A lightweight underwater target detection method and system based on image enhancement

By enhancing and feature fusion processing of color shift, overlap and occlusion problems in underwater target detection, the problems of low detection rate and large calculation amount in the prior art are solved, and efficient and accurate underwater target detection are achieved.

CN114821286BActive Publication Date: 2025-04-18SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210533831.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2025-04-18
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

There are problems of color offset, target overlap and occlusion in underwater target detection, and the existing methods based on deep convolutional neural networks have low detection rate and large calculation amount.

Method used

The multi-scale retinal enhancement algorithm with color recovery is used to preprocess the training set images, and feature extraction and fusion are used for lightweight convolutional neural networks and feature pyramid networks to improve detection accuracy and speed.

Benefits of technology

It significantly improves the accuracy and detection speed of underwater target detection, reduces the calculation amount and model size, and enhances the robustness of underwater targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114821286B_ABST
    Figure CN114821286B_ABST
Patent Text Reader

Abstract

The present invention discloses a lightweight underwater target detection method and system based on image enhancement, comprising the following steps: firstly, preprocessing the real underwater optical training set images using an image enhancement algorithm; then extracting the training set image features using a lightweight convolutional neural network; extracting feature images of three scales and processing them using a feature pyramid network with a fusion attention module; using a classification regression layer to calculate the processed feature images and regress the category and position of the underwater target contained in the image; marking the target position using a rectangular frame and displaying the target category name in the upper left corner; designing and implementing an underwater target detection system, which uses the method of the present invention to perform underwater image detection and video detection. The present invention is robust to color deviation, target occlusion and overlapping target detection in real underwater scenes, and the test results show that the method of the present invention can achieve high detection accuracy while ensuring the lightweight of the detection model.
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 based on convolutional neural networks, and in particular to a lightweight underwater target detection method and system based on image enhancement. Background Art

[0002] As people's demand for material resources continues to increase, the ocean, which is rich in mineral, chemical and biological resources, has become the focus of human exploration. However, the degree of human development of the ocean so far is very low, only about 5% to 10%, so exploring and studying the marine environment and resources has become one of the hot fields today. Underwater target detection refers to the process of determining the position, size and category of underwater targets in the input image, and is a key technology for underwater image processing. With the rise of artificial intelligence and deep learning, underwater target detection has broad application prospects in ocean exploration. At present, target detection based on deep convolutional neural networks can be divided into two-stage method and one-stage method according to its detection stage. The two-stage method first selectively searches for the region of interest in the image, and then classifies and regresses the region; the one-stage method abandons the extraction of the region of interest in the image, and directly extracts the image features and performs classification and regression. The one-stage method is an end-to-end target detection method with a streamlined process. While ensuring accuracy, it has a smaller amount of calculation and lower equipment requirements. Therefore, it is more applicable in underwater target detection scenarios.

[0003] Reference 1 (CHEN L, LIU Z, TONG L, et al. Underwater object detection using Invert Multi-Class Adaboost with deep learning [C]. In: 2020 International Joint Conference on Neural Networks (IJCNN), 2020: 19-24.) is a sample-weighted hybrid one-stage detection method for underwater small object detection. This method first extracts high-resolution and semantically rich feature maps, and uses a novel sample re-weighting algorithm to reduce the impact of noise on detection accuracy. It can achieve higher detection accuracy while ensuring speed. Reference 2 (LIN WH, ZHONG JX, LIU S, et al. RoIMix: Proposal-Fusion among Multiple Images for Underwater Object Detection [C]. In: 2020 IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), 2020: 2588-2592.) is a feature fusion-based underwater target detection method. This method uses candidate boxes to fuse different targets to generate new feature information for occluded and overlapping targets in underwater scenes, simulates underwater target training samples, and has strong robustness and high underwater target detection accuracy. Reference 3 (GE Z, LIU ST, WANG F, et al. YOLOX: Exceeding YOLO Series in 2021[J]. arXiv: 2107.08430, 2021.) proposes a lightweight one-stage target detection method YOLOX (You Only Look Once X), which combines the decoupling head, data enhancement and anchor-free detection with the traditional YOLO (You Only Look Once) method. It can be applied to target detection in different scenarios and has high detection accuracy and strong generalization.

