A method and system for detecting dense semi-transparent shrimp fry and a storage medium

By using transparency-aware feature fusion and an adaptive loss function, the problem of missed detection in dense semi-transparent shrimp larvae detection was solved, achieving high-precision and robust shrimp larvae detection.

CN121095984BActive Publication Date: 2026-02-24YANGTZE DELTA REGION INST OF UNIV OF ELECTRONICS SCI & TECH OF CHINE (HUZHOU)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511630367.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-10
Publication Date
2026-02-24
Estimated Expiration
2045-11-10

AI Technical Summary

Technical Problem

Existing technologies suffer from missed detections when dealing with dense, semi-transparent shrimp larvae. This is mainly due to insufficient feature extraction and the model's inadequate adaptability to the ambiguity of semi-transparent target boundaries, resulting in low positioning accuracy and duplicate detections.

Method used

By using transparency-aware feature fusion and an adaptive loss function, and by adjusting the weights of the feature maps and the penalty intensity of the loss using transparency compensation coefficients and dynamic compensation factors, accurate detection of semi-transparent targets can be achieved.

Benefits of technology

It effectively solves the problem of missed detection of semi-transparent shrimp larvae, improves detection accuracy and robustness, and adapts to complex background interference in high-density scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121095984B_ABST
    Figure CN121095984B_ABST
Patent Text Reader

Abstract

The present application provides a kind of dense translucent fry detection method, system and storage medium, it is related to computer vision technical field, the present application is by the transparency of target quantification, and as the basis, in feature fusion stage to weak signal is compensated and enhanced, while in model training stage to loss function is self-adaptive adjustment, to systematically solve the bottleneck problem such as missing detection, recheck and inaccurate positioning that existing technology faces when processing dense, small, translucent target.The detection recall rate of low contrast, translucent target is improved, the missing detection is effectively reduced;The detection accuracy and robustness in high-density, overlapping scene are improved, and the repeated detection is reduced;The positioning accuracy of model to edge fuzzy target is enhanced;By introducing physical priori knowledge, the overall generalization ability of model and applicability in complex underwater environment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, specifically to a method, system, and storage medium for detecting dense, semi-transparent shrimp larvae. Background Technology

[0002] In applications such as smart aquaculture, there is a need for accurate and automated population counting of dense, tiny organisms with semi-transparent physical properties (such as shrimp larvae). Existing technologies, such as object detection methods based on the standard YOLOv8 framework, face significant challenges in handling these special targets. At the feature extraction level, traditional YOLOv8 algorithms suffer from severe missed detections of small targets (shrimp larvae in this study) due to the loss of low-level feature details. Specifically, although the original YOLOv8 detection head utilizes the P3 layer feature map for small target detection, its feature resolution is still insufficient for the even smaller shrimp larvae. Furthermore, the semi-transparent nature of shrimp larvae makes their high-resolution features highly susceptible to interference from water background noise during shallow extraction. These factors collectively cause standard feature pyramid networks (such as PANet) to easily lose crucial shallow high-resolution spatial details for identifying tiny targets during deep convolution, resulting in serious missed detections.

[0003] Despite significant progress in existing target detection technologies, a series of technical challenges remain when dealing with small, dense targets with special physical properties. There is still room for improvement in the practicality and accuracy of existing technical solutions.

[0004] The problem of feature attenuation and information overload caused by physical properties. Current mainstream object detection frameworks, such as the general model represented by YOLOv8, are designed primarily for conventional opaque objects in their feature extraction networks. When applied to detect semi-transparent targets (such as shrimp larvae in water), the optical properties of these targets result in low contrast and blurred edges in the image, making their effective visual feature signals inherently very weak. During the feature pyramid network's layer-by-layer feature abstraction process, these already weak shallow high-resolution details are easily suppressed as background noise or overwhelmed when fused with deep, strong semantic features, ultimately causing the model to "blind" these targets and resulting in serious missed detections.

[0005] The model optimization process suffers from insufficient adaptability to the ambiguity of target boundaries. The training process of existing detection models is typically guided by a loss function that optimizes model parameters by measuring the geometric difference between predicted bounding boxes and manually labeled ground truth boxes. However, for semi-transparent targets, the blurred visual boundaries make accurate manual labeling inherently difficult and subject to systematic bias. Traditional loss functions, such as CIoU, lack the ability to perceive this "labeling uncertainty" in their optimization mechanism; they equally and strictly penalize all geometric deviations between predicted and ground truth boxes. This rigid optimization strategy not only easily leads to convergence instability and duplicate detection boxes in high-density scenes due to gradient problems, but also forces the model to overfit the inherently inaccurate boundary labels, thus limiting the final localization accuracy.

[0006] Existing alternatives have limitations in handling high-density scenes. To address these challenges, the industry has explored other technical approaches. For example, Chinese patent application CN117115080A discloses a region segmentation-based counting method. This method avoids the difficulty of direct end-to-end detection in high-density scenes by first segmenting the image and then counting and stitching the sub-regions. However, in extremely dense scenes where there is significant overlap and occlusion between target individuals, the accuracy of such "segmentation-counting" methods is difficult to guarantee, and the process of stitching and deduplication is computationally complex and lacks robustness, making it difficult to meet the demands of high-efficiency applications. Therefore, how to solve these problems within a unified and efficient end-to-end detection framework remains a critical technical bottleneck that urgently needs to be overcome in this field.

[0007] The information disclosed in the background section above is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0008] The purpose of this invention is to provide a method for detecting dense, semi-transparent shrimp larvae, in order to solve the problems mentioned in the background art.

[0009] To achieve the above objectives, the present invention provides the following technical solution:

[0010] A method for detecting densely packed, semi-transparent shrimp larvae, comprising the following steps:

[0011] S1: Acquire a digital image containing the target to be detected;

[0012] S2: Using a pre-set backbone network, extract multi-scale feature maps from the digital image;

[0013] S3: Perform a transparency-aware feature fusion process, which performs weighted bidirectional fusion of the multi-scale feature maps. When fusing at least one shallow feature map with high spatial resolution, a transparency compensation coefficient is calculated according to a preset transparency quantization model. The transparency compensation coefficient is then used to adjust the weight of the shallow feature map in the fusion process to generate a fused feature map.

[0014] S4: Based on the fused feature map, generate a predicted bounding box for the target to be detected;

[0015] S5: The model training of this method is guided by a preset adaptive loss function, wherein the adaptive loss function includes a dynamic compensation factor calculated based on the transmittance of the target boundary region, which is used to adaptively adjust the loss penalty of the prediction box to obtain the final prediction box set; and the final prediction box set is output as the detection result, wherein the detection result includes the position coordinates and confidence score of each shrimp seedling target, and the total number of shrimp seedlings is determined based on the number of the final prediction box set.

[0016] A dense semi-transparent shrimp larvae detection system, the system comprising:

[0017] The image acquisition module is configured to acquire a digital image containing the target to be detected;

[0018] The feature extraction module is configured to extract multi-scale feature maps from the digital image using a pre-set backbone network;

[0019] The transparency-aware feature fusion module is configured to perform weighted bidirectional fusion of the multi-scale feature maps, and when fusing at least one shallow feature map with high spatial resolution, calculate the transparency compensation coefficient according to a preset transparency quantization model, and use the transparency compensation coefficient to adjust the weight of the shallow feature map in the fusion process to generate a fused feature map.

[0020] The prediction box generation module is configured to generate a prediction box for the target to be detected based on the fused feature map.

[0021] The model training module is configured to use a preset adaptive loss function to guide the training of the model. The adaptive loss function includes a dynamic compensation factor calculated based on the transmittance of the target boundary region, which is used to adaptively adjust the loss penalty of the prediction box to obtain the final prediction box set. The final prediction box set is output as the detection result, which includes the position coordinates and confidence score of each shrimp seedling target. The total number of shrimp seedlings is determined based on the number of the final prediction box set.

