A water quality adaptive detection task-oriented underwater image enhancement method and edge computing system

By using MS-WQPN and an edge-cloud collaborative optimization framework, the adaptability and real-time issues of underwater image enhancement technology in aquaculture scenarios are solved, achieving stable and efficient aquatic product feature enhancement and detection, and supporting real-time monitoring and model iterative optimization at the edge.

CN122492479APending Publication Date: 2026-07-31福州海洋研究院
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
福州海洋研究院
Filing Date
2026-05-09
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing underwater image enhancement technologies lack scene adaptability in aquaculture scenarios, the optimization objectives are disconnected from downstream tasks, making it difficult to meet the real-time requirements of the edge, and the lack of an edge-cloud collaboration mechanism leads to unstable enhancement effects under complex water quality conditions, weakened aquatic product characteristics, and inability to meet real-time monitoring needs.

Method used

A multi-scale water quality sensing and parameter estimation network (MS-WQPN) is used for water quality type classification and continuous water quality parameter regression. Soft routing weights are generated through dynamic temperature coefficients to achieve smooth switching of enhancement strategies under different water quality conditions. A detection task-oriented loss function and feature preservation structure are introduced. Combined with an edge-cloud collaborative optimization framework, a lightweight model is deployed at the edge, and the cloud teacher network optimizes the student network parameters.

Benefits of technology

It achieves stable enhancement under different water quality conditions, improves the performance of aquatic product detection and identification, meets the needs of real-time edge monitoring, reduces hardware investment and operation and maintenance costs, and supports continuous iterative optimization of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492479A_ABST
    Figure CN122492479A_ABST
Patent Text Reader

Abstract

This invention provides a water quality-adaptive, detection-oriented underwater image enhancement method and edge computing system, comprising the following steps: processing the input underwater aquaculture image through a multi-scale water quality perception and parameter estimation network, and outputting in parallel discrete classification logical values ​​representing water quality categories and continuous water quality parameter regression values ​​representing the physical properties of the water body; smoothing the probability distribution of the discrete classification logical values ​​using a dynamic temperature coefficient to generate soft routing weights; weighted fusing the output features of multiple image enhancement paths with different depths and structural characteristics to obtain fused enhancement features; generating an enhanced image based on the fused enhancement features, inputting the enhanced image into a pre-trained aquatic product detection network, and calculating the detection-oriented loss based on the output of the detection network; backpropagating the detection-oriented loss, simultaneously optimizing the trainable parameters of the multi-scale water quality perception and parameter estimation network and each image enhancement path, and outputting the final enhanced image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and digital image processing technology, specifically relating to an underwater image enhancement method and system for aquaculture scenarios, and particularly to an underwater image enhancement method and edge-cloud collaborative computing system based on multi-scale water quality perception and parameter estimation network (MS-WQPN), water quality adaptive dynamic routing and detection task-oriented optimization. Background Technology

[0002] With the rapid development of IoT and AI technologies, smart aquaculture has become an important direction for the industry's transformation and upgrading. Among them, applications based on computer vision, such as monitoring the growth status of aquatic products, identifying diseases, and precise feeding, place extremely high demands on the quality of underwater images.

[0003] However, the underwater environment is complex and variable. Light is absorbed and scattered as it travels through water, resulting in images that commonly suffer from color distortion, low contrast, blurred details, and uneven lighting. This is especially true in aquaculture settings, where high stocking densities, significant variations in water turbidity, and complex lighting conditions make traditional underwater image enhancement methods inadequate for practical applications.

[0004] Currently, underwater image enhancement techniques are mainly divided into two categories: traditional methods and deep learning methods.

[0005] (1) Traditional image processing methods: physical model-based restoration methods (such as dark channel prior and color correction) and non-physical model-based enhancement methods (such as histogram equalization and Retinex algorithm). These methods are computationally simple, but have poor generalization ability and are difficult to adapt to complex and ever-changing underwater environments.

[0006] (2) Deep learning methods: In recent years, underwater image enhancement methods based on convolutional neural networks (CNNs) have made significant progress. Representative techniques include: multi-scale residual networks, which improve the enhancement effect through multi-scale feature extraction and residual connections; attention mechanism methods, which introduce channel attention, spatial attention or hybrid attention mechanisms; generative adversarial networks, which use GANs to generate high-quality underwater images, but training is unstable and difficult to deploy; and Transformer architecture, which uses self-attention mechanism to capture long-distance dependencies, but computational complexity is high.

[0007] Despite some progress in underwater image enhancement, existing technologies still have the following technical shortcomings in practical applications of aquaculture:

[0008] Lack of scene adaptability: Existing methods mostly adopt static network structures and use fixed feature extraction and fusion strategies. However, the water quality conditions in aquaculture scenarios are complex and variable (clear, turbid, high suspended solids, etc.), and a single fixed network cannot maintain optimal performance under different water quality conditions. Although some methods introduce attention mechanisms, they are still weight adjustments within a fixed network structure and do not achieve dynamic adaptation of the network structure.

[0009] The optimization objectives are disconnected from downstream tasks: Existing methods mainly optimize pixel-level metrics (such as PSNR and SSIM) or visual perception quality, without considering the friendliness of enhanced images to subsequent tasks such as object detection and recognition. Experiments show that enhanced images with high PSNR do not necessarily lead to better detection accuracy, and the optimization objectives of existing methods deviate from the needs of practical applications.

[0010] Lack of customization for aquatic product characteristics: The core objective of aquaculture is to accurately identify and monitor the growth status of aquatic products (such as abalone and large yellow croaker). Existing methods use general convolution kernels without optimizing and enhancing the contour features and texture details of aquatic products, resulting in insufficient contrast between aquatic products and the background, which affects the accuracy of subsequent detection.

[0011] Difficulty in meeting the real-time requirements of edge computing: Aquaculture monitoring requires continuous operation 24 / 7. Existing deep learning methods have large model parameters (typically over 50MB), requiring GPU support, making them difficult to deploy on resource-constrained edge devices. Simple model compression, on the other hand, leads to a significant performance degradation, failing to meet the needs of practical applications.

[0012] Lack of edge-cloud collaboration mechanism: Existing methods mostly adopt a single-point deployment mode, with the edge running independently, which cannot utilize the powerful computing capabilities of the cloud for model optimization; the cloud also cannot obtain the actual operating data of the edge, making it difficult to achieve continuous iterative optimization of the model. Summary of the Invention

[0013] To address the shortcomings and deficiencies of existing technologies, this invention provides a water quality-adaptive, detection-task-oriented underwater image enhancement method and edge computing system. This invention employs a multi-scale water quality perception and parameter estimation network to simultaneously perform water quality type classification and regression estimation of continuous water quality physical parameters on the input underwater aquaculture image, thereby obtaining discrete classification logical values ​​and normalized water quality parameter regression values ​​in parallel. By applying a temperature coefficient dynamically modulated by the regression values ​​to the probability distribution of the classification logical values, soft routing weights are generated. These weights are then used to weighted fuse several enhancement paths of varying depths and structures, achieving smooth switching of enhancement strategies under different water quality conditions and avoiding enhancement quality fluctuations caused by traditional hard-switching strategies in transitional water bodies. The enhancement network is trained end-to-end with a detection task as the guiding principle. The enhanced image is input into a pre-trained aquatic product detection network to calculate a detection-oriented loss, which includes target classification loss, bounding box regression loss, and feature similarity loss. This loss, along with pixel-level loss and perception loss, forms the total loss function for backpropagation optimization. Furthermore, a dual-channel feature preservation structure is introduced in the enhancement process, which enhances features along the contour edge direction and surface texture direction of the aquatic products, respectively. Finally, high-frequency edge information is fused into the enhanced features through residual methods. At the system level, this invention constructs an edge-cloud collaborative framework: a lightweight student network is deployed at the edge to perform the enhancement task and uploads difficult samples with low detection confidence to the cloud; the cloud then optimizes the teacher network based on the collected difficult samples and updates the parameters of the edge student network through a composite knowledge distillation strategy that includes detection consistency distillation.

