Shrimp feed residue lightweight detection method fusing multi-attention characteristics

The YOLO-Shrimp model, through the combination of the RepGhost network, the EnSimAM attention mechanism, and the EnWIoU loss function, solves the problems of accuracy and efficiency in shrimp feed residue detection in shrimp farming, achieving efficient and accurate residue detection, and is suitable for complex underwater environments.

CN121962847APending Publication Date: 2026-05-01DALIAN OCEAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DALIAN OCEAN UNIV
Filing Date
2025-12-29
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing deep learning models suffer from problems such as missed detections, false detections, and insufficient localization accuracy when detecting shrimp feed residues in shrimp farming, especially in high-density, complex underwater environments where they struggle to effectively extract subtle features.

Method used

The YOLO-Shrimp model is adopted, combined with the RepGhost lightweight backbone network, the EnSimAM attention mechanism and the EnWIoU loss function. Through multi-scale feature extraction, global, local and edge response enhancement, the accuracy of small target detection is improved, and the loss function is adjusted by adaptive weight to optimize bounding box regression.

Benefits of technology

It significantly improves the accuracy and efficiency of shrimp feed residue detection, reducing the number of parameters by 19.7% and computational complexity by 14.6%. On real aquaculture environment image datasets, it achieves 70.01% mAP@0.5 and 28.01% mAP@0.5:0.95, meeting the requirements of real-time high-frequency monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962847A_ABST
    Figure CN121962847A_ABST
Patent Text Reader

Abstract

A shrimp feed residue lightweight detection method fusing multi-attention features belongs to the field of image processing, is used for solving the problem of improving small target detection accuracy, and is technically characterized by inputting a multi-scale feature map into a neck network of a YOLO network, calculating a fusion weight value through an EnSimAM attention module of the neck network, and obtaining a fusion feature map according to the fusion weight value; wherein the EnSimAM attention module comprises a global attention branch, a local variance enhancement branch and an edge response enhancement branch; the EnSimAM attention module calculates a fusion weight value based on the following mode; the global attention branch calculates a global attention weight; calculating a local attention weight by a local variance enhancement branch; the edge response enhancement branch calculates an edge attention weight; determining adaptive weight values of the global attention weight, the local attention weight and the edge attention weight; and according to the adaptive weight value, calculating a fusion weight value of the global attention weight, the local attention weight and the edge attention weight.
Need to check novelty before this filing date? Find Prior Art

Description

A lightweight detection method for shrimp feed residues incorporating multiple attention features Technical Field

[0001] This invention belongs to the field of image processing and relates to a lightweight detection method for shrimp feed residues that integrates multiple attention features. Background Technology

[0002] Shrimp farming is a vital component of global aquaculture, with its industry scale and economic value continuously growing. In actual production, feed costs typically account for over 50% of total production costs, making it a key factor influencing the economic efficiency of aquaculture. Overfeeding not only leads to direct feed waste and increased feed costs, but uneaten feed also decomposes in the water, releasing harmful substances such as ammonia nitrogen and nitrite, thus deteriorating water quality and potentially inducing shrimp diseases, threatening the stability of the aquaculture ecosystem. Conversely, underfeeding inhibits normal shrimp growth, reducing yield and market size. Therefore, rapid and accurate assessment of uneaten feed in feeding trays after feeding is crucial for optimizing feeding strategies, reducing costs, improving efficiency, and promoting the sustainable development of aquaculture.

[0003] Currently, monitoring of uneaten feed in aquaculture mainly relies on the experience-based visual inspection of aquaculture workers, who subjectively judge the feed consumption in the feeding trays to adjust the feeding amount. This traditional method has many limitations: first, it is labor-intensive and inefficient, unsuitable for large-scale, high-density aquaculture; second, the results are highly dependent on personal experience, lacking objective and consistent evaluation standards, which can easily lead to arbitrary and unstable feeding decisions; and third, manual inspection makes it difficult to achieve continuous and high-frequency monitoring, potentially missing the optimal time for feeding adjustments. These problems, overall, restrict the development of precision and intelligent shrimp farming.

[0004] With the rapid development of computer vision and deep learning technologies, image-based automated monitoring of aquaculture has become a research hotspot. Deep learning object detection algorithms, represented by the YOLO (YouOnlyLookOnce) series, are widely used in aquaculture scenarios such as fish counting, behavior analysis, and growth monitoring due to their good balance between inference speed and detection accuracy. However, when general object detection models are directly applied to the task of monitoring uneaten feed in shrimp farming, they still face unique performance bottlenecks. Specifically, existing methods mainly exhibit the following problems in this task: (1) serious missed detections are likely to occur in high-density uneaten feed areas, and the model has difficulty distinguishing densely clustered feed particles; (2) they are easily confused with the texture or reflective areas of the feeding tray, resulting in false detections; (3) the positioning accuracy for slender or irregularly shaped particles is insufficient. These problems stem from the fact that general models have not been optimized for targets with extremely small size, high density distribution, and diverse shapes, and their standard network structure is difficult to effectively extract subtle features in complex underwater environments (such as changes in light and water turbidity). As shown in Figure 1, the complex background and similar colors make it difficult for ordinary deep learning models to perform this task.

[0005] In intensive shrimp farming, precise control of feeding amounts is crucial for reducing costs, optimizing farming strategies, and protecting the aquatic environment. However, current assessments of residual feed in feeding trays primarily rely on manual visual inspection, which is inefficient, subjective, and difficult to standardize. Residual feed particles are typically small in size, high in density, irregular in shape, and prone to occlusion, posing a significant challenge to automated visual inspection. Summary of the Invention

[0006] To improve the detection accuracy of shrimp feed residue in underwater environmental images, the target detection method in some embodiments of this application is based on the YOLO network, including...

[0007] The image is input into the backbone of the YOLO network to obtain multi-scale feature maps, where the target includes shrimp feed residue in underwater environment images;

[0008] The multi-scale feature map is input into the neck network of the YOLO network, and the fusion weight value is calculated through the EnSimAM attention module of the neck network. Based on the fusion weight value, the fusion feature map is obtained.

[0009] The fused feature map is input into the detection head of the YOLO network to generate target detection results, wherein the target detection results include the bounding box and class prediction of the target;

[0010] The EnSimAM attention module includes a global attention branch, a local variance enhancement branch, and an edge response enhancement branch.

[0011] The EnSimAM attention module calculates the fusion weight values ​​based on the following method;

[0012] The global attention branch calculates the global attention weights;

[0013] Local variance enhancement branch calculates local attention weights;

[0014] The edge response enhancement branch calculates the edge attention weights;

[0015] Determine adaptive weight values ​​for global attention weights, local attention weights, and edge attention weights;

[0016] Based on the adaptive weight values, calculate the fusion weight values ​​of global attention weight, local attention weight, and edge attention weight.

[0017] According to the target detection method in some embodiments of this application, the global attention branch is used to calculate the importance of each neuron in the feature map, and its calculation of global attention weights includes:

[0018] Neurons based on feature maps define energy functions;

[0019] The closed-form solution is obtained by minimizing the energy function;

[0020] Calculate the global attention weights based on the closed-form solution;

[0021] The local variance enhancement branch is used to enhance the feature changes of the target within a local region. It calculates local attention weights, including:

[0022] Based on local features of the feature map, the local mean is calculated through average pooling;

[0023] Calculate the local attention weight based on the local mean;

