Pseudosciaena crocea body surface white spot disease image acquisition device based on YOLOv5 algorithm

By designing a large yellow croaker body white spot disease image acquisition device based on the YOLOv5 algorithm, the problem of low image data acquisition efficiency in large breeding cages is solved, and high-quality multi-angle image data acquisition is realized, providing richness for the YOLOv5 algorithm The training data improves the recognition accuracy and stability of the breeding environment.

CN119445045APending Publication Date: 2025-02-14FUJIAN AGRI & FORESTRY UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411473394.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Monitoring and collecting data sets of individuals suffering from yellow croaker in large breeding cages are affected by the environment, with few effective data, and the image quality is affected by turbid seawater, low underwater light, and severe fish movements, resulting in the need of more YOLOv5 algorithm Only by training data can we achieve better results, and we cannot easily and efficiently collect multi-angle image data.

Method used

Design a large yellow croaker body white spot disease image acquisition device based on YOLOv5 algorithm, including a flow velocity simulation sink, image data acquisition system and water environment control area. By controlling the water flow velocity and water environment parameters, the swimming movement of the large yellow croaker is limited, and the collection is carried out. Clear image data of the diseased yellow croaker at multiple angles, and simulate image data under different turbidity, light intensity and group movement conditions.

Benefits of technology

It realizes convenient and efficient collection of large yellow croaker body white spot disease image data of various angles and types, providing a large number of high-quality data sets for the YOLOv5 algorithm, improving the algorithm's recognition accuracy, timely clearing of diseased individuals, and reducing the risk of infection , ensure the stability of the breeding environment and the healthy growth of fish.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445045A_ABST
    Figure CN119445045A_ABST
Patent Text Reader

Abstract

The invention provides a large yellow croaker body surface white spot disease image acquisition device based on a YOLOv5 algorithm. The large yellow croaker body surface white spot disease image acquisition device comprises a flow velocity simulation water tank (1); the flow velocity simulation water tank comprises a large yellow croaker image acquisition area (5), a flow velocity control area (25) and a water environment control area (13); an image data acquisition system is arranged at the large yellow croaker image acquisition area and comprises a plurality of cameras connected with a computer; the flow velocity simulation water tank firstly limits the swimming action of the detected pseudosciaena crocea to enable the action of the pseudosciaena crocea to be matched with the working parameters of the image data acquisition system, and then the image data acquisition system acquires the body surface image of the pseudosciaena crocea, analyzes the image based on a YOLOv5 algorithm, or trains the YOLOv5 algorithm by the acquired image; according to the invention, a large amount of independent, multi-angle and clear image data of the sick pseudosciaena crocea can be acquired, and the image data of the sick pseudosciaena crocea under the conditions of different turbidity, different illumination intensities and group movement in a culture environment can be simulated, so that the training effect of the YOLOv5 algorithm is more remarkable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of deep learning target detection and aquaculture, and in particular to a device for collecting images of white spot disease on the body surface of large yellow croaker based on a YOLOv5 algorithm. Background Art

[0002] The pathogen of white spot of yellow croaker (Larimichthys crocea) is Cryptocaryon irritans, a ciliate parasite that parasitizes the body surface and gill filaments. The diseased fish has increased mucus, and the epidermis proliferates to wrap the worm body into white spots. In severe cases, the scales fall off, the body surface is congested, and even blindness occurs. The disease is prone to occur in early summer or late summer and early autumn. Both fingerlings and spawning broodstock can be infected. The incidence rate is highest in the fingerling stage, and the severe infection rate can reach more than 70%, and the mortality rate is more than 30%. Yellow croaker is an important marine aquaculture species in China, and it is also an important aquaculture species for deep-sea aquaculture that my country has vigorously developed in recent years. White spot disease is easily contagious and can easily cause large-scale pathogen infection in yellow croaker. Therefore, it is crucial to quickly identify sick fish in aquaculture cages for the development of the yellow croaker aquaculture industry. YOLOv5 is an object detection algorithm based on deep learning, and its principle is based on the convolutional neural network (CNN) in deep learning technology. CNN can automatically extract features from images and use these features for recognition and classification. YOLOv5 has many advantages such as high accuracy, easy training, and light weight, but compared with other algorithms, YOLOv5 requires more training data to achieve better results. However, in the data set of diseased individuals of yellow croaker monitored and collected in large aquaculture cages, due to the influence of the environment, the effective data collected is relatively small, and the turbid seawater, low underwater light, and violent movement of fish may affect the quality of the collected data images of yellow croaker with white spot disease on the body surface. It is also necessary to manually adjust the color scale, contrast enhancement, and undercurrent prior algorithm to process the image, which increases the workload of image acquisition and cannot provide sufficient data for training. In addition, there are a large number of yellow croakers in the aquaculture cages and they are in motion, so it is impossible to collect multi-angle images of diseased individuals. Therefore, a yellow croaker body surface white spot disease image acquisition device based on the YOLOv5 algorithm is developed, which can more conveniently and efficiently collect data according to the image requirements of the YOLOv5 algorithm, and obtain yellow croaker body surface white spot disease image data of various angles and types. Provide a large amount of data set for the YOLOv5 algorithm to identify the white spot disease on the body surface of large yellow croaker cultured in cages, so that the YOLOv5 algorithm can accurately identify the white spot disease on the body surface of large yellow croaker, remove the diseased individuals in time, reduce the risk of infection, and ensure the stability of the breeding environment and the healthy growth of the fish population. Summary of the invention

