An underwater image enhancement and target detection integrated method
Patent Information
- Application Number
- CN202611243828.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-10-27
AI Technical Summary
(1)串联架构实时性差:传统“先增强、后检测”的串行流程会引入额外计算延迟,检测系统必须等待增强结果输出,难以满足水下机器人、AUV或嵌入式设备的实时性需求;
[0016]采用上述技术方案所产生的有益效果在于:本发明提供的水下图像增强和目标检测一体化方法,采用一体化联合建模,消除了串行架构缺陷,摒弃“先增强后检测”串行流程,采用YOLOv11共享特征主干实现图像增强、目标检测协同优化,彻底解决时延累积、跨模块信息割裂、误差逐级传递问题;采用物理先验驱动特征增强,适配水下退化场景,PPEM模块融合水下光学衰减物理规律,同步完成红通道色彩补偿、多尺度对比度提升、动态散射噪声抑制,从特征层面改善偏色、低对比度、颗粒噪声问题,显著提升弱纹理、复杂水下背景下目标特征辨识度;采用AFSL损失优化困难样本,定位精度大幅提升,通过分层加权机制差异化处理不同IoU样本,强化中等IoU困难样本训练,动态调整训练权重,大幅提升边界框回归精度,在高IoU阈值(mAP75)下检测性能显著优于传统损失函数;本发明的轻量化低时延,适配嵌入式实时部署,模型总参数量仅2.3M,URPC2020数据集测试中,检测模式推理延迟13.59ms、FPS 157.15,双任务模式FPS仍可达74.56,满足AUV、水下监测终端等资源受限设备实时推理需求;本发明方法的通用性强,兼顾常规水下目标与细粒度显微目标,不仅适用于海参、海胆、海星等海洋生物常规检测,针对显微藻类微小细粒度目标,可完整保留细微边界与形态特征,藻类数据集mAP50达95.9%、mAP75达85.2%,细粒度识别鲁棒性突出;本发明多模式灵活部署,适配多元水下应用场景,支持纯图像增强、纯目标检测、增强+检测双任务三种工作模式,覆盖水下生态巡检、AUV自主探测、水下图像离线分析、显微藻类观测多类工程场景。
Smart Images