[0024] The edge response enhancement branch is used to enhance the edges of the target. It calculates edge attention weights, including:

[0025] The gradients of the feature map in the horizontal and vertical directions are calculated based on the operator.

[0026] Calculate edge strength based on gradient;

[0027] The edge attention weight is calculated based on the edge strength.

[0028] According to the object detection method in some embodiments of this application, for the global attention branch, its input includes a feature map. ;

[0029] Among them, the neuron based on the feature map defines the energy function. It is expressed as follows:

[0030]

[0031] In the formula, The weights represent the linear transformation. This represents the bias of the linear transformation. Indicates the neuron currently to be evaluated. The response value in the feature map; Indicates the relationship with neurons The first in the same channel The response value of each neuron. Indicates the total number of neurons within the channel;

[0032] The closed-form solution is obtained by minimizing the energy function. It is expressed as follows:

[0033]

[0034] In the formula, The variance representing the channel characteristics. The mean value representing the channel characteristics. Represents the regularization coefficient. The mean value representing the channel characteristics. This represents the characteristic response value of the target neuron;

[0035] The global attention weights are calculated based on the closed-form solution. It is expressed as follows:

[0036]

[0037] In the formula, express function.

[0038] According to the target detection method in some embodiments of this application, for the local variance enhancement branch, the input includes a feature map. ;

[0039] Among them, based on local features of the feature map, through Average pooling calculates local mean It is expressed as follows:

[0040]

[0041] In the formula, The spatial coordinates of the target location in the feature map; Indicates the feature map at location Local variance at; Represents the neighborhood location of the feature map eigenvalues ​​at that location Indicates the spatial offset within the neighborhood; Indicated by The mean of the local neighborhood features centered on the target; Indicates to Normalized average of local neighborhoods;

[0042] in,

[0043] Among them, the local attention weight is calculated based on the local mean. It is expressed as follows:

[0044]

[0045] In the formula, This represents the scaling factor that adjusts the intensity of the local response.

[0046] According to the target detection method in some embodiments of this application, for the edge response enhancement branch, the input includes a feature map. ;

[0047] The gradients in the horizontal and vertical directions of the feature map calculated based on the operator are represented as follows:

[0048]

[0049]

[0050] In the formula, Represents the gradient in the horizontal direction. Represents the gradient in the vertical direction;

[0051] Among them, edge strength is calculated based on gradient. It is expressed as follows:

[0052]

[0053] Among them, edge attention weights are calculated based on edge intensity. It is expressed as follows:

[0054]

[0055] In the formula, This represents the edge response scaling factor.

[0056] According to the target detection method in some embodiments of this application, the adaptive weight values ​​for global attention weight, local attention weight, and edge attention weight are determined as follows:

[0057]

[0058] In the formula, express Adaptive weight values, express Adaptive weight values, express Adaptive weight values, Representation of feature map ϵ is a small constant used to prevent division by zero.

[0059] According to the target detection method in some embodiments of this application, a fusion weight value of global attention weight, local attention weight, and edge attention weight is calculated based on the adaptive weight value, as shown below:

[0060]

[0061] In the formula, This represents the fusion weight value.

[0062] The target detection method according to some embodiments of this application is characterized in that, multi-scale feature maps are extracted through the RepGhost network of the backbone network;

[0063] The RepGhost network extracts feature maps in the following way:

[0064] For the input feature map ,use Each convolutional kernel generates intrinsic features. , means as follows:

[0065]

[0066] In the formula, Representation of feature map ; Indicates the main convolution kernel; This represents the convolution operation; This represents the intrinsic feature map generated by the main convolution;

[0067] For each intrinsic feature Apply linear transformation To generate ghost characteristics, as shown below:

[0068]

[0069] In the formula, Indicates by the first An intrinsic feature The generated first One ghost characteristic; Indicates the first An intrinsic feature map; This represents the linear transformation operator used to generate ghost features; The number of channels representing intrinsic characteristics; This indicates the number of ghost features generated for each intrinsic feature;

[0070] By concatenating the generated ghost features, the output feature map is obtained. :

[0071]

[0072] This represents the final output feature map; This represents the intrinsic feature map generated by the main convolution; This represents a ghost feature map generated by linear transformation of intrinsic features; This indicates a splicing operation at the channel dimension.

[0073] According to the target detection method in some embodiments of this application, the RepGhost network includes at least two RG-bneck modules, wherein the output of the previous RG-bneck module is used as the input of the next RG-bneck module;

[0074] For the RG-bneck module, perform the following steps:

[0075] The first feature map is obtained by performing a 1×1 pointwise convolution operation on the input feature map;

[0076] The first feature map is transformed nonlinearly using the ReLU activation function to obtain the second feature map;

[0077] The third feature map is obtained by performing a depthwise separable convolution operation on the second feature map, and the fourth feature map is obtained by performing a batch normalization operation on the second feature map. The fifth feature map is obtained by adding the third feature map and the fourth feature map element by element.

[0078] The fifth feature map is transformed nonlinearly using the ReLU activation function to obtain the sixth feature map;

[0079] The sixth feature map is input into the DS / SE module that integrates depthwise separable convolution and channel attention for processing to obtain the seventh feature map.

[0080] Perform a 1×1 pointwise convolution operation on the seventh feature map to obtain the eighth feature map;

[0081] The ninth feature map is obtained by performing a depthwise separable convolution operation on the eighth feature map, and the tenth feature map is obtained by batch normalizing the eighth feature map. The eleventh feature map is obtained by adding the ninth feature map and the tenth feature map element by element.

[0082] The feature map is output based on the 11th feature map RG-bneck module.

[0083] According to the target detection method in some embodiments of this application, the loss function for model training is EnWIoU;

[0084] Suppose the predicted bounding box is within the base WIoU frame, predict the bounding box True bounding box ,in Indicates the center coordinates, , Let these represent the width and height of the box, respectively. The IoU is defined as:

[0085]

[0086] in, These represent the center coordinates of the predicted bounding box. Width, height; These represent the center coordinates of the actual bounding box. Width, height;

[0087] By assessing the degree of anomaly in the anchor frame Adaptively adjust loss weights;

[0088] Weighted intersection and combination loss ,in, Indicates the basic intersection-union ratio loss. This indicates a smart gradient gain allocation strategy. and For hyperparameters;

[0089] abnormality Represented as:

[0090]

[0091] In the formula, This represents the Euclidean distance between the center point of the predicted bounding box and the center point of the true bounding box. This represents the diagonal length of the smallest bounding box of the two objects;

[0092] First constraint: The aspect ratio of the predicted bounding box to the ground truth bounding box, expressed as follows:

[0093]

[0094] In the formula, Indicates the aspect ratio of the predicted bounding box. The aspect ratio of the actual bounding box;

[0095] when ,in If the threshold is used, the target is classified as a small, elongated target.

[0096] Second constraint: Directional consistency indicator function It is expressed as follows:

[0097]

[0098] This indicator function is used to determine whether the predicted bounding box and the true bounding box are consistent in either the horizontal direction or the vertical direction.

[0099] Based on the first and second constraints, the loss function EnWIoU is defined as follows:

[0100]

[0101] Among them, the direction modulation factor Represented as:

[0102]

[0103] In the formula, Indicates the directional penalty intensity coefficient;