[0003] The present invention proposes a large yellow croaker body surface white spot disease image acquisition device based on the YOLOv5 algorithm. On the one hand, it can collect a large number of independent, multi-angle, clear image data of diseased large yellow croakers. On the other hand, it can simulate the image data of diseased large yellow croakers under different turbidity, different light intensities, and group movement conditions in a breeding environment, so that the training effect of the YOLOv5 algorithm is more significant.

[0004] The present invention adopts the following technical solutions.

[0005] A yellow croaker body surface white spot disease image acquisition device based on the YOLOv5 algorithm, the acquisition device comprising a flow rate simulation tank (1); the flow rate simulation tank comprises a yellow croaker image acquisition area (5), a flow rate control area (25), and a water environment control area (13); an image data acquisition system is provided at the yellow croaker image acquisition area, and the image data acquisition system comprises a plurality of cameras connected to a computer;

[0006] The flow simulation tank first controls the water flow velocity and water environment parameters to limit the swimming movements of the tested large yellow croaker so that its movements can adapt to the working parameters of the image data acquisition system. The image data acquisition system is then used to collect the surface images of the large yellow croaker, and the images are analyzed based on the YOLOv5 algorithm, or the YOLOv5 algorithm is trained with the collected images.

[0007] The large yellow croaker image collection area (5) is a rectangular long slot, a side wall of the long side of which is provided with a drain port (6), and underwater cameras (9) connected to a computer (18) are evenly installed on the side wall where the drain port is provided; the shooting direction of the underwater camera is toward the inside of the long slot;

[0008] A high-definition camera (19) is arranged just above the large yellow croaker image collection area (5), and the high-definition camera's downward-looking shooting area covers a long slot, and each camera is connected to a computer (18) to form an image data collection system;

[0009] When the image data acquisition system needs to acquire images of large yellow croaker in a low-brightness environment for algorithm training, an opaque plastic light shield (20) is added to the high-definition camera during the acquisition process;

[0010] When the image data acquisition system needs to acquire images of large yellow croaker in a water environment with high turbidity for algorithm training, large impurities are added to the large yellow croaker image acquisition area (5) to simulate a water environment with high turbidity in a short time. After the image acquisition is completed, the flow rate simulation tank (1) is cleaned and the impurities are discharged through the drain port (6).

[0011] Both sides of the large yellow croaker image acquisition area (5) are provided with card slots (8), and the card slots (8) are connected to a mesh plate (7) inserted into the large yellow croaker image acquisition area, so as to divide the large yellow croaker image acquisition area (5) into a plurality of acquisition areas; the mesh plate (7) uses a barrier net with a large mesh size to block the large yellow croaker, and the effect of the barrier net on the flow rate can be ignored.

[0012] The two side ends of the large yellow croaker image acquisition area (5) are respectively a water inflow end and a water outflow end, and both the water inflow end and the water outflow end are connected to the flow rate control area.

[0013] Before operation, the flow velocity simulation tank (1) needs to be calibrated according to the size of the diseased large yellow croaker, the requirements for simulated sea conditions, etc., and a flow velocity measuring instrument LS300-A is used to detect the stability of the flow velocity of the water flowing through the U-shaped water flow turning baffle (3) to the large yellow croaker image acquisition area (5). The direction (28) of the water flow in the flow velocity control area (25) is opposite to the direction (29) of the water flow in the large yellow croaker image acquisition area (5) (e.g. Figure 3 );

[0014] The frequency converter (16) is connected to the propeller motor (15) to form a water flow control mechanism of the flow control area (25). When the water flow control mechanism is adjusted, the flow velocity of the large yellow croaker image acquisition area (5) is calibrated by a flow meter to establish a linear relationship between the motor adjustment frequency y and the flow velocity x (such as Figure 4 ):

[0015] y=0.56316x-4.5098 Formula 1;

[0016] (R 2 =0.99834).

[0017] A first side microporous filter screen plate (4) and a second side microporous filter screen plate (10) are respectively fixed at the connection parts where the water inflow end and the water outflow end are connected to the flow rate control area; a rectifying grid (11) is arranged behind the second side microporous filter screen plate at the water outflow end.

