Underwater target detection method and system based on self-attention distillation and image enhancement

By introducing self-attention distillation and image enhancement technology into the underwater target detection network, the problem of insufficient robustness in feature extraction by deep neural networks is solved, significantly improving the accuracy and speed of underwater target detection, and improving the robustness of the network. and generalizability.

CN115049815BInactive Publication Date: 2024-08-23NANJING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210498288.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-09
Publication Date
2024-08-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing underwater target detection technology, the target features extracted by deep neural networks are not robust enough, the model recognition accuracy is low, and the information between feature layers is ignored.

Method used

Using a method based on self-attention distillation and image enhancement, the self-attention distillation mechanism and the dark channel prior image enhancement module are introduced into the Yolov5 network to obtain the feedback connection path from the back layer to the front layer and improve the robustness of the feature representation. sex and discriminability.

Benefits of technology

It significantly improves the accuracy and speed of underwater target detection, improves the generalization and robustness of the network, and solves the problems of insufficiently robust feature representation and low model recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115049815B
    Figure CN115049815B
Patent Text Reader

Abstract

A method and system for underwater target detection based on self-attention distillation and image enhancement, the method comprising the steps of: constructing a target detection model, embedding an underwater image enhancement module based on a dark channel prior based on a Yolov5 network; introducing self-attention distillation into the Yolov5 network at the same time, obtaining a feedback connection path from the back layer to the front layer; training the target detection model to obtain the optimal target detection model training that meets the accuracy requirements; collecting images and inputting them into the optimal target detection model training to perform underwater target detection. The present invention improves the generalization and robustness of the underwater target detection network, and solves the problems that the feature representation extracted by the existing underwater target detection network is not robust enough and the model recognition accuracy is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of underwater target detection, and in particular to an underwater target detection method and system based on self-attention distillation and image enhancement. Background Art

[0002] The development of marine resources has become an increasingly important task in my country. Due to the complexity and uncertainty of the marine environment, it is risky for people to directly enter the ocean for exploration. Underwater robots have attracted much attention because they can replace people to work in dangerous underwater environments. When working underwater, robots rely on visual systems to perceive the underwater environment. The underwater target detection system is an important part of the underwater robot's visual system, which is mainly responsible for completing two functions: underwater image enhancement and underwater target detection. The core of underwater target detection is to locate various underwater targets in the image; however, the underwater environment is complex and changeable, and it is difficult to collect a large number of underwater images. At the same time, the collected images are blurred, have low resolution, and have target stacking, which makes it difficult for the images obtained by underwater robots to directly meet actual needs, and to a certain extent affects the accuracy and efficiency of subsequent target detection.

[0003] An underwater target detection method based on improved SSD and transfer learning (CN 111209952 A), an underwater target detection method based on an improved YOLO algorithm (CN 110765865 A), a strong negative sample underwater target detection method based on Faster-RCNN (CN 109165658 B), a lightweight underwater target detection method based on CenterNet (CN113420819 A), an underwater target detection method based on small sample machine learning and hyperparameter optimization (CN 113239980 A) and a detection network method for underwater target detection (CN 110956222 B). The main technical means of these underwater target detection methods are: obtaining an underwater perception and recognition target image dataset A, inputting the underwater perception and recognition target image data into a deep neural network, using the deep neural network to extract the perception and recognition target feature representation, and finally obtaining the perception and recognition target classification result. For example, in a method for underwater target detection based on strong negative samples of Faster-RCNN (CN 109165658 B), the underwater target image is input into the convolutional neural network to obtain a low-dimensional feature map, the low-dimensional feature map is input into the RPN network to obtain positive and negative samples, and the features of the positive and negative sample suggestion areas are extracted; the acquired suggestion area features are passed into the fully connected layer, and the classification results of the area are output. These methods rely on the feature representation ability of deep neural networks, focus on the feature information of underwater images, and ignore the information between the feature layers of deep neural networks. There are problems such as the feature representation extracted by the network is not robust enough and the model recognition accuracy is low. Summary of the invention

[0004] In order to solve the problems that the target features extracted by the existing underwater target detection technology network are not robust enough and the model recognition accuracy is low, the present invention proposes an underwater target detection method and system based on self-attention distillation and image enhancement, which can adaptively capture the information encoded in the feature attention graphs of different layers, supervise the deep neural network and accurately locate and identify the target position.

[0005] The technical solution to achieve the purpose of the present invention is: an underwater target detection method based on self-attention distillation and image enhancement, comprising the steps of:

[0006] Construct a target detection model based on the Yolov5 network and embed an underwater image enhancement module based on dark channel prior. At the same time, introduce self-attention distillation into the Yolov5 network to obtain the feedback connection path from the back layer to the front layer.