[0104] When a small, elongated target is detected, and the predicted bounding box matches the ground truth bounding box in the same direction... Reduce loss weights; when the predicted bounding box and the true bounding box are inconsistent in direction, Increase the severity of punishment.

[0105] Beneficial Effects: The lightweight detection model YOLO-Shrimp of this invention is an augmentation network. To improve the extraction capability of features from small-sized, high-density targets, a novel attention mechanism, EnSimAM, is designed. This module features a unique three-branch parallel structure that simultaneously models global neuron importance, local feature variance, and edge information. Specifically designed for the multi-characteristic requirements of small-sized, irregular targets, it can significantly improve the detection accuracy of small targets such as shrimp feed residue in small-sized, high-density underwater environmental images.

[0106] To further improve the localization accuracy of small targets, this invention also proposes an improved weighted intersection-union loss function, EnWIoU. Simultaneously, the model employs a lightweight RepGhost module as the backbone network, significantly reducing the number of parameters and computational complexity while maintaining detection accuracy.

[0107] Experimental results: On a dataset containing 3,461 real-world aquaculture environment images, YOLO-Shrimp achieved 70.01% and 28.01% accuracy on mAP@0.5 and mAP@0.5:0.95, respectively. Compared to the baseline model, the number of parameters was reduced by 19.7%, and GFLOPs were reduced by 14.6%, validating the comprehensive advantages of this method in terms of accuracy and efficiency. Attached Figure Description

[0108] Figure 1. A partial representation of images in a real-world task.

[0109] Figure 2. Overall architecture of YOLO-Shrimp, where dashed lines represent our improved modules and red backgrounds represent fully optimized components.

[0110] Figure 3. Overall structure diagram of the EnSimAM module.

[0111] Figure 4. Flowchart of the EnWIoU loss function.

[0112] Figure 5. Structure diagram of the RG-bneck module in the RepGhost lightweight backbone network.

[0113] Figure 6. Detection results of different algorithms in various typical scenarios.

[0114] Figure 7. Heatmap visualization (red = high activation; blue = low activation).

[0115] Figure 8. Detailed changes in metrics during model training.

[0116] Figure 9. Detailed changes in metrics during model training. Detailed Implementation

[0117] 1. Overview

[0118] This invention proposes an improved model, YOLO-Shrimp, based on the lightweight YOLOv11n architecture and specifically optimized for detecting uneaten feed in shrimp farming. The goal of this invention is to maintain high detection accuracy while meeting the requirements of low deployment costs and real-time processing. By addressing the aforementioned key issues, YOLO-Shrimp provides aquaculture practitioners with decision support capabilities that are difficult or unstable to achieve using traditional manual detection or existing benchmark models. For example, by more accurately quantifying uneaten feed levels, the system can automatically and precisely adjust feeding amounts, thereby avoiding feed waste and reducing production costs. Simultaneously, continuous high-frequency monitoring can detect abnormal feeding behaviors caused by disease or environmental changes earlier than manual observation, gaining valuable time for early warning and intervention.

[0119] The main contributions of this invention are summarized as follows:

[0120] Model structure innovation: A lightweight backbone network based on RepGhost is introduced, which reduces the number of parameters by 19.7% and GFLOPs by 14.6%, while improving mAP@0.5 by 2.80 percentage points, achieving a dual improvement in efficiency and accuracy.

[0121] Attention mechanism design: We propose a parameterless multi-scale attention mechanism, EnSimAM, which integrates global, local and edge responses. Without increasing the computational overhead, it improves mAP@0.5 by 1.27 percentage points, significantly enhancing the feature extraction capability for dense small targets.

[0122] Loss function and optimization strategy: The EnWIoU loss function was designed, and constraints on the shape and orientation of small targets were introduced, which improved mAP@0.5 by 1.05 percentage points, effectively improving the positioning accuracy of irregular bait residues.

[0123] Dataset and Application Validation: The performance of YOLO-Shrimp was validated on a real aquaculture dataset containing 3,461 images, achieving 70.01% mAP@0.5 and 28.01% mAP@0.5:0.95 (2.08M parameters, 5.5 GFLOPs computation), outperforming many advanced lightweight detection models and validating its practical application value.

[0124] 2. Related work

[0125] In recent years, deep learning-based object detection technology has made significant progress. Mainstream methods can generally be divided into two categories: two-stage detectors and single-stage detectors. Typical two-stage detectors, represented by the R-CNN series, first generate candidate regions and then classify and regress these regions. Although such methods typically have high detection accuracy, their computational complexity is high, often making them unsuitable for real-time applications. In contrast, single-stage detectors such as YOLO (YouOnlyLookOnce) and SSD (SingleShotMultiBoxDetector) model object detection as a regression problem, directly predicting bounding boxes and class probabilities from the input image. This achieves a good balance between detection speed and accuracy, making them more suitable for practical engineering scenarios.

[0126] A key challenge in object detection is the accurate localization of small targets. Small targets typically occupy only a few pixels and lack sufficient discriminative feature information, a problem particularly prominent in applications such as industrial defect detection and autonomous driving. To address this, researchers have proposed various improvement strategies. Among them, multi-scale feature fusion (such as Feature Pyramid Networks) has become a standard method for enhancing semantic information at different scales. Data augmentation techniques (including random cropping, rotation, and advanced strategies such as Mosaic) are widely used to increase the diversity of small targets in training data. Furthermore, some studies have introduced Generative Adversarial Networks (GANs) to synthesize additional training samples, particularly suitable for sparse or densely distributed industrial defect scenarios, thereby improving the robustness of the model.

[0127] The YOLO series is a leading representative of single-stage detectors. From YOLOv1 to YOLOv4, the framework has continuously evolved and optimized in terms of backbone network structure, feature fusion strategies, and loss function design. YOLOv5 achieved significant success in engineering practice by providing model versions of various scales, flexibly adapting to diverse application needs. The subsequent releases of YOLOv8 and YOLOv10 further introduced new network structure designs and training strategies, continuously driving improvements in real-time object detection performance. YOLOv9 introduced two key innovations: Programmable Gradient Information (PGI) and Generalized Efficient Layer Aggregation Network (GELAN). PGI alleviates the information bottleneck problem by introducing auxiliary invertible branches to generate reliable gradients, ensuring that the loss function can obtain complete feature information; GELAN, based on the gradient path planning concept, integrates the advantages of CSPNet and ELAN, achieving better parameter utilization and faster inference speed using only conventional convolution operators. The latest YOLOv11 version further introduces modules such as C3k2, SPPF, and C2PSA, achieving significant improvements in feature extraction, multi-scale fusion, and spatial attention modeling, setting a new benchmark for high-precision and high-efficiency detection. However, even these advanced YOLO models still have significant limitations when detecting extremely small and highly dense targets such as shrimp feed residue, highlighting the necessity of specialized optimization for small target detection tasks.

[0128] To achieve efficient deployment of deep learning models on resource-constrained edge devices, lightweight network design has become an important research direction. The MobileNet and ShuffleNet series significantly reduce the number of model parameters and computational cost through techniques such as depthwise separable convolutions, grouped convolutions, and channel shuffling. GhostNet further reduces feature redundancy by generating "ghost feature maps" using low-computation linear transformations. Building on this, RepGhost introduces reparameterization techniques, employing a multi-branch structure during training to enhance representational power, while effectively converting it to a single-path structure during inference. This "training-inference decoupling" design paradigm provides a new approach for building efficient and highly expressive lightweight models.