[0018] The flow rate control area (25) is provided with a propeller motor (15) connected to a frequency converter (16), the propeller motor being used to drive the water flow in the flow rate control area to flow toward the large yellow croaker image acquisition area at a desired speed, and a U-shaped water flow deflection baffle (3) being fixed at the water output end of the flow rate control area (25) for guiding the water flow output from the flow rate control area to the water inlet end of the large yellow croaker image acquisition area.

[0019] The water environment control area (13) includes an oxygen pump (17), a temperature sensing control switch (14), and a heating rod (12) connected to the temperature sensing control switch (14);

[0020] The equipment in the water environment control area (13) continues to work during the image acquisition process, and the oxygenation pump (17), the temperature sensing control switch (14), and the heating rod (12) are all in working condition, ensuring that the water environment of the entire flow rate simulation water tank (1) is in a stable state.

[0021] An acrylic cover plate (24) is installed directly above the flow velocity simulation water tank (1), and the acrylic cover plate (24) is screwed and fixed to the flow velocity simulation water tank (1) through the first screw hole (2);

[0022] A rectangular fish inlet (26) is provided on one side of the middle of the acrylic cover plate (24), the size of which is consistent with the large yellow croaker image acquisition area (5), and the acrylic cover plate (24) is provided with two water outlets (27);

[0023] The top of the acrylic cover plate (24) is fixedly connected to the acrylic rectangular cover plate (21) via a second screw hole (22), and a rectangular rubber ring (23) is installed below the acrylic rectangular cover plate (21), and the size of the rectangular rubber ring matches the rectangular fish inlet (26).

[0024] When the large yellow croaker body surface white spot disease image acquisition device is used in the image input input stage of the YOLOv5 algorithm model, according to the image training requirements of the YOLOv5 algorithm, a large number of independent, multi-angle, clear image data of diseased large yellow croaker are automatically collected, and the image data of diseased large yellow croaker under different turbidity, different light intensity, and group movement conditions in the breeding environment are automatically simulated to improve the image training effect of the YOLOv5 algorithm;

[0025] In the Backbone module of the YOLOv5 algorithm model, after the acquisition device has acquired the image, the image is input into the Focus module of the YOLOv5 algorithm model to extract features. In the Focus module, the input image is first sliced; this process samples every other pixel, and concentrates the width and height information of the image into the channel space without losing information to achieve image downsampling and retain all image information; then the Focus module recombines the slices obtained by the slicing operation, and further extracts features through a convolution operation CBS; the processing process outputs the downsampled feature maps CSP1_1, CSP1_2, and CSP1_3, and then the spatial size of the feature map is reduced through spatial pyramid pooling SPPF, while capturing multi-scale features, and the processed feature map is output as the Backbone to the Neck module;

[0026] The Neck module network is used to fuse feature maps of different scales. It improves the spatial resolution of the feature map by up-sampling up-conv, and concatenates it with the feature map of a higher layer in the Backbone to achieve feature fusion. Through this process, the CSP module of the YOLOv5 algorithm model further enhances the feature expression capability to extract more fine-grained features and outputs feature maps that carry rich contextual information.

[0027] In the Prediction module of the YOLOv5 algorithm model, this module is responsible for the final output stage of the model. In this stage, the feature map extracted and fused by Backbone and Neck is used to predict the category, position and confidence of the target, and generate the detection result, that is, to determine whether the large yellow croaker image data collected by the acquisition device has white spot disease on the body surface;

[0028] The YOLOv5 algorithm model includes a YOLOv5 target detection model for detecting disease white spot areas. In the YOLOv5 target detection model, the loss function is used to measure the difference between the model prediction value and the true value, and guide the model to optimize the model parameters by minimizing these differences; the YOLOv5 loss function L consists of three parts: classification loss ClassificationLoss, localization loss Localization Loss and confidence loss Objectness Loss;

[0029] L=L classification +L CIOU +L obj ;

[0030] Classification Loss is calculated using cross entropy loss; cross entropy loss is a loss function that measures the difference between the probability distribution predicted by the model and the probability distribution of the true label.

[0031] L classification =-(ylog(p)+(1-y)log(1-p));

[0032] y is the true label, which is 1 for the positive class, i.e. the target exists, and 0 for the negative class, i.e. the target does not exist. p is the probability that the model predicts the target exists.

[0033] Finally, the sample is expanded to: C is the total number of categories;

[0034] Localization Loss is used to measure the deviation between the bounding box predicted by the model and the true bounding box; YOLOv5 uses CIOU Loss as the calculation method for its positioning loss;