[0014] The specific technical solution adopted by this invention to solve its technical problem is as follows:

[0015] A water quality-adaptive, detection-oriented underwater image enhancement method is used to enhance underwater images in aquaculture scenarios, comprising the following steps:

[0016] The input underwater aquaculture images are processed by a multi-scale water quality sensing and parameter estimation network, and the discrete classification logic values ​​representing water quality categories and the continuous water quality parameter regression values ​​representing the physical properties of the water body are output in parallel.

[0017] A dynamic temperature coefficient is calculated based on the discrete classification logic value and the continuous water quality parameter regression value. The probability distribution of the discrete classification logic value is smoothed and modulated using the dynamic temperature coefficient to generate soft route weights. The output features of multiple image enhancement paths with different depths and structural characteristics are weighted and fused using the soft route weights to obtain fused enhancement features.

[0018] An enhanced image is generated based on the fusion enhancement features. The enhanced image is then input into a pre-trained aquatic product detection network. The detection-guided loss is calculated based on the output of the detection network. The detection-guided loss is backpropagated to simultaneously optimize the trainable parameters of the multi-scale water quality perception and parameter estimation network and each image enhancement path, and the final enhanced image is output.

[0019] Furthermore, the multi-scale water quality sensing and parameter estimation network includes a multi-scale feature extraction module, a water quality sensitive area attention module, a lightweight feature encoding module, and a multi-task estimation head, which are cascaded in sequence.

[0020] The multi-scale feature extraction module adopts a hollow spatial pyramid pooling structure, extracts water quality features in parallel through multiple branches with different receptive fields, and then fuses and outputs them.

[0021] The water quality sensitive area attention module recalibrates the input features through spatial attention and channel attention;

[0022] The lightweight feature encoding module uses depthwise separable convolution combined with channel shuffling operations for feature encoding;

[0023] The multi-task estimation head uses a dual-branch fully connected network to output the discrete classification logic value and the continuous water quality parameter regression value, respectively.

[0024] Furthermore, the discrete classification logic values ​​output by the multi-task estimation head correspond to three categories: clear water quality, turbid water quality, and water quality with high suspended particles; the continuous water quality parameter regression values ​​include at least the normalized estimates of water turbidity, visibility, and light intensity.

[0025] The multi-scale water quality sensing and parameter estimation network is trained using a weighted joint loss function, where the loss weight for the classification task is higher than that for the regression task.

[0026] Furthermore, the formula for calculating the dynamic temperature coefficient is as follows:

[0027]

[0028] in, For dynamic temperature coefficient, For learnable, adjustable hyperparameters These are regression values ​​for continuous water quality parameters;

[0029] The formula for calculating the weight of the soft router is:

[0030]

[0031] in, For soft router weights, For discrete classification logic values;

[0032] The learnable adjustable hyperparameters During training, optimization is performed through end-to-end backpropagation, and the range of values ​​is constrained by weight decay.

[0033] Furthermore, the multiple image enhancement paths with different depths and structural characteristics include shallow residual paths, deep residual paths, and multi-scale attention fusion paths;

[0034] The shallow residual path is adapted to clear water quality, the deep residual path is adapted to turbid water quality, and the multi-scale attention fusion path is adapted to water quality with high suspended particles.

[0035] The sum of the soft route weights corresponding to each image enhancement path is 1.

[0036] Furthermore, after obtaining the fused and enhanced features but before generating the enhanced image, a feature preservation enhancement step is also included:

[0037] The contour edge features of aquatic products are extracted by a multi-directional gradient filter bank, and the surface texture features of aquatic products are extracted by a high-frequency operator. After attention weighting, residual fusion is performed with the original features to obtain the optimized fusion enhanced features.

[0038] Furthermore, the detection-guided loss is composed of a weighted average of the target classification loss, the bounding box regression loss, and the feature similarity loss;

[0039] The feature similarity loss is used to measure the degree of similarity between the enhanced image and the reference image in the feature space of the aquatic product detection network.

[0040] The reference image is a clearly labeled image in the training set that corresponds to the input underwater aquaculture image, or a pseudo-reference image generated by a cloud-based teacher network.

[0041] Furthermore, the end-to-end training of the augmented network is optimized using a total loss function, which is a weighted sum of pixel-level loss, perceptual loss, and detection-guided loss.

[0042] The pixel-level loss uses L1 norm loss, and the perceptual loss is calculated based on multi-layer features of a pre-trained convolutional neural network.

[0043] Furthermore, it also includes edge-cloud collaborative optimization steps:

[0044] A lightweight enhancement network is deployed at the edge and the underwater image enhancement method is executed. Images with a detection confidence level lower than a preset threshold are selected as difficult samples and uploaded to the cloud.

[0045] The cloud-based teacher network is optimized based on difficult samples, and the lightweight augmented network parameters at the edge are updated through task-oriented knowledge distillation that includes detection consistency distillation.

[0046] And, an edge-cloud collaborative underwater image enhancement system, including an edge computing node, a cloud server and a communication module;

[0047] The communication module is used to enable bidirectional data transmission between edge computing nodes and cloud servers;

[0048] The edge computing nodes are deployed with lightweight student networks to perform the underwater image enhancement method described above;

[0049] The cloud server is equipped with a teacher network, which receives difficult samples uploaded by edge computing nodes through a communication module, updates the teacher network parameters based on the difficult samples, and optimizes the lightweight student network through task-oriented knowledge distillation that includes consistency detection distillation. The optimized student network parameters are then sent to the edge computing nodes through the communication module.

[0050] Compared to existing technologies, this invention and its preferred embodiment significantly improve the scene adaptability of underwater image enhancement schemes. Through fine-grained perception of water quality status and a dynamic routing mechanism, it can adaptively adjust the image enhancement strategy according to the changing water quality conditions in aquaculture scenarios, achieving a smooth transition of enhancement effects under different water quality environments. This avoids the performance degradation of traditional static networks in complex water quality scenarios and the insufficient image stability caused by hard switching strategies, maintaining stable and excellent enhancement effects under various water quality conditions. This invention achieves a deep alignment between image enhancement optimization goals and downstream aquaculture core application tasks, directly integrating the performance requirements of downstream tasks such as aquatic product detection and recognition into the optimization process of the enhancement network. It breaks through the limitations of traditional solutions that only optimize pixel-level image quality, enabling the enhanced images to better serve subsequent core applications such as target detection and state recognition, greatly enhancing the practical industrial application value of the solution. Meanwhile, this invention achieves customized feature preservation enhancement for core monitoring targets in aquaculture scenarios. It can directionally enhance the contour edges and surface texture details of aquatic products, effectively improving the contrast between the target and the water background. This preserves key and effective features for subsequent detection and identification tasks, avoiding the weakening of core target features by general enhancement schemes. Furthermore, this invention balances performance enhancement with the feasibility of edge deployment. Through a lightweight network architecture design, it can adapt to edge devices with limited resources in aquaculture sites, meeting the operational needs of 24 / 7 real-time monitoring. Simultaneously, through an edge-cloud collaborative system architecture, it can continuously iterate and optimize the model using real-world data collected at the edge, achieving continuous evolution of system performance and reducing hardware investment and maintenance costs for large-scale deployment. Attached Figure Description

