Underwater target detection method based on spatial residual error
Through spatial residual-based detection methods, packet extraction and information reconnection, combined with E-FPN network, the accuracy reduction problem caused by feature drift in underwater target detection is solved, and high-accuracy target recognition and position.
Patent Information
- Application Number
- CN202411228873.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-03
AI Technical Summary
Underwater object detection technology has the problem of feature drift in complex environments, and existing methods have failed to effectively deal with various types of image degradation factors, affecting the accuracy of target recognition and positioning.
Using a detection method based on spatial residuals, image features and information are extracted through grouping and reconnected, a backbone network suitable for complex feature scenarios is constructed, and deep feature fusion is combined with E-FPN network to obtain accurate target positioning information.
It improves the accuracy and robustness of underwater target detection, and can correctly identify and locate targets in complex environments, which is better than other algorithmic performance, especially in green and low-light dense scenarios.
Smart Images

Figure CN119048893A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of underwater target detection, and in particular to an underwater target detection method based on spatial residual. Background Art
[0002] As the central nervous system of underwater visual perception, underwater target detection is gradually empowering the field of ocean exploration, greatly improving the ability to identify and locate objects with high precision in complex underwater environments. Unlike the terrestrial environment, underwater imaging is affected by multiple degradation factors at the same time. They are like invisible hands that distort the essential characteristics of the image, destroy the statistical and structural information of the image, obscure the characteristic information of the real data, and affect the visual perception of the human eye and the pattern recognition efficiency of the computer. In order to overcome the negative impact of the underwater environment on the accuracy of underwater target detection, researchers are committed to developing various technologies and methods to enable underwater target detection systems to more accurately identify and locate targets in complex underwater environments. Summary of the invention
[0003] According to the technical problems raised above, a target detection method based on spatial residual is proposed. The present invention mainly adopts the idea of spatial residual, and accurately extracts several degradation factors existing in underwater images by modulating image features in groups. In view of the fact that existing target detection methods ignore the heterogeneity of underwater image degradation distribution and use a unified data capacity for various types of image degradation, the present invention proposes to use the idea of spatial residual to estimate the feature mapping relationship of the image in groups to deal with the degradation problem of the situation, and finally trains and infers based on real-scene underwater data sets to obtain accurate underwater target positioning information.
[0004] The technical means adopted by the present invention are as follows:
[0005] A method for underwater target detection based on spatial residual comprises the following steps:
[0006] S01: Obtain an underwater low-quality target detection dataset, and randomly divide the underwater low-quality target detection dataset into a training set, a validation set, and a test set according to a certain ratio;
[0007] S02: constructing a backbone network according to the spatial residual, taking the underwater low-quality image in the training set as input, and extracting a multi-scale feature map of the underwater low-quality image; the multi-scale feature map includes: a high-resolution feature map, a medium-resolution feature map, and a low-resolution feature map;
[0008] S03: input the multi-scale feature map extracted by S02 into the E-FPN network, perform deep feature fusion to obtain feature information output; the E-FPN network includes: a bottom-up feature aggregation path and a top-down feature analysis and feature information output;
[0009] S04: outputting the feature information extracted in S03, and acquiring mapping classification and positioning information by detecting the head network; the classification and positioning information includes: target classification information and target positioning frame coordinate information;
[0010] S05: Calculate the loss according to the classification and positioning information described in S04, wait for the loss to converge, and then complete the target detection model training;
[0011] S06: Inferring the image through the trained target detection model in S05, outputting and drawing the detection result.
[0012] Furthermore, in S02, the spatial residual includes feature grouping extraction and information reconnection operations, and the calculation method of feature grouping extraction is:
[0013] X1, X2 = Split(conv(F in ));
[0014] X 21 , X 22 =Split(Conv(X2));
[0015] X3=Conv(X 22 );
[0016] Among them, Conv represents the convolution operation, Split represents grouping the feature maps in the channel dimension, and F in represents the input feature map, X1 and X2 represent the feature maps after the first grouping, and X 21 , X 22 represents the feature map after the second grouping, and X3 represents the feature map after the feature grouping and extraction operation;
[0017] The calculation method for information reconnection is:
[0018] Y = Conv(Concat(X1, X 21 , X3));
[0019] Among them, Concat means reconnecting the feature map in the channel dimension, and Y represents the output of the spatial residual.
[0020] Furthermore, the backbone network is composed of five spatial residual sequential connections, which is used to extract deep features in the image. The calculation method is:
[0021] F in1 , F in2 , F in3 =Backbone(F);
[0022] Among them, F represents the underwater low-quality image, Backbone represents the backbone network composed of spatial residuals, and f in1 represents the low-resolution feature map, f in2 represents the medium resolution feature map, F in3 Represents a high-resolution feature map.
[0023] Furthermore, the calculation method of the bottom-up feature aggregation of the E-FPN network is:
[0024] T0=Upsample(F in1 );
[0025] T1=Concat(T0,F in2 );
[0026] T2=CSP(Concat(Upsample(CSP(T1))),F in3 ));
[0027] Among them, Upsample means upsampling the feature map, Concat means connecting the feature map in the channel dimension, CSP means extracting features from the feature map through the CSPLayer layer, and F in1 、F in2 and F in3 Represents feature maps of different scales output by the backbone network;
[0028] The calculation method of the E-FPN network top-down feature parsing and feature output is:
[0029] F out1 =T2;
[0030] F out2 =CSP(Concat(SR(F out1 ), T1);
[0031] F out3 =CSP(Concat(SR(F out2 ), T0);
[0032] Among them, SR represents the resizing of the feature map, T0, T1 and T2 all represent the multi-scale feature map output of the E-FPN network bottom-up feature aggregation, and F out1 、F out2 and F out3 Represents feature maps of different sizes that are finally output by the E-FPN network.
[0033] Furthermore, the feature extraction calculation formula of the CSP is:
[0034] S1 = Conv(input);
[0035] S2=Bottleneck(Conv(input));
[0036] output=Conv(Concat(S1, S2));
[0037] Among them, Bottleneck represents the basic block in the residual structure, input represents the input feature map, S1 and S2 represent the intermediate state feature maps, and output represents the output of CSP.
[0038] Furthermore, the target classification information is the probability value of the predicted object category in the prediction frame, and the calculation method is:
[0039] num cls =softmax(x);
[0040] Among them, softmax represents the normalization operation, num cls Represents the probability value of the target classification information, and x represents the category features learned by the detection head network;
[0041] The target positioning frame coordinate information is expressed as:
[0042] (X,Y,width,height);
[0043] Among them, X and Y represent the coordinate values of the center of the prediction box relative to the upper left corner of the feature map, and width and height represent the ratio of the width and height of the prediction box to the width and height of the feature map, respectively.
[0044] Furthermore, the loss function is calculated as follows:
[0045] L obj =BCEloss=-(y*logp+(1-y)*log(1-p));
[0046] L cls =BCEloss;
[0047] L box =IOUloss=1-IOU;
[0048] LOSS=λ obj *L obj +λ box *L box +λ cls *L cls ;
[0049] Among them, y represents the true label, p represents the probability predicted by the network, represents the intersection ratio between the predicted box and the true box, and λ obj ,box and λ cls Both represent weight coefficients, L obj Represents the loss between the detected target and the true value, L box Represents the loss between the detection box and the true value, L cls Represents the loss between the detected category and the true value.
[0050] Furthermore, the certain ratio is 8:1:1.
[0051] Compared with the prior art, the present invention has the following advantages:
[0052] In order to solve the problem of decreased accuracy of underwater target detection technology caused by feature drift, the present invention proposes a spatial residual block for optimizing the solution space, which uses SkipCut to construct effective boundary constraints for PDEs so that features at the same level can be solved in a suitable data capacity. It is instantiated as a new general backbone network architecture suitable for complex feature scenes, called the spatial residual target detection network (BSR5).
[0053] The present invention provides a Skipcut mechanism derived from a spatial residual block. From the perspective of the order of information flow, the SkipCut mechanism optimizes the use of channel order, matches the most appropriate parameter path for features at different levels, ensures that each type of feature can be processed in the optimal parameter interval, and makes the network solution space smoother. From the perspective of the reverse order of the gradient flow, Skip Cut, as a shortcut in the back-propagation process, can transfer gradients to multiple network layers, break through the limitations of chain transmission, and promote the reasonable distribution of gradients. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0055] Figure 1 It is a model flow chart of the present invention.
[0056] Figure 2 The detection results of different methods in the nearshore underwater ecological scene. Among them, (a) is the reference image, (b) is the detection result using the AMSP-UOD method, (c) is the detection result using the YOLOv8 method, (d) is the detection result using the YOLOv9 method, (e) is the detection result of the RTMDET method, and (f) is the detection result using the method proposed in this invention.
[0057] Figure 3The detection results of different methods in a low-light dense scene with severe green bias. Among them, (a) is the reference image, (b) is the detection result using the AMSP-UOD method, (c) is the detection result using the YOLOv8 method, (d) is the detection result using the YOLOv9 method, (e) is the detection result of the RTMDET method, and (f) is the detection result using the method proposed in this invention. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0060] like Figure 1 As shown, the present invention provides an underwater target detection method based on spatial residual, characterized in that it includes the following steps:
[0061] S01: Obtain an underwater low-quality target detection dataset, and randomly divide the underwater low-quality target detection dataset into a training set, a validation set, and a test set according to a certain ratio (the certain ratio is 8:1:1);
[0062] S02: construct a backbone network based on the spatial residual, take the underwater low-quality image in the training set as input, and extract the multi-scale feature map of the underwater low-quality image; the multi-scale feature map includes: a high-resolution feature map, a medium-resolution feature map and a low-resolution feature map; the spatial residual in S02 includes feature grouping extraction and information reconnection operations, and the calculation method of feature grouping extraction is:
[0063] X1, X2 = Split(Conv(F in ));
[0064] X 21 , X 22 =Split(Conv(X2));
[0065] X3=Conv(X 22 );
[0066] Among them, Conv represents the convolution operation, Split represents grouping the feature maps in the channel dimension, and F in represents the input feature map, X1 and X2 represent the feature maps after the first grouping, and X 21 , X 22 represents the feature map after the second grouping, and X3 represents the feature map after the feature grouping and extraction operation;
[0067] The calculation method for information reconnection is:
[0068] Y = Conv(Concat(X1, X 21 , X3));
[0069] Among them, Concat means reconnecting the feature map in the channel dimension, and Y represents the output of the spatial residual. The backbone network in S02 is composed of five spatial residuals connected in sequence, which is used to extract deep features in the image. The calculation method is:
[0070] F in1 , F in2 , F in3 =Backbone(F);
[0071] Among them, F represents the underwater low-quality image, Backbone represents the backbone network composed of spatial residuals, and F in1 represents the low-resolution feature map, F in2 represents the medium resolution feature map, F in3 Represents a high-resolution feature map.
[0072] S03: input the multi-scale feature map extracted by S02 into the E-FPN network, perform deep feature fusion to obtain feature information output; the E-FPN network includes: a bottom-up feature aggregation path and a top-down feature analysis and feature information output;
[0073] The calculation method of the bottom-up feature aggregation of the E-FPN network is:
[0074] T0=Upsample(F in1 );
[0075] T1=Concat(T0,F in2 );
[0076] T2=CSP(Concat(Upsample(CSP(T1))),F in3 ));
[0077] Among them, Upsample means upsampling the feature map, Concat means connecting the feature map in the channel dimension, CSP means extracting features from the feature map through the CSPLayer layer, and F in1 、F in2 and F in3 Represents feature maps of different scales output by the backbone network;
[0078] The calculation method of the E-FPN network top-down feature parsing and feature output is:
[0079] F out1 =T2;
[0080] F out2 =CSP(Concat(SR(F out1 ), T1);
[0081] F out3 =CSP(Concat(SR(F out2 ), T0);
[0082] Among them, SR represents the resizing of the feature map, T0, T1 and T2 all represent the multi-scale feature map output of the E-FPN network bottom-up feature aggregation, and F out1 、F out2 and F out3 Represents feature maps of different sizes that are finally output by the E-FPN network.
[0083] The feature extraction calculation formula of the CSP is:
[0084] S1 = Conv(input);
[0085] S2=Bittleneck(Conv(input));
[0086] output=Conv(Concat(S1, S2));
[0087] Among them, Bottleneck represents the basic block in the residual structure, input represents the input feature map, S1 and S2 represent the intermediate state feature maps, and output represents the output of CSP.
[0088] S04: outputting the feature information extracted in S03, and acquiring mapping classification and positioning information by detecting the head network; the classification and positioning information includes: target classification information and target positioning frame coordinate information;
[0089] The target classification information in S04 is the probability value of the predicted object category in the prediction frame, and the calculation method is:
[0090] num cls =softmax(x);
[0091] Among them, softmax represents the normalization operation, num cls Represents the probability value of the target classification information, and x represents the category features learned by the detection head network;
[0092] S05: Calculate the loss according to the classification and positioning information in S04, wait for the loss to converge, and then complete the target detection model training; the target positioning frame coordinate information in S05 is expressed as:
[0093] (X,Y,width,height);
[0094] Wherein, X and Y represent the coordinate values of the center of the prediction box relative to the upper left corner of the feature map, and width and height represent the ratio of the width and height of the prediction box to the width and height of the feature map. The calculation method of the loss function in S05 is:
[0095] L obj =BCEloss=-(y*logp+(1-y)*log(1-p));
[0096] L cls =BCEloss;
[0097] L box =IOUloss=1-IOU;
[0098] LOSS=λ obj *L obj +λ box *L box +λ cls *L cls ;
[0099] Among them, y represents the true label, p represents the probability predicted by the network, represents the intersection ratio between the predicted box and the true box, and λ obj , box and λ cls Both represent weight coefficients, L obj Represents the loss between the detected target and the true value, L box Represents the loss between the detection box and the true value, L cls Represents the loss between the detected category and the true value.
[0100] S06: Inferring the image through the trained target detection model in S05, outputting and drawing the detection result.
[0101] like Figure 2 As shown in the figure, the present invention provides detection results in nearshore underwater ecological scenes with other algorithms. From the experimental effect diagram, it can be seen that the four algorithms all detect the targets in the underwater images to a certain extent. However, Yolov8 mistakenly regards the black shadow in the upper right corner as the detection target. RTMDET also makes the mistake of treating the black shadow as the detection target. In addition, there is also the problem of target classification error. The results produced by our method and the advanced Yolov9 method and AMSP-UOD method all obtain correct detection results.
[0102] like Figure 3 As shown in the figure, the present invention provides the detection results of different methods in low-light dense scenes with severe green bias. It can be seen from the experimental effect diagram that the four algorithms all detect the targets in the underwater image to a certain extent. However, the AMSP-UOD method failed to detect the target in the dark on the left and made an incorrect detection. Yolov8, Yolov9 and RTMDET all failed to detect the target in the dark on the left. Our method correctly detects all targets even in such a scene with severe green bias.
[0103] This embodiment compares the experimental results of different algorithms from two objective indicators, AP and AP50; in target detection, the AP (Average Precision) indicator is an indicator used to evaluate the performance of object detection models. The goal of the target detection task is to identify and locate objects in images or videos, and provide a bounding box and a corresponding category for each detected object. For different thresholds, the model can produce different precision and recall rates. Plotting these points and forming a PR curve can be used to intuitively understand the performance of the model at different thresholds. AP is a measure of the average value of the area under the PR curve, which represents the comprehensive performance of the model on all categories. The calculation method of AP depends on whether multiple detection results (boxes) are allowed to exist in the same object instance. AP50 (Average Precision at 50) is a performance evaluation indicator in target detection, especially for evaluating the average accuracy of the model when the IoU (Intersection over Union) threshold is 50%. In the target detection task, IoU refers to the ratio of the intersection and union between the detection box (prediction box) and the true annotation box. AP75 (Average Precision at 75) is used to evaluate the average accuracy of the model when the IoU threshold is 75%. Therefore, the present invention has a significant improvement on the AP, AP50 and AP75 indicators of the original image, and is superior to other underwater target detection algorithms.
[0104] Table 1 Comparison of the indicators of the model of the present invention and other advanced algorithms
[0105]
[0106] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for underwater target detection based on spatial residual, characterized in that: The following steps are involved: S01: Obtain an underwater low-quality target detection dataset, and randomly divide the underwater low-quality target detection dataset into a training set, a validation set, and a test set according to a certain ratio; S02: constructing a backbone network according to the spatial residual, taking the underwater low-quality image in the training set as input, and extracting a multi-scale feature map of the underwater low-quality image; the multi-scale feature map includes: a high-resolution feature map, a medium-resolution feature map, and a low-resolution feature map; S03: input the multi-scale feature map extracted by S02 into the E-FPN network, perform deep feature fusion to obtain feature information output; the E-FPN network includes: a bottom-up feature aggregation path and a top-down feature analysis and feature information output; S04: outputting the feature information extracted in S03, and acquiring mapping classification and positioning information by detecting the head network; the classification and positioning information includes: target classification information and target positioning frame coordinate information; S05: Calculate the loss according to the classification and positioning information described in S04, wait for the loss to converge, and then complete the target detection model training; S06: Inferring the image through the trained target detection model in S05, outputting and drawing the detection result.
2. The underwater target detection method based on spatial residual according to claim 1, characterized in that: The spatial residual includes: feature grouping extraction and information reconnection operations; The calculation method for feature grouping extraction is: X1,X2=Split(Conv(F in )); X 21 ,X 22 =Split(Conv(X2)); X3=Conv(X 22 ); Among them, Conv represents the convolution operation, Split represents grouping the feature maps in the channel dimension, and F in represents the input feature map, X1 and X2 represent the feature maps after the first grouping, and X 21 , X 22 represents the feature map after the second grouping, and X3 represents the feature map after the feature grouping and extraction operation; The calculation method for information reconnection is: Y=Conv(Concat(X1,X 21 ,X3)); Among them, Concat means reconnecting the feature map in the channel dimension, and Y represents the output of the spatial residual.
3. The underwater target detection method based on spatial residual according to claim 1, characterized in that: The backbone network includes five spatial residual sequential connections and is used to extract deep features in the image. The calculation method of the backbone network is: F in1 ,F in2 ,F in3 =Backbone(F); Among them, F represents the underwater low-quality image, Backbone represents the backbone network composed of spatial residuals, and F in1 represents the low-resolution feature map, F in2 represents the medium resolution feature map, F in3 Represents a high-resolution feature map.
4. The underwater target detection method based on spatial residual according to claim 1, characterized in that: The calculation method of the bottom-up feature aggregation of the E-FPN network is: T0=Upsample(F in1 ); T1=Concat(T0,F in2 ); T2=CSP(Concat(Upsample(CSP(T1)),F in3 )); Among them, Upsample means upsampling the feature map, Concat means connecting the feature map in the channel dimension, CSP means extracting features from the feature map through the CSPLayer layer, and F in1 、F in2 and F in3 Represents feature maps of different scales output by the backbone network; The calculation method of the E-FPN network top-down feature parsing and feature output is: F out1 =T2; F out2 =CSP(Concat(SR(F out1 ),T1)); F out3 =CSP(Concat(SR(F out2 ),T0)); Among them, SR represents the resizing of the feature map, T0, T1 and T2 all represent the multi-scale feature map output of the E-FPN network bottom-up feature aggregation, and F out1 、F out2 and F out3 Represents feature maps of different sizes that are finally output by the E-FPN network.
5. The underwater target detection method based on spatial residual according to claim 4, characterized in that: The feature extraction calculation formula of the CSP is: S1 = Conv(input); S2=Bottleneck(Conv(input)); output=Conv(Concat(S1, S2)); Among them, Bottleneck represents the basic block in the residual structure, input represents the input feature map, S1 and S2 represent the intermediate state feature maps, and output represents the output of CSP.
6. The underwater target detection method based on spatial residual according to claim 1, characterized in that: The target classification information is the probability value of the predicted object category in the prediction box, and the calculation method is: num cls =softmax(x); Among them, softmax represents the normalization operation, num cls Represents the probability value of the target classification information, and x represents the category features learned by the detection head network; The target positioning frame coordinate information in S05 is expressed as: (X,Y,width,height); Among them, X and Y represent the coordinate values of the center of the prediction box relative to the upper left corner of the feature map, and width and height represent the ratio of the width and height of the prediction box to the width and height of the feature map, respectively.
7. The underwater target detection method based on spatial residual according to claim 1, characterized in that: The calculation method of the loss function is: L obj =BCEloss=-(y*log p+(1-y)*log(1-p)); L cls =BCEloss; L box =IOUloss=1-IOU; LOSS=λ obj *L obj +λ box *L box +λ cls *L cls ; Among them, y represents the true label, p represents the probability predicted by the network, represents the intersection ratio between the predicted box and the true box, and λ obj , box and λ cls Both represent weight coefficients, L obj Represents the loss between the detected target and the true value, L box Represents the loss between the detection box and the true value, L cls Represents the loss between the detected category and the true value.
8. The underwater target detection method based on spatial residual according to claim 1, characterized in that: The certain ratio is 8:1:1.
Citation Information
Patent Citations
Underwater target detection method based on improved Faster R-CNN
CN116778311A
Underwater target detection method and system based on spatial solution redundancy network
CN117496340A
Remote sensing image target detection method based on multi-scale feature multiplexing
CN118015261A
Unsupervised domain adaptation target re-identification method
WO2022001489A1
