CN-121999350-A - Underwater target detection method, device, equipment and storage medium
Abstract
The application discloses a method, a device, equipment and a storage medium for detecting an underwater target, which relate to the technical field of target detection and comprise the steps of acquiring an original image through an underwater camera of a target underwater robot in the process of detecting the underwater target by the target underwater robot; performing color correction on the original image to obtain a first image, performing contrast enhancement processing on the first image to obtain a second image, performing defogging processing on the second image to obtain a corresponding target image, performing target detection on the target image by using a target detection model deployed in the target underwater robot to obtain a target detection result corresponding to the target image, wherein the target detection model is a model obtained by training an optimized YOLOv model. Therefore, the application can realize high-efficiency and reliable target detection in the underwater scene, improves the accuracy of the detection result, and is suitable for underwater search and rescue or marine resource exploration.
Inventors
- XI SIYUAN
- LIU KAIQIAN
- CHEN TIAN
- WANG WENHAO
- HUANG SILONG
- CHEN LIWEI
Assignees
- 郑州大学
Dates
- Publication Date
- 20260508
- Application Date
- 20260127
Claims (10)
- 1. An underwater target detection method, comprising: In the process of detecting an underwater target by using a target underwater robot, acquiring an original image by an underwater camera of the target underwater robot; performing color correction on the original image to obtain a first image, performing contrast enhancement processing on the first image to obtain a second image, and performing defogging processing on the second image to obtain a corresponding target image; And performing target detection on the target image by using a target detection model deployed in the target underwater robot to obtain a target detection result corresponding to the target image, wherein the target detection model is a model obtained by training an optimized YOLOv model.
- 2. The method for detecting an underwater target according to claim 1, wherein the performing color correction on the original image to obtain a first image, performing contrast enhancement processing on the first image to obtain a second image, and performing defogging processing on the second image to obtain a corresponding target image comprises: performing color correction on the original image through automatic white balance processing or gray world hypothesis algorithm to obtain the first image; Performing image logarithmic transformation and multi-scale Gaussian blur processing on the first image by utilizing a multi-scale Retinex algorithm to estimate illumination distribution in the first image, and calculating corresponding multi-scale reflection components based on an illumination distribution estimation result; Correcting the multi-scale reflection component based on a color recovery factor, and adjusting and normalizing the correction result to obtain the second image; And defogging the second image by using a dark primary color prior algorithm or a Sea-Thu algorithm to obtain the target image.
- 3. The underwater target detection method as claimed in claim 1, further comprising: Introducing CBAM attention mechanism in the backbone network of the YOLOv model, replacing the activation function of the convolution layer with FReLU activation function, and introducing pyramid attention structure in Neck layers to obtain the optimized YOLOv5 model.
- 4. A method of underwater target detection as claimed in claim 3, further comprising: acquiring a plurality of initial underwater images, and labeling the initial underwater images by LabelImg to obtain a plurality of labeled images; performing color correction, contrast enhancement processing and defogging processing on the marked image to obtain a corresponding target underwater image, and performing data enhancement processing on the target underwater image to obtain a plurality of enhanced images; and constructing a target data set based on the enhanced image, and training the optimized YOLOv model based on the target data set to obtain the target detection model.
- 5. The method for detecting an underwater target according to claim 4, wherein the performing data enhancement processing on the target underwater image to obtain a plurality of enhanced images comprises: randomly selecting a first preset number of target underwater images, and performing mosaics splicing on the selected target underwater images to obtain corresponding enhanced images; Or randomly selecting a second preset number of target underwater images, determining labels in the target underwater images, and linearly mixing the target underwater images with the labels to obtain corresponding enhanced images, wherein the labels are obtained by labeling the initial underwater images corresponding to the target underwater images by LabelImg; Or, performing image transformation on the target underwater image to obtain the corresponding enhanced image, wherein the image transformation comprises rotation, scaling, translation and shearing; Or, adjusting the color attribute of the target underwater image to obtain the corresponding enhanced image, wherein the color attribute comprises tone, saturation and brightness; or, performing random clipping and horizontal overturning treatment on the target underwater image to obtain the corresponding enhanced image.
- 6. The underwater target detection method of claim 4 or 5, wherein before the training of the optimized YOLOv model based on the target dataset, further comprising: Constructing a first loss function based on a classification loss function, a first adjustable parameter corresponding to the classification loss function, a bounding box regression loss function, and a second adjustable parameter corresponding to the bounding box regression loss function; correspondingly, in the training process of the optimized YOLOv model, the training method further includes: Optimizing the first adjustable parameter and the second adjustable parameter in the first loss function to obtain an optimized first loss function, and obtaining a first result output by the optimized YOLOv model in the training process; Determining initial loss based on the first result and the optimized first loss function, and updating model parameters of the optimized YOLOv model based on the initial loss to obtain an initial detection model; Training the initial detection model based on the target data set to obtain the target detection model.
- 7. The method of claim 6, wherein training the initial detection model to obtain the target detection model comprises: determining a second loss function through a dynamic weight average algorithm, and acquiring a second result output by the initial detection model in the training process; determining a target loss based on the second result and the second loss function, and updating model parameters of the initial detection model based on the target loss to obtain the target detection model; correspondingly, after the training is performed on the initial detection model to obtain the target detection model, the method further includes: and converting the target detection model into a target format and deploying the target detection model into the target underwater robot so as to carry out underwater target detection by utilizing the target detection model, wherein the target format comprises a Tensor RT format.
- 8. An underwater target detection apparatus, comprising: The image acquisition module is used for acquiring an original image through an underwater camera of the target underwater robot in the process of detecting an underwater target by using the target underwater robot; The image processing module is used for carrying out color correction on the original image to obtain a first image, carrying out contrast enhancement processing on the first image to obtain a second image, and carrying out defogging processing on the second image to obtain a corresponding target image; The target detection module is used for carrying out target detection on the target image by utilizing a target detection model deployed in the target underwater robot so as to obtain a target detection result corresponding to the target image, wherein the target detection model is a model obtained by training an optimized YOLOv model.
- 9. An electronic device comprising a processor and a memory, wherein the memory is configured to store a computer program that is loaded and executed by the processor to implement the underwater target detection method as claimed in any of claims 1 to 7.
- 10. A computer readable storage medium for storing a computer program which when executed by a processor implements the underwater target detection method as claimed in any of claims 1 to 7.
Description
Underwater target detection method, device, equipment and storage medium Technical Field The present invention relates to the field of target detection technologies, and in particular, to a method, an apparatus, a device, and a storage medium for detecting an underwater target. Background With the continued awareness of humans about the ocean, it was found that it is of great importance to the development of socioeconomic performance, and thus the ocean has become the best option for humans to seek survival space and resources. In recent years, due to increasing interest in marine exploration, pollution monitoring, scientific research, search and rescue tasks, video mapping and other underwater things, underwater exploration has become a hot topic. Due to the complexity and uncertainty of the underwater environment, achieving accurate identification of underwater targets presents a number of challenges. Existing methods typically include image preprocessing, object detection, and the like. However, in an underwater environment, the image quality is generally poor due to the influence of light refraction, water turbidity and other factors, and difficulty is brought to target detection. Meanwhile, the traditional recognition algorithm is not ideal in the positioning condition of the target to be recognized in the preprocessed image, and is generally characterized in that the positioning accuracy of target object detection is not high and more time is required, so that the recognition of the underwater target is greatly influenced, the blurring of underwater imaging is caused, and the recognition accuracy of the target object is influenced. In summary, how to improve the efficiency and accuracy of underwater target detection is a technical problem to be solved at present. Disclosure of Invention Accordingly, the present invention is directed to a method, apparatus, device and storage medium for detecting an underwater target, which can improve the efficiency and accuracy of detecting an underwater target. The specific scheme is as follows: in a first aspect, the present application provides a method for detecting an underwater target, comprising: In the process of detecting an underwater target by using a target underwater robot, acquiring an original image by an underwater camera of the target underwater robot; performing color correction on the original image to obtain a first image, performing contrast enhancement processing on the first image to obtain a second image, and performing defogging processing on the second image to obtain a corresponding target image; And performing target detection on the target image by using a target detection model deployed in the target underwater robot to obtain a target detection result corresponding to the target image, wherein the target detection model is a model obtained by training an optimized YOLOv model. Optionally, the performing color correction on the original image to obtain a first image, performing contrast enhancement processing on the first image to obtain a second image, and performing defogging processing on the second image to obtain a corresponding target image includes: performing color correction on the original image through automatic white balance processing or gray world hypothesis algorithm to obtain the first image; Performing image logarithmic transformation and multi-scale Gaussian blur processing on the first image by utilizing a multi-scale Retinex algorithm to estimate illumination distribution in the first image, and calculating corresponding multi-scale reflection components based on an illumination distribution estimation result; Correcting the multi-scale reflection component based on a color recovery factor, and adjusting and normalizing the correction result to obtain the second image; And defogging the second image by using a dark primary color prior algorithm or a Sea-Thu algorithm to obtain the target image. Optionally, the underwater target detection method further includes: Introducing CBAM attention mechanism in the backbone network of the YOLOv model, replacing the activation function of the convolution layer with FReLU activation function, and introducing pyramid attention structure in Neck layers to obtain the optimized YOLOv5 model. Optionally, the underwater target detection method further includes: acquiring a plurality of initial underwater images, and labeling the initial underwater images by LabelImg to obtain a plurality of labeled images; performing color correction, contrast enhancement processing and defogging processing on the marked image to obtain a corresponding target underwater image, and performing data enhancement processing on the target underwater image to obtain a plurality of enhanced images; and constructing a target data set based on the enhanced image, and training the optimized YOLOv model based on the target data set to obtain the target detection model. Optionally, the performing data enhancement p