Adaptive fish target detection method and system for low-visibility water body
Patent Information
- Application Number
- CN202611406277.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-11
- Publication Date
- 2026-10-13
AI Technical Summary
[0006]为解决现有鱼类目标检测网络缺少水体低能见度感知能力、固定增强策略难以适应动态浑浊水体、重度浑浊条件下鱼体边界和纹理衰减导致漏检率升高的问题,本发明提供一种面向低能见度水体的自适应鱼类目标检测方法及系统
(1)本发明将水体浊度或图像退化程度建模为显式条件信号,使目标检测网络能够区分清水、中度浑浊和重度浑浊状态,避免对不同水质图像采用完全相同的特征响应策略;
Smart Images

Figure CN122906723A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of computer vision, intelligent sensing in aquaculture and deep learning target detection technology, and relates to a fish target detection method and system, specifically an adaptive fish target detection method and system for low visibility water bodies. Background Technology
[0002] In industrialized recirculating aquaculture, pond-based aquaculture, and cage aquaculture, fish target detection is fundamental for achieving precise feeding, population estimation, biomass assessment, behavioral analysis, and health monitoring. Compared to manual observation or contact sampling, underwater vision-based automated detection methods offer advantages such as non-contact, continuous operation, and high throughput, making them more suitable for long-term online monitoring.
[0003] However, visibility in real aquaculture water is not a stable condition. Uneaten feed, feces, microorganisms, bottom sediment disturbance, water circulation, and the feeding process can cause changes in the concentration of suspended particulate matter, leading to light scattering, absorption, and uneven local illumination. Low visibility in the water will cause the edges of fish bodies to diffuse, the texture details to be attenuated, and the contrast between the background and the fish body to be reduced. In the case of high-density fish schools, this can further lead to missed detections, false detections, and positioning errors.
[0004] Existing underwater fish target detection methods are mostly based on conventional YOLO, Faster R-CNN, or Transformer detectors, typically treating clear water and turbid water images as the same type of input, lacking explicit modeling of the degree of water degradation. Some methods add fixed image enhancement operations such as CLAHE before detection, which can improve contrast in local scenes, but the enhancement intensity is independent of the current water state, easily leading to over-enhancement in clear water images, and cannot directly adjust the semantic features of deep fish bodies.
[0005] Therefore, it is necessary to propose a detection method that can sense the low visibility state of water bodies and adaptively adjust the fish body feature response according to the state, so that the detection network can maintain strong robustness in continuously changing scenarios such as clear water, moderate turbidity and heavy turbidity. Summary of the Invention
[0006] To address the problems of existing fish target detection networks lacking the ability to perceive low visibility in water bodies, fixed enhancement strategies being unable to adapt to dynamically turbid water bodies, and the increased false negative rate caused by the attenuation of fish body boundaries and textures under heavily turbid conditions, this invention provides an adaptive fish target detection method and system for low visibility water bodies.
[0007] The technical solution adopted by the method of the present invention is: an adaptive fish target detection method for low visibility water bodies, comprising the following steps: Step 1: Acquire underwater fish image data and generate image-level low-visibility pseudo-labels; Step 2: Input the underwater fish image into the fish target detection network, and extract multi-scale fish body features through the backbone feature extraction network, including shallow spatial detail features P3, mid-level semantic features P4 and deep semantic features P5; Step 3: Using the turbidity prediction head set in the fish target detection network, predict the image-level turbidity estimate T of the current image based on the deep semantic feature P5; Step 4: Input the mid-layer semantic feature P4 and the image-level turbidity estimate T into the turbidity adaptive channel modulation module TA-Block set in the fish target detection network. After turbidity conditional modulation, the enhanced feature is output. ; Step 5: Input the modulated enhanced feature P4′ into the feature fusion network and detection head set in the fish target detection network, and output the fish target bounding box, category confidence and detection result.
[0008] Preferably, in step 1, image-level low visibility pseudo-labels are generated based on the image gradient magnitude variance and the image average brightness. ;in, It is the sum of the variance in the horizontal direction and the variance in the vertical direction; The average brightness of the grayscale image; It is a stability constant used to avoid the denominator being zero; This is the empirical normalization coefficient.
[0009] Preferably, in step 2, the backbone feature extraction network includes a first Conv layer, a second Conv layer, a first C3k2 layer, a third Conv layer, a second C3k2 layer, a fourth Conv layer, a third C3k2 layer, a fifth Conv layer, a fourth C3k2 layer, an SPPF layer, and a C2PSA module connected in sequence; wherein, the first Conv layer, the second Conv layer, the third Conv layer, the fourth Conv layer, and the fifth Conv layer are each composed of a two-dimensional convolutional layer, a two-dimensional batch normalization layer, and a SiLU activation layer connected in sequence, used to realize the convolutional transformation and nonlinear mapping of the input features; the first C3k2 layer, the second C3k2 layer, the third C3k2 layer, and the fourth C3k2 layer are used to perform branch transformation and feature extraction on the input features. Extraction, channel concatenation, and convolutional fusion are used to achieve multi-level feature aggregation and enhance feature representation capabilities. The SPPF layer is used to aggregate contextual information from different receptive fields through continuous multi-level max pooling and feature concatenation, thereby expanding the network's effective receptive field and enhancing multi-scale feature representation capabilities. The C2PSA module is used to enhance the network's ability to represent key regions and important semantic information of fish targets through channel partitioning, attention modeling, feature concatenation, and convolutional fusion. The second C3k2 layer, the third C3k2 layer, and the C2PSA module output shallow spatial detail features P3 with a spatial size of 1 / 8 of the input image size, mid-level semantic features P4 with a spatial size of 1 / 16 of the input image size, and deep semantic features P5 with a spatial size of 1 / 32 of the input image size, respectively.
[0010] Preferably, in step 3, the turbidity prediction head includes a global average pooling layer, a multilayer perceptron, and a sigmoid output layer; let the input deep semantic features be P5, where F∈R. (C×H×W) Where C is the number of channels, and H and W are the feature map height and width, respectively; the global average pooling layer is used to calculate the global description vector z of each channel; where the global description vector of the c-th channel is... ; This represents the feature value of the c-th channel in deep semantic feature P5 at the spatial position of the i-th row and j-th column. The multilayer perceptron outputs an image-level turbidity estimate T based on the channel global description vector z. ; Where σ(·) is the Sigmoid activation function, f MLP (·) is the multilayer perceptron mapping function, T∈(0,1), and the larger T is, the higher the degree of low visibility of the current image.
[0011] Preferably, in step 4, the turbidity adaptive channel modulation module TA-Block includes a channel statistics unit, a turbidity feature splicing unit, a bottleneck multilayer perceptron, a turbidity gating unit, and a residual rescaling unit; let the input mid-layer semantic feature P4 be X∈R. (C×H×W) Where C is the number of channels, and H and W are the feature map height and width, respectively; the channel statistics unit is used to calculate the channel statistics vector. ; where the statistical vector of the c-th channel ; The c-th channel of the mesoscale fusion feature P4 represents the feature value at the spatial location of the i-th row and j-th column. The turbidity feature splicing unit is used to combine the channel statistical vectors Concatenated with the image-level turbidity estimate T, it forms a joint turbidity-sensing representation. ; The bottleneck multilayer perceptron is used to generate channel weights. Where σ(·) is the Sigmoid activation function and δ(·) is the SiLU activation function; The dimension reduction matrix compresses the C+1 dimensional input into a C / r dimensional bottleneck space, where r is the channel compression ratio; W up To increase the dimension of the matrix, the bottleneck space is restored to a C-dimensional channel space; W∈R C This is the final channel weight vector; The turbidity gating unit is used to determine the image-level turbidity estimate T and the low turbidity gating threshold. and high turbidity gating threshold Calculate normalized gated variables and smoothing gate coefficient Where Clamp(·) is the cutoff function; when T is lower than hour, Approaching 0, the TA-Block maintains an approximate identity mapping; when T is higher than 0... hour, When the value approaches 1, the TA-Block enters a fully modulated state; The residual rescaling unit is used to adjust the smoothing gate coefficient. Constrained learnable scaling gain Maximum channel modulation amplitude Given the channel weights W, calculate the residual offset for each channel. , According to the residual offset Calculate channel scaling factor The input feature X is then rescaled channel-by-channel using the channel scaling factor to obtain the enhanced mesoscale feature. ;in, For learnable scaling parameters, It is the hyperbolic tangent function. The maximum channel modulation amplitude is represented by ⊙, which indicates element-wise Hadamard multiplication and automatic broadcasting in the spatial dimension. The channel weights are mapped from (0,1) to (-1,1) using 2W-1 to achieve bidirectional enhancement or suppression of different channels.
[0012] Preferably, in step 5, the feature fusion network includes a first Upsample layer, a first Concat layer, a fifth C3k2 layer, a second Upsample layer, a second Concat layer, a sixth C3k2 layer, a sixth Conv layer, a third Concat layer, a seventh C3k2 layer, a seventh Conv layer, a fourth Concat layer, and an eighth C3k2 layer. The sixth and seventh Conv layers each consist of a sequentially connected two-dimensional convolutional layer, a two-dimensional batch normalization layer, and a SiLU activation layer, used to perform convolutional transformations and nonlinear mappings of the input features. The fifth, sixth, seventh, and eighth C3k2 layers are used to perform branch transformations, feature extraction, channel concatenation, and convolutional fusion on the input features to achieve multi-level feature aggregation and enhance feature representation capabilities. The deep semantic feature P5 is upsampled to 1 / 16 of the input image size by the first Upsample layer, and then concatenated with the mid-level semantic feature P4 output by the backbone feature extraction network along the channel direction by the first Concat layer, and then fused by the fifth C3k2 layer. The fused feature and the image-level turbidity estimate T are input into the turbidity adaptive channel modulation module TA-Block to obtain the enhanced mesoscale feature. ; The enhanced mesoscale features After upsampling to 1 / 8 of the input image size by the second Upsample layer, and concatenating with the shallow spatial detail features P3 output by the backbone feature extraction network along the channel direction by the second Concat layer, and then performing feature fusion by the sixth C3k2 layer, a first detection feature X1 with a spatial size of 1 / 8 of the input image size is obtained. The first detection feature X1 is used for small target detection. The first detection feature X1 is downsampled to 1 / 16 of the input image size by the sixth Conv layer, and then compared with the enhanced mesoscale feature. The third Concat layer is used to stitch the images along the channel direction, and then the seventh C3k2 layer is used for feature fusion to obtain a second detection feature X2 with a spatial size of 1 / 16 of the input image size. The second detection feature X2 is used for medium target detection. The second detection feature X2 is downsampled to 1 / 32 of the input image size by the seventh Conv layer, and then concatenated with the deep semantic feature P5 output by the backbone feature extraction network through the fourth Concat layer along the channel direction. Finally, it is fused through the eighth C3k2 layer to obtain the third detection feature X3 with a spatial size of 1 / 32 of the input image size. The third detection feature X3 is used for large target detection.
[0013] Preferably, in step 5, the detection head includes a first detection layer, a second detection layer, and a third detection layer; the three scale detection features X1, X2, and X3 output by the feature fusion network are respectively input into the first detection layer, the second detection layer, and the third detection layer, and are used for small-scale, medium-scale, and large-scale fish target detection, respectively; wherein, the first detection layer receives 1 / 8 scale features, the second detection layer receives 1 / 16 scale features, and the third detection layer receives 1 / 32 scale features, and outputs target category, bounding box position, and confidence information.
[0014] Preferably, in step 5, the multi-scale detection module performs bounding box regression and class prediction on the first detection feature X1, the second detection feature X2, and the third detection feature X3, respectively. Based on the bounding box regression results, the reference points and stride corresponding to different detection scales are decoded to obtain the position coordinates of the fish target boxes. The class prediction score is converted into class confidence through the Sigmoid activation function, and the predicted class of the candidate fish target boxes is determined based on the class confidence. The fish target boxes and class confidence of the three detection scales are summarized, and low-confidence candidate boxes and overlapping redundant candidate boxes are removed by confidence thresholding and non-maximum suppression to obtain the final detection result containing the position of the fish target box, the predicted class, and the corresponding class confidence.
[0015] Preferably, the target detection network is a pre-trained network; the loss function L used during training is: ; ; Among them, L det For baseline detection loss, B is the mean squared error loss; B is the batch size, T is the mean squared error loss. k Let T be the predicted turbidity value for the k-th image. pseudo,k λ is the turbidity pseudo-label for the k-th image; λ is the weight coefficient for the turbidity prediction task, used to balance the optimization of fish target detection and the optimization of turbidity perception.
[0016] The technical solution adopted by the system of the present invention is: an adaptive fish target detection system for low visibility water bodies, comprising: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the adaptive fish target detection method for low-visibility water bodies.
[0017] Compared with the prior art, the beneficial effects of the present invention include: (1) The present invention models the turbidity of water or the degree of image degradation as an explicit conditional signal, so that the target detection network can distinguish between clear water, moderate turbidity and heavy turbidity, and avoids using the same feature response strategy for different water quality images. (2) The present invention generates image-level low visibility estimates by using a weakly supervised turbidity prediction head, without relying on synchronous turbidity sensor annotation for each frame, which is convenient for deployment in actual aquaculture systems; (3) The present invention sets up a turbidity adaptive channel modulation module TA-Block in the P4 feature branch, which can take into account both spatial details and semantic abstraction, enhance stable contours and fish semantic channels under heavy turbidity conditions, and suppress background scattering and noise-sensitive channels. (4) The present invention adopts a bounded residual modulation method to maintain an approximately identical mapping in the clear water state, reduce the disturbance to the high quality features of the original detector, and gradually enhance the detection capability of low contrast targets in the turbid state. (5) This invention optimizes the turbidity prediction auxiliary task and the fish target detection task together, so that the backbone network can learn the fish body category and location features while obtaining the ability to distinguish the degree of image degradation, thereby improving the adaptability of feature representation to changes in water state. (6) This invention utilizes P3, P4 and P5 multi-scale features for fusion and forms detection features for small, medium and large-scale fish respectively, which is beneficial to take into account the detection needs of small targets at a distance, targets occluded by fish schools and large targets at close range. (7) The present invention adopts an end-to-end single-stage detection structure. No additional image enhancement processing or frame-by-frame external turbidity sensor input is required in the inference stage. The target location, category and confidence level can be directly output, which is convenient for continuous online deployment on local computers or edge devices at the breeding site. Attached Figure Description
[0018] The technical solutions of the present invention will be further illustrated below using embodiments and specific implementation methods. In addition, some accompanying drawings are used in the description of the technical solutions. Those skilled in the art can obtain other drawings and the intent of the present invention from these drawings without any creative effort.
[0019] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the underwater image acquisition principle of an embodiment of the present invention; Figure 3 This is a diagram of the target detection network structure according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the turbidity prediction head structure according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the turbidity adaptive channel modulation module structure according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the target detection network training process according to an embodiment of the present invention; Figure 7 This is a schematic diagram of an experimental scenario according to an embodiment of the present invention; Figure 8 This is a schematic diagram comparing the detection results in heavily turbid water in an embodiment of the present invention; Figure 9 This is a schematic diagram comparing the detection results in moderately turbid water in an embodiment of the present invention. Figure 10 This is a schematic diagram showing the comparison of detection results in low-turbidity water in an experiment according to an embodiment of the present invention. Detailed Implementation
[0020] To facilitate understanding and implementation of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0021] Please see Figure 1 This embodiment provides an adaptive fish target detection method for low-visibility water bodies, comprising the following steps: Step 1: Acquire underwater fish image data and generate image-level low-visibility pseudo-labels; Please see Figure 2 In one embodiment, an underwater camera is fixed to the inner wall of the recirculating aquaculture pond at a depth of approximately 150 cm below the water surface, capturing video streams with a resolution of 1920×1080 and a frame rate of 30 fps. During the acquisition process, water temperature, dissolved oxygen, and water pressure are maintained within the allowable range for aquaculture, and different turbidity states are created by adjusting the feeding amount, introducing suspended bottom sediment, and changing the water circulation rate.
[0022] Water conditions were measured using a Seymbo disk and an optical turbidimeter. Clear water corresponds to a turbidity of 0.3–0.5 NTU and a Seymbo disk depth greater than 100 cm; moderately turbid water corresponds to a turbidity of 0.5–1.0 NTU and a Seymbo disk depth of 50–100 cm; and heavily turbid water corresponds to a turbidity of 1.0–1.5 NTU and a Seymbo disk depth less than 50 cm. For images where turbidity was not measured simultaneously, gradient variance, edge intensity, and local contrast were calculated as degradation statistics to generate continuous low-visibility pseudo-labels.
[0023] In one implementation, image-level low-visibility pseudo-labels are generated based on the image gradient magnitude variance and the image average brightness. ;in, It is the sum of the variance in the horizontal direction and the variance in the vertical direction; The average brightness of the grayscale image; It is a stability constant used to avoid the denominator being zero; These are empirical normalization coefficients; the sharper the image edges and the richer the texture, the better. The larger, The closer it gets to 0; when water turbidity causes boundary diffusion and texture attenuation, The smaller, The closer it gets to 1.
[0024] Step 2: Input the underwater fish image into the fish target detection network, and extract multi-scale fish body features through the backbone feature extraction network, including shallow spatial detail features P3, mid-level semantic features P4 and deep semantic features P5; Please see Figure 3In one embodiment, the backbone feature extraction network includes a first Conv layer, a second Conv layer, a first C3k2 layer, a third Conv layer, a second C3k2 layer, a fourth Conv layer, a third C3k2 layer, a fifth Conv layer, a fourth C3k2 layer, an SPPF layer, and a C2PSA module connected in sequence. The first Conv layer, the second Conv layer, the third Conv layer, the fourth Conv layer, and the fifth Conv layer are each composed of a two-dimensional convolutional layer, a two-dimensional batch normalization layer, and a SiLU activation layer connected in sequence, used to perform convolutional transformation and nonlinear mapping of the input features. The first C3k2 layer, the second C3k2 layer, the third C3k2 layer, and the fourth C3k2 layer are used to perform branch transformation and feature extraction on the input features. Extraction, channel concatenation, and convolutional fusion are used to achieve multi-level feature aggregation and enhance feature representation capabilities. The SPPF layer is used to aggregate contextual information from different receptive fields through continuous multi-level max pooling and feature concatenation, thereby expanding the network's effective receptive field and enhancing multi-scale feature representation capabilities. The C2PSA module is used to enhance the network's ability to represent key regions and important semantic information of fish targets through channel partitioning, attention modeling, feature concatenation, and convolutional fusion. The second C3k2 layer, the third C3k2 layer, and the C2PSA module output shallow spatial detail features P3 with a spatial size of 1 / 8 of the input image size, mid-level semantic features P4 with a spatial size of 1 / 16 of the input image size, and deep semantic features P5 with a spatial size of 1 / 32 of the input image size, respectively.
[0025] Step 3: Using the turbidity prediction head set in the fish target detection network, predict the image-level turbidity estimate T of the current image based on the deep semantic feature P5; Please see Figure 4 In one implementation, the turbidity prediction head includes a global average pooling layer, a multilayer perceptron, and a sigmoid output layer; let the input deep semantic features be P5, where F∈R. (C×H×W) Where C is the number of channels, and H and W are the feature map height and width, respectively; the global average pooling layer is used to calculate the global description vector z of each channel; where the global description vector of the c-th channel is... ; This represents the feature value of the c-th channel in deep semantic feature P5 at the spatial position of the i-th row and j-th column. The multilayer perceptron outputs an image-level turbidity estimate T based on the channel global description vector z. ; Where σ(·) is the Sigmoid activation function, f MLP (·) is the mapping function of the multilayer perceptron, T∈(0,1). Step 4: Input the mid-layer semantic feature P4 and the image-level turbidity estimate T into the turbidity adaptive channel modulation module TA-Block set in the fish target detection network. After turbidity conditional modulation, the enhanced feature is output. ; Please see Figure 5 In one embodiment, the turbidity adaptive channel modulation module TA-Block includes a channel statistics unit, a turbidity feature splicing unit, a bottleneck multilayer perceptron, a turbidity gating unit, and a residual rescaling unit; let the input mid-layer semantic feature P4 be X∈R. (C×H×W) Where C is the number of channels, and H and W are the feature map height and width, respectively; the channel statistics unit is used to calculate the channel statistics vector. ; where the statistical vector of the c-th channel ; The c-th channel of the mesoscale fusion feature P4 represents the feature value at the spatial location of the i-th row and j-th column. The turbidity feature splicing unit is used to combine the channel statistical vectors Concatenated with the image-level turbidity estimate T, it forms a joint turbidity-sensing representation. ; The bottleneck multilayer perceptron is used to generate channel weights. Where σ(·) is the Sigmoid activation function and δ(·) is the SiLU activation function; The dimension reduction matrix compresses the C+1 dimensional input into a C / r dimensional bottleneck space, where r is the channel compression ratio; W up To increase the dimension of the matrix, the bottleneck space is restored to a C-dimensional channel space; W∈R C This is the final channel weight vector; The turbidity gating unit is used to determine the image-level turbidity estimate T and the low turbidity gating threshold. and high turbidity gating threshold Calculate normalized gated variables and smoothing gate coefficient Where Clamp(·) is the cutoff function; when T is lower than hour, Approaching 0, the TA-Block maintains an approximate identity mapping; when T is higher than 0... hour, When the value approaches 1, the TA-Block enters a fully modulated state; The residual rescaling unit is used to adjust the smoothing gate coefficient. Constrained learnable scaling gain Maximum channel modulation amplitude Given the channel weights W, calculate the residual offset for each channel. , According to the residual offset Calculate channel scaling factor The input feature X is then rescaled channel-by-channel using the channel scaling factor to obtain the enhanced mesoscale feature. ;in, For learnable scaling parameters, It is the hyperbolic tangent function. The maximum channel modulation amplitude is represented by ⊙, which indicates element-wise Hadamard multiplication and automatic broadcasting in the spatial dimension. The channel weights are mapped from (0,1) to (-1,1) using 2W-1 to achieve bidirectional enhancement or suppression of different channels.
[0026] Step 5: Modulate the enhanced features Input the feature fusion network and detection head set in the fish target detection network, and output the fish target bounding box, category confidence and detection result.
[0027] Please see Figure 3 In one embodiment, the feature fusion network includes a first Upsample layer, a first Concat layer, a fifth C3k2 layer, a second Upsample layer, a second Concat layer, a sixth C3k2 layer, a sixth Conv layer, a third Concat layer, a seventh C3k2 layer, a seventh Conv layer, a fourth Concat layer, and an eighth C3k2 layer; wherein the sixth Conv layer and the seventh Conv layer are each composed of a two-dimensional convolutional layer, a two-dimensional batch normalization layer, and a SiLU activation layer connected in sequence, used to realize convolutional transformation and nonlinear mapping of input features; the fifth C3k2 layer, the sixth C3k2 layer, the seventh C3k2 layer, and the eighth C3k2 layer are all used to perform branch transformation, feature extraction, channel concatenation, and convolutional fusion on the input features to achieve multi-level feature aggregation and enhance feature expression capabilities; The deep semantic feature P5 is upsampled to 1 / 16 of the input image size by the first Upsample layer, and then concatenated with the mid-level semantic feature P4 output by the backbone feature extraction network along the channel direction by the first Concat layer, and then fused by the fifth C3k2 layer. The fused feature and the image-level turbidity estimate T are input into the turbidity adaptive channel modulation module TA-Block to obtain the enhanced mesoscale feature. ; The enhanced mesoscale features After upsampling to 1 / 8 of the input image size by the second Upsample layer, and concatenating with the shallow spatial detail features P3 output by the backbone feature extraction network along the channel direction by the second Concat layer, and then performing feature fusion by the sixth C3k2 layer, a first detection feature X1 with a spatial size of 1 / 8 of the input image size is obtained. The first detection feature X1 is used for small target detection. The first detection feature X1 is downsampled to 1 / 16 of the input image size by the sixth Conv layer, and then compared with the enhanced mesoscale feature. The third Concat layer is used to stitch the images along the channel direction, and then the seventh C3k2 layer is used for feature fusion to obtain a second detection feature X2 with a spatial size of 1 / 16 of the input image size. The second detection feature X2 is used for medium target detection. The second detection feature X2 is downsampled to 1 / 32 of the input image size by the seventh Conv layer, and then concatenated with the deep semantic feature P5 output by the backbone feature extraction network through the fourth Concat layer along the channel direction. Finally, it is fused through the eighth C3k2 layer to obtain the third detection feature X3 with a spatial size of 1 / 32 of the input image size. The third detection feature X3 is used for large target detection.
[0028] Please see Figure 3 In one embodiment, the detection head includes a first detection layer, a second detection layer, and a third detection layer; the three scale detection features X1, X2, and X3 output by the feature fusion network are respectively input to the first detection layer, the second detection layer, and the third detection layer, and are used for small-scale, medium-scale, and large-scale fish target detection, respectively; wherein, the first detection layer receives 1 / 8 scale features, the second detection layer receives 1 / 16 scale features, and the third detection layer receives 1 / 32 scale features, and outputs target category, bounding box position, and confidence information.
[0029] In one implementation, the multi-scale detection module performs bounding box regression and class prediction on the first detection feature X1, the second detection feature X2, and the third detection feature X3, respectively. Based on the bounding box regression results, the reference points and stride corresponding to different detection scales are decoded to obtain the position coordinates of the fish target boxes. The class prediction score is converted into class confidence through a sigmoid activation function, and the predicted class of the candidate fish target boxes is determined based on the class confidence. The fish target boxes and class confidence of the three detection scales are summarized, and low-confidence candidate boxes and overlapping redundant candidate boxes are removed by confidence thresholding and non-maximum suppression to obtain the final detection result containing the position of the fish target box, the predicted class, and the corresponding class confidence.
[0030] Please see Figure 6 In one embodiment, the target detection network is a trained network; the training set used during training includes 600 images of clear water, 400 images of moderately turbid water, and 200 images of heavily turbid water, while the validation set consists of 400 images at each of the three turbidity levels. The above quantities are only one embodiment, and those skilled in the art can adjust them according to the scale of aquaculture and the collection cycle.
[0031] The loss function used during training is: ; ; Among them, L det For baseline detection loss, B is the mean squared error loss; B is the batch size, T is the mean squared error loss. k Let T be the predicted turbidity value for the k-th image. pseudo,k λ is the turbidity pseudo-label for the k-th image; λ is the weight coefficient for the turbidity prediction task, used to balance the optimization of fish target detection and the optimization of turbidity perception.
[0032] During training, network performance is evaluated using precision (P), recall (R), mean precision (AP), and mean mean precision (mAP), which are calculated using the following formulas: ; ; ; ; TP is the true example. This is a false positive example. These are false negatives, where N is the number of target categories. This refers to the index obtained by calculating the average accuracy of each target category when the intersection-union ratio threshold between the predicted box and the ground truth box is set to 0.5, and then averaging the average accuracy of all target categories. This represents the average accuracy of each target category calculated at 10 cross-union thresholds ranging from 0.5 to 0.95 with a step size of 0.05, and then the average accuracy of all cross-union thresholds and all target categories is taken as the index. Precision rate is the ratio of the number of true positives to the sum of the number of true positives and false positives. Recall rate is the ratio of the number of true positives to the sum of the number of true negatives and false negatives. It represents the average precision of the i-th target category, which is the area under the precision-recall curve for that target category.
[0033] The invention will be further illustrated below through specific experiments.
[0034] (a) Experimental environment; Please see Figure 7 This experiment was conducted in an industrial aquaculture or recirculating aquaculture system environment. An underwater camera was fixed to the inner wall of the aquaculture tank or a monitoring bracket, at a depth of approximately 150 cm below the water surface, acquiring video streams with a resolution of 1920×1080 and a frame rate of 30 fps. A supplementary lighting source, a local computer, a Seymophilic disk, and an optical turbidimeter were used to construct the data acquisition and verification environment. Turbidity levels were determined: low turbidity was 0.3–0.5 NTU with a Seymophilic disk depth greater than 100 cm; medium turbidity was 0.5–1.0 NTU with a Seymophilic disk depth of 50–100 cm; and high turbidity was 1.0–1.5 NTU with a Seymophilic disk depth less than 50 cm.
[0035] During the collection process, the water temperature, dissolved oxygen, and water pressure are kept within the allowable range for aquaculture. Different turbidity states are created by adjusting the feeding amount, introducing suspended bottom sediment, and changing the water circulation rate.
[0036] The comparison scheme used in the experiment was: the existing YOLOv11 baseline model and the target detection network model of this application (hereinafter referred to as: AT-YOLOv11 model).
[0037] (II) Experimental Procedure; 1. Collect underwater fish videos and extract image frames, annotate the fish targets with bounding boxes, and form YOLO format training samples; 2. Classify images into low turbidity, moderate turbidity, and heavy turbidity based on Seyquist disk and image degradation statistics; 3. In the absence of frame-by-frame synchronized sensor annotations, calculate continuous low visibility pseudo-labels based on Sobel gradient variance, edge strength, brightness, and average brightness; 4. Train the YOLOv11 baseline model and the AT-YOLOv11 model separately. The AT-YOLOv11 model optimizes the detection loss during training. And turbidity prediction loss ; 5. During the inference stage, a single frame of underwater image is input, and the turbidity prediction head automatically outputs the turbidity estimate T. The TA-Block then performs adaptive channel recalibration on the P4 feature branch based on T. 6. The detection performance under different turbidity conditions was evaluated using precision (P), recall (R), AP, mAP@0.5, and mAP@0.5:0.95, with a focus on comparing the improvement in missed detection under heavily turbid conditions.
[0038] (III) Experimental Results; The results of the detection performance comparison in water bodies with different turbidity levels are shown in Table 1.
[0039] Table 1
[0040] In Table 1, the mAP@0.5, mAP@0.5:0.95, precision (P), and recall (R) of the YOLOv11 baseline model under low turbidity conditions were 93.9%, 70.1%, 87.7%, and 87.9%, respectively; while under moderate turbidity conditions, they were 85.9%, 57.2%, 82.0%, and 78.0%, respectively.
[0041] Please see Figure 8 The image shows a comparison of six sets of detection results in heavily turbid water, comprising 12 sub-images numbered (a) to (l) from top to bottom and left to right. (a), (c), (e), (g), (i), and (k) represent the AT-YOLOv11 detection results in six heavily turbid scenarios, while (b), (d), (f), (h), (j), and (l) represent the detection results of the YOLOv11 baseline model in the corresponding scenarios. Each pair of adjacent sub-images constitutes a model comparison for the same scenario. The blue rectangles and their confidence levels represent fish targets detected by the model, and the red dashed ellipses in the baseline results mark missed or incompletely detected fish areas. The comparison shows that AT-YOLOv11 can detect more effective targets in heavily turbid scenarios with blurred fish boundaries, low contrast, and multiple fish occlusion.
[0042] Please see Figure 9 The image shows a comparison of four sets of detection results in moderately turbid water, comprising eight sub-images numbered (a) to (h) from top to bottom and left to right. (a), (c), (e), and (g) represent the detection results of AT-YOLOv11 in four moderately turbid water scenarios, while (b), (d), (f), and (h) represent the detection results of the YOLOv11 baseline model in the corresponding scenarios. (a) and (b), (c) and (d), (e) and (f), and (g) and (h) constitute comparisons within the same scenario. Blue rectangles and their confidence levels represent detected fish targets, while red dashed ellipses mark the missed areas of the baseline model. The comparison shows that AT-YOLOv11 can maintain relatively complete target detection even under conditions of local scattering, uneven brightness, and mutual occlusion by fish.
[0043] Please see Figure 10The image shows a comparison of four sets of detection results in low-turbidity water, comprising eight sub-images numbered (a) to (h) from top to bottom and left to right. (a), (c), (e), and (g) represent the detection results of AT-YOLOv11 in four low-turbidity scenarios, while (b), (d), (f), and (h) represent the detection results of the YOLOv11 baseline model in the corresponding scenarios. (a) and (b), (c) and (d), (e) and (f), and (g) and (h) constitute comparisons within the same scenario. Blue rectangles and their confidence levels represent detected fish targets, while red dashed ellipses mark the missed detection areas of the baseline model. The comparison shows that TA-Block maintains approximately an identity mapping in low-turbidity images, and AT-YOLOv11 generally maintains a detection capability similar to the baseline model, while reducing missed detections for partially occluded targets.
[0044] Experiments show that the present invention exhibits stable detection performance under low, moderate, and severe turbidity conditions. Under low turbidity conditions, the mAP@0.5 of AT-YOLOv11 is 93.2%, close to the YOLOv11 baseline of 93.9%, indicating that turbidity gating maintains the TA-Block approximate identity mapping and does not significantly perturb the features of clear images. Under moderate turbidity conditions, the mAP@0.5, mAP@0.5:0.95, and precision P of AT-YOLOv11 are 86.0%, 57.6%, and 82.6%, respectively, representing improvements of 0.0% and 0.9% compared to the baseline. The recall rate R changed slightly from 78.0% to 77.7%, with increases of 0.1, 0.4, and 0.6 percentage points respectively. Under severe turbidity conditions, the mAP@0.5, mAP@0.5:0.95, precision P, and recall rate R of AT-YOLOv11 improved by 7.3, 4.1, 2.1, and 5.4 percentage points respectively compared to the baseline. This indicates that turbidity sensing modulation has the most significant effect on improving missed detections under low contrast, boundary diffusion, and occlusion conditions, and is suitable for long-term online monitoring in industrial aquaculture.
[0045] It should be understood that the embodiments described above are only some, not all, of the embodiments of the present invention. Furthermore, the technical features of the various embodiments or individual embodiments provided by the present invention can be arbitrarily combined to form feasible technical solutions. Such combinations are not constrained by the order of steps and / or structural composition patterns, but must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0046] It should be understood that the above description of the preferred embodiments is quite detailed, but it should not be considered as a limitation on the scope of protection of this invention. Those skilled in the art, under the guidance of this invention, can make substitutions or modifications without departing from the scope of protection of the claims of this invention, and all such substitutions or modifications fall within the scope of protection of this invention. The scope of protection of this invention should be determined by the appended claims.
Claims
1. An adaptive fish target detection method for low-visibility water bodies, characterized in that, Includes the following steps: Step 1: Acquire underwater fish image data and generate image-level low-visibility pseudo-labels; Step 2: Input the underwater fish image into the fish target detection network, and extract multi-scale fish body features through the backbone feature extraction network, including shallow spatial detail features P3, mid-level semantic features P4 and deep semantic features P5; Step 3: Using the turbidity prediction head set in the fish target detection network, predict the image-level turbidity estimate T of the current image based on the deep semantic feature P5; Step 4: Input the mid-layer semantic feature P4 and the image-level turbidity estimate T into the turbidity adaptive channel modulation module TA-Block set in the fish target detection network. After turbidity conditional modulation, the enhanced feature is output. ; Step 5: Modulate the enhanced features Input the feature fusion network and detection head set in the fish target detection network, and output the fish target bounding box, category confidence and detection result.
2. The adaptive fish target detection method for low-visibility water bodies according to claim 1, characterized in that: In step 1, image-level low visibility pseudo-labels are generated based on the image gradient magnitude variance and the image average brightness. ;in, It is the sum of the variance in the horizontal direction and the variance in the vertical direction; The average brightness of the grayscale image; It is a stability constant used to avoid the denominator being zero; This is the empirical normalization coefficient; assuming the average image brightness remains constant.
3. The adaptive fish target detection method for low-visibility water bodies according to claim 1, characterized in that: In step 2, the backbone feature extraction network includes a first Conv layer, a second Conv layer, a first C3k2 layer, a third Conv layer, a second C3k2 layer, a fourth Conv layer, a third C3k2 layer, a fifth Conv layer, a fourth C3k2 layer, an SPPF layer, and a C2PSA module, all connected in sequence. The first, second, third, fourth, and fifth Conv layers each consist of a two-dimensional convolutional layer, a two-dimensional batch normalization layer, and a SiLU activation layer, connected in sequence, used to perform convolutional transformation and nonlinear mapping of the input features. The first, second, third, and fourth C3k2 layers are used for branch transformation and feature extraction of the input features. Channel concatenation and convolutional fusion are used to achieve multi-level feature aggregation and enhance feature representation capabilities. The SPPF layer is used to aggregate contextual information from different receptive fields through continuous multi-level max pooling and feature concatenation, thereby expanding the network's effective receptive field and enhancing multi-scale feature representation capabilities. The C2PSA module is used to enhance the network's ability to represent key regions and important semantic information of fish targets through channel partitioning, attention modeling, feature concatenation, and convolutional fusion. The second C3k2 layer, the third C3k2 layer, and the C2PSA module output shallow spatial detail features P3 with a spatial size of 1 / 8 of the input image size, mid-level semantic features P4 with a spatial size of 1 / 16 of the input image size, and deep semantic features P5 with a spatial size of 1 / 32 of the input image size, respectively.
4. The adaptive fish target detection method for low-visibility water bodies according to claim 1, characterized in that: In step 3, the turbidity prediction head includes a global average pooling layer, a multilayer perceptron, and a sigmoid output layer; let the input deep semantic features be P5, where F∈R. (C×H×W) Where C is the number of channels, and H and W are the feature map height and width, respectively; the global average pooling layer is used to calculate the global description vector z of each channel; where the global description vector of the c-th channel is... ; This represents the feature value of the c-th channel in deep semantic feature P5 at the spatial position of the i-th row and j-th column. The multilayer perceptron outputs an image-level turbidity estimate T based on the channel global description vector z. ; Where σ(·) is the Sigmoid activation function, f MLP (·) is the multilayer perceptron mapping function, T∈(0,1), and the larger T is, the higher the degree of low visibility of the current image.
5. The adaptive fish target detection method for low-visibility water bodies according to claim 1, characterized in that: In step 4, the turbidity adaptive channel modulation module TA-Block includes a channel statistics unit, a turbidity feature splicing unit, a bottleneck multilayer perceptron, a turbidity gating unit, and a residual rescaling unit; let the input mid-layer semantic feature P4 be X∈R. (C ×H×W) Where C is the number of channels, and H and W are the feature map height and width, respectively; the channel statistics unit is used to calculate the channel statistics vector. ; where the statistical vector of the c-th channel ; The c-th channel of the mesoscale fusion feature P4 represents the feature value at the spatial location of the i-th row and j-th column. The turbidity feature splicing unit is used to combine the channel statistical vectors Concatenated with the image-level turbidity estimate T, it forms a joint turbidity-sensing representation. ; The bottleneck multilayer perceptron is used to generate channel weights. Where σ(·) is the Sigmoid activation function and δ(·) is the SiLU activation function; The dimension reduction matrix compresses the C+1 dimensional input into a C / r dimensional bottleneck space, where r is the channel compression ratio; W up To increase the dimension of the matrix, the bottleneck space is restored to a C-dimensional channel space; W∈R C This is the final channel weight vector; The turbidity gating unit is used to determine the image-level turbidity estimate T and the low turbidity gating threshold. and high turbidity gating threshold Calculate normalized gated variables and smoothing gate coefficient Where Clamp(·) is the cutoff function; when T is lower than hour, Approaching 0, the TA-Block maintains an approximate identity mapping; when T is higher than 0... hour, When the value approaches 1, the TA-Block enters a fully modulated state; The residual rescaling unit is used to adjust the smoothing gate coefficient. Constrained learnable scaling gain Maximum channel modulation amplitude Given the channel weights W, calculate the residual offset for each channel. , According to the residual offset Calculate channel scaling factor The input feature X is then rescaled channel-by-channel using the channel scaling factor to obtain the enhanced mesoscale feature. ;in, For learnable scaling parameters, It is the hyperbolic tangent function. The maximum channel modulation amplitude is represented by ⊙, which indicates element-wise Hadamard multiplication and automatic broadcasting in the spatial dimension. The channel weights are mapped from (0,1) to (-1,1) using 2W-1 to achieve bidirectional enhancement or suppression of different channels.
6. The adaptive fish target detection method for low-visibility water bodies according to claim 1, characterized in that: In step 5, the feature fusion network includes a first Upsample layer, a first Concat layer, a fifth C3k2 layer, a second Upsample layer, a second Concat layer, a sixth C3k2 layer, a sixth Conv layer, a third Concat layer, a seventh C3k2 layer, a seventh Conv layer, a fourth Concat layer, and an eighth C3k2 layer. The sixth and seventh Conv layers each consist of a sequentially connected two-dimensional convolutional layer, a two-dimensional batch normalization layer, and a SiLU activation layer, used to perform convolutional transformations and nonlinear mappings of the input features. The fifth, sixth, seventh, and eighth C3k2 layers are used to perform branch transformations, feature extraction, channel concatenation, and convolutional fusion on the input features to achieve multi-level feature aggregation and enhance feature representation capabilities. The deep semantic feature P5 is upsampled to 1 / 16 of the input image size by the first Upsample layer, and then concatenated with the mid-level semantic feature P4 output by the backbone feature extraction network along the channel direction by the first Concat layer, and then fused by the fifth C3k2 layer. The fused feature and the image-level turbidity estimate T are input into the turbidity adaptive channel modulation module TA-Block to obtain the enhanced mesoscale feature. ; The enhanced mesoscale features After upsampling to 1 / 8 of the input image size by the second Upsample layer, and concatenating with the shallow spatial detail features P3 output by the backbone feature extraction network along the channel direction by the second Concat layer, and then performing feature fusion by the sixth C3k2 layer, a first detection feature X1 with a spatial size of 1 / 8 of the input image size is obtained. The first detection feature X1 is used for small target detection. The first detection feature X1 is downsampled to 1 / 16 of the input image size by the sixth Conv layer, and then compared with the enhanced mesoscale feature. The third Concat layer is used to stitch the images along the channel direction, and then the seventh C3k2 layer is used for feature fusion to obtain a second detection feature X2 with a spatial size of 1 / 16 of the input image size. The second detection feature X2 is used for medium target detection. The second detection feature X2 is downsampled to 1 / 32 of the input image size by the seventh Conv layer, and then concatenated with the deep semantic feature P5 output by the backbone feature extraction network through the fourth Concat layer along the channel direction. Finally, it is fused through the eighth C3k2 layer to obtain the third detection feature X3 with a spatial size of 1 / 32 of the input image size. The third detection feature X3 is used for large target detection.
7. The adaptive fish target detection method for low-visibility water bodies according to claim 1, characterized in that: In step 5, the detection head includes a first detection layer, a second detection layer, and a third detection layer. The three scale detection features X1, X2, and X3 output by the feature fusion network are input into the first detection layer, the second detection layer, and the third detection layer, respectively, for small-scale, medium-scale, and large-scale fish target detection. The first detection layer receives 1 / 8 scale features, the second detection layer receives 1 / 16 scale features, and the third detection layer receives 1 / 32 scale features, and outputs target category, bounding box position, and confidence information.
8. The adaptive fish target detection method for low-visibility water bodies according to claim 1, characterized in that: In step 5, the multi-scale detection module performs bounding box regression and class prediction on the first detection feature X1, the second detection feature X2, and the third detection feature X3, respectively. Based on the bounding box regression results, the reference points and stride corresponding to different detection scales are decoded to obtain the position coordinates of the fish target boxes. The class prediction score is converted into class confidence through the Sigmoid activation function, and the predicted class of the candidate fish target boxes is determined based on the class confidence. The fish target boxes and class confidence of the three detection scales are summarized, and low-confidence candidate boxes and overlapping redundant candidate boxes are removed by confidence thresholding and non-maximum suppression to obtain the final detection result containing the position of the fish target box, the predicted class, and the corresponding class confidence.
9. The adaptive fish target detection method for low-visibility water bodies according to any one of claims 1-8, characterized in that: The target detection network is a pre-trained network; the loss function L used during training is: ; ; Among them, L det For baseline detection loss, B is the mean squared error loss; B is the batch size, T is the mean squared error loss. k Let T be the predicted turbidity value for the k-th image. pseudo,k λ is the turbidity pseudo-label for the k-th image; λ is the weight coefficient for the turbidity prediction task, used to balance the optimization of fish target detection and the optimization of turbidity perception.
10. An adaptive fish target detection system for low-visibility water bodies, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the adaptive fish target detection method for low-visibility water bodies as described in any one of claims 1 to 9.