A high-precision and fast target detection method for sonar images and its model building method
By introducing the CMB structure and Wise-IoU loss function into the YOLOv7 network, combined with the residual connection and pyramid structure, the problem of poor detection results of the traditional sonar image detection model in complex ocean environments is solved, and the goals of high accuracy and speed are achieved. Detection, suitable for marine environment.
Patent Information
- Application Number
- CN202410509852.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2024-08-13
- Estimated Expiration
- 2044-04-26
AI Technical Summary
The traditional sonar image target detection model has problems such as low signal-to-noise ratio, uneven brightness, blurred texture, low contrast and severe distortion in complex ocean environments, which affects the target detection effect, and the detection method based on anchor frames relies on manually determined super Parameters, lack of generalization.
A high-precision and fast target detection model for sonar images is proposed. The YOWE network model is built based on the YOLOv7 network structure. The CMB structure and Wise-IoU loss function are introduced to improve detection accuracy and robustness through feature fusion and multi-scale output heads. Combined with the residual Connections and pyramid structures speed up training and improve generalization.
It improves the accuracy and robustness of target detection in sonar images, reduces model deviation and variance, improves generalization ability, and can accurately identify targets of different scales and characteristics in complex marine environments. It is suitable for marine ecological research and military security assurance. .
Smart Images