[0051] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0052] Figure 1 This is a diagram illustrating the overall architecture of the water quality adaptive detection task-oriented underwater image enhancement system according to an embodiment of the present invention.

[0053] Figure 2 The diagram shows the structure of the Multi-Scale Water Quality Sensing and Parameter Estimation Network (MS-WQPN) in an embodiment of the present invention. In the diagram, (a) is a detailed diagram of the ASPP structure of the multi-scale feature extraction module, (b) is a detailed diagram of the WQA structure of the water quality sensitive area attention module, and (c) is a schematic diagram of the comparison of fine routing control logic.

[0054] Figure 3 This is a diagram of the dynamic routing multi-scale residual network structure according to an embodiment of the present invention.

[0055] Figure 4 This is a flowchart illustrating the task-oriented training process according to an embodiment of the present invention.

[0056] Figure 5 This is a structural diagram of the dual-channel module for maintaining aquatic product characteristics according to an embodiment of the present invention. Detailed Implementation

[0057] To make the features and advantages of the present invention more apparent and understandable, specific embodiments are described below in detail:

[0058] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0059] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0060] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a water quality-adaptive, detection task-oriented underwater image enhancement method and edge computing system. This addresses technical problems in existing technologies such as poor scene adaptability, disconnect between optimization goals and tasks, insufficient feature preservation capabilities, and difficulties in edge deployment. It is a novel underwater image enhancement method capable of adaptively adjusting according to water quality conditions, optimizing based on detection tasks, customizing for aquatic product characteristics, and supporting edge-cloud collaborative deployment.

[0061] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0062] In a first aspect, the present invention provides a water quality-adaptive, detection-oriented underwater image enhancement method, comprising the following steps:

[0063] S1: Multi-scale Water Quality Sensing Steps: The input underwater aquaculture image is analyzed using a Multi-scale Water Quality Sensing and Parameter Estimation Network (MS-WQPN), which outputs water quality type labels and estimated water quality parameters. MS-WQPN includes: a multi-scale feature extraction module, which uses a hollow spatial pyramid pooling (ASPP) structure to extract water quality features from different receptive fields in parallel; a water quality sensitive area attention module (WQA), which uses a spatial-channel dual attention mechanism to locate water quality feature regions and suppress interference from irrelevant regions; a lightweight feature encoding module, which uses depthwise separable convolution and channel shuffling operations to achieve efficient feature encoding; and a multi-task estimation head, which outputs water quality type classification results and regression values ​​of turbidity, visibility, and light intensity parameters in parallel.

[0064] S2: Fine-grained dynamic routing steps: Based on the water quality type classification logic value and water quality parameter estimation value output by the multi-task estimation head, calculate the dynamic temperature coefficient, which is used to smooth the distribution of the classification logic value and generate soft route weights; use the soft route weights to perform weighted fusion on multiple preset multi-scale residual connection paths of different depths to achieve a smooth transition of the enhancement strategy under different water quality conditions.

[0065] S3: Detection-oriented optimization step: Input the enhanced image into the pre-trained aquatic product detection network, calculate the detection loss and optimize the enhancement network parameters through backpropagation; the detection loss includes target classification loss, bounding box regression loss and feature similarity loss.

[0066] S4: Feature Preservation Enhancement Step: A dual-channel structure is used to process the outline edge and surface texture details of aquatic products respectively, and feature preservation enhancement is achieved through directional filter banks and high-frequency enhanced attention mechanism.

[0067] The multi-scale feature extraction module includes:

[0068] A 1×1 standard convolution branch captures detailed texture features; a 3×3 dilated convolution branch (with dilation rates of 3, 6, and 12) captures multi-scale contextual features; a global average pooling branch captures global statistical features; and a feature fusion layer concatenates the outputs of the five branches and reduces the dimensionality through a 1×1 convolution.

[0069] The water quality sensitive area attention module includes:

[0070] The spatial attention branch generates a spatial weight map through 7×7 convolution and 1×1 convolution to suppress interference from aquatic products and aquaculture equipment; the channel attention branch generates channel weights through global pooling and fully connected layers to enhance water quality sensitive feature channels; the feature recalibration unit performs element-wise multiplication operations on the original features with spatial weights and channel weights.

[0071] The lightweight feature encoding module uses depthwise separable convolution instead of standard convolution and introduces channel shuffling to promote information flow between channels, saving more than 85% of the number of parameters compared to standard convolution.

[0072] The multi-task estimation head includes:

[0073] The classification task branch outputs the probability distributions of three water quality categories: clear water, turbid water, and water with high suspended particulate matter. The regression task branch outputs three continuous parameter values: turbidity, visibility, and light intensity. The multi-task joint loss function uses a weighted summation method that combines the classification cross-entropy loss and the regression mean square error loss.

[0074] In the fine-grained dynamic routing steps:

[0075] When the water quality is clear and the visibility is >1.5m, the shallow residual path weight dominates (>60%); when the water quality is turbid and the turbidity is >300NTU, the deep residual path weight dominates (>60%); when the water quality is high in suspended particles, the multi-scale attention fusion path weight dominates (>60%); in transitional scenarios, the weights of the three paths change continuously according to the water quality parameters to achieve a smooth transition.

[0076] Secondly, the present invention provides an edge-cloud collaborative underwater image enhancement system, comprising:

[0077] Edge computing nodes deploy a lightweight student network to execute a task-oriented underwater image enhancement method for adaptive water quality detection, with MS-WQPN inference time <3ms and model size <1MB; cloud servers deploy a complex teacher network to periodically receive difficult samples uploaded from the edge, update teacher network parameters, and optimize the student network through task-oriented knowledge distillation; a communication module enables bidirectional data transmission between the edge and the cloud, including model parameter synchronization and difficult sample uploading.

[0078] The specific implementation of the present invention is further shown and described below:

[0079] 1. Multi-scale water quality sensing and parameter estimation network (MS-WQPN)

[0080] The multi-scale water quality sensing and parameter estimation network in this embodiment adopts a lightweight architecture that combines a multi-scale feature pyramid with a water quality sensitive area attention mechanism, including:

[0081] (1) Multi-scale feature extraction module

[0082] A dilated spatial pyramid pooling structure is employed, using five branches with different receptive fields in parallel to extract water quality features: Branch 1: 1×1 standard convolution (16 channels), capturing detailed texture features, suitable for clear water; Branches 2-4: 3×3 dilated convolution (16 channels, with dilation rates of 3, 6, and 12 respectively), capturing multi-scale contextual features, suitable for different turbidity levels; Branch 5: global average pooling, capturing global statistical features such as illumination and color cast. The outputs of the five branches are concatenated along the channel dimension (80 channels in total), and then reduced to 32 channels through 1×1 convolution to form a multi-scale fused feature map.