[0035] The calculation method of IoU is as follows: suppose there are two bounding boxes, one is the predicted bounding box and the other is the real bounding box; the coordinates of the predicted bounding box are (x p ,y p ,w p ,h p ), where (x p ,y p ) is the coordinate w of the upper left corner p and h p are the width and height respectively; the coordinates of the real bounding box (x g ,y g ,w g ,h g );

[0036] First, calculate the intersection: First, calculate the intersection area of ​​the two bounding boxes, that is, the coordinates of the overlapping parts of the two bounding boxes, such as Figure 6 ;

[0037] Let the coordinates of the upper left corner of the intersection area be (x max ,y max ), where x max =max(x p, x g ) and y max =max(y p ,y g ); the coordinates of the lower right corner of the intersection area are (x min ,y min ), where x min =min(x p +w p ,x g +w g ) and y min =min(y p +h p ,y g +h g ); the width and height of the intersection area are w intersect =x min -x max and intersect =y min -y max ; if w intersect >0 and intersect >0, indicating that the two boxes overlap, and the area of ​​the intersection is A intersect =w intersect ×h intersect ;

[0038] Then calculate the union: the area of ​​the predicted bounding box is A p =w p×h p ; The area of ​​the true bounding box is A g =w g ×h g ; The union area of ​​the two bounding boxes is A union =A p +A g -A intersect ;

[0039] Finally, IoU is the ratio of the intersection area to the union area, that is, IoU = A intersect / A union ; The value range of IoU is between 0 and 1. The closer the value is to 1, the higher the overlap between the predicted bounding box and the true bounding box, and the higher the accuracy of object detection. In the object detection task, a threshold is set to 0.5. When IoU is higher than this threshold, the detection result is considered correct.

[0040] The final formula of CIOU Loss is:

[0041] L CIOU =1-IoU+d 2 / c 2 +4 / π 2 arctan(w p / h p )arctan(w g / h g );

[0042] d is the distance between the center point of the predicted box and the center point of the real box, c is the diagonal length of the minimum closure box that can contain the predicted box and the real box;

[0043] Finally, there is the objectness loss. This part of the loss function is aimed at the model's prediction of whether there is an object in the bounding box. In YOLOv5 in this device, the binary cross-entropy loss is used to calculate the object confidence loss. The calculation formula is as follows:

[0044] L obj =-[t obj log(p obj )+(1-t obj )log(1-p obj )];

[0045] t obj is the confidence label of the true target, which is 1 if the bounding box contains the target, otherwise it is 0; p obj is the confidence score of the model's prediction.

[0046] Finally, the sample is expanded to:

[0047] C is the total number of categories;

[0048] So the final model adopts the loss function formula as follows:

[0049]

[0050] The present invention can collect data more conveniently and efficiently according to the image requirements of the YOLOv5 algorithm, and obtain image data of large yellow croaker body surface white spot disease of various angles and types. A large number of data sets are provided for the YOLOv5 algorithm to identify large yellow croaker body surface white spot disease in cage culture, so that the YOLOv5 algorithm can accurately identify large yellow croaker body surface white spot disease, remove sick individuals in time, reduce the risk of infection, and ensure the stability of the breeding environment and the healthy growth of fish.

[0051] On the one hand, the present invention can collect a large amount of independent, multi-angle, clear image data of diseased large yellow croaker, and on the other hand, it can simulate the image data of diseased large yellow croaker under different turbidity, different light intensity, and group movement conditions in the breeding environment, so that the training effect of the YOLOv5 algorithm is more significant. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0053] Attached Figure 1 1 is a schematic diagram of the structure of the YOLOv5 algorithm in the present invention;

[0054] Attached Figure 2 It is a schematic diagram of the overall structure of the device of the present invention;

[0055] Attached Figure 3 It is a schematic diagram of the structure of the flow rate control and image acquisition part of the device of the present invention;

[0056] Attached Figure 4 It is a schematic diagram of the relationship between flow velocity and frequency in the flow velocity control area;

[0057] Attached Figure 5 This is a schematic diagram of the image collection of large yellow croaker; (A) image collection of the back of large yellow croaker; B image collection of the side of large yellow croaker; C image of a large yellow croaker with white spot disease on its body surface; D image of a large yellow croaker with white spot disease on its body surface marked with diseased large yellow croaker)

[0058] Attached Figure 6 This is a schematic diagram of an image captured by a YOLOv5 algorithm prediction device;

[0059] In the figure: 1-flow rate simulation water tank; 2-first screw hole; 3-U-shaped water flow turning baffle; 4-first side microporous filter screen; 5-large yellow croaker image acquisition area; 6-drain outlet; 7-screen; 8-card slot; 9-underwater camera; 10-second side microporous filter screen; 11-rectifier grid; 12-heating rod; 13-water environment control area; 14-temperature sensing control switch; 15-propeller motor; 16-inverter; 18-computer; 19-high-definition camera; 20-light shield; 21-acrylic rectangular cover; 22-second screw hole; 23-rectangular rubber ring; 25-flow rate control area; 26-rectangular fish inlet. DETAILED DESCRIPTION