[0004] Underwater target detection has its own particular complexity, and the reasons are as follows: the wavelength of light is absorbed and scattered in the underwater environment, which directly leads to the problem of weak contrast and severe color degradation of underwater images; at the same time, the low transparency of seawater and the high content of tiny inorganic and organic matter in the water hinder the propagation of light, resulting in visibility loss and color deviation in underwater images. The existence of the above problems has greatly reduced the quality of underwater images, resulting in low accuracy when detecting underwater image data. Object detection methods based on convolutional neural networks have achieved great success in computer vision tasks and are widely used in various target detection scenarios. In order to significantly improve the detection accuracy, such methods often use baseline networks with complex structures and a large number of parameters, ignoring real-time and lightweight portability. Summary of the invention

[0005] In order to overcome the problems of color cast, target overlap and occlusion in underwater scenes, as well as the problems of low detection rate and large computational complexity in existing underwater target detection based on deep convolutional neural networks, the present invention proposes a lightweight underwater target detection method based on image enhancement. The method uses the MSRCR image enhancement algorithm to preprocess the training set, and uses a lightweight feature extraction network and a feature pyramid network that integrates multiple attention modules of scale, channel and space to effectively fuse context information, so that the detector can fully focus on the feature information of underwater targets, while having faster detection speed and higher accuracy.

[0006] A lightweight underwater detection method based on image enhancement specifically comprises the following steps:

[0007] S1. Collect images containing various underwater targets in real optical underwater scenes, and mark the underwater targets to be detected in the images to form a training set; the underwater targets include sea urchins, starfish, scallops and sea cucumbers; the marking is to circle the targets in the underwater images with rectangular frames and mark the category names of the targets in the rectangular frames.

[0008] S2, unify the size of the underwater training set images in step S1 and use the image enhancement algorithm to perform image processing to obtain a preprocessed underwater optical image training set; the unification of the training set image size is to transform the size of the training set image so that its length and width are the same as the length and width set by the method of the present invention; the image enhancement algorithm adopts a multi-scale retinal enhancement algorithm with color restoration (Multi-Scale Retinex with Color Restoration, MSRCR), and the specific process is as follows:

[0009] B1. First, perform multi-scale retinal enhancement (MSR) processing on the initial training set images:

[0010]

[0011] Among them, s j is the original image, s j (x, y) is the pixel point in the original image, F MSR is the enhancement result, N is the number of single-scale retinal enhancement algorithms, * is the convolution operation, ω j It is the weight factor corresponding to the j-th single-scale retinal enhancement algorithm, generally taken as ∑ω j =1,f j (x,y) is the filter function, which is expressed as follows:

[0012]

[0013] Among them, the value of k must satisfy ∫∫f(x,y)dxdy=1; σ j represents the kernel parameters;

[0014] B2. MSRCR algorithm further introduces the color restoration factor based on the MSR algorithm. Its formula is as follows:

[0015] F MSRCR =c j (x,y)F MSR (x,y)

[0016] Among them, F MSRCR represents the enhancement result, c j (x,y) is the color restoration factor, which must meet the following conditions:

[0017]

[0018] Wherein, μ and η represent the color restoration gain factor and bias, both of which are constants.

[0019] S3, constructing a convolutional neural network for underwater target detection; the underwater target detection convolutional neural network first uses a lightweight convolutional neural network to extract feature images of three different scales; the lightweight convolutional neural network is composed of a lightweight convolution block and a residual bottleneck structure; then a feature pyramid module is used to process and fuse the feature images of three different scales; the feature pyramid module is composed of upsampling, downsampling, average pooling, maximum pooling, convolution operation, scale attention, channel attention, spatial attention and full connection layer composed of residual layer; finally, the three fused feature images are input into the classification regression layer for prediction;