[0022] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method for detecting dense, semi-transparent shrimp larvae.

[0023] Compared with existing technologies, the beneficial effects of this invention are as follows: The core innovation of this invention lies in transforming the physical property of the target's "semi-transparency" from a negative factor that interferes with detection into an information source that can be quantified and used to actively guide the model for adaptive adjustment. Specifically, through color space analysis, the visual transparency is precisely quantified into a calculable local transmittance field. This quantified information is then used as a core guiding signal, injected in parallel into two key stages of the deep learning model, forming a synergistic gain effect.

[0024] Using the calculated transmittance information, a transparency compensation coefficient is dynamically generated within the feature fusion network. This coefficient is used to non-linearly and selectively enhance the weights of shallow detail features in the region representing the semi-transparent target, which is characterized by high transmittance areas. This enables the network to proactively compensate for signal attenuation caused by transparency at the feature level, fundamentally addressing and resolving the aforementioned missed detection problem.

[0025] By utilizing the same transmittance information, a dynamic compensation factor is introduced at the loss function level during model training. This factor dynamically adjusts the penalty for localization errors in the loss function by evaluating the average transmittance of the target boundary region. For targets with high average transmittance due to blurred boundaries, the loss function is more tolerant; conversely, it imposes stricter constraints. This allows the model to "understand" and adapt to the uncertainty of annotations during training, avoiding overfitting to blurred boundaries and thus specifically addressing the problems of low localization accuracy and repeated detections. Attached Figure Description

[0026] Figure 1 This is a schematic diagram of the overall method flow of the present invention;

[0027] Figure 2 This is a diagram of the BiFPN network architecture of the present invention;

[0028] Figure 3 This is an example diagram comparing the test results of shrimp larvae according to the present invention;

[0029] Figure 4 This diagram illustrates the DFL loss and Box loss generated during the training and validation processes of DPD-YOLO and YOLOV8 in this invention. Detailed Implementation

[0030] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0031] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0032] Example 1:

[0033] Please see Figures 1 to 4 The present invention provides a technical solution:

[0034] A method for detecting densely packed, semi-transparent shrimp larvae includes the following steps:

[0035] S1: Acquire a digital image containing the target to be detected;

[0036] S2: Using a pre-set backbone network, extract multi-scale feature maps from the digital image;

[0037] S3: Perform a transparency-aware feature fusion process, which performs weighted bidirectional fusion of the multi-scale feature maps. When fusing at least one shallow feature map with high spatial resolution, a transparency compensation coefficient is calculated according to a preset transparency quantization model. The transparency compensation coefficient is then used to adjust the weight of the shallow feature map in the fusion process to generate a fused feature map.

[0038] S4: Based on the fused feature map, generate a predicted bounding box for the target to be detected;

[0039] S5: The model training of this method is guided by a preset adaptive loss function, wherein the adaptive loss function includes a dynamic compensation factor calculated based on the transmittance of the target boundary region, which is used to adaptively adjust the loss penalty force on the prediction box to obtain the final prediction box set; and the final prediction box set is output as the detection result, wherein the detection result includes the position coordinates and confidence score of each shrimp seedling target, and the total number of shrimp seedlings is determined based on the number of the final prediction box set.

[0040] Further explanation: The feature fusion process in step S3 is configured to be performed in a weighted bidirectional feature pyramid network (hereinafter referred to as BiFPN) structure, and the shallow feature map is configured as a P2 layer feature map;

[0041] The BiFPN computation process includes two paths: top-down and bottom-up. This embodiment takes the computation of layers P3 and P4 as an example, and shows the intermediate feature map of its top-down path. , and the output feature map of the bottom-up path. , The calculation is performed using the following formula:

[0042]

[0043]

[0044]

[0045]

[0046] in, This is the input feature map of the nth layer of the backbone network. This is the intermediate feature map of the top-down path in the nth layer of the backbone network. This is the output feature map of the bottom-up path in the nth layer of the backbone network. The constants characterizing numerical stability are used to ensure numerical stability. Conv is the convolution operation, and Resize is the size adjustment operation.

[0047] w represents the learnable weights, specifically: and The superscripts are used to distinguish the output feature maps. and The definition of the learnable weights during calculation is similar to that of the other learnable weights, and will not be repeated here.

[0048] It should be noted that the learnable weights need to be obtained by performing the following model training process: The experimental platform is built on a server configured with an NVIDIA-RTX-4090-GPU (24GB VRAM), the software environment is Ubuntu-20.04 operating system, and the PyTorch-1.12 deep learning framework and CUDA-11.3 are used.

[0049] The training dataset was derived from 72 hours of continuous video capture from multiple aquaculture ponds, from which 10,000 original images with a resolution of 1920×1080 were extracted. All images were annotated by professionals using the LabelImg tool, with precise bounding boxes labeled for each shrimp larvae. To enhance the model's generalization ability, data augmentation strategies, including random cropping, horizontal flipping, and brightness adjustment, were applied to the dataset before training.

[0050] The model training process is as follows: AdamW is used as the optimizer, with an initial learning rate of 0.001, and a cosine annealing strategy is used for dynamic decay of the learning rate. The batch size is set to 16. The model is trained for a total of 300 epochs. Training is considered complete when the model's loss on the validation set no longer decreases significantly for 10 consecutive epochs. Through this process, all learnable weights in the network structure described in this embodiment are fully trained and converged, ultimately forming a detection model capable of achieving the technical effects described in this embodiment. The introduction of the P2 layer in this embodiment fundamentally ensures that the original feature information of small targets can enter the subsequent processing flow; while the BiFPN structure ensures that this detailed information can be used efficiently and without loss in multi-scale fusion, rather than being diluted or lost in the unidirectional information flow of traditional PAN-FPN. The combination of the two directly solves the pain point of missed detection caused by feature loss in existing technologies.

[0051] Following step S3, a step is also included that is configured to perform a coordinate attention mechanism processing with transparency awareness. Details are as follows:

[0052] This embodiment introduces an improved coordinate attention (CA) mechanism;

[0053] Transmittance-sensitive pooling: One-dimensional global pooling is performed on the input feature map X along the horizontal and vertical directions respectively to generate directional feature maps. and This process introduces a mask generated based on brightness variance. This achieves sensitivity to light transmittance;

[0054] The "mask M(h,w) generated based on brightness variance" is specifically implemented through the following calculation logic: The goal of this calculation logic is to generate a weight value for each spatial location of the input feature map. This value reflects the degree of brightness change in the local area at that location. Areas with drastic brightness changes are given higher weights. In this embodiment, this area is represented as the target edge or texture.

[0055] Specifically, an input is defined, namely, the luminance channel map in the HSV space obtained from the original digital image, and an original luminance channel matrix is ​​formed. At the same time, a sliding window is initialized, the size of which is preferably 3×3 pixels in this embodiment.

[0056] The core calculation steps involve extracting the luminance values ​​of all pixels within a 3×3 neighborhood centered on each pixel (h, w) in the luminance channel map. Then, the statistical variance of all luminance values ​​within this neighborhood is calculated. This calculation logic is described as follows: First, calculate the average luminance values ​​of all pixels within the neighborhood; second, calculate the square of the difference between each pixel's luminance value and its average; third, sum all squared differences and divide by the total number of pixels in the neighborhood to obtain the luminance variance value corresponding to the central pixel (h, w).

[0057] The variance values ​​calculated for all pixels in the entire image are normalized and linearly mapped to the interval [0,1]. The normalized variance map is the final mask M(h,w). This mask is then used in the transmittance-sensitive pooling step of the coordinate attention mechanism, where it is multiplied element-wise with the corresponding features to achieve feature weighting.

