An underwater target detection method and system based on a double-path optimization structure

CN122530784APending Publication Date: 2026-08-07GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUILIN UNIV OF ELECTRONIC TECH
Filing Date
2026-03-17
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0005]本发明的目的在于提供一种基于双路径优化结构的水下目标检测方法及系统,以解决上述背景技术中提出的现有技术中目标检测模型普遍面临边界框预测不稳定及模型收敛速度慢等问题

Benefits of technology

(1)本发明中基于双路径优化结构的水下目标检测方法,通过引入分箱回归路径将边界框的宽高连续预测转化为离散分箱分类与精细偏移回归相结合的方式,显著提升了预测稳定性;同时,通过设计由基础定位损失与平均精度损失构成的动态加权混合损失函数,在训练初期依赖定位损失保证稳定收敛,在训练后期逐步强化AP损失以直接优化评估指标。该方法有效加速了模型收敛过程,降低训练时间与计算资源消耗,并在复杂水下环境中实现了更高的检测精度与鲁棒性,为资源受限的嵌入式部署场景提供了可行的技术解决方案。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122530784A_ABST
    Figure CN122530784A_ABST
Patent Text Reader

Abstract

The application discloses a kind of underwater target detection method and system based on double-path optimization structure, it is related to underwater image processing technical field;The method comprises the following steps: obtaining original underwater image, image annotation, data set is formed by original underwater image and corresponding annotated underwater image;Build basic target detection model, model includes feature extraction network, feature fusion network and detection head;Box regression model is constructed in detection head, and the width height regression task of boundary box is converted into box classification task and in-box offset regression task;Design mixed loss function, which is dynamically weighted by basic positioning loss function and ranking-based average precision loss function;Model training is carried out based on data set, and the box regression path and loss optimization path are jointly optimized, and underwater environment target detection model is obtained.The application significantly improves the convergence speed and training efficiency of the model, reduces the consumption of training resources, and maintains high detection accuracy and strong robustness in complex underwater environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of underwater image processing technology, and particularly relates to an underwater target detection method and system based on a dual-path optimization structure. Background Technology

[0002] The underwater environment is rife with complex optical phenomena such as scattering, absorption, and refraction, which often result in images exhibiting low contrast, low saturation, blurred details, and uneven illumination, leading to various visual degradation problems. When these quality-impaired images are directly input into target detection models, they often result in unclear target outlines and unstable size predictions, leading to false positives and false negatives. This significantly reduces the intelligent perception capabilities of the detection model in applications such as underwater monitoring, aquaculture, marine resource exploration, and underwater robots.

[0003] Existing underwater target detection technologies mainly follow two approaches: one type attempts to improve image quality through image enhancement techniques before inputting the enhanced image into the detection model. However, the enhancement process may introduce artifacts or color shifts, and the instability of enhancement quality further affects the reliability of the detection results. The other type of method uses an end-to-end detection framework to train directly on the underwater image. However, since the model structure is often designed based on general vision tasks, it is difficult to effectively adapt to the special optical characteristics of underwater degradation, resulting in slow model convergence and difficulty in guaranteeing bounding box prediction accuracy.

[0004] Under current technological conditions, target detection models generally face problems such as unstable prediction of bounding box width and height, significant fluctuations in classification confidence, difficulties in training convergence, and insufficient generalization ability. Furthermore, traditional loss functions typically employ single-path optimization strategies, which struggle to balance localization accuracy and ranking consistency, making them more prone to performance bottlenecks in complex underwater environments. Therefore, a new detection architecture is needed to improve the robustness, accuracy, and training convergence efficiency of underwater target detection through a more stable regression method and a more reasonable loss optimization mechanism, thereby better adapting to the changing underwater visual environment. Summary of the Invention

[0005] The purpose of this invention is to provide an underwater target detection method and system based on a dual-path optimization structure, so as to solve the problems of unstable bounding box prediction and slow model convergence speed that are commonly faced by target detection models in the prior art mentioned above.

[0006] To achieve the above objectives, the present invention employs the following technical solution:

[0007] In its first aspect, this invention proposes an underwater target detection method based on a dual-path optimization structure, comprising the following steps: S1. Construct the dataset; acquire raw underwater images, preprocess and annotate the raw underwater images, and the dataset consists of the raw underwater images and the corresponding annotated underwater images. S2. Construct a basic target detection model; the basic target detection model includes a feature extraction network, a feature fusion network, and a detection head; S3. Improvement of the basic target detection model: Construct a binning regression model in the detection head, and transform the bounding box width and height regression task into a binning classification task and an in-bin offset regression task; S4. Design a hybrid loss function; the hybrid loss function is composed of a dynamic weighted sum of the basic positioning loss function and the ranking-based average accuracy loss function. S5. Training the basic target detection model; Training the improved basic target detection model based on the dataset, and jointly optimizing the binning regression path and the loss optimization path; S6. Underwater target detection: The optimized and updated basic target detection model is used as the underwater environment target detection model to detect targets in underwater images.

[0008] The method of this invention significantly improves the model convergence speed and training efficiency, and reduces training resource consumption; it maintains high detection accuracy and strong robustness in complex underwater environments; the optimized model has both high efficiency and lightweight characteristics, and can meet the real-time detection needs of resource-constrained scenarios such as embedded devices.

[0009] Preferably, the basic target detection model in S2 is as follows: The feature extraction network employs a deep convolutional neural network architecture to extract multi-level feature information from the input image; the feature fusion network is used for multi-level feature fusion. The detection head is connected after the feature extraction network. The detection head structure includes a classification branch and a regression branch, which are used to perform target classification and bounding box regression prediction on the extracted features.

[0010] Furthermore, the feature extraction network adopts a multi-scale fusion structure, which includes a shallow detail feature extraction sub-network and a deep semantic feature extraction sub-network. The former is responsible for capturing texture and edges, while the latter is responsible for modeling the global structure and semantic relationships. The two achieve feature fusion through cross-layer connections.

[0011] Preferably, the basic target detection model in S3 is improved as follows: The detection head includes a target classification branch and a bounding box regression branch set in parallel. The target classification branch is used to predict the probability of the target category based on the extracted features. The bounding box regression branch adopts a binning regression model structure. The binning regression model includes a binning classification subnetwork and an offset regression subnetwork that share input features. The binning and classification subnetwork adopts a three-layer convolutional cascade structure, where the first two convolutional layers are followed by non-linear activation functions, and the third convolutional layer serves as the output layer, with a channel value of [value missing]. , representing the original output of the neural network convolutional layer, used to indicate the original confidence score of the target width and height values ​​belonging to each bin interval; The offset regression subnetwork adopts a three-layer convolutional structure isomorphic to the binning classification subnetwork, and is used to regress and predict the offset of the target width and height values ​​in the corresponding interval. The binning regression model discretizes the continuous width and height value range into multiple predefined intervals, each with a fixed center value. The binning classification subnetwork performs the binning classification task, and the offset regression subnetwork performs the intra-bin offset regression task. The final output width and height prediction values ​​are obtained by weighted summation of the center value of the selected interval and the predicted offset. By replacing the traditional continuous regression method with binning classification, the stability of bounding box localization is improved.