[0020] The underwater target detection convolutional neural network uses a lightweight convolutional neural network to extract feature images of three scales; the sizes of the extracted feature images of the three scales are respectively and Where M is the length and width of the training set image; the lightweight convolutional neural network is used to extract feature images of three scales, which are set from large to small as f1, f2 and f3. The process is as follows:

[0021]

[0022] in, To perform n G-bneck residual bottleneck structure processing; Conv1 represents a convolution operation with a convolution kernel size of 3×3 and a step size of 2; Input represents the input preprocessed underwater optical training set image; the residual bottleneck structure is divided into two categories with a step size of 1 and a step size of 2. When the step size is 1: When the step length is 2: F G-bneck (z) = F LC (Conv1(F LC (z)))+z; where z is the function variable, F LC The lightweight convolution operation sequentially sets the convolution operation with a convolution kernel size of 1×1 and a step size of 1 and the layer-by-layer convolution operation from front to back; in the feature image, in the calculation process of f1, the G-bneck residual bottleneck structure with a step size of 1 is used for the second and fourth times, and the residual bottleneck structure with a step size of 1 is used for the rest; in the calculation process of f2 and f3, the residual bottleneck structure with a step size of 2 is used for the first time, and the residual bottleneck structure with a step size of 1 is used for the rest.

[0023] The feature pyramid module is used to process and fuse feature images of three different scales. The specific principle is as follows:

[0024] The feature images extracted by the lightweight convolutional neural network are subjected to upsampling, downsampling, residual bottleneck layer and fusion attention module operations to perform fusion of different scales; the three fused feature images are set as F1, F2 and F3 from large to small, and the principle is as follows:

[0025] F1=F CSP (F LCS (F up (Q2)+f1))

[0026] F2=F CSP (F LCS (F down (F1)+Q2))

[0027] F3=F CSP (F LCS (F down (F2)+Q1))

[0028] Where, Q1 = Conv2(f3), Q2 = F LCS (F up(Q1)+f2), F up is the upsampling function, F down is the downsampling function, Conv2 represents the convolution operation with a convolution kernel size of 1×1 and a step size of 1, and F CSP The residual bottleneck layer is:

[0029] F CSP (z) = z + (3 × (z + Conv2 (z)))

[0030] F LCS To integrate the attention module, specifically:

[0031] F LCS (z) = F LA +F CA +F SA +z

[0032] in:

[0033] F LA (z)=z·δ(Conv2(AvgPool(z)))

[0034] F CA (z) = z·δ(FC(MaxPool(z)))

[0035] F SA (z)=z·δ(Conv3(MaxPool(z),AvgPool(z)))

[0036] Among them, AvgPool is the average pooling operation, MaxPool is the maximum pooling operation, FC is the fully connected operation, Conv3 represents the convolution operation with a convolution kernel size of 7×7 and a step size of 1, and δ is the Sigmoid activation function.

[0037] The three fused feature images are input into the classification regression layer for prediction; the fused feature images F1, F2 and F3 processed by the feature pyramid network which introduces the fusion scale, channel and spatial attention modules are respectively input into the three classification regression layers; the classification regression layer is provided with a convolution layer, a batch normalization layer and an activation function layer from front to back; the three input fused feature images are respectively subjected to multiple 3×3 convolutions and 1×1 convolutions to change the number of channels to obtain the classification regression layer prediction result; the average confidences of the prediction results of the three classification regression layers are compared, and the prediction result with the highest average confidence is selected to calculate and obtain the information representing the category and position of the underwater target.

[0038] S4, using the underwater target detection convolutional neural network constructed in step S3 to train the training set preprocessed in step S2; during training, the underwater image target is identified and located through the results output by the classification regression layer, and the target position is marked with a rectangular frame, and underwater targets of different categories are marked to obtain an underwater target image with a rectangular frame and target category;

[0039] S5. Set the relevant hyperparameters and conventional optimization algorithms required for training the underwater target detection convolutional neural network, and save the weight parameter file of the convolutional neural network training when the loss function converges;