[0058] After concatenating the feature maps from the two directions, feature mapping is performed using a shared 1×1 convolution and a non-linear activation function to obtain the feature tensor Z. Subsequently, attention maps in the horizontal and vertical directions are generated through different convolutions. and During the generation process, divide by The item incorporates light transmittance information. and The characteristics are as follows:

[0059]

[0060]

[0061] Mapping attention in the horizontal and vertical directions and Multiplying the original input feature map X by the original input feature map yields the final output feature map Y for each channel c: where T represents the local transmittance;

[0062]

[0063] in Use the sigmoid activation function; this generates attention maps in both the horizontal and vertical directions. and In order to incorporate transmittance information, the following calculation logic is executed:

[0064] For the feature tensor Z after 1×1 convolution and nonlinear activation, two independent 1×1 convolutions are used to generate two one-dimensional vectors corresponding to the height H and width W of the original feature map, denoted as . and .

[0065] Attention mapping in the horizontal direction The average luminance value of each row of pixels in the original luminance channel matrix is ​​calculated, thus obtaining a one-dimensional row average transmittance vector of length H. Similarly, for attention mapping in the vertical direction... Calculate the average luminance value of each column of pixels in the original luminance channel matrix to obtain a one-dimensional column average transmittance vector of length W. . Vector Each element in the matrix is ​​divided by (1 plus the row average transmittance vector). The element value at the corresponding position in the map is then input into the Sigmoid activation function to generate the final horizontal attention map. Attention mapping in the vertical direction Perform the same computational logic, using and This ensures dimensionality matching of all tensors in the computational logic, allowing transmittance information to be used unambiguously to adjust attention weights. It enables the model to focus on key spatial regions related to the semi-transparent target not only in the feature fusion stage but also in the feature refinement stage, suppressing background interference and thus providing a more accurate and robust feature foundation for subsequent bounding box regression.

[0066] Further explanation: The transparency quantization model is configured to determine local transmittance by converting local regions of an image from the RGB color space to the HSV color space and extracting the values ​​of its luminance channels;

[0067] The transparency compensation coefficient is configured to be calculated by summing a reference value with the local transmittance;

[0068] The dynamic compensation factor is configured to calculate the local transmittance at the midpoint of the four sides of the target truth box, and then use these local transmittances to determine the boundary average transmittance through a preset functional relationship.

[0069] Further explanation: The adaptive loss function is configured as a Focal-EIOU loss function, and the dynamic compensation factor is configured as the focusing parameter in the loss function.

[0070] The Focal-EIOU loss function also includes a balancing factor, which is configured to be calculated based on the maximum transmittance of the target to be detected, in order to further balance the learning weights.

[0071] This embodiment provides the following explanation of the Focal-EIOU loss function:

[0072] Calculate the maximum transmittance within the target truth box. And calculate the balance factor according to the following formula. :

[0073] The calculated balance factor and dynamic compensation factor Together they are used in loss calculation;

[0074] For highly transparent targets, Balance factor Increasing it to 0.6 reduces the contribution of low-quality predicted boxes to the total loss; for targets with low transparency, its Balance factor Keep it at 0.5, using the standard weight.

