Fish parasite identification method and system

Through the CLAHE algorithm and ResNet50 convolutional neural network combined with CBAM module, the problem of poor complex background recognition in fish parasite detection is solved, efficient and accurate automated detection is achieved, and the error detection rate and cost is reduced. It is suitable for real-time detection in aquaculture workshops.

CN120299067APending Publication Date: 2025-07-11广州南沙智汇农业科技有限公司

Patent Information

Application Number
CN202510434419.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-07-11

Smart Images

  • Figure CN120299067A_ABST
    Figure CN120299067A_ABST
Patent Text Reader

Abstract

The invention relates to a fish parasite identification method and system, and the method comprises the steps: S1, collecting images: collecting images under a slice microscope, and making an image set; s2, preprocessing the image to construct a data set: labeling a target in the image, the labeled target being a fish parasite in the image, and a label being a parasite category name; dividing a training set, a test set and a verification set; s3, establishing a parasite recognition model: based on a ResNet50 convolutional neural network architecture, establishing an initial model of parasite image recognition, embedding a CBAM module in the initial model, designing a feature pyramid network and setting Anchor size adaptation, then setting super data of the initial model, and training the initial model by using data in a training set; s4, sequentially evaluating the model by using the test set and the verification set to obtain a parasite recognition model; and S5, inputting the fish slice image acquired in real time into the parasite recognition model, and outputting a parasite image and a corresponding parasite category name in the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of aquaculture disease detection, and particularly relates to a method and system for identifying fish parasites. Background Art

[0002] In aquaculture, the management of aquaculture diseases is an important part. At present, the detection of fish parasites generally relies on manual microscopic examination, that is, after taking fish tissue for pressing slices or centrifuging digestive fluid, observing the morphology of eggs or larvae under a microscope to judge the disease situation.

[0003] However, manual microscopic examination requires a high level of professionalism from the inspectors, who need to have a high level of knowledge related to parasites and certain experience. The professional capabilities of the inspectors vary, and it is easy to miss detections and make misdiagnoses. Moreover, it has the disadvantages of low efficiency and high labor costs.

[0004] Although some automated parasite recognition solutions based on image processing have emerged, these existing solutions have certain technical limitations. For example, in fish tissue section images, there are complex backgrounds such as fat granules and blood vessel textures. It is difficult for existing solutions to accurately identify and judge these section images with complex backgrounds, especially the complex backgrounds of unstained fish tissue sections have poor robustness, and the false positive rate is greater than 20%.

[0005] Moreover, there may be parasites of different species with large differences in volume and size in the same image. Inaccurate scaling during the parasite target recognition process also has a certain impact on the accurate identification of parasites. Summary of the Invention

[0006] Based on this, it is necessary to provide a method and system for identifying fish parasites.

[0007] An embodiment of the present invention provides a method for identifying fish parasites, including the following steps:

[0008] S1. Image acquisition: Acquire images of the slices under a microscope and form an image set;

[0009] S2. Image preprocessing to construct a data set: Use the CLAHE algorithm to enhance the low-contrast images in the image set, and combine top-hat transformation to suppress the uniform background in the images; convert to the LAB color space, and use the brightness and color difference channels to separate the target and background in the images; the target is fish parasites;

[0010] Label annotation of image data: Screen the images in the image set, keep the qualified images, and label the targets in the qualified images. The labeled targets are the fish parasites in the images, and the labels are the names of parasite categories;

[0011] Divide the image dataset: divide it into a training set, a test set, and a validation set;

[0012] Perform parasite image data augmentation: use an augmentation strategy to perform data augmentation on the images in the training set;

[0013] S3. Establish a parasite recognition model: based on the ResNet50 convolutional neural network architecture, establish an initial model for parasite image recognition, embed a CBAM module in the initial model, and design a feature pyramid network to adapt to the Anchor size setting. Then, set the hyperparameters of the initial model, and use the data in the training set to train the initial model to obtain a first intermediate model;

[0014] S4. Model evaluation: use the test set to evaluate the trained first intermediate model to obtain a trained second intermediate model; use the validation set to evaluate the second intermediate model to obtain a parasite recognition model;

[0015] S5. Implement automated detection to identify parasites in the image: input the fish slice images collected in real time into the parasite recognition model, and output the parasite images and the corresponding parasite category names in the images.