[0007] Train the target detection model to obtain the optimal target detection model training that meets the accuracy requirements;

[0008] The collected images are input into the optimal target detection model training to perform underwater target detection.

[0009] Furthermore, the underwater image enhancement module performs image enhancement by constructing an underwater imaging model, using a dark channel to detect the darkest areas before 0.1%, taking the average of the input image pixel values ​​corresponding to these areas as the estimated value of the background light, and using the attenuation ratios of different channels to estimate the transmittance map to perform preliminary enhancement of the underwater image; and simultaneously using the gray world algorithm for color correction.

[0010] Furthermore, the underwater imaging model is:

[0011] I λ (x) = J λ (x)t λ (x)+A λ (1-t λ (x))

[0012] Among them, x is the pixel of the image, λ is the RGB three channels, I λ (x) is the turbid image, J λ (x) is the original image of the scene, A λ is the background light, t λ (x) is the transmittance of each channel, J λ (x)t λ (x) is the direct irradiation component, A λ (1-t λ (x) is the backscattered component.

[0013] Furthermore, the transmittance of each channel tλ (x) is:

[0014] t λ (x) = e -βλdλ(x)

[0015] Among them, β λ is the attenuation coefficient, d λ (x) is the depth of field.

[0016] Furthermore, the original scene image J λ (x) is:

[0017]

[0018] in, is the transmittance of each channel t λ The estimated value of (x) is:

[0019]

[0020] Where Ω(x) is a size×size region, A λ is the atmospheric light value of pixel x in the λ channel, I λ (x) is the turbid image of pixel x in the λ channel.

[0021] Furthermore, the self-attention distillation is specifically as follows:

[0022] Based on the activated self-attention distillation, the mapping function G is generated:

[0023] G:R Cm×Hm×Wm →R Cm×Hm

[0024] Where: C m is the channel, H m is the height, W m is the width;

[0025] Constructor by counting the absolute value of each element:

[0026]

[0027]

[0028]

[0029] Among them, A mi Indicates A m The i-th slice in the channel dimension, G sum (A m ) represents the function constructed by summing when P = 1, represents the function constructed by summing when P>1, The function constructed by maximizing .

[0030] Furthermore, the method for training the target detection model is:

[0031] Obtain underwater perception and recognition target image dataset A under different shooting conditions, and use LabelImg to annotate the data. The annotation file includes the image name, image size, rectangular bounding box coordinates, and perception and recognition target category;

[0032] The underwater perception and recognition target image dataset A is input into the target detection model for iterative training until a target detection model that meets the accuracy requirements is obtained.

[0033] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the underwater target detection method based on self-attention distillation and image enhancement is implemented.

[0034] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the underwater target detection method based on self-attention distillation and image enhancement.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] (1) The present invention designs an underwater image enhancement method, which uses the attenuation ratio of different channels to estimate the transmittance map and perform preliminary underwater image enhancement. The gray world algorithm is used for color correction to improve the image color effect, effectively improve the image quality and contrast, and obtain the best underwater image enhancement effect;

[0037] (2) The present invention introduces self-attention distillation into the underwater target detection network, provides a feedback connection path from the back layer to the front layer, and allows the network to extract information from the attention map of the back layer that is helpful for the learning of the front layer. This connection helps to promote reciprocal learning between consecutive layers through self-attention distillation, uses the network's own attention map as the distillation target, and adaptively captures the information encoded in the feature attention maps of different layers, thereby improving the robustness and discriminability of underwater target feature representation;

[0038] (3) Image enhancement and self-attention distillation are embedded into the target detection network to achieve end-to-end underwater image enhancement and target detection, which significantly improves the detection accuracy and speed of underwater perception and recognition targets. It can also improve the generalization and robustness of the underwater target detection network and solve the problems of insufficient robustness of feature representation extracted by the existing underwater target detection network and low model recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1Flowchart of the underwater target detection method based on self-attention distillation and image enhancement.

[0040] Figure 2 Schematic diagram of the training phase of the underwater object detection method based on self-attention distillation and image enhancement.

[0041] Figure 3 Schematic diagram of the testing phase of the underwater object detection method based on self-attention distillation and image enhancement. DETAILED DESCRIPTION

[0042] The technical solutions in the embodiments of the present invention are described clearly and completely below. The described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] An underwater target detection method based on self-attention distillation and image enhancement, specifically comprising:

[0044] 1. Data preparation stage

[0045] 1.1 Collect a large number of underwater perception and recognition target image datasets A under different shooting conditions, and use LabelImg to annotate the data. The annotation files include information such as image name, image size, rectangular bounding box coordinates, and perception and recognition target category.

[0046] 2. Model design stage

[0047] 2.1 Design an underwater image enhancement method based on dark channel prior.