[0075] In balance factor In the calculation formula, the base value of 0.5 and the coefficient of 0.1 are optimized empirical parameters derived from the analysis of a large amount of experimental data. Specifically, the base value of 0.5 is set from the design idea of ​​the standard loss function Focal-Loss, that is, in the absence of prior information, equal initial attention is given to positive and negative samples or easy and difficult samples. In this scheme, it corresponds to the target being completely opaque ( The baseline balance level at that time.

[0076] A coefficient of 0.1 defines the sensitivity of the balance factor to changes in target transparency. This value is determined as follows: a base value of 0.5 is fixed, and a grid search experiment is conducted on this coefficient across a series of candidate values ​​(0.05, 0.1, 0.15, 0.2). The evaluation metric is the overall performance of the model on a validation set containing targets with different transparency levels. In this embodiment, when the coefficient is less than 0.1, the moderating effect on high transparency targets is not significant; when the coefficient is greater than 0.15, it may introduce excessive perturbation to the loss function, affecting convergence. Therefore, 0.1 is selected as the preferred value to achieve the best trade-off between moderating effect and training stability. In a preferred embodiment of this example, the formula for calculating the balance factor is determined as follows: The expression.

[0077] This limitation is achieved by introducing a balance factor. This allows the loss function to utilize dynamic compensation factors. While focusing on hard samples, the model can also fine-tune the penalty strategy for prediction boxes of different quality based on the overall transparency of the target. This dual adjustment mechanism makes the model training process more refined and stable, enabling it to learn more effectively from complex datasets containing a large number of semi-transparent targets, thereby further improving detection accuracy and the model's generalization ability.

[0078] The following are specific implementation instructions for the above content:

[0079] The core technical feature to be elaborated in this embodiment is a deep learning detection method that uses dual-path dynamic adaptive adjustment based on the optical transparency characterized by the physical properties of the target. The core innovation of this method lies in constructing a closed-loop linkage control system of "physical property quantification - feature space compensation - loss space adaptation".

[0080] Specifically, the "semi-transparent" physical property of the target is quantified into a computable, normalized local transmittance field. In the feature fusion stage, a transparency compensation coefficient is dynamically generated to non-linearly enhance the weight of shallow detail features in high-transmittance regions, fundamentally solving the problem of missed detections due to weak features. In the model training stage, the boundary average transmittance extracted from this field information is used to dynamically generate a dynamic compensation factor. This factor adaptively adjusts the penalty strength of the loss function for boundaries with different degrees of ambiguity, thereby solving the problems of low positioning accuracy and re-detection caused by annotation bias. By enabling the neural network model to learn and understand the intrinsic physical and optical properties of the target, the model not only significantly improves performance when processing semi-transparent targets, but also, in its overall specific implementation, the key technical parameters are described below:

[0081] The multi-scale feature map series parameters, including the backbone network input feature map, are denoted as follows: The intermediate feature map of the top-down path, with parameter symbols as follows: And the bottom-up path output feature map, whose parameter sign is Here, the index label n represents the level of the feature pyramid; in this embodiment, n = 2, 3, 4, 5. A smaller value indicates higher spatial resolution. These parameters are all three-dimensional tensors, representing the visual features of the image at different levels of abstraction. The acquisition method is as follows: The input image is directly output after being processed by convolutional downsampling by a preset backbone network (CSPDarknet is used in this embodiment); and These are intermediate and final results generated within the feature fusion network through a series of operations such as convolution, upsampling, resizing, and element-wise weighted summation on other feature maps.

[0082] The constant of the numerical stability constant, whose parameter sign is This constant is used to prevent extremely small positive values ​​with a denominator of zero in numerical calculations, and its physical meaning is to ensure the stability of the calculation. Its value is determined as follows: based on the computing hardware architecture used, a fixed value much smaller than the normal calculation value but greater than zero is selected; in this embodiment, 1e-8 is chosen. Its function is to prevent the denominator from approaching zero in weighted fusion calculations. In the specific embodiment of this example, this constant... The preferred value is 0.0001. This value is a common setting in deep learning model design, and its range is usually between [1e-6, 1e-3], in order to ensure the stability of the calculation without significantly affecting the calculation results.

[0083] Local transmittance, denoted by T, is a scalar value ranging from [0,1] and is used to quantify the transparency of a specific pixel or region in an image. A value of 0 indicates complete opacity, and a value of 1 indicates complete transparency. This parameter is determined based on color theory, where the transparency of an object is visually represented in an image as the degree to which its brightness approximates the brightness of the background. This embodiment uses the HSV color space model to quantify this physical property. The calculation logic for obtaining this parameter is as follows: a local region of the input image, which is a single pixel or a small pixel neighborhood, is converted from the standard RGB color space to the HSV color space. Then, the value of the brightness component in the converted result is extracted, i.e., the brightness value corresponding to the V channel. Since the value range of the V channel is within the [0,1] range, this value is directly used as the final value of the local transmittance T.

[0084] If the RGB value of a pixel in an image is (128, 128, 128), the RGB value of its corresponding water background is (100, 100, 100), and the RGB value of a semi-transparent shrimp larva's body region is (115, 115, 115), after color space conversion, the V value of the background region is 0.39, and the V value of the shrimp larva's body region is 0.45. Therefore, the local transmittance T of the shrimp larva's body region is determined to be 0.45.

[0085] Transparency compensation factor, its parameter symbol is , is a scalar greater than or equal to 1, used to dynamically adjust the weights of shallow feature maps during feature fusion. This parameter is designed based on the principle of compensatory enhancement: the higher the transparency of a target, the weaker its feature signal in the image, thus requiring greater weight compensation to ensure it is not overwhelmed. The calculation logic for this parameter is as follows: summing the baseline value of 1.0 with the local transmittance T calculated using the above method. That is, the transparency compensation coefficient. The value is equal to 1.0 plus the local transmittance T. This design ensures that when the target is completely opaque (T=0), the compensation coefficient is 1.0, producing no additional effect and achieving a smooth transition. Its output value range is limited to the interval [1,2].

[0086] In this embodiment, if the local transmittance T of the selected area is determined to be 0.45, then the transparency compensation coefficient corresponding to that area is... That is, 1.0 + 0.45 = 1.45.

[0087] The calculation and application of the "transparency compensation factor" are defined in detail below:

[0088] For the input RGB image or a local area thereof, perform color space conversion to obtain HSV representation, and extract the value of its luminance channel as a quantitative index of local transmittance T;

[0089] In the top-down path of BiFPN, the intermediate feature map of layer P2 is calculated. At that time, the transparency compensation coefficient Applied to the P2 layer input feature map extracted from the backbone network The specific fusion process is as follows:

[0090]

[0091] This process enables dynamic enhancement of detailed features in highly transparent areas, i.e., areas containing semi-transparent targets. This is achieved by quantifying the visually "semi-transparent" features into calculable V-channel values ​​and generating a transparency compensation coefficient. This allows for intelligent adjustments to the feature fusion process based on physical principles. This ensures that for highly transparent target areas, weak feature signals are not suppressed as noise but are instead compensated for and enhanced, thus significantly improving the model's ability to identify and separate semi-transparent targets in complex water environments.

[0092] Boundary average transmittance, its parameter symbol is `T` is a scalar value taking values ​​in the interval [0,1], used to characterize the average transparency of the edges around the target bounding box. This parameter is a statistical measure of local transmittance `T` at a specific spatial location, used to macroscopically assess the blurriness of the target outline; the calculation logic is as follows: First, obtain the coordinates of the four vertices of the target ground truth box. Second, based on these four vertex coordinates, calculate the coordinates of the midpoints of its top, bottom, left, and right edges. Third, call the aforementioned method for calculating local transmittance `T` to obtain the local transmittance at each of the four midpoint positions. Finally, perform an arithmetic mean on these four local transmittances; the result is the boundary average transmittance. .

[0093] If the local transmittance T at the midpoints of the top, bottom, left, and right edges of a truth box are 0.6, 0.7, 0.5, and 0.6 respectively, then the average transmittance of the boundary of the truth box is... The answer is (0.6+0.7+0.5+0.6) / 4=0.6.

[0094] Adjustable hyperparameters, whose parameter symbols are: is a scalar parameter used to adjust the sensitivity of the dynamic compensation factor. The determination of this parameter relies on offline experimental calibration. Specifically, the calibration method involves preparing a dataset with a validation set and setting a set of candidate values ​​for adjustable hyperparameters. The model is then fully trained using each candidate value, and its mean accuracy is evaluated on the validation set. Finally, the value that best performs the model on the validation set is selected. The value is used as the final determined numerical value. In this embodiment, the value is determined to be 0.5 through this calibration method.

[0095] Adjustable hyperparameters The following offline calibration process was completed:

[0096] An internal dataset containing 10,000 labeled images was used. This dataset was randomly divided into training, validation, and test sets in a ratio of 7:2:1. The calibration process was performed only on the training and validation sets.

[0097] Set adjustable hyperparameters The set of candidate values ​​is defined, ranging from 0.1 to 1.0, with a step size of 0.1. For each candidate value in the set, a complete model is trained from scratch on the training set using the exact same training hyperparameters until convergence.

[0098] After each model is trained, it is evaluated on a validation set. The performance metric used is the standard mean accuracy. This metric is calculated as follows: an intersection-to-union (IoU) threshold of 0.5 is set, then the mean accuracy (AP) for all classes at this threshold is calculated, and finally, the arithmetic mean of the AP values ​​for all classes is taken.

[0099] Record each adjustable hyperparameter The average precision score corresponding to each candidate value is calculated. The score is plotted against adjustable hyperparameters. The relationship curve of the values ​​is analyzed, and an adjustable hyperparameter is selected to maximize the average accuracy score. The value is used as the preferred value in this embodiment. Through this process, the adjustable hyperparameter is determined. The preferred value is 0.5. Experiments show that when the adjustable hyperparameter... When the value is below 0.3, the model is not adaptable enough to semi-transparent targets; when it is above 0.8, it may be too tolerant of annotation noise, leading to a decrease in accuracy. Therefore, the reasonable range of its value is between 0.3 and 0.8.

[0100] The dynamic compensation factor, whose parameter symbol is: , is the focusing parameter in the standard Focal-Loss loss function, used to adaptively adjust the penalty intensity of the loss function for different samples. The calculation of this parameter is one of the core innovations of this embodiment, directly linking the physical properties of the target with the machine learning loss function. The calculation logic is as follows: The aforementioned determined adjustable hyperparameter... The calculated boundary average transmittance Perform a multiplication operation. Then, add the product to the base value of 1.0. The sum is the dynamic compensation factor. The value of this design makes the target boundary more blurred, and the average light transmittance of the boundary decreases. The larger the dynamic compensation factor, the greater the dynamic compensation factor. The larger the value, the lower the loss weight for that sample. When At that time, dynamic compensation factor The output value range is limited to [1.0, 1.6]. If the boundary average transmittance... The hyperparameter is 0.6, which is adjustable. If it is 0.5, then the dynamic compensation factor is... The result is 1.0 + 0.5 × 0.6 = 1.3.

[0101] Furthermore, this embodiment demonstrates that when processing samples with extremely transparent properties, i.e., the boundary average transmittance... With a value close to 1.0, a dynamic compensation factor is used to achieve optimal training convergence. The instantaneous value can slightly exceed 1.5, for example, reaching 1.58. Therefore, the effective working range of this parameter is verified to be in the interval [1.0, 1.6], which ensures the model's strong adaptability to all types of targets, from opaque to extremely transparent.

[0102] This embodiment provides the following specific and reproducible calculation path for the dynamic compensation factor:

[0103] For each training sample, obtain the coordinates of its ground truth bounding box. Calculate the local transmittance at the midpoints of the four edges of the image's luminance channel V, which has been converted to HSV color space:

[0104]

[0105] Calculate the arithmetic mean of these four local transmittances to obtain the boundary average transmittance. .

[0106] in , , , These represent the local light transmittance at the midpoints of the corresponding edges at the top, bottom, left, and right, respectively.

[0107] Average transmittance at the boundary Substitute the following preset functional relationship into the equation to calculate the final dynamic compensation factor. :

[0108]

[0109] In a specific embodiment of this example, the hyperparameters can be adjusted. The preferred value range for υ is [0.3, 0.8]. When the value of υ is below 0.3, the loss function is not sensitive enough to changes in transmittance, making it difficult to effectively distinguish between samples with clear edges and those with blurred edges. When the value of υ is above 0.8, it will over-respond to small fluctuations in transmittance, leading to unstable model training. In this embodiment, for the shrimp larvae detection task in an aquaculture scenario, the best practice value for υ is 0.5.

[0110] The complete calculation process of this embodiment is broken down as follows:

[0111] 1.1) The initial input is a digital image to be processed, which exists as a multidimensional array in RGB format.