[0016] Preferably, in step S1, the slice is an unstained fish meat slice, the resolution of the image under the microscope is 2592×1944, the image set forms a parasite database, the pictures in the parasite database cover common parasites in fish meat, and the number of pictures in the parasite database is more than 20,000.

[0017] Preferably, in step S2, screening the images includes removing the unqualified images in the image set that do not meet the image screening criteria, and only retaining the qualified images that meet the standards; the specific method for image screening is as follows:

[0018] Use the Laplacian variance algorithm to calculate the image sharpness, and remove the blurred images with a variance <50; manually sample 10% of the samples and remove the invalid data with large-area bubbles and knife mark contamination to obtain qualified images that meet the standards;

[0019] The specific method for data label annotation is: multiple aquaculture pathology experts cross-annotate the category names of parasites in the images. For targets with complete morphology and a gray level difference ≥5, the target species are annotated. For targets with blurred boundaries, multiple aquaculture pathology experts use the majority voting method to determine the annotation of the targets;

[0020] The dataset is divided by stratified sampling according to the types of parasites, so that the division ratio of the training set, the test set, and the validation set is 7:2:1.

[0021] Preferably, in step S2, the enhancement strategies include random rotation, local occlusion, simulated light fluctuations, and Gaussian noise; any one or more of the above enhancement strategies are executed on any image in the training set; the test set and the validation set are normalized, and the parameters for the normalization are: mean of L channel = 50, standard deviation = 25; mean of A / B channels = 0, standard deviation = 64.

[0022] Preferably, in step S3, a double-queue asynchronous data loading is used, and the preprocessed data is stored in a cache pool to reduce the latency in the input and output processes.

[0023] Preferably, in step S4, adversarial training is further included in the model training phase. The specific method of the adversarial training is: by generating adversarial samples, the generated adversarial samples are mixed into the training set at a ratio of 1:1, so as to force the model to learn to distinguish parasites from similar structures.

[0024] Preferably, the method for generating the adversarial samples is:

[0025] Based on StyleGAN2, synthetic images are generated, and the interfering objects in the complex background of the synthetic images that will interfere with image recognition are simulated. The similarity of the fish meat texture is controlled by adjusting the generator parameters. The interfering objects include muscle fibers and fat particles;

[0026] Any image processing method including Gaussian noise or morphological dilation is used to locally modify the original parasite image, so as to generate negative samples.

[0027] Preferably, in step S4, the monitoring metrics for model training are the sensitivity of the validation set and the loss value of the validation set;

[0028] The early stopping condition for the monitoring metrics is that the validation set loss has not decreased for 15 consecutive Epochs, or the sensitivity fluctuation range < 0.2%; the model for the monitoring metrics is saved as the model weight with the highest F1-Score on the validation set.

[0029] Preferably, in step S5, post-processing optimization is further included. The specific method of the post-processing optimization includes: based on the morphological rules of parasites, filtering out false positive targets, outputting the filtered parasite targets, and verifying through multi-scale sliding windows to improve the stability of the detection results.

[0030] The present invention also provides a fish parasite automatic recognition system, which includes a database, a data acquisition module, a data processing module, a model establishment module, a model evaluation module, and an image recognition module. The data acquisition module includes a microscope and a camera, and the camera is a USB camera.

[0031] The present invention provides a method for identifying microorganisms based on computer vision. The fish slice pattern collected in real time is input into the recognition model, which can automatically and quickly identify and output the parasite image and the corresponding parasite category name in the image. The detection time for a single sample using this method does not exceed 30 seconds, while the detection time for a single sample by manual inspection is 5 - 10 minutes, and the efficiency is increased by more than 10 times, solving the problems of low efficiency, high cost, and dependence on the experience of technicians in traditional manual microscopy inspection;

[0032] The sensitivity of this method for detection is ≥98.2%, the accuracy rate is relatively high, which improves the detection accuracy rate, and the consistency of the detection results is relatively strong. There is no need for staining, and the hardware costs such as reagents are low, having a cost advantage; it realizes fast and automated detection without staining pretreatment, adapting to the real-time requirements of the breeding workshop. Under the condition of light fluctuation of ±30%, the performance degradation is <3%, with strong robustness, which can reduce the false detection rate caused by complex background interference and adapt to the complex environment of the breeding workshop. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The above and other objects, features, and advantages of the present invention will become more clear through the preferred embodiments of the present invention shown in the drawings. The same reference numerals in all the drawings indicate the same parts, and the drawings are not deliberately drawn to scale in actual size, with the emphasis on showing the gist of the present invention.