[0083] (2) Water Quality Attention (WQA) module

[0084] For input features (in Using spatial attention branches Convolution and Convolution extracts spatial distribution patterns, and a spatial weight map is generated using the Sigmoid activation function. Used to suppress irrelevant regions:

[0085]

[0086] The channel attention branch first performs global average pooling on the spatial dimension, and then generates channel weight vectors through a fully connected layer and activation mechanism. To enhance water quality sensitivity characteristics:

[0087]

[0088] in, This represents the Sigmoid function. Represents the ReLU activation function. and These are the weights for the fully connected layer.

[0089] The final feature recalibration is accomplished through element-wise multiplication:

[0090]

[0091] (3) Lightweight feature encoding module

[0092] Let the feature map input to this module be... (in This module mainly consists of depthwise separable convolution, channel shuffling, and global average pooling, achieving efficient feature encoding with extremely low parameter count. Depthwise separable convolution decomposes standard convolution into channel-wise depthwise convolution and cross-channel depthwise convolution. Pointwise convolution. Let the depthwise convolution kernel be... The pointwise convolution kernel is (in Its forward propagation process is represented as:

[0093]

[0094]

[0095] in, Indicates batch normalization. This represents the ReLU activation function. To facilitate information exchange between different channel groups, [the following is used]... Shuffle the channels and set the number of groups to [number]. The specific operation involves first reshaping the dimensions of the feature matrix, transposing it, and then flattening it.

[0096]

[0097] The feature map is then downsampled with a stride of 2 and then enters the second depthwise separable convolution (the number of channels is increased to...). ), generate feature maps Finally, global average pooling is used to losslessly compress the two-dimensional spatial features into a one-dimensional global feature vector. :

[0098]

[0099] (4) Multi-task estimation head

[0100] This module receives the 128-dimensional feature vector output by the feature encoder. Through a dual-branch fully connected network structure, water quality type classification results and continuous physical parameter prediction values ​​are output in parallel.

[0101] Task A (Water Quality Type Classification):

[0102] Two fully connected layers (FC) are used to map the feature dimensions sequentially. ), and incorporate Dropout into the hidden layer (with a failure rate set to 0). To prevent overfitting. Let... and Network weights, hidden layer features The calculation is as follows:

[0103]

[0104] The classification output layer uses the Softmax function to generate a three-dimensional probability distribution of water quality types. :

[0105]

[0106] That is, the probability that the network predicts an image belongs to the i-th water quality class is: .

[0107] Task B (Water Quality Parameter Regression):

[0108] Similarly, using the dimension... The network architecture uses a Sigmoid activation function instead of Softmax in the output layer, mapping the predicted values ​​to... The interval outputs a normalized continuous water quality parameter vector. :

[0109]

[0110]

[0111] In the formula, It is the ReLU activation function. For the Sigmoid function, and These represent the learnable weight matrix and bias vector of the corresponding fully connected layer in the regression branch, respectively. The output... The parameters are then directly fed into the "Fine Routing Control Strategy" module to calculate the dynamic temperature coefficient.

[0112] The joint loss function of MS-WQPN is defined as: Among them, the classification task weight Set to 1.0, regression task weight Set it to 0.5. By setting a smaller regression coefficient, we ensure that the accuracy of water quality categories is prioritized during the network convergence process, and then the estimation accuracy of physical parameters is optimized collaboratively.

[0113] (5) Fine-grained routing control strategy based on water quality parameter modulation

[0114] To avoid the sudden changes in local weights caused by traditional hard handover, this invention designs a soft routing calculation formula based on regression parameter modulation. Specifically, it utilizes the category logistic values ​​(Logits, denoted as...) output by the classification task branch. ) and the water quality parameters output by the regression task branch (denoted as ) ), calculate dynamic temperature coefficient The final soft route weights are generated using the smoothing Softmax function, and the mathematical formula is as follows:

[0115] Dynamic temperature coefficient:

[0116] Soft router weight:

[0117] in the formula This is a learnable, adjustable hyperparameter. It is useful when water quality is in a typical turbid state (e.g., classification probabilities tend towards turbidity, and turbidity is extremely high). When the value is small, the network will generate near-hard-assigned weights, causing the backbone network's computing power to focus on deep residual branches; when the water quality is in a transitional state, As the value increases, the Softmax distribution is smoothed, and the final weights are adaptively adjusted. .

[0118] 2. Dynamic routing multi-scale residual network (in collaboration with MS-WQPN)

[0119] Let the shallow feature map input to this module be... Receives fine-grained routing weight vectors calculated from MS-WQPN. .

[0120] This module contains three parallel feature extraction branches, each performing different nonlinear mapping operations:

[0121] Branch A (shallow residual path): Consists of 3 residual blocks (64 channels), suitable for clear water. Let its mapping function be... The output features are:

[0122]

[0123] Branch B (Deep Residual Path): Consists of 6 residual blocks (128 channels), suitable for turbid water. Let its mapping function be... The output features are:

[0124]

[0125] Branch C (Multi-scale Attention Path): Combines Selective Kernel attention mechanism, fusing... , and The multi-scale convolution kernel is suitable for water quality with high suspended particulate matter. Let its mapping function be... The output features are:

[0126]

[0127] Finally, the output features of the three branches are weighted and fused according to the soft routing weights modulated by water quality parameters to achieve fine-grained adaptation to water quality conditions and generate the final fused enhanced features. :

[0128]

[0129] like Figure 3 As shown, the dynamic routing multi-scale residual network of this invention receives fine routing weights calculated by MS-WQPN, sets up three parallel feature extraction branches adapted to different water quality conditions, and finally completes the weighted fusion of multi-branch features based on the routing weights to output fused enhanced features.

[0130] 3. Detection Task-Oriented Composite Loss Function

[0131] like Figure 4 As shown, this invention adopts a joint training strategy oriented towards detection tasks, which deeply couples the optimization objective of the augmentation network with the downstream aquatic product detection task. The end-to-end optimization of the augmentation network is achieved through a composite total loss function consisting of pixel-level loss, perception loss, and detection friendliness loss.

[0132] Define the total loss function of the augmentation network. The weighted sum of pixel-level loss, perceptual loss, and detection-friendly loss:

[0133]

[0134] Pixel-level loss Use the L1 norm, which has better smoothness, to measure the enhanced image. Compared with reference image Pixel-level differences:

[0135]

[0136] Perceived loss L2 distance is calculated based on multi-layer features extracted from a pre-trained VGG16 network to measure the difference between visual perception and semantic structure (wherein) Indicates the first of VGG16 Layer feature mapping):

[0137]

[0138] Detection of friendly loss This involves directly incorporating the performance of downstream aquatic product testing tasks into the optimization objective of the augmented network, further expanding it into a composite formula of classification loss, regression loss, and feature similarity loss:

[0139]

[0140] Among them, target classification loss Cross-entropy loss and bounding box regression loss are used. Smooth L1 loss and feature similarity loss are used. Calculate the cosine similarity loss between the enhanced image and the reference image in the feature space of the detection network.

[0141] 4. Dual-channel module for maintaining aquatic product characteristics