[0112] 1.2) The digital image is input into a pre-set, pre-trained backbone network. Through a series of convolution, activation, and downsampling operations within the network, a set of multi-scale feature maps with different spatial resolutions and channel depths is generated. These feature maps are labeled as follows: .

[0113] The 'pre-built, pre-trained backbone network' is described in detail below. In this embodiment, the backbone network adopts the CSPDarknet structure. This structure specifically includes: an initial convolutional layer, followed by four main residual stages. Each residual stage consists of a downsampled convolutional block and multiple stacked Cross-Stage Partial-Network (CSP) modules. SiLU (Sigmoid-weighted Linear-Unit) is used as the activation function after all convolutional layers. The 'pre-training' process is implemented as follows: The publicly available large-scale image dataset ImageNet-1k is selected as the pre-training dataset, which contains approximately 1.28 million training images. All images are preprocessed, uniformly resized to 640×640 pixels, and data augmentation strategies including random flipping and color dithering are applied. Next, the model is trained using the PyTorch deep learning framework on a server equipped with an NVIDIA-A100 GPU. During training, AdamW was selected as the optimizer, with an initial learning rate of 0.1%, and cosine annealing was used for dynamic adjustment of the learning rate. The weight decay coefficient was set to 0.05%, and the batch size was set to 64. Finally, the entire backbone network was trained for a total of 300 epochs until the loss function value of the model on the validation set converged. After this process, the weight parameters of the network model were saved, which constitutes the pre-trained backbone network used in subsequent steps of this embodiment.

[0114] 1.3) Executed in a weighted bidirectional feature pyramid network (BiFPN), containing two information flow paths: top-down and bottom-up; for the top-down path - higher layers: input feature maps of the highest layer. Processing is performed to generate intermediate feature maps. Furthermore, integration and Generate intermediate feature maps These fusions are all standard weighted sums; in parallel, the original input image or its low-resolution version is converted to the HSV color space to generate a luminance channel map aligned with the feature map space of each level, which is a lookup table for the global local transmittance T.

[0115] For top-down path-shallow compensation fusion: in the calculation At that time, compensation fusion is performed, specifically based on the generated luminance channel map, to find... The local transmittance T at each spatial location. Then, according to " Calculate the transparency compensation coefficient for each location. .right The original weights are adjusted by adjusting them with the calculated transparency compensation coefficient. Implement element-wise multiplication. Finally, adjust the weights... Upsampling is obtained through a "top-down path" Perform weighted fusion to generate the final result. .

[0116] From the lowest level output feature map Initially, upsampling is performed layer by layer and compared with the input feature maps of the corresponding layers. and intermediate feature maps Perform weighted fusion to generate sequentially .

[0117] 1.4) Output the feature map of the generated bottom-up path. Each data point is fed into its respective detection head. Each detection head consists of several convolutional layers and ultimately outputs a tensor that encodes the class probability, confidence level, center coordinates, width, and height of the detected target at the corresponding scale.

[0118] 1.5) For each predicted bounding box and its matching ground truth bounding box, calculate their Intersection over Union (IoU). Then, according to the Focal-EIOU loss function, calculate the center point distance loss term, width difference loss term, and height difference loss term respectively.

[0119] Calculate the average transmittance of the current target ground truth box boundary. Subsequently, according to " Calculate the dynamic compensation factor corresponding to the sample pair. .

[0120] The calculated losses are summed to obtain the basic EIOU loss value. Then, the intersection-union ratio (IoU) value is adjusted using a dynamic compensation factor. The Focal weights are obtained by exponentiation. Finally, these Focal weights are multiplied by the base EIOU loss value to obtain the final loss value for the sample pair.

[0121] The loss values ​​of all sample pairs are summed or averaged to obtain the overall loss for a batch. The gradient is then calculated based on this overall loss using the backpropagation algorithm, and the network parameters of the entire model are updated using the Adam optimizer.

[0122] The model training process was performed on a computing platform configured with an NVIDIA-RTX-4090 GPU and the PyTorch-2.0 framework. Model parameter updates were performed using the Adam optimizer, with the following hyperparameter configuration:

[0123] The initial learning rate was set to an optimal value of 0.001. This value was determined based on grid search experiments conducted within the range of 0.01 to 0.0001, which found that 0.001 could ensure convergence speed while avoiding gradient explosion in the early stages of training, thus achieving the best performance balance. A reasonable range for this value is between 0.0005 and 0.002.

[0124] The Beta parameter of the Adam optimizer is set to an industry-standard value, where It is 0.9. The value is 0.999. The weight decay coefficient is set to 0.0005 to regularize the model complexity and prevent overfitting.

[0125] The training process consisted of 300 rounds, with each training batch containing 16 images.

[0126] The learning rate decay strategy employs a cosine-annealing scheduler. In each training epoch, the current learning rate is set to the product of a baseline learning rate and a scaling factor. This scaling factor is calculated as follows: the ratio of the current training epoch to the total number of training epochs is multiplied by pi (π); then, the cosine of this ratio is taken; finally, this cosine is incremented by 1 and divided by 2. This logic allows the learning rate to decay smoothly and non-linearly from its initial value to near zero during training, helping the model converge to the optimal solution better in the later stages of training.

[0127] 1.6) During the inference phase, the final output of the process is a list of bounding boxes processed by non-maximum suppression (NMS). Each bounding box contains its location coordinates, the label of its class, and the confidence score of the prediction. During the inference phase, the original set of predicted boxes generated by the detection head undergoes a post-processing process including non-maximum suppression (NMS) to generate the final, unique list of bounding boxes. The specific implementation of this process is as follows:

[0128] All original predicted boxes undergo initial filtering. A confidence score threshold of 0.25 is set as the preferred value. This value is determined based on the observation that a precision-recall curve plotted on the validation set shows that 0.25 effectively filters out most background noise while maximizing the retention of potential true targets, achieving a good balance. A reasonable range is between 0.2 and 0.4. Predicted boxes with confidence scores below this threshold are discarded. Next, non-maximum suppression (NMS) is performed on the remaining predicted boxes. The logic for this operation is as follows: all predicted boxes are sorted from highest to lowest confidence score. The box with the highest score is selected as the baseline, and all other boxes are iterated over. The Intersection over Union (IoU) between each box and the baseline box is calculated. If the calculated IoU is greater than the preset threshold, the box is considered to detect the same target as the baseline box and is suppressed.

[0129] In this embodiment, the Intersection over Union (IoU) threshold is set to a preferred value of 0.45. This value is determined as follows: this embodiment targets dense, small-object scenes where the objects are close together. An excessively high IoU threshold would lead to the incorrect suppression of overlapping independent objects, while an excessively low threshold would fail to effectively remove redundant detection boxes for the same object. Through testing on a validation set for images with varying density, 0.45 has been confirmed as the optimal value. Its reasonable range is between 0.4 and 0.55. The above process is repeated until all predicted boxes have been processed. The final output is the list of remaining bounding boxes after NMS processing.

[0130] Furthermore, one of the core aspects of this embodiment lies in how to fuse high-resolution shallow spatial feature representations. After upsampling of abstract deep semantic feature representation and the transparency compensation coefficient characterizing the physical optical features of the target. .