[0034] Figure 1 is the flowchart of the method of the embodiment of the present invention;

[0035] Figure 2 is the original image collected under the microscope of the unstained fish meat slice of the preferred embodiment of the present invention;

[0036] Figure 3 is the parasite image of the detection result visualization output by the recognition of the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0037] The technical solution of the present invention will be further described in detail below with reference to the drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the embodiments cited do not limit the present invention.

[0038] As Figures 1 - 3 shown, a method for identifying fish parasites includes the following steps:

[0039] S1. Collect images: Collect the images under the microscope of the slices and make them into an image set; specifically, collect the images of the unstained fish meat slices under the microscope;

[0040] S2. Image preprocessing to construct a dataset: The CLAHE algorithm is used to enhance the low-contrast images in the image set, and the top-hat transform is combined to suppress the uniform background in the images; convert to the LAB color space, and use the brightness and color difference channels to separate the objects and backgrounds in the images; the object is a fish parasite.

[0041] Label the image data: Label the objects in the qualified images. The labeled object is the fish parasite in the image, and the label is the name of the parasite category.

[0042] Divide the image dataset: Divide it into a training set, a test set, and a validation set.

[0043] Perform parasite image data augmentation: Use an augmentation strategy to augment the images in the training set.

[0044] S3. Establish a parasite recognition model: Based on the ResNet50 convolutional neural network architecture, establish an initial model for parasite image recognition. Embed the CBAM module in the initial model, and design a Feature Pyramid Network (FPN) to adapt to the Anchor size. Then, set the hyperparameters of the initial model, and use the data in the training set to train the initial model to obtain a first intermediate model.

[0045] S4. Model evaluation: Use the test set to evaluate the trained first intermediate model to obtain a trained second intermediate model; use the validation set to evaluate the second intermediate model to obtain a parasite recognition model.

[0046] S5. Implement automated detection to identify parasites in images: Input the real-time collected fish slice images into the parasite recognition model, output the parasite images and the corresponding parasite category names in the images, and the detection results are visualized.

[0047] First, prepare standard biological specimen slices, collect images using a microscope, and label the collected image data; then, preprocess and augment the labeled data; further, use the processed data to train and optimize the established model, verify and deploy the trained and optimized model, finally obtain a parasite recognition model. Finally, input the real-time collected fish slice images into the parasite recognition model, and the parasite recognition model performs automated detection and analysis, outputs the parasite images and the corresponding parasite category names in the images, and the detection results are visualized.

[0048] Preferably, the backbone network for training the model adopts the ResNet-50 structure, which includes the following stages:

[0049] Stage1: 1 7×7 convolution (stride = 2), with 64 output channels, followed by 3×3 max pooling (stride = 2), output size 256×256×64;

[0050] Stage2: 3 residual blocks (Bottleneck structure), with 256 output channels, output size 128×128×256;

[0051] Stage3: 4 residual blocks, with 512 output channels, output size 64×64×512 (embedded with CBAM attention module);

[0052] Stage4: 6 residual blocks, with 1024 output channels, output size 32×32×1024 (embedded with CBAM attention module);

[0053] Stage5: 3 residual blocks, with 2048 output channels, output size 16×16×2048.

[0054] Preferably, the CBAM module is added to the ResNet-50 structure, specifically:

[0055] After each residual block in Stage3 and Stage4, channel attention and spatial attention are concatenated in series, and the formula is as follows:

[0056] Channel attention: M c (F) = σ(MLP(AvgPool(F)) + MLP(MaxPool(F)))

[0057] Spatial attention: M s (F) = σ(f 7×7 ([AvgPool(F); MaxPool(F)]))

[0058] Output feature map:

[0059] In the above formula, F is the input feature map, and the shape of the input feature map is C×H×W, where: C is the number of channels (Channel), H is the height of the feature map (Height), and W is the width of the feature map (Width);

[0060] AvgPool(F) is the global average pooling operation, which compresses the feature map of each channel into a vector of C×1×1;

[0061] MaxPool(F) is the global max pooling operation, and the output shape is the same as AvgPool(F);

[0062] The MLP is a Multi-Layer Perceptron, and its structure is as follows:

[0063] Input layer: C neurons;

