Zebra fish phenotype recognition and quantitative analysis method based on YOLOv8
Through the YOLOv8 instance segmentation network, the problem of low accuracy in zebrafish phenotype recognition and quantitative analysis is solved, and high-precision identification and quantitative analysis of body surface morphology of juvenile zebrafish is achieved, supporting high-throughput pollutant toxicity assessment .
Patent Information
- Application Number
- CN202410943297.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art In zebrafish phenotype recognition and quantitative analysis, the accuracy is not high, especially the calculation of head area and body length is inaccurate, and all phenotypic parameters cannot be obtained from one picture at the same time.
Using the example segmentation network method based on YOLOv8, through image data augmentation and instance segmentation network model training, high-precision analysis of the body surface morphology of zebrafish juvenile fish, including the accuracy of the head, eyes, pericardial, yolk sac and fish body length Identification and quantitative analysis.
High-precision recognition of the contours of various tissues of zebrafish juvenile fish is achieved, with an average recognition accuracy of 94.5%, which reduces labor costs, improves efficiency and accuracy, and supports high-throughput pollutant toxicity assessment.
Smart Images

Figure CN119007210A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a zebrafish phenotype recognition and quantitative analysis method based on YOLOv8. Background Art
[0002] Currently, there is a lack of toxicity data for many new pollutants, making it difficult to assess their environmental risks. Therefore, there is an urgent need for high-throughput toxicological assessments of pollutants detected in the environment.
[0003] Zebrafish is one of the model organisms widely used in medicine, life sciences, toxicology and other disciplines. It has the advantages of low breeding cost, short breeding cycle and in vitro fertilization. Zebrafish combined with a high-content cell imaging analysis system (referred to as a high-content imaging system) can obtain a large number of highly reliable biological images in a single experiment, realizing high-throughput screening of pollutant toxicity. These images contain a large number of phenotypic parameters of zebrafish (such as body length, yolk sac area, pericardial area, etc.), each of which is a potential indicator for measuring the toxicity of chemicals. However, how to quickly and quantitatively analyze each indicator based on images is an urgent problem to be solved.
[0004] Deep learning methods are widely used in image processing, video analysis, and speech recognition. Compared with traditional machine learning methods, deep learning methods overcome the limitations of manually measuring phenotypic features by automatically optimizing feature extraction and classification. So far, researchers have used deep learning methods to build recognition models for zebrafish phenotypic deformities and phenotypic features of some body organs.
[0005] For example, the document "Environ. Sci. Technol. 2023, 57 (46), 18127-18138." Based on the computer vision models Mask R-CNN and TensorMask, a model was constructed to identify 8 abnormal phenotypes of zebrafish (head hemorrhage, mandibular deformity, uninflated swim bladder, pericardial edema, yolk sac edema, spinal curvature, death, and non-hatching) and 8 phenotypic parameters (eyes, head, jaw, heart, yolk sac, spine, tail, and swim bladder). The average accuracy of the model was 52.37%-98.23% and 50.23%-94.8%, respectively. Among them, the average accuracy of the model for the recognition of the heart, yolk sac, and tail was only 50.23%, 71.6%, and 53.2%, respectively. In addition, the study can also quantitatively analyze the area, body length, and curvature of the eyes, head, jaw, heart, yolk sac, and swim bladder of zebrafish. However, the calculation of the head area in the article is based on the calculation after deducting the eyes and mandible, which cannot fully and truly reflect the size of the head area; the calculation of body length is based on the three-point positioning of the eyes, spine and tail. This method will be extremely inaccurate for fish with large spinal or tail curvature deformities. Moreover, the above methods cannot derive all phenotypic parameters based on one picture at the same time. Patent CN113361353A developed a model for identifying five zebrafish deformities (tail deformity, pericardial edema, back deformity, yolk edema, and incomplete swim bladder development) based on the DeepLabV3Plus method and a scoring method for the degree of deformity; Patent CN113409255A developed a model and scoring method for identifying one or more morphologies of normal hatching, spinal curvature, pericardial edema, post-hatching necrosis, tail downbend, tail upturned, yolk extension deformity, and yolk sac edema in zebrafish based on the Mask R-CNN method.
[0006] In summary, most of these existing technologies identify and evaluate specific deformed morphologies or abnormal phenotypes of zebrafish larvae, and the quantitative analysis accuracy of phenotypic organ size is not high. Pollutants have a variety of developmental toxic effects on zebrafish larvae. In addition to causing deformities, they can also cause subtle changes in eyes, head, body length, etc. that cannot be observed manually. Therefore, it is necessary to develop models and methods that can automatically segment and accurately identify zebrafish phenotypes (such as body length, yolk sac area, pericardial area, head area, eye area, etc.) and can simultaneously perform quantitative analysis. Summary of the invention
[0007] The purpose of the present invention is to provide a zebrafish phenotype identification and quantitative analysis method based on YOLOv8, aiming to solve at least one of the problems mentioned in the background technology; the present invention can accurately segment and extract the area and length of multiple organ regions based on a picture, and assist the high-content imaging system to perform high-throughput screening of pollutants that induce developmental toxicity.
[0008] The present invention is implemented as follows: a zebrafish phenotype identification and quantitative analysis method based on YOLOv8, the method comprising:
[0009] S100: acquiring images of samples treated with different compounds at different concentrations, and establishing an image dataset of the morphological phenotype of the samples;
[0010] Among them, zebrafish were used as samples, and zebrafish embryos and zebrafish larvae were used to characterize the biological morphology of samples at different stages;
[0011] S200: Divide the image dataset into a training dataset, a validation dataset, and a test dataset, and perform preprocessing and data enhancement on the training dataset to expand the scale and diversity of the training dataset;
[0012] Among them, preprocessing: use Labelme open source annotation tool to annotate the collected image dataset to obtain the outline of the head, eyes, pericardium, yolk sac and body of the zebrafish fry;
[0013] Data enhancement: Use the open source software library, imgaug, to amplify the image data set through the image distortion algorithm, and enhance all data through geometric transformation, color transformation, noise addition, etc.; Use 13 image enhancement algorithms, including salt and pepper noise, Gaussian noise, Gaussian blur, rotation, translation, scaling, horizontal flip, vertical flip, gamma contrast adjustment, linear contrast adjustment, brightness transformation, hue and saturation transformation, and snowflake effect, to enhance the image data set in a random threshold and random combination manner; For the images obtained through data enhancement, their corresponding labels are calculated through the image transformation matrix;
[0014] S300: labeling the sample image with information, and inputting the constructed instance segmentation network model into the model training to obtain a trained instance segmentation network model;
[0015] S400: Using the trained instance segmentation network model, morphological recognition and segmentation are performed on sample images treated with different compounds at different concentrations to obtain surface morphological data information of the samples.
[0016] Furthermore, the step S100 includes:
[0017] The zebrafish fertilized eggs were exposed to the compounds within 5 hours of fertilization and cultured in a light-controlled incubator at 28.5°C with a 14-h light / 10-h dark cycle;
[0018] The poison solution was renewed every 24 hours, and starting from 24 hours after fertilization, 210uL of 5mmol / L N-phenylthiourea (PTU) was additionally added to inhibit pigment production, and cultured until 72 hours after fertilization;
[0019] The zebrafish larvae were transferred to a 96-well plate and anesthetized with tricaine (MS-222), centrifuged at 200 rpm for 2 min, and adjusted so that the ventral sides were facing the same direction and the eyes were overlapped;
[0020] A high-content imaging system was used for image acquisition, in which the TL10 bright field channel was selected and the confocal mode was used for layer scanning under a 4x objective.
[0021] Furthermore, in step S200, the imgaug library is used to perform data augmentation on the training data set through an image distortion algorithm, and all data are enhanced through different image enhancement algorithms according to random thresholds and random combinations.
[0022] Furthermore, in step S200, the image data set is divided into: 80% as a training data set, 10% as a verification data set, and 10% as a test data set.
[0023] Furthermore, the instance segmentation network model includes a Backbone network structure, a Neck network structure and a Head network structure, which are used for feature extraction, feature fusion and prediction respectively.
[0024] Furthermore, the Backbone network structure adopts CSPDarknet53, which extracts different levels of information of the image through multiple convolutional layers, residual blocks and C2f modules;
[0025] The Neck network structure includes a feature pyramid network and a feature attention enhancement network; the feature pyramid network fuses feature maps of different scales through top-down and lateral connections, and the feature attention enhancement network further enhances the expression ability of the feature map, combines global and local information, and ensures that target detection and segmentation tasks can handle targets of different scales; the C2f module divides the feature map into two parts, performs convolution operations on each part, and then fuses them to reduce the amount of calculation and improve the feature expression ability;
[0026] The Head network structure includes a detection head and a segmentation head, and the detection head and the segmentation head jointly implement the instance segmentation task;
[0027] Among them, the detection head adopts the Anchor-Free method to generate the bounding box and category prediction of the target by predicting whether each feature point is the target center point and its offset, bounding box and category; the segmentation head starts from the feature map of the Neck network structure, and through a series of convolution and upsampling operations, gradually restores it to the same resolution as the input image, and finally generates a pixel-level segmentation mask for each detection box; the segmentation head uses the RoIAlign technology to accurately align the feature map with the detection box to avoid pixel-level deviation and improve the accuracy of the mask.
[0028] Furthermore, when the model is trained in step S300, NVIDIA's graphics processor GeForceRTX 4060Ti 8G is used for calculation, and CUDA12.1 library is used for acceleration; the model can be established based on the Pytorch deep learning framework.
[0029] The present invention provides a zebrafish phenotype recognition and quantitative analysis method based on YOLOv8, through which the surface morphology of zebrafish fry is analyzed with high precision for the toxicity assessment of pollutants; by identifying and detecting the morphological characteristics of each part of the sample, the area of the head, eyes, pericardium and yolk sac and the length of the fish body are extracted, and a zebrafish morphology automatic measurement model, namely an instance segmentation network model, is established to achieve fast and accurate batch processing of experimental images. This method can more scientifically and accurately identify and quantify the head and body length areas, and the average accuracy rate of identifying the contours of various zebrafish tissues reaches 94.5%. On the one hand, it greatly reduces labor costs and improves efficiency, and on the other hand, it also ensures accuracy and reproducibility. The present invention fully combines deep learning technology with the zebrafish high-throughput model, bringing new inspiration to the toxicity data processing method of traditional model organisms. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of a process for zebrafish phenotype identification and quantitative analysis based on YOLOv8 provided in an embodiment of the present invention;
[0031] Figure 2 The original image after data enhancement in the embodiment of the present invention;
[0032] Figure 3 A schematic diagram of the structure of an instance segmentation network model in an embodiment of the present invention;
[0033] Figure 4 A schematic diagram of the backbone network structure used in an embodiment of the present invention;
[0034] Figure 5 Schematic diagram of the principle of skeleton extraction operation in an embodiment of the present invention;
[0035] Figure 6 This is a diagram showing the result of predicting an image in an embodiment of the present invention;
[0036] Figure 7 A schematic diagram of the principle flow of a zebrafish phenotype recognition and quantitative analysis method based on YOLOv8 provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0038] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.
[0039] like Figure 1 , Figure 7 As shown, in one embodiment, an embodiment of the present invention provides a zebrafish phenotype recognition and quantitative analysis method based on YOLOv8, the method comprising:
[0040] S100: acquiring images of samples treated with different compounds at different concentrations, and establishing an image dataset of the morphological phenotype of the samples;
[0041] Generally, toxicological assessments are conducted on pollutants, so the different compounds here are specifically pollutants or new pollutants that need to be evaluated;
[0042] In one scenario, zebrafish embryos were exposed to poison within 5 hours of fertilization and cultured in a constant temperature incubator at 28.5°C with a 14h light / 10h dark cycle. The poison solution was updated every 24 hours, and starting from 24hpf (i.e., 24 hours after fertilization), 210uL of 5mmol / L N-phenylthiourea (PTU) was additionally added to inhibit pigment production, and cultured until 72hpf; transferred to a 96-well plate, and zebrafish larvae (72hpf) were anesthetized with tricaine (MS-222), centrifuged at 200rpm for 2min, adjusted so that the ventral sides were facing the same direction, and the eyes were overlapped; layer scanning was performed using a high-content imaging system, the TL10 bright field channel was selected, and layer scanning was performed using the confocal mode under a 4x objective lens, and image acquisition was performed to establish an image dataset of zebrafish surface morphology;
[0043] In one scenario, when establishing an image dataset of zebrafish body surface morphology, the image dataset can be classified, with 80% as a training dataset, 10% as a validation dataset, and 10% as a test dataset, and the JSON label file corresponding to the image is converted into a TXT text file to construct a dataset in the format required by the YOLOv8 model.
[0044] S200: Divide the image dataset into a training dataset, a validation dataset, and a test dataset, and perform preprocessing and data enhancement on the training dataset to expand the scale and diversity of the training dataset;
[0045] Among them, preprocessing: use Labelme open source annotation tool to annotate the collected image dataset to obtain the outline of the head, eyes, pericardium, yolk sac and body of the zebrafish fry;
[0046] Data enhancement: Use the open source software library (imgaug library) to perform data augmentation on the image dataset (especially the training dataset) through the image distortion algorithm, and perform data enhancement on all data through geometric transformation, color transformation, noise addition, etc. The image dataset is enhanced by using 13 image enhancement algorithms including salt and pepper noise, Gaussian noise, Gaussian blur, rotation, translation, scaling, horizontal flip, vertical flip, gamma contrast adjustment, linear contrast adjustment, brightness transformation, hue and saturation transformation, and snowflake effect, in accordance with random thresholds and random combinations. For the images obtained through data enhancement, their corresponding labels are calculated through the image transformation matrix; the results can be referred to Figure 2 .
[0047] In this way, the amount of training data can be increased, allowing the model to see more types of samples during training, improving the model's generalization ability and reducing the risk of the model remembering the training data and being unable to adapt to new data; solving the problem of single environmental factors such as background elements and lighting conditions in manually taken images in the same batch and insufficient training data, and improving the model's robustness for zebrafish instance segmentation and measurement.
[0048] like Figure 2 , demonstrating the data enhancement effect of the image dataset through the imgaug library; a total of 13 image processing algorithms are applied, including salt and pepper noise, Gaussian noise, Gaussian blur, rotation, translation, scaling, horizontal flip, vertical flip, gamma contrast adjustment, linear contrast adjustment, brightness transformation, hue and saturation transformation, and snowflake effect.
[0049] S300: labeling the sample image with information, and inputting the constructed instance segmentation network model into the model training to obtain a trained instance segmentation network model;
[0050] Among them, information labeling can also be completed in the preprocessing stage; for example: using the Labelme open source labeling tool to label the collected image dataset.
[0051] S400: Using the trained instance segmentation network model, morphological recognition and segmentation are performed on sample images treated with different compounds at different concentrations to obtain surface morphological data information of the samples.
[0052] In an example of this embodiment, an image is input into a trained model for prediction, the prediction graph is read, data of the head, eyes, pericardium, yolk sac and body length are obtained, and the zebrafish surface morphology index data of the same batch are output to an Excel file.
[0053] In this embodiment, when the method is used to evaluate the developmental toxicity of pollutants to zebrafish, a high-content imaging system is used to collect zebrafish images, and a YOLOv8 model, i.e., a trained instance segmentation network model, is used to semi-automatically identify target graphics and obtain parameters, and by collecting surface images of zebrafish embryos / juveniles, the phenotypic organ multi-parameter changes are analyzed to achieve phenotypic developmental toxicity evaluation and screening of pollutants. It has the characteristics of high throughput, stable results, and can quickly and accurately evaluate and screen the phenotypic developmental toxicity of pollutants using multi-parameter indicators.
[0054] In one usage scenario of this embodiment, when performing image acquisition, pre-imaging processing can be performed first: the fixed position is to use tricaine (MS-222) to anesthetize the zebrafish fry, anesthetize the zebrafish fry in the 96-well plate, and centrifuge at 200 rpm for 2 minutes, adjust the ventral side to face the same direction, and overlap the eyes;
[0055] After that, image data collection is performed, including:
[0056] On the machine: Run the high-content imaging system (ImageXpress Micro Confocal), open the MetaXpress software, and load the black transparent 96-well plate containing the pollutant-treated zebrafish embryos / larvae;
[0057] Set the imaging program parameters: select 4X Plan Apo objective lens, wide-field non-confocal imaging mode, 2×2 fields of view per well, and each field of view is adjacent to each other; select laser autofocus and Z-layer vertical shooting for acquisition settings, laser autofocus selects to focus on the bottom of the plate and then offset according to the thickness of the bottom plate, select TL 10 bright field channel, turn on digital confocal, layer scanning mode, shoot all wells, set the analysis program to "Findingfish", save the program and name it "4X-TL 10";
[0058] Imaging and image preservation: Name the experiment and run the program for high-content fully automatic imaging;
[0059] Image browsing and data analysis: select the data named in the experiment, select the entire field of view of the image, preview it, and then perform image analysis. Select Create Montages and Overlays (an image processing option of the high-content imaging system) for analysis, obtain bright field images, and automatically save the images to establish an image dataset of the morphological phenotype of zebrafish larvae.
[0060] In an example of this embodiment, appropriate parameter settings are performed in various image processing algorithms; specifically, as follows:
[0061] The addition ratio of salt and pepper noise is set to 0.01;
[0062] The noise intensity of Gaussian noise is set to 5;
[0063] The calculation formula for image blur is:
[0064]
[0065] The calculation formula of Gaussian blur is:
[0066]
[0067] The standard deviation of the blur level is set between 0 and 3.
[0068] The calculation formula for rotation is:
[0069]
[0070] Where x, y are the coordinates after rotation, x0, y0 are the coordinates before rotation, a is the rotation angle, x c is the horizontal coordinate of the rotation center, y c is the ordinate of the rotation center.
[0071] The translation is random, with a percentage range of -20% to 20%.
[0072] The calculation formula for scaling is:
[0073]
[0074] Where x, y are the coordinates after scaling, x0, y0 are the coordinates before scaling, S x is the horizontal scaling ratio, S y is the vertical scaling factor.
[0075] The calculation formula for horizontal flipping is: [x, y, l] = [W-x0, y0, 1] (5);
[0076] The calculation formula for vertical flipping is: [x, y, 1] = [x0, H - y0, 1] (6);
[0077] Where x, y are the coordinates after flipping, x0, y0 are the coordinates before flipping, H is the height of the image, and W is the width of the image.
[0078] Gamma contrast adjustment changes the brightness distribution of an image through nonlinear transformation. For the input pixel value I and the output pixel value O, the formula for gamma correction is:
[0079] O(x, y) = I γ (x, y) (7)
[0080] where I is the pixel value normalized to [0, 1].
[0081] Linear contrast adjustment adjusts the contrast of an image through linear transformation, making the distribution range of image pixel values wider or more compact, thereby enhancing or weakening the contrast. The calculation formula is:
[0082] O(x,y)=α(I(x,y)-μ)+μ (8)
[0083] Where I is the input pixel value, O is the output pixel value, a is the contrast factor, and μ is the average value of the image pixel values.
[0084] Brightness transformation is achieved by performing linear addition operation on each pixel value of the image. The calculation formula is:
[0085] O(x,y)=I(x,y)+Δ (9)
[0086] Where I is the input pixel value, O is the output pixel value, and Δ is the brightness adjustment value.
[0087] Hue and saturation transformations are implemented by converting an image from RGB color space to HSV color space. In HSV color space, hue transformation changes the overall color of an image by adjusting the value of the hue channel, while saturation transformation changes the purity or intensity of the color by adjusting the value of the saturation channel. After adjustment, the image is converted back to RGB color space. Hue transformation is usually implemented by addition and modulo operations, while saturation transformation is usually implemented by multiplication. These transformations can flexibly adjust the color properties of an image without affecting its brightness and details.
[0088] The snowflake effect simulates the shape of snowflakes by randomly generating white dots, adjusting the size and number, blending them with the original image, and then applying motion blur to simulate the effect of snowflakes falling.
[0089] In one example of this example, when performing model training, a model loss function can be set to facilitate a finite number of convergences of the model training; this facilitates judging the training effect of the model.
[0090] Among them, the model loss functions are divided into four categories: bounding box regression loss, confidence loss, classification loss, and mask loss;
[0091] The bounding box regression loss is used to measure the difference between the predicted bounding box and the true bounding box, which allows the model to locate the object more accurately.
[0092] Bounding box regression loss function:
[0093]
[0094] IoU is the intersection over union ratio between the predicted box and the real box, ρ(b, b g ) is the Euclidean distance between the center points of the predicted box and the true box, c is the diagonal length of the minimum closure area surrounding the two, a is the weight balance factor, and v is a parameter that measures the consistency of the aspect ratio of the predicted box and the true box.
[0095] Confidence loss is used to measure the accuracy of the model's confidence prediction of the detected target, which can improve the accuracy of the model's judgment on whether the target exists or not.
[0096] Confidence loss function:
[0097] L conf =-(y log(p)+(1-y)log(1-p)) (11)
[0098] y is the true label (1 if the target is present, 0 if the target is not present), and p is the confidence of the model's prediction.
[0099] Classification loss is used to measure the model's prediction accuracy for the detected target category and can improve the accuracy of target classification.
[0100] Classification loss function:
[0101] N is the number of categories, yi is the true category label, p i is the class probability predicted by the model.
[0102] The mask loss function includes Binary Cross-Entropy Loss (BCELoss) and Dice Loss (Dice similarity coefficient loss function, a loss function based on the Dice coefficient), which are used to measure the difference between the mask predicted by the model and the true mask, so that the model can accurately segment each pixel of the target and improve the accuracy of the instance segmentation mask.
[0103] Binary cross entropy loss function:
[0104]
[0105] Dice Loss:
[0106]
[0107] Combining the above parts, the total loss function of the YOLOv8 model for instance segmentation can be expressed as:
[0108] L=λ CIoU L CIoU +λ conf L conf +λ cls L cls +λ mask (L mask +L Dice ) (15)
[0109] Among them, λ CIoU , conf , cls , mask is the weight coefficient that balances the loss of each part. By optimizing these loss functions, the model can perform target monitoring and instance segmentation more accurately, thereby performing well in the segmentation task of body representation of zebrafish larvae.
[0110] When the YOLOv8 model in this example performs instance segmentation, its model architecture combines the requirements of target detection and instance segmentation, and achieves efficient feature extraction and prediction through the design of a multi-layer network. Figure 3 , Figure 4 , the backbone network of the YOLOv8 model (specifically CSPDarknet53) extracts low-level and high-level features of the image to obtain rich feature maps. This part mainly includes convolutional layers for preliminary feature extraction, and residual blocks for processing feature maps at different levels to capture complex patterns in the image.
[0111] After the backbone network, FPN (Feature Pyramid Network) further fuses features and fuses feature maps from different scales to better handle objects of different sizes. It includes Top-Down Path Enhancement and Bottom-Up Path Enhancement, which propagate information from high-level features to low-level features and from low-level features to high-level features, respectively, to enhance multi-scale feature fusion. FAN (Feature Attention Enhancement Network) further enhances the expressiveness of feature maps, combines global and local information, and ensures that object detection and segmentation tasks can handle objects of different scales.
[0112] The detection head and segmentation head are the core prediction parts of the model. The detection head mainly consists of convolutional layers, which are used to further process feature maps and generate outputs related to object detection, including classification prediction, bounding box regression, and confidence prediction. The main task of these layers is to predict the object category, object bounding box location, and confidence of the object at each anchor point.
[0113] The segmentation head is responsible for instance segmentation. It restores the feature map size to the size of the original input image through the upsampling layer, and finally generates an instance segmentation mask to predict the category of each pixel.
[0114] In one scenario of this embodiment, after the model is trained, the model may be evaluated for overall indicators;
[0115] The trained model was evaluated to obtain the model's precision, recall, and mAP50 scores for the classification and segmentation of various tissue contours of zebrafish larvae. The specific results are shown in Table 1.
[0116] Precision: refers to the proportion of positive samples predicted by the model that are actually positive samples; it measures the accuracy of the prediction results, that is, how many of all the positive samples predicted by the model are truly positive samples;
[0117] Recall rate: refers to the proportion of all actually positive samples that are correctly predicted as positive samples; it measures the model's coverage of positive samples, that is, how many of all actual positive samples are correctly identified by the model;
[0118] mAP50 score: It combines the advantages of precision and recall and provides an overall performance evaluation. The mAP50 score reflects the overall performance of the model in different categories and is an important indicator for evaluating the segmentation and recognition capabilities of the model in complex scenes:
[0119] Table 1 shows the overall average indicators of the model training results
[0120] Class Precision Recall mAP50 Head 0.944 0.981 0.957 Eye 0.947 0.973 0.979 Pericardium (heart) 0.939 0.962 0.951 Yolk sac 0.942 0.979 0.976 Fish body 0.953 0.963 0.974
[0121] In step S400, the sample image is morphologically recognized and segmented. Specifically, the trained YOLOv8 model is used to calculate the zebrafish body phenotype image to obtain the segmentation mask of the zebrafish body, head, eyes, pericardium and yolk sac in the image;
[0122] like Figure 5 As shown, for the obtained segmentation mask of the fish body, the skeleton extraction algorithm in the OpenCV library is used to refine the binary mask image, and the segmentation mask of the fish body in the image is refined into a skeleton of a single pixel width while maintaining the topological structure of the fish body; after obtaining the skeleton, the number of pixels on the skeleton can be calculated to find the length of the fish body.
[0123] exist Figure 6 In the figure, the model recognition results are shown. After obtaining the segmentation mask images of the head, eyes, pericardium and yolk sac, the number of pixels in each mask image is calculated, and then the scale provided by the image acquisition device (high-content imaging system), that is, the actual size represented by each pixel, is used to obtain the area of each tissue of the zebrafish larvae, and the prediction results of the same batch are output one by one into the Excel file.
[0124] The specific values of the recognition results are:
[0125] Head area: 27841.968 μm 2 ; Eye area: 4272.048 μm 2 ; Heart area: 1985.984 μm 2 ; Yolk sac area: 20296.32 μm 2 ; Body length: 3197μm.
[0126] A zebrafish phenotype recognition and quantitative analysis method based on YOLOv8 in an embodiment of the present invention can be based on zebrafish pictures, through the YOLOv8 network, combined with OpenCV morphological operations, and applied to the analysis of the body surface morphology of zebrafish fry. By identifying and detecting the morphological characteristics of each part, the area of the head, eyes, pericardium and yolk sac and the length of the fish body are extracted; finally, a YOLOv8 model that can recognize the body surface morphology of zebrafish in bright field is constructed; and batch processing, measurement and evaluation of zebrafish images under different compounds and different concentrations are realized.
[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A zebrafish phenotype recognition and quantitative analysis method based on YOLOv8, characterized in that: The method comprises the following steps: S100: acquiring images of samples treated with different compounds at different concentrations, and establishing an image dataset of the morphological phenotype of the samples; S200: Divide the image dataset into a training dataset, a validation dataset, and a test dataset, and perform preprocessing and data enhancement on the training dataset to expand the scale and diversity of the training dataset; S300: labeling the sample image with information, and inputting the constructed instance segmentation network model into the model training to obtain a trained instance segmentation network model; S400: Using the trained instance segmentation network model, morphological recognition and segmentation are performed on sample images treated with different compounds at different concentrations to obtain surface morphological data information of the samples.
2. The method according to claim 1, characterized in that The step S100 includes: AB type wild zebrafish were used for breeding at a male-female ratio of 1:
1. The fertilized eggs were exposed to the chemical compound within 5 hours of fertilization and cultured in a constant temperature incubator at 28.5°C with a 14-hour light / 10-hour dark cycle. The poison solution was renewed every 24 hours, and starting from 24 hours after fertilization, 210uL 5mmol / L N-phenylthiourea (PTU) was added to inhibit pigment production, and cultured until 72 hours after fertilization; the zebrafish larvae were transferred to a 96-well plate, and tricaine was used to anesthetize the zebrafish larvae, centrifuged at 200rpm for 2min, and adjusted so that the ventral side was facing the same direction, and the eyes were overlapped; Image acquisition was performed using a high-content imaging system.
3. The method according to claim 1, characterized in that In step S200, the imgaug library is used to perform data augmentation on the training data set through an image distortion algorithm, and all data are enhanced through different image enhancement algorithms according to random thresholds and random combinations.
4. The method according to claim 3, characterized in that In step S200, the image data set is divided into: 80% as a training data set, 10% as a verification data set, and 10% as a test data set.
5. The method according to claim 1, characterized in that The instance segmentation network model includes a Backbone network structure, a Neck network structure and a Head network structure, which are used for feature extraction, feature fusion and prediction respectively.
6. The method according to claim 5, characterized in that The Backbone network structure adopts CSPDarknet53, which extracts different levels of image information through multiple convolutional layers, residual blocks and C2f modules; The Neck network structure includes a feature pyramid network and a feature attention enhancement network; The feature pyramid network fuses feature maps of different scales through top-down and lateral connections, and the feature attention enhancement network further enhances the expressiveness of feature maps, combining global and local information to ensure that target detection and segmentation tasks can handle targets of different scales; The Head network structure includes a detection head and a segmentation head, and the detection head and the segmentation head jointly implement the instance segmentation task.
7. The method according to claim 1, characterized in that When the model is trained in step S300, NVIDIA's graphics processor GeForce RTX 4060Ti 8G is used for calculation, and the CUDA12.1 library is used for acceleration.
Citation Information
Patent Citations
Mask R-CNN-based zebra fish morphological classification method
CN113409255A
Medical image cell segmentation and tracking method
CN116721414A
Cabbage attitude estimation detection method based on multi-task network model
CN117058165A
Small target detection model training method, small target detection method and related equipment
CN117746015A
Deep learning-based pavement disease identification method and device, medium and equipment
CN118096654A
Cited By
Sonar image-based severe environment desilting robot path planning method and system
CN119458383A
Cosmetic soothing efficacy evaluation method and system based on deep learning model
CN120070314A
A Method and System for Evaluating the Soothing Efficacy of Cosmetics Based on Deep Learning Models
CN120070314B
Deep learning-based zebrafish embryo chemical substance toxicity evaluation system and method
CN121259810A
A method and system for automatically extracting shell phenotype data of philippine clam based on dual-view images
CN122780301A