[0131] The characteristics of shallow space The output from the shallow layers of the backbone network retains the richest image details, such as contours, textures, and edges, but lacks high-level semantic information. Its role in this scheme is to provide a basis for precise target localization.

[0132] Deep semantic features represent After multiple convolutions and fusions, it contains high-level semantic information about "what is the target," but a large amount of spatial detail has been lost. Its role is to provide a basis for target classification.

[0133] Transparency compensation coefficient characterized by physical optical features The compensation coefficient, obtained by quantizing the brightness of the image, does not directly describe what or where the target is, but rather describes the "signal strength" of the target region, that is, to what extent the features of the region are credible and not weakened by the transparency effect.

[0134] This embodiment reveals the intrinsic quantitative relationship among these three factors: the effectiveness of shallow spatial features is directly constrained by the physical and optical properties of the target. When the target's transparency increases, its... The intensity of the characteristic signal in the image will attenuate disproportionately, even falling below the background noise. If this is done indiscriminately... When fused with powerful deep semantic features, these attenuated, weak true features are easily overlooked. Therefore, a transparency compensation coefficient for physical optical features must be introduced. The contribution of shallow spatial features is dynamically and nonlinearly reweighted.

[0135] Conventional element-wise addition or channel concatenation are essentially linear or fixed fusion strategies. They treat features from all spatial locations equally and cannot handle inconsistencies in feature signal intensity caused by changes in the physical properties of the target. While linear weighting introduces weights, these weights are globally shared and fixed, failing to achieve pixel-level adaptive adjustment. These methods inevitably lead to poor feature fusion results when dealing with semi-transparent targets.

[0136] To address the aforementioned limitations, this embodiment designs a dynamically adaptive weight fusion system guided by physical properties. Its internal working mechanism is as follows: the system receives two feature maps, a shallow one and a deep one, as input. Unlike conventional methods, it also has an additional control input for receiving the physical optical feature map, which corresponds one-to-one with the spatial location of the shallow feature map, i.e., the transparency compensation coefficient. The resulting coefficient diagram. Before fusion calculation, the system first uses transparency compensation coefficients. The resulting coefficient map performs an element-wise multiplication operation on the shallow feature map. The physical meaning of this operation is: for the transparency compensation coefficient... Regions with high values ​​(high transparency) significantly enhance their eigenvalues; for the transparency compensation coefficient Regions with low feature values ​​(opaque) retain their feature values ​​largely unchanged. After this "pre-enhancement" process, the adjusted shallow feature maps are then fused with the deep feature maps using conventional weighted fusion. This achieves intelligent adjustment of the feature's signal-to-noise ratio. The network can then "differentiate" regions with varying transparency, selectively amplifying crucial but physically attenuated detail features while preserving semantic information from all regions. This improves the model's detection rate for low-contrast, blurred-edge targets in complex backgrounds. Furthermore, because the enhancement is targeted, it does not significantly increase false positives for background noise, thus improving overall detection accuracy.

[0137] The formal logical description of the fusion system is as follows: the system is configured to perform a fusion operation to generate an intermediate feature map. This operation includes: obtaining the features represented by a shallow feature map. A resized deep feature map and a with Transparency compensation coefficient map with the same spatial dimension. The system performs an element-wise multiplication operation with the following operands: and This yields a pre-enhanced shallow feature map. Then, the system compares this pre-enhanced shallow feature map with the deep feature map. Assign learnable weights respectively and The two weighted feature maps are then summed element-wise. Finally, the sum is processed through a convolutional layer and divided by a normalization term to obtain the final output. .

[0138] Element-wise multiplication operator: Its function is to perform dynamic adaptive weight adjustment based on the transparency compensation coefficient. The shallow feature map represents Each eigenvalue is nonlinearly enhanced.

[0139] Weighted summation operator: Its function is to linearly combine compensated shallow spatial information with deep semantic information to achieve preliminary fusion of multimodal features.

[0140] Convolutional layer operators: Their function is to deeply integrate and purify the features after initial fusion, and extract more discriminative combined features.

[0141] When the target is completely opaque: that is, when the local transmittance T of the target area is 0, the transparency compensation coefficient... The value is calculated to be 1.0. At this point, the element-level multiplication operation is equivalent to an identity transformation, and the system behavior is downgraded to standard weighted bidirectional feature pyramid network fusion, ensuring that the detection performance for conventional opaque targets is not affected.

[0142] When the area is completely transparent / pure background: that is, when the local transmittance T of the area is close to 1.0, the transparency compensation coefficient... Approaching 2.0, the feature values ​​in this region are amplified. Although this amplifies the background noise, the final fusion result does not produce erroneous strong activations because subsequent convolutional layers have the ability to learn patterns and suppress irrelevant noise, and the region has a low response in deep semantic features.

[0143] The technical solution disclosed in this embodiment is applicable to scenarios where the input image contains images where the target has low contrast and blurred edges due to semi-transparency, reflection, or being in low-light or underwater environments. Its applicability is limited by the requirement that the target must exhibit at least a perceptible, albeit weak, but systematic difference in brightness or color within the image for the transparency quantification model to perform effective calculations. In extreme cases where the target is completely invisible or has pixel values ​​identical to the background, the performance of this solution will degrade to a level comparable to conventional detection methods.

[0144] The following are detailed implementation instructions for the above content:

[0145] The core of this embodiment lies in introducing three key parameters dynamically related to the target physical property "transparency": transparency compensation coefficient, dynamic compensation factor, and balance factor. These parameters work together to optimize the model's feature perception and learning convergence process.

[0146] Mean accuracy is a core indicator for evaluating the overall performance of a model. Its value range is [0,1]. The closer the mean accuracy is to 1, the higher the overall accuracy of the model in detecting all categories of targets under the condition that the Intersection over Union (IoU) threshold is 0.5, that is, the false negative rate and false positive rate of the model are both at extremely low levels.

[0147] The recall rate has a range of [0, 1]. The closer the recall rate is to 1, the stronger the model's ability to find all true targets and the fewer targets are missed.

[0148] The precision value ranges from [0,1]. The closer the precision value is to 1, the higher the proportion of true targets in the prediction results given by the model, and the fewer errors there are in misidentifying the background or other objects as targets.

[0149] Transparency compensation factor In the calculation logic, the transparency compensation coefficient It exhibits a strict positive correlation with local transmittance T. As the local transmittance T of a local area of ​​the image increases, meaning the target becomes more transparent, the transparency compensation coefficient increases. It also increases monotonically. In the feature fusion step, the transparency compensation coefficient... Used to adjust the weights of the high-resolution P2 layer feature maps, i.e., " The physical characteristics of semi-transparent targets mean that their feature signals in images are weak and easily ignored as background noise. This application achieves compensatory enhancement of these weak but crucial feature signals by increasing the feature weights of high-transmittance regions. This positive correlation design accurately maps the physical detection logic that "the more transparent the target, the more attention it needs to be given," and its direct technical effect is to improve the recall rate of the model.

[0150] Dynamic compensation factor In the calculation logic, the average transmittance at the boundary is calculated. Let be the local transmittance at the midpoint of the four sides of the target ground truth box. Therefore, the dynamic compensation factor... Average transmittance at the boundary with the target boundary There is a strict positive correlation. The more blurred the target boundary, the higher the average light transmittance of the boundary. When the value is higher, the dynamic compensation factor The larger the value, the greater the dynamic compensation factor. It is used as the focusing parameter in the Focal-EIOU loss function. In the Focal-Loss mechanism, the dynamic compensation factor... A larger value indicates a stronger suppression effect on loss weights with high IoU, thus allowing the model to focus more on learning difficult samples with low IoU. The semi-transparent nature of target boundaries often leads to biases in manual annotation, forming "label noise." Applying excessively large loss penalties to these "difficult" samples with blurred boundaries can cause the model to overfit to the noise. This application addresses this by increasing the dynamic compensation factor for such samples. This intelligently reduces the penalty for localization errors, allowing the model to learn within a reasonable tolerance range. This positive correlation design accurately maps the learning logic that "the more unreliable the label, the more lenient the penalty should be," and its direct technical effect is to improve the model's accuracy and overall mean precision.

