Multilayer fusion drowning detection method and system, electronic equipment and storage medium
Through the multi-layer fusion drowning detection method, combined with supervised and unsupervised detection technology, the problems of high false alarm rate and untimely response in the existing technology are solved, and higher detection accuracy and response speed are achieved, ensuring the safety of swimmers.
Patent Information
- Application Number
- CN202411825863.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-04
AI Technical Summary
The existing drowning detection technology has problems such as high false alarm rate, untimely response, low detection accuracy and lack of robustness and authenticity, especially in complex underwater environments.
A multi-layer fusion drowning detection method is used to collect video images through the camera equipment, perform image pre-processing, supervised abnormality detection, vertical human body extraction, feature vector extraction and unsupervised abnormality detection, and finally make a fusion decision, and trigger an alarm when a drowning person is detected.
It improves the accuracy and response speed of drowning detection, enhances the robustness and flexibility of the system, ensures the detection effect in different environments, and improves the safety of swimmers.
Smart Images

Figure CN119763154A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing and computer vision technology, and in particular to a multi-layer fusion drowning detection method, system, electronic equipment and storage medium. Background Art
[0002] Drowning is a major life safety issue. Drowning incidents occur in an endless stream every year. How to reduce the occurrence of drowning accidents has become a problem that needs to be solved urgently in daily life. The original drowning detection technology mostly relies on sensors and manual monitoring. These methods have problems such as high false alarm rate and untimely response in practical applications. With the development of artificial intelligence technology, drowning detection methods based on image processing and computer vision have gradually attracted attention. However, under the interference of complex underwater environments (such as changes in illumination, water wave reflections, etc.), traditional drowning detection technologies based on computer vision have problems such as low detection accuracy, lack of robustness and authenticity of the detection method, and untimely response. In order to solve the above problems, the present invention provides a drowning detection method, device, storage medium and drowning detection warning system based on computer vision.
[0003] Existing drowning detection technologies mostly rely on sensors and manual monitoring. However, wearing sensors makes the wearer feel uncomfortable, has a low sense of experience, and has a high false alarm rate in practical applications. Although the manual monitoring method has high efficiency, the monitoring effect is easily affected by physical conditions, personal emotions and water surface environment, and has great safety hazards, and requires huge manpower costs. Existing drowning detection technology based on computer vision usually trains models based on normal and abnormal underwater data sets, and then detects abnormal drowning behavior in this supervised way. However, in reality, there are very few abnormal underwater data sets, and it is often necessary to imitate the actions of drowning people underwater to produce data sets. This method often lacks authenticity, the accuracy and robustness of the model are not high, and the model is generally complex. Drowning detection technology based on computer vision usually obtains images based on monitoring, and then uploads the data to the cloud for analysis and processing. However, this method results in the inability to timely alarm and process abnormal drowning behavior, poor real-time performance, and usually requires a good device network environment.
[0004] Therefore, there is an urgent need for a drowning detection method that can address the current problems of the drowning detection technology mentioned above to ensure the safety of swimmers. Summary of the invention
[0005] In order to solve the problems existing in the prior art, the present invention provides a multi-layer fusion drowning detection method, system, electronic device and storage medium, which collects video images of underwater swimmers in different environments and makes them into data sets, and uses the data sets for image enhancement, supervised and unsupervised model training. The video stream collected by the camera is subjected to image preprocessing, supervised anomaly detection, underwater vertical human body extraction, feature vector extraction, unsupervised anomaly detection in sequence according to the algorithm process deployed in the device, and finally a fusion decision is made. When a drowning person is detected according to the decision result, an alarm can be triggered to promptly notify the lifeguard to pay attention to the status of the swimming pool and ensure the safety of the swimmer, so as to improve the accuracy and response speed of drowning detection, and solve the problems mentioned in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solution: a multi-layer fusion drowning detection method, comprising the following steps:
[0007] S1. Image acquisition: obtaining real-time video target images of water areas through camera equipment;
[0008] S2, image preprocessing;
[0009] S3, supervised anomaly detection;
[0010] S4, vertical human body extraction;
[0011] S5, feature vector extraction;
[0012] S6, unsupervised anomaly detection;
[0013] S7, fusion decision: The supervised anomaly detection results and the unsupervised anomaly detection results are fused and analyzed, and the detection targets are divided into different safety categories, namely normal, drowning, and suspected drowning.
[0014] Preferably, in step S2, it specifically includes:
[0015] S201, firstly, performing median filtering on the acquired video target image to remove shot noise;
[0016] S202, performing Gaussian filtering on the image after median filtering to further smooth the image, thereby improving image quality.
[0017] Preferably, in step S3, the supervised anomaly detection refers to using the trained YOLOv8s model to identify and judge the target image, obtain the category and confidence score of the detected target by analysis, and judge whether the target has an abnormality; specifically, it includes:
[0018] S301, collecting swimming videos captured by underwater cameras, and extracting frames from them using OpenCV;
[0019] S302, performing image enhancement operations on contrast, brightness, and white balance on the image acquired in step S301;
[0020] S303, making the processed images into an underwater data set in the YOLO format required for model training, including a normal data set and a drowning data set;
[0021] S304, using the model weights pre-trained by YOLOv8s on the COCO dataset as the initial weights for training, training YOLOv8s through the normal dataset and the drowning dataset, and continuously adjusting the model parameters of YOLOv8s to obtain the final YOLOv8s model, i.e., the supervised drowning detection model;
[0022] S305, loading the trained YOLOv8s model from the local machine and initializing the YOLOv8s model;
[0023] S306, using the YOLOv8s model to predict the preprocessed target image and return the detection result results;
[0024] S307, obtain the prediction result from results and convert it into an array, in which each element represents the coordinate box, category and confidence information of a detected object; filter the category of interest, and in the array, filter out the detection results and confidence scores of category 0 and category 1, regard category 0 as normal, and category 1 as abnormal, so as to obtain the situation of supervised anomaly detection.
[0025] Preferably, in step S4, the vertical human body extraction refers to using a vertical human body extraction strategy to extract a list of nearly vertical human bodies that meet the drowning characteristic conditions, and construct an STC image, extracting images of vertical human body areas in three consecutive frames, and stacking them to effectively obtain human body spatiotemporal information; specifically including the following:
[0026] S401, setting a threshold, setting an aspect ratio threshold, used to determine whether the detection frame is a vertical human body;
[0027] S402, category judgment, traverse the input detection results, each detection result includes the detection box coordinate box, confidence conf and category cls, check whether the category cls of the detection box is 0 or 1, category 0 is normal, and category 1 is abnormal;
[0028] S403, calculating the aspect ratio, calculating the width width and height height of the detection box for class 0 and class 1, and then calculating the aspect ratio aspect_ratio;
[0029] S404, filter the detection frame. If the aspect ratio is greater than the set threshold, further check the position and area of the detection frame: the detection frame coordinate information (x1, y1, x2, y2), check whether the detection frame is within the left and right boundaries of the image, that is, whether x1 is greater than 20 and x2 is less than the image width minus 20. If the judgment is satisfied, further check whether the area of the detection frame is greater than or equal to 5000;
[0030] S405 saves the detection frame. If the detection frame meets the above conditions, its coordinate information (x1, y1, x2, y2) is saved in the vertical human body list and returned;
[0031] S406, constructing a human body space-time cube image STC, extracting images of vertical human body regions in three consecutive frames, and stacking them.
[0032] Preferably, in step S5, the feature vector extraction is to convert the STC image and then send it to a lightweight feature extraction network model FEN to extract the feature vector; specifically, it includes the following:
[0033] S501, loading and initializing the trained FEN model;
[0034] S502, convert the STC image: first convert the input image from BGR to RGB color space; then convert the RGB image into a tensor and perform normalization; secondly add a batch dimension to the tensor and move the tensor to the device GPU with the same model parameters;
[0035] S503, input the converted image into the trained FEN model, use the context manager to disable gradient calculation, perform forward propagation, and extract feature vectors;
[0036] S504: Move the feature vector from the GPU to the CPU, convert it into an array, and flatten it into a one-dimensional vector.
[0037] Preferably, in step S6, the following is specifically included:
[0038] S601, using a normal data set to train a One-Class SVM model and determine the feature space decision boundary;
[0039] S602, input the extracted feature vector into the One-Class SVM model, determine whether it is within the feature space boundary determined by the model and constructed by training the normal data set, and calculate whether the distance from the sample to the decision boundary is greater than a threshold, so as to determine whether it is an abnormal sample;
[0040] S603. According to the judgment result, an abnormal value of the unsupervised detection result is obtained, where an abnormal value of 0 indicates normal, and an abnormal value of 1 indicates abnormal.
[0041] Preferably, in step S7, the division method specifically includes the following:
[0042] For normal cls=0: if the unsupervised detection result abnormal value is 1, the label is "Suspicious" and the color is yellow; if the unsupervised detection result abnormal value is 0, the label is "Normal" and the color is green;
[0043] For anomaly cls=1: if the unsupervised detection result anomaly value is 1, the label is "Drowning" and the color is red; if the unsupervised detection result anomaly value is 0, the label is "Suspicious" and the color is yellow;
[0044] Consider green as a normal situation, yellow as a suspected drowning situation, and red as a drowning situation.
[0045] On the other hand, to achieve the above-mentioned purpose, the present invention also provides the following technical solution: a multi-layer fusion drowning detection system, comprising the following modules:
[0046] Image acquisition module: obtain real-time video target images of water areas through camera equipment;
[0047] Image preprocessing module;
[0048] Supervised anomaly detection module: Use the trained YOLOv8s model to identify and judge the target image, obtain the category and confidence score of the detected target through analysis, and determine whether the target has abnormal conditions;
[0049] Vertical human body extraction module: Use the vertical human body extraction strategy to extract a list of nearly vertical human bodies that meet the drowning feature conditions, construct an STC image, extract the images of the vertical human body area in three consecutive frames, and stack them to effectively obtain the human body's spatiotemporal information;
[0050] Feature vector extraction module: converts the STC image and then sends it to the lightweight feature extraction network model FEN to extract feature vectors;
[0051] Unsupervised anomaly detection module;
[0052] Fusion decision module: The supervised anomaly detection results and the unsupervised anomaly detection results are fused and analyzed, and the detection targets are divided into different safety categories, namely normal, drowning, and suspected drowning.
[0053] On the other hand, to achieve the above-mentioned purpose, the present invention also provides the following technical solution: an electronic device, the electronic device comprising: a processor; and a memory for storing one or more programs;
[0054] When the one or more programs are executed by a processor, the processor is caused to execute the multi-layer fusion drowning detection method.
[0055] On the other hand, to achieve the above-mentioned purpose, the present invention also provides the following technical solution: a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the multi-layer fusion drowning detection method when executed by a processor.
[0056] The beneficial effects of the present invention are:
[0057] 1) Enhanced accuracy: By combining the high-precision target detection and recognition of the Yolov8s model and the anomaly detection capability of the One-Class SVM model, the system can achieve more accurate drowning detection and reduce false alarms and missed alarms.
[0058] 2) Fast response speed: The real-time detection and recognition capabilities of the Yolov8s model combined with the simplified calculation process of the pruned and quantized One-Class SVM model ensure that the system can respond and detect drowning incidents quickly and trigger the alarm mechanism in time.
[0059] 3) Multi-level security assurance: Combining Yolov8s and One-Class SVM models, through multi-layer fusion partitioning detection mechanism and image preprocessing method, the detection effect of the system in different environments is ensured, which improves the safety and safety management level of the swimming pool.
[0060] 4) High robustness: The combination of the two models enables the system to maintain efficient detection in various complex environments. Yolov8s provides powerful target detection capabilities, while the One-Class SVM model enhances the robustness of the system in anomaly detection.
[0061] 5) High flexibility: The system can be adjusted and optimized according to specific needs. The combination of Yolov8s and One-Class SVM model provides a variety of technical solutions to meet the needs of different application scenarios and improve the adaptability and scalability of the system.
[0062] 6) High degree of automation: From image acquisition, preprocessing to anomaly detection, the whole process is automated without manual intervention, which improves the practicality and convenience of the system. The drowning detection method provided by the present invention has achieved significant technological progress through high accuracy, fast response speed, high robustness and flexibility, high degree of automation, multi-level safety assurance and wide applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 It is a flow chart of a multi-layer fusion division drowning detection method according to an embodiment of the present invention;
[0064] Figure 2 Schematic diagram of a supervised drowning anomaly detection process in an embodiment of the present invention;
[0065] Figure 3 A schematic diagram of a vertical human body extraction strategy flow in an embodiment of the present invention;
[0066] Figure 4 Schematic diagram of the network structure of a feature extraction network (FEN) in an embodiment of the present invention;
[0067] Figure 5 A schematic diagram of the network structure of the ShuffleBlock block in the feature extraction network in an embodiment of the present invention;
[0068] Figure 6 Schematic diagram of the workflow of unsupervised drowning anomaly detection in an embodiment of the present invention;
[0069] Figure 7 It is a schematic diagram of the modules of the multi-layer fusion-divided drowning detection system in an embodiment of the present invention;
[0070] Figure 8 This is a schematic diagram of the structure of an electronic device in an embodiment of the present invention;
[0071] In the figure, 110-image acquisition module; 120-image preprocessing module; 130-supervised anomaly detection module; 140-vertical human body extraction module; 150-feature vector extraction module; 160-unsupervised anomaly detection module; 170-fusion decision module; 210-processor; 220-storage. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] like Figure 1 As shown, a multi-layer fusion division drowning detection method provided by an embodiment of the present invention includes:
[0074] S1, image acquisition, obtains real-time video images of the water area through camera equipment.
[0075] S2, image preprocessing, denoises the video image using relatively low-complexity median filtering and Gaussian filtering methods to improve image quality.
[0076] S3, supervised anomaly detection, uses the accelerated and trained YOLOv8s model to identify and judge the image, and judges whether the target has abnormal conditions by analyzing the detection category and confidence score.
[0077] S4, vertical human body extraction, uses the vertical human body extraction strategy to extract a list of nearly vertical human bodies that meet the drowning feature conditions, and constructs an STC image, extracts the images of the vertical human body area in three consecutive frames, and stacks them.
[0078] S5, feature vector extraction, uses a lightweight feature extraction network (FEN, Feature Extraction Network) to extract feature vectors of approximate vertical human bodies. The STC image is converted and sent to the model to extract feature vectors.
[0079] S6, unsupervised anomaly detection, uses normal samples to train the One-Class SVM (Support Vector Machine) model to determine the decision boundary, that is, the feature space depicted by the normal samples. Based on the One-Class SVM model and the feature vector extracted from the vertical human body, the feature is input into the model to determine whether it is in the feature space determined by the model and constructed by the normal data set training, and calculates whether its distance to the boundary of the feature space determined by the model is greater than the threshold, thereby determining whether the feature is abnormal.
[0080] S7, comprehensive decision, combines the results of supervised anomaly detection and unsupervised anomaly detection for fusion decision. The final decision results are divided into three types: Normal (green), i.e. normal situation, Suspicious (yellow), i.e. suspected drowning situation, and Drowning (red), i.e. drowning situation.
[0081] Further, in S1, image acquisition is performed by acquiring underwater image videos in real time through a camera, and then transmitting them to, for example, an AI device for preprocessing.
[0082] Further, in S2, the image preprocessing process is:
[0083] S201, firstly, the collected image is subjected to median filtering to remove shot noise (such as salt and pepper noise), and edge information can be retained during the processing;
[0084] S202, performing Gaussian filtering on the image after median filtering to effectively smooth the image, reduce high-frequency noise, and remove blurring effects caused by turbid water.
[0085] Furthermore, S3 specifically includes:
[0086] The training of supervised anomaly detection models mainly includes the following points:
[0087] 1) Collect swimming videos captured by underwater cameras and extract frames using OpenCV;
[0088] 2) Perform image enhancement operations such as contrast, brightness, and white balance on the acquired image;
[0089] 3) The processed images are made into underwater datasets in YOLO format required for model training, namely normal datasets and drowning datasets, and the datasets are divided into training set, test set and validation set;
[0090] 4) Use the model weights pre-trained by YOLOv8s on the COCO dataset as the initial weights for training, and perform training on the normal dataset and drowning dataset of the training set. According to the test results of the test set, continuously adjust the model parameters of YOLOv8s to obtain the final YOLOv8s model, i.e., the supervised drowning detection model.
[0091] like Figure 2 As shown, the process of supervised anomaly detection is:
[0092] S301, load the trained YOLOv8s model from the local and initialize the YOLOv8s model.
[0093] S302, model prediction, uses the YOLOv8s model to predict the preprocessed frame image and returns the detection results.
[0094] S303, parse the detection results, obtain the prediction results from results and convert them into an array, in which each element represents the coordinate box, category and confidence information of a detected object.
[0095] S304, filter the concerned category, and filter out the detection results and confidence scores of category 0 (normal) and category 1 (abnormal) in the array, so as to obtain the supervised anomaly detection situation.
[0096] Furthermore, in S4, vertical human body extraction is specifically as follows:
[0097] After filtering out the human detection results of category 0 (normal) and category 1 (abnormal) in the array, it is necessary to use the vertical human extraction strategy to further exclude the human detection frames of category 0 and category 1 in the queue frame images, exclude the human detection frames that do not match the drowning characteristics, and retain the nearly vertical human detection frames of category 0 and category 1 that are similar to the drowning characteristics, so as to reduce the calculation of subsequent parameters and speed up the detection speed.
[0098] like Figure 3 As shown in the figure, the vertical human body extraction strategy process is:
[0099] S401, setting a threshold, setting an aspect ratio threshold (threshold), used to determine whether the detection frame is a vertical human body;
[0100] S402, category judgment, traverse the input detection results, each detection result includes the detection box coordinates (box), confidence (conf) and category (cls), check whether the category cls of the detection box is 0 or 1 (category 0 is normal, category 1 is abnormal);
[0101] S403, calculating the aspect ratio, calculating the width (width) and height (height) of the detection box for class 0 and class 1, and then calculating the aspect ratio (aspect_ratio);
[0102] S404, filter the detection frame. If the aspect ratio is greater than the set threshold, further check the position and area of the detection frame: the detection frame coordinate information (x1, y1, x2, y2), check whether the detection frame is within the left and right boundaries of the image, that is, whether x1 is greater than 20 and x2 is less than the image width minus 20. If the judgment is satisfied, further check whether the area of the detection frame is greater than or equal to 5000 (the above numerical parameters can be adjusted according to the specific situation);
[0103] S405 saves the detection frame. If the detection frame meets the above conditions, its coordinate information (x1, y1, x2, y2) is saved in the vertical human body list and returned;
[0104] S406, constructing a human body space-time cube image (STC), constructing an STC image, extracting images of vertical human body regions in three consecutive frames, and stacking them.
[0105] Further in S5, the specific detection process of feature vector extraction is as follows:
[0106] S501, training the FEN network. Since the data set is quite different from the training data set of the pre-trained model, the model needs to be fine-tuned. This can better adapt to underwater application scenarios. According to the pre-set ShuffeNetV2 network structure, the ShuffleNetV2 model is trained on the given training data set, and finally the trained FEN network is obtained;
[0107] Among them, the model structure of the FEN feature extraction network is as follows: Figure 4 Shown
[0108] The FEN network structure adopts the Shufflenetv2 network structure and has made some improvements. The overall network architecture consists of 2 convolutional layers, 3 maximum pooling layers and 2 ShuffleBlock modules.
[0109] First stage:
[0110] Convolutional layer (Conv1): The number of input channels is 3 (RGB image), the number of output channels is 24, and 3x3 convolution is used with a stride of 2.
[0111] Normalization layer (IN1): Instance normalization layer (InstanceNorm2d), normalizing 24 channels.
[0112] Activation function (Lrelu1): Leaky ReLU activation function.
[0113] Convolutional layer (Conv2): 3x3 convolution, 96 input channels, 192 output channels, and stride 2.
[0114] Normalization layer (IN2): Instance normalization layer, normalizing 192 channels.
[0115] Activation function (Lrelu2): Leaky ReLU activation function.
[0116] Max pooling (maxpool1): max pooling layer with a pooling window of 2x2 and a stride of 2.
[0117] Phase 2:
[0118] Shuffle_block1 and shuffle_block2: Two ShuffleBlocks, which perform channel shuffling and deep convolution operations respectively, to facilitate faster and more accurate image classification and feature vector extraction. The ShuffleBlock network structure is as follows: Figure 5 shown.
[0119] The third stage: fully connected layer, the number of input features is 2, and the number of output features is the number of categories (num_classes).
[0120] S502, loading and initializing the trained FEN model;
[0121] S503, image preprocessing, according to the defined image preprocessing transformation, first convert the input image from BGR to RGB color space; then convert the RGB image into a tensor and perform normalization; secondly, add a batch dimension to the tensor and move the tensor to the same device (CPU or GPU) as the model parameters;
[0122] S504, input into the trained FEN model to extract feature vectors, use the context manager to disable gradient calculation, perform forward propagation, and extract feature vectors;
[0123] S505, move the feature vector from the GPU to the CPU, convert it into an array, and flatten it into a one-dimensional vector.
[0124] Further, if Figure 6 As shown in Figure 2, the unsupervised anomaly detection process is:
[0125] S601, loading the previously saved One-Class SVM model and determining the feature space decision boundary;
[0126] S602, input the extracted features into the One-Class SVM model to determine whether they are within the boundary determined by the model and constructed by training the normal data set, and calculate whether the distance from the sample to the decision boundary is greater than the threshold, so as to determine whether it is an anomaly;
[0127] S603, according to the judgment result, obtain the abnormal value of the unsupervised detection result, where the abnormal value is 0, indicating normal, and the abnormal value is 1, indicating abnormal.
[0128] If the feature is in the feature space formed by normal behavior training, that is, the detection result is greater than 0 or equal to 1, it indicates normal and the outlier is set to 0; if the feature is not in the feature space formed by normal behavior training, that is, the detection result is less than 0 or equal to -1, it indicates abnormality.
[0129] In order to improve the accuracy of detection, if the detection result is less than 0 or equal to -1, the distance from the feature vector to the boundary of the feature space is further determined. If it is greater than the set threshold, the outlier is set to 1, otherwise, the outlier is set to 0.
[0130] The One-Class SVM model training process is as follows:
[0131] 1) Collect and create underwater data sets: extract pictures or video frames of normal behavior, and divide the data sets into training sets and test sets. The training set contains normal behavior samples, and the test set can contain normal and abnormal behaviors (such as drowning behavior);
[0132] 2) Image preprocessing: median filtering and Gaussian filtering are used to denoise the image;
[0133] 3) Vertical human body extraction: extracting approximately vertical human bodies that meet the characteristics of drowning from the image;
[0134] 4) Feature extraction: Extract the vertical human feature vector from each frame of the image
[0135] 5) Model training: Use the One-Class SVM model to train the feature vector and generate a model that describes the normal behavior feature space.
[0136] Among them, One-Class SVM (Support Vector Machine) is an unsupervised learning algorithm for anomaly detection, which is particularly suitable for processing scenarios with a single category (normal samples). Its main idea is to construct a "boundary" based on the normal samples contained only in the training data, so as to distinguish normal samples from abnormal samples (that is, samples not within the boundary are considered abnormal).
[0137] The core idea of One-Class SVM is to find a hyperplane or boundary to contain most normal samples in a closed area, while marking points far away from the area as abnormal.
[0138] During the training phase, most of the training data are normal samples. By learning the distribution of these normal samples, One-Class SVM attempts to find the minimum boundary of the data and standardizes the normal samples to improve the performance of the model.
[0139] During the testing phase, all test samples are input into the One-Class SVM model. If the sample is within the boundary, it is considered normal; if it exceeds the boundary, it is marked as abnormal.
[0140] Among them, the training of One-Class SVM adopts the following optimization objectives to obtain the minimum margin:
[0141]
[0142] Where w is the normal vector of the decision boundary. i is a slack variable used to allow some normal samples to fall outside the boundary (i.e., soft boundary), by adjusting w and ε iTo find an ideal decision boundary. ρ is the bias, which determines the specific location of the boundary. v is a hyperparameter used to control the tightness of the boundary and the proportion of allowed anomalies, similar to the control parameter of the error rate. n is the number of training samples.
[0143] Among them, the One-Class SVM using the Gaussian kernel (RBF kernel) suitable for complex distributed nonlinear data maps the data, i.e., the feature vector, to a high-dimensional space so that a suitable boundary can be found in the complex distribution. The use of the Gaussian kernel allows the model to still form a reasonable decision boundary when facing complex data distribution. The formula of the Gaussian kernel is:
[0144] K(x i ,x j ) = exp(-γ||x i -x j || 2 ) (2)
[0145] Among them, γ is a hyperparameter of the kernel function, which controls the width of the kernel. A larger γ makes the model pay more attention to the similarity of local data points.
[0146] Among them, for the test sample x, the decision function is:
[0147]
[0148] in, It maps the original data to the feature vector of high-dimensional space through the kernel function. When f(x)>0, the test result is equal to 1, which is judged as a normal sample; when f(x)<0, the test result is equal to -1, which is judged as an abnormal sample.
[0149] Furthermore, in S7, a fusion decision is made by combining the results of the supervised anomaly detection and the unsupervised anomaly detection to classify the human body in the detection frame into one of drowning, normal, and suspected drowning.
[0150] The fusion decision process is:
[0151] S701, traverse the supervised anomaly detection results and the unsupervised anomaly detection results.
[0152] S702: The supervised anomaly detection results and the unsupervised anomaly detection results are fused and analyzed, and the detection targets are divided into different safety categories, namely normal, drowning, and suspected drowning. The specific fusion classification method is as follows:
[0153] For normal (cls=0): if the unsupervised detection result anomaly value is 1, the label is "Suspicious" and the color is yellow; if the unsupervised detection result anomaly value is 0, the label is "Normal" and the color is green.
[0154] For anomalies (cls=1): if the unsupervised detection result anomaly value is 1, the label is "Drowning" and the color is red; if the unsupervised detection result anomaly value is 0, the label is "Suspicious" and the color is yellow.
[0155] There are three final decision results: Normal (green), i.e. normal situation, Suspicious (yellow), i.e. suspected drowning situation, and Drowning (red), i.e. drowning situation. Different response measures can be implemented according to different decision results.
[0156] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a multi-layer fusion drowning detection system, which can implement the functions provided by the above method embodiment, such as Figure 7 As shown, the system includes the following modules:
[0157] Image acquisition module 110: acquires real-time video target images of water areas through camera equipment;
[0158] Image preprocessing module 120;
[0159] Supervised anomaly detection module 130: uses the trained YOLOv8s model to identify and judge the target image, obtains the category and confidence score of the detected target through analysis, and determines whether the target has an abnormality;
[0160] Vertical human body extraction module 140: uses a vertical human body extraction strategy to extract a list of nearly vertical human bodies that meet the drowning characteristic conditions, constructs an STC image, extracts images of vertical human body regions in three consecutive frames, and stacks them to effectively obtain human body temporal and spatial information;
[0161] Feature vector extraction module 150: converts the STC image and then sends it to the lightweight feature extraction network model FEN to extract feature vectors;
[0162] Unsupervised anomaly detection module 160;
[0163] Fusion decision module 170: performs fusion analysis on the supervised anomaly detection results and the unsupervised anomaly detection results, and divides the detection targets into different safety categories, namely normal, drowning, and suspected drowning.
[0164] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides an electronic device, such as Figure 8 As shown, the device includes: a processor 210; and a memory 220, for storing one or more programs;
[0165] When the one or more programs are executed by the processor 210, the processor is enabled to perform the multi-layer fusion drowning detection method.
[0166] The main structure of the electronic device includes a camera, an embedded AI device, an LED light bar, a waterproof casing and a 12V power supply.
[0167] The camera is used to collect and acquire underwater video stream data. It adopts Sony MIX219 with a resolution of 800W.
[0168] The embedded AI device is used to carry and run the drowning detection algorithm. The drowning detection algorithm run by the AI device is used to determine whether the swimmer is drowning. The embedded AI device uses the RK3568 artificial intelligence development board based on Rockchip. The embedded AI device is connected to the camera via a data cable and transmits information.
[0169] The LED light bar is used to improve the imaging effect of the camera in low light conditions, and also provides necessary lighting for the swimming pool at night. It adopts 12v 2835 type SMD light bar, and the LED light bar is connected to the 12V power supply.
[0170] The waterproof housing is used to protect the embedded AI device from the interference of the underwater environment and provide a safe operating environment. The waterproof housing has a diameter of 180mm and a height of 61mm. There are many through holes on one side for placing the camera and LED light bar, which are sealed and covered by a panel made of glass. There are buckles on the other side for fixing the detection device to the pool wall.
[0171] The 12v power supply is used to output power to the embedded AI device and the LED light strip. The 12v power supply device is connected to the positive and negative poles of the embedded AI device and the LED light strip.
[0172] In addition, to ensure its waterproofness and integrity, the interior of the detection device is completely filled with waterproof silicone rubber. We use a reserved unshielded twisted pair network cable to communicate with the detection device. The drowning detection device can carry and run the drowning detection algorithm proposed in this paper on an embedded AI device, and can complete the drowning detection work without uploading it to a server.
[0173] The multi-layer fusion drowning detection method specifically includes the following:
[0174] Image acquisition: obtain real-time video target images of water areas through camera equipment; image preprocessing; supervised anomaly detection: vertical human body extraction; feature vector extraction; unsupervised anomaly detection; fusion decision: fuse and analyze the supervised anomaly detection results and the unsupervised anomaly detection results, and divide the detection targets into different safety categories, namely normal, drowning, and suspected drowning.
[0175] Based on the same inventive concept as the above method embodiment, the embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 210, the multi-layer fusion drowning detection method is implemented.
[0176] The multi-layer fusion drowning detection method specifically includes the following:
[0177] Image acquisition: obtain real-time video target images of water areas through camera equipment; image preprocessing; supervised anomaly detection: vertical human body extraction; feature vector extraction; unsupervised anomaly detection; fusion decision: fuse and analyze the supervised anomaly detection results and the unsupervised anomaly detection results, and divide the detection targets into different safety categories, namely normal, drowning, and suspected drowning.
[0178] The advantages and positive effects of the technical solution to be protected by the present invention are:
[0179] First, the current drowning detection method is usually based on a supervised drowning detection method. The drowning behavior characteristics are extracted by simulating drowning events, and the status of the swimmer is classified by a supervised classification method, which leads to the lack of robustness of the detection method and the detection method is relatively complex. In addition, in view of the lack of actual drowning video data for drowning detection, the relatively quiet early stage of drowning, and the lack of real-time drowning detection, which cannot be discovered and warned in time, the present invention integrates the supervised drowning detection method and the unsupervised drowning detection method, and applies this method to the edge terminal detection device to improve the accuracy, robustness, flexibility and real-time performance of the drowning detection method.
[0180] The specific description is as follows:
[0181] 1. Fusion drowning detection method
[0182] (1) A combined supervised and unsupervised drowning detection method is used. The supervised drowning detection based on the Yolov8s model and the unsupervised drowning detection based on the One-Class SVM model are used to combine the detection results of the two and make a comprehensive judgment on the detection results. By combining the high-precision target detection of the Yolov8s model and the anomaly detection capability of the One-Class SVM model, the system can achieve more accurate drowning detection and reduce the false alarm and missed alarm rates.
[0183] (2) The combination of the two models enables the system to maintain efficient detection in various complex environments. Yolov8s provides powerful target detection capabilities, while the One-Class SVM model enhances the system's robustness in anomaly detection.
[0184] (3) Combining Yolov8s and One-Class SVM models, through multiple detection mechanisms and image preprocessing methods, the detection effect of the system in different environments is ensured, thereby improving security.
[0185] (4) The real-time detection capability of the Yolov8s model is combined with the simplified calculation process of One-Class SVM using Gaussian kernel, and the entire system model is pruned and quantized, ensuring that the system can respond quickly and detect drowning incidents and trigger the alarm mechanism in time.
[0186] 2. Use a more efficient drowning detection model
[0187] (1) After extensive optimization and training, the Yolov8s model can accurately identify and detect target objects in complex environments such as different lighting conditions and underwater environmental changes. Its high-precision detection capability makes it particularly suitable for scenarios that require high reliability, such as drowning detection.
[0188] (2) The Yolov8s model supports a variety of target detection tasks, can detect and identify multiple targets simultaneously, and generate bounding boxes and category labels for each target. It can also be adjusted and optimized according to specific application requirements, can work stably in various harsh environments, and has high robustness and flexibility.
[0189] (3) As a single-stage target detection algorithm, the Yolov8s model can complete the detection task in a very short time. It can not only ensure the implementation of video processing requirements, but also detect drowning incidents in time and trigger alarms, greatly reducing the rescue response time.
[0190] (4) YOLOv8s improves the model's recognition accuracy of target categories by optimizing the network structure and improving the loss function. It can effectively identify different objects in the image and accurately classify them. Whether it is a complex scene or the similarity between targets, YOLOv8s can maintain a high recognition accuracy.
[0191] (5) One-Class SVM is an anomaly detection method based on support vector machine. It distinguishes normal samples from abnormal samples by establishing a hyperplane or boundary. One-Class SVM attempts to contain most normal samples within a closed boundary, and all samples outside the boundary are considered abnormal.
[0192] This method is suitable for data in complex, high-dimensional space, especially when there are no clear abnormal samples, and it can be classified according to the distribution of normal samples.
[0193] (6) One-Class SVM is suitable for complex, high-dimensional, nonlinearly distributed data, especially when the sample distribution does not clearly show a certain statistical distribution characteristics. By selecting an appropriate kernel function (such as the RBF kernel), linear and nonlinear distribution problems can be effectively handled. For diverse and irregular drowning behavior characteristics (such as the complexity of underwater posture and human movement), One-Class SVM has higher flexibility.
[0194] (7) One-Class SVM has strong generalization and robustness, and is suitable for handling anomaly detection problems of various distributions, especially when the data is nonlinearly distributed or complexly distributed. Since it does not rely on specific distribution assumptions, One-Class SVM has high robustness in detecting abnormal behavior and is suitable for complex and changeable scenarios such as drowning detection.
[0195] Second, the original method of using sensors and manual monitoring detects drowning by monitoring the physiological characteristics of swimmers or the time spent in the water. However, wearing sensors usually makes swimmers feel uncomfortable, and the detection accuracy is easily affected by the actual movements of the swimmers, resulting in poor detection accuracy and practicality. The manual monitoring method requires a lot of manpower, and manual monitoring is easily disturbed by personal emotions, water surface environment, etc., and the response is not timely when drowning occurs. Therefore, a drowning detection method based on computer vision is used to avoid the limitations of wearable sensor equipment, and the drowning detection algorithm can be applied to drowning detection in different complex underwater environments. Compared with the traditional drowning detection method mentioned above, it has higher flexibility, higher convenience and higher automation level, and greatly improves the safety management level of the swimming pool.
[0196] The specific description is:
[0197] (1) The system can be adjusted and optimized according to specific needs. The combination of Yolov8s and One-Class SVM model provides a variety of technical solutions to meet the needs of different application scenarios and improve the adaptability and scalability of the system.
[0198] (2) The entire detection process is highly automated, from image acquisition, preprocessing, anomaly detection to alarm triggering, without the need for human intervention, which improves the practicality of the system.
[0199] (3) The model is pruned and quantized and deployed on edge devices. The system is modular and edge-based, easy to install and maintain, and suitable for various scenarios such as swimming pools.
[0200] (4) Underwater drowning detection and warning are carried out through a combination of supervised and unsupervised methods, and this method is applied to edge terminals, which greatly reduces the manual management cost of the swimming pool. In addition, it is combined with manual detection to greatly improve the safety management level of the swimming pool and greatly protect the life and property of swimmers.
[0201] Third, One-Class SVM (Support Vector Machine) is an unsupervised learning algorithm for anomaly detection, which is particularly suitable for processing scenarios with a single category (normal samples). The main idea is to construct a "boundary" based on the normal samples contained only in the training data, so as to distinguish normal samples from abnormal samples (that is, samples not within the boundary are considered abnormal). The core idea of One-Class SVM is to find a hyperplane or boundary to contain most normal samples in a closed area, and mark points far away from the area as abnormal. However, in anomaly detection, there are usually many abnormal features close to the boundary of the feature space. According to underwater environment experiments, these features are usually mostly non-abnormal features, which will cause instability and reduced accuracy of the model judgment results. In order to make the output of the model judgment results more stable, this design proposes a stabilization method based on distance threshold.
[0202] The specific description is as follows:
[0203] That is, if the One-Class SVM model determines that the input feature is an abnormal feature, it usually does not output the judgment result immediately. It calculates the distance from the input feature to the boundary of the feature space to determine whether the calculated distance is greater than the pre-set distance threshold. If it is greater than the threshold, the output judgment result is abnormal, otherwise the output judgment result is normal. The distance threshold is obtained through repeated experiments on a large number of normal and abnormal behaviors. This method can further improve the stability of the model's anomaly detection.
[0204] Fourth, the target detection and recognition functions of YOLOv8s have been verified in many fields, including face recognition, object recognition, action recognition, etc. Whether in static images or dynamic videos, YOLOv8s can provide stable and efficient target recognition services. However, in view of the environmental characteristics of the swimming pool and the specific requirements of drowning detection, such as insufficient light, unclear water quality, and complex background interference, these factors will affect the target detection and recognition performance of YOLOv8s, making the target detection and recognition functions of YOLOv8s challenging. According to the above-mentioned swimming pool environment characteristics and challenges, this drowning detection method designs and adopts a specific model training and detection method system to reduce the underwater environmental interference of the swimming pool and improve the target detection and recognition capabilities.
[0205] The specific description is:
[0206] (1) Model training and optimization for specific scenarios
[0207] In order to improve the performance of YOLOv8s in underwater environments, a real underwater personnel image dataset is collected and produced for model training. This dataset should include personnel images under various underwater conditions (such as different lighting, turbidity, depth), and the model parameters are continuously adjusted through training sets, test sets, and validation sets to help the model learn and adapt to the characteristics of the underwater environment, detect and identify specific targets, and improve the model's specific target detection and recognition capabilities.
[0208] (2) Data enhancement
[0209] During the training process, data enhancement techniques are used, such as simulating different underwater lighting conditions, color distortion, blur, etc., to further improve the generalization ability of YOLOv8s, so that it can perform better in real underwater environments and have stronger target detection and recognition capabilities.
[0210] (3) Image preprocessing and model optimization
[0211] Underwater images are usually low-resolution and noisy, so the YOLOv8s model needs to be specifically optimized, using lower-complexity median and Gaussian filters and integrating a denoising preprocessing step.
[0212] The present invention has great application value in complex and harsh environments where safety requirements are relatively high and edge devices are needed for drowning monitoring. When the underwater environment is relatively complex, when a large amount of manual intervention is required for drowning monitoring in a swimming pool, when the accuracy, real-time performance, flexibility and practicality of the drowning detection method are insufficient, and when the safety management level of the swimming pool does not meet the requirements, the use of this system can make swimming pool drowning detection and early warning more convenient and safer.
[0213] According to current trends and research analysis, swimming pool drowning incidents are occurring more and more frequently. More effective and real-time drowning detection and warning methods will greatly improve the level of swimming pool safety management and better ensure the safety of swimmers.
[0214] In several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus and method embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0215] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0216] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or partly contributed to the prior art or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk. It should be noted that, in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.
[0217] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0218] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0219] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0220] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0221] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-layer fusion drowning detection method, characterized in that: The steps include: S1. Image acquisition: obtaining real-time video target images of water areas through camera equipment; S2, image preprocessing; S3, supervised anomaly detection; S4, vertical human body extraction; S5, feature vector extraction; S6, unsupervised anomaly detection; S7, fusion decision: The supervised anomaly detection results and the unsupervised anomaly detection results are fused and analyzed, and the detection targets are divided into different safety categories, namely normal, drowning, and suspected drowning.
2. The multi-layer fusion drowning detection method according to claim 1, characterized in that: In step S2, it specifically includes: S201, firstly, performing median filtering on the acquired video target image to remove shot noise; S202, performing Gaussian filtering on the image after median filtering to further smooth the image, thereby improving image quality.
3. The multi-layer fusion drowning detection method according to claim 1, characterized in that: In step S3, the supervised anomaly detection refers to using the trained YOLOv8s model to identify and judge the target image, obtain the category and confidence score of the detected target through analysis, and judge whether the target has an abnormality; specifically, it includes: S301, collecting swimming videos captured by underwater cameras, and extracting frames from them using OpenCV; S302, performing image enhancement operations on contrast, brightness, and white balance on the image acquired in step S301; S303: The processed images are made into an underwater dataset in YOLO format required for model training, including a normal dataset and a drowning dataset. S304, using the model weights pre-trained by YOLOv8s on the COCO dataset as the initial weights for training, training YOLOv8s through the normal dataset and the drowning dataset, and continuously adjusting the model parameters of YOLOv8s to obtain the final YOLOv8s model, i.e., the supervised drowning detection model; S305, loading the trained YOLOv8s model from the local machine and initializing the YOLOv8s model; S306, using the YOLOv8s model to predict the preprocessed target image and return the detection result results; S307, obtain the prediction result from results and convert it into an array, in which each element represents the coordinate box, category and confidence information of a detected object; filter the category of interest, and in the array, filter out the detection results and confidence scores of category 0 and category 1, regard category 0 as normal, and category 1 as abnormal, so as to obtain the situation of supervised anomaly detection.
4. The multi-layer fusion drowning detection method according to claim 1, characterized in that: In step S4, the vertical human body extraction refers to using the vertical human body extraction strategy to extract a list of nearly vertical human bodies that meet the drowning characteristic conditions, and construct an STC image, extract the images of the vertical human body area in three consecutive frames, and stack them to effectively obtain the human body's spatiotemporal information; specifically, it includes the following: S401, setting a threshold, setting an aspect ratio threshold, used to determine whether the detection frame is a vertical human body; S402, category judgment, traverse the input detection results, each detection result includes the detection box coordinate box, confidence conf and category cls, check whether the category cls of the detection box is 0 or 1, category 0 is normal, and category 1 is abnormal; S403, calculating the aspect ratio, calculating the width width and height height of the detection box for class 0 and class 1, and then calculating the aspect ratio aspect_ratio; S404, filter the detection frame. If the aspect ratio is greater than the set threshold, further check the position and area of the detection frame: the detection frame coordinate information (x1, y1, x2, y2), check whether the detection frame is within the left and right boundaries of the image, that is, whether x1 is greater than 20 and x2 is less than the image width minus 20. If the judgment is satisfied, further check whether the area of the detection frame is greater than or equal to 5000; S405 saves the detection frame. If the detection frame meets the above conditions, its coordinate information (x1, y1, x2, y2) is saved in the vertical human body list and returned; S406, constructing a human body space-time cube image STC, extracting images of vertical human body regions in three consecutive frames, and stacking them.
5. The multi-layer fusion drowning detection method according to claim 1, characterized in that: In step S5, the feature vector extraction is to convert the STC image and then send it to the lightweight feature extraction network model FEN to extract the feature vector; specifically, it includes the following: S501, loading and initializing the trained FEN model; S502, convert the STC image: first convert the input image from BGR to RGB color space; then convert the RGB image into a tensor and perform normalization; secondly add a batch dimension to the tensor and move the tensor to the device GPU with the same model parameters; S503, input the converted image into the trained FEN model, use the context manager to disable gradient calculation, perform forward propagation, and extract feature vectors; S504: Move the feature vector from the GPU to the CPU, convert it into an array, and flatten it into a one-dimensional vector.
6. The multi-layer fusion drowning detection method according to claim 1, characterized in that: In step S6, the specific steps include: S601, using a normal data set to train a One-Class SVM model and determine the feature space decision boundary; S602, input the extracted feature vector into the One-Class SVM model, determine whether it is within the feature space boundary determined by the model and constructed by training the normal data set, and calculate whether the distance from the sample to the decision boundary is greater than a threshold, so as to determine whether it is an abnormal sample; S603. According to the judgment result, an abnormal value of the unsupervised detection result is obtained, where an abnormal value of 0 indicates normal, and an abnormal value of 1 indicates abnormal.
7. The multi-layer fusion drowning detection method according to claim 1, characterized in that: In step S7, the division method specifically includes the following: For normal cls=0: if the unsupervised detection result abnormal value is 1, the label is "Suspicious" and the color is yellow; if the unsupervised detection result abnormal value is 0, the label is "Normal" and the color is green; For anomaly cls=1: if the unsupervised detection result anomaly value is 1, the label is "Drowning" and the color is red; if the unsupervised detection result anomaly value is 0, the label is "Suspicious" and the color is yellow; Consider green as a normal situation, yellow as a suspected drowning situation, and red as a drowning situation.
8. A system according to the multi-layer fusion drowning detection method according to any one of claims 1 to 7, characterized in that: Includes the following modules: Image acquisition module (110): acquires real-time video target images of water areas through a camera device; Image preprocessing module (120); Supervised anomaly detection module (130): uses the trained YOLOv8s model to identify and judge the target image, obtains the category and confidence score of the detected target through analysis, and determines whether the target has an abnormality; A vertical human body extraction module (140): uses a vertical human body extraction strategy to extract a list of nearly vertical human bodies that meet the drowning characteristic conditions, constructs an STC image, extracts images of vertical human body regions in three consecutive frames, and stacks them to effectively obtain human body temporal and spatial information; Feature vector extraction module (150): converts the STC image and then sends it to a lightweight feature extraction network model FEN to extract feature vectors; Unsupervised anomaly detection module (160); Fusion decision module (170): performs fusion analysis on the supervised anomaly detection results and the unsupervised anomaly detection results, and divides the detection targets into different safety categories, namely normal, drowning, and suspected drowning.
9. An electronic device, characterized in that: The electronic device comprises: a processor (210); and a memory (220) for storing one or more programs; When the one or more programs are executed by the processor (210), the processor is caused to perform the multi-layer fusion drowning detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by the processor (210), the multi-layer fusion drowning detection method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Near-drowning behavior detection method based on support vector machine
CN103413114A
Fall detection method and device, and computer readable storage medium
CN113657150A
Drowning detection method and device based on unsupervised anomaly detection
CN113887383A
Fall detection method and device, electronic equipment and storage medium
CN116898425A
Cited By
Change detection method and system
CN121686293A
DIP plug-in AVI over-killing reduction and efficiency improvement system and method, and storage medium
CN121746811A