Water surface floating object detection method based on improved YOLOV8 model
By improving the YOLOv8 model, combined with the CSP_DCNv2CoordConv and C2S_Upsample modules, the detection difficulties of small targets and complex scenes of floating objects on the water surface are solved, and efficient detection and accurate identification of small targets from a long distance are achieved.
Patent Information
- Application Number
- CN202510482925.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-07-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the detection of floating objects on the surface of the YOLO model, there is insufficient perception of spatial location of small targets and complex scenes, resulting in the problem of high missed detection rate.
The CSP_DCNv2CoordConv and C2S_Upsample modules were introduced to improve the YOLOv8 model. The CSP_DCNv2CoordConv module combines coordinate convolution and deformable convolution to enhance the perception of target spatial position information. The C2S_Upsample module solves the multi-scale feature fusion problem through an adaptive feature enhancement mechanism.
It significantly improves the performance of floating objects detection on water surface, especially in the detection of long-distance small targets, improves the model's detection ability of complex shapes and heterogeneous targets, and reduces redundant calculations.
Smart Images

Figure CN120388288A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of object detection in deep learning, and specifically relates to a method for detecting floating objects on the water surface based on an improved YOLOV8 model. Background Art
[0002] With the acceleration of waterway transportation and urbanization, the detection and management of floating objects on the water surface have become environmental challenges that need to be solved urgently. Traditional methods for detecting floating objects on the water surface rely on manual inspections and simple mechanical equipment, which are inefficient and have limited accuracy. Especially under long-distance and complex background conditions, it is difficult to ensure the detection effect. In recent years, intelligent detection algorithms based on deep learning have attracted wide attention, and they can process complex recognition tasks more accurately and improve the accuracy of detection and classification.
[0003] As a classic single-stage object detection algorithm, the YOLO series of models has the advantages of good real-time performance and fast detection speed. However, when the YOLO model is used to detect small objects and long-distance floating objects in complex scenes, there are problems such as insufficient perception of the spatial position of the object and insufficient extraction of fine-grained features, resulting in a relatively high miss detection rate.
[0004] To solve these problems, this paper introduces and optimizes the CSP_DCNv2CoordConv and C2S_Upsample modules to improve the YOLOv8 model. The CSP_DCNv2CoordConv module combines coordinate convolution (CoordConv) and deformable convolution (Deformable Convolution), greatly enhancing the ability to perceive the spatial position information of the object. Coordinate convolution enables the model to better perceive the spatial distribution of objects by introducing coordinate information, especially suitable for detecting floating objects with irregular shapes. The deformable convolution (DCNv2) introduces a shape-adaptive change of the convolution kernel, which can more flexibly capture the complex shapes and postures of objects and improve the detection ability for heterogeneous objects. In addition, the dynamic convolution mechanism enables the model to adaptively adjust the shape and size of the convolution kernel according to the content of the input image, further enhancing the model's feature extraction ability for diverse objects.
[0005] The C2S_Upsample module solves the problem of multi-scale feature fusion through an adaptive feature enhancement mechanism. In this module, the feature maps are upsampled step by step, enabling effective combination of features at different scales, especially for the detection of long-distance and small objects, with better performance. This optimization greatly improves the model's ability to capture long-distance small objects while reducing redundant calculations.
[0006] The improved YOLOv8 model effectively integrates the CSP_DCNv2 CoordConv and C2S_Upsample modules, significantly enhancing the performance of detecting floating objects on the water surface. This method performs excellently in complex scenarios, but in practical applications, it is still necessary to further optimize the computational complexity of the model to ensure its real-time performance on resource-constrained devices, providing more efficient technical support for the intelligent management of water areas. Summary of the Invention
[0007] Object of the Invention: Aiming at the above-mentioned existing technologies, a method for detecting floating objects on the water surface based on an improved YOLOV8 model is proposed;
[0008] Technical Solution Adopted in the Invention: A method for detecting floating objects on the water surface based on an improved YOLOV8 model, comprising the following steps:
[0009] S1: Construct a dataset for detecting floating objects on the water surface;
[0010] S2: Image marking and data augmentation;
[0011] S3: Construct an improved YOLOV8 model based on CSP_DCNv2 CoordConv and C2S_Upsample;
[0012] S4: Train the improved YOLOV8 model based on CSP_DCNv2 CoordConv and C2S_Upsample;
[0013] S5: Use the trained improved YOLOV8 model to detect floating objects on the water surface and conduct experiments on the roboflow floating object dataset.
[0014] Preferably, in step S2, for the two-dimensional images included in the constructed dataset for detecting floating objects on the water surface, the blurred and unclear two-dimensional images are deleted, and then watermark removal processing and cropping are performed to unify the size and format of the two-dimensional images. The Stable Diffusion tool is used to enhance the two-dimensional images, and two-dimensional images of rainy days, foggy days, and nights are added; subsequently, the VOTT labeling tool is used to classify and label the two-dimensional images, labeling the classification information, position information, and scale information of the targets; finally, the dataset of floating objects on the water surface is divided into a training set, a validation set, and a test set according to the ratio of 7:2:1.
[0015] Preferably, in step S3, the improved YOLOV8 model includes improving the original C2f module to CSP_DCNv2 CoordConv and improving the original Upsample module to C2S_Upsample:
[0016] The CSP_DCNv2 CoordConv module effectively enhances the detection ability of floating objects on the water surface through the combination of multiple sub-modules. First, the convolutional layer extracts local features from the input feature map to capture low-level features. Subsequently, the feature map is split into three parts by the Split module and sent to the CoordConv, Bottleneck_DCNv2, and Conv modules respectively. The CoordConv module introduces spatial position information, enabling the model to have the ability to perceive the spatial distribution of objects in the feature map, which is particularly helpful for the detection of irregular objects. The Bottleneck_DCNv2 module adopts a dynamic convolution mechanism, which can adaptively capture the complex shapes and postures of objects and retain the original features through residual connections, reducing information loss. The Conv module further performs local feature extraction. After feature extraction is completed, these three parts of features are concatenated by the Concat module to fuse the feature information of different paths. Finally, through convolution and additive residual connections, the deep expression of features is further improved. Based on lightweight design, this module improves the ability of fine-grained feature extraction and position information perception, and significantly improves the effect especially in the detection of small targets at a long distance.
[0017] The process of the convolution operation can be expressed as:
[0018] Y s = f(W * X s + b) (11)
[0019] where, X s is the input feature map, W is the ordinary convolution weight, b is the bias term, f is the activation function, and Y s is the output feature map after convolution;
[0020] Then, the feature map is split into three parts by the Split module and sent to the Bottleneck_DCNv2, CoordConv, and Conv modules respectively. Assuming the dimension of the input feature map is The three parts of the split feature maps can be expressed as:
[0021]
[0022] Bottleneck_DCNv2 module: Adopts a dynamic convolution mechanism to adaptively capture the complex shapes and postures of objects and retain the original features through residual connections, reducing information loss. This process can be expressed as:
[0023] Y1 = X a + f(W1 * X a ) (13)
[0024] where, X ais the input feature map, W1 is the deformable convolution weight of DCNv2, and f is the non-linear activation function.
[0025] CoordConv module: Introduces spatial position information. By appending horizontal and vertical coordinate channels to the feature map, the model is equipped with the ability to perceive the spatial distribution of objects, which is particularly helpful for the detection of irregular objects. The feature map after introducing the coordinate channels can be expressed as:
[0026]
[0027] And the output after the CoordConv convolution operation is:
[0028] Y2 = f(W2 * X′ b + b2) (15)
[0029] where W2 is the coordinate convolution weight, X′ b is the feature map after introducing the coordinate channels, and b2 is the bias term.
[0030] Conv module: The simple convolutional layer directly performs a convolution operation on the third part of the input feature map to extract additional features, and the output is:
[0031] Y3 = f(W3 * X c + b3) (16)
[0032] where W3 is the ordinary convolution weight, X c is the feature map after introducing the coordinate channels, and b3 is the bias term;
[0033] After feature extraction is completed, these three parts of features are concatenated in the channel dimension through the Concat module; the dimensions of the three parts of the feature maps are and The result after concatenation is:
[0034]
[0035] Finally, through convolution and additive residual connection, the deep expression of the features is further enhanced, and the formula is:
[0036] Y final = Y input + Y conv (18)
[0037] where Y input is the input feature map, Y conv is the feature map after convolution, and Y final is the final output;
[0038] The C2S_Upsample module improves the model's detection ability for small targets at long distances through channel concatenation and spatial expansion; first, the input feature map X u is divided into five parts: the first part maintains the original resolution and number of channels, and the number of channels in the remaining four parts is reduced to one-half, one-quarter, one-eighth, and one-sixteenth of the original respectively; through the Concat module, these five parts are concatenated in the channel dimension to obtain a new feature map X u ′, which incorporates multi-scale information; using 1×1 convolutional operations to increase the richness of channel information, the concatenated feature map is converted to 4C u channels and divided into four equal parts; each part undergoes spatial expansion to double the resolution to finally generate 2H u ×2W u ×C u output feature map Y u ; this design can effectively fuse multi-scale information while maintaining the original resolution, and increase fine-grained spatial details through super-resolution reconstruction, which is suitable for small targets at long distances in water surface floating object detection;
[0039] C2S_Upsample improves the detection ability for small targets at long distances by segmenting, channel concatenating, and spatially reorganizing the input feature map; X u represents the input feature map of C2S_Upsample, and the output feature map is represented by Y u , and the process is as follows:
[0040] 1) Input feature map: X u with a size of H u ×W u ×C u , where H u and W u are the height and width of the input feature map respectively, and C u is the number of input channels;
[0041] 2) Feature map segmentation: The input feature map X u is segmented along the channel dimension into 5 parts:
[0042] The first part maintains the original resolution and number of channels H u ×W u ×C u ;
[0043] The number of channels in the remaining four parts is successively one-half, one-quarter, one-eighth, and one-sixteenth of the original number of channels, and are respectively represented as:
[0044] 3) Channel concatenation: By concatenating these five parts along the channel dimension, the concatenated feature map X u ′ is obtained, and its size is:
[0045]
[0046] where C u ′ is the number of channels after concatenation;
[0047] 4) Super-resolution reconstruction:
[0048] Perform a 1×1 convolution operation on the concatenated feature map X u ′ to transform the number of channels to H u ×W u ×(C1'+C2'+C3'+C4'); where each C i satisfies: C1' = C2' = C3' = C4' = C u
[0049] The feature map after convolution is: H u ×W u ×4C u
[0050] 5) Channel splitting and spatial expansion:
[0051] Divide the feature map H u ×W u ×4C u after convolution into 4 equal parts along the channel dimension, and the number of channels in each part is C u , respectively: H u ×W u ×C u
[0052] Transfer these 4 parts from the channel dimension to the spatial dimension through a concatenation operation, that is, map the features of each channel block to a higher-resolution space, and finally the output feature map obtained is Y u :
[0053] Y u = 2H u ×2W u ×C u (20)
[0054] In this way, the C2S_Upsample module can improve the resolution of the feature map while maintaining the input feature space information, and further enhance the feature expression ability through super-resolution and convolution operations; this processing method is especially suitable for the long-distance small target detection scenario, which can effectively enhance the detail information and improve the spatial perception ability.
[0055] Preferably, in step S4, the training hyperparameters are initialized as follows: the weight decay rate is set to 0.0005, the weight decay rate is 0.05, the initial learning rate is 0.01, the batch size is set to 64, and the number of training epochs is 200; after training is completed, the trained model weights and training logs are saved for subsequent analysis.
[0056] Beneficial effects: By introducing the CSP_DCNv2CoordConv and C2S_Upsample modules, the present invention effectively solves the problem that the YOLOv8 model has insufficient perception of small targets at a long distance in the task of detecting floating objects on the water surface. The CSP_DCNv2CoordConv module combines coordinate convolution and deformable convolution, improving the model's ability to capture complex shapes and irregular floating objects, especially showing significant effects in the detection of small objects at a long distance. The adaptive feature enhancement mechanism of the C2S_Upsample module further improves the effect of multi-scale feature fusion and enhances the overall detection ability of the model for targets at different distances.
[0057] In addition, the ablation experiment results on the roboflow floating object dataset show that the proposed improved model has significantly improved accuracy and recall rates in the detection of small targets at a long distance compared to the traditional YOLOv8 model. The experiment also verifies the generalization ability of this method, which performs well under different water environments and complex background conditions, contributing to improving the practical application effect of intelligent detection of floating objects on the water surface. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 is a flowchart of a method for detecting floating objects on the water surface based on an improved YOLOV8 model of the present invention;
[0059] Figure 2 is an algorithm diagram of a method for detecting floating objects on the water surface based on an improved YOLOV8 model with CSP_DCNv2CoordConv and C2S_Upsample;
[0060] Figure 3 is a schematic diagram of a floating object sample;
[0061] Figure 4 is a schematic diagram of the overall network structure of the CSP_DCNv2CoordConv module;
[0062] Figure 5 is a schematic diagram of the overall process of the CSP_DCNv2CoordConv module network;
[0063] Figure 6 is a schematic diagram of the structure of the C2S_Upsample module;
[0064] Figure 7It is a schematic flow diagram of the C2S_Upsample module;
[0065] Figure 8 It is a graph of the ablation experiment results of the method proposed by the present invention on the roboflow floating object dataset. Specific implementation manners
[0066] The following further explains the present invention in conjunction with the accompanying drawings and specific implementation manners.
[0067] The present invention proposes a method for detecting water surface floating objects based on an improved YOLOV8 model. The process is as Figure 1 shown and specifically includes the following contents:
[0068] S1: Construct a water surface floating object detection dataset;
[0069] S2: Image marking and data augmentation;
[0070] For the two-dimensional images included in the constructed water surface floating object detection dataset, delete the blurred and unclear two-dimensional images, then perform watermark removal processing and cropping, unify the size and format of the two-dimensional images, use the Stable Diffusion tool to enhance the two-dimensional images, and add two-dimensional images of rainy days, foggy days, and nights; subsequently, use the VOTT labeling tool to classify and label the two-dimensional images, label the classification information, position information, and scale information of the targets; finally, divide the water surface floating object dataset into a training set, a validation set, and a test set according to a ratio of 7:2:1; among them, the dataset is divided into 8 categories, namely: plastic, glass, metal, wood, rubber, fishing net, foam, and convenience bag, as Figure 3 shown;
[0071] S3: Construct an improved YOLOV8 model based on CSP_DCNv2CoordConv and C2S_Upsample. Its overall algorithm structure diagram is as Figure 2 shown;
[0072] The main implementation manner of the improved YOLOV8 model in step S3 is as follows:
[0073] Figure 4 It is a schematic diagram of the overall structure of the CSP_DCNv2CoordConv network, mainly composed of Bottleneck_DCNv2, CoordConv, and Conv; its overall process is as Figure 5 shown:
[0074] The process of the improved CSP_DCNv2CoordConv model first performing a convolution operation on the input image can be expressed as:
[0075] Y s= f(W * X s + b) (21)
[0076] where X s is the input feature map, W is the ordinary convolution weight, b is the bias term, f is the activation function, and Y s is the output feature map after convolution;
[0077] Then, the feature map is split into three parts by the Split module and sent to the Bottleneck_DCNv2, CoordConv, and Conv modules respectively; assuming the dimension of the input feature map is The three split feature maps can be expressed as:
[0078]
[0079] Bottleneck_DCNv2 module: Adopts a dynamic convolution mechanism to adaptively capture the complex shapes and postures of objects, and retains the original features through residual connections to reduce information loss. This process can be expressed as:
[0080] Y1 = X a + f(W1 * X a ) (23)
[0081] where X a is the input feature map, W1 is the deformable convolution weight of DCNv2, and f is the non-linear activation function;
[0082] CoordConv module: Introduces spatial position information. By attaching horizontal and vertical coordinate channels to the feature map, the model is enabled to have the ability to perceive the spatial distribution of objects, which is especially helpful for the detection of irregular objects; the feature map after introducing the coordinate channels can be expressed as:
[0083]
[0084] And the output after the CoordConv convolution operation is:
[0085] Y2 = f(W2 * X' b + b2) (25)
[0086] where W2 is the coordinate convolution weight, X' b is the feature map after introducing the coordinate channels, and b2 is the bias term;
[0087] Conv module: The simple convolutional layer directly performs a convolution operation on the third part of the input feature map to extract additional features, and the output is:
[0088] Y3 = f(W3 * X c + b3) (26)
[0089] Among them, W3 is the weight of ordinary convolution, X c is the feature map after introducing the coordinate channel, and b3 is the bias term;
[0090] After feature extraction is completed, these three parts of features are concatenated in the channel dimension through the Concat module; assuming that the dimensions of the three parts of feature maps are respectively and The result after concatenation is:
[0091]
[0092] Finally, through convolution and additive residual connection, the deep expression of features is further enhanced, and the formula is:
[0093] Y final = Y input + Y conv (28)
[0094] Among them, Y input is the input feature map, Y conv is the feature map after convolution, and Y final is the final output.
[0095] Figure 6 is the structural schematic diagram of the improved C2S_Upsample module, and the specific operation process of channel concatenation and spatial expansion is as Figure 7 shown:
[0096] First, the input feature map X u is divided into five parts: the first part maintains the original resolution and number of channels, and the number of channels of the remaining four parts is reduced to one-half, one-quarter, one-eighth, and one-sixteenth of the original respectively; through the Concat module, these five parts are concatenated in the channel dimension to obtain a new feature map X u ′, which incorporates multi-scale information; then, using 1×1 convolution operation, the richness of channel information is increased, and the concatenated feature map is converted into 4C u channels and divided into four equal parts; each part undergoes spatial expansion to double the resolution to finally generate an output feature map Y u × 2W u × C u ; this design can effectively fuse multi-scale information while maintaining the original resolution, and increase fine-grained spatial details through super-resolution reconstruction, which is suitable for distant small targets in water surface floating object detection; u ;
[0097] C2S_Upsample improves the detection ability for small targets at long distances by segmenting, channel concatenating, and spatially reorganizing the input feature map; X u represents the input feature map of C2S_Upsample, and the output feature map is represented by Y u The process is as follows:
[0098] 1. Input feature map: X u with a size of H u ×W u ×C u where H u and W u are the height and width of the input feature map respectively, and C u is the number of input channels;
[0099] 2. Feature map segmentation: The input feature map X u is segmented along the channel dimension into 5 parts:
[0100] The first part maintains the original resolution and number of channels H u ×W u ×C u ;
[0101] The number of channels of the remaining four parts is successively one - half, one - quarter, one - eighth, and one - sixteenth of the original number of channels, and are respectively represented as:
[0102] 3. Channel concatenation: By concatenating these five parts along the channel dimension, the concatenated feature map X u ′ is obtained, and its size is:
[0103]
[0104] where C u ′ is the number of channels after concatenation;
[0105] 4. Super - resolution reconstruction:
[0106] Perform a 1×1 convolution operation on the concatenated feature map X′ u to transform the number of channels to H u ×W u ×(C1'+C2'+C3'+C4'); where each C i satisfies: C1' = C2' = C3' = C4' = C u
[0107] The convolved feature map is: H u ×W u ×4C u
[0108] 5. Channel Splitting and Spatial Expansion:
[0109] Divide the feature map H u ×W u ×4C u along the channel dimension into 4 parts, each part having a channel number of C u , namely: H u ×W u ×C u
[0110] Transfer these 4 parts from the channel dimension to the spatial dimension through a concatenation operation, that is, map the features of each channel block to a higher-resolution space, and finally the output feature map obtained is Y u :
[0111] Y u = 2H u ×2W u ×C u (30)
[0112] In this way, the C2S_Upsample module can improve the resolution of the feature map while maintaining the input feature spatial information, and further enhance the feature expression ability through super-resolution and convolution operations; this processing method is especially suitable for the long-distance small target detection scenario, which can effectively enhance the detail information and improve the spatial perception ability;
[0113] S4: Train the YOLOV8 model based on CSP_DCNv2CoordConv and C2S_Upsample;
[0114] Improve the YOLOV8 model initialization training hyperparameters of CSP_DCNv2CoordConv and C2S_Upsample as follows:
[0115] Set the weight decay rate to 0.0005, the initial learning rate to 0.01, the batchsize to 64, and the training period epoch to 200; after training, save the trained model weights and training logs for subsequent analysis;
[0116] S5: Use the trained improved YOLOV8 model to detect floating objects on the water surface and conduct experiments on the roboflow floating object dataset.
[0117] Figure 8This is the ablation experiment result graph of the method proposed by the present invention on the roboflow floating object dataset. It can be seen that the mAP50 (mean average precision) of different models on the roboflow floating object dataset and the detection performance of various objects (such as glass, metal, foam, plastic, rubber, wood, fishing net, bag). The overall mAP50 of the classic YOLOv8 model is 68.2%. After adding the CSP_DCNv2 CoordConv module and the C2S_Upsample module respectively, the mAP50 is improved to 70.6% and 71.1% respectively. Finally, after combining these two modules, the mAP50 is further improved to 71.9%, which is 3.7 percentage points higher than the original YOLOv8. This indicates that by improving the model structure, the overall detection ability for various water surface floating objects can be effectively improved.
[0118] The above are only the preferred embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A method for detecting floating objects on the water surface based on an improved YOLOV8 model, characterized in that, It includes the following steps: S1: Construct a water surface floating object detection dataset; S2: Image labeling and data augmentation; S3: Construct an improved YOLOV8 model based on CSP_DCNv2CoordConv and C2S_Upsample; S4: Train the improved YOLOV8 model based on CSP_DCNv2CoordConv and C2S_Upsample; S5: Use the trained improved YOLOV8 model to detect water surface floating objects and conduct experiments on the roboflow floating object dataset.
2. The water surface floating object detection method based on the improved YOLOV8 model according to claim 1, wherein In step S2, for the two-dimensional images included in the constructed water surface floating object detection dataset, delete the blurred and unclear two-dimensional images, then perform watermark removal and cropping, unify the size and format of the two-dimensional images, use the StableDiffusion tool to enhance the two-dimensional images, and add two-dimensional images of rainy days, foggy days, and nights; subsequently, use the VOTT labeling tool to classify and label the two-dimensional images, label the classification information, location information, and scale information of the targets; finally, divide the water surface floating object dataset into a training set, a validation set, and a test set according to the ratio of 7:2:
1.
3. The method for detecting water surface floating objects based on an improved YOLOV8 model according to claim 2, wherein, In step S3, the improved YOLOV8 model includes improving the original C2f module to CSP_DCNv2CoordConv and the original Upsample module to C2S_Upsample: The CSP_DCNv2CoordConv module is composed of multiple sub-modules: First, the convolutional layer performs local feature extraction on the input feature map to capture low-level features; subsequently, the feature map is split into three parts by the Split module and sent to the Bottleneck_DCNv2, CoordConv, and Conv modules respectively; the CoordConv module introduces spatial position information, enabling the model to have the ability to perceive the spatial distribution of objects in the feature map, which is particularly helpful for the detection of irregular objects; the Bottleneck_DCNv2 module adopts a dynamic convolution mechanism, which can adaptively capture the complex shapes and postures of objects and retain the original features through residual connections, reducing information loss; the Conv module further performs local feature extraction; after the feature extraction is completed, these three parts of features are concatenated through the Concat module to fuse the feature information of different paths, and finally, through convolution and additive residual connections, the deep expression of features is further enhanced; The process of the convolution operation is expressed as: Y s = f(W * X s + b) (1) Among them, X s is the input feature map, W is the general convolution weight, b is the bias term, f is the activation function, and Y s is the output feature map after convolution; Next, the feature map is split into three parts by the Split module and sent to the Bottleneck_DCNv2, CoordConv, and Conv modules respectively; assuming the dimension of the input feature map is The three split feature maps can be expressed as: The Bottleneck_DCNv2 module: Adopts a dynamic convolution mechanism to adaptively capture the complex shapes and postures of objects and retain the original features through residual connections, reducing information loss; this process is expressed as: Y1 = X a + f(W1 * X a ) (3) Among them, X a is the input feature map, W1 is the deformable convolution weight of DCNv2, and f is the non-linear activation function; The CoordConv module: Introduces spatial position information. By adding horizontal and vertical coordinate channels to the feature map, the model has the ability to perceive the spatial distribution of objects, which is particularly helpful for the detection of irregular objects; the feature map after introducing the coordinate channels is expressed as: And the output after the CoordConv convolution operation is: Y2 = f(W2 * X b ′ + b2) (5) Among them, W2 is the coordinate convolution weight, and X b ′ is the feature map after introducing the coordinate channel, and b2 is the bias term; Conv module: The simple convolutional layer directly performs a convolution operation on the third part of the input feature map to extract additional features, and the output is: Y3 = f(W3 * X c + b3) (6) Among them, W3 is the weight of ordinary convolution, X c is the feature map after introducing the coordinate channel, and b3 is the bias term; After feature extraction is completed, these three parts of features are concatenated in the channel dimension through the Concat module; the dimensions of the three parts of feature maps are respectively and The result after concatenation is: Finally, through the convolutional and additive residual connections, the deep expression of the features is further enhanced. The formula is: Y final = Y input + Y conv (8) Among them, Y input is the input feature map, and Y conv is the feature map after convolution, and Y final is the final output; The C2S_Upsample module performs channel concatenation and spatial expansion: First, the input feature map X u is divided into five parts: the first part maintains the original resolution and number of channels, and the number of channels in the remaining four parts is reduced to one-half, one-fourth, one-eighth, and one-sixteenth of the original respectively; through the Concat module, these five parts are concatenated in the channel dimension to obtain a new feature map X u ′, which incorporates multi-scale information; then, a 1×1 convolution operation is used to increase the richness of channel information, converting the concatenated feature map to 4C u channels, and it is divided into four equal parts; each part undergoes spatial expansion to double the resolution, finally generating an output feature map Y u of 2H u ×2W u ×C u ; C2S_Upsample improves the detection ability for small targets at long distances by segmenting, channel concatenating, and spatially reorganizing the input feature map; X u Let denote the input feature map of C2S_Upsample, and the output feature map is denoted by Y u The process is as follows: 1) Input feature map: X u with size H u ×W u ×C u , where H u and W u are the height and width of the input feature map respectively, and C u is the number of input channels; 2) Feature map segmentation: Split the input feature map X u along the channel dimension into 5 parts: The first part maintains the original resolution and the number of channels H u ×W u ×C u ; The number of channels of the remaining four parts is successively one-half, one-quarter, one-eighth, and one-sixteenth of the original number of channels, and are respectively expressed as: 3) Channel concatenation: By concatenating these five parts in the channel dimension, the concatenated feature map X u ′ is obtained, and its size is: Among them, C u ′ is the number of channels after splicing; 4) Super-resolution reconstruction: For the spliced feature map X u ′, perform a 1×1 convolution operation to transform the number of channels to H u ×W u ×(C1'+C2'+C3'+C4'); where each C i satisfies: C1' = C2' = C3' = C4' = C u The feature map after convolution is: H u ×W u ×4C u 5) Channel splitting and spatial expansion: The feature map H after convolution u ×W u ×4C u is evenly divided into 4 parts along the channel dimension, and the number of channels in each part is C u , which are respectively: H u ×W u ×C u Transfer these four parts from the channel dimension to the spatial dimension through a splicing operation, that is, map the features of each channel block to a higher-resolution space, and the finally obtained output feature map is Y u : Y u = 2H u × 2W u × C u (10).
4. The water surface floating object detection method based on the improved YOLOV8 model according to claim 3, characterized in that, In the step S4: Initialize the training hyperparameters as follows: Set the weight decay rate to 0.0005, the initial learning rate to 0.01, the batchsize to 64, and the training epoch to 200; After training, save the trained model weights and training logs for subsequent analysis.
Citation Information
Cited By
A multi-scale feature filtering and reorganization method for water surface floating object monitoring
CN122493342A