[0040] S6. Construct a lightweight underwater target detection model based on image enhancement, that is, introduce the weight parameter file obtained in step S5 into the underwater target detection convolutional neural network constructed in step S3, and use the detection model to perform target detection on the underwater image to be detected. At the same time, the detection model will automatically record the underwater target rectangular frame contained in the detection image, and identify and mark the target type in the rectangular frame.

[0041] The present invention also provides a lightweight underwater target detection system based on image enhancement, comprising the following modules:

[0042] An underwater image acquisition module, configured to acquire a training set of underwater images to be detected;

[0043] An underwater target image detection model acquisition module is configured to construct an underwater target image detector by combining the weight parameter file described in claim 1 with a lightweight underwater target detection method based on image enhancement, and to perform target detection and recognition in underwater images;

[0044] The underwater target video detection model acquisition module is configured to construct an underwater target video detector by combining the weight parameter file described in claim 1 with a lightweight underwater target detection method based on image enhancement, and perform target detection and recognition in underwater videos.

[0045] Beneficial effects:

[0046] 1. The present invention proposes a lightweight underwater target detection method and system based on image enhancement. The training set contains a large number of color-biased and blurred underwater images with target occlusion and overlap. The present invention first uses a retinal enhancement algorithm with color restoration to enhance the training set images, and then uses a lightweight convolutional neural network to extract features to speed up the detection network training speed and reduce the number of parameters.

[0047] 2. After using a lightweight convolutional neural network to extract underwater target feature images, the present invention fully fuses the extracted feature images of different scales using a feature pyramid network composed of sampling, residual bottleneck structure and fusion attention module, and inputs the fused features into the classification regression layer to obtain the prediction results.

[0048] 3. The present invention designs and implements an underwater target detection system, which can use the lightweight underwater target detection method based on image enhancement proposed by the present invention to perform target detection in underwater images and videos. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 The overall structure diagram of the underwater target detection method used in the embodiment of the present invention;

[0050] Figure 2 A structural diagram of a hybrid attention module involved in the underwater target detection method used in an embodiment of the present invention, wherein sub-graph b1 is a scale attention structural diagram, sub-graph b2 is a channel attention structural diagram, and sub-graph b3 is a spatial attention structural diagram;

[0051] Figure 3 This is a general operation flow chart of the underwater target detection system according to an embodiment of the present invention;

[0052] Figure 4 It is a structural diagram of the underwater target detection system according to an embodiment of the present invention;

[0053] Figure 5 It is a comparison diagram of some underwater detection effects between the comparison method YOLOX and the embodiment of the present invention, wherein sub-figures a1 and a2 are underwater detection effect diagrams of the comparison method YOLOX, and sub-figures b1 and b2 are underwater detection effect diagrams of the embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to further describe the lightweight underwater target detection method and system based on image enhancement proposed by the present invention, an underwater image of an embodiment of the present invention is described in conjunction with the accompanying drawings to enhance the understanding of the purpose, method structure and application effect of the present invention. The embodiment is only a further explanation of the present invention, and researchers in this field can make further non-fundamental technical improvements on the basis of the present invention, which are also within the scope of protection of the present invention.

[0055] A lightweight underwater target detection method based on image enhancement specifically comprises the following steps:

[0056] S1, collecting images containing various underwater targets in real optical underwater scenes, and marking the underwater targets to be detected in the images to form a training set; the underwater targets include sea urchins, starfish, scallops and sea cucumbers; the marking is to circle the targets in the underwater images with rectangular frames and mark the category names of the targets in the rectangular frames;

[0057] S2, unify the size of the underwater training set images in step S1 and use the image enhancement algorithm to perform image processing to obtain a preprocessed underwater optical image training set; the unification of the training set image size is to transform the size of the training set image so that its length and width are the same as the length and width set by the method of the present invention; the image enhancement algorithm adopts a multi-scale retinal enhancement algorithm with color restoration (Multi-Scale Retinex with Color Restoration, MSRCR), and the specific process is as follows:

[0058] First, perform multi-scale retinal enhancement (MSR) processing on the initial training set images:

[0059]

[0060] Among them, s j is the original image, s j (x, y) is the pixel point in the original image, F MSR is the enhancement result, N is the number of single-scale retinal enhancement algorithms, * is the convolution operation, ω j It is the weight factor corresponding to the j-th single-scale retinal enhancement algorithm, generally taken as ∑ω j =1,f j (x,y) is the filter function, which is expressed as follows:

[0061]

[0062] Among them, the value of k must satisfy ∫∫f(x,y)dxdy=1; σ j represents the kernel parameters;

[0063] The MSRCR algorithm further introduces a color restoration factor based on the MSR algorithm. The formula is as follows:

[0064] F MSRCR =cj(x,y)F MSR (x,y)

[0065] Among them, F MSRCR represents the enhancement result, c j (x,y) is the color restoration factor, which must meet the following conditions:

[0066]

[0067] Wherein, μ and η represent the color restoration gain factor and bias, both of which are constants.

[0068] S3, constructing a convolutional neural network for underwater target detection; the underwater target detection convolutional neural network first uses a lightweight convolutional neural network to extract feature images of three different scales; the lightweight convolutional neural network is composed of a lightweight convolution block and a residual bottleneck structure; then the feature images of the three scales extracted are processed and fused by introducing a feature pyramid network that integrates scale, channel and spatial attention modules; finally, the three fused feature images are input into a classification regression layer for prediction;

[0069] S4, using the underwater target detection convolutional neural network constructed in step S3 to train the training set preprocessed in step S2; during training, the underwater image target is identified and located through the results output by the classification regression layer, and the target position is marked with a rectangular frame, and underwater targets of different categories are marked to obtain an underwater target image with a rectangular frame and target category;

[0070] S5. Set the relevant hyperparameters and conventional optimization algorithms required for training the underwater target detection convolutional neural network, and save the weight parameter file of the convolutional neural network training when the loss function converges;

[0071] S6. Construct a lightweight underwater target detection model based on image enhancement, that is, introduce the weight parameter file obtained in step S5 into the underwater target detection convolutional neural network constructed in step S3, and use the detection model to perform target detection on the underwater image to be detected. At the same time, the detection model will automatically record the underwater target rectangular frame contained in the detection image, and identify and mark the target type in the rectangular frame.

[0072] 1. As a specific implementation of the present invention, the underwater target detection convolutional neural network in step S3 uses a lightweight convolutional neural network to extract feature images of three scales; the sizes of the feature images of the three scales extracted are respectively and Where M is the length and width of the training set image; the lightweight convolutional neural network is used to extract feature images of three scales, which are set from large to small as f1, f2 and f3. The process is as follows:

[0073]

[0074] in, To perform n G-bneck residual bottleneck structure processing; Conv1 represents a convolution operation with a convolution kernel size of 3×3 and a step size of 2; Input represents the input preprocessed underwater optical training set image; the residual bottleneck structure is divided into two categories with a step size of 1 and a step size of 2. When the step size is 1: When the step length is 2: F G-bneck (z) = F LC (Conv1(F LC(z)))+z; where z is the function variable, F LC Lightweight convolution operation, which sets the convolution kernel size to 1×1, the stride to 1, and the layer-by-layer convolution operation from front to back;

[0075] For the feature images f1, f2 and f3, in the calculation process of f1, the G-bneck residual bottleneck structure with a step size of 1 is used for the second and fourth times, and the residual bottleneck structure with a step size of 1 is used for the rest; in the calculation process of f2 and f3, the residual bottleneck structure with a step size of 2 is used for the first time, and the residual bottleneck structure with a step size of 1 is used for the rest.

[0076] As a specific implementation of the present invention, the feature pyramid network of the fusion scale, channel and spatial attention modules introduced in step S3 processes and fuses the feature images of the three scales selected and extracted, and the principle is as follows:

[0077] The feature images extracted by the lightweight convolutional neural network are subjected to upsampling, downsampling, residual bottleneck layer and fusion attention module operations to perform fusion of different scales; the three fused feature images are set as F1, F2 and F3 from large to small, and the principle is as follows:

[0078] F3=F CSP (F LCS (F up (Q2)+f3))

[0079] F2=F CSP (F LCS (F down (F3)+Q2))

[0080] F1=F CSP (F LCS (F down (F2)+Q1))

[0081] Where, Q1 = Conv2(f3), Q2 = F LCS (F up (Q1)+f2), F up is the upsampling function, F down is the downsampling function, Conv2 represents the convolution operation with a convolution kernel size of 1×1 and a step size of 1, and F CSP The residual bottleneck layer is:

[0082] F CSP (z) = z + (3 × (z + Conv2 (z)))

[0083] F LCS To integrate the attention module, specifically:

[0084] FLCS (z) = F LA +F CA +F SA +z

[0085] F LCS (z) = F LA +F CA +F SA +z

[0086] in:

[0087] F LA (z)=z·δ(Conv2(AvgPool(z)))

[0088] F CA (z) = z·δ(FC(MaxPool(z)))

[0089] F SA (z)=z·δ(Conv3(MaxPool(z),AvgPool(z)))

[0090] Among them, AvgPool is the average pooling operation, MaxPool is the maximum pooling operation, FC is the fully connected operation, Conv3 represents the convolution operation with a convolution kernel size of 7×7 and a step size of 1, and δ is the Sigmoid activation function.

[0091] As a specific implementation of the present invention, in step S3, the three fused feature images are input into the classification regression layer for prediction; the fused feature images F1, F2 and F3 processed by the feature pyramid network that introduces the fusion scale, channel and spatial attention modules are respectively input into the three classification regression layers; the classification regression layer is provided with a convolution layer, a batch normalization layer and an activation function layer from front to back; the three input fused feature images are respectively subjected to multiple 3×3 convolutions and 1×1 convolutions to change the number of channels to obtain the classification regression layer prediction results; the average confidences of the prediction results of the three classification regression layers are compared, and the prediction result with the highest average confidence is selected to calculate and obtain information representing the category and position of the underwater target.

[0092] The present invention also provides a lightweight underwater target detection system based on image enhancement, comprising the following modules:

[0093] An underwater image acquisition module, configured to acquire a training set of underwater images to be detected;

[0094] An underwater target image detection model acquisition module is configured to construct an underwater target image detector by combining the weight parameter file described in claim 1 with a lightweight underwater target detection method based on image enhancement, and to perform target detection and recognition in underwater images;

[0095] The underwater target video detection model acquisition module is configured to construct an underwater target video detector by combining the weight parameter file described in claim 1 with a lightweight underwater target detection method based on image enhancement, and perform target detection and recognition in underwater videos.

[0096] Simulation experiment:

[0097] This simulation experiment uses an underwater image training set from the official URPC2021 dataset. This dataset comes from the optical image competition of the National Underwater Robot Competition and contains 7,543 annotated real underwater optical images, including color casts and weak contrast caused by various lighting conditions. There are four types of targets: sea urchins, starfish, scallops, and sea cucumbers, and there are complex detection scenarios such as target overlap and occlusion.

[0098] The dataset is divided into training set and test images with a ratio of 9:1.

[0099] The underwater target detection accuracy and model size results of the comparison method YOLOX and the method of the present invention in the test image are shown in Table 1.

[0100] Table 1 Statistics of underwater target detection accuracy and model size in simulation experiments

[0101]

[0102] It can be seen from Table 1 that the method of the present invention can effectively detect underwater targets. Compared with the YOLOX method, it has obvious advantages in the detection of starfish and scallops, and the average accuracy is improved by 1.25%, and the detection model is reduced by 46.1%.

[0103] from Figure 5 It can be seen that the method of the present invention is more robust than the YOLOX method in detecting blurred, overlapping and occluded targets, and can detect more targets.

[0104] The above simulation experimental results fully demonstrate that the method of the present invention can efficiently detect targets in underwater images and identify their types while ensuring the lightweight of the underwater target detection network. The use of the method of the present invention has lower hardware requirements and better overall performance, which shows the effectiveness and advancement of the method of the present invention.