[0048] Similar to the principle of fog formation, light scatters when it encounters suspended particles and plankton, causing turbidity in underwater images. For this reason, the present invention designs an underwater image enhancement method based on dark channel prior to preprocess underwater images: the darkest area before 0.1% is detected by dark channel, and the average value of the input image pixel values ​​corresponding to these areas is used as the estimated value of the background light. The transmittance map is estimated using the attenuation ratio of different channels to perform preliminary enhancement of underwater images. The gray world algorithm is used for color correction to improve the color visual effect of the image, effectively improve the image quality and contrast, and obtain the best underwater image enhancement effect.

[0049] The formation principle of underwater image turbidity is similar to that of fog, both of which are caused by the scattering of visible light encountering suspended particles. To address this problem, the present invention proposes an underwater image enhancement method based on dark channel prior. The underwater imaging model can be expressed as:

[0050] I λ (x) = J λ (x)t λ(x)+A λ (1-t λ (x))

[0051] Among them, x is the pixel of the image, λ is the RGB three channels, I λ (x) is the turbid image, J λ (x) is the original image of the scene, A λ is the background light, t λ (x) is the transmittance of each channel, J λ (x)t λ (x) is the direct irradiation component, A λ (1-t λ (x)) is the backscattered component. λ (x) is given by the attenuation coefficient β λ and depth of field d λ (x) determine:

[0052] t λ (x) = e -βλdλ(x)

[0053] Considering the existence of sunlight, the light source consists of background light and sunlight. Detect the darkest area in the first 0.1% and take the average value of the corresponding pixel values ​​in these areas as the background light value.

[0054]

[0055] Assume that the transmittance is a constant in the local area Ω(x) and is expressed as Ω(x) is a size×size area (size=15), and the dark channel is calculated at both ends:

[0056]

[0057] Statistics show that in any local area of ​​a clear, non-turbid image, at least one channel has low brightness:

[0058]

[0059] The transmittance of each channel is estimated for:

[0060]

[0061] Then the original scene image J λ (x):

[0062]

[0063] A λ is the atmospheric light value of pixel x in the λ channel, Iλ (x) is the turbid image of pixel x in the λ channel. To improve the image color effect, the gray world algorithm is used for color correction.

[0064] 2.2 Underwater object detection network based on self-attention distillation.

[0065] Self-attention distillation is divided into activation-based self-attention distillation and gradient-based self-attention distillation. Gradient-based self-attention distillation, which obtains the self-attention map by using the gradient output of the layer, is difficult to achieve ideal results; while activation-based self-attention distillation, which obtains the self-attention map by processing the activation of the feature layer, has produced considerable results in underwater target detection networks. Introducing self-attention distillation into the target detection network Yolov5 pre-trains an underwater target detection network: when the model is trained to a reasonable level, the feature attention maps from different layers will encode rich information, which can be used as a supervisory target detection network without additional notes. The present invention introduces self-attention distillation in the target detection network, allowing the network to use its own high-level attention map as the distillation target of the underlying attention map, thereby enhancing the feature expression ability of the backbone network. Based on activation-based self-attention distillation, its self-attention map generation is equivalent to finding a mapping G:

[0066] G:R Cm×Hm×Wm →R Cm×Hm

[0067] Where: C m is the channel, H m is the height, W m is the width;

[0068] The absolute value of each element in the mapping function represents the importance of this element in the final output. The function is constructed by counting the absolute value of each element:

[0069]

[0070]

[0071]

[0072] Among them, A mi Indicates A m The i-th slice in the channel dimension, G sum (A m ) represents the function constructed by summing when P = 1, represents the function constructed by summing when P>1, When P>1, A mi Indicates A m The i-th slice in the channel dimension. G sum(A m )and compared to, More weight is given to regions with higher activation. The larger P is, the more attention is paid to these regions. It is empirically found that when P = 2, the performance improvement is greater. With G sum (A m )compared to, Computing weights across multiple neurons, rather than picking the maximum value of those neurons as the weight, is less biased.

[0073] Compared with directly using labels to supervise each layer of the network, self-attention distillation provides a feedback connection path from the later layer to the previous layer, allowing the network to extract information from the attention map of the later layer that helps the learning of the previous layer. This connection helps promote reciprocal learning between consecutive layers through self-attention distillation.

[0074] 2.3 Introduce the underwater image enhancement method into the underwater target detection network and train the deep neural network M end-to-end.

[0075] When solving problems such as the feature representation extracted by the network is not robust enough and the model recognition accuracy is low, the objective function of a module may deviate from the macroscopic goal of the system, and the trained detection system does not achieve the optimal performance. Yolov5 is used as the target detection network, and an underwater image enhancement method based on dark channel prior is introduced in the underwater target detection network Yolov5. End-to-end training of underwater target detection network based on self-attention distillation and image enhancement avoids the inherent defects of multiple modules and reduces the complexity of the project.