[0142] like Figure 5 As shown, the dual-channel module for preserving aquatic product features of this invention adopts a parallel dual-branch architecture of edge preservation channel and detail recovery channel. Combined with the identity mapping of the original features, it achieves preservation enhancement of aquatic product features through residual summation.

[0143] Edge-preserving channels:

[0144] A directional Sobel filter bank is used to extract the image gradient response. For the horizontal and vertical directions (0 degrees and 90 degrees), the feature extraction operator is approximately defined as partial derivative convolution:

[0145]

[0146] After extracting edge feature maps in four directions (0°, 45°, 90°, 135°), channel stitching is performed, and then... Convolution dimensionality reduction to the original number of channels Generate edge enhancement features .

[0147] Detailed recovery channel:

[0148] Using the Laplacian operator to capture high-frequency texture information, the Laplacian second derivative operation is defined as:

[0149]

[0150] After assigning channel weights to high-frequency features using a channel attention mechanism, the residuals of these features are summed with the original features and edge features to output the final preserved enhanced features.

[0151]

[0152] 5. Edge-Cloud Collaborative Knowledge Distillation

[0153] Teacher Network: Employs a complex hybrid architecture of U-TransCNN or Transformer-CNN, with approximately 100MB of parameters, deployed on a cloud GPU server. Student Network: Utilizes the dynamic routing lightweight network of this invention, with <5MB of parameters, deployed on an edge device. Knowledge Distillation Strategies: Soft label distillation, where the student network learns the soft output of the teacher network (temperature coefficient T=4); Feature distillation, minimizing the L2 distance between intermediate layer features of the student network and corresponding layer features of the teacher network; Detection consistency distillation, enhancing the consistency loss of detection results between the student and teacher networks.

[0154] The detection consistency distillation strategy is detailed below:

[0155] To ensure that the images enhanced by the edge student network achieve a high degree of consistency with the cloud teacher network in downstream detection tasks, this invention designs a detection consistency loss method tailored for aquatic product detection tasks. This loss function does not directly constrain pixels, but rather constrains the output feature layer of the detection network, specifically consisting of classification consistency loss and bounding box regression consistency loss.

[0156]

[0157] Formula details:

[0158] Classification consistency ( KL divergence was used to calculate the soft probability distribution of target categories detected by the teacher network. Category probability distribution corresponding to student network The relative entropy between them. This forces the augmented image of the student network not only to "detect" the aquatic products, but also to infinitely approximate the confidence distribution of the teacher network.

[0159] Bounding box regression consistency ( ): Generalized intersection-union loss is used to constrain the bounding box. Compared to the traditional L2 loss, This approach can more accurately penalize the positional bias and scale differences between student and teacher networks when predicting bounding boxes for aquatic products (such as densely overlapping abalone). By incorporating the aforementioned composite detection consistency loss into the distillation process, the lightweight enhancement model at the edge implicitly learns the feature extraction capabilities of complex models for blurred underwater targets.

[0160] In the detection of consistency distillation, the three key feature layers of the teacher network (Shallow details) (Mid-level semantics) (High-level task characteristics) are respectively related to the output layers of the three residual branches of the student network. Establish a one-to-one feature layer correspondence mapping. This is achieved through calculation. ,in Convolutional projection layers enable feature alignment between complex and lightweight models at the same semantic depth.

[0161] Compared with the prior art, the advantages of the solutions provided by the present invention include:

[0162] Significantly improved scenario adaptability: Through a water quality adaptive dynamic routing mechanism, the network can automatically select the optimal enhancement strategy based on actual water quality conditions. Experiments show that under three different water quality conditions, the PSNR and SSIM indicators of this invention are superior to those of the static network structure, especially in turbidity and high suspended solids scenarios where the improvement is more significant.

[0163] The optimization objective is highly aligned with the downstream task: a composite loss function oriented towards the detection task is introduced, directly incorporating the detection performance of aquatic products into the optimization objective. Comparative experiments show that, compared to methods that only optimize pixel-level indicators, the detection mAP of the enhanced images in this invention is improved by 12-18%, and the recall rate is improved by 15-20%, significantly outperforming existing technologies.

[0164] Effective preservation of aquatic product characteristics: The dual-channel enhancement module, designed for the morphological characteristics of aquatic products, can effectively enhance the outline edges and surface texture details, improve the contrast between aquatic products and the background, and provide high-quality visual input for subsequent detection and recognition.

[0165] Meeting edge real-time requirements: Through an edge-cloud collaborative knowledge distillation architecture, the lightweight edge model maintains high enhancement quality while achieving an inference speed of 30+ FPS (NVIDIA Jetson Nano), meeting real-time monitoring needs, and the model size is <5MB, making it suitable for large-scale deployment.

[0166] Support for continuous iterative optimization: The edge-cloud collaboration mechanism enables the system to continuously collect actual operational data, and through iterative optimization and knowledge distillation of the cloud-based teacher network, continuously improve the performance of the edge model and achieve the system's self-evolution.

[0167] Reduced deployment and maintenance costs: The edge does not require high-performance GPUs, and real-time enhancement can be achieved using low-cost embedded devices, which greatly reduces hardware investment and energy consumption costs, making it suitable for large-scale applications in aquaculture farms.

[0168] Achieving fine-grained water quality perception and precise routing control: Compared with traditional single classifiers (which only output 3 types of labels), MS-WQPN simultaneously outputs water quality type and continuous parameters through multi-task learning, achieving a leap from coarse-grained hard to fine-grained soft integration, and improving dynamic routing accuracy by more than 25%.

[0169] High-performance perception with extremely low computational overhead: MS-WQPN has only 0.8MB of parameters and an inference time of <3ms (JetsonNano), which is 2.5 times faster than traditional CNN classifiers, meeting the real-time requirements of edge computing without consuming the computational resources of the main augmentation network.

[0170] Enhancing robustness in complex transition scenarios: In actual aquaculture environments, water quality conditions often change gradually (e.g., gradually becoming turbid after feeding). MS-WQPN's soft routing mechanism can smoothly transition between different enhancement strategies, avoiding image jitter caused by hard switching, and significantly improving system stability.

[0171] Compared with the closest existing technology, the main differences of the present invention are: (1) Dynamic routing mechanism: Existing technology adopts a static network structure, while the present invention dynamically selects the network path according to the water quality conditions, which has scene adaptability. (2) Detection task orientation: Existing technology optimizes pixel-level or perception quality, while the present invention directly incorporates detection performance into the optimization target, which is highly consistent with the downstream task. (3) Feature preservation design: Existing technology uses a general convolution kernel, while the present invention designs directional filtering and high-frequency attention for aquatic product features to maintain the integrity of biological features. (4) Edge-cloud collaboration: Existing technology does not consider the deployment architecture, while the present invention proposes a complete edge-cloud collaborative optimization scheme that supports continuous learning and model evolution.

[0172] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0173] 1. System Overall Architecture

[0174] like Figure 1 As shown, the water quality adaptive detection task-oriented underwater image enhancement system of the present invention is composed of a real-time enhancement and detection link of edge computing nodes, a model iteration and knowledge distillation link of cloud server, and a communication module that realizes bidirectional data interaction, forming a closed-loop technical architecture of perception-enhancement-detection-iteration.