[0060] As shown in the figure, a yellow croaker body surface white spot disease image acquisition device based on the YOLOv5 algorithm, the acquisition device includes a flow rate simulation tank 1; the flow rate simulation tank includes a yellow croaker image acquisition area 5, a flow rate control area 25, and a water environment control area 13; an image data acquisition system is provided at the yellow croaker image acquisition area, and the image data acquisition system includes multiple cameras connected to a computer;

[0061] The flow simulation tank first controls the water flow velocity and water environment parameters to limit the swimming movements of the tested large yellow croaker so that its movements can adapt to the working parameters of the image data acquisition system. The image data acquisition system is then used to collect the surface images of the large yellow croaker, and the images are analyzed based on the YOLOv5 algorithm, or the YOLOv5 algorithm is trained with the collected images.

[0062] The large yellow croaker image acquisition area 5 is a rectangular long slot, a drain port 6 is provided at one side wall of the long side, and underwater cameras 9 connected to a computer 18 are evenly installed at the side wall where the drain port is provided; the shooting direction of the underwater camera is toward the inside of the long slot;

[0063] A high-definition camera 19 is provided just above the large yellow croaker image collection area 5, and the high-definition camera's downward-looking shooting area covers a long slot, and each camera is connected to a computer 18 to form an image data collection system;

[0064] When the image data acquisition system needs to acquire images of large yellow croaker in a low-brightness environment for algorithm training, an opaque plastic light shield 20 is added to the high-definition camera during the acquisition process;

[0065] When the image data acquisition system needs to obtain images of large yellow croaker in a water environment with high turbidity for algorithm training, large impurities are added to the large yellow croaker image acquisition area 5 to simulate a water environment with high turbidity in a short time. After the image acquisition is completed, the flow rate simulation tank 1 is cleaned and the impurities are discharged through the drain port 6.

[0066] Card slots 8 are provided on both sides of the large yellow croaker image acquisition area 5, and the card slots 8 are connected to the mesh plate 7 inserted into the large yellow croaker image acquisition area, so as to divide the large yellow croaker image acquisition area 5 into multiple acquisition areas; the mesh plate 7 uses a large mesh size isolation net to block the large yellow croaker, and the influence of the isolation net on the flow rate can be ignored.

[0067] The two side ends of the large yellow croaker image acquisition area 5 are respectively a water inflow end and a water outflow end, and both the water inflow end and the water outflow end are connected to the flow rate control area.

[0068] The flow rate simulation tank 1 needs to be calibrated according to the size of the diseased large yellow croaker, the requirements of the simulated sea conditions, etc. before operation, and a flow rate measuring instrument LS300-A is used to detect the stability of the water flow velocity flowing through the U-shaped water flow turning baffle 3 to the large yellow croaker image acquisition area 5. The water flow direction 28 in the flow rate control area 25 is opposite to the water flow direction 29 in the large yellow croaker image acquisition area 5. Figure 3 ;

[0069] The frequency converter 16 is connected to the propeller motor 15 to form a water flow control mechanism of the flow control area 25. When the water flow control mechanism is adjusted, the flow velocity of the large yellow croaker image acquisition area 5 is calibrated by a flow meter to establish a linear relationship between the motor adjustment frequency y and the flow velocity x. Figure 4 :

[0070] y=0.56316x-4.5098 Formula 1;

[0071] (R 2 =0.99834).

[0072] The first side microporous filter screen 4 and the second side microporous filter screen 10 are respectively fixed at the connection parts where the water inflow end, the water outflow end and the flow rate control area are connected; a rectifying grid 11 is arranged behind the second side microporous filter screen at the water outflow end.

[0073] The flow rate control area 25 is provided with a propeller motor 15 connected to a frequency converter (16), and the propeller motor is used to drive the water flow in the flow rate control area to flow to the large yellow croaker image acquisition area at a required speed. A U-shaped water flow turning baffle 3 is fixed at the water output end of the flow rate control area 25, which is used to guide the water flow output from the flow rate control area to the water inlet end of the large yellow croaker image acquisition area.

[0074] The water environment control area 13 includes an oxygen pump 17, a temperature sensing control switch 14, and a heating rod 12 connected to the temperature sensing control switch 14;

[0075] The equipment in the water environment control area 13 works continuously during the image acquisition process, and the oxygenation pump 17, the temperature sensing control switch 14, and the heating rod 12 are all in working state, ensuring that the water environment of the entire flow rate simulation tank 1 is in a stable state.