[0076] 3. Model training phase

[0077] 3.1 The underwater perception and recognition target image dataset A obtained in step 1.1 is divided into a training set T, a validation set V and a test set I according to the ratio of 8:1:1;

[0078] 3.2 Input the training set T into the end-to-end model M designed in step 2.3 for model training. During the training phase, the validation set V is used to verify the model training effect. When the model M obtains good results on the validation set V and the accuracy does not improve with the training process, stop training;

[0079] 3.3 The final training is completed and the model M' is obtained.

[0080] 4. Model testing phase

[0081] The underwater image test set I is input into the trained model M', and the target is detected, perceived and recognized end-to-end. After testing, the model improves the robustness and discriminability of underwater target feature representation.

[0082] An underwater target detection system based on self-attention distillation and image enhancement includes a data acquisition module and a target detection model; the data acquisition module is used to collect underwater target image data, and the target detection model is used for underwater target detection. It is based on the Yolov5 network and embedded with an underwater image enhancement module based on dark channel priors; at the same time, self-attention distillation is introduced into the network Yolov5 to obtain a feedback connection path from the back layer to the front layer. The system includes all the technical features of the method, which will not be repeated here.

Claims

1. An underwater target detection method based on self-attention distillation and image enhancement, characterized in that: Includes steps: Construct a target detection model based on the Yolov5 network and embed an underwater image enhancement module based on dark channel prior. At the same time, introduce self-attention distillation into the Yolov5 network to obtain the feedback connection path from the back layer to the front layer. Train the target detection model to obtain the optimal target detection model training that meets the accuracy requirements; Collect images and input them into the optimal target detection model training to perform underwater target detection; The underwater image enhancement module performs image enhancement by: constructing an underwater imaging model, using a dark channel to detect the darkest areas before 0.1%, taking the average of the input image pixel values ​​corresponding to these areas as the estimated value of the background light, and using the attenuation ratio of different channels to estimate the transmittance map to perform preliminary underwater image enhancement; and using a gray world algorithm to perform color correction; The underwater imaging model is: I λ (x)=J λ (x)t λ (x)+A λ (1-t λ (x)) Among them, x is the pixel of the image, λ is the RGB three channels, I λ (x) is the turbid image, J λ (x) is the original image of the scene, A λ is the background light, t λ (x) is the transmittance of each channel, J λ (x)t λ (x) is the direct radiation component, A λ (1-t λ (x) is the backscattered component; The transmittance of each channel t λ (x) is: t λ (x)=e -βλdλ(x) Among them, β λ is the attenuation coefficient, d λ (x) is the depth of field; The original scene image J λ (x) is: in, is the transmittance of each channel t λ The estimated value of (x) is: Where Ω(x) is a size×size region, A λ is the atmospheric light value of pixel x in the λ channel, I λ (x) is the turbid image of pixel x in the λ channel.

2. The underwater target detection method based on self-attention distillation and image enhancement according to claim 1, characterized in that: The self-attention distillation is specifically as follows: Based on the activated self-attention distillation, the mapping function G is generated: G:R Cm×Hm×Wm →R Cm×Hm Where: C m is the channel, H m is the height, W m is the width; Constructor by counting the absolute value of each element: Among them, A mi Indicates A m The i-th slice in the channel dimension, G sum (A m ) represents the function constructed by summing when P = 1, represents the function constructed by summing when P>1, The function constructed by maximizing .

3. The underwater target detection method based on self-attention distillation and image enhancement according to claim 1, characterized in that: The method for training the target detection model is: Obtain underwater perception and recognition target image dataset A under different shooting conditions, and use LabelImg to annotate the data. The annotation file includes the image name, image size, rectangular bounding box coordinates, and perception and recognition target category; The underwater perception and recognition target image dataset A is input into the target detection model for iterative training until a target detection model that meets the accuracy requirements is obtained.

4. An underwater target detection system based on self-attention distillation and image enhancement for implementing the underwater target detection method according to any one of claims 1 to 3, characterized in that: It includes a data acquisition module and a target detection model; the data acquisition module is used to collect underwater target image data, and the target detection model is used for underwater target detection. It is based on the Yolov5 network and is embedded with an underwater image enhancement module based on dark channel prior; at the same time, self-attention distillation is introduced into the network Yolov5 to obtain a feedback connection path from the back layer to the front layer.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the underwater target detection method based on self-attention distillation and image enhancement as described in any one of claims 1-3 is implemented.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the underwater target detection method based on self-attention distillation and image enhancement as described in any one of claims 1-3 is implemented.