Method for detecting small-size floating objects on water surface
By using image processing technology and deep learning algorithms to detect floating objects on the water surface, the problems of low detection efficiency and low accuracy in the existing technology are solved, and real-time monitoring and precise management of large-area water areas are achieved.
Patent Information
- Application Number
- CN202510067257.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-06
AI Technical Summary
The existing methods for detecting small-target floating objects on the water surface have problems such as low detection efficiency, low accuracy, and difficulty in monitoring and handling floating objects in large areas of water.
An automated water surface small-target floating object detection method is adopted based on image processing technology and deep learning algorithms, including image preprocessing, non-local attention mechanism feature extraction, combined convolution processing, feature fusion at different levels, and target marking and classification.
It realizes efficient and accurate detection of small target floating objects on the water surface, and can monitor and manage large areas of water in real time, improves detection efficiency and accuracy, and reduces the workload of manual patrols.
Smart Images

Figure QLYQS_4
Abstract
Description
Technical Field
[0001] The present invention relates to a method for detecting small floating objects on the water surface in the field of artificial intelligence target detection, and is particularly suitable for detecting and monitoring small floating objects on the water surface, and has important application value in the fields of environmental protection, water quality monitoring, and disaster prevention. Background Art
[0002] With the development of industrialization and urbanization, water pollution is becoming increasingly serious, especially the impact of small floating objects on water quality and ecological environment cannot be ignored. Traditional detection methods often rely on manual inspections, which are inefficient and difficult to cover large areas of water. Therefore, it is of great significance to develop an automated and efficient method for detecting small floating objects on the water surface.
[0003] The presence of floating objects on the water surface not only affects the natural landscape of the water body, but may also lead to deterioration of water quality, affect the living environment of aquatic organisms, and even pose a threat to human health. For example, non-degradable floating objects such as plastic waste will accumulate in the water body for a long time, destroying the ecological balance. In addition, floating objects on the water surface may also cause water traffic accidents and affect shipping safety. Therefore, effective detection and monitoring of floating objects on the water surface is of great significance for protecting water resources, maintaining ecological balance and protecting human health.
[0004] Traditional methods for detecting floating objects on the water surface mainly rely on manual inspections and simple sensor detection, which have problems such as low efficiency and low accuracy. Manual inspections are limited by time and space, making it difficult to achieve real-time monitoring of large areas of water, while simple sensor detection is often inaccurate due to interference from environmental factors (such as light, water flow, etc.). In order to improve the efficiency and accuracy of detecting floating objects on the water surface, visual analysis technology has gradually been introduced into this field and has become a key means to solve this problem.
[0005] Visual analysis technology, as a comprehensive application of computer vision and image processing technology, processes and analyzes images or videos captured by the camera to achieve the recognition, positioning and tracking of target objects. Specifically, the algorithm for detecting floating objects on the water surface mainly includes the following steps: image preprocessing, feature extraction, target detection and classification, and target tracking and recognition. In the image preprocessing stage, the image quality is improved by methods such as denoising, enhancement, and grayscale transformation, laying the foundation for subsequent feature extraction and target detection. In the feature extraction stage, the features of floating objects on the water surface are extracted by edge detection, texture analysis and other methods. Next, in the target detection and classification stage, deep learning algorithms such as convolutional neural networks (CNN) are used to achieve accurate detection and classification of floating objects on the water surface. Finally, in the target tracking and recognition stage, the algorithm is iteratively updated to achieve continuous tracking and accurate recognition of floating objects.
[0006] Compared with traditional methods, the algorithm for detecting floating objects on the water surface has significant functional advantages. First, visual analysis technology can achieve all-weather and all-round monitoring, greatly improving the coverage and frequency of detection. Traditional manual inspections and sensor detection are often limited by time and space, while the detection system based on visual analysis can achieve real-time monitoring of large areas of water by deploying multiple cameras. Secondly, the algorithm for detecting floating objects on the water surface can significantly improve the accuracy of detection. Thanks to the application of deep learning algorithms, visual analysis technology can accurately identify various types of floating objects, such as plastics, wood, oil stains, etc. It can not only detect the presence of floating objects, but also identify their types and sizes. This is of great significance for water environment management and pollutant cleanup.
[0007] CN117237614A discloses a method for detecting small floating objects on a lake surface based on deep learning, including constructing a data set; performing image enhancement on training samples in the data set to obtain an enhanced data set; establishing a target detection network, and adding a coordinate attention mechanism module before the first upsampling operation; training the target detection network with the enhanced data set until convergence to obtain a small floating object detection model on the lake surface; obtaining the original remote sensing image to be detected, and sending the image to the small floating object detection model on the lake surface after image enhancement to obtain the target detection result. It can increase the image foreground ratio and increase the size of small targets therein; and the detection of small targets is more accurate. When extracting features, the information between channels is obtained and the position information related to the direction is considered, which greatly improves the detection speed and accuracy, and the overall method is flexible and lightweight enough, saving computing costs.
[0008] CN113807238A discloses a visual measurement method for the area of floating objects on the water surface of a river, including: using a camera with calibrated internal and external parameters to shoot a grayscale image of the river water surface and perform nonlinear distortion correction; calculating the starting point distance of the water edge lines on both sides according to the water level and the cross-sectional topography, and inversely calculating the image point coordinates of the water edge lines based on the variable height water surface photogrammetry model to determine the image position of the water surface area; performing non-uniform illumination correction on the water surface area based on a multi-scale Retinex algorithm based on a central peripheral model; using a deep learning-based PSPnet network to segment the corrected image to obtain a binary image with floating objects as the foreground and the water surface as the background; traversing the foreground pixels in the binary image, calculating their physical area according to the object image scale factor, and accumulating to obtain the total area of floating objects. It realizes the accurate measurement of the area of floating objects on the water surface of the river, which is of great significance for improving the overall level of automation and intelligence of the existing water conservancy video monitoring system.
[0009] However, there is still room for improvement in detection efficiency, accuracy, real-time monitoring and handling of floating objects in waters. Summary of the invention
[0010] The present invention aims to solve the technical problems existing in the existing methods for detecting small floating objects on the water surface, including but not limited to low detection efficiency, low accuracy, difficulty in real-time monitoring and processing of floating objects in large areas of water, etc. In order to overcome these shortcomings, the present invention proposes an automated method for detecting small floating objects on the water surface based on image processing technology and deep learning algorithm, which can effectively identify and monitor small floating objects on the water surface, and is of great significance to the fields of environmental protection, water quality monitoring and disaster prevention.
[0011] The present invention provides a method for detecting small-volume floating objects on a water surface, comprising the following steps:
[0012] S1: Collect water surface images and perform preprocessing such as denoising, contrast enhancement, and edge enhancement on the collected images;
[0013] S2: Extract image features using non-local attention mechanism;
[0014] S3: Use combined convolution to process the features obtained in the previous step;
[0015] S4: feature maps at different levels are differentiated and then fused;
[0016] S5: Mark and classify the detected small floating objects according to shape, color and size.
[0017] The present invention has the following significant advantages and beneficial effects: high degree of automation, reducing the workload of manual inspections; high detection efficiency, and the ability to cover a wide range of waters. DETAILED DESCRIPTION
[0018] The present invention provides a method for detecting small-volume floating objects on a water surface, comprising the following steps:
[0019] S1: Collect water surface images and perform preprocessing such as denoising, contrast enhancement, and edge enhancement on the collected images;
[0020] S2: Extract image features using non-local attention mechanism;
[0021] S3: Use combined convolution to process the features obtained in the previous step;
[0022] S4: feature maps at different levels are differentiated and then fused;
[0023] S5: Mark and classify the detected small floating objects according to shape, color and size;
[0024] Further, the step S1 specifically includes:
[0025] S11: Divide the key areas of the water area into different areas. The area of each area can be divided into (20X20, 40X40, 80X80) square meters according to the importance. Then deploy three cameras with high dynamic range (HDR) function in each area. The camera placement angle can be roughly 120 degrees to achieve seamless monitoring of the entire water area.
[0026] S12: For the data collected by the camera, a combination of improved median filtering and Gaussian filtering is used to effectively remove random noise in the image while retaining the edge information of small objects on the water surface. The formula is as follows: .
[0027] S13: An improved edge detection algorithm suitable for small floating objects is used to highlight the contour information in the image. The formula is as follows:
[0028] S14: Then use the adaptive histogram equalization designed for small objects on the water surface to improve the distinction between the target and the background in the image. The formula is as follows:
[0029] Step S2 specifically includes:
[0030] The non-local attention mechanism is defined as follows:
[0031] ,
[0032] S21: The processed image data is processed through three convolutional layers, and then three parallel branches are adopted, and 512 convolution kernels of size 1×1×1 are used to perform convolution operations on each branch. After processing, each branch will output a feature map with a dimension of N×H×W×512.
[0033] S22: Then, the first and second branches are reshaped respectively, and the results correspond to NHW×512 and 512×NHW. The two outputs are matrix multiplied to obtain the output of NHW×NHW.
[0034] S23: The outputs of the first two branches are subjected to a softmax operation and then matrix multiplication with the output of the third branch to obtain a dimension of NHW×512. After a reshape operation, it becomes a four-dimensional tensor of N×H×W×512.
[0035] S24: Finally, this output is subjected to a convolution operation to obtain an output with the same dimension as the input.
[0036] Step S3 specifically includes:
[0037] S31: The feature map extracted in the previous step is divided into four branches, and the four branches are convolved respectively, with the convolution size being 3 1*1 and one K*K respectively.
[0038] S32: The four outputs obtained above are then normalized respectively, and then the second path is passed through a K*K convolution kernel, and the third path is passed through an average pooling operation. Then the two outputs are normalized again.
[0039] S33: Add the above four outputs together to obtain an output.
[0040] Step S4 specifically includes:
[0041] S41: Perform differential processing on the feature maps of 20*20, 40*40, 80*80, and 160*160 resolutions obtained in the above operation. Perform fine-grained detail feature extraction on 160*160 and 80*80, and perform coarse-grained extraction on 20*20 and 40*40. Finally, perform weighted fusion on the obtained results.
[0042] S42: The processed data is restored to a preset resolution of the detection frame through a corresponding number of up-samplings for detection.
[0043] Step S5 specifically includes:
[0044] S51: Use contour tracking and geometric feature extraction technology to identify the geometric shape of floating objects.
[0045] S52: The image is converted from the RGB space to the HSV space using the color space conversion technology to extract the color features of the floating objects.
[0046] S53: The size information extraction technology is used to distinguish different types of floating objects, such as plastic, wood, oil, etc., according to the pixel size in the image.
[0047] Through the above steps, the present invention provides an efficient and accurate method for detecting small floating objects on the water surface, which can realize real-time monitoring and precise management of large areas of water. This method not only improves the efficiency and accuracy of detection, but also provides strong technical support for environmental protection and water quality monitoring. With the further development of technology and the continuous expansion of application scenarios, the method of the present invention will play a more important role.
[0048] The method for detecting small floating objects on the water surface provided by the present invention has the following significant advantages and beneficial effects: high degree of automation, reducing the workload of manual inspections; high detection efficiency, and being able to cover a wide range of waters.
Claims
1. A method for detecting small floating objects on the water surface, characterized in that: The following steps are involved: S1: Collect water surface images and perform denoising, contrast enhancement, and edge enhancement preprocessing on the collected images; S2: Extract image features using non-local attention mechanism; S3: Use combined convolution to process the features obtained in the previous step; S4: feature maps at different levels are differentiated and then fused; S5: Mark and classify the detected small floating objects according to shape, color and size.
2. A method for detecting small-volume floating objects on the water surface according to claim 1, characterized in that: Step S1 specifically includes: S11: Divide the key areas of the water area into different areas. The area of each area is divided into (20X20, 40X40, 80X80) square meters according to the importance. Then deploy three cameras with high dynamic range function in each area. The cameras are placed at an angle of approximately 120 degrees to achieve seamless monitoring of the entire water area. S12: For the data collected by the camera, a method combining improved median filtering and Gaussian filtering is used to remove random noise in the image while retaining the edge information of small objects on the water surface. The formula is as follows: ; S13: An improved edge detection algorithm suitable for small floating objects is used to highlight the contour information in the image. The formula is as follows: ; S14: Then, an adaptive histogram equalization designed for small objects on the water surface is used to improve the distinction between the target and the background in the image. The formula is as follows: .
3. A method for detecting small-volume floating objects on the water surface according to claim 2, characterized in that: Step S2 specifically includes: The non-local attention mechanism is defined as follows: , ; S21: The processed image data is processed through three convolutional layers, and then three parallel branches are adopted, and 512 convolution kernels of size 1×1×1 are used to perform convolution operations on each branch. After processing, each branch will output a feature map with a dimension of N×H×W×512; S22: Then reshape the first and second branches respectively, the results correspond to NHW×512 and 512×NHW, and then matrix multiply the two outputs to obtain NHW×NHW output; S23: The outputs of the first two branches are subjected to a softmax operation and then matrix multiplied with the output of the third branch to obtain a dimension of NHW×512. After a reshape operation, it becomes a four-dimensional tensor of N×H×W×512. S24: Finally, this output is subjected to a convolution operation to obtain an output with the same dimension as the input.
4. A method for detecting small-volume floating objects on the water surface according to claim 3, characterized in that: Step S3 specifically includes: S31: The feature map extracted in the previous step is divided into four branches, and the four branches are convolved respectively, and the convolution and size are three 1*1 and one K*K respectively; S32: Then, the four outputs obtained above are normalized respectively, and then the second path is passed through a K*K convolution kernel, the third path is passed through an average pooling operation, and then the two outputs are normalized again; S33: Add the above four outputs together to obtain an output.
5. A method for detecting small-volume floating objects on the water surface according to claim 4, characterized in that: Step S4 specifically includes: S41: performing differential processing on the feature maps with resolutions of 20*20, 40*40, 80*80, and 160*160 obtained in the above operation, performing fine-grained detail feature extraction on 160*160 and 80*80, performing coarse-grained extraction on 20*20 and 40*40, and finally performing weighted fusion on the obtained results; S42: The processed data is restored to a preset resolution of the detection frame through a corresponding number of up-samplings for detection.
6. A method for detecting small-volume floating objects on the water surface according to claim 5, characterized in that: Step S5 specifically includes: S51: using contour tracking and geometric feature extraction technology to identify the geometric shape of the floating object; S52: using color space conversion technology to convert the image from RGB space to HSV space to extract the color features of the floating object; S53: Using size information extraction technology to distinguish different types of floating objects according to pixel sizes in the image.
Citation Information
Patent Citations
Visual measurement method for area of floating object on water surface of river channel
CN113807238A
Chest rib fracture detection method based on attention convolutional neural network
CN111986177A
Single-stage water surface small target detection method and device
CN115019169A
Lake surface floating object small target detection method based on deep learning
CN117237614A
Soft package sealing performance detection device and method based on vibration and infrared image fusion
CN118706336A