[0129] Attention mechanisms significantly enhance the feature representation capabilities of neural networks by dynamically focusing on key information regions within the input features. The SE module recalibrates channel feature responses by learning the importance relationships between channels, while CBAM simultaneously introduces channel attention and spatial attention. However, these methods typically introduce additional parameters and computational overhead. SimAM proposes a parameter-free 3D attention mechanism based on neuroscience theory, defining an energy function to measure the importance of each neuron, thereby achieving refined weight allocation of the feature map. Although SimAM is structurally simple and performs well, its bias towards global perception remains insufficient when handling small targets with strong local key information, providing a research space for improving attention mechanisms for small target scenarios.

[0130] Loss functions play a crucial role in the optimization of object detection models. While traditional IoU loss is intuitive, it is prone to gradient vanishing when the predicted bounding box does not overlap with the ground truth bounding box. To overcome this deficiency, researchers have proposed several improved IoU-like loss functions. GIoU penalizes non-overlapping cases by introducing a minimum bounding box; DIoU directly incorporates the normalized distance between the center points of the predicted and ground truth bounding boxes into the loss term to accelerate convergence; and CIoU further considers aspect ratio consistency based on DIoU. However, on datasets with inconsistent annotation quality, these loss functions are easily affected by the gradient dominance of low-quality or high-quality samples, thus impacting the overall learning performance of the model. WIoU, by introducing a dynamic non-monotonic focusing mechanism, adaptively allocates gradient weights based on the "abnormality" of the anchor boxes, reducing the influence of high-quality and low-quality samples and allowing the model to focus more on learning "medium-quality" samples, thereby improving overall generalization ability. This idea provides important insights for further optimization of small target localization accuracy.

[0131] Computer vision technology has shown broad application prospects in the field of intelligent aquaculture, and has been used for tasks such as fish counting, body length measurement, behavior analysis, and disease diagnosis. In feeding management, vision-based feeding behavior and uneaten feed monitoring are gradually gaining attention. Some early studies used traditional image processing methods for uneaten feed detection, but these lack robustness in complex underwater environments. In recent years, deep learning methods have been introduced into uneaten feed identification and counting tasks, including using density estimation networks to perform statistical analysis on densely distributed uneaten feed. Despite some exploration, there is still a lack of efficient, lightweight, and specifically optimized detection models for the specific scenario of "small-sized, high-density" uneaten feed in shrimp feeding trays. Based on this research gap, this invention integrates the latest advancements in object detection, lightweight networks, and attention mechanisms to propose an innovative solution tailored to practical application needs.

[0132] 3. The proposed method

[0133] To address the challenge of detecting small-sized, high-density shrimp feed residue in complex underwater environments, this invention proposes a series of targeted improvements based on the YOLOv11n architecture, constructing a lightweight detection framework—YOLO-Shrimp—that balances high accuracy and computational efficiency. The overall structure of the proposed model is shown in Figure 2.

[0134] The YOLO-Shrimp processing flow is as follows: First, the input image is processed by a lightweight RepGhost backbone network to extract multi-scale features. Then, these features are fed into the neck network, where the proposed EnSimAM attention module is embedded at key locations to enhance the representation of small target features. The fused feature map is further input into the detection head to generate bounding boxes and class predictions for the targets. During the training phase, the difference between the predicted bounding boxes and the ground truth bounding boxes is measured using the EnWIoU loss function designed in this invention, thereby providing more accurate gradient information for model optimization.

[0135] Although both EnSimAM and EnWIoU are integrated into the YOLO framework, their design philosophies differ significantly from existing methods. EnSimAM, through its unique three-branch parallel structure, simultaneously models global neuron importance, local feature variance, and edge information. Unlike SimAM, which relies solely on the global energy function, or attention mechanisms that only focus on channel / spatial dimensions, EnSimAM is specifically designed to meet the multi-characteristic requirements of small, irregular targets. Similarly, EnWIoU is not a simple improvement on CIoU, DIoU, or WIoU, but rather introduces geometric constraints such as orientation consistency and aspect ratio sensitivity, providing more targeted localization supervision for small, slender targets—a feature lacking in existing methods.

[0136] 3.1 EnSimAM Attention Mechanism

[0137] Standard attention mechanisms excel at handling large-scale features, but their global receptive field often struggles to capture crucial local details of small targets occupying only a few pixels. Inspired by the parameterless design of SimAM, this invention proposes an enhanced multi-scale attention mechanism, EnSimAM, whose structure is shown in Figure 3. This mechanism is designed for dense small-target scenes, fusing global context, local details, and edge information to construct a more comprehensive and robust feature representation. Its core idea lies in the parallel modeling and adaptive fusion of three types of attention cues.

[0138] Given an input feature map ,in , , Representing the number of channels, height, and width respectively, EnSimAM constructs three parallel branches: Global Attention, Local Variance Enhancement, and Edge Response Enhancement.

[0139] In the global attention branch, continuing the core idea of ​​SimAM, the importance of each neuron is evaluated by defining an energy function. For the target neuron... Compared with other neurons in the feature map Its energy function is defined as:

[0140]

[0141] Where, in the formula, The weights represent the linear transformation. This represents the bias of the linear transformation. Indicates the neuron currently to be evaluated. The response value in the feature map; Indicates the relationship with neurons The first in the same channel The response value of each neuron. Indicates the total number of neurons within the channel; .

[0142] Minimizing this energy function yields a closed-form solution:

[0143]

[0144] In the formula, The variance representing the channel characteristics. The mean value representing the channel characteristics. Represents the regularization coefficient. express, This represents the characteristic response value of the target neuron;

[0145] The global attention weights are calculated as follows:

[0146]

[0147] In the formula, express function.

[0148] To enhance the feature variations of small targets within local regions, this invention introduces a local variance enhancement branch. Firstly, through... Average pooling calculates local means:

[0149]

[0150] In the formula, The spatial coordinates of the target location in the feature map; Indicates the feature map at location Local variance at; Represents the neighborhood location of the feature map eigenvalues ​​at that location Indicates the spatial offset within the neighborhood; Indicated by The mean of the local neighborhood features centered on the target; Indicates to Normalized average of local neighborhoods;

[0151] in,

[0152] The local attention weight is defined as:

[0153]

[0154] in This is a scaling factor used to adjust the intensity of the local response.

[0155] In the edge response enhancement branch, the approximate Sobel operator is used to calculate the gradients in the horizontal and vertical directions:

[0156]

[0157]

[0158] Edge strength is calculated as follows:

[0159]

[0160] The exported edge attention weights are:

[0161]

[0162] in This is the edge response scaling factor.

[0163] These fusion weights are dynamically calculated based on the energy of the input feature maps themselves, rather than learned parameters, ensuring the mechanism remains parameter-free. These three types of attention are not simply added together, but fused through adaptive weights, where...

[0164] In the formula, express Adaptive weight values, express Adaptive weight values, express Adaptive weight values, Representation of feature map ϵ is a small constant used to prevent division by zero.

[0165] The fusion weights are calculated based on feature intensity, resulting in the final EnSimAM attention:

[0166]

[0167] In the formula, This represents the fusion weight value.

[0168] 3.2 EnWIoU Loss Function