[0064] Hidden layer: C / r neurons (r is the compression ratio, usually taken as 16);

[0065] Output layer: C neurons, and the activation functions are ReLU and Sigmoid (only for the last layer).

[0066] σ is the Sigmoid function, which normalizes the output to 0, 1, representing the weight coefficients of each channel;

[0067] F′ is the feature map after channel attention weighting, and its shape is still C×H×W;

[0068] F″ is the final feature map after spatial attention weighting, with the shape C×H×W.

[0069] Preferably, design a Feature Pyramid Network (FPN), specifically:

[0070] Input multi-scale feature maps (from Stage3 to Stage5), and unify the number of channels to 256 through 1×1 convolution;

[0071] Top-down path: Upsample the high-dimensional features through bilinear interpolation and add them to the lower-layer features;

[0072] Output feature map size:

[0073] P3: 64×64×256;

[0074] P4: 32×32×256;

[0075] P5: 16×16×256.

[0076] Preferably, the Detection Head, specifically:

[0077] Each FPN output layer is connected to a 3×3 convolution (output channels 256), followed by a classification branch (1×1 convolution, outputting class probabilities) and a regression branch (1×1 convolution, outputting bounding box coordinate offsets);

[0078] Anchor setting, specifically: According to the parasite size distribution, set 4 ratios (1:1, 1:2, 2:1, 1:3) and 3 scales (8×8, 16×16, 32×32), with a total of 12 Anchors per pixel.

[0079] Preferably, the input and preprocessing of the training model are as follows: Image size: uniformly scaled to 512×512 pixels, and normalized in the LAB color space (L channel range [0,100], A / B channel range [-128,127]). Normalization parameters: L channel mean = 50, standard deviation = 25; A / B channel mean = 0, standard deviation = 64.

[0080] Preferably, the hyperparameter settings are as follows: Optimizer: Adam (beta1 = 0.9, beta2 = 0.999, epsilon = 1e-8). Learning rate strategy: Initial learning rate 0.001, Cosine annealing period is 50 Epochs.

[0081] Loss function:

[0082] Focal Loss (classification task, α = 0.25, γ = 2): FL(pt) = -α(-pt) γ log(pt)

[0083] CloU Loss (regression task):

[0084] where

[0085] where pt represents the probability predicted by the model, that is, the probability of predicting a positive sample;

[0086] α is the weight used to balance positive and negative samples, usually used to solve the class imbalance problem;

[0087] γ is the focus parameter for adjusting easy and hard samples, and the larger the value, the greater the penalty for hard samples;

[0088] IoU represents the Intersection over Union, which is used to measure the overlap degree between the predicted box and the ground truth box;

[0089] ρ 2 (b, bgt) represents the square of the Euclidean distance between the center points of the predicted box b and the ground truth box b gt ;

[0090] υ represents the term related to the angle, which is used to measure the direction difference between the predicted box and the ground truth box, w gt and h gt are the width and height of the ground truth box, and w and h are the width and height of the predicted box;

[0091] Batch Size: 16.

[0092] In a preferred embodiment, in step S1, the standard biological specimen section is an unstained fish slice; the image set of the collected images forms a parasite database. The data source of the data set is: 400× microscope captured images of unstained fish slices (resolution 2592×1944), covering a variety of common parasites (such as Ichthyophthirius multifiliis, Dactylogyrus), with a total of 20,000 original images. In this way, the resolution of the pictures in the parasite database is 2592×1944, and the pictures in the parasite database cover common fish parasites and the number is not less than 20,000.

[0093] In a preferred embodiment, in step S2, screening the images includes eliminating the unqualified images in the image set and only retaining the qualified images that meet the standards; the criteria for image screening, that is, the cleaning rules of the data set are: using the Laplacian variance algorithm to calculate the image sharpness, and eliminating the blurred images with a variance <50; manually sampling 10% of the samples and eliminating the invalid data containing large-area bubbles and knife mark contamination to obtain the qualified images that meet the standards.

[0094] The specific method for data label annotation is: multiple aquatic pathology experts use the annotation tool LabelStudio to cross-annotate the category names of parasites in the images.

[0095] The annotation criteria are: only annotate the targets with complete morphology and a gray-scale difference ≥5.

[0096] For the parasite targets with blurred boundaries, the majority voting method is used to determine the final annotation.