Figure 1.1
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of underwater computer vision technology, and in particular relates to a sonar image high-precision rapid target detection method and a model building method thereof. Background Art
[0002] Sonar has special advantages in the underwater imaging process. Optical images are affected by factors such as water quality and surface fluctuations underwater, and are prone to reflection and refraction. The light intensity will rapidly weaken with the increase of depth, or even disappear completely, resulting in a decrease in image quality. Unlike optical images, sonar images are less affected. Sonar images are not limited by light conditions and are not affected by the surface characteristics of underwater objects. They can also effectively detect targets in environments with extremely limited light, such as the deep sea. In addition, sound waves have a stronger ability to propagate in water than light waves, and can penetrate turbidity, depth and other interferences in the water, so that sonar images can provide clearer and more comprehensive underwater information and provide more stable and reliable images. These advantages make acoustic methods an important means of ocean exploration at present. Research on sonar image target detection is of great significance to improving marine safety, promoting the development and utilization of marine resources, promoting marine scientific research, and maintaining the marine environment.
[0003] However, the traditional acoustic detection model assumes a simplified marine environment, which limits its applicability in real environments, especially in shallow sea areas. The complex environment of the marine medium, such as the sound channel formed by regular changes in the speed of sound, random scattering, irregularities of the sea surface and seabed, eddies, turbulence, organisms, etc., these objective factors affect the research and application of marine acoustics. At the same time, accompanied by the variability of operating and environmental conditions, the existence of ocean reverberation, environmental noise and self-noise, and the limitations of sonar imaging principles, sonar images generally have low signal-to-noise ratio, uneven brightness, blurred texture, low contrast and severe distortion, which greatly affects the target detection effect.
[0004] Forward-looking sonar is flexible in operation and more suitable for close-range target detection and identification and forward obstacle avoidance. It is widely used in military and civilian fields. Designing an efficient and accurate forward-looking sonar image target detection and identification method can effectively support marine ecological research and development and military security work.
[0005] In the development history of deep learning-based object detection technology, detection algorithms can be roughly divided into two categories according to the workflow: two-stage algorithms and one-stage algorithms. The former divides the detection task into two steps: first extracting candidate regions, and then classifying candidate regions. Its advantage is high detection accuracy. Representative network models include R-CNN, Fast R-CNN, Faster R-CNN, etc. The latter does not require region proposals and obtains the category probability and location coordinates of the target in one step, so it has a speed advantage over the two-stage algorithm. Representative network models include YOLO, SSD, etc.
[0006] Depending on whether the network feature extraction process relies on a large number of scattered anchor frames, common detection network models can be divided into anchor-based and non-anchor-based networks. The essential difference between anchor-based and anchor-free detection lies in how to define positive and negative training samples, which leads to the performance gap between the two. In recent years, target detection based on CNN development has been dominated by anchor-based detection. For both the two-stage and single-stage methods, they first tile a large number of preset anchor points on the image, then predict the categories of these anchor points, and refine the coordinates of these anchor points once or several times as the detection result output.
[0007] The anchor-based detection method is an improvement on the traditional sliding window method, making it easier to generate region proposals. Anchors can be regarded as hand-crafted prior bounding boxes. They are classified as positive and negative samples according to the degree of overlap with the true box, and the prediction output of the bounding box position network is located based on additional offset regression. In object-oriented target detection algorithms, anchor-based methods tend to perform better. However, anchors are associated with many hyperparameters that need to be manually determined using prior knowledge, which increases the amount of calculation. Although YOLOv2 proposes to use a clustering algorithm to obtain prior box information, this method does not have generalization, and the positive and negative samples depend on the IoU value between the prior box and the true box. The hyperparameters have a great impact on the final performance of the detector. Summary of the invention
[0008] In view of the above problems, the first aspect of the present invention provides a method for building a high-precision and fast target detection model for sonar images, comprising the following steps:
[0009] Step 1, obtaining a large number of sonar echo intensity original images, wherein the original images are downloaded from an open source platform or directly obtained by sonar underwater;
[0010] Step 2: preprocess the original image obtained in step 1; grayscale the original image based on the characteristics of the sonar image, and generate a corresponding label file for the target object contained in each image to describe the coordinate position and category of the target object; finally, divide the data set into a training set, a validation set, and a test set;
[0011] Step 3, based on the YOLOv7 network structure, build a new YOWE network model; the YOWE network model includes input, backbone network CSPDarknet and detection output Head, and introduces CMB structure in Head. The CMB structure includes feature fusion part and detection part. The feature fusion part helps the model to extract information from features at different levels and use high-level semantic information to assist target detection. Even if the underlying features of the sonar image are affected by noise or blur, the sonar image target can still be correctly identified; the detection part is to add an output layer, each output layer is responsible for detecting targets of different scales and features, and helps the model make full use of multi-scale information;
[0012] Step 4: Use the training set and validation set in step 2 to train the YOWE network model built in step 3, and introduce Wise-IoU as the loss function;
[0013] Step 5: Use the test set in step 2 to test the trained YOWE network model, and select the model with the best verification effect as the final model.
[0014] Preferably, the preprocessing in step 2 also includes the following process: performing equal-interval extraction on the sonar echo intensity map collected on-site using sonar to increase the irrelevance between images; and simultaneously performing inversion, rotation and cropping for data enhancement processing.
[0015] Preferably, the CMB structure is specifically:
[0016] The CMB structure includes a feature fusion part and a detection part. The feature fusion part includes a BConv module, a UPSample module and a CatConv module, which are used to enable the network to process features more effectively; the BConv includes a convolution layer, a batch normalization layer and an activation layer. The convolution kernel size of the convolution is 1, and the activation layer uses a leaky rectified linear activation function. The BConv module first performs a depth-separable convolution to reduce the number of channels, and then performs a standard convolution to increase the number of channels. The BConv module is used to reduce the computational complexity and improve the model performance, improve the model computational efficiency and parameter utilization; the UPSample module is used to upsample the feature map, thereby using the fusion of feature maps of different scales or upgrading the low-resolution feature map to a higher resolution level; the Catconv module The invention comprises two branches, the first branch is composed of a BConv module with a convolution kernel of 1×1 and a step size of 1, and the second branch is composed of a BConv module with a convolution kernel of 1×1 and a step size of 1×1 and four BConv modules with convolution kernels of 3×3 and a step size of 1 in cascade; the Catconv module is used to realize the association between features of more layers; the detection part comprises a REP module and a Conv module for obtaining a more accurate prediction effect; the REP module has different structures during training and deployment, and a 1×1 convolution branch is added to the 3×3 convolution branch during training, and if the input and output channels and image sizes are consistent, a BN branch is added, and the three branches are added and output, and a 3×3 main branch convolution output is used during deployment; the REP module is used to enhance the model's perception of the input image.
[0017] Preferably, the specific processing flow of the CMB structure is:
[0018] S1, input the last feature fusion result of the network into the BConv module;
[0019] S2, inputs the result of S1 into UPSample for upsampling;
[0020] S3, passes the input of the first layer E-ELAN in the backbone network to the BConv module;
[0021] S4, passes the output of S3 and S2 to the Catconv module to fuse the feature maps;
[0022] S5, input the features fused in S4 into the BConv module, and perform channel reduction and increase processing again;
[0023] S6, divides the output of S5 into two branches, one branch is input into the MPConv module, introducing additional branches and operations to make feature extraction more diverse and flexible; the other branch is input into the REP module to expand the receptive field of the model;
[0024] S7, passing the output of the MPConv module to the subsequent feature processing network, passing the output of the REP module to the Conv module, the Conv module is the convolutional layer; finally, the Conv module outputs a final detection result branch.
[0025] Preferably, the BConv module is used to halve the channel to obtain an output feature map with half the length and width, thereby achieving a super downsampling result; the BConv module is composed of a convolution layer, a batch normalization layer BN and a LeakyReLU activation function; the convolution layer uses a 1×1 convolution kernel and a step size of 1; the BN layer performs normalization processing on each neuron and is a key step in data preprocessing; the calculation method of the LeakyReLU activation function is as follows:
[0026]
[0027] in, is a constant less than 1, called the leaky coefficient; LeakyReLU avoids the zero gradient problem by introducing a small linear slope in the negative region.
[0028] Preferably, Wise-IoU is introduced as the loss function to replace the original CIoU loss function, a dynamic focusing mechanism is adopted, "outlier degree" is used instead of IoU to evaluate the quality of the anchor frame, and a gradient gain allocation strategy with better performance is adopted.
[0029] Preferably, residual connections and pyramid structures are used for feature extraction in the backbone network CSPDarknet and the detection output Head; cross-layer connections are added between certain layers of the network, and the output of the previous layer is directly added to the input of the next layer, so that the network learns the residual information, that is, the difference between the previous layer and the next layer, so as to more effectively propagate the gradient; in the YOWE model, the pyramid structure is implemented by convolutional layers or pooling layers of different scales, and these layers interact through cross-layer connections or downsampling operations, and finally an output with multi-scale feature representation is obtained; combined with residual connections and pyramid structures, the REP module in the YOWE model enables the network to better propagate gradients and accelerate the training process.
[0030] The second aspect of the present invention also provides a high-precision and rapid target detection method for sonar images, comprising the following process:
[0031] Obtain sonar echo intensity map through sonar;
[0032] Processing the obtained sonar echo intensity image in grayscale and inputting it into the target detection model constructed by the construction method described in the first aspect;
[0033] Output the coordinate position and category result map of the target object.
[0034] The third aspect of the present invention also provides a high-precision and rapid target detection device for sonar images, the device includes at least one processor and at least one memory, the processor and the memory are coupled; the memory stores a computer execution program of the target detection model built by the building method described in the first aspect; when the processor executes the computer execution program stored in the memory, the processor executes a high-precision and rapid target detection method for sonar images.
[0035] The fourth aspect of the present invention also provides a computer-readable storage medium, characterized in that: the computer-readable storage medium stores a computer execution program of the target detection model built by the building method described in the first aspect, and when the computer execution program is executed by the processor, the processor executes a high-precision and rapid target detection method for sonar images.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] The present invention is based on the improvement of YOLOv7, proposes the YOWE network model, introduces the CMB structure to improve the model structure and introduces the Wise-IoU loss function, improves the network structure, increases the output head, connects with different levels of the network, specifically captures the features of a specific level, and integrates the results of multiple output heads. On the one hand, the detection accuracy is improved, and on the other hand, more robust and reliable prediction results can be obtained, the deviation and variance of the model can be reduced, and the generalization ability of the model can be improved. Finally, a high-precision and fast target detection method for sonar images based on deep learning is proposed.
[0038] (1) In the CMB structure of the present invention, the feature fusion part helps the model to extract information from features at different levels and use high-level semantic information to assist target detection. Even if the underlying features of the sonar image are affected by noise or blur, the high-level features may still contain useful information, thereby achieving the effect of correctly identifying sonar image targets that are severely affected by noise and difficult to extract feature information. Adding a detection output head allows the model to add an output layer, and each output layer is responsible for detecting targets of different scales and features, helping the model to make full use of multi-scale information and achieve the effect of accurately identifying targets of different scales in sonar images.
[0039] (2) The WIoU introduced in the present invention is used to balance the impact of targets of different sizes on the loss function and improve the detection accuracy of the model; combined with the CBA structure, the network performance is improved to a certain extent, and there is further performance gain when used together.
[0040] (3) Combining residual connections and pyramid structures, the REP module in the YOWE model enables the network to better propagate gradients, accelerate the training process, and improve the model convergence speed; using the pyramid structure, the network can simultaneously capture image information of multiple scales, improving the network's perception of objects of different scales, thereby improving detection accuracy and generalization capabilities. In summary, YOWE uses the characteristics of residual connections and pyramid structures to improve the network's feature extraction and expression capabilities, thereby improving the performance of target detection tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 The figure is an overall logic block diagram of the sonar image target detection and recognition method of the present invention.
[0042] Figure 2 This is an example image of the original data set in Example 1 after grayscale image preprocessing.
[0043] Figure 3 This is a schematic diagram of the overall structure of the YOWE model proposed in the present invention.
[0044] Figure 4 This is a diagram of the CMB structure network proposed in the present invention.
[0045] Figure 5 This is a structural diagram of the BConv module in the CMB structure of the present invention.
[0046] Figure 6 This is a structural diagram of the Catconv module in the CMB structure of the present invention.
[0047] Figure 7 This is a structural diagram of the MPConv module in the CMB structure of the present invention.
[0048] Figure 8 This is a structural diagram of the REP module in the CMB structure of the present invention.
[0049] Fig. 9 This is a diagram showing the detection results in Example 1.
[0050] Fig.10 This is a simplified diagram of the device structure in Example 2 of the present invention. DETAILED DESCRIPTION
[0051] Embodiment 1:
[0052] The advantages of anchor-based detectors are that anchor frames allow the model to detect targets at different scales, enabling the model to handle targets of different sizes and shapes, improving the generalization ability of detection; anchor frames can help the model locate the target more accurately; using them reduces the number of areas that need to be processed, improving computational efficiency; anchor frames can better handle target overlap and avoid confusion and misjudgment of the model.
[0053] Based on the above principle, the present invention proposes a high-precision and fast target detection method for sonar images. The overall logic block diagram is as follows: Figure 1 As shown in the figure, a new YOWE network model is built based on the YOLOv7 network structure; the model building includes the following processes:
[0054] Step 1, obtaining a large number of sonar echo intensity original images, wherein the original images are downloaded from an open source platform or directly obtained by sonar underwater;
[0055] Step 2: preprocess the original image obtained in step 1; grayscale the original image based on the characteristics of the sonar image, and generate a corresponding label file for the target object contained in each image to describe the coordinate position and category of the target object; finally, divide the data set into a training set, a validation set, and a test set;
[0056] Step 3, based on the YOLOv7 network structure, build a new YOWE network model; the YOWE network model includes input, backbone network CSPDarknet and detection output Head, and introduces CMB structure in Head. The CMB structure includes feature fusion part and detection part. The feature fusion part helps the model to extract information from features at different levels and use high-level semantic information to assist target detection. Even if the underlying features of the sonar image are affected by noise or blur, the sonar image target can still be correctly identified; the detection part is to add an output layer, each output layer is responsible for detecting targets of different scales and features, and helps the model make full use of multi-scale information;
[0057] Step 4: Use the training set and validation set in step 2 to train the YOWE network model built in step 3, and introduce Wise-IoU as the loss function;
[0058] Step 5: Use the test set in step 2 to test the trained YOWE network model, and select the model with the best verification effect as the final model.
[0059] 1. Get the raw data
[0060] The dataset used in the present invention is a public dataset downloaded from the Internet, which is a multi-beam forward-looking sonar echo intensity image dataset. The dataset has 7,600 training images and 800 test images, including 10 categories of targets.
[0061] 2. Data Preprocessing
[0062] For the sonar echo intensity images collected by ourselves, we first screen out the duplicate or similar images in the original images, which can be done by equal interval extraction, etc. Because the two adjacent images in the data set are very similar, it will cause the model to overfit, resulting in poor generalization ability of the model in the future; for the useful images screened, we first preprocess the grayscale images, and then use Labelimg to annotate the images. The standard content includes the target object coordinate information and category information, and the labels are converted into COCO format; finally, all images are divided into training set, validation set and test set. The comparison before and after preprocessing is as follows: Figure 2 shown.
[0063] 3.YOWE network model construction
[0064] The specific structure of the YOWE target detection model is as follows Figure 3 As shown, the YOWE model includes an input, a backbone network CSPDarknet and a detection output Head. The YOWE model includes an input end to receive the image to be processed; the CSPDarknet backbone network extracts image features; the feature fusion network calculates and processes the extracted features; and the prediction network infers the target information in the test set based on the learned features. The present invention introduces a CMB structure in the Head. The CMB structure includes a feature fusion part and a detection part. The feature fusion part helps the model to extract information from features at different levels and uses high-level semantic information to assist target detection. Even if the underlying features of the sonar image are affected by noise or blur, the high-level features may still contain useful information, thereby achieving the effect of correctly identifying sonar image targets that are severely affected by noise and difficult to extract feature information. Adding a detection output head allows the model to add an output layer. Each output layer is responsible for detecting targets of different scales and features, helping the model to make full use of multi-scale information and achieve the effect of accurately identifying targets of different scales in sonar images.
[0065] CMB structure Figure 4As shown in the figure: It includes feature fusion part and detection part, which further fuses features based on the original feature fusion and detection network of the network and adds an output head. The feature fusion part includes BConv module, UPSample module and CatConv module, which are used to make the network process features more effectively. The BConv includes a convolution layer, a batch normalization layer and an activation layer. The convolution kernel size of the convolution is 1. The activation layer uses a leaky rectified linear activation function. The BConv module first performs a depth-separable convolution to reduce the number of channels, and then performs a standard convolution to increase the number of channels. The BConv module is used to reduce the computational complexity and improve the model performance, improve the model computational efficiency and parameter utilization; the UPSample module is used to upsample the feature map, thereby using the fusion of feature maps of different scales or upgrading the low-resolution feature map to a higher resolution level; the Catconv module includes two branches, the first branch is composed of a BConv module with a convolution kernel of 1×1 and a step size of 1, and the second branch is composed of a BConv with a convolution kernel of 1×1 and a step size of 1×1 and four BConv modules with a convolution kernel of 3×3 and a step size of 1 cascaded; the Catconv module is used to realize the association between features of more layers. The detection part includes a REP module and a Conv module to obtain a more accurate prediction effect. The REP module has different structures during training and deployment. During training, a 1×1 convolution branch is added to the 3×3 convolution. At the same time, if the input and output channels and image sizes are consistent, a BN branch is added. The three branches are added together to output, and the 3×3 main branch convolution output is used during deployment. The REP module is used to enhance the model's perception of the input image.
[0066] The CMB processing flow is as follows: In the first step, the original last feature fusion result of the network is input into the BConv module. In the second step, the result of the first step is input into UPSample for upsampling. In the third step, the input of the first layer of E-ELAN in the backbone network is passed to the BConv module. The BConv module structure is as follows: Figure 5 As shown; the fourth step passes the output of the third and second steps to the Catconv module, whose structure is as follows Figure 6 As shown, the feature maps are fused; in the fifth step, the features fused in the fourth step are input into the BConv module, and the number of channels is reduced and increased again; in the sixth step, the output of the fifth step is divided into two branches, one branch is input into the MPConv module, and the structure is as follows Figure 7 As shown in Figure 2, additional branches and operations are introduced to make feature extraction more diverse and flexible; another branch inputs the REP module, whose structure is as follows: Figure 8As shown, the receptive field of the model is expanded; in the seventh step, the output of the MPConv module is passed to the subsequent feature processing network, and the output of the REP module is passed to the Conv module, which is the convolutional layer; finally, the Conv module outputs a final detection result branch.
[0067] The CMB structure proposed in the present invention is used to improve the model's perception and feature representation capabilities, the ability to detect targets of different scales, the model's calculation efficiency and parameter utilization; the WIoU introduced in the present invention is used to balance the impact of targets of different sizes on the loss function and improve the model's detection accuracy; these two strategies respectively improve the network performance to a certain extent, and there is further performance gain when used together.
[0068] BConv module: Its function is to halve the channels and obtain an output feature map with half the length and width, achieving the result of super downsampling. BConv consists of a convolution layer, a batch normalization layer (BN), and a LeakyReLU activation function. The convolution layer uses a 1×1 convolution kernel with a step size of 1; the BN layer performs normalization on each neuron and is a key step in data preprocessing; the LeakyReLU activation function is used to perform nonlinear calculations on the network. The calculation method is: hour, ;when hour, .in is the independent variable, It is a hyperparameter, and its value is generally 0.01. The calculation method of the LeakyReLU activation function is as follows:
[0069]
[0070] in, is a constant less than 1, called the leakage coefficient, and usually takes a very small value, such as 0.001. LeakyReLU avoids the zero gradient problem by introducing a small linear slope in the negative region, which can make network training more stable. It solves the problem of neuron "death" caused by the traditional ReLU function in the negative region. In the negative region, LeakyReLU allows a small gradient to flow through, which makes the network more stable during training. Compared with the ReLu activation function, LeakyReLU introduces an additional hyperparameter Need to adjust. It has linear characteristics. In the negative area, it will not return to zero completely, but multiply by a small slope. , thus retaining a certain degree of information. In some cases, LeakyReLU may cause the network to converge more slowly because it introduces a linear response in the negative region, which may slow down the learning of the network. LeakyReLU is often applied to hidden layers in neural networks to solve some problems that may occur with traditional ReLU functions.
[0071] UPSample module: used for upsampling or deconvolution operations, which is a technical means of sampling a low-resolution image into a high-resolution image, and its function is to expand the input data to a larger size. In deep learning, upsampling is often used in tasks such as image segmentation and image generation. The simplest upsampling methods are repeated interpolation, bilinear interpolation, and deconvolution. Repeated interpolation is to copy each pixel in the original image to the corresponding position in the larger image. This method is simple and intuitive, but it may cause jagged edges in the output image. Bilinear interpolation is a smoother interpolation method that uses the weighted average of four adjacent pixels to calculate the value of the new pixel to achieve a smooth upsampling effect. Deconvolution is a method of upsampling by learning parameters. In a convolutional neural network, the deconvolution layer can learn how to map a low-resolution feature map to a high-resolution feature map.
[0072] UPSample expands the input data to a larger size to provide more spatial information in subsequent network layers. This helps improve the resolution and perceptual range of the network, thereby improving the network's ability to process image details and structures. Upsampling can expand low-resolution feature maps to high resolution, providing more spatial information. Upsampling can increase the network's perceptual range of the input image, allowing the network to better understand the global structure and contextual information in the image. When upsampling with deconvolution, the network can learn how to map low-resolution feature maps to high-resolution feature maps, which can help the network better adapt to the needs of specific tasks. Simple upsampling methods such as bilinear interpolation are fast to calculate but do not have learning capabilities; while parameter learning methods such as deconvolution are usually more computationally expensive but can provide better performance. UPSample is a common operation in deep learning that can improve the resolution, perceptual range, and performance of the network by expanding the input data to a larger size.
[0073] In the present invention, the Wise-IoU (hereinafter referred to as WIoU) loss function replaces the original CIoU loss function. The loss function is used for bounding box regression, that is, predicting the position of the object. Given the predicted bounding box and the true box, the degree of difference between the two is reflected by calculating the loss function. Then, the back propagation algorithm updates the model parameters according to the loss function, and the above steps are repeated to finally make the model prediction result as close to the true value as possible. Wise-IoU is a bounding box regression loss function with a dynamic focusing mechanism. The dynamic focusing mechanism uses "outlier degree" instead of IoU to evaluate the quality of the anchor frame, and adopts a gradient gain allocation strategy with superior performance. The IoU is the intersection-union ratio of the predicted box and the true box, and the calculation formula is:
[0074]
[0075] Among them, A represents the predicted box, B represents the real box, and IoU is calculated as the ratio of the intersection of A and B to the union of A and B. The higher the IoU value, the higher the overlap between box A and box B, which means the more accurate the model prediction.
[0076] The advantage of the WIoU strategy is that it not only weakens the competitiveness of high-quality anchor frames, but also alleviates the unfavorable gradients caused by low-quality anchor frames. Therefore, Wise-IoU can focus on anchor frames of ordinary quality and improve the overall performance of the detector.
[0077] Residual connections and pyramid structures are used for feature extraction in the model backbone network, feature fusion, and network output. Residual connections refer to adding cross-layer connections between certain layers of the network, and adding the output of the previous layer directly to the input of the next layer. This connection method allows the network to learn residual information, that is, the difference between the previous layer and the next layer, so as to more effectively propagate gradients, accelerate the training process, and help solve the problem of gradient disappearance or gradient explosion. The pyramid structure refers to the presence of feature maps of multiple scales in the network, and each feature map of a scale captures image information at different levels, thereby improving the network's perception of objects of different scales. In the YOWE model, the pyramid structure is usually implemented through convolutional layers or pooling layers of different scales, which interact with each other through cross-layer connections or downsampling operations, and finally obtain outputs with multi-scale feature representations. Combining residual connections and pyramid structures, the REP module in YOWE enables the network to better propagate gradients, accelerate the training process, and improve the model convergence speed; using the pyramid structure, the network can simultaneously capture image information of multiple scales, improve the network's perception of objects of different scales, and thus improve detection accuracy and generalization ability. In summary, YOWE utilizes the characteristics of residual connection and pyramid structure to improve the feature extraction and expression capabilities of the network, thereby improving the performance of object detection tasks.
[0078] 4. Model Training
[0079] The implementation platform of the YOWE target detection model in this embodiment is based on the Linux operating system, the programming language is Python 3.8, the deep learning framework is Pytorch 2.1.2, and the CUDA version is 12.0. The YOLOv7 default optimizer and learning rate are used. The system is trained on an NVIDIA 3090 GPU with 24GB of memory for 100 rounds with a batch size of 32. Depending on the size of the data set, the number of training rounds can be appropriately set according to the actual situation.
[0080] After training on the training set is completed, find the result summary of the corresponding task in the folder where the results are stored, select the automatically saved best.pt weight file, that is, the weight with the best test effect on the validation set, and use this weight file to make predictions on the test set.
[0081] 5. Experimental Results
[0082] Fig. 9 An example diagram of the prediction results of the present invention is shown. In this embodiment, the detection effect of the sonar image high-precision fast target detection network model YOWE of the present invention and the detection model that has performed well recently on a public test set are compared. At the same time, an ablation experiment is performed to compare the CMB structure of the present invention and the introduced WIoU loss function to verify the effectiveness of the scheme proposed by the present invention. The present invention provides two commonly used evaluation indicators for image detection, namely, average accuracy mean MAP and frames per second FPS. The larger the value of the average accuracy mean MAP, the more accurate the detection, and the larger the frame per second FPS, the faster the detection speed. Experiments were conducted on a public sonar image test set, and the evaluation indicator results are shown in Table 1:
[0083] Table 1 Performance comparison of various models
[0084]
[0085] On public datasets, the MAP of the YOWE model proposed in this paper is 1.6% and 0.7% higher than that of YOLOv7 and CenterNet respectively. Compared with other algorithms, the MAP of the proposed model is higher than that of other algorithms, and its accuracy is second only to the YOLOv7 benchmark model, but it can fully meet the requirements of real-time detection.
[0086] 6. Ablation experiment:
[0087] In order to clarify the contribution of the CMB structure and the WIoU loss function in the present invention, this embodiment conducts an ablation experiment to verify the impact of different improvements on the model performance. Table 2 gives the experimental results of introducing the CMB structure and the WIoU loss function based on it. The experimental results are shown in Table 2:
[0088] Table 2 Ablation experiment results
[0089]
[0090] The results of ablation experiments show that compared with the original model, the YOWE model can extract feature information with richer sizes, increase the association with different levels of the network, and prompt the network to learn more levels of abstract features, so that the model can better understand and represent the target objects. It is suitable for complex tasks such as sonar image detection, is more efficient and accurate, and can obtain more robust and reliable prediction results.
[0091] In the corresponding application scenario, the target detection model constructed in the present invention can be used to perform target detection. The specific process is as follows:
[0092] Obtain sonar echo intensity map through sonar;
[0093] The obtained sonar echo intensity image is gray-scale processed and input into the target detection model constructed by the construction method of this embodiment;
[0094] Output the coordinate position and category result map of the target object.
[0095] Embodiment 2:
[0096] like Fig.10 As shown, the present invention also provides a high-precision and rapid target detection device for sonar images, the device includes at least one processor and at least one memory, and also includes a communication interface and an internal bus; the memory stores a computer execution program; the memory stores a computer execution program of the target detection model built by the construction method described in Example 1; when the processor executes the computer execution program stored in the memory, the processor can execute a high-precision and rapid target detection method for sonar images. The internal bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus. The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a U disk, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.
[0097] The device may be provided as a terminal, a server or other forms of devices.
[0098] Fig.10 is a block diagram of a device shown as an example. The device may include one or more of the following components: a processing component, a memory, a power component, a multimedia component, an audio component, an input / output (I / O) interface, a sensor component, and a communication component. The processing component generally controls the overall operation of the electronic device, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component may include one or more processors to execute instructions to complete all or part of the steps of the above method. In addition, the processing component may include one or more modules to facilitate interaction between the processing component and other components. For example, the processing component may include a multimedia module to facilitate interaction between the multimedia component and the processing component.
[0099] The memory is configured to store various types of data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phone book data, messages, pictures, videos, etc. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0100] The communication component is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0101] In an exemplary embodiment, the electronic device may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.
[0102] Embodiment 3:
[0103] The present invention also provides a computer-readable storage medium, which stores a computer execution program of the target detection model built by the construction method described in Example 1. When the computer execution program is executed by a processor, the processor can execute a high-precision and rapid target detection method for sonar images.
[0104] Specifically, a system, device or equipment equipped with a readable storage medium may be provided, on which a software program code for implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system, device or equipment reads and executes the instructions stored in the readable storage medium. In this case, the program code read from the readable medium itself can implement the functions of any of the above-mentioned embodiments, so the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of the present invention.
[0105] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk (such as CD-ROM, CD-R, CD-RW, DVD-20 ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tape, etc. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0106] It should be understood that the storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in a terminal or server.
[0107] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0108] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0109] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0110] Although the above describes the specific implementation methods of the present invention, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for building a high-precision and fast target detection model for sonar images, characterized in that: The process includes: Step 1, obtaining a large number of sonar echo intensity original images, wherein the original images are downloaded from an open source platform or directly obtained by sonar underwater; Step 2: preprocess the original image obtained in step 1; grayscale the original image based on the characteristics of the sonar image, and generate a corresponding label file for the target object contained in each image to describe the coordinate position and category of the target object; finally, divide the data set into a training set, a validation set, and a test set; Step 3, based on the YOLOv7 network structure, build a new YOWE network model; the YOWE network model includes input, backbone network CSPDarknet and detection output Head, and introduces CMB structure in Head. The CMB structure includes feature fusion part and detection part. The feature fusion part helps the model to extract information from features at different levels and use high-level semantic information to assist target detection. Even if the underlying features of the sonar image are affected by noise or blur, the sonar image target can still be correctly identified; the detection part is to add an output layer, each output layer is responsible for detecting targets of different scales and features, and helps the model make full use of multi-scale information; the CMB structure is specifically as follows: The CMB structure includes a feature fusion part and a detection part. The feature fusion part includes a BConv module, a UPSample module and a CatConv module, which are used to enable the network to process features more effectively; the BConv module includes a convolution layer, a batch normalization layer and an activation layer. The convolution kernel size of the convolution is 1, and the activation layer uses a leaky rectified linear activation function. The BConv module first performs a depth-separable convolution to reduce the number of channels, and then performs a standard convolution to increase the number of channels. The BConv module is used to reduce the computational complexity and improve the model performance, improve the model computational efficiency and parameter utilization; the UPSample module is used to upsample the feature map, thereby using the fusion of feature maps of different scales or upgrading the low-resolution feature map to a higher resolution level; the CatConv module It includes two branches, the first branch is composed of a BConv module with a convolution kernel of 1×1 and a step size of 1, and the second branch is composed of a BConv module with a convolution kernel of 1×1 and a step size of 1×1 and four BConv modules with a convolution kernel of 3×3 and a step size of 1 in cascade; the CatConv module is used to realize the association between features of more layers; the detection part includes a REP module and a Conv module to obtain a more accurate prediction effect; the REP module has different structures during training and deployment, and a 1×1 convolution branch is added to the 3×3 convolution branch during training. At the same time, if the input and output channels and image sizes are consistent, a BN branch is added, and the three branches are added and output, and the 3×3 main branch convolution output is used during deployment; the REP module is used to enhance the model's perception of the input image; The specific processing flow of the CMB structure is as follows: S1, input the last feature fusion result of the network into the BConv module; S2, inputs the result of S1 into UPSample for upsampling; S3, passes the input of the first layer E-ELAN in the backbone network to the BConv module; S4, passes the output of S3 and S2 to the CatConv module to fuse the feature maps; S5, input the features fused in S4 into the BConv module, and perform channel reduction and increase processing again; S6, divides the output of S5 into two branches, one branch is input into the MPConv module, introducing additional branches and operations to make feature extraction more diverse and flexible; the other branch is input into the REP module to expand the receptive field of the model; S7, passing the output of the MPConv module to the subsequent feature processing network, passing the output of the REP module to the Conv module, the Conv module is the convolutional layer; finally, the Conv module outputs a final detection result branch; Step 4: Use the training set and validation set in step 2 to train the YOWE network model built in step 3, and introduce Wise-IoU as the loss function; Step 5: Use the test set in step 2 to test the trained YOWE network model, and select the model with the best verification effect as the final model.
2. The method for building a high-precision and rapid target detection model for sonar images as claimed in claim 1, characterized in that: The preprocessing in step 2 also includes the following processes: performing equal-interval extraction on the sonar echo intensity map collected on-site using sonar to increase the irrelevance between images; and simultaneously performing inversion, rotation and cropping for data enhancement processing.
3. The method for building a high-precision and rapid target detection model for sonar images as claimed in claim 1, characterized in that: The BConv module is used to halve the channels to obtain an output feature map with half the length and width, achieving the result of super downsampling; the BConv module is composed of a convolution layer, a batch normalization BN layer and a LeakyReLU activation function; the convolution layer uses a 1×1 convolution kernel and a step size of 1; the BN layer performs normalization processing on each neuron and is a key step in data preprocessing; the calculation method of the LeakyReLU activation function is as follows: in, is the independent variable, is a constant less than 1, called the leaky coefficient; LeakyReLU avoids the zero gradient problem by introducing a small linear slope in the negative region.
4. The method for building a high-precision and rapid target detection model for sonar images as claimed in claim 1, characterized in that: Residual connections and pyramid structures are used for feature extraction in the backbone network CSPDarknet and the detection output Head; cross-layer connections are added between certain layers of the network, and the output of the previous layer is directly added to the input of the next layer, so that the network can learn the residual information, that is, the difference between the previous layer and the next layer, so as to propagate the gradient more effectively; in the YOWE model, the pyramid structure is implemented through convolutional layers or pooling layers of different scales, and these layers interact through cross-layer connections or downsampling operations, and finally obtain an output with multi-scale feature representation; combined with residual connections and pyramid structures, the REP module in the YOWE model enables the network to better propagate gradients and accelerate the training process.
5. A high-precision and rapid target detection method for sonar images, characterized in that: The process includes: Obtain sonar echo intensity map through sonar; Processing the obtained sonar echo intensity image in grayscale and inputting it into the target detection model constructed by the construction method according to any one of claims 1 to 4; Output the coordinate position and category result map of the target object.
6. A high-precision and rapid target detection device for sonar images, characterized in that: The device includes at least one processor and at least one memory, the processor and the memory are coupled; the memory stores a computer execution program of the target detection model built by the building method according to any one of claims 1 to 4; when the processor executes the computer execution program stored in the memory, the processor executes a high-precision and rapid target detection method for sonar images.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer execution program of the target detection model constructed by the construction method according to any one of claims 1 to 4. When the computer execution program is executed by the processor, the processor executes a high-precision and rapid target detection method for sonar images.
Citation Information
Patent Citations
Robust sonar target detection method based on dual-path feature fusion network
CN110163108A
Sonar image real-time detection method based on target detection neural network
CN114219998A