[0151] The Focal-EIOU loss is defined as: ; For IOU-based loss Central point loss and width and height loss The EIOU loss function characterization;

[0152] The EIOU function consists of three parts: IOU loss. Loss of center point between the predicted bounding box and the labeled bounding box and width and height loss The EIOU loss function formula is as follows:

[0153]

[0154] in , , These represent the center point, width, and height of the prediction box, respectively. , , These represent the center point, width, and height of the annotation box, respectively. represent and The Euclidean distance between them , , These represent the diagonal length, width, and height of the corresponding minimum bounding box, respectively.

[0155] Balance factor In computational logic This represents the maximum transmittance within the target ground truth box. Therefore, the balance factor... It exhibits a strictly positive correlation with the overall transparency of the target. (Balance factor) It is used as a denominator term in the loss function. The more transparent the overall target, the better. The higher the value, the better the balance factor. It will increase more. This makes IoU and the balance factor... The ratio decreases, thus further reducing the overall loss contribution of this sample. This design is based on the dynamic compensation factor. The supplementation and fine-tuning of the mechanism should not only focus on samples with blurred boundaries, but also give greater learning tolerance to samples that are very transparent and extremely difficult to detect as a whole.

[0156] Furthermore, to verify the effectiveness of each technical component of this invention, the following experiments were conducted. All experiments were trained and evaluated on the same dataset containing a large number of dense, semi-transparent shrimp larvae images. Evaluation metrics included precision, recall, mean precision, and F1 score; see Table 1 below for details.

[0157] Table 1 Evaluation Index Results

[0158]

[0159] Experimental results show that, using precision (P), recall (R), mean average precision (mAP@0.5), and F1 score as evaluation metrics, integrating BiFPN and the CA attention mechanism into the YOLOv8 architecture significantly improves model performance. Introducing the CA attention module alone significantly improves recall (R) (+5.55 percentage points). This improvement stems from the attention mechanism's ability to enhance feature representation, particularly improving sensitivity to small targets such as seedlings. This mechanism selectively strengthens key features and suppresses irrelevant information, thus improving detection performance for small targets. Using the BiFPN structure alone results in a more significant improvement in F1 score (+6.9 percentage points). This performance gain is attributed to BiFPN's effective multi-scale feature fusion capability, which optimizes detection of targets of different sizes through cross-scale connections. This structure promotes information flow between features at different levels, thereby improving the detection accuracy of multi-scale targets.

[0160] The synergistic use of the two modules achieves an optimal performance balance, improving precision by 3.05 percentage points and recall by 13.13 percentage points. Notably, this performance improvement was accompanied by a reduction in model size, from 23.68 MB to 22.32 MB. This seemingly contradictory phenomenon demonstrates that structural optimization effectively eliminates model redundancy while enhancing feature representation capabilities. From a parameter efficiency perspective, BiFPN reduces computational redundancy through its cross-scale connections, achieving model compression. While the CA attention mechanism introduces only a small number of additional parameters, it significantly contributes to accuracy metrics, particularly improving mAP@0.5 by 4.9 percentage points. This efficient trade-off between model complexity and performance fully demonstrates the effectiveness of these architectural improvements.

[0161] Figure 4 A, B, C, and D in the figure show the DFL loss and Box loss generated by DPD-YOLO and YOLOV8 during training and validation.

[0162] DPD-YOLO refers to Dense-feature-Pyramid and partial-Dehazing.

[0163] The core idea and main contributions of this algorithm are twofold, aiming to solve the challenge of target detection in underwater environments:

[0164] Dense-Feature-Pyramid-Network (DFPN): To address the issue that underwater targets are typically dense and small in size, it designs a novel feature pyramid structure that enhances the flow of information between features at different levels through denser connections, so as to better preserve and utilize the detailed information that is crucial for the detection of small targets.

[0165] Partial Dehazing Module (PDM): Addressing the common problems of blurriness, color distortion, and low contrast (i.e., "hazing") in underwater images, this algorithm integrates a lightweight dehazing module. Instead of performing global dehazing on the entire image, it restores image clarity in a localized manner as a pre-enhancement step for feature extraction, thereby improving the subsequent network's ability to recognize targets.

[0166] During model training, by observing the trend of training and validation losses with training epochs, the performance differences between 'DPD-YOLO' and YOLOv8 can be clearly compared and analyzed. Experimental results show that as the number of training epochs increases, the loss values ​​of both models show a decreasing trend and eventually stabilize, but 'DPD-YOLO' exhibits superior performance.

[0167] From the loss curves on the validation set, 'DPD-YOLO' significantly outperforms YOLOv8 in both the DFL (Discretionary Feature Learning) loss and Box loss. Specifically, 'DPD-YOLO's' DFL loss eventually stabilizes at around 0.08, a 33% reduction compared to YOLOv8's 0.12; its Box loss stabilizes at around 0.07, a 30% reduction compared to YOLOv8's 0.10. This significant performance advantage indicates that 'DPD-YOLO' possesses stronger feature learning and model generalization capabilities. Further analysis of the convergence process reveals that 'DPD-YOLO' reaches a stable state in approximately 100 training epochs, while YOLOv8 requires around 150 epochs. This faster convergence speed signifies higher training efficiency for 'DPD-YOLO,' enabling faster model optimization. Furthermore, 'DPD-YOLO' exhibits smaller loss fluctuations on the validation set, with a 40% lower standard deviation than YOLOv8, indicating better training stability. In the specific application scenario of shrimp larvae detection, the performance advantages of 'DPD-YOLO' have significant practical implications. Lower DFL loss means the model can more accurately distinguish shrimp larvae from background noise, reducing false positives. Secondly, a better Box loss indicates that the model's localization of shrimp larvae is more precise, which is beneficial for subsequent analysis tasks such as body length measurement. Finally, the fast convergence characteristics allow the model to adapt quickly to changes in the aquaculture environment, meeting the needs of real-time monitoring.