[0097] The data set is divided by stratified sampling according to the types of parasites, so that the division ratio of the training set, test set, and validation set is 7:2:1.

[0098] In a preferred embodiment, in step S2, the enhancement strategies include random rotation, local occlusion, simulated light fluctuation, and Gaussian noise; any one or more of the above enhancement strategies are executed on the training set, where random rotation (±30°), local occlusion (maximum occlusion area 20%), simulated light fluctuation (brightness change ±25%); the test set and validation set are normalized, and the normalization parameters are: mean of L channel = 50, standard deviation = 25; mean of A / B channels = 0, standard deviation = 64. Random rotation means rotating the image in a clockwise or counterclockwise manner, and the rotation direction is randomly specified, with an angle of 30° for each rotation; local occlusion means performing local occlusion processing on the image, and the occlusion area does not exceed 20% of the total area of the image; simulated light fluctuation is achieved by adjusting the brightness of the image, dimming the image or brightening the image, and the brightness change does not exceed 25% of the initial brightness.

[0099] In a preferred embodiment, in step S3, a double-queue asynchronous data loading is used, and the preprocessed data is stored in a cache pool, thereby reducing the I / O latency and achieving a reduction in the latency during the input and output processes.

[0100] In a preferred embodiment, in step S4, adversarial training is added during the model training phase;

[0101] The adversarial training is specifically as follows: by generating adversarial samples, the generated adversarial samples are mixed into the training set at a ratio of 1:1, thereby forcing the model to learn to distinguish parasites from similar structures; among them, the learning rate is separately set to 0.0001 during the adversarial training phase to avoid damaging the feature extraction ability of the backbone network.

[0102] In a preferred embodiment, the steps for generating the adversarial samples are as follows: based on StyleGAN2, synthetic images are generated to simulate the interference objects in a complex background, and the texture similarity is controlled by adjusting the generator parameters; among them, the interference objects are substances such as muscle fibers and fat particles that will interfere with image recognition. Traditional image processing methods such as Gaussian noise and morphological dilation are used to locally modify the original parasite image to generate negative samples.

[0103] In a preferred embodiment, in step S4, the monitoring metrics for model training are the sensitivity of the validation set and the loss value of the validation set; early stopping condition: the validation set loss has not decreased for 15 consecutive Epochs, or the sensitivity fluctuation range < 0.2%; model saving: save the model weights with the highest F1-Score on the validation set.

[0104] In a preferred embodiment, in step S5, post-processing optimization is further included, and the post-processing optimization includes the following steps: based on the morphological rules of parasites, false positive targets are filtered, and the filtered targets are output; through multi-scale sliding window verification, the stability of detection is improved.

[0105] 1. The process of model training:

[0106] Data input and augmentation:

[0107] 1.1 Data Augmentation Strategies: The augmentation strategies include random rotation, local occlusion, lighting fluctuation, and Gaussian noise. Among them, (1) Random Rotation Augmentation Strategy: The angle range is ±30°, that is, the picture is rotated clockwise or counterclockwise by 30°. The probability that any input picture is executed with the random rotation augmentation strategy is 80%. (2) Local Occlusion Augmentation Strategy: Use a random rectangular mask. The maximum occlusion area ratio of the random rectangle to the picture does not exceed 20%. The probability that this strategy is executed is 50%. (3) Lighting Fluctuation Augmentation Strategy: The brightness adjustment range of the picture is ±25% (that is, the brightness of the picture is brightened by 25%, or the brightness of the picture is dimmed by 25%), and the contrast adjustment range is ±15%. The execution probability is 70%. (4) Gaussian Noise Augmentation Strategy: Add noise with a standard deviation of 0.02. The probability that it is executed is 30%.

[0108] 1.2 Data Loading: Use dual-queue asynchronous loading (4 threads). After preprocessing, the data is stored in the cache pool to reduce I / O latency, that is, input / output latency.

[0109] 1.3 Forward Propagation and Loss Calculation: Each Batch inputs 16 enhanced images, which pass through the backbone network, FPN, and detection head in sequence. Positive and negative sample matching: Adopt the IoU threshold (positive sample ≥ 0.5, negative sample ≤ 0.4), and each Anchor is assigned to the closest GT box. Loss calculation: Total loss = classification Focal Loss (weight 1.0) + regression CIoU Loss (weight 0.5).

[0110] 1.4 Backward Propagation and Parameter Update:

[0111] Gradient Clipping: Set the maximum gradient norm to 5.0 to prevent gradient explosion;

[0112] Parameter Update Frequency: Update once every 10 Batches. The cumulative gradient strategy improves the stability of small Batch training;

[0113] Learning Rate Adjustment: Update according to the Cosine annealing formula after each Epoch:

[0114]

[0115] where, η max = 0.001, η min = 0.0001, T max = 50.

[0116] where, η t is the learning rate at the current time step, η min is the minimum value of the learning rate, η max is the maximum value of the learning rate, T cur is the current number of Epochs, Tmax is the total number of Epochs;

[0117] Fix T max = 50 means that a complete cosine annealing cycle is completed every 50 Epochs.

[0118] 1.5 Training Monitoring and Early Stopping

[0119] Monitoring Metrics: Validation set sensitivity (Recall) and loss value;

[0120] Early Stopping Condition: The validation set loss has not decreased for 15 consecutive Epochs, or the sensitivity fluctuation range < 0.2%;

[0121] Model Saving: Save the model weights with the highest F1-Score on the validation set.

[0122] 1.6 Adversarial Training

[0123] (1) Adversarial Sample Generation Method: Generate synthetic images based on StyleGAN2 to simulate interfering objects (such as muscle fibers, fat particles) in complex backgrounds, and control the texture similarity by adjusting the generator parameters; Use traditional image processing methods (such as Gaussian noise, morphological dilation) to locally modify the original parasite image to generate negative samples.

[0124] (2) Adversarial Sample Integration: Mix the generated adversarial samples into the training set at a ratio of 1:1, forcing the model to learn to distinguish parasites from similar structures; Set the learning rate to 0.0001 separately during the adversarial training phase to avoid damaging the feature extraction ability of the backbone network.

[0125] 2. Model Results

[0126] (1) Performance Metrics: The validation set evaluation results include a sensitivity (Recall) of 97.8%, a precision of 93.6%, and an F1-Score of 95.7%.

[0127] (2) Test Set Results: The sensitivity (Recall) is 98.2% and the precision is 94.5%.

[0128] In the comparative experiment, the sensitivity of the proposed model is improved by 12.3% compared with the traditional YOLOv5 model, and the false positive rate is reduced by 72%;

[0129] Compared with manual detection: The miss rate is reduced from 9.2% to 2%.

[0130] 3. Model Generalization Verification: In an independent validation set (including 5 rare parasites) not involved in training, the model sensitivity remains ≥ 95.2%; the false detection rate of the validation set is stable below 3.8%.

[0131] In step S1, the standard biological specimen section is an unstained fish slice.

[0132] Prepare a standard biological specimen section and collect an image of the section under a microscope.

[0133] A fish parasite automatic recognition system for implementing the fish parasite recognition method described above. The recognition system includes: a database, a data acquisition module, a data processing module, a model establishment module, a model evaluation module, and an image recognition module. The data acquisition module includes a microscope and a camera. The camera is a 5-million-pixel USB camera, and the microscope is a microscope with a 40× objective lens. Microscope (40× objective lens) + 5-million-pixel USB camera + edge computing device; Real-time performance: model inference speed 20 FPS, alarm delay < 0.1 second.

[0134] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.

Claims

1. A method for identifying fish parasites, characterized in that, The steps are as follows: S1. Image acquisition: Acquire the microscopic images of the slices and make them into an image set; S2. Image preprocessing to construct a data set: Use the CLAHE algorithm to enhance the low-contrast images in the image set, and combine the top-hat transform to suppress the uniform background in the images; Convert to the LAB color space, and use the brightness and color difference channels to separate the target and background in the images; The target is fish parasites; Label annotation for image data: Screen the images in the image set, keep the qualified images, and perform label annotation on the targets in the qualified images. The target to be annotated is the fish parasites in the images, and the label is the parasite category name; Divide the image data set: Divide it into a training set, a test set, and a validation set; Perform parasite image data augmentation: Use an augmentation strategy to augment the images in the training set; S3. Establish a parasite recognition model: Based on the ResNet50 convolutional neural network architecture, establish an initial model for parasite image recognition, embed the CBAM module in the initial model, and design a feature pyramid network and set the Anchor size to be adapted. Then, set the hyperparameters of the initial model, and use the data in the training set to train the initial model to obtain a first intermediate model; S4. Model evaluation: Use the test set to evaluate the trained first intermediate model to obtain a trained second intermediate model; Use the validation set to evaluate the second intermediate model to obtain a parasite recognition model; S5. Realize automatic detection to identify the parasites in the images: Input the real-time acquired fish slice images into the parasite recognition model, and output the parasite images and the corresponding parasite category names in the images.

