A method for target detection in ocean sonar images based on soft threshold denoising
Through technical means such as deep convolution network and cross-space information threshold learning module, the problem of background noise interference in sonar images is solved, and the high accuracy and stable performance of sonar image object detection is achieved.
Patent Information
- Application Number
- CN202410356369.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-27
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-03-27
AI Technical Summary
The prior art is difficult to effectively suppress background noise interference in sonar images, resulting in low accuracy of sonar image object detection.
Using a soft threshold denoising method, feature extraction and fusion are performed through deep convolutional networks, combined with cross-spatial information threshold learning module and feature enhancement module, the NBD regression loss function is used to improve the robustness of object detection.
Accurate object detection and classification of sonar images is realized, detection accuracy and stability are improved, and an object detection system with high accuracy and stable performance is obtained.
Smart Images

Figure CN118247646B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for detecting ocean sonar images based on soft threshold denoising. Background Art
[0002] With the development of imaging sonar systems, underwater target detection and identification using sonar images play an important role in military and civilian fields. In the military field, sonar target detection is used for mine target detection, maritime reconnaissance, ship surveillance, underwater intelligent confrontation, etc. In the civilian field, it is used for underwater archaeology, biological research, shipwreck salvage, etc.
[0003] Affected by the underwater acoustic field environment, sonar images have poor contrast, low resolution, and severe noise, which poses a great challenge to the accurate detection of sonar image targets. In the early days, sonar target detection was mainly done by manually distinguishing target categories, but this method is relatively inefficient and difficult to ensure stable accuracy due to subjective factors. With the development of digital image processing technology, many optical image processing methods have been used to solve the sonar target detection problem.
[0004] However, unlike ordinary optical images, sonar images contain a lot of background noise interference, making it difficult for general target detection methods to achieve good results in sonar image target detection. Therefore, how to effectively suppress background noise interference and improve detection accuracy has become a very important task in ocean sonar image target detection. Summary of the invention
[0005] The embodiment of the present application solves the problem of large background noise in sonar images in the prior art by providing a method for detecting targets in ocean sonar images based on soft threshold denoising, thereby improving the accuracy of sonar image recognition.
[0006] The present application embodiment provides a method for detecting targets in ocean sonar images based on soft threshold denoising, comprising:
[0007] Step S1, collecting sonar images to be detected, and performing standardization processing on the sonar images to be detected to form a preprocessed image set;
[0008] Step S2, extracting features from the images in the preprocessed image set through a deep convolutional network to generate a feature map;
[0009] Step S3, fusing features of different scales on the feature maps through the feature fusion part of the deep convolutional neural network;
[0010] Step S4, obtaining feature location and classification results of the image data through the detection regression part of the deep convolutional neural network.
[0011] Step S4 also includes the following method:
[0012] S41, based on the fused feature map, determining a horizontal bounding box corresponding to the feature map;
[0013] S42, determining a probability density distribution of each horizontal bounding box based on the horizontal bounding box, and outputting similarities between probability distributions of the horizontal bounding boxes based on the probability distribution of the horizontal bounding boxes;
[0014] Step S43, determining the loss of the image based on the similarity between the probability distributions of the horizontal bounding boxes.
[0015] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0016] Through deep convolutional network feature extraction and fusion, combined with cross-spatial information threshold learning module and feature enhancement module, accurate target detection and classification of sonar images are achieved. At the same time, the NBD regression loss function is used to improve the robustness of target detection, and a target detection system with high accuracy and stable performance is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of a method for detecting ocean sonar images based on soft threshold denoising;
[0018] Figure 2 This is a network architecture diagram of a method for ocean sonar image target detection based on soft threshold denoising;
[0019] Figure 3 It is a processing flow chart of a cross-spatial information threshold learning module of a method for detecting ocean sonar images based on soft threshold denoising;
[0020] Figure 4 This is a processing flow chart of the feature enhancement module of an ocean sonar image target detection method based on soft threshold denoising. DETAILED DESCRIPTION
[0021] To facilitate the understanding of the present invention, the present application will be described more comprehensively below with reference to the relevant drawings; the drawings show preferred embodiments of the present invention, but the present invention can be implemented in many different forms and is not limited to the embodiments described herein; on the contrary, the purpose of providing these embodiments is to enable a more thorough and comprehensive understanding of the disclosed content of the present invention.
[0022] It should be noted that the terms “vertical”, “horizontal”, “up”, “down”, “left”, “right” and similar expressions used in this document are only for illustrative purposes and do not represent the only implementation method.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which the present invention belongs; the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the term "and / or" used herein includes any and all combinations of one or more related listed items.
[0024] In one embodiment of the present invention, Figure 1 As shown, the present application designs a method for detecting targets in ocean sonar images based on soft threshold denoising, comprising:
[0025] Step S1, collecting sonar images to be detected, and performing standardization processing on the sonar images to be detected to form a preprocessed image set.
[0026] Step S2: extract features from the images in the preprocessed image set through a deep convolutional network to generate a feature map.
[0027] Step S3, features of different scales are fused on the feature maps through the feature fusion part of the deep convolutional neural network.
[0028] Preferably, Figure 2 As shown in the figure, with the Yolov5 network as the basic model, the overall network can be divided into the feature extraction part on the left, the feature fusion part in the middle and the detection regression part. The feature extraction part is a common network trunk, such as Resnet50, Cspdarknet53, etc. Its main function is to downsample the image of the data through convolution and extract features of different scales.
[0029] The feature fusion part of the Yolov5 network is mainly a structure similar to a feature pyramid. For general feature fusion, such as feature pyramid or bidirectional feature pyramid, they often only consider the information fusion between different layers, but cannot distinguish noise information. For sonar images, this noise information interferes with target detection very seriously, so the present invention adds a cross-spatial information threshold learning module and a feature enhancement module based on soft threshold denoising in the feature fusion part:
[0030] Preferably, step S3 also includes a cross-spatial information threshold learning module and a feature enhancement module; the cross-spatial information threshold learning module can learn feature weights of different spatial positions, which helps to highlight important areas and suppress noise, and the feature enhancement module further enhances the representation ability of the feature map through denoising processing, thereby improving the accuracy of target detection.
[0031] Preferably, the feature enhancement module includes determining the enhancement effect of the input feature map based on three dimensions of width, height and channel.
[0032] Preferably, Figure 3 As shown, the cross-spatial information threshold learning module includes using three parallel routes to extract the attention weights of the feature map. The three parallel routes are X average pooling, Y average pooling, and 3x3 convolution branches. The average pooling operation and the convolution operation are performed respectively through the three parallel routes. The attention weights of the feature map can be extracted from multiple angles, and the perception ability of the model is enhanced. This method can more effectively capture important features in the image.
[0033] Preferably, the cross-spatial information threshold learning module also includes obtaining attention weights by matrix addition based on the cross-matrix multiplication results of the parallel routes.
[0034] Among them, the two parallel routes corresponding to X average pooling and Y average pooling are located in the 1x1 branch. First, the first two routes perform average pooling operations along two different dimensions, X and Y, respectively. The two feature maps are further concat-operated and followed by a 1x1 convolution, and the input feature maps are further reweighted to obtain F1. At this time, the parallel 3x3 convolution branch first undergoes a 3x3 convolution to obtain F2. Further, both branches are sequentially operated by GroupNorm, average pooling, and sigmoid activation functions. Finally, the output F1 and F2 are cross-matrix multiplied and the results are matrix-added to obtain the final output.
[0035] like Figure 4 As shown, for the input feature map, the average values are taken in the width, height and channel dimensions respectively, and then compared with the output of the cross-spatial information threshold learning module. Multiply to get the actual threshold :
[0036] ;
[0037] Where x is the input feature map, i, j, and c are the width, height, and channel index of the feature map x, respectively.
[0038] Preferably, when the absolute value of the pixel value of the feature map is less than the threshold When , the pixel value is set to zero and the pixel value is greater than the threshold The pixel value is shrunk.
[0039] The output y is obtained by denoising, and the absolute value below this threshold is The input data with an absolute value greater than this threshold is set to zero. The input data of is also shrunk towards zero, and the formula is as follows:
[0040] .
[0041] Preferably, a fused feature map is determined based on the attention weight and the feature map after feature enhancement.
[0042] Step S4, obtaining feature location and classification results of the image data through the detection regression part of the deep convolutional neural network.
[0043] Using the detection and regression part of the deep convolutional neural network, the feature map can be located and classified, and the location information and category label of the target can be output. This step is the core of the target detection task and can achieve accurate target detection and classification.
[0044] Preferably, step S4 also includes the following implementation:
[0045] S41, based on the fused feature map, determine a horizontal bounding box corresponding to the feature map.
[0046] In this step, the bounding box is modeled as a two-dimensional Gaussian distribution through the Normalized Bhattacharyya Distance (NBD) metric. The coordinates of the features in the horizontal bounding box are determined according to the size of the horizontal bounding box. For the horizontal bounding box, R = (cx, cy, w, h), where (cx, cy), w, and h represent the center coordinates, width, and height, respectively. The equation of the inscribed ellipse can be expressed as:
[0047] ;
[0048] in( ) are the center coordinates of the ellipse, , is the semi-axis length along the x-axis and y-axis. Therefore, = cx; = cy; = w / 2; = h / 2.
[0049] Using the Normalized Bhattacharyya Distance (NBD) metric, the bounding box is modeled as a two-dimensional Gaussian distribution, and the coordinates of the features in the horizontal bounding box are determined according to the size of the horizontal bounding box. This step helps to locate the target more accurately.
[0050] S42, based on the horizontal bounding boxes, determining the probability density distribution of each horizontal bounding box, and based on the probability distribution of the horizontal bounding boxes, outputting the similarity between the probability distributions of the horizontal bounding boxes.
[0051] Among them, the probability density function formula of the two-dimensional Gaussian distribution of the horizontal bounding box is:
[0052] ;
[0053] Among them, and Represents the coordinates (x, y), mean vector, and covariance matrix of a Gaussian distribution.
[0054] Therefore, the horizontal bounding box R = (cx, cy, w, h) can be modeled as a two-dimensional Gaussian distribution N ( ),in:
[0055] ;
[0056] After changing the form of describing the bounding box into a two-dimensional Gaussian distribution, the problem of measuring the similarity of two bounding boxes is transformed into the problem of measuring the distance between two probability density functions.
[0057] Formula for the Bhattacharyya distance between two probability density functions as follows:
[0058] ;
[0059] where p ∼ N (µ1, Σ1) and q ∼ N (µ2, Σ2) are both Gaussian distributions:
[0060] ;
[0061] where in the case of a horizontal bounding box, , are all 0, so the Bhattacharyya distance of the horizontal bounding box is It can be simplified into the following form:
[0062] ;
[0063] Through calculation, NBD will output a numerical value between 0 and 1, which represents the similarity between the two probability distributions. The closer the value is to 0, the more similar the two distributions are, while the closer the value is to 1, the lower the similarity is. Based on the calculated NBD value, the similarity between the two probability distributions can be judged, which is used to measure the similarities or differences between different features or data sets.
[0064] By calculating the Bhattacharyya distance between two probability density functions, the problem of measuring the similarity of two bounding boxes is transformed into the problem of measuring the distance between two probability density functions. This method can more accurately compare the similarities between different bounding boxes and improve the accuracy of target detection.
[0065] Step S43, determining the loss of the image based on the similarity between the probability distributions of the horizontal bounding boxes.
[0066] By using the regression loss function of NBD and taking the Yolov5 network as the basic model, the regression loss function of the network is the IOU regression loss function , bounding box regression loss is the IOU regression loss function adopted by the Yolov5 network model And NBD regression loss function The common composition is as follows:
[0067] ;
[0068] in Is the balance coefficient, which is used to balance the two types of loss functions. NBD regression loss function Bhattacharyya distance Normalize and then design it into a loss function to get:
[0069] ;
[0070] Where C is a constant closely related to the data set. The present invention sets C to the average absolute size of the objects in the data set and obtains the best performance. Moreover, C is stable within a certain range.
[0071] The bounding box regression loss Lbbox is composed of the IOU regression loss function LIOU and the NBD regression loss function LNBD. By balancing the two types of loss functions, the accuracy and robustness of target detection are improved. At the same time, the design of the NBD regression loss function LNBD can better handle noise and outliers and improve the robustness of the model.
[0072] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0073] Through deep convolutional network feature extraction and fusion, combined with cross-spatial information threshold learning module and feature enhancement module, accurate target detection and classification of sonar images are achieved. At the same time, the NBD regression loss function is used to improve the robustness of target detection, and a target detection system with high accuracy and stable performance is achieved.
[0074] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting targets in ocean sonar images based on soft threshold denoising, characterized in that: include: Step S1, collecting sonar images to be detected, and performing standardization processing on the sonar images to be detected to form a preprocessed image set; Step S2, extracting features from the images in the preprocessed image set through a deep convolutional network to generate a feature map; Step S3, fusing features of different scales on the feature maps through the feature fusion part of the deep convolutional neural network; Step S4, obtaining feature location and classification results of the image data through the detection regression part of the deep convolutional neural network; The step S3 also includes a cross-spatial information threshold learning module and a feature enhancement module; The feature enhancement module includes, for the input feature map, determining the enhancement effect of the feature map based on three dimensions: width, height and channel; The cross-spatial information threshold learning module includes extracting the attention weight of the feature map using three parallel routes, the three parallel routes are X average pooling, Y average pooling, and 3x3 convolution branch; For the input feature map, the average values are taken in the width, height and channel dimensions respectively, and then multiplied by the output α of the cross-spatial information threshold learning module to obtain the actual threshold τ: Where x is the input feature map, i, j and c are the width, height and channel index of feature map x respectively; When the absolute value of the pixel value of the feature map is less than the threshold τ, the pixel value is set to zero, and the pixel value greater than the threshold τ is shrunk; The step S4 also includes the following implementation: S41, based on the fused feature map, determining a horizontal bounding box corresponding to the feature map; S42, determining a probability density distribution of each horizontal bounding box based on the horizontal bounding box, and outputting similarities between probability distributions of the horizontal bounding boxes based on the probability distribution of the horizontal bounding boxes; Step S43, determining the loss of the image based on the similarity between the probability distributions of the horizontal bounding boxes; Formula B for the Bhattacharyya distance of the horizontal bounding box D as follows: Where p~N(μ1,Σ1) and q~N(μ2,Σ2) are both Gaussian distributions: Among them, in the case of a horizontal bounding box, c1 and c2 are both 0, so the Bhattacharyya distance B of the horizontal bounding box is D It can be simplified into the following form: Bounding Box Regression Loss As shown below: Where λ is the balance coefficient, which is used to balance the two types of loss functions. is the IOU regression loss function, is the NBD regression loss function.
2. The method for detecting targets in ocean sonar images based on soft threshold denoising as claimed in claim 1, characterized in that: The probability density function formula of the two-dimensional Gaussian distribution of the horizontal bounding box is: where x, μ, and Σ represent the coordinates (x, y), mean vector, and covariance matrix of the Gaussian distribution.
3. The method for detecting targets in ocean sonar images based on soft threshold denoising as claimed in claim 1, characterized in that: According to the size of the horizontal bounding box, the coordinates of the features in it are determined. For the horizontal bounding box R = (cx, cy, w, h), where (cx, cy), w and h represent the center coordinates, width and height respectively, the equation of the inscribed ellipse can be expressed as: Where (μ x , μ y ) is the center coordinate of the ellipse, σ x , σ y are the semi-axis lengths along the x-axis and y-axis.
4. The method for detecting targets in ocean sonar images based on soft threshold denoising as claimed in claim 1, characterized in that: The cross-spatial information threshold learning module also includes obtaining the attention weight by matrix addition based on the cross-matrix multiplication results of the parallel routes.
Citation Information
Patent Citations
Unmanned aerial vehicle image target detection method based on multiple scales and Gaussian Wasserstein distance
CN116469020A
Underwater synthetic aperture sonar image target detection method and system
CN117456346A