[0105] The above is an explanation of the method and system of the present invention, and researchers in the field can reproduce the present invention through these explanations. Based on the content of the present invention, other embodiments and results obtained by researchers without creative work should fall within the scope of protection of the present invention.

Claims

1. A lightweight underwater target detection method based on image enhancement, characterized in that: The following steps are involved: S1, collecting images containing underwater targets in real optical underwater scenes, and marking the underwater targets to be detected in the images to form a training set; the underwater targets include four categories: sea urchins, starfish, scallops and sea cucumbers; the marking is to circle the targets in the underwater images with rectangular frames and mark the category names of the targets in the rectangular frames; S2, unify the size of the underwater training set images in step S1 and use the image enhancement algorithm to perform image processing to obtain a preprocessed underwater optical image training set; the unification of the training set image size is to transform the size of the training set image so that its length and width are the same as the length and width set by the method of the present invention; the image enhancement algorithm adopts a multi-scale retinal enhancement algorithm with color restoration (Multi-Scale Retinex with Color Restoration, MSRCR), and the specific process is as follows: First, perform multi-scale retinal enhancement (MSR) processing on the initial training set images: Among them, s j is the original image, s j (x, y) is the pixel point in the original image, F MSR is the enhancement result, N is the number of single-scale retinal enhancement algorithms, * is the convolution operation, ω j It is the weight factor corresponding to the j-th single-scale retinal enhancement algorithm, generally taken as ∑ω j =1,f j (x,y) is the filter function, which is expressed as follows: Among them, the value of k must satisfy ∫∫f(x,y)dxdy=1; σ j represents the kernel parameters; The MSRCR algorithm further introduces a color restoration factor based on the MSR algorithm. The formula is as follows: F MSRCR =c j (x,y)F MSR (x,y) Among them, F MSRCR represents the enhancement result, c j (x,y) is the color restoration factor, which must meet the following conditions: Wherein, μ and η represent the color restoration gain factor and bias, both of which are constants; S3, constructing a convolutional neural network for underwater target detection; the underwater target detection convolutional neural network first uses a lightweight convolutional neural network to extract feature images of three different scales; the lightweight convolutional neural network is composed of a lightweight convolution block and a residual bottleneck structure; then a feature pyramid module is used to process and fuse the feature images of three different scales; the feature pyramid module is composed of upsampling, downsampling, average pooling, maximum pooling, convolution operation, scale attention, channel attention, spatial attention and full connection layer composed of residual layer; finally, the three fused feature images are input into the classification regression layer for prediction; S4, using the underwater target detection convolutional neural network constructed in step S3 to train the training set preprocessed in step S2; during training, the underwater image target is identified and located through the results output by the classification regression layer, and the target position is marked with a rectangular frame, and underwater targets of different categories are marked to obtain an underwater target image with a rectangular frame and target category; S5. Set the relevant hyperparameters and conventional optimization algorithms required for training the underwater target detection convolutional neural network, and save the weight parameter file of the convolutional neural network training when the loss function converges; S6. Construct a lightweight underwater target detection model based on image enhancement, that is, introduce the weight parameter file obtained in step S5 into the underwater target detection convolutional neural network constructed in step S3, and use the detection model to perform target detection on the underwater image to be detected. At the same time, the detection model will automatically record the underwater target rectangular frame contained in the detection image, and identify and mark the target type in the rectangular frame.

