A method and system for rapid detection of diseased fish
Patent Information
- Application Number
- CN202610767353.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-09-25
AI Technical Summary
这种方法主观性强,且耗时耗力
该系统和方法可以快速准确识别鱼类病害,实现数据可视化,便于水产养殖公司实时监测鱼类健康状况,及时发现病害,并进行相应防治,避免经济损失,为智能化水产养殖提供了技术支持。
Smart Images

Figure CN122821585A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automatic detection technology for diseased fish, specifically a method and system for rapid detection of diseased fish. Background Technology
[0002] Traditional methods of fish disease detection mainly rely on visual inspection by aquaculture workers. This involves observing the fish's head, mouth, eyes, gill covers, scales, and fins to determine its health. This method is highly subjective and time-consuming. Especially in high-density aquaculture, as the number of fish increases, overlapping and obscuring of each other during movement become severe, making manual observation unreliable and easily missing the optimal treatment window.
[0003] With the continuous development of computer vision and artificial intelligence technologies, machine learning and deep learning-based methods are increasingly being applied to fish disease detection. However, existing methods have certain limitations. Firstly, in recirculating aquaculture systems, high fish density and fast swimming speeds can cause overlapping and occlusion. Secondly, complex water surface environments can also interfere with the accuracy and speed of detection models. Thirdly, existing deep learning-based detection models suffer from large parameter counts and high redundancy, making them unsuitable for mobile deployment. To address these issues, we have built a data acquisition platform and proposed a rapid detection method for largemouth bass surface diseases based on FCL-YOLOv12n, which can be used for automatic, accurate, and rapid detection of skin ulceration and tail rot. Summary of the Invention
[0004] To address the shortcomings of existing technologies, the present invention aims to provide a rapid detection method and system for diseased fish. Compared to traditional observation methods used by aquaculture personnel, the method and system proposed in this invention have significant advantages. First, it acquires real-time image data of diseased fish using a camera and performs automatic detection using algorithms, making it a non-destructive detection method. Second, this method is fast, accurate, and real-time, enabling timely detection of diseased fish and providing a guarantee for timely subsequent treatment, thus providing technical support for intelligent aquaculture.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A rapid detection system for diseased fish, characterized in that the system is an improved FCL-YOLOv12n model, the improvement including: replacing the multilayer perceptron (MLP) in YOLOv12n with a freeform perceptron (FRFP), using Converse2D to improve the neck network in YOLOv12n, and using LAMP for pruning the YOLOv12n model. Specifically: (1) To address the challenges posed by the complex underwater environment, significant variations in light intensity and color, and the continuous movement of fish causing severe occlusion of diseased areas and large changes in fish size, this study replaced the multilayer perceptual layer (MLP) in the ABlock module of the A2C2F module with a feature-refinement feedforward network (FRFP). Figure 1 As shown. FRFP is a feedforward network structure for feature refinement. By introducing partially convolutional Pconv modules, it enhances the feature information of diseased areas in fish images, improving the model's ability to extract small targets and detailed features of diseased fish. A gate mechanism is used to reduce the burden on the fish disease model for processing redundant information such as the complex underwater environment. The calculation formula is as follows: ; ; ; ; in, For the input feature vector, and Represents linear projection. The intermediate feature vector; This refers to channel-by-channel slicing. and The resulting vector; and These represent the reshape and flatten operations, respectively, used to convert sequence input into two-dimensional feature maps; and These refer to partial convolution and depthwise convolution, respectively. Represents matrix multiplication of v. The characteristics of the result after gating fusion For activation function, This is the final output.
[0006] (2) In target detection algorithms, the upsampling module plays an important role in feature fusion and multi-scale feature extraction. Fish diseases exhibit significant variations in the morphology, color, and texture of the affected areas, and the distribution of lesions across the fish body is uneven. This makes it difficult for the model to accurately identify the feature boundaries of the affected areas in fish disease identification tasks. We propose the Converse2D algorithm to improve the neck network in YOLOv12n. The core idea of using Converse2D to improve upsampling in the Neck is to utilize its mathematical inverse operation to replace the traditional transpose convolution or interpolation operation, thereby reducing artifacts and improving detail restoration during feature reconstruction, thus better capturing the detailed information of fish disease targets.
[0007] For a certain position on the output feature map The pixel value is obtained by multiplying the corresponding window of the input feature map element-wise with the convolution kernel, summing the results, and then adding the bias, as shown in the following formula: ; In the formula, For output feature map The pixel value of the location; On the input feature map, within the corresponding convolution kernel window The pixel value of the location; On the convolution kernel The weight value of the location; This is a bias term.
[0008] (3) Traditional amplitude pruning typically removes the weight with the smallest absolute value from the entire model. However, this leads to a problem: the weight distribution varies greatly between different layers (some layers have relatively small weight values, while others have relatively large ones). If a uniform global threshold is used, some layers' weights may be over-pruned, causing damage to the network structure. LAMP improves upon this by introducing a hierarchical scoring mechanism, performing normalized comparisons within each layer. It does not directly compare the absolute values of weights in different layers, but instead uses a "layer adaptive threshold" to determine which connections to prune. LAMP defines a scoring metric to determine which weights to prune. For weights within a certain layer... Its scoring formula (Formula 6) is usually based on the squared cumulative distribution of the weights within that layer.
[0009] ; In the formula, For the single weight value currently being evaluated, The set of all weights within the current layer. for Any weight in the layer, For weight The LAMP importance score ranges from 0 to 1.
[0010] Compared to other pruning methods (such as those requiring setting global or layer-by-layer sparsity), LAMP pruning only requires specifying a global target sparsity, and the algorithm automatically allocates the pruning ratio for each layer. Furthermore, LAMP pruning better preserves the knowledge distribution in the pre-trained model, preventing layers with low amplitude but high information density from being over-pruned. Because the pruned model retains its unstructured sparse pattern, it can accelerate the model on certain hardware that supports sparse computation (such as the sparsity features of the NVIDIA A100).
[0011] A rapid detection method for diseased fish, characterized by comprising the following steps: Step 1: Collect and label images of healthy and diseased fish to construct a diseased fish detection dataset; Step 2: Process the diseased fish detection dataset obtained in Step 1 using the improved FCL-YOLOv12n model and output the diseased fish detection results.
[0012] A storage medium, characterized in that the storage medium stores computer-executable instructions, which, when invoked by a computer, enable the computer to implement the aforementioned rapid detection method for diseased fish.
[0013] An electronic device is characterized by comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the aforementioned rapid detection method for diseased fish.
[0014] The rapid detection method and system for diseased fish described in this invention have the following beneficial effects: This system and method can quickly and accurately identify fish diseases, realize data visualization, and facilitate aquaculture companies to monitor the health status of fish in real time, detect diseases in a timely manner, and carry out corresponding prevention and control to avoid economic losses, thus providing technical support for intelligent aquaculture. Attached Figure Description
[0015] The present invention includes the following figures: Figure 1 Improve the ABlock structure using the FPFR module.
[0016] Figure 2 Comparison diagram of Converse2D module structure.
[0017] Figure 3 FCL-YOLOv12n detection results for healthy and diseased fish in different scenarios (under different lighting conditions): (a) fish bodies occlude each other, (b) small target diseased fish, (c) severe water surface reflection. Detailed Implementation
[0018] The present invention will be further described in detail below with reference to the accompanying drawings.
[0019] Step 1: Dataset Preparation and Online Data Augmentation Training A total of 3000 images of healthy and diseased largemouth bass were collected. Bounding boxes were annotated using LabelImg, generating YOLO format annotation files. Online data augmentation was employed to generate diverse data samples in real-time during training. Step 2: Model Improvement and Training While YOLOv12n achieves a good balance between speed and accuracy, it still requires targeted optimization when handling scenarios with numerous tiny targets and fine-grained features, such as diseased fish. This can be addressed by replacing the multilayer perceptron (MLP) with a FRFP, improving the neck network in YOLOv12n using Converse2D, and pruning the YOLOv12n model using LAMP.
[0020] Step 3: GUI Deployment and Real-time Testing To be implemented in actual aquaculture environments, a software system with a graphical user interface (GUI) was developed and packaged into a practical toolkit with a PyQt interface, making it convenient for aquaculture personnel to monitor the health of fish in real time.
[0021] Table 1 Comparative Experiments ; The contents not described in detail in this specification are existing technologies known to those skilled in the art.
Claims
1. A rapid detection system for diseased fish, characterized in that, The system is an improved FCL-YOLOv12n model. The improvements include: replacing the multilayer perceptron (MLP) in YOLOv12n with FRFP, using Converse2D to improve the neck network in YOLOv12n, and using LAMP to prune the YOLOv12n model.
2. The rapid detection system for diseased fish as described in claim 1, characterized in that: The FRFP introduces a partially convolutional Pconv module to enhance the feature information of fish lesion areas in the image, and reduces the processing burden of redundant information by the fish disease model through a gating mechanism. Specifically: ; ; ; ; in, For the input feature vector, and Represents linear projection. This is the intermediate feature vector; This refers to channel-by-channel slicing. and The resulting vector; and These represent the reshape and flatten operations, respectively, used to convert sequence input into two-dimensional feature maps; and These refer to partial convolution and depthwise convolution, respectively. Represents matrix multiplication of v. The characteristics of the result after gating fusion For activation function, This is the final output.
3. The rapid detection system for diseased fish as described in claim 1, characterized in that: The Converse2D algorithm identifies the feature boundaries of lesion areas in fish bodies according to the following formula: ; In the formula, For output feature map The pixel value of the location; On the input feature map, within the corresponding convolution kernel window The pixel value of the location; On the convolution kernel The weight value of the location; This is a bias term.
4. The rapid detection system for diseased fish as described in claim 1, characterized in that: The LAMP pruning treatment scoring formula is shown below: ; In the formula, For the single weight value currently being evaluated, The set of all weights within the current layer. for Any weight in the layer, For weight The LAMP importance score ranges from 0 to 1.
5. A method for rapid detection of diseased fish using the system described in claim 1, characterized in that, Includes the following steps: Step 1: Collect and label images of healthy and diseased fish to construct a diseased fish detection dataset; Step 2: Process the diseased fish detection dataset obtained in Step 1 using the improved FCL-YOLOv12n model, and output the diseased fish detection results.
6. A storage medium, characterized in that, The storage medium stores computer-executable instructions, which, when invoked by a computer, enable the computer to implement the rapid detection method for diseased fish as described in claim 5.
7. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the rapid detection method for diseased fish as described in claim 5.