[0169] In small target detection tasks, bounding box regression accuracy is particularly critical. Although WIoU performs excellently when handling samples of varying quality through its dynamic focusing mechanism, in shrimp feed residue detection scenarios, targets are not only small in size but also often exhibit elongated and irregular shapes. To further improve localization accuracy, this invention proposes an enhanced WIoU loss function, denoted as EnWIoU.

[0170] In the basic WIoU framework, let the predicted bounding box be... True bounding box ,in Indicates the center coordinates, , Representing width and height respectively, IoU is defined as:

[0171]

[0172] In the formula, the numerator is the intersection area of ​​the predicted bounding box and the ground truth bounding box; the denominator is the union area of ​​the predicted bounding box and the ground truth bounding box; and IoU represents the degree of overlap between the predicted bounding box and the ground truth bounding box.

[0173] in, These represent the center coordinates of the predicted bounding box. Width, height; These represent the center coordinates of the actual bounding box. Width, height;

[0174] WIoU introduces a dynamic, non-monotonic focusing mechanism by evaluating the anomaly of the anchor frame. The loss weights are adaptively adjusted.

[0175] In this context, the anomaly degree β in the adaptively adjusted loss weight WIoU is used to characterize the geometric deviation of the predicted anchor box from the real target; β in the attention mechanism is a scaling factor for the edge response, used to adjust the influence of the edge gradient on the attention weights.

[0176] .

[0177] in, This represents the weighted intersection-union loss, used to dynamically adjust the anchor frame loss in target detection tasks; This represents the basic intersection-union ratio loss, used to characterize the degree of overlap between the predicted bounding box and the ground truth bounding box; This represents the adaptive weighting coefficient, whose value is dynamically adjusted based on the anomalies such as the anchor frame's positioning deviation and scale matching degree. This represents an intelligent gradient gain allocation strategy, where α and δ are hyperparameters used to control the behavior of loss weight adjustment. The parameter representing the degree of anomaly is calculated based on the anchor frame positioning deviation.

[0178] The degree of abnormality β is defined as:

[0179]

[0180] In the formula, This represents the Euclidean distance between the center point of the predicted bounding box and the center point of the true bounding box. This represents the diagonal length of the smallest bounding box of the two objects;

[0181] in, Indicates the center coordinates of the predicted bounding box; Represents the center coordinates of the actual bounding box; This represents the width and height of the actual bounding box.

[0182] Building upon WIoU, this invention further introduces two geometric constraint factors specifically designed for small target features. This represents the aspect ratio parameter of the predicted bounding box; The aspect ratio parameter representing the actual bounding box; These represent the width and height of the predicted bounding box, respectively. These represent the width and height of the actual bounding box, respectively; , Used to obtain the larger and smaller values ​​of the width and height.

[0183] First, calculate the aspect ratios of the predicted bounding box and the ground truth bounding box, as defined below:

[0184]