[0175] The edge computing node serves as the front-end execution unit of the system, carrying out the entire real-time underwater image processing process. Its main links are as follows: The input end receives raw underwater images of aquaculture scenes captured by underwater cameras. These images are first fed into a multi-scale water quality perception and parameter estimation network (MS-WQPN) to complete water quality analysis, and outputs in parallel water quality type classification logic values ​​and continuous water quality parameters such as turbidity, visibility, and light intensity. The above outputs are then fed into a fine dynamic routing control module to calculate and generate soft routing weights for three parallel enhancement paths. Based on the routing weights, the multi-path feature weighted fusion is completed and then fed into a dual-channel feature preservation module to complete the enhancement of aquatic product contour edges and the restoration of surface texture details, outputting the final enhanced image. The enhanced image is simultaneously fed into a pre-trained YOLOv5 aquatic product detection network, which outputs detection results such as aquatic product category, location, and growth status. At the same time, difficult samples with detection confidence below a threshold are selected and stored in the edge-end difficult sample pool.

[0176] The cloud server serves as the system's backend optimization unit, supporting continuous iterative optimization of the model. Its main process involves: receiving difficult samples uploaded from the edge computing nodes via the communication module and storing them in the cloud's difficult sample pool; periodically fine-tuning and optimizing the complex teacher network deployed in the cloud based on the collected field samples to generate high-quality pseudo-labels, deep features, and soft labels; performing task-oriented knowledge distillation (soft label distillation, feature distillation, and detection consistency distillation) via the knowledge distillation module to optimize the lightweight student network at the edge computing nodes; and finally, periodically sending updated student network model parameters to the edge computing nodes via the communication module to achieve continuous evolution of the system model.

[0177] Figure 1 In the diagram, the left side represents the system input, corresponding to the raw underwater images captured by the underwater camera; the middle section represents the core processing link of the edge computing node, from left to right: the core innovation area for water quality perception and routing, the lightweight student network enhancement processing area, and the downstream detection task output area; the upper part of the diagram represents the model optimization and knowledge distillation unit of the cloud server, which forms a two-way data interaction with the edge computing node; the right side of the diagram represents the system output, corresponding to the aquatic product detection results and enhanced image output.

[0178] 2. Specific Implementation Steps

[0179] Step 1: Data Preparation and Preprocessing

[0180] Training dataset construction:

[0181] Underwater images of aquaculture scenarios (abalone and large yellow croaker ponds) were collected, covering three water quality conditions: clear, turbid, and high suspended solids. Reference images (short-range, high-resolution) were captured under controlled conditions using professional underwater photography equipment and used as Ground Truth. Data augmentation was performed: random rotation, flipping, cropping, and brightness adjustment were applied to expand the dataset to 10,000 image pairs. During image acquisition, a turbidity sensor was used to simultaneously record water turbidity (NTU) and light intensity (Lux), and visibility distance (m) was measured using a reference calibration board. These continuous physical parameters were normalized and used as the ground truth for the regression task of the multi-task estimation head.

[0182] Preprocessing:

[0183] The images are resized to a uniform resolution of 256×256; normalized to the range of [0, 1]; and the input WQPN images are downsampled to 64×64 to improve processing speed.

[0184] Step 2: Training the Multi-Scale Water Quality Sensing and Parameter Estimation Network (MS-WQPN)

[0185] like Figure 2 As shown, the multi-scale water quality sensing and parameter estimation network in this embodiment adopts a lightweight architecture that combines a multi-scale feature pyramid with a water quality sensitive area attention mechanism. The overall structure consists of a multi-scale feature extraction module, a water quality sensitive area attention module, a lightweight feature encoding module, and a multi-task estimation head, all cascaded together. Figure 2 a is a detailed diagram of the ASPP structure for the multi-scale feature extraction module. Figure 2 b is a detailed structural diagram of the Water Quality Awareness (WQA) module for water quality sensitive areas. Figure 2 c is a schematic diagram comparing the logic of the soft routing control of this invention with that of traditional hard routing.

[0186] Detailed network architecture design:

[0187] (1) Multi-scale feature extraction module (ASPP)

[0188] The input image is [256×256×3], with 5 parallel branches: branch 1 is Conv1×1 (16ch), stride=1, receptive field=1; branches 2-4 are Conv3×3 (16ch), with dilatations of 3, 6, and 12, and receptive fields of 7, 13, and 25, respectively; branch 5 is global pooling. The outputs of the 5 branches are concatenated (80ch) and then reduced to 32ch by 1×1 convolution, resulting in an output [256×256×32].

[0189] Void rate selection principle: For clear water (visibility > 2m), effective details are in the range of 1-7 pixels, with branches 1-2 being dominant; for turbid water (visibility 0.5-2m), structural information is in the range of 7-25 pixels, with branches 3-4 being dominant; for high suspended matter (visibility < 0.5m), only large-scale structures are visible, with branches 4-5 being dominant.

[0190] (2) Water Quality Sensitive Area Attention Module (WQA)

[0191] For input features (in Using spatial attention branches Convolution and Convolution extracts spatial distribution patterns, and a spatial weight map is generated using the Sigmoid activation function. Used to suppress irrelevant regions:

[0192]

[0193] The channel attention branch first performs global average pooling on the spatial dimension, and then generates channel weight vectors through a fully connected layer and activation mechanism. To enhance water quality sensitivity characteristics:

[0194]

[0195] in, This represents the Sigmoid function. Represents the ReLU activation function. and These are the weights for the fully connected layer.

[0196] The final feature recalibration is accomplished through element-wise multiplication:

[0197]

[0198] (3) Lightweight feature encoding module

[0199] Let the feature map input to this module be... (in This module mainly consists of depthwise separable convolution, channel shuffling, and global average pooling, achieving efficient feature encoding with extremely low parameter count. Depthwise separable convolution decomposes standard convolution into channel-wise depthwise convolution and cross-channel depthwise convolution. Pointwise convolution. Let the depthwise convolution kernel be... The pointwise convolution kernel is (in Its forward propagation process is represented as:

[0200]

[0201]

[0202] in, Indicates batch normalization. This represents the ReLU activation function. To facilitate information exchange between different channel groups, [the following is used]... Shuffle the channels and set the number of groups to [number]. The specific operation involves first reshaping the dimensions of the feature matrix, transposing it, and then flattening it.

[0203]

[0204] The feature map is then downsampled with a stride of 2 and then enters the second depthwise separable convolution (the number of channels is increased to...). ), generate feature maps Finally, global average pooling is used to losslessly compress the two-dimensional spatial features into a one-dimensional global feature vector. :

[0205]

[0206] (4) Multi-task estimation head

[0207] This module receives the 128-dimensional feature vector output by the feature encoder. Through a dual-branch fully connected network structure, water quality type classification results and continuous physical parameter prediction values ​​are output in parallel.

[0208] Task A (Water Quality Type Classification):

[0209] Two fully connected layers (FC) are used to map the feature dimensions sequentially. ), and incorporate Dropout into the hidden layer (with a failure rate set to 0). To prevent overfitting. Let... and Network weights, hidden layer features The calculation is as follows:

[0210]

[0211] The classification output layer uses the Softmax function to generate a three-dimensional probability distribution of water quality types. :

[0212]

[0213] That is, the probability that the network predicts an image belongs to the i-th water quality class is: .

[0214] Task B (Water Quality Parameter Regression):

[0215] Similarly, using the dimension... The network architecture uses a Sigmoid activation function instead of Softmax in the output layer, mapping the predicted values ​​to... The interval outputs a normalized continuous water quality parameter vector. :

[0216]

[0217]

[0218] In the formula, It is the ReLU activation function. For the Sigmoid function, and These represent the learnable weight matrix and bias vector of the corresponding fully connected layer in the regression branch, respectively. The output... The parameters are then directly fed into the "Fine Routing Control Strategy" module to calculate the dynamic temperature coefficient.

[0219] The joint loss function of MS-WQPN is defined as: Among them, the classification task weight Set to 1.0, regression task weight Set it to 0.5. By setting a smaller regression coefficient, we ensure that the accuracy of water quality categories is prioritized during the network convergence process, and then the estimation accuracy of physical parameters is optimized collaboratively.

[0220] (5) Fine-grained routing control strategy based on water quality parameter modulation

[0221] To avoid the sudden changes in local weights caused by traditional hard switching, this invention utilizes the class logits (logits, denoted as...) output by the classification task branch. ) and the water quality parameters output by the regression task branch (denoted as ) ), calculate dynamic temperature coefficient The final soft route weights are generated using the smoothing Softmax function, and the mathematical formula is as follows:

[0222] Dynamic temperature coefficient:

[0223] Soft router weight:

[0224] in the formula For learnable and adjustable hyperparameters, routing modulation hyperparameters The initial value is set to 0.5, with a range limited to [0.1, 2.0]. In the initial stages of training, As learnable parameters, they are optimized end-to-end using the backpropagation algorithm. During training, constraints are applied... Weight decay prevents it from saturating too quickly, ensuring that the model maintains a consistent level of control over water quality parameters at the water quality boundary. Its sensitive response. When the water quality is in a typical turbid state (such as when the classification probability tends to be turbid and the turbidity is extremely high). When the value is small, the network will produce weights that are close to hard-assigned (e.g. This allows the backbone network's computing power to focus on deep residual branches; when the water quality is in a transitional state (e.g., the classification prediction is turbid, but the turbidity is low, only 150 NTU). As the value increases, the Softmax distribution is smoothed (softened), and the final weights are adaptively adjusted. .

[0225] The network structure that implements multi-branch enhanced path weighted fusion based on the above soft route weights is as follows: Figure 3 As shown.

[0226] Step 3: Detect task-oriented training strategies

[0227] Aquatic product testing network:

[0228] YOLOv5s was used as the pre-trained detection network; detection categories: abalone, large yellow croaker, and diseased areas; input: enhanced image; output: target category, confidence score, and bounding box coordinates.

[0229] Joint training process:

[0230] The joint training process used in this step is as follows: Figure 4 As shown.

[0231] Fix the detection network parameters and train only the augmentation network;

[0232] Forward propagation: Original image → Augmentation network → Augmented image → Detection network → Detection result;

[0233] Calculate the composite loss: ;

[0234] Backpropagation updates and enhances network parameters;

[0235] Every 10 epochs, the detection mAP is evaluated on the validation set, and the optimal model is saved.

[0236] Loss weight settings:

[0237] a=1.0 (pixel loss weight); b=0.1 (perceptual loss weight); c=0.5 (detection loss weight); d=1.0, e=1.0, f=0.5 (internal weight of detection loss).

[0238] Step 4: Implementation of the dual-channel feature preservation module

[0239] The overall structure of the dual-channel feature preservation module implemented in this step is as follows: Figure 5 As shown.

[0240] Edge-preserving channels:

[0241] A directional Sobel filter bank is used to extract the image gradient response. For the horizontal and vertical directions (0 degrees and 90 degrees), the feature extraction operator is approximately defined as partial derivative convolution:

[0242]

[0243] After extracting edge feature maps in four directions (0°, 45°, 90°, 135°), channel stitching is performed, and then... Convolution dimensionality reduction to the original number of channels Generate edge enhancement features .

[0244] Detailed recovery channel:

[0245] Using the Laplacian operator to capture high-frequency texture information, the Laplacian second derivative operation is defined as:

[0246]

[0247] After assigning channel weights to high-frequency features using a channel attention mechanism, the residuals of these features are summed with the original features and edge features to output the final preserved enhanced features.

[0248]

[0249] Step 5: Edge-Cloud Collaborative Deployment

[0250] Edge deployment:

[0251] Hardware platform: NVIDIA Jetson Nano (4GB RAM, 128-core GPU); Software environment: TensorRT acceleration, FP16 inference; Execution flow: (1) Receive camera input (1080p, 30fps); (2) Downsample to 256×256; (3) WQPN forward inference (<3ms); (4) Dynamic routing selection (<2ms); (5) Student network forward inference (<25ms); (6) Output enhanced image and upload to the cloud (upload 1 frame every 10 frames). Confidence screening threshold for difficult samples. The default setting is 0.40. This refers to the target confidence score output by the edge-end YOLOv5s detector. Furthermore, when the overlap is high after non-maximum suppression, the image frame is identified as a difficult sample and triggers the cloud upload mechanism.

[0252] Cloud deployment:

[0253] Hardware platform: NVIDIA RTX 3090 GPU; Operation process: (1) Receive hard samples (images with low confidence) uploaded by the edge; (2) The teacher network forward inferences to generate high-quality pseudo-labels; (3) Fine-tune the teacher network regularly (weekly) using the collected data; (4) Perform knowledge distillation to optimize the student network; (5) Push the updated student network parameters to the edge.

[0254] Details of knowledge distillation:

[0255] Temperature coefficient T=4, softening probability distribution; distillation loss: Student network fine-tuning: learning rate 0.0001, 10 epochs.

[0256] In a preferred embodiment, the routing modulation hyperparameter is set. The multi-task loss weight coefficients of MS-WQPN are set as follows: Classification ,return In the consistency distillation detection, the feature layer mapping relationship between the teacher network and the student network is as follows: , .

[0257] 3. Experimental verification and effect evaluation

[0258] 3.1 Experimental Setup

[0259] Dataset:

[0260] We have built our own underwater image dataset for aquaculture (AUD): 7000 pairs for training (original images + reference images), 1500 pairs for validation, and 1500 pairs for testing (500 pairs for each water quality).

[0261] Comparison method:

[0262] Traditional methods: Histogram equalization (HE), Dark channel prior (DCP); Deep learning methods: MetaUE, TDiR, PrompIR; In this invention: Complete solution (WQPN + dynamic routing + detection guidance + dual channel).

[0263] Evaluation indicators:

[0264] Image quality metrics: PSNR, SSIM; Detection performance metrics: mAP@0.5, Recall, Precision; Efficiency metrics: Inference time (ms), Model size (MB).

[0265] 3.2 Experimental Results

[0266] Table 1 Comparison of image enhancement performance under different water quality conditions

[0267]

[0268] Table 2 Comparison of detection performance of enhanced images (using YOLOv5s detector)

[0269]

[0270] Table 3 Comparison of computational efficiency and model size

[0271]

[0272] 3.3 Results Analysis

[0273] The experimental results show that: (1) Image quality improvement: The PSNR and SSIM of this invention are better than existing methods under three water quality conditions, and the average improvement is 0.8dB compared with the second best TDiR, proving the effectiveness of the water quality adaptive dynamic routing mechanism. (2) Significantly improved detection performance: The detection accuracy of the enhanced image of this invention reaches 80.2%, which is 13.69% higher than the original image and 3.3 percentage points higher than the second best TDiR, proving the effectiveness of the detection task-oriented optimization strategy. (3) Edge real-time performance: The edge model is only 4.2MB, and the inference speed on Jetson Nano reaches 36fps, which meets the real-time requirements and the performance is better than existing methods running on high-end GPUs. (4) Water quality adaptability: The performance advantage of this invention is more obvious in turbid and high suspended matter scenarios (PSNR improvement of 0.7 / 0.8dB), proving that the dynamic routing mechanism can effectively cope with complex water quality conditions.

[0274] 4 Typical Application Scenarios

[0275] Scenario 1: Monitoring of abalone farming ponds

[0276] Water quality characteristics: High stocking density, abundant excrement, and turbid water; Application effect: Utilizing a turbid water path, effectively removing the fog-like appearance and enhancing the edges of the abalone shell.

[0277] Scene 2: Large Yellow Croaker Cage Aquaculture

[0278] Water quality characteristics: Open water, large changes in light intensity, and many suspended solids; Application effect: Dynamically switches between clear and suspended solid paths to adapt to changes in light intensity and maintain the details of fish texture.

[0279] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0280] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