2. The parasite identification method according to claim 1, wherein In step S1, the slice is an unstained fish slice, the resolution of the microscopic image is 2592×1944, the image set forms a parasite database, the pictures in the parasite database cover common fish parasites, and the number of pictures in the parasite database is more than 20,000.

3. The parasite recognition method according to claim 1, characterized in that, In step S2, screening the images includes eliminating the unqualified images in the image set that do not meet the image screening criteria, and only keeping the qualified images that meet the criteria; The specific method for image screening is as follows: Use the Laplacian variance algorithm to calculate the image sharpness, and eliminate the blurred images with a variance <50; Manually sample 10% of the samples and eliminate the invalid data with large areas of bubbles and knife mark pollution to obtain qualified images that meet the criteria; The specific method for data label annotation is: Cross-annotate the parasite category names in the images by multiple aquatic pathology experts. For the targets with complete morphology and a gray level difference ≥5, perform target type annotation. For the targets with blurred boundaries, multiple aquatic pathology experts use the majority voting method to determine the annotation for the targets; The data set is divided by stratified sampling according to the types of parasites, so that the division ratio of the training set, the test set, and the validation set is 7:2:

1.

4. The parasite identification method according to claim 1, characterized in that In step S2, the enhancement strategies include random rotation, local occlusion, simulated light fluctuation, and Gaussian noise; any one or more of the above enhancement strategies are executed on any image in the training set; the test set and the validation set are normalized, and the parameters for the normalization are: mean of L channel = 50, standard deviation = 25; mean of A / B channel = 0, standard deviation = 64.

5. The parasite recognition method according to claim 1, wherein In step S3, a double queue is used to asynchronously load data, and the preprocessed data is stored in the cache pool to reduce the latency in the input and output processes.

6. The parasite identification method according to claim 1, wherein In step S4, adversarial training is also included during the model training phase. The specific method of the adversarial training is: by generating adversarial samples, the generated adversarial samples are mixed into the training set at a ratio of 1:1, so as to force the model to learn to distinguish parasites from similar structures.

7. The parasite identification method according to claim 6, wherein, The method for generating the adversarial samples is: Based on StyleGAN2, synthetic images are generated, and the interfering objects in the complex background of the synthetic images that will interfere with image recognition are simulated. The similarity of the fish meat texture is controlled by adjusting the generator parameters. The interfering objects include muscle fibers and fat particles. Any image processing method including Gaussian noise or morphological dilation is used to locally modify the original parasite image to generate negative samples.

8. The parasite identification method according to claim 1, wherein In step S4, the monitoring metrics for model training are the sensitivity of the validation set and the loss value of the validation set. The early stopping condition for the monitoring metrics is that the validation set loss has not decreased for 15 consecutive Epochs, or the sensitivity fluctuation range < 0.2%; the model for the monitoring metrics is saved as the model weight with the highest F1-Score on the validation set.

9. The parasite identification method according to claim 1, wherein In step S5, post-processing optimization is also included. The specific method of the post-processing optimization includes: based on the morphological rules of parasites, false positive targets are filtered, and the filtered parasite targets are output. Through multi-scale sliding window verification, the stability of the detection results is improved.

10. A fish parasite automatic identification system for implementing the identification method of fish parasites as described in any one of claims 1-9, characterized in that , the recognition system includes a database, a data acquisition module, a data processing module, a model establishment module, a model evaluation module, and an image recognition module. The data acquisition module includes a microscope and a camera, and the camera is a USB camera.

Citation Information

Patent Citations

  • Deep learning-based parasite egg identification method

    CN108805101A

  • Image recognition method and device based on deep learning, server and storage medium

    CN113344927A

  • Mask-RCNN-based multi-target detection method in indoor complex environment

    CN115937659A

  • Melanoma auxiliary diagnosis method based on deep learning

    CN117078642A

  • Method for providing an image using an operating microscope and operating microscope

    DE102023200671B3

Cited By

  • AI-based trachinotus ovatus juvenile fish culture water parasite prediction and prevention method and system

    CN121436288A