2. A lightweight underwater target detection method based on image enhancement according to claim 1, characterized in that: The underwater target detection convolutional neural network in step S3 uses a lightweight convolutional neural network to extract feature images of three scales; the sizes of the feature images of the three scales extracted are respectively and Where M is the length and width of the training set image; the lightweight convolutional neural network is used to extract feature images of three scales, which are set from large to small as f1, f2 and f3. The process is as follows: in, To perform n G-bneck residual bottleneck structure processing; Conv1 represents a convolution operation with a convolution kernel size of 3×3 and a step size of 2; Input represents the input preprocessed underwater optical training set image; the residual bottleneck structure is divided into two categories with a step size of 1 and a step size of 2. When the step size is 1: When the step length is 2: F G-bneck (z) = F LC (Conv1(F LC (z)))+z; where z is the function variable, F LC Lightweight convolution operation, which sets the convolution kernel size to 1×1, the stride to 1, and the layer-by-layer convolution operation from front to back; For the feature images f1, f2 and f3, in the calculation process of f1, the G-bneck residual bottleneck structure with a step size of 1 is used for the second and fourth times, and the residual bottleneck structure with a step size of 1 is used for the rest; in the calculation process of f2 and f3, the residual bottleneck structure with a step size of 2 is used for the first time, and the residual bottleneck structure with a step size of 1 is used for the rest.

3. The lightweight underwater target detection method based on image enhancement according to claim 1 is characterized in that: In step S3, the feature pyramid module is used to process and fuse the feature images of three different scales. The specific principle is as follows: The feature images extracted by the lightweight convolutional neural network are subjected to upsampling, downsampling, residual bottleneck layer and fusion attention module operations to perform fusion of different scales; the three fused feature images are set as F1, F2 and F3 from large to small, and the principle is as follows: F1=F CSP (F LCS (F up (Q2)+f1)) F2=F CSP (F LCS (F down (F1)+Q2)) <h2 style=";text-align:left;direction:ltr">F3=F<h2 style=";text-align:left;direction:ltr"> CSP <h2 style=";text-align:left;direction:ltr"> (F<h2 style=";text-align:left;direction:ltr"> LCS <h2 style=";text-align:left;direction:ltr"> (F<h2 style=";text-align:left;direction:ltr"> down <h2 style=";text-align:left;direction:ltr"> (F2)+Q1)) Where, Q1 = Conv2(f3), Q2 = F LCS (F up (Q1)+f2), F up is the upsampling function, F down is the downsampling function, Conv2 represents the convolution operation with a convolution kernel size of 1×1 and a step size of 1, and F CSP The residual bottleneck layer is: F CSP (z)=z+(3×(z+Conv2(z))) F LCS To integrate the attention module, specifically: F LCS (z)=F LA +F CA +F SA +z in: F LA (z)=z·δ(Conv2(AvgPool(z))) F CA (z)=z·δ(FC(MaxPool(z))) F SA (z)=z·δ(Conv3(MaxPool(z),AvgPool(z))) Among them, AvgPool is the average pooling operation, MaxPool is the maximum pooling operation, FC is the fully connected operation, Conv3 represents the convolution operation with a convolution kernel size of 7×7 and a step size of 1, and δ is the Sigmoid activation function.

4. The lightweight underwater target detection method based on image enhancement according to claim 1 is characterized in that: In step S3, the three fused feature images are input into the classification regression layer for prediction; the fused feature images F1, F2 and F3 processed by the feature pyramid network that introduces the fusion scale, channel and spatial attention modules are respectively input into the three classification regression layers; the classification regression layer is provided with a convolution layer, a batch normalization layer and an activation function layer from front to back; the three input fused feature images are respectively subjected to multiple 3×3 convolutions and 1×1 convolutions to change the number of channels to obtain the classification regression layer prediction results; the average confidences of the prediction results of the three classification regression layers are compared, and the prediction result with the highest average confidence is selected to calculate and obtain information representing the category and position of the underwater target.

5. A lightweight underwater target detection system based on image enhancement, characterized in that: Includes the following modules: An underwater image acquisition module, configured to acquire a training set of underwater images to be detected; An underwater target image detection model acquisition module is configured to construct an underwater target image detector by combining the weight parameter file described in claim 1 with a lightweight underwater target detection method based on image enhancement, and to perform target detection and recognition in underwater images; The underwater target video detection model acquisition module is configured to construct an underwater target video detector by combining the weight parameter file described in claim 1 with a lightweight underwater target detection method based on image enhancement, and perform target detection and recognition in underwater videos.