[0076] An acrylic cover plate 24 is installed directly above the flow velocity simulation water tank 1, and the acrylic cover plate 24 is screwed and fixed to the flow velocity simulation water tank 1 through the first screw hole 2;

[0077] A rectangular fish inlet 26 is provided on one side of the middle of the acrylic cover plate 24, and the size is consistent with the large yellow croaker image collection area 5, and the acrylic cover plate 24 is provided with two water outlets 27;

[0078] The top of the acrylic cover plate 24 is fixedly connected to the acrylic rectangular cover plate 21 through a second screw hole 22 , and a rectangular rubber ring 23 is installed below the acrylic rectangular cover plate 21 , and the size of the rectangular rubber ring matches the rectangular fish inlet 26 .

[0079] When the large yellow croaker body surface white spot disease image acquisition device is used in the image input input stage of the YOLOv5 algorithm model, according to the image training requirements of the YOLOv5 algorithm, a large number of independent, multi-angle, clear image data of diseased large yellow croaker are automatically collected, and the image data of diseased large yellow croaker under different turbidity, different light intensity, and group movement conditions in the breeding environment are automatically simulated to improve the image training effect of the YOLOv5 algorithm;

[0080] In the Backbone module of the YOLOv5 algorithm model, after the acquisition device has acquired the image, the image is input into the Focus module of the YOLOv5 algorithm model to extract features. In the Focus module, the input image is first sliced; this process samples every other pixel, and concentrates the width and height information of the image into the channel space without losing information to achieve image downsampling and retain all image information; then the Focus module recombines the slices obtained by the slicing operation, and further extracts features through a convolution operation CBS; the processing process outputs the downsampled feature maps CSP1_1, CSP1_2, and CSP1_3, and then the spatial size of the feature map is reduced through spatial pyramid pooling SPPF, while capturing multi-scale features, and the processed feature map is output as the Backbone to the Neck module;

[0081] The Neck module network is used to fuse feature maps of different scales. It improves the spatial resolution of the feature map by up-sampling up-conv, and concatenates it with the feature map of a higher layer in the Backbone to achieve feature fusion. Through this process, the CSP module of the YOLOv5 algorithm model further enhances the feature expression capability to extract more fine-grained features and outputs feature maps that carry rich contextual information.

[0082] In the Prediction module of the YOLOv5 algorithm model, this module is responsible for the final output stage of the model. In this stage, the feature map extracted and fused by Backbone and Neck is used to predict the category, position and confidence of the target, and generate the detection result, that is, to determine whether the large yellow croaker image data collected by the acquisition device has white spot disease on the body surface;

[0083] The YOLOv5 algorithm model includes a YOLOv5 target detection model for detecting disease white spot areas. In the YOLOv5 target detection model, the loss function is used to measure the difference between the model prediction value and the true value, and guide the model to optimize the model parameters by minimizing these differences; the YOLOv5 loss function L consists of three parts: classification loss ClassificationLoss, localization loss Localization Loss and confidence loss Objectness Loss;

[0084] L=L classification +L CIOU +L obj ;

[0085] Classification Loss is calculated using cross entropy loss; cross entropy loss is a loss function that measures the difference between the probability distribution predicted by the model and the probability distribution of the true label.

[0086] L classification =-(ylog(p)+(1-y)log(1-p));

[0087] y is the true label, which is 1 for the positive class, i.e. the target exists, and 0 for the negative class, i.e. the target does not exist. p is the probability that the model predicts the target exists.

[0088] Finally, the sample is expanded to: C is the total number of categories;

[0089] Localization Loss is used to measure the deviation between the bounding box predicted by the model and the true bounding box; YOLOv5 uses CIOU Loss as the calculation method for its positioning loss;

[0090] The calculation method of IoU is as follows: suppose there are two bounding boxes, one is the predicted bounding box and the other is the real bounding box; the coordinates of the predicted bounding box are (x p ,y p ,w p ,h p ), where (x p ,y p ) is the coordinate w of the upper left corner p and h p are the width and height respectively; the coordinates of the real bounding box (x g ,y g ,w g ,h g );

[0091] First, calculate the intersection: First, calculate the intersection area of ​​the two bounding boxes, that is, the coordinates of the overlapping parts of the two bounding boxes, such as Figure 6 ;

[0092] Let the coordinates of the upper left corner of the intersection area be (x max ,y max ), where x max =max(x p, x g ) and y max =max(y p ,y g ); the coordinates of the lower right corner of the intersection area are (x min ,y min ), where x min =min(x p +w p ,x g +w g ) and y min =min(y p +h p ,y g +h g ); the width and height of the intersection area are w intersect =x min -x max and intersect =y min -y max ; if w intersect >0 and intersect >0, indicating that the two boxes overlap, and the area of ​​the intersection is A intersect =w intersect ×h intersect ;