[0185] when (in When the threshold is used, the target is judged as a slender small target.

[0186] Subsequently, the following direction consistency indicator function is defined:

[0187]

[0188] in, This indicates the direction consistency indicator; a value of 1 indicates that the predicted bounding box and the true bounding box have the same main direction; a value of 0 indicates that the predicted bounding box and the true bounding box have different main directions.

[0189] This indicator function is used to determine whether the predicted bounding box and the true bounding box are consistent in their principal directions (i.e., both are horizontal or both are vertical). Based on the above two constraints, this invention defines the EnWIoU loss function as follows:

[0190]

[0191] The directional modulation factor γ is defined as:

[0192]

[0193] For enhanced weighted intersection-and-union loss; Based on the intersection and union ratio loss; These are adaptive weighting coefficients based on the degree of anchor frame anomaly. This is the orientation modulation factor, used to adjust the loss weights based on the orientation consistency between the predicted bounding box and the true bounding box; : Directional penalty intensity coefficient, a preset hyperparameter; Constraint operators are used to limit the loss value within a predetermined range to ensure numerical stability.

[0194] in, The directional penalty intensity coefficient is set to 0.1 in the experiments of this invention. When the detected slender targets have a consistent orientation, This will reduce the loss weights; conversely, when the predicted bounding box and the true bounding box are not aligned in the same direction, This will increase the severity of the penalty. Finally, by introducing the clamp function, the loss value is limited to a certain range. To ensure the stability of the training process, as shown in Figure 4, this design not only allows EnWIoU to inherit WIoU's intelligent sensitivity to sample quality, but also further introduces refined constraints on the target's shape and orientation. Therefore, in localization tasks involving small targets, especially irregularly shaped targets, EnWIoU can provide more robust and accurate supervision signals.

[0195] 3.3 RepGhost Lightweight Backbone Network

[0196] To develop a lightweight detection model suitable for edge computing applications, this invention optimizes the YOLOv11n backbone network by introducing the RepGhost module. RepGhost is a highly efficient reparameterization module that employs different network structures during training and inference phases, thereby achieving "lossless" performance acceleration. Its specific structure is shown in Figure 5. The design concept of the RepGhost module is derived from GhostNet.

[0197] Given an input feature map Traditional convolutional layers require the use of Use convolutional kernels to generate Each outputs a feature map. In RepGhost, it first uses... indivual( Convolutional kernels are used to generate intrinsic features. Its calculation form is as follows: in, Indicates the input feature map; This represents the main convolution kernel (main convolution operation). This represents the convolution operation; This represents the intrinsic feature map generated by the main convolution; Indicates the number of output channels of the main convolution; These represent the height and width of the feature map, respectively. Subsequently, a series of computationally inexpensive linear transformations are applied to each intrinsic feature. To generate ghost characteristics, the generation method is defined as follows: Indicates by the first The first intrinsic feature generated by the first One ghost characteristic; Indicates the first An intrinsic feature map; This represents the linear transformation operator used to generate ghost features; The number of channels representing intrinsic characteristics; This represents the total number of channels in the final output feature; This indicates the number of ghost features generated for each intrinsic feature.

[0198] in This indicates the number of ghost features generated from each intrinsic feature.

[0199] Finally, by concatenating all the generated features, the final output feature map of the model is obtained:

[0200]

[0201] This represents the final output feature map; This represents the intrinsic feature map generated by the main convolution; This represents a ghost feature map generated by linear transformation of intrinsic features; This indicates a splicing operation along the channel dimension; This indicates the total number of channels in the output feature map; These represent the height and width of the feature map, respectively. It can be understood that the RepGhost module includes five RG-bneck modules. For each RG-bneck module, its output is ultimately a feature map. The output of the previous module serves as the input to the next module, and this process is passed sequentially layer by layer.

[0202] The input image first passes through Cnov, BN, and ReLU activation functions, and the output feature map enters the first RG-bneck module.

[0203] This method effectively reduces computational complexity from Reduced to in, and These represent the kernel sizes used in the main convolution operation and the linear transformation, respectively. In summary, by combining the main convolution with a low-cost linear transformation, the overall computational complexity is significantly reduced while maintaining the same output feature dimensions.

[0204] 3.4 Overall Algorithm of YOLO-Shrimp

[0205] To clearly illustrate the model's operational flow, Table 1 summarizes the overall training and inference algorithm of YOLO-Shrimp. This algorithm details how the input image is processed step-by-step within the network, and how the custom modules—RepGhost, EnSimAM, and EnWIoU—are integrated and work collaboratively within the YOLOv11n framework.

[0206] Table 1. Training and Inference Process of YOLO-Shrimp

[0207]

[0208] 4. Experiment and Results Analysis

[0209] 4.1 Dataset and Experimental Environment

[0210] The dataset used in this invention comes from a real shrimp farming environment. At a shrimp farming base in Xingshutun, Dalian, researchers used ordinary smartphones to photograph the feeding trays one hour after feeding to obtain images of uneaten feed. This time point was chosen because at this point, some feed had been consumed, and the distribution and morphological characteristics of the uneaten feed were most representative, making it suitable for uneaten feed assessment. The original dataset contains a total of 1,200 images.

[0211] Given the small size, relatively uniform shape, and tendency of uneaten bait particles to agglomerate and densely distribute, this invention performs systematic data preprocessing and enhancement operations on the original data to expand the data scale, improve sample diversity, and prevent model overfitting. Specific enhancement methods include random cropping, rotation, flipping, and adjustments to brightness and contrast. After processing, the final dataset size is expanded to 3,461 images. This dataset realistically reflects many challenges faced in uneaten bait detection tasks, such as the high-density distribution of small particles, size differences, agglomeration, and uneven underwater lighting. The dataset is randomly divided into a training set and a validation set at a 9:1 ratio, with the training set containing 3,115 images and the validation set containing 346 images.

[0212] All experiments were conducted in a unified hardware and software environment to ensure the reproducibility of the results. The specific experimental environment configuration is shown in Table 2. To comprehensively evaluate model performance, this invention employs commonly used evaluation metrics in the field of object detection, including precision (P), recall (R), mean average precision (mAP), number of model parameters, and computational cost (GFLOPs).

[0213] Table 2. Hardware and software configuration

[0214]

[0215] 4.2 Comparative Experiment and Ablation Experiment

[0216] To further verify the superiority of the proposed model, this invention conducted a systematic comparative experiment with YOLO-Shrimp and several advanced object detection algorithms, including other lightweight YOLO series models (YOLOv5n, YOLOv8n, YOLOv10n), traditional detection methods (Faster R-CNN, SSD), and a newer detection architecture (RT-DETR). All comparison models were trained and tested on the same dataset and under consistent experimental settings. The comparison results are summarized in Table 3.

[0217] Experimental results show that the proposed model significantly outperforms traditional detection methods such as SSD and Faster R-CNN in all accuracy metrics, while maintaining a clear advantage in terms of model size and computational complexity, demonstrating a good balance between detection performance and computational efficiency.

[0218] Table 3. Comparison of experimental results, where bold values ​​represent the optimal values.

[0219]

[0220] The above results fully demonstrate the inherent advantages of the YOLO architecture in real-time detection tasks. Compared with another detector designed for real-time applications, RT-DETR, the model of this invention achieves a 27.61 percentage point improvement in mAP@0.5, while the number of parameters and computational cost are only 10.9% and 10.2% of the latter, respectively, demonstrating a significant overall performance advantage. In comparisons with lightweight models of the YOLO series, the method of this invention also consistently demonstrates superior performance. Compared to YOLOv5n, YOLOv8n, and YOLOv10n, the proposed model achieves at least a 5.44 percentage point improvement in mAP@0.5, while also having the lowest number of parameters and GFLOPs among all compared YOLO variants. These results strongly validate the effectiveness of the improvement strategy of this invention.

[0221] It is worth noting that, compared with the baseline model YOLOv11n, the model of this invention not only achieves a comprehensive improvement in detection accuracy, but also successfully reduces model size and computational overhead. This indicates that the method of this invention achieves a more ideal balance between accuracy, speed, and model complexity for the representative and challenging task of bait detection, effectively pushing the performance ceiling of existing methods.

[0222] Table 4. Ablation Experiment (R=RepGhost, E=EnSimAM, U=EnWIoU)

[0223]

[0224] To further analyze the contributions of each improved module, ablation experiments were conducted using YOLOv11n as the baseline model, and the results are shown in Table 4. The baseline model achieved an mAP@0.5 of 65.88% on this dataset. When RepGhost was introduced as the backbone network, the mAP@0.5 increased to 68.68%, an improvement of 2.80 percentage points, while the mAP@0.95 improved by 2.31 percentage points. The number of model parameters and computational cost decreased by 19.7% and 14.6%, respectively, indicating that RepGhost significantly enhanced feature extraction capabilities while reducing complexity.

[0225] Introducing the EnSimAM attention mechanism alone improved the model's mAP@0.5 by 1.27 percentage points, indicating that the proposed multi-scale attention mechanism can effectively guide the model to focus on small target regions such as bait remnants, improving detection performance without introducing additional parameters. When training using only the EnWIoU loss function, the model's mAP@0.5 improved by 1.05 percentage points, validating that the geometric design targeting the shape and orientation constraints of small targets can provide more accurate supervision information for bounding box regression.

[0226] When all three improved modules were introduced, the model achieved optimal performance, with mAP@0.5 and mAP@0.95 reaching 70.01% and 28.01%, respectively, representing improvements of 4.13 and 2.93 percentage points compared to the baseline model. Precision and recall also showed varying degrees of improvement. This indicates that RepGhost, EnSimAM, and EnWIoU created a good synergistic effect at different levels of the model, jointly promoting the improvement of detection performance.

[0227] In addition, to evaluate the effect of data augmentation strategies, ablation experiments were conducted for different augmentation schemes, and the results are shown in Table 5. Without any augmentation strategy, the model's mAP@0.5 was 65.32%. After introducing full data augmentation, this indicator improved to 68.15%. Using only a local augmentation strategy targeting small and dense targets, mAP@0.5 improved to 69.24%, outperforming the general augmentation method. When the two augmentation strategies were used in combination, the model's final mAP@0.5 reached 70.01%, an improvement of 4.69 percentage points compared to the un-augmented model. The results indicate that the combination of general augmentation and targeted augmentation plays a crucial role in improving the detection performance of high-density small targets.

[0228] Table 5. Performance Comparison of Different Enhancement Strategies for YOLO-Shrimp

[0229]

[0230] 4.3 Visualization Analysis Experiment

[0231] To gain a deeper understanding of the model's behavioral characteristics, verify the effectiveness of the proposed improvement method, and reveal the underlying mechanism of performance enhancement, this invention conducted systematic and comprehensive visualization analysis experiments. The visualization results demonstrate the model's detection capabilities, attention mechanism characteristics, training stability, and data distribution features from multiple perspectives, providing strong empirical support for understanding the model's superior performance.

[0232] Figure 6 illustrates the detection results of different algorithms in various typical scenarios. Compared with other methods, the proposed YOLO-Shrimp model (top column) significantly reduces the false negative rate in high-density areas, demonstrating its superior performance under complex real-world conditions. To comprehensively evaluate the robustness of the model, this invention specifically selected several challenging test examples, including high-density and low-density bait distributions, different lighting conditions, and complex background interference. Several significant features can be observed from the detection results: First, in scenarios with extremely dense bait particles, the model can accurately identify most of the sticky and overlapping particles, mainly due to the effective enhancement of local features and edge information by the EnSimAM attention mechanism. Second, for extremely small bait targets, the model can still maintain high localization accuracy, with the predicted bounding box closely matching the actual target, verifying the optimization effect of the EnWIoU loss function in small target detection tasks. Furthermore, under complex environmental conditions such as uneven lighting or turbid water, the model performance only shows a slight decrease, demonstrating good environmental adaptability. It is worth noting that the model also demonstrates high accuracy in determining the orientation of slender bait particles, intuitively reflecting the effectiveness of the orientation consistency constraint in EnWIoU. Overall, the model maintains low false negative and false positive rates across different scenarios, providing intuitive and visual evidence of its robustness and practical application value.

[0233] Figure 7 shows the heatmap visualization (red = high activation; blue = low activation). Compared with the baseline YOLOv11n, the heatmap of the model of this invention shows stronger and more concentrated activation at the boundary of the remaining feed particles, indicating that the EnSimAM module effectively enhances the feature representation of small targets. It can be seen that the model of this invention exhibits a stronger and more concentrated activation response in the boundary region of the uneaten feed particles, indicating that the EnSimAM module can effectively enhance the feature representation ability of small targets. To further understand the working mechanism of YOLO-Shrimp, this invention uses the Grad-CAM method to generate the model attention heatmap, as shown in Figure 7. The comparative analysis results reveal several significant phenomena. The improved model exhibits a more concentrated and precise activation distribution, with the significant region almost completely covering the densely distributed uneaten feed area in the feeding tray, while effectively suppressing irrelevant activations at the edge of the feeding tray, water surface reflections, and other background areas. This indicates that EnSimAM can guide the model to effectively focus computational resources on the target area highly relevant to the task, thereby significantly reducing background interference. Further comparison of the baseline and improved models reveals that the proposed method significantly enhances activation intensity at the edges of small targets. This phenomenon can be directly attributed to the edge response enhancement branch in EnSimAM. Furthermore, when dealing with densely distributed small targets, the improved model better distinguishes adjacent targets and avoids excessive fusion of activation regions. This is attributed to the effective capture of fine-grained features by the local variance enhancement branch. Finally, a clear complementarity can be observed in the activation patterns of different feature levels: shallow features focus more on capturing detailed edge information, while deep features pay more attention to semantic information and global context. This further validates the effectiveness of the multi-scale attention fusion strategy proposed in this invention.

[0234] Figure 8 illustrates the changes in key metrics during training, including total loss, bounding box regression loss, classification loss, and mAP. The training curves show that all loss functions exhibit a smooth downward trend without significant oscillations or instability, indicating that the proposed EnWIoU loss function has good numerical stability. Especially in the early stages of training, the bounding box regression loss decreases faster than the baseline model. This is mainly attributed to EnWIoU introducing more refined constraints on the shape and orientation of small targets, enabling the model to learn effective localization strategies more quickly. The mAP@0.5 metric shows a continuous upward trend on both the training and validation sets, with a consistently small performance gap between them, indicating that the model possesses strong generalization ability without overfitting. Notably, in the later stages of training, the mAP on the validation set continues to gradually increase, demonstrating that the model effectively avoids premature convergence to local optima. Furthermore, the analysis of AP changes at different target scales shows that the performance improvement is most significant for small targets, directly verifying the effectiveness of the directional optimization method for small target detection proposed in this invention.

[0235] Figure 9 illustrates the statistical characteristics of the dataset and the analysis results of the model's predictive performance. Regarding data distribution, this invention systematically statistically analyzed the size, spatial location, and morphological features of the targets. The results show that approximately 85% of the targets in the dataset are small-sized, further validating the objective characteristic that the bait detection task primarily targets small objects. The spatial distribution heatmap shows that the targets are mainly concentrated in the central region of the image, which is consistent with the location of the bait tray in the actual scene, and also reflects the good standardization and consistency of the data acquisition process.

[0236] Regarding morphological distribution, approximately 40% of the targets exhibit elongated features. This statistical result directly prompted the introduction of aspect ratio constraints in the EnWIoU design of this invention. Confusion matrix analysis further reveals the model's classification performance. The results show that the model has high accuracy in identifying residual bait categories, with low false positive and false negative rates, demonstrating excellent overall classification accuracy. Notably, the vast majority of false negative samples originated from targets that were extremely small or severely blurred, rather than from systematic errors in the model. This further validates the robustness of the method in complex scenarios.

[0237] 4.4 Considerations for Practical Deployment and Application

[0238] To bridge the gap between research findings and practical applications, this invention envisions a typical deployment scheme for YOLO-Shrimp in a livestock farm environment. Specifically, a waterproof camera can be installed at a fixed height directly above each feeding tray, equipped with a stable supplemental lighting source to reduce the impact of ambient light variations on image quality. After feeding, images are acquired at a low frequency, for example, every 15–30 minutes. The image processing workflow is deployed on an edge computing device (such as NVIDIA Jetson Orin Nano), sequentially completing steps such as image acquisition, preprocessing, YOLO-Shrimp inference, and post-processing. The final output of the residual feed quantity result will be transmitted to the farm's centralized management system. When the residual feed level exceeds a set threshold, a real-time alarm can be triggered for management personnel, or it can be directly connected to the automated feeding control system to adjust the next round of feeding, thereby optimizing feed utilization.

[0239] Regarding performance on representative edge hardware platforms, although this invention has not yet undergone actual deployment testing, its performance can be reasonably estimated based on the model's computational complexity. YOLO-Shrimp's computational cost is approximately 5.5 GFLOPs. On devices such as the NVIDIA Jetson Orin Nano, designed for AI inference tasks, combined with inference optimization tools like TensorRT, the model is expected to achieve high inference throughput. Considering image acquisition and the entire processing flow, this invention anticipates end-to-end latency to be controlled within 500ms, with inference speeds expected to exceed 50 frames per second. Given that aquaculture feeding adjustments are typically measured on an hourly timescale, this near real-time processing capability is fully capable of meeting the operational needs of precision aquaculture systems, providing timely and actionable data support for management decisions.

[0240] To address the urgent need for automated detection of uneaten feed in intensive shrimp farming, this invention proposes a lightweight, high-precision target detection method, YOLO-Shrimp, based on YOLOv11n. To overcome the challenges of small, densely distributed, and diverse morphologies of uneaten feed particles, this invention systematically optimizes the model structure, attention mechanism, and loss function design. Specifically, a hardware-friendly lightweight backbone network is constructed using the RepGhost module; a multi-scale attention mechanism, EnSimAM, integrating global, local, and edge information, is proposed to enhance the feature extraction capability for small targets; and an enhanced loss function, EnWIoU, incorporating target morphology and orientation constraints, is designed to improve the localization accuracy of small targets. Extensive experimental verification demonstrates superior performance on real-world aquaculture datasets. Compared to the baseline model YOLOv11n and other advanced detection methods, YOLO-Shrimp achieves 70.01% mAP@0.5 while reducing the number of parameters and computational cost to 2.08M and 5.5 GFLOPs, respectively, fully validating the effectiveness of the proposed method.

Claims

1. A target detection method based on the YOLO network, characterized in that, The process includes: inputting an image into the backbone of a YOLO network to obtain multi-scale feature maps, where the target includes shrimp feed residue in an underwater environment image; inputting the multi-scale feature maps into the neck network of the YOLO network, calculating fusion weight values ​​through the EnSimAM attention module of the neck network, and obtaining a fusion feature map based on the fusion weight values; inputting the fusion feature maps into the detection head of the YOLO network to generate target detection results, where the target detection results include the target's bounding box and category prediction; wherein the EnSimAM attention module includes a global attention branch, a local variance enhancement branch, and an edge response enhancement branch; the EnSimAM attention module calculates the fusion weight values ​​based on the following method: the global attention branch calculates the global attention weight; the local variance enhancement branch calculates the local attention weight; the edge response enhancement branch calculates the edge attention weight; adaptive weight values ​​for the global attention weight, local attention weight, and edge attention weight are determined; and based on the adaptive weight values, the fusion weight value for the global attention weight, local attention weight, and edge attention weight is calculated.

2. The target detection method according to claim 1, characterized in that, in, The global attention branch is used to calculate the importance of each neuron in the feature map. Its calculation of global attention weights includes: defining an energy function based on the neurons in the feature map; obtaining a closed-form solution by minimizing the energy function; and calculating the global attention weights based on the closed-form solution. The local variance enhancement branch is used to enhance the feature changes of the target within local regions. Its calculation of local attention weights includes: calculating the local mean based on the local features of the feature map using average pooling; and calculating the local attention weights based on the local mean. The edge response enhancement branch is used to strengthen the edges of the target. Its calculation of edge attention weights includes: calculating the horizontal and vertical gradients of the feature map based on operators; calculating the edge intensity based on the gradients; and calculating the edge attention weights based on the edge intensity.

3. The target detection method according to claim 2, characterized in that, in, For the global attention branch, the input includes feature maps. Among them, the neuron based on the feature map defines the energy function. It is expressed as follows: In the formula, The weights represent the linear transformation. This represents the bias of the linear transformation. Indicates the neuron currently to be evaluated. The response value in the feature map; Indicates the relationship with neurons The first in the same channel The response value of each neuron. This represents the total number of neurons within a channel; where the closed-form solution is obtained by minimizing the energy function. It is expressed as follows: In the formula, The variance representing the channel characteristics. The mean value representing the channel characteristics. Represents the regularization coefficient. The mean value representing the channel characteristics. This represents the feature response value of the target neuron; where the global attention weights are calculated based on the closed-form solution. It is expressed as follows: In the formula, express function.

4. The target detection method according to claim 3, characterized in that, in, For the local variance enhancement branch, the input includes feature maps. Among them, based on local features of the feature map, through Average pooling calculates local mean It is expressed as follows: In the formula, The spatial coordinates of the target location in the feature map; Indicates the feature map at location Local variance at; Represents the neighborhood location of the feature map eigenvalues ​​at that location Indicates the spatial offset within the neighborhood; Indicated by The mean of the local neighborhood features centered on the target; Indicates to The local neighborhood is used for normalized averaging; where, Among them, the local attention weight is calculated based on the local mean. It is expressed as follows: In the formula, This represents the scaling factor that adjusts the intensity of the local response.

5. The target detection method according to claim 4, characterized in that, in, For the edge response enhancement branch, its input includes feature maps. The gradients in the horizontal and vertical directions of the feature map calculated based on the operator are represented as follows: In the formula, Represents the gradient in the horizontal direction. This represents the gradient in the vertical direction; the edge strength is calculated based on the gradient. It is expressed as follows: Among them, edge attention weights are calculated based on edge intensity. It is expressed as follows: In the formula, This represents the edge response scaling factor.

6. The target detection method according to claim 5, characterized in that, in, The adaptive weight values ​​for global attention weights, local attention weights, and edge attention weights are determined as follows: In the formula, express Adaptive weight values, express Adaptive weight values, express Adaptive weight values, Representation of feature map ϵ is a small constant used to prevent division by zero.

7. The target detection method according to claim 6, characterized in that, Based on the adaptive weight values, the fused weight values ​​of global attention weights, local attention weights, and edge attention weights are calculated as follows: In the formula, This represents the fusion weight value.

8. The target detection method according to any one of claims 1-7, characterized in that, in, Multi-scale feature maps are extracted using the RepGhost network in the backbone network; the RepGhost network extracts feature maps based on the following method: for the input feature map ,use Each convolutional kernel generates intrinsic features. , means as follows: In the formula, Representation of feature map ; Indicates the main convolution kernel; This represents the convolution operation; This represents the intrinsic feature map generated by the main convolution; for each intrinsic feature... Apply linear transformation To generate ghost characteristics, as shown below: In the formula, Indicates by the first An intrinsic feature The generated first One ghost characteristic; Indicates the first An intrinsic feature map; This represents the linear transformation operator used to generate ghost features; The number of channels representing intrinsic characteristics; This represents the number of ghost features generated for each intrinsic feature; the output feature map is obtained by concatenating the generated ghost features. : This represents the final output feature map; This represents the intrinsic feature map generated by the main convolution; This represents a ghost feature map generated by linear transformation of intrinsic features; This indicates a splicing operation at the channel dimension.

9. The target detection method according to claim 8, characterized in that, The RepGhost network comprises at least two RG-bneck modules, where the output of the preceding RG-bneck module serves as the input to the following RG-bneck module. For each RG-bneck module, the following steps are performed: a 1×1 pointwise convolution is performed on the input feature map to obtain a first feature map; the first feature map is non-linearly transformed using the ReLU activation function to obtain a second feature map; a depthwise separable convolution is performed on the second feature map to obtain a third feature map; batch normalization is performed on the second feature map to obtain a fourth feature map; and the third and fourth feature maps are then element-wise compared. The fifth feature map is obtained by adding the features; the fifth feature map is then transformed nonlinearly using the ReLU activation function to obtain the sixth feature map; the sixth feature map is then processed by the DS / SE module integrating depthwise separable convolution and channel attention to obtain the seventh feature map; a 1×1 pointwise convolution operation is performed on the seventh feature map to obtain the eighth feature map; a depthwise separable convolution operation is performed on the eighth feature map to obtain the ninth feature map; the eighth feature map is then batch normalized to obtain the tenth feature map; the ninth and tenth feature maps are then element-wise added to obtain the eleventh feature map; and the RG-bneck module outputs the feature map based on the eleventh feature map.

10. The target detection method according to claim 1 or 9, characterized in that, The loss function for model training is EnWIoU; assuming the predicted bounding box is within the basic WIoU framework, the predicted bounding box... True bounding box ,in Indicates the center coordinates, 、 Let these represent the width and height of the box, respectively. The IoU is defined as: in, These represent the center coordinates of the predicted bounding box. Width, height; These represent the center coordinates of the true bounding box. Width, height; assess the degree of anomaly in the anchor frame. Adaptively adjust loss weights; weighted intersection-over-union loss ,in, Indicates the basic intersection-union ratio loss. This indicates a smart gradient gain allocation strategy. and For hyperparameters; degree of anomaly Represented as: In the formula, This represents the Euclidean distance between the center point of the predicted bounding box and the center point of the true bounding box. This represents the diagonal length of the smallest bounding box; the first constraint is the aspect ratio between the predicted bounding box and the ground truth bounding box, expressed as follows: In the formula, Indicates the aspect ratio of the predicted bounding box. Indicates the aspect ratio of the actual bounding box; when ,in The threshold value determines the target as a slender, small target; the second constraint is the orientation consistency indicator function. It is expressed as follows: This indicator function is used to determine whether the predicted bounding box and the true bounding box are consistent whether they are both horizontal or both vertical; based on the first and second constraints, the loss function EnWIoU is defined as follows: Among them, the direction modulation factor Represented as: In the formula, This represents the directional penalty intensity coefficient; when the predicted bounding box of a detected elongated small target is consistent with the ground truth bounding box in the same direction. Reduce loss weights; when the predicted bounding box and the true bounding box are inconsistent in direction, Increase the severity of punishment.