Figure CN122989450A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater target detection and image enhancement technology, and in particular to an integrated method for underwater image enhancement and target detection. Background Technology
[0002] Underwater target detection is affected by the selective absorption of light of different wavelengths by water and the scattering effect of suspended particles. The acquired images generally suffer from degradation problems such as blue-green color cast, low contrast, loss of texture details, and severe scattering noise, which leads to a decrease in the classification accuracy of target detection networks and insufficient bounding box regression accuracy.
[0003] Existing underwater image enhancement and target detection technologies can be divided into four categories: 1) underwater image enhancement methods based on prior or physical models, such as transmission graph estimation, color correction, histogram equalization, and fusion enhancement; 2) underwater image enhancement methods based on deep learning, such as CNN, Transformer, and other networks that directly learn the mapping from degraded images to enhanced images; 3) lightweight underwater-specific target detection and attention-optimized detection networks; and 4) tandem or loosely coupled methods for underwater image enhancement and target detection.
[0004] The existing technology has four major flaws: (1) Poor real-time performance of serial architecture: The traditional serial process of "enhancement first, detection later" introduces additional computational delay. The detection system must wait for the enhancement result to be output, which is difficult to meet the real-time requirements of underwater robots, AUVs or embedded devices. (2) Incompatibility between enhancement and detection tasks: High quality of visual enhancement does not necessarily lead to improved detection performance. Some enhancement results are more biased towards human visual perception, which may introduce artifacts, amplify water noise, and interfere with the feature extraction of the detector. (3) Existing joint frameworks are not practical for implementation: Although existing joint augmentation detection methods attempt to share features, they often have complex network structures and a large number of parameters. During training, gradient interference and convergence instability may occur between the augmentation task and the detection task. (4) Insufficient accuracy in locating difficult samples: In severely degraded underwater scenarios, the distribution of easy and difficult samples is extremely uneven. Traditional detection loss functions process all samples with equal weight, which cannot enhance the learning of difficult samples with low to medium IoU. The boundary regression accuracy is poor under high IoU threshold.
[0005] In summary, existing technologies cannot simultaneously achieve high-quality underwater image enhancement and high-precision real-time target detection within a unified lightweight framework, and it is difficult to balance visual restoration effect, detection accuracy, model parameter count, and inference speed. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide an integrated underwater image enhancement and target detection method that addresses the shortcomings of the prior art. Based on YOLOv11 and physical prior feature recalibration, the method collaboratively completes image restoration and target detection within a single shared feature framework, simultaneously improving the accuracy of underwater target classification, boundary localization, and fine-grained target recognition, while achieving lightweight and low-latency inference.
[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: On the one hand, the present invention provides an integrated method for underwater image enhancement and target detection, comprising the following steps: Step 1: Acquire underwater images to be detected, uniformly scale them to 640×640 resolution and complete normalization preprocessing, then input them into the YOLOv11 shared backbone network; Step 2: Embed a Physical Prior Encoding Module (PPEM) into the YOLOv11 backbone network and / or neck network, and recalibrate the network features using underwater optical imaging physical priors; the PPEM includes a prior-guided channel attention submodule, a multi-scale contrast enhancement submodule, and a dynamically gated underwater denoising attention submodule. The feature tensor of the input PPEM is ,in, Indicates the number of feature channels. and These represent the height and width of the feature map, respectively. PPEM sequentially performs prior guidance channel recalibration, multi-scale contrast enhancement, and dynamic gating denoising. Step 3: During the multi-scale feature upsampling and cross-scale feature transfer process in the network, a resampling optimization strategy oriented towards high-frequency detail preservation is adopted to alleviate edge detail loss and improve cross-scale feature alignment accuracy. Step 4: Construct image enhancement and target detection branches in parallel based on shared features. The image enhancement branch outputs the restored underwater image, and the target detection branch outputs the target category and target bounding box. The two branches share low-level and mid-level features within a unified framework. Step 5: Train the dual-branch network using a two-stage joint training strategy: In the construction phase, L1 loss is used to train the image enhancement branch, and YOLO detection loss is used to train the object detection branch; in the progressive optimization phase, the image enhancement branch is superimposed with LAB perceptual loss and TV total variation loss, and the object detection branch uses adaptive focus sliding loss AFSL to complete the learning of difficult samples. Step 6: During model inference, switch deployment modes according to actual application needs. Deployment modes include enhancement mode, detection mode, and dual-task mode.
[0008] Furthermore, the prior-guided channel attention submodule completes channel feature recalibration based on the physical prior that red light attenuates faster than blue and green light underwater, and introduces a learnable bias parameter to achieve red channel compensation, correcting the blue-green color cast in the underwater image; the specific method is as follows: First, global pooling is performed on the input features, as shown in the following formula: ; in, Indicates the first Global statistics for each channel; Represents the input feature tensor In the The first feature channel, the first line, number The eigenvalue at the column space location; , , These represent the normalized relative attenuation coefficients of red, green, and blue light in water, respectively. A larger coefficient indicates a stronger attenuation in the corresponding wavelength band, and satisfies the following conditions: For intermediate features with more than 3 channels, a learnable mapping function can be used. Map the three-dimensional spectral attenuation prior to C feature channels: ; in, This represents the channel prior vector that, after mapping, has the same number of input feature channels; Then calculate the channel attention weights. : ; in, For the sigmoid function, For activation function, These are learnable prior adjustment parameters; This represents the channel statistics vector obtained after performing global average pooling on each channel of the input features; and represent the learnable weight matrices of the first and second fully connected layers in the channel attention network, respectively; The characteristics after channel recalibration are: .
[0009] Furthermore, the multi-scale contrast enhancement submodule employs multi-branch dilated convolution to extract multi-receptive field contextual features and lightweightly fuses multi-scale features to improve the discriminative power of low-contrast underwater targets; the specific method is as follows: The channel-recalibrated features obtained from the prior-guided channel attention submodule are input into multiple dilated convolution branches with different dilation rates: ; in, Indicates the first The scale features output by each dilated convolution branch; Indicates the branch number of the dilated convolution. ; Indicates the total number of branches in a dilated convolution; Indicates the kernel size as void ratio dilated convolution operation; After extracting features at different scales, the features are concatenated and lightweightly fused to obtain: ; in, This represents the multi-scale fused features obtained after multi-scale feature stitching, channel fusion, and residual connection. This indicates that a splicing operation is performed along the feature channel dimension.
[0010] Furthermore, the dynamically gated underwater denoising attention submodule adaptively learns the water noise map, softly suppresses noise regions caused by suspended particles and scattering, and preserves the target structure texture information; the specific method is as follows: Predict the noise attention map based on the multi-scale fusion features obtained from the multi-scale contrast enhancement submodule: ; Where N represents the noise response intensity at each spatial location and channel; Then, soft suppression is performed using dynamic gating coefficients: ; in, This represents the denoised feature tensor obtained after suppressing water scattering noise and suspended particle noise through a dynamic gating mechanism. Its spatial size and number of channels are related to the multi-scale fusion features. To maintain consistency; ⊙ indicates element-wise multiplication. These are learnable denoising strength coefficients; The final output of PPEM is: .
[0011] Furthermore, the Adaptive Focus Sliding Loss (AFSL) includes a sliding weight term and a dynamic focus term, assigning differentiated weights to samples in different IoU intervals: low IoU samples maintain the basic weight, medium IoU samples are assigned enhanced weights, and high IoU samples are assigned decaying weights. That is, the loss weights are expressed as: ; in, This represents the average crossover-union ratio of positive samples in the current training batch, and serves as a dynamic threshold for distinguishing between low IoU samples, medium IoU hard samples, and high IoU samples. This represents the width of the sliding interval, and its value is a preset hyperparameter. when At that time, the sample uses a basic weight of 1; when At that time, the samples were weighted with enhanced weights. ; when At that time, the weight increases with IoU according to Gradually decrease; The batch average IoU is used as a dynamic adjustment parameter to automatically adjust the weight strength of difficult samples during training.
[0012] Furthermore, the enhancement mode closes the detection branch and outputs only the enhanced and repaired underwater image; the detection mode closes the enhancement branch output path and outputs only the target detection category and bounding box; the dual-task mode performs dual-branch synchronous inference and outputs the enhanced image and detection results in parallel.
[0013] Furthermore, the underwater image is an image of underwater marine life, a microscopic image of algae, or other images of underwater degraded scenes.
[0014] On the other hand, the present invention also provides an electronic device, comprising: one or more processors, and a memory for storing instructions that, when executed by the one or more processors, cause the one or more processors to perform the underwater image enhancement and target detection integrated method.
[0015] Thirdly, this application proposes a computer-readable storage medium storing executable instructions that, when executed, cause a processor to perform the integrated underwater image enhancement and target detection method.
[0016] The beneficial effects of adopting the above technical solution are as follows: The underwater image enhancement and target detection integrated method provided by this invention adopts integrated joint modeling, eliminating the defects of serial architecture and abandoning the serial process of "enhancing first and then detecting". It uses YOLOv11 shared feature backbone to achieve collaborative optimization of image enhancement and target detection, completely solving the problems of time delay accumulation, cross-module information fragmentation, and error propagation at each level; it adopts physical prior-driven feature enhancement, adapting to underwater degradation scenarios. The PPEM module integrates the physical laws of underwater optical attenuation, and simultaneously completes red channel color compensation, multi-scale contrast enhancement, and dynamic scattering noise suppression, improving the bias from the feature level. This invention addresses issues such as color distortion, low contrast, and grainy noise, significantly improving target feature recognition in weak textures and complex underwater backgrounds. It employs AFSL loss to optimize difficult samples, resulting in a substantial improvement in localization accuracy. A hierarchical weighting mechanism differentiates samples with varying IoU, strengthening training on moderately IoU difficult samples and dynamically adjusting training weights to significantly enhance bounding box regression accuracy. At a high IoU threshold (mAP75), its detection performance is significantly superior to traditional loss functions. This invention is lightweight and low-latency, suitable for embedded real-time deployment, with a total model parameter count of only 2.3M. In URPC2020 dataset testing, the detection mode inference latency was 13.59ms and the FPS was [missing data]. At 157.15 FPS, the dual-task mode still achieves 74.56, meeting the real-time inference needs of resource-constrained equipment such as AUVs and underwater monitoring terminals. The method of this invention is highly versatile, accommodating both conventional underwater targets and fine-grained microscopic targets. It is not only suitable for routine detection of marine organisms such as sea cucumbers, sea urchins, and starfish, but also for microscopic algae, completely preserving subtle boundaries and morphological features. The mAP50 of the algae dataset reaches 95.9%, and the mAP75 reaches 85.2%, demonstrating outstanding robustness in fine-grained recognition. This invention offers flexible multi-mode deployment, adapting to diverse underwater application scenarios. It supports three working modes: pure image enhancement, pure target detection, and dual-task enhancement + detection, covering various engineering scenarios such as underwater ecological inspection, AUV autonomous detection, offline underwater image analysis, and microscopic algae observation. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the overall framework of the integrated underwater image enhancement and target detection method provided in the first embodiment of the present invention; Figure 2 A flowchart of the method steps provided in the first embodiment of the present invention; Figure 3 This is a schematic diagram of the adaptive focus sliding loss (AFSL) weight allocation logic provided in the first embodiment of the present invention. Detailed Implementation
[0018] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0019] Example 1: An integrated method for underwater image enhancement and target detection, such as Figure 1 As shown, an underwater image acquisition device acquires underwater images to be processed and inputs these images into an integrated underwater image enhancement and target detection network. Depending on the specific application requirements, the network can operate in enhancement mode, detection mode, or a dual-task mode. In enhancement mode, only the enhanced image is output; in detection mode, only the target category and target bounding box are output; in dual-task mode, both the enhanced image and the target detection results are output simultaneously.
[0020] The integrated network used in this embodiment includes an input image, a shared backbone network, a physical prior coding module, a neck feature fusion network, a resampling optimization module, an image enhancement branch, and a target detection branch. The shared backbone network extracts features of different scales from the input underwater image, and the physical prior coding module performs channel recalibration, contrast enhancement, and noise suppression on these features. The neck feature fusion network completes cross-scale feature fusion through the resampling optimization module, and the fused features are then input to the image enhancement branch and the target detection branch, respectively.
[0021] like Figure 2 As shown, the method of this embodiment is specifically described below.
[0022] Step 1: Collect an image dataset of underwater marine life including sea cucumbers, sea urchins, scallops, and starfish, scale it to a resolution of 640×640 and perform normalization preprocessing.
[0023] Step 2: Input the preprocessed image into the YOLOv11 shared backbone network, and embed the PPEM physical prior coding module at the connection between the backbone and the neck network. The module consists of a prior guided channel attention submodule, a multi-scale contrast enhancement submodule, and a dynamic gated denoising attention submodule.
[0024] Step 3: PPEM performs red channel compensation, multi-scale contrast enhancement, and dynamic scattering noise suppression to complete feature recalibration.
[0025] Step 4: The neck network performs multi-scale feature fusion. During the fusion process, high-frequency details are introduced to maintain resampling optimization and reduce the loss of edge information.
[0026] Step 5: The fused features are fed into the image enhancement branch and the object detection branch respectively. The image enhancement branch outputs the repaired image, and the object detection branch outputs the object category and bounding box.
[0027] Step 6: Two-stage training: In the construction stage, L1 loss is used to train the image augmentation branch and YOLO standard loss is used to train the object detection branch; in the progressive optimization stage, the image augmentation branch is superimposed with LAB perceptual loss + TV loss, and the object detection branch uses AFSL loss.
[0028] like Figure 3 As shown, the horizontal axis represents the intersection-union ratio (IU) between the predicted bounding box and the ground truth bounding box, and the vertical axis represents the sliding weight. The average IU of the current batch of samples is used as the dynamic threshold. and with As the width of the sliding interval. When When, the samples use basic weights; when When, assign enhancement weights to moderately difficult IoU samples that have further optimization value; when At that time, the sample weight gradually decreases as the positioning accuracy increases.
[0029] Let the average intersection-union ratio (IUU) of positive samples in the current training batch be 0.60, which is the dynamic threshold. The width of the sliding interval is 0.10, that is... At this point, the interval boundaries for low IoU samples, medium IoU samples, and high IoU samples are 0.50 and 0.60, respectively.
[0030] When the IoU of a sample is 0.30, since the IoU of that sample is no greater than 0.50, it belongs to the low IoU sample range. Therefore, the basic weight is maintained and its sliding weight is 1.
[0031] When the IoU of a sample is 0.55, since the sample's IoU is greater than 0.50 and less than 0.60, it falls into the medium IoU hard sample range near the dynamic threshold, therefore, enhanced weights are applied. According to the weight calculation formula, the moving weight for this sample is: ; in, This represents the average crossover-union ratio of positive samples in the current training batch, and serves as a dynamic threshold for distinguishing between low IoU samples, medium IoU hard samples, and high IoU samples. This represents the width of the sliding interval, and its value is a preset hyperparameter.
[0032] This increases the contribution of such moderately IoU difficult samples to the loss calculation, allowing the model to focus on optimizing predicted bounding boxes that are close to correct but still lack sufficient localization accuracy.
[0033] When the IoU of a sample is 0.60, since the IoU of this sample is not lower than the dynamic threshold of 0.60, it belongs to the high IoU sample range, and its sliding weight gradually decreases as the IoU increases. The sliding weight of this sample is: ; When the IoU of a sample is 0.90, its moving weight is: ; When the IoU of a sample is 1.00, the predicted bounding box completely overlaps with the ground truth bounding box, and its sliding weight is: ; As can be seen from the above examples, in the low IoU range, the samples maintain their basic weights to ensure that the model continues to learn basic localization capabilities; in the medium IoU range near the dynamic threshold, the samples receive larger boost weights, allowing the model to focus on difficult positive samples with further optimization value; in the high IoU range, the sample weights gradually decay from a higher value to 1 as the IoU increases, thereby reducing the excessive consumption of training resources by high-quality easy samples.
[0034] Therefore, this sliding weight mechanism can differentiate the training contribution based on the localization quality of the samples, while preserving the basic learning ability of low IoU samples, strengthening medium IoU difficult samples, and appropriately reducing the relative influence of high IoU easy samples.
[0035] Step 7: Infer and output the detection results of various marine biological targets.
[0036] When performing fine-grained target detection of microalgae, based on the above overall framework, the input is replaced with a dataset of microscopic algae slices to detect microalgae such as Noctiluca scintillans, Alternaria stenoptera, Chaetoceros, and Navicula. Enhancement branches are retained throughout the training and inference process to strengthen the expression of the boundaries and subtle morphological features of microalgae. AFSL focuses on strengthening the learning of medium IoU difficult samples to improve the localization accuracy under high IoU threshold. The mAP75 of the algae dataset reaches 85.2%, which is suitable for microscopic fine-grained recognition scenarios.
[0037] When deployed in real-time in pure detection mode, the enhanced branch image output path is closed during the inference phase, and only the shared backbone, PPEM, resampling optimization module, and detection head are retained to perform inference; there is no image post-processing overhead, the inference latency is 13.59ms, the FPS is 157.15, and it is compatible with underwater AUVs and online real-time monitoring terminals.
[0038] In the pure enhancement mode underwater image preprocessing, the detection branch is closed during the inference stage, and only the backbone network and enhancement branch are enabled, outputting underwater images with color correction, denoising, and detail enhancement; suitable for underwater camera offline image restoration and marine environment manual observation and analysis scenarios.
[0039] In the dual-task synchronous output intelligent inspection mode, the enhancement branch and detection branch are activated simultaneously during the inference stage, and the repaired image and target detection results are output in parallel; the single model synchronously provides visual observation materials and target recognition data, which is compatible with marine ecological intelligent inspection and underwater auxiliary decision-making systems, with an inference speed of 74.56 FPS.
[0040] Training hyperparameters: momentum coefficient 0.937, weight decay 0.0005, initial learning rate 0.001, total training epochs 300, no external pre-trained weights loaded.
[0041] This embodiment uses the URPC2020 underwater target detection dataset for experimental verification. The detection categories include sea cucumbers, sea urchins, scallops, and starfish. After data screening and annotation checks, a total of 5500 valid underwater images were obtained. The dataset was divided into training, validation, and test sets using a hierarchical random partitioning method at an 8:1:1 ratio. The training set contains 4400 images, the validation set contains 550 images, and the test set contains 550 images. During data partitioning, images were used as the basic unit, and efforts were made to maintain a consistent distribution ratio for each target category across the training, validation, and test sets to avoid affecting model training and testing results due to differences in category distribution. For input images with different aspect ratios, the image size was adjusted proportionally, and image edges were padded to uniformly process the images to 640×640 pixels to avoid distortion of target shape and geometric proportions caused by direct stretching. The training set is used for model parameter learning, the validation set is used for model performance evaluation and parameter selection during training, and the test set is used only for verification of detection performance after model training is completed.
[0042] During model training, data augmentation operations such as random horizontal flipping, scale transformation, color perturbation, and stitching enhancement are performed on the training set images to improve the model's adaptability to different underwater lighting, target scale, occlusion degree, and background environment. No random data augmentation is performed on the validation and test sets; only proportional scaling, edge filling, and normalization are performed to ensure the objectivity and repeatability of the experimental results.
[0043] This embodiment uses a self-built algal microscopic image dataset for validation. Algal samples were collected from the nearshore waters of Qinhuangdao. After collection, they were stained and fixed with Luger's reagent, enriched by precipitation, and then diluted for microscopic observation. The microscopic image acquisition equipment used was a LEICA DMi8 microscopic imaging system, including a microscope and a matching image acquisition camera. Based on the size and morphological characteristics of different algal species, images were acquired at magnifications of 100x, 200x, or 400x, with the original image resolution being 2560×1920 pixels.
[0044] The self-built algal microscopic image dataset contains 827 algal microscopic images. Common algal species in the nearshore waters of Qinhuangdao are labeled according to algal biological classification standards, with classification down to at least the genus level. For targets with clear morphological characteristics, further identification is made down to the species level. The dataset includes 13 algal targets, such as *Noctiluca scintillans*, *Chaetoceros*, *Rhizophora*, *Cyclophora*, *Nyctaginosa*, *Prorocentrum microsporum*, *Pseudo-Nyctaginosa*, *Cyclophora spiralis*, *Navicula*, *Nyctaginosa*, *Skeletonema costatum*, and *Nyctaginosa longiformis*.
[0045] Data annotation was performed using LabelMe software. Initial annotation was done by He Yike, and subsequent annotation was reviewed by Feng Xin to verify category information, bounding box positions, and any missing or incorrect annotations. The bounding box was the smallest bounding rectangle completely enclosing the visible area of the algae target, and it was designed to closely match the target's outer contour. For targets with spikes, chain-like structures, long-axis protrusions, or other structures significant for classification, the corresponding visible structures were included in the bounding box. Multiple distinguishable independent targets were annotated separately; targets that severely overlapped, had unclear boundaries, or whose categories could not be reliably determined were not included in the effective training annotations.
[0046] The dataset was divided into training, validation, and test sets in an 8:1:1 ratio, containing 662, 83, and 82 images respectively. The data partitioning was based on the original microscopic field of view as the basic unit. Images from the same microscopic field of view and their corresponding cropped images were assigned to only one subset of the data to avoid data leakage caused by images from the same source appearing in the training, validation, and test sets.
[0047] Under the same experimental conditions, the YOLOv11 baseline model achieved mAP50 and mAP75 of 71.9% and 40.3%, respectively, with 2.6M parameters. After adding PPEM, the model's mAP50 increased to 82.3%, mAP75 increased to 45.6%, and the number of parameters decreased to 2.3M, indicating that PPEM can enhance target feature representation in degraded underwater scenes and reduce network redundancy. Adding AFSL alone improved the model's mAP50 and mAP75 to 79.3% and 47.4%, respectively, while maintaining the 2.6M parameter count. This demonstrates that AFSL can improve bounding box localization accuracy through adaptive weighting of difficult samples without changing the inference network structure.
[0048] When using both PPEM and AFSL simultaneously, the complete method of this invention achieves an mAP50 of 82.4% and an mAP75 of 48.2%, with a parameter count of 2.3M. Compared to the baseline model, mAP50 and mAP75 are improved by 10.5 and 7.9 percentage points, respectively, while the parameter count is reduced by 0.3M. These results demonstrate that PPEM and AFSL can contribute to feature representation and training optimization, respectively, and work synergistically to improve underwater target detection accuracy and boundary localization capabilities at high IoU thresholds while maintaining a lightweight design.
[0049] Example 2: This embodiment proposes an electronic device, including: one or more processors, and a memory for storing instructions, which, when executed by the one or more processors, cause the one or more processors to perform the underwater image enhancement and target detection integrated method.
[0050] The electronic device may be a mobile phone, computer, or tablet computer, etc., and includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements the integrated underwater image enhancement and target detection method as described in the embodiments. It is understood that the electronic device may also include an input / output (I / O) interface and communication components.
[0051] The processor is used to execute all or part of the steps in the integrated underwater image enhancement and target detection method as described in the above embodiments. The memory is used to store various types of data, which may include, for example, instructions for any application or method in the electronic device, as well as application-related data.
[0052] The processor can be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic components, and is used to execute the underwater image enhancement and target detection integrated method described in the above embodiments.
[0053] Example 3: This embodiment proposes a computer-readable storage medium that stores executable instructions. When these instructions are executed, if they are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0054] The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the integrated underwater image enhancement and target detection method described in the various embodiments of this application.
[0055] The aforementioned storage media include: flash memory, hard disk, multimedia card, card-type memory (e.g., SD (Secure Digital Memory Card) or DX (Memory Data Register, MDR) memory), random access memory (RAM), static random-access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, disk, optical disk, server, APP (Application) application store, and other media capable of storing program verification codes. These media store computer programs, which, when executed by a processor, can implement the various steps of the aforementioned integrated underwater image enhancement and target detection method.
[0056] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the present invention.
Claims
1. An integrated method for underwater image enhancement and target detection, characterized in that: Includes the following steps: Step 1: Acquire underwater images to be detected, uniformly scale them to 640×640 resolution and complete normalization preprocessing, then input them into the YOLOv11 shared backbone network; Step 2: Embed a Physical Prior Encoding Module (PPEM) into the YOLOv11 backbone network and / or neck network, and recalibrate the network features using underwater optical imaging physical priors; the PPEM includes a prior-guided channel attention submodule, a multi-scale contrast enhancement submodule, and a dynamically gated underwater denoising attention submodule. The feature tensor of the input PPEM is ,in, Indicates the number of feature channels. and These represent the height and width of the feature map, respectively. PPEM sequentially performs prior guidance channel recalibration, multi-scale contrast enhancement, and dynamic gating denoising. Step 3: During the multi-scale feature upsampling and cross-scale feature transfer process in the network, a resampling optimization strategy oriented towards high-frequency detail preservation is adopted to alleviate edge detail loss and improve cross-scale feature alignment accuracy. Step 4: Construct image enhancement and target detection branches in parallel based on shared features. The image enhancement branch outputs the restored underwater image, and the target detection branch outputs the target category and target bounding box. The two branches share low-level and mid-level features within a unified framework. Step 5: Train the dual-branch network using a two-stage joint training strategy: In the construction phase, L1 loss is used to train the image enhancement branch, and YOLO detection loss is used to train the object detection branch; in the progressive optimization phase, the image enhancement branch is superimposed with LAB perceptual loss and TV total variation loss, and the object detection branch uses adaptive focus sliding loss AFSL to complete the learning of difficult samples. Step 6: During model inference, switch deployment modes according to actual application needs. Deployment modes include enhancement mode, detection mode, and dual-task mode.
2. The integrated method for underwater image enhancement and target detection according to claim 1, characterized in that: The prior-guided channel attention submodule completes channel feature recalibration based on the physical prior that red light attenuates faster underwater than blue and green light, and introduces a learnable bias parameter to achieve red channel compensation, correcting the blue-green color cast in underwater images; the specific method is as follows: First, global pooling is performed on the input features, as shown in the following formula: ; in, Indicates the first Global statistics for each channel; Represents the input feature tensor In the The first feature channel, the first line, number The eigenvalue at the column space location; , , These represent the normalized relative attenuation coefficients of red, green, and blue light in water, respectively. A larger coefficient indicates a stronger attenuation in the corresponding wavelength band, and satisfies the following conditions: For intermediate features with more than 3 channels, a learnable mapping function can be used. Map the three-dimensional spectral attenuation prior to C feature channels: ; in, This represents the channel prior vector that, after mapping, has the same number of input feature channels; Then calculate the channel attention weights. : ; in, For the sigmoid function, For activation function, These are learnable prior adjustment parameters; This represents the channel statistics vector obtained after performing global average pooling on each channel of the input features; and represent the learnable weight matrices of the first and second fully connected layers in the channel attention network, respectively; The characteristics after channel recalibration are: 。 3. The integrated method for underwater image enhancement and target detection according to claim 2, characterized in that: The multi-scale contrast enhancement submodule uses multi-branch dilated convolution to extract multi-receptive field context features and lightweightly fuses multi-scale features to improve the distinguishability of low-contrast underwater target features. The specific method is as follows: The channel-recalibrated features obtained from the prior-guided channel attention submodule are input into multiple dilated convolution branches with different dilation rates: ; in, Indicates the first The scale features output by each dilated convolution branch; Indicates the branch number of the dilated convolution. ; Indicates the total number of branches in a dilated convolution; Indicates the kernel size as void ratio dilated convolution operation; After extracting features at different scales, the features are concatenated and lightweightly fused to obtain: ; in, This represents the multi-scale fused features obtained after multi-scale feature stitching, channel fusion, and residual connection. This indicates that a splicing operation is performed along the feature channel dimension.
4. The integrated method for underwater image enhancement and target detection according to claim 3, characterized in that: The dynamically gated underwater denoising attention submodule adaptively learns the water noise map, softly suppresses noise regions caused by suspended particles and scattering, and preserves the target structure texture information; the specific method is as follows: Predict the noise attention map based on the multi-scale fusion features obtained from the multi-scale contrast enhancement submodule: ; Where N represents the noise response intensity at each spatial location and channel; Then, soft suppression is performed using dynamic gating coefficients: ; in, This represents the denoised feature tensor obtained after suppressing water scattering noise and suspended particle noise through a dynamic gating mechanism. Its spatial size and number of channels are related to the multi-scale fusion features. To maintain consistency; ⊙ indicates element-wise multiplication. These are learnable denoising strength coefficients; The final output of PPEM is: 。 5. The integrated method for underwater image enhancement and target detection according to claim 4, characterized in that: The Adaptive Focus Sliding Loss (AFSL) includes a sliding weight term and a dynamic focus term, assigning differentiated weights to samples in different IoU intervals: low IoU samples maintain the basic weight, medium IoU samples are assigned enhanced weights, and high IoU samples are assigned decaying weights. The loss weights are expressed as follows: ; in, This represents the average crossover-union ratio of positive samples in the current training batch, and serves as a dynamic threshold for distinguishing between low IoU samples, medium IoU hard samples, and high IoU samples. This represents the width of the sliding interval, and its value is a preset hyperparameter. when At that time, the sample uses a basic weight of 1; when At that time, the samples were weighted with enhanced weights. ; when At that time, the weight increases with IoU according to Gradually decrease; The batch average IoU is used as a dynamic adjustment parameter to automatically adjust the weight strength of difficult samples during training.
6. The integrated method for underwater image enhancement and target detection according to claim 1, characterized in that: The enhancement mode in step 6 is to close the detection branch and only output the enhanced and repaired underwater image; the detection mode is to close the enhancement branch output path and only output the target detection category and bounding box; the dual-task mode is to perform dual-branch synchronous inference and output the enhanced image and detection results in parallel.
7. The integrated method for underwater image enhancement and target detection according to claim 6, characterized in that: The underwater images are images of underwater marine life, microscopic algae, or other underwater degraded scenes.
8. An electronic device, characterized in that: The method includes one or more processors and a memory for storing instructions that, when executed by the one or more processors, cause the one or more processors to perform the integrated underwater image enhancement and target detection method according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: It stores executable instructions that, when executed, cause the processor to perform the integrated underwater image enhancement and target detection method according to any one of claims 1-7.