A method and system for identifying water environment targets
By constructing a yolov8-OMCIL network model based on the yolov8 network model, combining the hybrid network reverse residual attention mechanism and the cross-modal attention mechanism, the problem of water surface reflection and floating object reflection is solved, and a more efficient and reliable water environment object detection is achieved.
Patent Information
- Application Number
- CN202411415924.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-10-11
AI Technical Summary
Water surface reflection and floating object reflection significantly reduce the accuracy of traditional water environment target detection, especially in complex lighting conditions and variable outdoor environments.
The yolov8-OMCIL network model based on the yolov8 network model, hybrid network reverse residual attention mechanism and cross-modal attention mechanism is adopted. Through the improved YOLOv8 algorithm and ODConv convolution unit, the model's ability to extract target features of water bodies under different lighting conditions is enhanced, and the weight parameters of the model are optimized using the MPDIoU loss function.
It improves the real-time and reliability of water environmental target detection, enhances the robustness of the model under different weather and lighting conditions, and optimizes the positioning accuracy of small targets that are difficult to identify and confusing from a long distance.
Smart Images

Figure CN118918486B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of target detection, and in particular relates to a method and system for identifying a target in a water environment. Background Art
[0002] The protection and management of water environment is a global environmental issue. Among them, there are solid wastes discharged randomly in water environments such as rivers and seas, which are floating objects. The existence of floating objects on the water surface not only affects the natural beauty of the water body, but also may have a negative impact on the ecosystem and human activities.
[0003] Traditional methods of detecting targets in water environments rely on manual inspections or simple image processing techniques. Among them, existing image processing techniques extract features from images through convolutional neural networks to obtain floating object recognition results. However, existing image processing techniques have limitations in terms of accuracy, efficiency, and robustness. Especially in complex lighting conditions and changeable outdoor environments, the reflection of the water surface and floating objects will significantly reduce the accuracy of detection. Summary of the invention
[0004] The present invention provides a method and system for identifying a water environment target, so as to solve the technical problem that the reflection of the water surface and the reflection of floating objects significantly reduce the detection accuracy.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] A first aspect of the present invention provides a method for identifying a water environment target, comprising:
[0007] Collect monitoring images of floating objects on the water surface, and input the monitoring images of floating objects on the water surface into the preset yolov8-OMCIL network model to obtain the monitoring results of floating objects;
[0008] The construction process of the yolov8-OMCIL network model includes:
[0009] The yolov8-OMCIL network model is constructed based on the yolov8 network model, the hybrid network reverse residual attention mechanism and the cross-modal attention mechanism;
[0010] Obtain the target data of floating objects on the water surface, preprocess the target data of floating objects on the water surface and add real labels to obtain training samples, train the yolov8-OMCIL network model through the training samples to obtain the training recognition results, calculate the training loss value between the training recognition results and the training samples according to the MPDIoU loss function, optimize the weight parameters of the yolov8-OMCIL network model based on the training loss value, and repeat the training process of the yolov8-OMCIL network model until the iteration threshold is reached to output the trained yolov8-OMCIL network model.
[0011] Furthermore, the target data of floating objects on the water surface is obtained, including:
[0012] Acquire a water surface detection video; extract a water surface detection image from the water surface detection video according to a set number of frames, screen out water surface detection images containing floating objects and whose image resolution is greater than a set threshold T, and then standardize the water surface detection images to obtain target images of consistent size, which are recorded as water surface floating object target data.
[0013] Furthermore, the target data of floating objects on the water surface is preprocessed, including:
[0014] Rotate the target image ; Randomly flip the target image horizontally and vertically, randomly crop and scale the target image; Randomly change the brightness, contrast, and color saturation of the target image; Add Gaussian noise with a mean of 0 and a standard deviation of 0.1 to the target image.
[0015] Furthermore, the yolov8-OMCIL network model includes a backbone network, a head network and a task detection network;
[0016] The backbone network includes a first convolutional layer, a second convolutional layer, a first feature fusion layer, a third convolutional layer, a second feature fusion layer, a fourth convolutional layer, a third feature fusion layer, a fifth convolutional layer, a hybrid network reverse residual attention mechanism module and an SPPF module which are connected in sequence;
[0017] The head network includes a first upsampling layer, a first connection layer, a fourth feature fusion layer, a second upsampling layer, a second connection layer, a fifth feature fusion layer, a first CotNet module, a sixth convolutional layer, a third connection layer, a sixth feature fusion layer, a second CotNet module, a seventh convolutional layer, a fourth connection layer, a seventh feature fusion layer and a third CotNet module connected in sequence;
[0018] The task detection network includes a first detection module, a second detection module and a third detection module;
[0019] The output end of the second feature fusion layer is connected to the second connection layer; the output end of the third feature fusion layer is connected to the first connection layer; the output end of the SPPF module is connected to the first upsampling layer;
[0020] The output end of the first upsampling layer is connected to the fourth connection layer; the output end of the fourth feature fusion layer is connected to the third connection layer;
[0021] The output end of the sixth convolutional layer is connected to the first detection module; the output end of the second CotNet module is connected to the second detection module; and the output end of the third CotNet module is connected to the third detection module.
[0022] Furthermore, the first convolutional layer, the sixth convolutional layer, and the seventh convolutional layer are set as Conv convolutional units; the second convolutional layer to the fifth convolutional layer are set as ODConv convolutional units;
[0023] The ODConv convolution unit includes a dynamic convolution input layer, a global average pooling layer, a first fully connected layer and a ReLU activation function connected in sequence; the ReLU activation function connects the second fully connected layer, the third fully connected layer, the fourth fully connected layer and the fifth fully connected layer; the second to fourth fully connected layers are all connected to a single Sigmoid activation function layer; the fifth fully connected layer is connected to a Softmax activation function layer; the Sigmoid activation function layer and the Softmax activation function layer are connected to n dynamic convolution kernels; the n dynamic convolution kernels are connected to a first adder; the first adder and the dynamic convolution input layer are both connected to a first multiplier; the first multiplier is connected to a dynamic convolution output layer;
[0024] Input the feature map x into the ODConv convolution unit to obtain the feature map y, expressed as:
[0025] ;
[0026] Among them, x represents the input feature map of the ODConv convolution unit, and y represents the output feature map of the ODConv convolution unit. Represented as the channel attention weight of the i-th dynamic convolution kernel, Represented as the output channel attention of the i-th dynamic convolution kernel; is the input channel attention of the i-th dynamic convolution kernel; is the spatial attention of the i-th dynamic convolution kernel; is a multiplication operation; Represents the i-th convolution kernel, and the value range of i is .
[0027] Furthermore, the hybrid network reverse residual attention mechanism module includes a hybrid network input layer, a first convolution kernel, a second multiplier, a depth-separable convolution, a second adder, a second convolution kernel, a third adder and a hybrid network output layer connected in sequence; the hybrid network input layer is connected to the third adder and the attention matrix unit; the attention matrix unit is connected to the second multiplier; the output end of the second multiplier is connected to the second adder; the first convolution kernel and the second convolution kernel are set to 1×1 convolution.
[0028] Furthermore, the first CotNet module, the second CotNet module and the third CotNet module include a cross-modal input layer; the cross-modal input layer is connected to the third convolution kernel, the fourth convolution kernel and the fifth connection layer; the fourth convolution kernel, the fifth connection layer, the fifth convolution kernel, the sixth convolution kernel, the third multiplier, the fourth adder and the cross-modal output layer are connected in sequence; the output end of the third convolution kernel is connected to the sixth convolution kernel; the output end of the fourth convolution kernel is connected to the fourth adder.
[0029] Furthermore, the yolov8-OMCIL network model is trained through training samples to obtain training recognition results, including:
[0030] Input the training sample into the backbone network of the yolov8-OMCIL network model; output the feature map P1 from the SPPF module in the backbone network, and input the feature map P1 into the first upsampling layer; upsample the feature map P1 through the first upsampling layer to obtain the feature map Q1;
[0031] The third feature fusion layer outputs the feature map P2, and the feature map Q1 and the feature map P2 are spliced through the first connection layer and sent to the fourth feature fusion layer in sequence; the fourth feature fusion layer outputs the feature map Q2, and the feature map Q2 is upsampled through the second upsampling layer to obtain the feature map Q3;
[0032] The second feature fusion layer outputs the feature map P3, and the feature map Q3 and the feature map P3 are spliced through the second connection layer, and then sent to the fifth feature fusion layer, the first CotNet module and the sixth convolution layer in sequence. The sixth convolution layer generates a detection feature map U1 and sends it to the first detection module;
[0033] The detection feature map U1 and the feature map Q2 are spliced through the third connection layer and sent to the sixth feature fusion layer and the second CotNet module in sequence; the second CotNet module outputs the detection feature map U2;
[0034] The detection feature map U2 is sequentially input to the seventh convolution layer and the fourth connection layer; the output features of the seventh convolution layer are spliced with the feature map Q1 through the fourth connection layer, and then sent to the seventh feature fusion layer and the third CotNet module in sequence; the third CotNet module outputs the detection feature map U3;
[0035] The detection feature map U1, the detection feature map U2 and the detection feature map U3 are detected to obtain a floating object recognition framework, which is recorded as a training recognition result.
[0036] Furthermore, the training loss value between the training recognition result and the training sample is calculated according to the MPDIoU loss function, and the expression formula is:
[0037] ;
[0038] ;
[0039] ;
[0040] in, It is expressed as the coordinates of the upper left corner of the floating object identification frame; It is expressed as the coordinates of the lower right corner of the floating object identification frame; Represented as the coordinates of the upper left corner of the float frame in the real label; is the coordinate of the lower right corner of the floating object frame in the real label; is the square of the Euclidean distance between the upper left corner of the pre-floating object identification frame and the floating object frame in the true label; is the square of the Euclidean distance between the lower right corner of the pre-floating object recognition frame and the floating object frame in the real label; w and h represent the width and height of the floating object frame in the real label, respectively; It is the intersection-over-union ratio of the pre-floating object recognition frame and the floating object frame in the true label.
[0041] A second aspect of the present invention provides a water environment target recognition system, comprising:
[0042] The monitoring module is used to collect monitoring images of floating objects on the water surface, and input the monitoring images of floating objects on the water surface into the preset yolov8-OMCIL network model to obtain the monitoring results of floating objects;
[0043] Model building module, used to build yolov8-OMCIL network model based on yolov8 network model, hybrid network reverse residual attention mechanism and cross-modal attention mechanism;
[0044] The acquisition module is used to obtain the target data of floating objects on the water surface, pre-process the target data of floating objects on the water surface and add real labels to obtain training samples.
[0045] The training module is used to train the yolov8-OMCIL network model through training samples to obtain training recognition results; the training loss value between the training recognition results and the training samples is calculated according to the MPDIoU loss function, the weight parameters of the yolov8-OMCIL network model are optimized based on the training loss value, and the training process of the yolov8-OMCIL network model is repeatedly iterated until the iteration threshold is reached to output the trained yolov8-OMCIL network model.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] The present invention collects monitoring images of floating objects on the water surface, and inputs the monitoring images of floating objects on the water surface into a preset yolov8-OMCIL network model to obtain floating object monitoring results; it can adapt to different environmental conditions and target characteristics, and improves the real-time performance and reliability of water environment target detection.
[0048] The present invention constructs a yolov8-OMCIL network model based on the yolov8 network model, the hybrid network inverse residual attention mechanism and the cross-modal attention mechanism; through the improved YOLOv8 algorithm, the model's ability to extract the characteristics of water environment targets under different lighting conditions is enhanced, the convergence process of the model is optimized, and the robustness of water environment target recognition under different weather conditions is improved.
[0049] The present invention calculates the training loss value between the training recognition result and the training sample according to the MPDIoU loss function, optimizes the weight parameters of the yolov8-OMCIL network model based on the training loss value, uses the MPDIoU loss function to replace the traditional loss function, and increases the accuracy of regression by calculating the distance between the specific points of the predicted box and the real box. The positioning accuracy of the model for small targets that are difficult to identify and easy to confuse at a long distance is optimized. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A flow chart of a method for identifying a water environment target provided in Example 1 of the present invention;
[0051] Figure 2 A structural diagram of the ODConv convolution unit provided in Example 1 of the present invention;
[0052] Figure 3 A structural diagram of a hybrid network reverse residual attention mechanism module provided in Example 1 of the present invention;
[0053] Figure 4 A structural diagram of the CotNet module provided in Example 1 of the present invention;
[0054] Figure 5 This is a structural diagram of the yolov8-OMCIL network model provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0055] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0056] Example 1
[0057] like Figure 1 As shown, this implementation provides a method for identifying a water environment target, including:
[0058] The yolov8-OMCIL network model is constructed based on the yolov8 network model, the hybrid network inverse residual attention mechanism and the cross-modal attention mechanism (abbreviated as CotNet); through the improved YOLOv8 algorithm, the model's ability to extract the characteristics of water environment targets under different lighting conditions is enhanced, the convergence process of the model is optimized, and the robustness of water environment target recognition under different weather conditions is improved.
[0059] The yolov8-OMCIL network model includes a backbone network, a head network and a task detection network;
[0060] The backbone network includes a first convolutional layer, a second convolutional layer, a first feature fusion layer, a third convolutional layer, a second feature fusion layer, a fourth convolutional layer, a third feature fusion layer, a fifth convolutional layer, a hybrid network reverse residual attention mechanism module and an SPPF module which are connected in sequence;
[0061] The head network includes a first upsampling layer, a first connection layer, a fourth feature fusion layer, a second upsampling layer, a second connection layer, a fifth feature fusion layer, a first CotNet module, a sixth convolutional layer, a third connection layer, a sixth feature fusion layer, a second CotNet module, a seventh convolutional layer, a fourth connection layer, a seventh feature fusion layer and a third CotNet module connected in sequence;
[0062] The task detection network includes a first detection module, a second detection module and a third detection module;
[0063] The output end of the second feature fusion layer is connected to the second connection layer; the output end of the third feature fusion layer is connected to the first connection layer; the output end of the SPPF module is connected to the first upsampling layer;
[0064] The output end of the first upsampling layer is connected to the fourth connection layer; the output end of the fourth feature fusion layer is connected to the third connection layer;
[0065] The output end of the sixth convolutional layer is connected to the first detection module; the output end of the second CotNet module is connected to the second detection module; the output end of the third CotNet module is connected to the third detection module; wherein the first convolutional layer, the sixth convolutional layer, and the seventh convolutional layer are set as Conv convolutional units; the second to fifth convolutional layers are set as ODConv convolutional units.
[0066] like Figure 2As shown, the ODConv convolution unit includes a dynamic convolution input layer, a global average pooling layer (abbreviated as GAP), a first fully connected layer and a ReLU activation function connected in sequence; the ReLU activation function connects the second fully connected layer, the third fully connected layer, the fourth fully connected layer and the fifth fully connected layer; the second to fourth fully connected layers are all connected to a single Sigmoid activation function layer; the fifth fully connected layer is connected to a Softmax activation function layer; the Sigmoid activation function layer and the Softmax activation function layer are connected to n dynamic convolution kernels; the n dynamic convolution kernels are connected to a first adder; the first adder and the dynamic convolution input layer are both connected to a first multiplier; the first multiplier is connected to a dynamic convolution output layer;
[0067] Input the feature map x into the ODConv convolution unit to obtain the feature map y, expressed as:
[0068] ;
[0069] Among them, x represents the input feature map of the ODConv convolution unit, and y represents the output feature map of the ODConv convolution unit. Represented as the channel attention weight of the i-th dynamic convolution kernel, Represented as the output channel attention of the i-th dynamic convolution kernel; is the input channel attention of the i-th dynamic convolution kernel; is the spatial attention of the i-th dynamic convolution kernel; is a multiplication operation; Represents the i-th convolution kernel, and the value range of i is .
[0070] The ODConv convolution unit introduces spatial attention, input channel attention, and output channel attention; the added airspace enables the yolov8-OMCIL network model to extract the spatial distribution and morphological characteristics of the target features of the floating object samples on the water surface in the spatial dimension. The added input channels enable the yolov8-OMCIL network model to extract information between different channels, because under different lighting conditions, the floating objects themselves will reflect light, and the water surface will also produce different reflections under different lighting conditions. The use of ODConv convolution allows the model to extract the shape and color features of the floating object samples on the water surface under different weather conditions; the added output channels enable the yolov8-OMCIL network model to better distinguish between floating objects and the background; yolov8-OMCIL can effectively extract features for floating objects of different sizes and angles under different lighting conditions.
[0071] like Figure 3As shown, the hybrid network reverse residual attention mechanism module includes a hybrid network input layer, a first convolution kernel, a second multiplier, a depth-separable convolution, a second adder, a second convolution kernel, a third adder and a hybrid network output layer connected in sequence; the hybrid network input layer is connected to the third adder and the attention matrix unit; the attention matrix unit is connected to the second multiplier; the output end of the second multiplier is connected to the second adder; the first convolution kernel and the second convolution kernel are set to 1×1 convolution;
[0072] The hybrid network reverse residual attention mechanism module can extract more multi-scale information from the input features and fuse this information together, improving the detection ability of the yolov8-OMCIL network model for targets of different scales.
[0073] like Figure 4 As shown, the first CotNet module, the second CotNet module and the third CotNet module include a cross-modal input layer; the cross-modal input layer is connected to the third convolution kernel, the fourth convolution kernel and the fifth connection layer (referred to as Concat); the fourth convolution kernel, the fifth connection layer, the fifth convolution kernel, the sixth convolution kernel, the third multiplier, the fourth adder and the cross-modal output layer are connected in sequence; the output end of the third convolution kernel is connected to the sixth convolution kernel; the output end of the fourth convolution kernel is connected to the fourth adder; the third convolution kernel and the fifth convolution kernel are set to 1×1 convolution, and the fourth convolution kernel is k×k convolution;
[0074] The cross-modal attention mechanism is used for feature fusion, which enhances the expressiveness of features by capturing the co-occurrence relationship between different positions in the feature map, so that the yolov8-OMCIL model can more effectively fuse features of different scales and be more accurate in processing multi-scale targets.
[0075] Obtain a water surface detection video; extract a water surface detection image from the water surface detection video according to a set number of frames, screen out water surface detection images containing floating objects and whose image resolution is greater than a set threshold T, and then perform standardization on the water surface detection images to obtain target images of the same size, which are recorded as water surface floating object target data;
[0076] Preprocess the target data of floating objects on the water surface, including: rotating the target image ; Randomly flip the target image horizontally and vertically, randomly crop and scale the target image; Randomly change the brightness, contrast, and color saturation of the target image; Add Gaussian noise with a mean of 0 and a standard deviation of 0.1 to the target image; Preprocess the target data of floating objects on the water surface and add real labels to obtain training samples.
[0077] The yolov8-OMCIL network model is trained through training samples to obtain training recognition results, including:
[0078] Input the training sample into the backbone network of the yolov8-OMCIL network model; output the feature map P1 from the SPPF module in the backbone network, and input the feature map P1 into the first upsampling layer; upsample the feature map P1 through the first upsampling layer to obtain the feature map Q1;
[0079] The third feature fusion layer outputs the feature map P2, and the feature map Q1 and the feature map P2 are spliced through the first connection layer and sent to the fourth feature fusion layer in sequence; the fourth feature fusion layer outputs the feature map Q2, and the feature map Q2 is upsampled through the second upsampling layer to obtain the feature map Q3;
[0080] The second feature fusion layer outputs the feature map P3, and the feature map Q3 and the feature map P3 are spliced through the second connection layer, and then sent to the fifth feature fusion layer, the first CotNet module and the sixth convolution layer in sequence. The sixth convolution layer generates a detection feature map U1 and sends it to the first detection module;
[0081] The detection feature map U1 and the feature map Q2 are spliced through the third connection layer and sent to the sixth feature fusion layer and the second CotNet module in sequence; the second CotNet module outputs the detection feature map U2;
[0082] The detection feature map U2 is sequentially input to the seventh convolution layer and the fourth connection layer; the output features of the seventh convolution layer are spliced with the feature map Q1 through the fourth connection layer, and then sent to the seventh feature fusion layer and the third CotNet module in sequence; the third CotNet module outputs the detection feature map U3;
[0083] The detection feature map U1, the detection feature map U2 and the detection feature map U3 are detected to obtain a floating object recognition framework, which is recorded as a training recognition result.
[0084] The training loss value between the training recognition result and the training sample is calculated according to the MPDIoU loss function. The expression formula is:
[0085] ;
[0086] ;
[0087] ;
[0088] in, It is expressed as the coordinates of the upper left corner of the floating object identification frame; It is expressed as the coordinates of the lower right corner of the floating object identification frame; Represented as the coordinates of the upper left corner of the float frame in the real label; is the coordinate of the lower right corner of the floating object frame in the real label; is the square of the Euclidean distance between the upper left corner of the pre-floating object identification frame and the floating object frame in the true label; is the square of the Euclidean distance between the lower right corner of the pre-floating object recognition frame and the floating object frame in the real label; w and h represent the width and height of the floating object frame in the real label, respectively; It is the intersection-over-union ratio of the pre-floating object recognition frame and the floating object frame in the true label.
[0089] The MPDIoU loss function is used to increase the accuracy of regression and simplify the calculation process. The yolov8-OMCIL network model can effectively converge when the floating object recognition frame intersects or does not intersect the floating object frame in the true label, which significantly optimizes the positioning accuracy of the yolov8-OMCIL network model for small targets that are difficult to identify and easy to confuse at a long distance.
[0090] The weight parameters of the yolov8-OMCIL network model are optimized based on the training loss value, and the training process of the yolov8-OMCIL network model is iterated repeatedly until the iteration threshold is reached and the trained yolov8-OMCIL network model is output.
[0091] The monitoring images of floating objects on the water surface are collected and input into the preset yolov8-OMCIL network model to obtain the monitoring results of floating objects.
[0092] Table 1, comparison of experimental results between yolov8-OMCIL model and original model;
[0093]
[0094] It can be seen from Table 1 that the yolov8-OMCIL model has a significant improvement in accuracy; it can adapt to different environmental conditions and target characteristics, and improve the real-time and reliability of water environment target detection.
[0095] Example 2
[0096] This embodiment provides a water environment target recognition system. The water environment target recognition system described in this embodiment can be used to execute the water environment target recognition method described in Example 1. The water environment target recognition system includes:
[0097] The monitoring module is used to collect monitoring images of floating objects on the water surface, and input the monitoring images of floating objects on the water surface into the preset yolov8-OMCIL network model to obtain the monitoring results of floating objects;
[0098] Model building module, used to build yolov8-OMCIL network model based on yolov8 network model, hybrid network reverse residual attention mechanism and cross-modal attention mechanism;
[0099] The acquisition module is used to obtain the target data of floating objects on the water surface, pre-process the target data of floating objects on the water surface and add real labels to obtain training samples.
[0100] The training module is used to train the yolov8-OMCIL network model through training samples to obtain training recognition results; the training loss value between the training recognition results and the training samples is calculated according to the MPDIoU loss function, the weight parameters of the yolov8-OMCIL network model are optimized based on the training loss value, and the training process of the yolov8-OMCIL network model is repeatedly iterated until the iteration threshold is reached to output the trained yolov8-OMCIL network model.
[0101] like Figure 5 As shown, the yolov8-OMCIL network model includes a backbone network, a head network and a task detection network;
[0102] The backbone network includes a first convolutional layer, a second convolutional layer, a first feature fusion layer, a third convolutional layer, a second feature fusion layer, a fourth convolutional layer, a third feature fusion layer, a fifth convolutional layer, a hybrid network reverse residual attention mechanism module and an SPPF module which are connected in sequence;
[0103] The head network includes a first upsampling layer, a first connection layer, a fourth feature fusion layer, a second upsampling layer, a second connection layer, a fifth feature fusion layer, a first CotNet module, a sixth convolutional layer, a third connection layer, a sixth feature fusion layer, a second CotNet module, a seventh convolutional layer, a fourth connection layer, a seventh feature fusion layer and a third CotNet module connected in sequence;
[0104] The task detection network includes a first detection module, a second detection module and a third detection module;
[0105] The output end of the second feature fusion layer is connected to the second connection layer; the output end of the third feature fusion layer is connected to the first connection layer; the output end of the SPPF module is connected to the first upsampling layer;
[0106] The output end of the first upsampling layer is connected to the fourth connection layer; the output end of the fourth feature fusion layer is connected to the third connection layer;
[0107] The output end of the sixth convolutional layer is connected to the first detection module; the output end of the second CotNet module is connected to the second detection module; and the output end of the third CotNet module is connected to the third detection module.
[0108] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, etc.) containing computer-usable program code. M , optical storage, etc.).
[0109] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0110] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0112] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for identifying a water environment target, characterized in that: include: Collect monitoring images of floating objects on the water surface, and input the monitoring images of floating objects on the water surface into the preset yolov8-OMCIL network model to obtain the monitoring results of floating objects; The construction process of the yolov8-OMCIL network model includes: The yolov8-OMCIL network model is constructed based on the yolov8 network model, the hybrid network reverse residual attention mechanism and the cross-modal attention mechanism; Obtain the target data of floating objects on the water surface, preprocess the target data of floating objects on the water surface and add real labels to obtain training samples, train the yolov8-OMCIL network model through the training samples to obtain the training recognition results, calculate the training loss value between the training recognition results and the training samples according to the MPDIoU loss function, optimize the weight parameters of the yolov8-OMCIL network model based on the training loss value, and repeat the training process of the yolov8-OMCIL network model until the iteration threshold is reached to output the trained yolov8-OMCIL network model.
2. The water environment target recognition method according to claim 1, characterized in that: Obtain target data of floating objects on the water surface, including: Acquire a water surface detection video; extract a water surface detection image from the water surface detection video according to a set number of frames, screen out water surface detection images containing floating objects and whose image resolution is greater than a set threshold T, and then standardize the water surface detection images to obtain target images of consistent size, which are recorded as water surface floating object target data.
3. The method for identifying water environment targets according to claim 1, characterized in that: Preprocess the target data of floating objects on the water surface, including: Rotate the target image ; Randomly flip the target image horizontally and vertically, randomly crop and scale the target image; randomly change the brightness, contrast, and color saturation of the target image; add Gaussian noise with a mean of 0 and a standard deviation of 0.1 to the target image.
4. The method for identifying water environment targets according to claim 1, characterized in that: The yolov8-OMCIL network model includes a backbone network, a head network and a task detection network; The backbone network includes a first convolutional layer, a second convolutional layer, a first feature fusion layer, a third convolutional layer, a second feature fusion layer, a fourth convolutional layer, a third feature fusion layer, a fifth convolutional layer, a hybrid network reverse residual attention mechanism module and an SPPF module which are connected in sequence; The head network includes a first upsampling layer, a first connection layer, a fourth feature fusion layer, a second upsampling layer, a second connection layer, a fifth feature fusion layer, a first CotNet module, a sixth convolutional layer, a third connection layer, a sixth feature fusion layer, a second CotNet module, a seventh convolutional layer, a fourth connection layer, a seventh feature fusion layer and a third CotNet module connected in sequence; The task detection network includes a first detection module, a second detection module and a third detection module; The output end of the second feature fusion layer is connected to the second connection layer; the output end of the third feature fusion layer is connected to the first connection layer; The output end of the SPPF module is connected to the first upsampling layer; The output end of the first upsampling layer is connected to the fourth connection layer; the output end of the fourth feature fusion layer is connected to the third connection layer; The output end of the sixth convolutional layer is connected to the first detection module; the output end of the second CotNet module is connected to the second detection module; and the output end of the third CotNet module is connected to the third detection module.
5. The method for identifying water environment targets according to claim 4, characterized in that: The first convolutional layer, the sixth convolutional layer, and the seventh convolutional layer are set as Conv convolutional units; the second to fifth convolutional layers are set as ODConv convolutional units; The ODConv convolution unit includes a dynamic convolution input layer, a global average pooling layer, a first fully connected layer and a ReLU activation function connected in sequence; the ReLU activation function connects the second fully connected layer, the third fully connected layer, the fourth fully connected layer and the fifth fully connected layer; the second to fourth fully connected layers are all connected to a single Sigmoid activation function layer; the fifth fully connected layer is connected to a Softmax activation function layer; the Sigmoid activation function layer and the Softmax activation function layer are connected to n dynamic convolution kernels; the n dynamic convolution kernels are connected to a first adder; the first adder and the dynamic convolution input layer are both connected to a first multiplier; the first multiplier is connected to a dynamic convolution output layer; Input the feature map x into the ODConv convolution unit to obtain the feature map y, expressed as: ; Among them, x represents the input feature map of the ODConv convolution unit, and y represents the output feature map of the ODConv convolution unit. Represented as the channel attention weight of the i-th dynamic convolution kernel, Represented as the output channel attention of the i-th dynamic convolution kernel; is the input channel attention of the i-th dynamic convolution kernel; is the spatial attention of the i-th dynamic convolution kernel; is a multiplication operation; Represents the i-th convolution kernel, and the value range of i is .
6. The method for identifying water environment targets according to claim 4, characterized in that: The hybrid network reverse residual attention mechanism module includes a hybrid network input layer, a first convolution kernel, a second multiplier, a depth-separable convolution, a second adder, a second convolution kernel, a third adder and a hybrid network output layer connected in sequence; the hybrid network input layer is connected to the third adder and the attention matrix unit; the attention matrix unit is connected to the second multiplier; the output end of the second multiplier is connected to the second adder; the first convolution kernel and the second convolution kernel are set to 1×1 convolution.
7. The method for identifying water environment targets according to claim 4, characterized in that: The first CotNet module, the second CotNet module and the third CotNet module include a cross-modal input layer; the cross-modal input layer is connected to the third convolution kernel, the fourth convolution kernel and the fifth connection layer; The fourth convolution kernel, the fifth connection layer, the fifth convolution kernel, the sixth convolution kernel, the third multiplier, the fourth adder and the cross-modal output layer are connected in sequence; the output end of the third convolution kernel is connected to the sixth convolution kernel; the output end of the fourth convolution kernel is connected to the fourth adder.
8. The method for identifying water environment targets according to claim 4, characterized in that: The yolov8-OMCIL network model is trained through training samples to obtain training recognition results, including: Input the training sample into the backbone network of the yolov8-OMCIL network model; output the feature map P1 from the SPPF module in the backbone network, and input the feature map P1 into the first upsampling layer; upsample the feature map P1 through the first upsampling layer to obtain the feature map Q1; The third feature fusion layer outputs the feature map P2, and the feature map Q1 and the feature map P2 are spliced through the first connection layer and sent to the fourth feature fusion layer in sequence; the fourth feature fusion layer outputs the feature map Q2, and the feature map Q2 is upsampled through the second upsampling layer to obtain the feature map Q3; The second feature fusion layer outputs the feature map P3, and the feature map Q3 and the feature map P3 are spliced through the second connection layer, and then sent to the fifth feature fusion layer, the first CotNet module and the sixth convolution layer in sequence. The sixth convolution layer generates a detection feature map U1 and sends it to the first detection module; The detection feature map U1 and the feature map Q2 are spliced through the third connection layer and sent to the sixth feature fusion layer and the second CotNet module in sequence; the second CotNet module outputs the detection feature map U2; The detection feature map U2 is sequentially input to the seventh convolution layer and the fourth connection layer; the output features of the seventh convolution layer are spliced with the feature map Q1 through the fourth connection layer, and then sent to the seventh feature fusion layer and the third CotNet module in sequence; the third CotNet module outputs the detection feature map U3; The detection feature map U1, the detection feature map U2 and the detection feature map U3 are detected to obtain a floating object recognition framework, which is recorded as a training recognition result.
9. The method for identifying water environment targets according to claim 1, characterized in that: The training loss value between the training recognition result and the training sample is calculated according to the MPDIoU loss function. The expression formula is: ; ; ; in, It is expressed as the coordinates of the upper left corner of the floating object identification frame; It is expressed as the coordinates of the lower right corner of the floating object identification frame; Represented as the coordinates of the upper left corner of the float frame in the real label; is the coordinate of the lower right corner of the floating object frame in the real label; is the square of the Euclidean distance between the upper left corner of the pre-floating object identification frame and the floating object frame in the true label; is the square of the Euclidean distance between the lower right corner of the pre-floating object recognition frame and the floating object frame in the real label; w and h represent the width and height of the floating object frame in the real label respectively; It is the intersection-over-union ratio of the pre-floating object recognition frame and the floating object frame in the true label.
10. A water environment target recognition system, characterized in that: include: The monitoring module is used to collect monitoring images of floating objects on the water surface, and input the monitoring images of floating objects on the water surface into the preset yolov8-OMCIL network model to obtain the monitoring results of floating objects; Model building module, used to build yolov8-OMCIL network model based on yolov8 network model, hybrid network reverse residual attention mechanism and cross-modal attention mechanism; The acquisition module is used to obtain the target data of floating objects on the water surface, pre-process the target data of floating objects on the water surface and add real labels to obtain training samples. The training module is used to train the yolov8-OMCIL network model through training samples to obtain training recognition results; the training loss value between the training recognition results and the training samples is calculated according to the MPDIoU loss function, the weight parameters of the yolov8-OMCIL network model are optimized based on the training loss value, and the training process of the yolov8-OMCIL network model is repeatedly iterated until the iteration threshold is reached to output the trained yolov8-OMCIL network model.
Citation Information
Patent Citations
Target detection method and system based on YOLOv8 network
CN116958688A
Person re-identification method of integrating global features and ladder-shaped local features and device thereof
US20230162522A1
Cited By
Water surface floating object adaptive identification and tracking method and system
CN120355753B