A diagnostic method for Cryptocaryon irritans disease in marine fish based on image recognition technology
By constructing an image recognition model for the dorsal fin of large yellow croaker using deep learning networks and neural networks based on image recognition technology, the problem of early diagnosis of cryptocaryonosis in marine fish was solved, achieving efficient and accurate disease identification and promoting the intelligent development of aquaculture.
Patent Information
- Application Number
- CN202210669598.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-06-14
AI Technical Summary
Existing technologies make it difficult to achieve efficient, accurate, and simple diagnosis of cryptocaryonosis in marine fish, especially in high-density aquaculture environments, where early diagnosis is difficult and can easily lead to large-scale fish mortality.
A diagnostic method based on image recognition technology was adopted. Using deeplabv3+ deep learning network and Efficientnet neural network, combined with data augmentation and transfer learning, a dorsal fin image recognition model of large yellow croaker was constructed, and a mobile APP program was designed to identify cryptocaryonosis.
It enables early diagnosis of cryptocaryonosis in marine fish, improves identification accuracy and efficiency, simplifies operational procedures, and promotes the intelligent and digital development of aquaculture.
Smart Images

Figure CN115458151B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of diagnosis of aquatic animal diseases and insect pests, and in particular to a method for diagnosing Cryptocaryon irritans disease in marine fish based on image recognition technology. Background Art
[0002] Cryptocaryon irritans is the causative agent of cryptocaryonosis. Studies have confirmed that, with the exception of a few species, such as yellow-spotted basketfish and yellow croaker, which are less susceptible to Cryptocaryonosis, Cryptocaryon can readily infect other marine bony fish. Once infected, farmed fish often develop visible white spots on their surface, leading to the disease being referred to as "marine fish white spot disease." The parasite reproduces rapidly, and during an outbreak, the progression from a mild early infection to a more intensive infection can take as little as a week. Especially in relatively closed, high-density, factory-based aquaculture systems, once Cryptocaryonosis enters the system, its numbers increase exponentially. If not promptly detected and prevented, it can quickly lead to widespread mortality in farmed fish. Therefore, effective prevention and control of Cryptocaryon irritans in marine fish requires early diagnosis.
[0003] Over the years, many studies have aimed to find an efficient and rapid diagnostic method for cryptonucleosis. Currently, the main diagnostic methods include epigenetic diagnosis and molecular biological diagnosis. Epigenetic diagnosis is simple and quick, but when the fish show obvious visible symptoms, it is also the peak of the disease, and the fish is already "terminally ill". In addition, other similar symptoms can also confuse farmers. Molecular biological methods are more accurate and efficient in diagnosing diseases, but they have high requirements for the professional quality and equipment of the testers, and can only be completed under laboratory conditions. Therefore, it is imperative to find an intelligent, efficient, simple and fast diagnostic method for cryptonucleosis in marine fish.
[0004] In recent years, with the rapid development of agricultural informatization, computer technology has been gradually applied to various areas of agricultural development. Computer vision, for example, has gradually expanded from the humanities field to the agricultural market, achieving considerable success in the classification and identification of agricultural products and crop diseases. Srdjan et al. developed a model for identifying plant leaf diseases based on deep neural networks, achieving an accuracy of 96.30%. Wang Xiping et al. developed an image recognition model for apple lesions based on a convolutional neural network and a time-varying impulse learning method, achieving an accuracy of 97.45%. However, in marine aquaculture, Cryptocaryon irritans infects fish, resulting in distinct white spots on their bodies and fins. Furthermore, upon maturation, these white spots spontaneously shed to the bottom of the aquaculture pond, forming cysts with a specific shape, size, and color. Therefore, the development of an image recognition system for Cryptocaryon irritans in marine fish is not only feasible but also holds promise for promoting the intelligent development of the aquaculture industry. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a diagnostic method for marine fish Cryptocaryon irritans disease based on image recognition technology with low network parameters, high recognition efficiency and high recognition accuracy.
[0006] The technical solution adopted by the present invention is a method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology, the method comprising the following steps:
[0007] S1. Collect images of large yellow croaker with cryptonarian disease, healthy large yellow croaker, the bottom of aquaculture barrel with cysts, and the bottom of aquaculture barrel without cysts;
[0008] S2. Selecting, from all the images collected in step S1, some images of large yellow croaker suffering from cryptonarianosis, some images of healthy large yellow croaker, and some images of the bottom of aquaculture barrels with cysts, and manually annotating the dorsal fins of the large yellow croaker in the selected images and the cysts in the selected images of the bottom of aquaculture barrels, respectively, to obtain a plurality of labeled images, and storing them in two folders, respectively;
[0009] S3, the images in the two folders obtained in step S2 are respectively carried out data augmentation operation, obtain the augmented image about large yellow croaker and the augmented image about the bottom of the breeding bucket, the augmented image about large yellow croaker and the large yellow croaker image collected in step S1 are composed of a large yellow croaker image data set, the augmented image about the bottom of the breeding bucket and the image at the bottom of the breeding bucket collected in step S1 are composed of a breeding bucket bottom image data set, and the sizes of the images in the two data sets are respectively adjusted to obtain the adjusted large yellow croaker image data set and the adjusted breeding bucket bottom image data set;
[0010] S4, dividing the images in the adjusted aquaculture barrel bottom image dataset obtained in step S3 into a training set, a validation set, and a test set according to proportion;
[0011] S5. Use deeplabv3+ deep learning network to build a cryptonucleariasis pathogen recognition model, input the training set and validation set obtained in step S4 into the deeplabv3+ deep learning network for training, and obtain a trained cryptonucleariasis pathogen recognition model. Input the test set obtained in step S4 into the trained cryptonucleariasis pathogen recognition model for testing, and obtain the optimal cryptonucleariasis pathogen recognition model;
[0012] S6. Use deeplabv3+ deep learning network to extract the fish dorsal fin from the image in the adjusted large yellow croaker image dataset obtained in step S3, output the fish dorsal fin image by deeplabv3+ deep learning network, and perform dot multiplication on the mask of the fish dorsal fin image and the large yellow croaker image collected in step S1 to obtain a fish dorsal fin image with the same pixel value and size as the original image, and form a fish dorsal fin image dataset by the fish dorsal fin images;
[0013] S7, performing image enhancement processing on the images in the fish dorsal fin image dataset obtained in step S6 to obtain a processed fish dorsal fin image dataset;
[0014] S8, segmenting the images in the processed fish dorsal fin image dataset obtained in step S7 to obtain an image classification dataset;
[0015] S9, dividing the image classification dataset obtained in step S8 into a training set, a validation set, and a test set in proportion;
[0016] S10, using EfficientNet neural network to build a large yellow croaker dorsal fin image classification model;
[0017] S11, utilize the training set and verification set obtained in step S9 to train the large yellow croaker dorsal fin image classification model in step S10 to obtain a large yellow croaker disease image recognition model;
[0018] S12. Input the test set images obtained in step S9 into the large yellow croaker disease image recognition model obtained in step S11 for testing to obtain an optimal large yellow croaker disease image recognition model.
[0019] S13. Design a mobile phone APP program based on the optimal large yellow croaker disease image recognition model to complete the identification of cryptotrichosis during the breeding process by taking pictures.
[0020] The beneficial effects of the present invention are as follows: the present invention applies computer image processing technology to the identification of aquatic diseases for the first time, solves the difficulties in the effectiveness and accuracy of aquatic disease identification in the past, realizes the early diagnosis of cryptonucleosis, and is simple to operate and efficient compared with the previous appearance diagnosis and molecular biology diagnosis. The accuracy of disease identification is greatly improved, which is conducive to promoting the development of aquaculture towards intelligence; in order to improve the accuracy of disease identification of underwater farmed animals, the present invention adopts the dual identification of pathogens and symptoms, which greatly improves the accuracy of disease identification to a certain extent; compared with traditional machine learning, the present invention does not need to perform tedious work steps such as manual preprocessing and feature extraction of images, and uses neural networks to perform image processing. Feature extraction realizes end-to-end operation and greatly reduces the model construction time; the deep learning network is used to extract features from images, which greatly reduces the time and accuracy of image processing; the transfer learning method is used to train with a pre-trained model, which greatly reduces the training time of the model; the model can identify cryptonucleosis in images of large yellow croaker captured in complex environments, and is more robust than traditional machine learning methods. Therefore, it is expected to become an application for future aquaculture disease identification; in the field of aquaculture, the computer technology is used for the first time to identify farmed animal diseases, which can effectively promote the development of aquaculture towards intelligence and provide a certain theoretical reference for the future realization of digital farming.
[0021] Preferably, in step S2, the specific process of manually labeling the dorsal fin of the fish in the selected large yellow croaker image and the cysts in the selected breeding barrel bottom image is: using the software Labelbox to manually label the dorsal fin of the large yellow croaker image and the cysts on the bottom of the breeding barrel obtained in step S1, and marking the pixel values of the dorsal fin part of the large yellow croaker in the image of the large yellow croaker suffering from cryptorchidism, the dorsal fin part of the large yellow croaker in the image of the healthy large yellow croaker, and the cyst part in the image of the breeding barrel bottom with cysts as 1, and marking the pixels of other parts of the fish body and the background part as 0, and extracting the parts with pixel values of 1 to obtain several marked dorsal fin images of large yellow croaker and several marked cyst images of the breeding barrel bottom.
[0022] Preferably, in step S3, the specific process of performing data augmentation operations on the images in the two folders obtained in step S2 is: calling relevant functions in the OpenCV function library, and using Python language to change the brightness, add noise, enlarge and reduce, and change the mirror image of the marked images in the two folders obtained in step S2 to expand the image data.
[0023] Preferably, in step S3, the specific process of changing the brightness of the marked images in the two folders obtained in step S2 using Python language is: using the formula g(i,j)=α·f(i,j)+β, wherein f(i,j) is used as the source image pixel, g(i,j) is used as the output image pixel, i and j represent the pixel located in the i-th row and j-th column, the parameters α>0 and β are usually called gain and bias parameters, and linear processing is performed on each pixel point on each marked image in the two folders obtained in step S2.
[0024] Preferably, in step S3, the specific process of adding noise to the marked images in the two folders obtained in step S2 using Python language is as follows: using Python language to generate Gaussian noise with zero mean, adding Gaussian noise with zero mean to each marked image in the two folders obtained in step S2, that is, adding a random number to the grayscale value of each pixel on each image; the specific process of adding a random number to the grayscale value of each pixel is as follows: first, two random numbers U and V are generated, and then the Box-Muller algorithm is used to obtain two random variables with Gaussian distribution properties: Finally, the degree of adding Gaussian noise is controlled by random variables X and Y.
[0025] Preferably, in step S3, the specific process of using Python language to enlarge and reduce the marked images in the two folders obtained in step S2 is: each marked image in the two folders obtained in step S2 is scaled in the x-axis and y-axis directions according to a certain ratio to obtain a new image. If the scaling ratios in the two directions are the same, it is full-ratio scaling, otherwise it is non-full-ratio scaling.
[0026] Preferably, in step S3, using Python language to change the mirror image of the marked images in the two folders obtained in step S2 specifically includes: using Python language to horizontally mirror, vertically mirror, or diagonally mirror the images marked in step S2.
[0027] Preferably, in step S3, the specific process of adjusting the sizes of the images in the two data sets respectively is: calling a function in the OpenCV function library, and using Python language to adjust the sizes of the images in the large yellow croaker image data set and the images in the aquaculture barrel bottom image data set to 640*640, and specifically using the resize function to adjust the size of the image to 640*640. The function calling format is as follows: void resize(InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR); wherein, InputArray src and OutputArray dst represent the input and output images respectively, Size dsize represents the size of the output image, double fx=0, double fy=0 represent the transformation size factors in the x and y directions, and int interpolation=INTER_LINEAR represents the interpolation method.
[0028] Preferably, in step S4, the images in the adjusted aquaculture barrel bottom image dataset obtained in step S3 are divided into a training set, a validation set, and a test set according to a ratio of 7:1:1;
[0029] Preferably, in step S5, the training set and validation set obtained in step S4 are input into the deeplabv3+ deep learning network for training, and the specific process of obtaining the trained cryptonucleariasis pathogen recognition model is as follows: using the deeplabv3+ deep learning network, the training set and validation set obtained in step S4 are input into the deeplabv3+ model for deep learning, using the Adam algorithm, selecting the Adam optimizer function as the parameter optimizer, setting the initial learning rate of the model to 0.01, and the maximum number of training iterations to 50; then the test set obtained in step S4 is input into the trained cryptonucleariasis pathogen recognition model for testing, when the loss value of the test set no longer decreases, the attenuated learning rate and the attenuation parameter are attenuated to 0.1, and the attenuated learning rate is the product of the initial learning rate and the attenuation parameter; repeat the training many times, and when the loss value of the validation set no longer decreases after 50 iterations, terminate the model training to complete the establishment of the cryptonucleariasis pathogen recognition model.
[0030] Preferably, in step S6, the specific steps of using deeplabv3+ deep learning network to extract the dorsal fin of the image in the adjusted large yellow croaker image data set obtained in step S3 are: using deeplabv3+ deep learning network, the adjusted large yellow croaker image data set obtained in step S3 is input into the deeplabv3+ model for deep learning, utilizing the Adam algorithm, selecting the Adam optimizer function as the parameter optimizer, setting the initial learning rate of the model to 0.01, and the maximum number of training iterations to 50; then re-inputting some images in the adjusted large yellow croaker image data set obtained in step S3 into the trained cryptocaryonosis pathogen recognition model for testing, when the loss value of the model no longer decreases, attenuating the learning rate and the attenuation parameter to 0.1, and the attenuated learning rate is the product of the initial learning rate and the attenuation parameter; after repeated training, when the loss value of the model no longer decreases after 50 iterations, terminating the model training and completing the extraction of the large yellow croaker dorsal fin image.
[0031] Preferably, in step S7, the image enhancement processing of the fish dorsal fin image dataset obtained in step S6 is specifically performed by calling functions in the OpenCV function library and using the Python language to perform grayscale transformation and sharpening processing on the fish dorsal fin image; the grayscale transformation of the fish dorsal fin image is specifically performed by using a gamma correction method, and the sharpening processing of the fish dorsal fin image is specifically performed by using an unsharp masking method.
[0032] Preferably, in step S8, the image in the processed fish dorsal fin image dataset obtained in step S7 is segmented as follows: a function is called in the OpenCV function library, and a block image with a size of 50*50 is extracted on the fish dorsal fin image with the extreme point as the center using the python language, and the image classification dataset is composed of block images with a size of 50*50.
[0033] Preferably, in step S11, the specific process of using the training set and validation set obtained in step S9 to train the large yellow croaker dorsal fin image classification model in step S10 is as follows: using the network model of the Efficientnet neural network as the initial weight, using the cross-validation method in the sklearn package of the Efficientnet neural network to randomly divide the images in the training set into seven parts, and training the Efficientnet neural network N times, each training is to merge one of the seven parts with the initial validation set into a validation set, and the remaining six parts are used as training sets to train the Efficientnet neural network; after each training, the parameters of the network model are adjusted using the Adam optimizer, and then training is performed again. After completing N training times, N trained network models will be obtained, and at least two relatively best groups of network models are selected, and the selected at least two groups of network models are fused using the mean method to obtain a large yellow croaker disease image recognition model.
[0034] Preferably, in step S13, a mobile phone APP program is designed according to the optimal large yellow croaker disease image recognition model, and the specific process of completing the identification of cryptocaryonosis in the breeding process by taking pictures is as follows: the optimal cryptocaryonosis pathogen recognition model established in S5 and the optimal large yellow croaker disease image recognition model established in S11 are both converted into TFLite lightweight models, and then both are embedded in the mobile phone program APP to create an end-to-end Android application; wherein, the mobile phone program APP is written in Java language in Andriod Studio; after installation, the user selects local photos or takes photos with the mobile phone camera. When the photo is input into the program, click the recognition button, and the prediction result will be given at the bottom of the APP to realize the diagnosis of large yellow croaker cryptocaryonosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a flow chart of a method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology of the present invention;
[0036] Figure 2 A flowchart of using the training set and validation set obtained in step S9 in step S11 of the present invention to train the large yellow croaker dorsal fin image classification model in step S10;
[0037] Figure 3 This is a comparison diagram of the bottom image of the aquaculture barrel in the present invention; Figure 3 (a) is an image of the bottom of a culture barrel with cysts. Figure 3 Middle (b) is an image of the bottom of the culture barrel without cysts;
[0038] Figure 4 This is a comparison diagram of the large yellow croaker image in the present invention; Figure 3(a) in the middle is an image of a large yellow croaker suffering from cryptonucleosis. Figure 3 Middle (b) is an image of a healthy large yellow croaker;
[0039] Figure 5 This is a comparison diagram of the dorsal fin image after image enhancement processing in the present invention; Figure 4 (a) is the dorsal fin image of a healthy large yellow croaker, and (b) is the dorsal fin image of a large yellow croaker with cryptonucleus disease.
[0040] Figure 6 A comparison diagram of block images obtained by segmenting the images in the fish dorsal fin image dataset processed in the present invention; Figure 5 (a) is a block image with white dots after segmentation. Figure 5 Middle (b) is the block image without white spots after segmentation;
[0041] Figure 7 This is a model structure diagram of the large yellow croaker dorsal fin image classification model in the present invention. DETAILED DESCRIPTION
[0042] The invention will be further described below with reference to the accompanying drawings and in combination with specific implementations, so that those skilled in the art can implement the invention with reference to the description. The protection scope of the invention is not limited to the specific implementations.
[0043] The technical solution adopted by the present invention is a method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology. Figure 1 As shown, the method includes the following steps:
[0044] S1. Collect images of large yellow croaker suffering from cryptonarianosis, images of healthy large yellow croaker, images of the bottom of aquaculture barrels with cysts, and images of the bottom of aquaculture barrels without cysts; in the images of large yellow croaker suffering from cryptonarianosis, the body surface and fins of the large yellow croaker will show obvious visible white spots, while in the images of healthy large yellow croaker, the body surface and fins of the large yellow croaker are normal; in the images of the bottom of aquaculture barrels with cysts, there are obvious visible white spots on the bottom of the aquaculture barrels, while the images of the bottom of aquaculture barrels without cysts have no obvious cysts.
[0045] S2. Selecting, from all the images collected in step S1, some images of large yellow croaker suffering from cryptonarianosis, some images of healthy large yellow croaker, and some images of the bottom of aquaculture barrels with cysts, and manually annotating the dorsal fins of the large yellow croaker in the selected images and the cysts in the selected images of the bottom of aquaculture barrels, respectively, to obtain a plurality of labeled images, and storing them in two folders, respectively;
[0046] S3, the images in the two folders obtained in step S2 are respectively carried out data augmentation operation, obtain the augmented image about large yellow croaker and the augmented image about the bottom of the breeding bucket, the augmented image about large yellow croaker and the large yellow croaker image collected in step S1 are composed of a large yellow croaker image data set, the augmented image about the bottom of the breeding bucket and the image at the bottom of the breeding bucket collected in step S1 are composed of a breeding bucket bottom image data set, and the sizes of the images in the two data sets are respectively adjusted to obtain the adjusted large yellow croaker image data set and the adjusted breeding bucket bottom image data set;
[0047] S4, dividing the images in the adjusted aquaculture barrel bottom image dataset obtained in step S3 into a training set, a validation set, and a test set according to proportion;
[0048] S5. Use deeplabv3+ deep learning network to build a cryptonucleariasis pathogen recognition model, input the training set and validation set obtained in step S4 into the deeplabv3+ deep learning network for training, and obtain a trained cryptonucleariasis pathogen recognition model. Input the test set obtained in step S4 into the trained cryptonucleariasis pathogen recognition model for testing, and obtain the optimal cryptonucleariasis pathogen recognition model;
[0049] S6. Use deeplabv3+ deep learning network to extract the fish dorsal fin from the image in the adjusted large yellow croaker image dataset obtained in step S3, output the fish dorsal fin image by deeplabv3+ deep learning network, and perform dot multiplication on the mask of the fish dorsal fin image and the large yellow croaker image collected in step S1 to obtain a fish dorsal fin image with the same pixel value and size as the original image, and form a fish dorsal fin image dataset by the fish dorsal fin images;
[0050] S7, performing image enhancement processing on the images in the fish dorsal fin image dataset obtained in step S6 to obtain a processed fish dorsal fin image dataset;
[0051] S8, segmenting the images in the processed fish dorsal fin image dataset obtained in step S7 to obtain an image classification dataset;
[0052] S9, dividing the image classification dataset obtained in step S8 into a training set, a validation set, and a test set in proportion;
[0053] S10, using EfficientNet neural network to build a large yellow croaker dorsal fin image classification model;
[0054] S11, utilize the training set and verification set obtained in step S9 to train the large yellow croaker dorsal fin image classification model in step S10 to obtain a large yellow croaker disease image recognition model;
[0055] S12. Input the test set images obtained in step S9 into the large yellow croaker disease image recognition model obtained in step S11 for testing to obtain an optimal large yellow croaker disease image recognition model.
[0056] S13. Design a mobile phone APP program based on the optimal large yellow croaker disease image recognition model to complete the identification of cryptotrichosis during the breeding process by taking pictures.
[0057] The present invention applies computer image processing technology to the identification of aquatic diseases for the first time, solving the previous difficulties in the effectiveness and accuracy of aquatic disease identification and realizing the early diagnosis of cryptonucleosis. Compared with the previous epigenetic diagnosis and molecular biological diagnosis, the present invention is simple to operate and efficient, and the accuracy of disease identification is greatly improved, which is conducive to promoting the development of aquaculture towards intelligence. In order to improve the accuracy of disease identification of underwater farmed animals, the present invention adopts the dual identification of pathogens and symptoms, which greatly improves the accuracy of disease identification to a certain extent. Compared with traditional machine learning, the present invention does not need to perform tedious work steps such as manual image preprocessing and feature extraction, and uses neural networks to extract features from images. It achieves end-to-end operation, greatly reducing the model construction time; uses a deep learning network to extract features from images, greatly reducing the time and accuracy of image processing; uses the transfer learning method and pre-trained models for training, greatly reducing the model training time; the model can identify cryptonucleosis in images of large yellow croaker captured in complex environments, and is more robust than traditional machine learning methods. Therefore, it is expected to become an application for future aquaculture disease identification; in the field of aquaculture, computer technology is used for the first time to identify farmed animal diseases, which can effectively promote the intelligent development of the aquaculture industry and provide a certain theoretical reference for the future realization of digital farming.
[0058] In step S2, the specific process of manually labeling the dorsal fin of the fish in the selected large yellow croaker image and the cysts in the selected aquaculture barrel bottom image is as follows: using the software Labelbox to manually label the dorsal fin of the large yellow croaker image and the cysts on the bottom of the aquaculture barrel obtained in step S1, and marking the pixel values of the dorsal fin part of the large yellow croaker in the image of the large yellow croaker suffering from cryptonucleosis, the dorsal fin part of the large yellow croaker in the image of the healthy large yellow croaker, and the cyst part in the image of the bottom of the aquaculture barrel with cysts as 1, and marking the pixels of other parts of the fish body and the background part as 0, and extracting the parts with pixel values of 1 to obtain several marked dorsal fin images of large yellow croaker and several marked cyst images of the bottom of the aquaculture barrel.
[0059] In step S3, the specific process of performing data augmentation operations on the images in the two folders obtained in step S2 is as follows: calling relevant functions in the OpenCV function library, and using Python language to change the brightness, add noise, enlarge and reduce, and change the mirror image of the marked images in the two folders obtained in step S2 to expand the image data.
[0060] In step S3, the specific process of changing the brightness of the marked images in the two folders obtained in step S2 using Python language is as follows: using the formula g(i,j)=α·f(i,j)+β, where f(i,j) is the source image pixel, g(i,j) is the output image pixel, i and j represent the pixel located in the i-th row and j-th column, and the parameters α>0 and β are usually called gain and bias parameters. Linear processing is performed on each pixel point on each marked image in the two folders obtained in step S2.
[0061] In step S3, the specific process of adding noise to the marked images in the two folders obtained in step S2 using Python is as follows: using Python to generate Gaussian noise with zero mean, adding Gaussian noise with zero mean to each marked image in the two folders obtained in step S2, that is, adding a random number to the grayscale value of each pixel on each image; the specific process of adding a random number to the grayscale value of each pixel is as follows: first, two random numbers U and V are generated, and then the Box-Muller algorithm is used to obtain two random variables with Gaussian distribution properties: Finally, the degree of adding Gaussian noise is controlled by random variables X and Y.
[0062] Several common methods for adding noise to an image include adding Gaussian noise, salt and pepper noise, or Poisson noise. In step S3, the specific process of adding noise to the image marked in step S2 using Python is as follows: using Python to generate Gaussian noise with zero mean, adding Gaussian noise with zero mean to the image marked in step S2, that is, adding a random number to the grayscale value of each pixel. The specific process of adding a random number to the grayscale value of each pixel is as follows: first, two random numbers U and V are generated, and then the Box-Muller algorithm is used to obtain two random variables with Gaussian distribution properties: Finally, the degree of adding Gaussian noise is controlled by random variables X and Y.
[0063] In step S3, the specific process of using Python language to zoom in and out the marked images in the two folders obtained in step S2 is as follows: each marked image in the two folders obtained in step S2 is zoomed in a certain ratio in the x-axis and y-axis directions to obtain a new image. If the zoom ratios in the two directions are the same, it is full-scale zooming, otherwise it is non-full-scale zooming. It can be expressed as a matrix: The corresponding algebraic expression can be expressed as: Among them, x0 and y0 represent the original size of the image, f x and f y Indicates the scaling factor, x and y indicate the target image size.
[0064] In step S3, the image marked in the two folders obtained in step S2 is mirrored using Python. Specifically, the image marked in step S2 is mirrored horizontally, vertically, or diagonally. Assuming the image size is M*N, the three different transformation methods are expressed by the following formulas:
[0065] Horizontal mirror:
[0066]
[0067] Mirror vertically:
[0068]
[0069] Diagonal mirror image:
[0070]
[0071] Note that in OpenCV the coordinates start from (0, 0), so the +1 in the formula needs to be changed to -1 when programming.
[0072] In step S3, the specific process of adjusting the sizes of the images in the two data sets is as follows: calling a function in the OpenCV function library, and using Python language to adjust the sizes of the images in the large yellow croaker image data set and the images in the aquaculture bucket bottom image data set to 640*640. Specifically, the resize function is used to adjust the size of the image to 640*640. The function calling format is as follows: void resize(InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR); wherein InputArray src and OutputArray dst represent the input and output images respectively, Size dsize represents the size of the output image, double fx=0, double fy=0 represent the transformation size factors in the x and y directions, and int interpolation=INTER_LINEAR represents the interpolation method.
[0073] In step S4, the images in the adjusted aquaculture tank bottom image dataset obtained in step S3 are divided into a training set, a validation set, and a test set according to a ratio of 7:1:1;
[0074] In step S5, the training set and validation set obtained in step S4 are input into the deeplabv3+ deep learning network for training. The specific process of obtaining the trained cryptorchidosis pathogen recognition model is as follows: using the deeplabv3+ deep learning network, the training set and validation set obtained in step S4 are input into the deeplabv3+ model for deep learning, using the Adam algorithm, selecting the Adam optimizer function as the parameter optimizer, setting the initial learning rate of the model to 0.01, and the maximum number of training iterations to 50; then the test set obtained in step S4 is input into the trained cryptorchidosis pathogen recognition model for testing, when the loss value of the test set no longer decreases, the attenuated learning rate and the attenuation parameter are attenuated to 0.1, and the attenuated learning rate is the product of the initial learning rate and the attenuation parameter; when the loss value of the validation set no longer decreases after 50 iterations, the model training is terminated to complete the establishment of the cryptorchidosis pathogen recognition model.
[0075] In step S6, the specific steps of using deeplabv3+ deep learning network to extract the dorsal fin of the image in the adjusted large yellow croaker image data set obtained in step S3 are as follows: using deeplabv3+ deep learning network, the adjusted large yellow croaker image data set obtained in step S3 is input into the deeplabv3+ model for deep learning, using the Adam algorithm, selecting the Adam optimizer function as the parameter optimizer, setting the initial learning rate of the model to 0.01, and the maximum number of training iterations to 50; then re-inputting some images in the adjusted large yellow croaker image data set obtained in step S3 into the trained cryptocaryonosis pathogen recognition model for testing, when the loss value of the model no longer decreases, attenuating the learning rate and the attenuation parameter to 0.1, and the attenuated learning rate is the product of the initial learning rate and the attenuation parameter; after repeated training, when the loss value of the model no longer decreases after 50 iterations, terminating the model training, and completing the extraction of the large yellow croaker dorsal fin image.
[0076] In step S7, the image enhancement processing is performed on the fish dorsal fin image dataset obtained in step S6, specifically: calling functions in the OpenCV function library, and using Python language to perform grayscale conversion and sharpening processing on the fish dorsal fin image; the grayscale conversion of the fish dorsal fin image is specifically performed by using a gamma correction method, and the sharpening processing of the fish dorsal fin image is specifically performed by using an unsharp masking method.
[0077] Gamma correction is to edit the gamma curve of an image, which is a nonlinear tone editing of the image, changing the high grayscale area and low grayscale area of the image to increase their ratio, thereby improving the contrast effect of the image. According to the expression: Among them, V in The value range of γ is 0-1. The value of γ determines the grayscale mapping method between the input image and the output image, that is, it determines whether to enhance the low grayscale value area of the image or the high grayscale value area of the image; when γ>1, the contrast of the high grayscale area of the image is enhanced; when γ<1, the contrast of the low grayscale area of the image is enhanced; when γ=1, the image is not changed.
[0078] The unsharp masking process involves three steps: first, blurring the original image; second, subtracting the blurred image from the original (creating a difference image called a template); and third, adding the template to the original image. Unsharp masking emphasizes the edges of the dorsal fin image, making the white spots more visible.
[0079] In step S8, the image in the processed fish dorsal fin image dataset obtained in step S7 is segmented as follows: a function is called in the OpenCV function library, and a block image with a size of 50*50 is extracted on the fish dorsal fin image with the extreme point as the center using the Python language, and the image classification dataset is composed of block images with a size of 50*50.
[0080] In step S11, the specific process of using the training set and validation set obtained in step S9 to train the large yellow croaker dorsal fin image classification model in step S10 is as follows: using the network model of the Efficientnet neural network as the initial weight, using the cross-validation method in the sklearn package of the Efficientnet neural network to randomly divide the images in the training set into seven parts, and training the Efficientnet neural network N times, each training is to merge one of the seven parts with the initial validation set into a validation set, and the remaining six parts are used as training sets to train the Efficientnet neural network; after each training, the parameters of the network model are adjusted using the Adam optimizer, and then training is performed again. After completing N training times, N trained network models will be obtained, and at least two relatively best groups of network models are selected, and the selected at least two groups of network models are fused using the mean method to obtain a large yellow croaker disease image recognition model.
[0081] A mobile phone APP program is designed based on the optimal large yellow croaker disease image recognition model. The specific process of completing the identification of cryptocaryonosis in the breeding process by taking pictures is as follows: the optimal cryptocaryonosis pathogen recognition model established in S5 and the optimal large yellow croaker disease image recognition model established in S11 are both converted into TFLite lightweight models, and then both are embedded in the mobile phone program APP to create an end-to-end Android application; wherein, the mobile phone program APP is written in Java language in Andriod Studio; after installation, the user uses local photos or mobile phone cameras to take pictures. When the photo is input into the program, click the recognition button, and the prediction result will be given at the bottom of the APP to realize the diagnosis of large yellow croaker cryptocaryonosis.
[0082] Example 1:
[0083] A diagnostic method for Cryptocaryon irritans disease in large yellow croaker based on image recognition technology, such as Figure 1 As shown, the method includes the following steps:
[0084] S1. Using a high-definition camera, collect 3,000 images each of large yellow croaker with cryptonarianosis, healthy large yellow croaker, and the bottom of aquaculture barrels with cysts and without cysts, for a total of 12,000 images selected by experts in the field of aquatic diseases; the images of large yellow croaker with cryptonarianosis will show clearly visible white spots on the body surface and fins of the large yellow croaker, while the images of healthy large yellow croaker will show no abnormalities on the body surface and fins; the images of the bottom of aquaculture barrels with cysts will show clearly visible white spots on the bottom of the aquaculture barrels, while the images of the bottom of aquaculture barrels without cysts will show no obvious cysts;
[0085] S2, from all the images collected in step S1, select 25 large yellow croaker images with cryptonucleosis, 25 healthy large yellow croaker images and 50 aquaculture bucket bottom images with cysts, the dorsal fin of the fish body in the selected large yellow croaker images and the cysts in the selected aquaculture bucket bottom images are manually marked respectively, and several images with mark are obtained respectively, and are stored in two folders respectively; The specific process of manual marking is: utilize software Labelbox to manually mark the dorsal fin in the large yellow croaker image obtained in step S1 and the cysts at the bottom of the aquaculture bucket respectively, the pixel value of the dorsal fin part of the large yellow croaker in the large yellow croaker image with cryptonucleosis, the dorsal fin part of the large yellow croaker in the healthy large yellow croaker image and the cyst part in the aquaculture bucket bottom image with cysts is all marked as 1, the pixel mark of other parts of the fish body and the background part is 0, and the part with the pixel value of 1 is extracted to obtain several large yellow croaker dorsal fin images with mark and several aquaculture bucket bottom cyst images with mark;
[0086] S3, the images in the two folders obtained in step S2 are respectively carried out data augmentation operation by changing brightness, adding noise, zooming and changing mirror image, obtain the augmented image about large yellow croaker and the augmented image about the bottom of the breeding bucket, by forming the large yellow croaker image data set about the augmented image about large yellow croaker and the large yellow croaker image collected in step S1, by forming the breeding bucket bottom image data set about the augmented image at the bottom of the breeding bucket and the breeding bucket bottom image collected in step S1, and respectively adjust the size of the image in the two data sets, specifically adjust to 640*640, obtain the large yellow croaker image data set after adjustment and the breeding bucket bottom image data set after adjustment;
[0087] Changing the brightness refers to changing the image brightness and contrast without changing the image information, that is, linear processing is performed on each pixel of the image. In this embodiment, two random seeds are set to represent the brightness and contrast respectively, with a random range of 0.5-1.5. The values obtained by using the random seeds are used to change the brightness and contrast of the image data;
[0088] The common methods of adding noise are Gaussian noise, salt and pepper noise, and Poisson noise. In this embodiment, Python is used to generate Gaussian noise with zero mean, and a noise that follows a Gaussian distribution is added to the image. That is, a random number is added to the gray value of each point. In this embodiment, a 5*5 domain window with a standard deviation of 3 is used to add noise to the image.
[0089] The image enlargement or reduction is to scale a given image in the x-axis and y-axis directions according to a certain ratio to obtain a new image. In this embodiment, the image data is randomly scaled within a scaling factor range of 0.5-1.5.
[0090] Regarding the changing of the image mirror, in this embodiment, random horizontal and vertical inversion operations are performed on the image data, and the random seed is set to 3;
[0091] It should be noted that the image dataset was expanded by changing the brightness, adding noise, zooming in and out, and changing the mirror image on the 100 annotated images. After the expansion, the large yellow croaker image dataset obtained after data augmentation has a total of 4900 images.
[0092] S4, dividing the images in the adjusted aquaculture barrel bottom image dataset obtained in step S3 into a training set, a validation set, and a test set in a ratio of 7:1:1;
[0093] S5. Use deeplabv3+ deep learning network to build a cryptonucleariasis pathogen identification model, input the training set and validation set obtained in step S4 into deeplabv3+ deep learning network for training, and obtain the trained cryptonucleariasis pathogen identification model. Input the test set obtained in step S4 into the trained cryptonucleariasis pathogen identification model for testing, and obtain the optimal cryptonucleariasis pathogen identification model. The specific process of obtaining the trained cryptonucleariasis pathogen identification model is as follows: use deeplabv3+ deep learning network, input the training set and validation set obtained in step S4 into deeplabv3+ model for deep learning, use Adam algorithm, select Adam The optimizer function is used as a parameter optimizer, and the initial learning rate of the model is set to 0.01, and the maximum number of training iterations is 50; the test set obtained in step S4 is then input into the trained cryptonucleosis pathogen recognition model for testing. When the loss value of the test set no longer decreases, the learning rate and the decay parameter are decayed to 0.1, and the decayed learning rate is the product of the initial learning rate and the decay parameter; the training is repeated multiple times, and when the loss value of the validation set no longer decreases after 50 iterations, the model training is terminated, and the establishment of the cryptonucleosis pathogen recognition model is completed;
[0094] S6, using deeplabv3+ deep learning network to extract fish dorsal fin from the images in the adjusted large yellow croaker image dataset obtained in step S3, outputting the fish dorsal fin image from deeplabv3+ deep learning network, and performing dot multiplication on the mask of the fish dorsal fin image and the large yellow croaker image collected in step S1 to obtain a fish dorsal fin image that is consistent with the pixel value and size of the original image, and the fish dorsal fin images constitute a fish dorsal fin image dataset; using deeplabv3+ deep learning network to extract fish dorsal fin from the images in the adjusted large yellow croaker image dataset obtained in step S3, the specific steps are: using deeplabv3+ deep learning network, inputting the adjusted large yellow croaker image dataset obtained in step S3 into deeplabv3+ model for deep learning, using Adam algorithm, selecting Adam The optimizer function is used as a parameter optimizer to set the initial learning rate of the model to 0.01 and the maximum number of training iterations to 50; then, some images in the adjusted large yellow croaker image data set obtained in step S3 are re-inputted into the trained cryptonucleosis pathogen recognition model for testing; when the loss value of the model no longer decreases, the learning rate and the decay parameter are decayed to 0.1, and the decayed learning rate is the product of the initial learning rate and the decay parameter; after repeated training, when the loss value of the model no longer decreases after 50 iterations, the model training is terminated to complete the extraction of the large yellow croaker dorsal fin image;
[0095] S7, the image in the fish dorsal fin image data set obtained in step S6 is subjected to image enhancement processing to obtain a processed fish dorsal fin image data set; the specific image enhancement processing includes grayscale conversion and sharpening processing on the image; the grayscale conversion uses a gamma correction method to count the probability density of each grayscale level, find the first grayscale level with a probability density less than 0.01 (low input), find the first grayscale level with a probability density greater than 0.99 (high input), thereby setting the pixel value less than the low input to 0, and the grayscale level greater than the high input to 255, and performing a linear transformation on the middle part, thereby changing the high grayscale area and the low grayscale area of the image, increasing their ratio, thereby improving the contrast effect of the image; the sharpening processing uses an unsharp masking method, and the process is divided into three steps: blurring the original image; subtracting the blurred image from the original image (generating a difference image called a template); adding the template to the original image; thereby highlighting the edge portion of the dorsal fin image, making the symptom (white spot) more obvious;
[0096] S8, the image in the fish dorsal fin image data set after the process obtained in step S7 is segmented into 50*50 blocks, and the block diagram is composed of image classification data sets; In view of the large gray value of the white point on the dorsal fin image, and the decreasing trend to the surrounding area in the middle, the spot image must cover the extreme value point T. Therefore, the 50*50 block diagram is extracted with the extreme value point as the center. If the pixel average value of the block diagram is >T*0.4, the block diagram is written into the folder and saved as the block diagram data set;
[0097] S9, dividing the image classification data set obtained in step S8 into a training set, a validation set, and a test set in proportion; the training set contains 1400 block images, including 700 images with white spots and 700 images without white spots; the validation set contains 200 block images, including 100 images with white spots and 100 images without white spots; and the test set contains 200 block images, including 200 images with white spots and 200 images without white spots;
[0098] S10. To address the problem that Cryptocaryon irritans disease in large yellow croaker is difficult to detect in its early stages, an EfficientNet neural network was used to construct a large yellow croaker dorsal fin image classification model. The large yellow croaker dorsal fin image classification model includes a convolutional layer, two fully connected layers, and an output layer. The classification function used in the output layer is a Softmax classification function, which is expressed as follows: Wherein, e is a natural constant (approximately 2.71828), z represents the result of a regression algorithm (such as linear regression), and k represents a total of k label categories in the label of the data. In the embodiment of the present invention, k=2, i.e., healthy large yellow croaker and large yellow croaker with cryptonucleus disease;
[0099] S11, utilize the training set and verification set obtained in step S9 to train the large yellow croaker dorsal fin image classification model in step S10 to obtain a large yellow croaker disease image recognition model; the specific training process is: using the network model of the Efficientnet neural network as the initial weight, using the cross-validation method in the sklearn package of the Efficientnet neural network to randomly divide the images in the training set into seven parts, and training the Efficientnet neural network N times, each training is to merge one of the seven parts with the initial verification set into a verification set, and the remaining six parts are used as training sets to train the Efficientnet neural network; after each training, the parameters of the network model are adjusted by the Adam optimizer, and then trained again. After completing N training times, N trained network models are obtained, and at least two groups of relatively best network models are selected, and at least two groups of network models selected are fused using the mean method to obtain a large yellow croaker disease image recognition model;
[0100] The large yellow croaker dorsal fin image classification model needs to be trained iteratively multiple times until the loss function of the network model converges, that is, the loss function stops decreasing after decreasing to a certain level, and a large yellow croaker disease image recognition model that can accurately detect disease spots is obtained; the loss of the network model is mainly calculated using the CrossEntropyLoss function, and the expression of the CrossEntropyLoss function is: H(p,q)=∑ x p(x)logq(x); where p is the probability of the expected output, q is the probability of the actual output, and H(p,q) is the cross entropy, which determines how close the actual output is to the expected output. In this embodiment of the present invention, it represents the difference between an image with a disease and an image with a detected disease.
[0101] S12, inputting the test set image obtained in step S9 into the large yellow croaker disease image recognition model obtained in step S11 for testing to obtain an optimal large yellow croaker disease image recognition model;
[0102] S13. Design a mobile phone APP program based on the optimal large yellow croaker disease image recognition model, and complete the identification of cryptocaryonosis during the breeding process by taking pictures. The specific process is: convert the optimal cryptocaryonosis pathogen recognition model established in S5 and the optimal large yellow croaker disease image recognition model established in S11 into TFLite lightweight models, and then embed them into the mobile phone program APP to create an end-to-end Android application; wherein, the mobile phone program APP is written in Java language in AndriodStudio; after installation, the user uses local photos or mobile phone cameras to take pictures. When the photo is input into the program, click the recognition button, and the prediction result will be given at the bottom of the APP to realize the diagnosis of large yellow croaker cryptocaryonosis.
Claims
1. A method for diagnosing Cryptocaryon irritans in marine fish based on image recognition technology, characterized in that: The method comprises the following steps: S1. Collect images of large yellow croaker with cryptonarian disease, healthy large yellow croaker, the bottom of aquaculture barrel with cysts, and the bottom of aquaculture barrel without cysts; S2. Selecting, from all the images collected in step S1, some images of large yellow croaker suffering from cryptonarianosis, some images of healthy large yellow croaker, and some images of the bottom of aquaculture barrels with cysts, and manually annotating the dorsal fins of the large yellow croaker in the selected images and the cysts in the selected images of the bottom of aquaculture barrels, respectively, to obtain a plurality of labeled images, and storing them in two folders, respectively; S3, the images in the two folders obtained in step S2 are respectively carried out data augmentation operation, obtain the augmented image about large yellow croaker and the augmented image about the bottom of the breeding bucket, the augmented image about large yellow croaker and the large yellow croaker image collected in step S1 are composed of a large yellow croaker image data set, the augmented image about the bottom of the breeding bucket and the image at the bottom of the breeding bucket collected in step S1 are composed of a breeding bucket bottom image data set, and the sizes of the images in the two data sets are respectively adjusted to obtain the adjusted large yellow croaker image data set and the adjusted breeding bucket bottom image data set; S4, dividing the images in the adjusted aquaculture barrel bottom image dataset obtained in step S3 into a training set, a validation set, and a test set according to proportion; S5. Use deeplabv3+ deep learning network to build a cryptonucleariasis pathogen recognition model, input the training set and validation set obtained in step S4 into the deeplabv3+ deep learning network for training, and obtain a trained cryptonucleariasis pathogen recognition model. Input the test set obtained in step S4 into the trained cryptonucleariasis pathogen recognition model for testing, and obtain the optimal cryptonucleariasis pathogen recognition model; S6. Use deeplabv3+ deep learning network to extract the fish dorsal fin from the image in the adjusted large yellow croaker image dataset obtained in step S3, output the fish dorsal fin image by deeplabv3+ deep learning network, and perform dot multiplication on the mask of the fish dorsal fin image and the large yellow croaker image collected in step S1 to obtain a fish dorsal fin image with the same pixel value and size as the original image, and form a fish dorsal fin image dataset by the fish dorsal fin images; S7, performing image enhancement processing on the images in the fish dorsal fin image dataset obtained in step S6 to obtain a processed fish dorsal fin image dataset; S8, segmenting the images in the processed fish dorsal fin image dataset obtained in step S7 to obtain an image classification dataset; S9, dividing the image classification dataset obtained in step S8 into a training set, a validation set, and a test set in proportion; S10, using EfficientNet neural network to build a large yellow croaker dorsal fin image classification model; S11, utilize the training set and verification set obtained in step S9 to train the large yellow croaker dorsal fin image classification model in step S10 to obtain a large yellow croaker disease image recognition model; S12, inputting the test set image obtained in step S9 into the large yellow croaker disease image recognition model obtained in step S11 for testing to obtain an optimal large yellow croaker disease image recognition model; S13. Design a mobile phone APP program based on the optimal large yellow croaker disease image recognition model to complete the identification of cryptotrichosis during the breeding process by taking pictures.
2. The method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology according to claim 1, wherein: In step S2, the specific process of manually labeling the dorsal fin of the fish in the selected large yellow croaker image and the cysts in the selected aquaculture barrel bottom image is as follows: using the software Labelbox to manually label the dorsal fin of the large yellow croaker image and the cysts on the bottom of the aquaculture barrel obtained in step S1, and marking the pixel values of the dorsal fin part of the large yellow croaker in the image of the large yellow croaker suffering from cryptonucleosis, the dorsal fin part of the large yellow croaker in the image of the healthy large yellow croaker, and the cyst part in the image of the bottom of the aquaculture barrel with cysts as 1, and marking the pixels of other parts of the fish body and the background part as 0, and extracting the parts with pixel values of 1 to obtain several marked dorsal fin images of large yellow croaker and several marked cyst images of the bottom of the aquaculture barrel.
3. The method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology according to claim 2, wherein: In step S3, the specific process of performing data augmentation operations on the images in the two folders obtained in step S2 is as follows: calling relevant functions in the OpenCV function library, and using Python language to change the brightness, add noise, enlarge and reduce, and change the mirror image of the marked images in the two folders obtained in step S2 to expand the image data.
4. The method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology according to claim 3, wherein: In step S3, the specific process of using Python language to change the brightness of the marked images in the two folders obtained in step S2 is as follows: using the formula g(i,j)=α·f(i,j)+β, where f(i,j) is the source image pixel, g(i,j) is the output image pixel, i and j represent the pixel located in the i-th row and j-th column, and the parameters α>0 and β are called gain and bias parameters, linear processing is performed on each pixel on each marked image in the two folders obtained in step S2; the specific process of using Python language to add noise to the marked images in the two folders obtained in step S2 is as follows: using Python language to generate Gaussian noise with zero mean, adding Gaussian noise with zero mean to each marked image in the two folders obtained in step S2, that is, adding a random number to the grayscale value of each pixel on each image; the specific process of adding a random number to the grayscale value of each pixel is as follows: first, two random numbers U and V are generated, and then the Box-Muller algorithm is used to obtain two random variables with Gaussian distribution properties: Finally, the degree of adding Gaussian noise is controlled by random variables X and Y; in step S3, the specific process of using Python language to enlarge and reduce the marked images in the two folders obtained in step S2 is: each marked image in the two folders obtained in step S2 is scaled in a certain proportion in the x-axis and y-axis directions to obtain a new image. If the scaling ratios in the two directions are the same, it is full-ratio scaling, otherwise it is non-full-ratio scaling; in step S3, the specific process of using Python language to change the mirror image of the marked images in the two folders obtained in step S2 is: using Python language to horizontally mirror, vertically mirror, or diagonally mirror the images marked in step S2.
5. The method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology according to claim 3 or 4, characterized in that: In step S5, the training set and validation set obtained in step S4 are input into the deeplabv3+ deep learning network for training, and the specific process of obtaining the trained cryptonucleariasis pathogen recognition model is as follows: using the deeplabv3+ deep learning network, the training set and validation set obtained in step S4 are input into the deeplabv3+ model for deep learning, using the Adam algorithm, selecting the Adam optimizer function as the parameter optimizer, setting the initial learning rate of the model to 0.01, and the maximum number of training iterations to 50; then the test set obtained in step S4 is input into the trained cryptonucleariasis pathogen recognition model for testing, when the loss value of the test set no longer decreases, the attenuated learning rate and the attenuation parameter are attenuated to 0.1, and the attenuated learning rate is the product of the initial learning rate and the attenuation parameter; repeat the training many times, and when the loss value of the validation set no longer decreases after 50 iterations, terminate the model training to complete the establishment of the cryptonucleariasis pathogen recognition model.
6. The method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology according to claim 5, characterized in that: In step S6, the specific steps of using deeplabv3+ deep learning network to extract the dorsal fin of the image in the adjusted large yellow croaker image data set obtained in step S3 are as follows: using deeplabv3+ deep learning network, the adjusted large yellow croaker image data set obtained in step S3 is input into the deeplabv3+ model for deep learning, using the Adam algorithm, selecting the Adam optimizer function as the parameter optimizer, setting the initial learning rate of the model to 0.01, and the maximum number of training iterations to 50; then re-inputting some images in the adjusted large yellow croaker image data set obtained in step S3 into the trained cryptocaryonosis pathogen recognition model for testing, when the loss value of the model no longer decreases, attenuating the learning rate and the attenuation parameter to 0.1, and the attenuated learning rate is the product of the initial learning rate and the attenuation parameter; after repeated training, when the loss value of the model no longer decreases after 50 iterations, terminating the model training, and completing the extraction of the large yellow croaker dorsal fin image.
7. The method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology according to claim 6, characterized in that: In step S7, the image enhancement processing is performed on the fish dorsal fin image dataset obtained in step S6, specifically: calling functions in the OpenCV function library, and using Python language to perform grayscale conversion and sharpening processing on the fish dorsal fin image; the grayscale conversion of the fish dorsal fin image is specifically performed by using a gamma correction method, and the sharpening processing of the fish dorsal fin image is specifically performed by using an unsharp masking method.
8. The method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology according to claim 7, characterized in that: In step S8, the image in the processed fish dorsal fin image dataset obtained in step S7 is segmented as follows: a function is called in the OpenCV function library, and a block image with a size of 50*50 is extracted on the fish dorsal fin image with the extreme point as the center using the Python language, and the image classification dataset is composed of block images with a size of 50*50.
9. The method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology according to claim 8, characterized in that: In step S11, the specific process of using the training set and validation set obtained in step S9 to train the large yellow croaker dorsal fin image classification model in step S10 is as follows: using the network model of the Efficientnet neural network as the initial weight, using the cross-validation method in the sklearn package of the Efficientnet neural network to randomly divide the images in the training set into seven parts, and training the Efficientnet neural network N times, each training is to merge one of the seven parts with the initial validation set into a validation set, and the remaining six parts are used as training sets to train the Efficientnet neural network; after each training, the parameters of the network model are adjusted using the Adam optimizer, and then training is performed again. After completing N training times, N trained network models will be obtained, and at least two relatively best groups of network models are selected, and the selected at least two groups of network models are fused using the mean method to obtain a large yellow croaker disease image recognition model.
10. The method for diagnosing Cryptocaryon irritans disease in large yellow croaker based on image recognition technology according to claim 9, characterized in that: In step S13, a mobile phone APP program is designed according to the optimal large yellow croaker disease image recognition model, and the specific process of completing the identification of cryptocaryonosis in the breeding process by taking pictures is as follows: the optimal cryptocaryonosis pathogen recognition model established in S5 and the optimal large yellow croaker disease image recognition model established in S11 are both converted into TFLite lightweight models, and then both are embedded in the mobile phone program APP to create an end-to-end Android application; wherein, the mobile phone program APP is written in Java language in Andriod Studio; after installation, the user uses local photos or mobile phone cameras to take pictures. When the photos are input into the program, click the recognition button, and the prediction results will be given at the bottom of the APP to realize the diagnosis of large yellow croaker cryptocaryonosis.
Citation Information
Patent Citations
Method and system for processing image of diseased fish body
CN102110294A
Plant leaf disease identification method based on OfficientNet network and deep learning
CN114581758A