[0012] Furthermore, the processing procedure of the binning regression model is as follows: First, predict the continuous width and height values ​​of the bounding box ( w,h Discretize the data into K intervals and perform probability prediction for each interval:

[0013] in, Is the predicted target width and height values ​​falling into the first... k The probability of each interval. It is the raw output of the neural network convolutional layer, that is, the raw score of each interval; Then, offset correction is performed on each interval, and the predicted width and height of the bins are calculated. The result is obtained by weighted summation of the center value of the selected interval and the predicted offset:

[0014] in, , These are the center values ​​for the width and height of the boxes, respectively. , This represents the offset within the box.

[0015] Preferably, the hybrid loss function in S4 is specifically: The basic localization loss function includes bounding box regression loss, target confidence loss, and classification loss; the ranking-based average accuracy loss function uses the detection performance evaluation index as the optimization objective; a balance coefficient that changes with the training process is set for dynamic weighting. A dynamically weighted hybrid loss function consisting of IoU loss and AP loss is designed to adaptively adjust the optimization objective at different training stages.

[0016] Furthermore, the hybrid loss function is composed of the original YOLO loss function and the average precision loss function specifically:

[0017] where is the original loss function of YOLOv7, including CIoU loss, objectiveness loss and classification loss, is the AP loss (average precision loss based on ranking), and are dynamic weight coefficients that change with training.

[0018] Furthermore, the balance coefficient is dynamically adjusted according to the number of training rounds, specifically as follows:

[0019] where represents the balance coefficient of the basic localization loss function, represents the balance coefficient of the average precision loss function based on ranking; is the maximum number of training rounds, and are respectively the minimum and maximum values of and are respectively the minimum and maximum values of + = 1. The design of this dynamic weighting mechanism is based on training process perception: in the early stage of training (Epoch < T), the model has not learned effective feature representations. At this time, is near the minimum value while is near the maximum value. The model mainly relies on the basic localization loss to quickly converge the search space and avoid gradient oscillation caused by the sorting fluctuation of the AP loss;;; As training progresses, increases linearly while decreases accordingly. The optimization focus gradually tilts towards . This process ensures that both losses participate in the optimization, thereby effectively strengthening the direct optimization of the final mean average precision (mAP) index while maintaining training stability.

[0020] Preferably, the training of the basic object detection model in S5 is specifically as follows: The joint optimization employs an end-to-end training approach. Forward propagation calculates the predicted width and height of the binning regression path and the mixed loss function value. Backpropagation simultaneously updates the binning regression path parameters in the feature extraction network and the detection head, as well as the dynamic weight parameters in the loss optimization path. During the forward propagation phase, input features are processed independently by the binning classification sub-network and the offset regression sub-network, respectively, to calculate the binning probability and offset. During the backpropagation phase, based on a dual-path decoupling structure, the binning regression path and the loss optimization path share the backbone network feature gradients, but the gradient flow is calculated independently within the detection head.

[0021] Furthermore, the joint optimization employs a dual-path backpropagation structure, where the binning regression path and the loss optimization path share feature gradients; the backpropagation update specifically involves: · in, For the set of model parameters, This is the adjustment coefficient; These represent the total loss function, binning regression loss function, and mixed loss function of backpropagation, respectively.

[0022] This invention avoids mutual interference between classification features and regression features in deep networks through this gradient update strategy.

[0023] Preferably, the underwater target detection in S6 specifically includes: The underwater environment target detection model uses a non-maximum suppression algorithm to filter detection boxes during the detection process, removing prediction boxes with high overlap rates. Specifically:

[0024] in, , For two different prediction boxes, For intersection, union, and comparison, The threshold value is set, typically 0.5, to ensure the uniqueness and accuracy of the detection results.

[0025] In a second aspect, the present invention proposes an underwater target detection system based on a dual-path optimization structure, including an underwater environment target detection model; The underwater environment target detection model includes a feature extraction network, a feature fusion network, and a detection head; The feature extraction network adopts a deep convolutional neural network architecture, and the backbone network of the deep convolutional neural network architecture adopts a network with residual or cross-stage connection structure; the feature extraction network is used to extract multi-level feature information from the input image; The feature fusion network is used for multi-level feature fusion; The detection head includes a target classification branch and a bounding box regression branch set in parallel. The target classification branch is used to predict the target category probability of the extracted features. The bounding box regression branch adopts a binning regression model structure, which further includes a binning classification subnetwork and an offset regression subnetwork. The binning classification subnetwork is used to predict the predefined interval to which the target size belongs, and the offset regression subnetwork is used to predict the correction amount of the target size in the corresponding interval. The two work together to complete the bounding box regression prediction.

[0026] The underwater target detection system based on the dual-path optimization structure is suitable for the detection of various underwater environmental targets, including the identification of fish, corals, plankton, and artificial structures.

[0027] Compared with the prior art, the beneficial effects of the present invention are: (1) The underwater target detection method based on the dual-path optimization structure in this invention transforms the continuous prediction of the bounding box width and height into a combination of discrete bin classification and fine-grained offset regression by introducing a binning regression path, which significantly improves the prediction stability. Simultaneously, by designing a dynamically weighted hybrid loss function consisting of basic localization loss and average accuracy loss, stable convergence is ensured by relying on localization loss in the early stages of training, while the AP loss is gradually strengthened in the later stages of training to directly optimize the evaluation index. This method effectively accelerates the model convergence process, reduces training time and computational resource consumption, and achieves higher detection accuracy and robustness in complex underwater environments, providing a feasible technical solution for resource-constrained embedded deployment scenarios.

[0028] (2) This invention constructs a detection head structure based on dual-path decoupling, effectively solving the problem of multi-task feature interference. Addressing the issue of feature gradient conflicts between classification and regression tasks in existing single-path detection models, this invention designs an independent classification branch and a regression branch containing a binning mechanism in the detection head. By further refining the binning classification and in-bin offset regression sub-networks in the regression path, deep decoupling of features is achieved. This structural design enables the network to extract features sensitive to the bounding box size range and features sensitive to fine edges, avoiding mutual constraints of single feature maps when handling large-span size predictions, thus significantly improving the feature representation capability for target localization in complex underwater scenarios. Furthermore, by constructing a binning regression path in the detection head, the continuous regression task of bounding box width and height is transformed into a combination of binning classification and offset regression, significantly improving the stability of bounding box prediction.

[0029] (3) The method in this invention proposes a discretized bin regression method adapted to underwater multi-scale targets, which improves the detection robustness of small and blurred targets. Given that underwater imaging involves light refraction and scattering, resulting in drastic changes in target scale and blurred edges, traditional direct coordinate regression is sensitive to outliers and has difficulty converging. This invention transforms the continuous width and height prediction task into a combined task of "coarse-grained interval classification + fine-grained offset correction". This discretization process reduces the difficulty of model fitting extreme sizes (such as distant microorganisms or close-range giant equipment), significantly enhances the stability of bounding box prediction, and effectively reduces target box jitter and positioning drift in underwater blurred environments.

[0030] (4) The method in this invention designs a dynamically weighted hybrid loss function based on training process awareness, balancing model convergence speed and evaluation metric optimization. To address the problem of difficulty in convergence during the early stages of training caused by directly introducing average precision (AP) loss, this invention constructs a hybrid function comprising basic localization loss and ranking-sensitive AP loss, and introduces a dynamic balancing coefficient that changes non-linearly with the training epoch. This mechanism gives higher weight to the basic localization loss in the early stages of training to quickly lock the search space and guide the model to converge stably; in the later stages of training, it smoothly transitions to AP loss as the dominant factor, directly optimizing the gradient for the detection evaluation metric (mAP). This strategy effectively solves the oscillation problem caused by inconsistent optimization directions of multi-objective loss functions, improving the detection accuracy of the final model without increasing inference computation costs. Attached Figure Description

[0031] Figure 1 This is a flowchart of the underwater target detection method based on a dual-path optimization structure in this invention; Figure 2 This is a flowchart of the bin regression calculation process for the underwater target detection method based on the dual-path optimization structure in this invention; Figure 3 This is a graph showing the calculation and training optimization of the hybrid loss function of the underwater target detection method based on the dual-path optimization structure in this invention; Figure 4 This is a graph showing the changes in training metrics for the original baseline object detection model in existing technologies. Figure 5 This is a graph showing the change in training metrics of the underwater target detection model based on a dual-path optimization structure in this invention. Detailed Implementation

[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] Example 1: See Figure 1 The underwater target detection method based on the dual-path optimization structure mainly includes the following steps: Step 1: Obtain the original underwater image training samples and the corresponding labeled reference image training sample data; the original image training samples are training samples without target labels.

[0034] The original underwater image training samples are unprocessed image samples collected in real underwater environments, including blurring, color shift, and low contrast degradation caused by water scattering, light attenuation, suspended particles, etc.

[0035] The labeled reference image training samples are data from the original images that have been manually or semi-automatically labeled. By performing bounding box annotation and category labeling on the original underwater image training samples, a standard dataset containing the location coordinates of target objects and their category information is constructed, and the dataset is divided into training set, validation set, and test set.

[0036] Step 2: Construct a basic target detection model based on training samples from labeled reference images.

[0037] The basic object detection model adopts a network structure based on a single-stage detection framework (such as the YOLO series), including a feature extraction backbone network, a multi-scale feature fusion network, and a detection head module. This model can be a randomly initialized, untrained model, or a transfer learning model pre-trained on a general object detection dataset to accelerate convergence on underwater tasks.

[0038] In this embodiment, the feature extraction network adopts a deep convolutional neural network architecture to extract multi-level feature information from the input image. Its backbone network can be a network with residual or cross-stage connection structures, such as ResNet or CSPDarknet, to adapt to the feature representation requirements in complex underwater environments. The detection head module is connected after the feature extraction network and adopts a parallel dual-path decoupled structure, which is responsible for target classification and bounding box regression prediction of the extracted features, respectively. Unlike traditional coupled structures, the bounding box regression branch in this embodiment integrates a binning regression model, which is further subdivided into independent binning classification subnetworks and offset regression subnetworks to adapt to the high-precision positioning requirements in complex underwater environments. The basic target detection model can be an untrained initialized model or a transfer learning model with basic detection capabilities after pre-training on a large public dataset.

[0039] Step 3: Based on the basic target detection model, the bounding box width and height regression task is converted into a bin classification task and an in-bin offset regression task in the detection head, and a bin regression model is constructed.

[0040] In this embodiment, the binning regression path is implemented by discretizing the continuous width and height value range into multiple predefined intervals, each interval having a fixed center value. To address the problem of multi-task feature interference, the binning regression model employs physically isolated sub-network structures: the binning classification sub-network uses a three-layer convolutional cascade structure (containing two convolutional-activation layer pairs and one linear output convolutional layer) to extract scale-sensitive features and predict the probability distribution of the binning interval to which the target width and height value belongs; the offset regression sub-network also uses an independent three-layer convolutional structure to extract edge detail features and predict the fine offset of the target width and height value within the corresponding interval. The final width and height prediction values ​​are obtained by weighted summation of the center value of the selected interval and the predicted offset. Specifically, as shown... Figure 2 As shown, the binning regression model processing procedure is as follows: First, the binning regression model continuously predicts the width and height of the bounding box ( w,h The function is discretized into K intervals, and a probability prediction is performed for each interval. The feature map channel values ​​output by the classification sub-network are... , representing the original output of the convolutional layer, the prediction process includes:

[0041] in, It is to predict the target's width and height to fall into the first... k The probability of each interval. It is the raw output of the neural network convolutional layer, that is, the raw score of each interval.

[0042] Then, the predicted width and height values ​​of the sub-bins are represented as follows:

[0043] in, It is to predict the target's width and height to fall into the first... k The probability of each interval. and For pre-calculated fixed parameters, the target width and height range is normalized. Linear partitioning It is obtained by calculating the geometric center position of each uniform interval. , This is the direct predicted output value of the corresponding channel in the regression subnetwork, representing the true width and height of the target relative to the center of its interval. The fine offset amplitude is used to numerically correct the coarse-grained bin center to eliminate discretization errors.

[0044] This binning regression mechanism effectively reduces the quantization error of traditional direct regression methods by transforming the continuous regression problem into a combination of discrete classification and fine regression, significantly improving the stability and accuracy of bounding box prediction, and providing a structural basis for the subsequent construction of a hybrid loss function.

[0045] Step 4: Design a hybrid loss function based on the basic target detection model. The hybrid loss function is composed of a dynamic weighted average accuracy loss function based on the basic localization loss function and the ranking-based average accuracy loss function, and construct a loss optimization path.

[0046] The basic localization loss function includes bounding box regression loss, object confidence loss, and classification loss, used to ensure the model's basic detection capability. The ranking-based average precision loss function directly uses the detection performance evaluation metric as the optimization objective. The dynamic weighting mechanism sets a balance coefficient that changes with the training process. In the early stages of training, it primarily relies on the basic localization loss function to ensure stable model convergence, while in the later stages, it gradually increases the weight of the average precision loss function to keep the optimization objective consistent with the final evaluation metric. Figure 3 As shown.

[0047] In this embodiment, a hybrid loss function is designed based on the basic target detection model. This hybrid loss function is dynamically weighted and composed of a basic localization loss function and a ranking-based average accuracy loss function, thereby constructing a loss optimization path. The original loss function in this embodiment... With average precision loss function Construct the corresponding hybrid loss function as follows:

[0048] in, It is the original loss function of YOLOv7, including CIoU loss, objectivity loss, and classification loss. It is AP loss (average precision loss based on ranking). and These are dynamic weighting coefficients that change with training.

[0049] Specifically, balance factor and The scheduling function is dynamically adjusted with each training round. The user sets the initial value, termination value, and change method of the scheduling function, so that the basic localization loss is the main factor in the early stage of training, and the weight of the ranking loss is gradually increased in the later stage of training.

[0050] Based on the mixed loss function, the relevant formulas for the dynamic adjustment of the balance factor include:

[0051] in For the maximum number of training rounds, and They are respectively The minimum and maximum values, and They are respectively The minimum and maximum values, and usually satisfy the following: + =1.

[0052] Step 5: Based on the original underwater image training samples and the corresponding labeled reference image training sample data, jointly optimize the binning regression path and the loss optimization path.

[0053] In this embodiment, joint optimization adopts an end-to-end training method. The width and height prediction results and the mixed loss function value of the binning regression path are calculated through forward propagation, and the binning regression path parameters in the feature extraction network and the detection head, as well as the dynamic weight parameters in the loss optimization path are updated simultaneously through backpropagation.

[0054] During the joint optimization of the model, the changing trend of the total loss function is continuously monitored, while key performance indicators on the validation set, including mean precision and recall, are also monitored. Reasonable convergence conditions are set, including the maximum number of training epochs, validation set accuracy reaching a predetermined standard, or the improvement of indicators stabilizing. When any convergence condition is met, the current optimal model parameters are saved; otherwise, the optimization iteration continues.

[0055] Specifically, the joint optimization employs a dual-path backpropagation structure, where the binning regression path and the loss optimization path share feature gradients. The backpropagation update is as follows: · in, For the set of model parameters, This is the adjustment coefficient.

[0056] Specifically, the model parameters are updated using a stochastic gradient descent optimization algorithm, employing the Adam optimizer with an initial learning rate of 10. -3 The learning rate is dynamically adjusted during training using a cosine annealing strategy. The learning rate is specifically:

[0057] in, The current learning rate, Let T be the initial learning rate, and T be the learning rate update period.

[0058] The parameter update process synchronously updates the optimized binning regression path parameters, feature extraction network parameters, and dynamic balance coefficients in the loss optimization path to the base model. The resulting optimized model, while maintaining the original network structure, significantly improves the stability of bounding box localization through the binning regression mechanism, and ensures a balance between detection accuracy and convergence speed through hybrid loss optimization.

[0059] Step 6: Update the basic target detection model based on the optimized parameters to obtain a target detection model that can be used in underwater environments.

[0060] This invention filters detection boxes using a non-maximum suppression (NMS) algorithm after training, removing prediction boxes with high overlap rates. The filtering of prediction boxes with high overlap rates specifically involves:

[0061] in , For two different prediction boxes, For intersection, union, and comparison, The threshold value is set, typically 0.5, to ensure the uniqueness and accuracy of the detection results.

[0062] After model training is complete, the final optimized network parameters are saved for subsequent deployment. During the testing phase, the underwater image to be tested is input into the optimized detection model, and target category prediction and precise location information are obtained through forward propagation. Based on the test results, the system evaluates the model's overall performance in practical applications, focusing on detection accuracy and inference efficiency metrics. If the model performance does not yet meet the needs of practical applications, further optimization can be performed by adjusting network hyperparameters or expanding the training dataset. The detection model, after a complete optimization process, can be directly deployed on various underwater operation platforms to achieve accurate real-time detection of underwater targets.

[0063] Experimental verification: To further verify the effectiveness of the underwater target detection method based on the dual-path optimization structure proposed in this invention, this embodiment conducted ablation experiments on a real underwater dataset for comparison. Figure 4 The training process curves using the unmodified original YOLOv7 model are shown. Figure 5 The training process curves after applying the method of this invention are shown.

[0064] contrast Figure 4 and Figure 5 As can be seen from the mAP@0.5 and mAP@0.5:0.95 curves, the convergence speed is significantly improved: thanks to the training process-aware dynamic hybrid loss function designed in this invention, the improved model shows explosive growth in various accuracy indicators in the early stage of training (the first 10 epochs), quickly reaching the convergence state; while the indicators of the original model rise relatively slowly. This indicates that the dynamic weight mechanism effectively guides the gradient optimization direction in the early stage of training; the bounding box localization is more accurate: on the mAP@0.5:0.95 indicator, which represents high-precision localization capability, the final convergence value of the improved model is significantly higher than that of the original model. This proves that by introducing a binning regression model, transforming continuous regression into "interval classification + fine offset", the localization drift problem caused by unclear underwater target boundaries is effectively solved, and the fitting of the detection box is significantly improved; the training process is more stable: observing the value box curves in the two figures, the original model has obvious oscillations during training; while the loss decrease curve of the improved model is extremely smooth and the value is lower. This is thanks to the dual-path decoupled detection head structure used in this invention, which effectively avoids mutual interference between classification features and regression features, greatly enhancing the robustness of the model.

[0065] In summary, the experimental results strongly demonstrate the significant advantages of the method of the present invention in improving the accuracy of underwater target detection, accelerating the convergence speed, and enhancing the stability of the model.

[0066] The above description is only for the purpose of helping to understand the method and core essence of the present invention, but the scope of protection of the present invention is not limited thereto. For those skilled in the art, any equivalent substitutions or modifications made to the technical solution and inventive concept disclosed in the present invention within the scope of the technology disclosed in the present invention should be covered within the scope of protection of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An underwater target detection method based on a dual-path optimization structure, characterized in that, Includes the following steps: S1. Construct the dataset; acquire raw underwater images, preprocess and annotate the raw underwater images, and the dataset consists of the raw underwater images and the corresponding annotated underwater images. S2. Construct a basic target detection model; the basic target detection model includes a feature extraction network, a feature fusion network, and a detection head; S3. Improvement of the basic target detection model: Construct a binning regression model in the detection head, and transform the bounding box width and height regression task into a binning classification task and an in-bin offset regression task; S4. Design a hybrid loss function; the hybrid loss function is composed of a dynamic weighted sum of the basic positioning loss function and the ranking-based average accuracy loss function. S5. Training the basic target detection model; Training the improved basic target detection model based on the dataset, and jointly optimizing the binning regression path and the loss optimization path; S6. Underwater target detection; The optimized and updated base target detection model is used as an underwater environment target detection model to detect targets in underwater images.

2. The underwater target detection method based on a dual-path optimization structure according to claim 1, characterized in that, The basic target detection model in S2 is as follows: The feature extraction network employs a deep convolutional neural network architecture to extract multi-level feature information from the input image; the feature fusion network is used for multi-level feature fusion. The detection head is connected after the feature extraction network. The detection head structure includes a classification branch and a regression branch, which are used to perform target classification and bounding box regression prediction on the extracted features.

3. The underwater target detection method based on a dual-path optimization structure according to claim 1, characterized in that, The improvements to the basic target detection model in S3 are as follows: The detection head includes a target classification branch and a bounding box regression branch set in parallel. The target classification branch is used to predict the probability of the target category based on the extracted features. The bounding box regression branch adopts a binning regression model structure. The binning regression model includes a binning classification subnetwork and an offset regression subnetwork that share input features. The binning and classification subnetwork adopts a three-layer convolutional cascade structure, where the first two convolutional layers are followed by non-linear activation functions, and the third convolutional layer serves as the output layer, with a channel value of [value missing]. , representing the original output of the neural network convolutional layer, used to indicate the original confidence score of the target width and height values ​​belonging to each bin interval; The offset regression subnetwork adopts a three-layer convolutional structure isomorphic to the binning classification subnetwork, and is used to regress and predict the offset of the target width and height values ​​in the corresponding interval. The binning regression model discretizes the continuous width and height value range into multiple predefined intervals, each interval having a fixed center value. The binning classification subnetwork performs the binning classification task, and the offset regression subnetwork performs the in-bin offset regression task. The final output width and height prediction values ​​are obtained by weighted summation of the center value of the selected interval and the predicted offset.

4. The underwater target detection method based on a dual-path optimization structure according to claim 3, characterized in that, The processing procedure for the binning regression model is as follows: First, predict the continuous width and height values ​​of the bounding box ( w,h Discretize the data into K intervals and perform probability prediction for each interval: in, Is the predicted target width and height values ​​falling into the first... k The probability of each interval. It is the raw output of the neural network convolutional layer, that is, the raw score of each interval; Then, offset correction is performed on each interval, and the predicted width and height of the bins are calculated. The result is obtained by weighted summation of the center value of the selected interval and the predicted offset: in, , These are the center values ​​for the width and height of the boxes, respectively. , This represents the offset within the box.

5. The underwater target detection method based on a dual-path optimization structure according to claim 1, characterized in that, The specific hybrid loss function in S4 is as follows: The basic localization loss function includes bounding box regression loss, target confidence loss, and classification loss; the ranking-based average accuracy loss function uses the detection performance evaluation index as the optimization objective. Dynamic weighting is performed by setting a balance coefficient that changes as the training process progresses.

6. The underwater target detection method based on a dual-path optimization structure according to claim 5, characterized in that, The balance coefficient is dynamically adjusted with each training round, as follows: in, This represents the balance coefficient of the basic positioning loss function. This represents the balance coefficient of the ranking-based average precision loss function; For the maximum number of training rounds, and They are respectively The minimum and maximum values, and They are respectively The minimum and maximum values, and satisfying + =1.

7. The underwater target detection method based on a dual-path optimization structure according to claim 1, characterized in that, The training of the basic object detection model in S5 is as follows: The joint optimization adopts an end-to-end training method. The width and height prediction results and the mixed loss function value of the binning regression path are calculated through forward propagation, and the binning regression path parameters in the feature extraction network and the detection head, as well as the dynamic weight parameters in the loss optimization path are updated simultaneously through backpropagation.

8. The underwater target detection method based on a dual-path optimization structure according to claim 7, characterized in that, The joint optimization employs a dual-path backpropagation structure, where the binning regression path and the loss optimization path share feature gradients; the backpropagation update is specifically as follows: · in, For the set of model parameters, This is the adjustment coefficient; These represent the total loss function, binning regression loss function, and mixed loss function of backpropagation, respectively.

9. An underwater target detection system based on a dual-path optimization structure obtained by the method described in any one of claims 1-8, characterized in that, Including underwater environment target detection models; The underwater environment target detection model includes a feature extraction network, a feature fusion network, and a detection head; The feature extraction network adopts a deep convolutional neural network architecture, and the backbone network of the deep convolutional neural network architecture adopts a network with residual or cross-stage connection structure; the feature extraction network is used to extract multi-level feature information from the input image; The feature fusion network is used for multi-level feature fusion; The detection head includes a target classification branch and a bounding box regression branch set in parallel. The target classification branch is used to predict the target category probability of the extracted features. The bounding box regression branch adopts a binning regression model structure, which further includes a binning classification subnetwork and an offset regression subnetwork. The binning classification subnetwork is used to predict the predefined interval to which the target size belongs, and the offset regression subnetwork is used to predict the correction amount of the target size in the corresponding interval. The two work together to complete the bounding box regression prediction.