[0093] Then calculate the union: the area of ​​the predicted bounding box is A p =w p×h p ; The area of ​​the true bounding box is A g =w g ×h g ; The union area of ​​the two bounding boxes is A union =A p +A g -A intersect ;

[0094] Finally, IoU is the ratio of the intersection area to the union area, that is, IoU = A intersect / A union ; The value range of IoU is between 0 and 1. The closer the value is to 1, the higher the overlap between the predicted bounding box and the true bounding box, and the higher the accuracy of object detection. In the object detection task, a threshold is set to 0.5. When IoU is higher than this threshold, the detection result is considered correct.

[0095] The final formula of CIOU Loss is:

[0096] L CIOU =1-IoU+d 2 / c 2 +4 / π 2 arctan(w p / h p )arctan(w g / h g );

[0097] d is the distance between the center point of the predicted box and the center point of the real box, c is the diagonal length of the minimum closure box that can contain the predicted box and the real box;

[0098] Finally, there is the objectness loss. This part of the loss function is aimed at the model's prediction of whether there is an object in the bounding box. In YOLOv5 in this device, the binary cross-entropy loss is used to calculate the object confidence loss. The calculation formula is as follows:

[0099] L obj =-[t obj log(p obj )+(1-t obj )log(1-p obj )];

[0100] t obj is the confidence label of the true target, which is 1 if the bounding box contains the target, otherwise it is 0; p obj is the confidence score of the model's prediction.

[0101] Finally, the sample is expanded to:

[0102] C is the total number of categories;

[0103] So the final model adopts the loss function formula as follows:

[0104]

[0105] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A device for collecting images of white spot disease on the body surface of large yellow croaker based on the YOLOv5 algorithm, characterized in that: The acquisition device comprises a flow rate simulation water tank (1); the flow rate simulation water tank comprises a large yellow croaker image acquisition area (5), a flow rate control area (25), and a water environment control area (13); an image data acquisition system is provided at the large yellow croaker image acquisition area, and the image data acquisition system comprises a plurality of cameras connected to a computer; The flow simulation tank first controls the water flow velocity and water environment parameters to limit the swimming movements of the tested large yellow croaker so that its movements can adapt to the working parameters of the image data acquisition system. The image data acquisition system is then used to collect the surface images of the large yellow croaker, and the images are analyzed based on the YOLOv5 algorithm, or the YOLOv5 algorithm is trained with the collected images.

2. A large yellow croaker body surface white spot disease image acquisition device based on YOLOv5 algorithm according to claim 1, characterized in that: The large yellow croaker image collection area (5) is a rectangular long slot, a side wall of the long side of which is provided with a drain port (6), and underwater cameras (9) connected to a computer (18) are evenly installed on the side wall where the drain port is provided; the shooting direction of the underwater camera is toward the inside of the long slot; A high-definition camera (19) is arranged just above the large yellow croaker image collection area (5), and the high-definition camera's downward-looking shooting area covers a long slot, and each camera is connected to a computer (18) to form an image data collection system; When the image data acquisition system needs to acquire images of large yellow croaker in a low-brightness environment for algorithm training, an opaque plastic light shield (20) is added to the high-definition camera during the acquisition process; When the image data acquisition system needs to acquire images of large yellow croaker in a water environment with high turbidity for algorithm training, large impurities are added to the large yellow croaker image acquisition area (5) to simulate a water environment with high turbidity in a short time. After the image acquisition is completed, the flow rate simulation tank (1) is cleaned and the impurities are discharged through the drain port (6).

3. A large yellow croaker body surface white spot disease image acquisition device based on YOLOv5 algorithm according to claim 2, characterized in that: Both sides of the large yellow croaker image acquisition area (5) are provided with card slots (8), and the card slots (8) are connected to a mesh plate (7) inserted into the large yellow croaker image acquisition area, so as to divide the large yellow croaker image acquisition area (5) into a plurality of acquisition areas; the mesh plate (7) uses a barrier net with a large mesh size to block the large yellow croaker, and the effect of the barrier net on the flow rate can be ignored.

4. A large yellow croaker body surface white spot disease image acquisition device based on YOLOv5 algorithm according to claim 2, characterized in that: The two side ends of the large yellow croaker image collection area (5) are respectively a water inflow end and a water outflow end, and both the water inflow end and the water outflow end are connected to the flow rate control area.