[0281] This invention is not limited to the preferred embodiment described above. Anyone inspired by this invention can derive various other forms of water quality adaptive detection task-oriented underwater image enhancement method and edge computing system. All equivalent variations and modifications made within the scope of the claims of this invention shall fall within the scope of this invention.

Claims

1. A water quality-adaptive, detection-oriented underwater image enhancement method for enhancing underwater images of aquaculture scenarios, characterized in that... Includes the following steps: The input underwater aquaculture images are processed by a multi-scale water quality sensing and parameter estimation network, and the discrete classification logic values ​​representing water quality categories and the continuous water quality parameter regression values ​​representing the physical properties of the water body are output in parallel. The dynamic temperature coefficient is calculated based on the discrete classification logic value and the continuous water quality parameter regression value. The probability distribution of the discrete classification logic value is smoothed and modulated using the dynamic temperature coefficient to generate soft routing weights. Using the soft routing weights, the output features of multiple image enhancement paths with different depths and structural characteristics are weighted and fused to obtain fused enhancement features; An enhanced image is generated based on the fusion enhancement features. The enhanced image is then input into a pre-trained aquatic product detection network. The detection-guided loss is calculated based on the output of the detection network. The detection-guided loss is backpropagated to simultaneously optimize the trainable parameters of the multi-scale water quality perception and parameter estimation network and each image enhancement path, and the final enhanced image is output.

2. The water quality adaptive detection task-oriented underwater image enhancement method according to claim 1, characterized in that: The multi-scale water quality sensing and parameter estimation network includes a multi-scale feature extraction module, a water quality sensitive area attention module, a lightweight feature encoding module, and a multi-task estimation head, which are cascaded together. The multi-scale feature extraction module adopts a hollow spatial pyramid pooling structure, extracts water quality features in parallel through multiple branches with different receptive fields, and then fuses and outputs them. The water quality sensitive area attention module recalibrates the input features through spatial attention and channel attention; The lightweight feature encoding module uses depthwise separable convolution combined with channel shuffling operations for feature encoding; The multi-task estimation head uses a dual-branch fully connected network to output the discrete classification logic value and the continuous water quality parameter regression value, respectively.

3. The water quality adaptive detection task-oriented underwater image enhancement method according to claim 2, characterized in that: The discrete classification logic values ​​output by the multi-task estimation head correspond to three categories: clear water quality, turbid water quality, and water quality with high suspended particles; the continuous water quality parameter regression values ​​include at least the normalized estimates of water turbidity, visibility, and light intensity. The multi-scale water quality sensing and parameter estimation network is trained using a weighted joint loss function, where the loss weight for the classification task is higher than that for the regression task.

4. The water quality adaptive detection task-oriented underwater image enhancement method according to claim 1, characterized in that: The formula for calculating the dynamic temperature coefficient is as follows: in, For dynamic temperature coefficient, For learnable and adjustable hyperparameters, These are regression values ​​for continuous water quality parameters; The formula for calculating the weight of the soft router is: in, For soft router weights, For discrete classification logic values; The learnable adjustable hyperparameters During training, optimization is performed through end-to-end backpropagation, and the range of values ​​is constrained by weight decay.

5. The water quality adaptive detection task-oriented underwater image enhancement method according to claim 1, characterized in that: The multiple image enhancement paths with different depths and structural characteristics include shallow residual paths, deep residual paths, and multi-scale attention fusion paths. The shallow residual path is adapted to clear water quality, the deep residual path is adapted to turbid water quality, and the multi-scale attention fusion path is adapted to water quality with high suspended particles. The sum of the soft route weights corresponding to each image enhancement path is 1.

6. The water quality adaptive detection task-oriented underwater image enhancement method according to claim 1, characterized in that: After obtaining the fused and enhanced features but before generating the enhanced image, a feature-preserving enhancement step is also included: The contour edge features of aquatic products are extracted by a multi-directional gradient filter bank, and the surface texture features of aquatic products are extracted by a high-frequency operator. After attention weighting, residual fusion is performed with the original features to obtain the optimized fusion enhanced features.

7. The underwater image enhancement method for water quality adaptive detection task-oriented method according to claim 1, characterized in that: The detection-guided loss is composed of a weighted average of the target classification loss, bounding box regression loss, and feature similarity loss. The feature similarity loss is used to measure the degree of similarity between the enhanced image and the reference image in the feature space of the aquatic product detection network. The reference image is a clearly labeled image in the training set that corresponds to the input underwater aquaculture image, or a pseudo-reference image generated by a cloud-based teacher network.

8. The water quality adaptive detection task-oriented underwater image enhancement method according to claim 1, characterized in that: The end-to-end training of the augmented network is optimized using a total loss function, which is a weighted sum of pixel-level loss, perceptual loss, and detection-guided loss. The pixel-level loss uses L1 norm loss, and the perceptual loss is calculated based on multi-layer features of a pre-trained convolutional neural network.

9. The water quality adaptive detection task-oriented underwater image enhancement method according to claim 1, characterized in that: It also includes edge-cloud collaborative optimization steps: A lightweight enhancement network is deployed at the edge and the underwater image enhancement method is executed. Images with a detection confidence level lower than a preset threshold are selected as difficult samples and uploaded to the cloud. The cloud-based teacher network is optimized based on difficult samples, and the lightweight augmented network parameters at the edge are updated through task-oriented knowledge distillation that includes detection consistency distillation.

10. An edge-cloud collaborative underwater image enhancement system, characterized in that, Includes edge computing nodes, cloud servers, and communication modules; The communication module is used to enable bidirectional data transmission between edge computing nodes and cloud servers; The edge computing node is deployed with a lightweight student network for executing the underwater image enhancement method according to any one of claims 1 to 9; The cloud server is equipped with a teacher network, which receives difficult samples uploaded by edge computing nodes through a communication module, updates the teacher network parameters based on the difficult samples, and optimizes the lightweight student network through task-oriented knowledge distillation that includes consistency detection distillation. The optimized student network parameters are then sent to the edge computing nodes through the communication module.