[0168] like Figure 3 As shown, Figure 3 A, C, and E in the table represent the traditional YOLOv8 shrimp larvae testing results, while Figure 3 B, D, and F in the table initially represent the shrimp larvae detection results after optimization of the innovative framework of the detection method (DSD-YOLO) in this embodiment. Through comparative analysis, it was found that the traditional YOLOv8 model has a large number of false positives when identifying shrimp larvae. Figure 3 (A, C) and missed detection ( Figure 3 (E in the text). In comparison, the innovative DSD-YOLO framework in this study significantly improved the detection performance in the same area, effectively reducing false positives and false negatives. However, when faced with complex backgrounds and occlusions, especially when shrimp larvae were obscured by other shrimp larvae, the YOLOv8 framework encountered many false positives and false negatives, severely impacting detection accuracy. After the initial improvements in this project, the detection performance of the innovative DSD-YOLO framework was significantly improved, particularly in handling occluded scenarios. Even with partial occlusion, it can more effectively identify shrimp larvae.

[0169] The present invention also provides a dense semi-transparent shrimp larvae detection system, the system comprising:

[0170] The image acquisition module is configured to acquire a digital image containing the target to be detected;

[0171] The feature extraction module is configured to extract multi-scale feature maps from the digital image using a pre-set backbone network;

[0172] The transparency-aware feature fusion module is configured to perform weighted bidirectional fusion of the multi-scale feature maps, and when fusing at least one shallow feature map with high spatial resolution, calculate the transparency compensation coefficient according to a preset transparency quantization model, and use the transparency compensation coefficient to adjust the weight of the shallow feature map in the fusion process to generate a fused feature map.

[0173] The prediction box generation module is configured to generate a prediction box for the target to be detected based on the fused feature map.

[0174] The model training module is configured to use a preset adaptive loss function to guide the training of the model. The adaptive loss function includes a dynamic compensation factor calculated based on the transmittance of the target boundary region, which is used to adaptively adjust the loss penalty of the prediction box to obtain the final prediction box set. The final prediction box set is output as the detection result, which includes the position coordinates and confidence score of each shrimp seedling target. The total number of shrimp seedlings is determined based on the number of the final prediction box set.

[0175] Specifically: the transparency-aware feature fusion module further includes a coordinate attention submodule, which is configured to perform transparency-aware coordinate attention mechanism processing on the fused feature map;

[0176] Specifically, the coordinate attention submodule introduces a mask generated based on local brightness variance to weight the features when performing orientation-sensitive pooling.

[0177] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0178] It should be noted that all calculation formulas in this application employ regression analysis, including but not limited to machine learning algorithms, to deeply analyze the collected parameters and identify their natural trends and interrelationships. Specialized software, such as Python's Scikit-learn library or the R language, is used to automatically generate mathematical models that match the data. Then, cross-validation and other methods are used to objectively evaluate the model performance, and continuous feedback and optimization are combined to ensure that the created formulas truly reflect the inherent laws of the data, thereby guaranteeing their effectiveness and accuracy. In all calculation formulas in this application, the parameters in each formula undergo dimensionless processing within a consistent range to ensure that different physical quantities are compared on the same scale; dimensionless processing techniques include, but are not limited to, min-max-normalization and Z-score standardization.

[0179] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting densely packed, semi-transparent shrimp larvae, characterized in that, The specific steps include: S1: Acquire a digital image containing the target to be detected; S2: Using a pre-set backbone network, extract multi-scale feature maps from the digital image; S3: Perform a transparency-aware feature fusion process, which performs weighted bidirectional fusion of the multi-scale feature maps. When fusing at least one shallow feature map with high spatial resolution, a transparency compensation coefficient is calculated according to a preset transparency quantization model. The transparency compensation coefficient is then used to adjust the weight of the shallow feature map in the fusion process to generate a fused feature map. S4: Based on the fused feature map, generate a predicted bounding box for the target to be detected; S5: The model training of this method is guided by a preset adaptive loss function, wherein the adaptive loss function includes a dynamic compensation factor calculated based on the transmittance of the target boundary region, which is used to adaptively adjust the loss penalty of the prediction box to obtain the final prediction box set; and the final prediction box set is output as the detection result, wherein the detection result includes the position coordinates and confidence score of each shrimp seedling target, and the total number of shrimp seedlings is determined based on the number of the final prediction box set; The adaptive loss function is as follows: The Focal-EIOU loss is defined as: ; For IOU-based loss Central point loss and width and height loss The EIOU loss function characterization; The EIOU function consists of three parts: IOU loss. Loss of center point between the predicted bounding box and the labeled bounding box and width and height loss The EIOU loss function formula is as follows: in , , These represent the center point, width, and height of the prediction box, respectively. , , These represent the center point, width, and height of the annotation box, respectively. represent and The Euclidean distance between them , , These represent the diagonal length, width, and height of the corresponding minimum bounding box, respectively; balance factor. In computational logic The maximum transmittance within the target truth box; therefore, the balance factor... It has a strict positive correlation with the overall transparency of the target.

2. The method for detecting densely packed semi-transparent shrimp larvae according to claim 1, characterized in that: The feature fusion process in step S3 is configured to be performed in a weighted bidirectional feature pyramid network structure, and the shallow feature map is configured as a P2 layer feature map.

3. The method for detecting densely packed semi-transparent shrimp larvae according to claim 2, characterized in that: Following step S3, there is also a step configured to perform a coordinate attention mechanism processing that is perceptual about transparency.

4. The method for detecting densely packed semi-transparent shrimp larvae according to claim 3, characterized in that: The transparency quantization model is configured to determine local transmittance by converting local regions of an image from the RGB color space to the HSV color space and extracting the values ​​of its luminance channels. The transparency compensation coefficient is configured to be calculated by summing a reference value with the local transmittance; The dynamic compensation factor is configured to calculate the local transmittance at the midpoint of the four sides of the target truth box, and then use these local transmittances to determine the boundary average transmittance through a preset functional relationship.

5. The method for detecting densely packed semi-transparent shrimp larvae according to claim 4, characterized in that: The adaptive loss function is configured as a Focal-EIOU loss function, and the dynamic compensation factor is configured as the focusing parameter in the loss function.

6. The method for detecting densely packed semi-transparent shrimp larvae according to claim 5, characterized in that: The Focal-EIOU loss function also includes a balancing factor, which is configured to be calculated based on the maximum transmittance of the target to be detected, in order to balance the learning weights.

7. The method for detecting densely packed semi-transparent shrimp larvae according to claim 6, characterized in that: The more blurred the boundary of the target to be detected, the larger the value of the dynamic compensation factor; the balance factor is positively correlated with the overall transparency of the target to be detected.

8. A dense semi-transparent shrimp larvae detection system, characterized in that, The system for implementing the method as described in any one of claims 1-7 includes: The image acquisition module is configured to acquire a digital image containing the target to be detected; The feature extraction module is configured to extract multi-scale feature maps from the digital image using a pre-set backbone network; The transparency-aware feature fusion module is configured to perform weighted bidirectional fusion of the multi-scale feature maps, and when fusing at least one shallow feature map with high spatial resolution, calculate the transparency compensation coefficient according to a preset transparency quantization model, and use the transparency compensation coefficient to adjust the weight of the shallow feature map in the fusion process to generate a fused feature map. The prediction box generation module is configured to generate a prediction box for the target to be detected based on the fused feature map. The model training module is configured to use a preset adaptive loss function to guide the training of the model. The adaptive loss function includes a dynamic compensation factor calculated based on the transmittance of the target boundary region, which is used to adaptively adjust the loss penalty of the prediction box to obtain the final prediction box set. The final prediction box set is output as the detection result, which includes the position coordinates and confidence score of each shrimp seedling target. The total number of shrimp seedlings is determined based on the number of the final prediction box set. The adaptive loss function is as follows: The Focal-EIOU loss is defined as: ; For IOU-based loss Central point loss and width and height loss The EIOU loss function characterization; The EIOU function consists of three parts: IOU loss. Loss of center point between the predicted bounding box and the labeled bounding box and width and height loss The EIOU loss function formula is as follows: in , , These represent the center point, width, and height of the prediction box, respectively. , , These represent the center point, width, and height of the annotation box, respectively. represent and The Euclidean distance between them , , These represent the diagonal length, width, and height of the corresponding minimum bounding box, respectively; balance factor. In computational logic The maximum transmittance within the target truth box; therefore, the balance factor... It has a strict positive correlation with the overall transparency of the target.

9. The dense semi-transparent shrimp larvae detection system according to claim 8, characterized in that: The transparency-aware feature fusion module further includes a coordinate attention submodule, which is configured to perform transparency-aware coordinate attention mechanism processing on the fused feature map; Specifically, the coordinate attention submodule introduces a mask generated based on local brightness variance to weight the features when performing orientation-sensitive pooling.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Deep learning shrimp seed counting method and system based on region segmentation and storage medium

    CN117115080A

  • Image target detection method, system and device and storage medium

    CN114581744A

  • Multi-scale feature fusion small target detection algorithm for aerial image of unmanned aerial vehicle

    CN118262256A