5. A large yellow croaker body surface white spot disease image acquisition device based on YOLOv5 algorithm according to claim 4, characterized in that: Before operation, the flow velocity simulation tank (1) needs to be calibrated according to the size of the diseased large yellow croaker, the requirements for simulated sea conditions, etc., and a flow velocity measuring instrument is used to detect the stability of the flow velocity of the water flowing through the U-shaped water flow turning baffle (3) to the large yellow croaker image acquisition area (5); the frequency converter (16) is connected to the propeller motor (15) to form a water flow control mechanism of the flow velocity control area (25); when the water flow control mechanism is adjusted, the flow velocity of the large yellow croaker image acquisition area (5) is calibrated by a flow velocity meter to establish a linear relationship between the motor adjustment frequency y and the flow velocity x: y=0.56316x-4.5098 Formula 1; (R 2 =0.99834)。 6. A large yellow croaker body surface white spot disease image acquisition device based on YOLOv5 algorithm according to claim 4, characterized in that: A first side microporous filter screen plate (4) and a second side microporous filter screen plate (10) are respectively fixed at the connection parts where the water inflow end and the water outflow end are connected to the flow rate control area; a rectifying grid (11) is arranged behind the second side microporous filter screen plate at the water outflow end.

7. A large yellow croaker body surface white spot disease image acquisition device based on YOLOv5 algorithm according to claim 4, characterized in that: The flow rate control area (25) is provided with a propeller motor (15) connected to a frequency converter (16), the propeller motor being used to drive the water flow in the flow rate control area to flow toward the large yellow croaker image acquisition area at a desired speed, and a U-shaped water flow deflection baffle (3) being fixed at the water output end of the flow rate control area (25) for guiding the water flow output from the flow rate control area to the water inlet end of the large yellow croaker image acquisition area.

8. A large yellow croaker body surface white spot disease image acquisition device based on YOLOv5 algorithm according to claim 1, characterized in that: The water environment control area (13) includes an oxygen pump (17), a temperature sensing control switch (14), and a heating rod (12) connected to the temperature sensing control switch (14); The equipment in the water environment control area (13) continues to work during the image acquisition process, and the oxygenation pump (17), the temperature sensing control switch (14), and the heating rod (12) are all in working condition, ensuring that the water environment of the entire flow rate simulation water tank (1) is in a stable state.

9. A large yellow croaker body surface white spot disease image acquisition device based on YOLOv5 algorithm according to claim 1, characterized in that: An acrylic cover plate (24) is installed directly above the flow velocity simulation water tank (1), and the acrylic cover plate (24) is screwed and fixed to the flow velocity simulation water tank (1) through the first screw hole (2); A rectangular fish inlet (26) is provided on one side of the middle of the acrylic cover plate (24), the size of which is consistent with the large yellow croaker image acquisition area (5), and the acrylic cover plate (24) is provided with two water outlets (27); The top of the acrylic cover plate (24) is fixedly connected to the acrylic rectangular cover plate (21) via a second screw hole (22), and a rectangular rubber ring (23) is installed below the acrylic rectangular cover plate (21), and the size of the rectangular rubber ring matches the rectangular fish inlet (26).

10. A large yellow croaker body surface white spot disease image acquisition device based on YOLOv5 algorithm according to claim 1, characterized in that: When the large yellow croaker body surface white spot disease image acquisition device is used in the image input input stage of the YOLOv5 algorithm model, according to the image training requirements of the YOLOv5 algorithm, a large number of independent, multi-angle, clear image data of diseased large yellow croaker are automatically collected, and the image data of diseased large yellow croaker under different turbidity, different light intensity, and group movement conditions in the breeding environment are automatically simulated to improve the image training effect of the YOLOv5 algorithm; In the Backbone module of the YOLOv5 algorithm model, after the acquisition device has acquired the image, the image is input into the Focus module of the YOLOv5 algorithm model to extract features. In the Focus module, the input image is first sliced; this process samples every other pixel, and concentrates the width and height information of the image into the channel space without losing information to achieve image downsampling and retain all image information; then the Focus module recombines the slices obtained by the slicing operation, and further extracts features through a convolution operation CBS; The processing process outputs the downsampled feature maps CSP1_1, CSP1_2, and CSP1_3, and then the spatial size of the feature maps is reduced through spatial pyramid pooling SPPF, while capturing multi-scale features. The processed feature maps are used as the output of Backbone and enter the Neck module; The Neck module network is used to fuse feature maps of different scales. It improves the spatial resolution of the feature map by up-sampling up-conv, and concatenates it with the feature map of a higher layer in the Backbone to achieve feature fusion. Through this process, the CSP module of the YOLOv5 algorithm model further enhances the feature expression capability to extract more fine-grained features and outputs feature maps that carry rich contextual information. In the Prediction module of the YOLOv5 algorithm model, this module is responsible for the final output stage of the model. In this stage, the feature maps extracted and fused by the previous Backbone and Neck are used to predict the category, position and confidence of the target, and generate the detection result, that is, to determine whether the large yellow croaker image data collected by the acquisition device has white spot disease on the body surface.

Citation Information

Cited By

  • Mariculture net cage management and control system

    CN120143724A