A method, system, device and storage medium for fish phenotypic extraction

By using convolutional neural networks and a self-supervised segmentation model, a coarse mask is generated, and a self-supervised segmentation model is constructed, which solves the problems of low efficiency and high cost in fish phenotypic extraction and realizes rapid and automated fish phenotypic detection.

CN117726829BActive Publication Date: 2026-11-17HUAZHI RICE BIO TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311720692.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2026-11-17
Estimated Expiration
2043-12-14

AI Technical Summary

Technical Problem

Existing methods for extracting fish phenotypes are inefficient, manual measurement is time-consuming and highly subjective, and traditional supervised learning algorithms are costly and lack adaptability to new situations.

Method used

By employing convolutional neural networks and a self-supervised segmentation model, a coarse mask is generated through bilinear downsampling to construct an initial self-supervised segmentation model for training, enabling rapid measurement and statistical analysis of fish phenotypes and reducing the need for data labeling.

Benefits of technology

It improves the efficiency of fish phenotypic extraction, reduces labor and time costs, reduces subjectivity, and enables automated processing on large-scale datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117726829B_ABST
    Figure CN117726829B_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, device, and storage medium for fish phenotypic extraction. The method includes acquiring an image of the fish phenotypic to be detected; inputting the image of the fish phenotypic to be detected into a trained convolutional neural network model to obtain image features of the image of the fish phenotypic to be detected; generating an image containing a coarse mask based on the image features through bilinear downsampling; constructing an initial self-supervised segmentation model by using image processing algorithms and pattern recognition technology; inputting the generated image containing the coarse mask into the initial self-supervised segmentation model for training; obtaining the trained self-supervised segmentation model and its output fish phenotypic detection results. By replacing the traditional supervised learning algorithm with an unsupervised segmentation model, only preprocessing of the image data is required, eliminating the need for extensive manual data annotation for model training, thus avoiding the large amount of manual and time costs associated with data annotation and improving the efficiency of fish phenotypic extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of fish phenotyping, and in particular to a method, system, device and storage medium for fish phenotyping. Background Technology

[0002] Currently, methods for fish phenotypic extraction include manual measurement, traditional detection, and segmentation algorithms. However, manual measurement requires measuring instruments to measure and statistically analyze each phenotypic of the fish, including body length, body height, and head length. Detailed measurement is required for each phenotypic, which is time-consuming and inefficient. Furthermore, manual measurement involves subjective judgment, and different measurers may have different standards, leading to subjective results. Traditional supervised learning algorithms require a large amount of labeled training data, and data labeling is costly in terms of manpower and time, especially for pixel-level image segmentation tasks, which require fine pixel-level labeling, making it very expensive. Traditional supervised learning algorithms also have high requirements for the quality of training data. If the label quality is low or the label is inaccurate, it will directly affect the model's learning effect and segmentation ability. Moreover, traditional supervised learning algorithms usually perform poorly when facing unknown categories or changes in data distribution because they are trained and learned based on existing labeled data and lack the ability to adapt to new situations. Summary of the Invention

[0003] This invention aims to at least solve the technical problems existing in the prior art. To this end, this invention proposes a method, system, device, and storage medium for fish phenotypic extraction, which can shorten the extraction time of large amounts of fish phenotypic data, avoid the large amount of manual and time costs caused by data annotation, and improve the efficiency of fish phenotypic extraction.

[0004] In a first aspect, the present invention provides a method for extracting fish phenotypes, comprising the following steps:

[0005] Acquire phenotypic images of the fish to be detected;

[0006] The phenotypic image of the fish to be detected is input into a trained convolutional neural network model to obtain the image features of the phenotypic image of the fish to be detected.

[0007] An image containing a coarse mask is generated by bilinear downsampling based on the image features;

[0008] An initial self-supervised segmentation model is constructed. The generated image containing the coarse mask is input into the initial self-supervised segmentation model for training, resulting in a trained self-supervised segmentation model and its output fish phenotypic detection results.

[0009] The control method according to embodiments of the present invention has at least the following beneficial effects:

[0010] This method first acquires phenotypic images of the fish to be detected; then, it inputs these images into a trained convolutional neural network model to obtain image features; based on these features, it generates an image containing a coarse mask through bilinear downsampling; by using image processing algorithms and pattern recognition techniques, it achieves rapid measurement and statistical analysis of fish phenotypic characteristics, thereby improving efficiency, reducing subjectivity, and enabling automated processing on large-scale datasets; next, it constructs an initial self-supervised segmentation model, inputting the generated image containing the coarse mask into the initial self-supervised segmentation model for training, resulting in a trained self-supervised segmentation model and its output fish phenotypic detection results. This unsupervised segmentation model replaces the traditional supervised learning algorithm, requiring only image data preprocessing and eliminating the need for extensive manual data annotation for model training, thus avoiding the significant manual and time costs associated with data annotation and improving the efficiency of fish phenotypic extraction.

[0011] According to some embodiments of the present invention, generating an image containing a coarse mask by bilinear downsampling based on the image features includes:

[0012] The query set is obtained by bilinear downsampling based on the image features;

[0013] Based on the query set and the image features, a cosine similarity calculation is performed to obtain a score mapping set;

[0014] Normalize the set of fraction mappings to obtain a soft mask;

[0015] The soft mask is converted into a binary mask according to a preset threshold.

[0016] Calculate the mask score of the binary mask;

[0017] The image containing the coarse mask is generated based on the binary mask and the mask score.

[0018] According to some embodiments of the present invention, converting the soft mask into a binary mask according to a preset threshold includes:

[0019] The pixel values ​​of the soft mask are normalized according to a preset rule to obtain the normalized value of each pixel in the soft mask.

[0020] Pixels whose normalized values ​​are greater than or equal to the preset threshold are used as foreground pixels;

[0021] Pixels whose normalized values ​​are less than the preset threshold are used as the background.

[0022] The binary mask is obtained based on the foreground and the background.

[0023] According to some embodiments of the present invention, the mask fraction of the binary mask is calculated using the following formula:

[0024]

[0025] Where maskness is the mask score, P i Let N be the pixel value of the i-th binary mask. f Let be the number of foreground pixels in the i-th soft mask.

[0026] According to some embodiments of the present invention, generating the image containing the coarse mask based on the binary mask and the mask fraction includes:

[0027] The binary mask is sorted according to the mask score to obtain the sorted mask;

[0028] The sorted mask is subjected to redundant mask removal using a non-maximum suppression method to obtain the image containing the coarse mask.

[0029] According to some embodiments of the present invention, the step of inputting the generated image containing the coarse mask into the initial self-supervised segmentation model for training, to obtain the trained self-supervised segmentation model and its output fish phenotypic detection results, includes:

[0030] The image containing the coarse mask is input into the initial self-supervised segmentation model for prediction, resulting in the first self-supervised segmentation model and its output first predicted mask.

[0031] Calculate the first total loss value based on the first prediction mask and the coarse mask;

[0032] The initial self-supervised segmentation model is back-optimized based on the first total loss value to obtain the trained self-supervised segmentation model and its output fish phenotypic detection results.

[0033] According to some embodiments of the present invention, calculating the first total loss value based on the first prediction mask and the coarse mask includes:

[0034] The first maximum loss is calculated using the following formula:

[0035] L max =L(max) x (m), max x (m*))+L(max y (m), max y (m*))

[0036] Among them, L max Let m* be the first maximum loss, m be the coarse mask, m be the predicted mask, and max be the maximum loss.x To perform a Max operation along the X-axis, max y To perform a Max operation along the Y-axis;

[0037] The first prior loss is calculated using the following formula:

[0038]

[0039] Among them, L pairwise E is the first prior loss. in Let e ​​be the set of lines connecting each pixel in the mask to its surrounding pixels, and y be an edge connecting each pixel to another pixel in its surrounding area. e Let y be the category value of the two pixels of e. e =1 means that the two pixels of e belong to the same category, y e =0 means that two pixels of e belong to different categories, P is the probability, and N is the probability of E. in Total number of sides;

[0040] The first total loss value is calculated based on the first maximum loss and the first prior loss using the following formula:

[0041] L mask =L max +L pairwise

[0042] Among them, L mask This is the first total loss value.

[0043] A second aspect of the present invention provides a fish phenotypic extraction system, the fish phenotypic extraction system comprising:

[0044] The data acquisition module is used to acquire phenotypic images of the fish to be detected;

[0045] The image feature extraction module is used to input the phenotypic image of the fish to be detected into a trained convolutional neural network model to obtain the image features of the phenotypic image of the fish to be detected.

[0046] A coarse mask generation module is used to generate an image containing a coarse mask based on the image features through bilinear downsampling.

[0047] The fish phenotypic detection module is used to construct an initial self-supervised segmentation model. The generated image containing the coarse mask is input into the initial self-supervised segmentation model for training, and the trained self-supervised segmentation model and its output fish phenotypic detection results are obtained.

[0048] This system first acquires images of the fish phenotypes to be detected; then, it inputs these images into a trained convolutional neural network model to obtain image features; based on these features, it generates an image with a coarse mask through bilinear downsampling; by using image processing algorithms and pattern recognition techniques, it can achieve rapid measurement and statistical analysis of fish phenotypes, thereby improving efficiency, reducing subjectivity, and enabling automated processing on large-scale datasets; next, it constructs an initial self-supervised segmentation model, inputting the generated image with the coarse mask into the initial self-supervised segmentation model for training, resulting in a trained self-supervised segmentation model and its output fish phenotype detection results. By replacing traditional supervised learning algorithms with an unsupervised segmentation model, only image data preprocessing is required, eliminating the need for extensive manual data annotation for model training, thus avoiding the significant manual and time costs associated with data annotation and improving the efficiency of fish phenotype extraction.

[0049] A third aspect of the present invention provides a fish phenotypic extraction electronic device, comprising at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, the instructions being executed by the at least one control processor to enable the at least one control processor to perform the fish phenotypic extraction method described above.

[0050] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the above-described fish phenotypic extraction method.

[0051] It should be noted that the beneficial effects of the second to fourth aspects of the present invention compared with the prior art are the same as the beneficial effects of the fish phenotypic extraction system described above compared with the prior art, and will not be described in detail here.

[0052] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0053] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0054] Figure 1 This is a flowchart of a fish phenotypic extraction method according to an embodiment of the present invention;

[0055] Figure 2 This is a schematic diagram of the overall process of a fish phenotypic extraction method provided in an embodiment of the present invention;

[0056] Figure 3 This is a schematic diagram of the process for generating a coarse mask in a fish phenotypic extraction method provided in an embodiment of the present invention;

[0057] Figure 4 This is a schematic diagram of the result obtained after unsupervised processing of the original image data of a fish phenotypic extraction method provided in an embodiment of the present invention;

[0058] Figure 5 This is a schematic diagram illustrating the calculation of fish phenotypic data by pixels after segmentation in a fish phenotypic extraction method provided in an embodiment of the present invention.

[0059] Figure 6 This is a schematic diagram of a fish phenotypic extraction system according to an embodiment of the present invention. Detailed Implementation

[0060] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0061] In the description of this invention, the use of terms such as "first," "second," etc., is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance, or implicitly indicating the number of technical features indicated, or implicitly indicating the order of the technical features indicated.

[0062] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the drawings and are only for the convenience of describing this invention and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0063] In the description of this invention, it should be noted that, unless otherwise explicitly defined, terms such as "setting," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.

[0064] Currently, methods for fish phenotypic extraction include manual measurement, traditional detection, and segmentation algorithms. However, manual measurement requires measuring instruments to measure and statistically analyze each phenotypic of the fish, including body length, body height, and head length. Detailed measurement is required for each phenotypic, which is time-consuming and inefficient. Furthermore, manual measurement involves subjective judgment, and different measurers may have different standards, leading to subjective results. Traditional supervised learning algorithms require a large amount of labeled training data, and data labeling is costly in terms of manpower and time, especially for pixel-level image segmentation tasks, which require fine pixel-level labeling, making it very expensive. Traditional supervised learning algorithms also have high requirements for the quality of training data. If the label quality is low or the label is inaccurate, it will directly affect the model's learning effect and segmentation ability. Moreover, traditional supervised learning algorithms usually perform poorly when facing unknown categories or changes in data distribution because they are trained and learned based on existing labeled data and lack the ability to adapt to new situations.

[0065] To address the aforementioned technical deficiencies, referring to... Figure 1 and Figure 2 This invention provides a method for extracting fish phenotypes, comprising:

[0066] Step S101: Obtain the phenotypic image of the fish to be detected;

[0067] Step S102: Input the phenotypic image of the fish to be detected into the trained convolutional neural network model to obtain the image features of the phenotypic image of the fish to be detected;

[0068] Step S103: Generate an image containing a coarse mask based on image features through bilinear downsampling;

[0069] Step S104: Construct an initial self-supervised segmentation model. Input the generated image containing the coarse mask into the initial self-supervised segmentation model for training to obtain the trained self-supervised segmentation model and its output fish phenotypic detection results.

[0070] This method first acquires phenotypic images of the fish to be detected; then, it inputs these images into a trained convolutional neural network model to obtain image features; based on these features, it generates an image containing a coarse mask through bilinear downsampling; by using image processing algorithms and pattern recognition techniques, it achieves rapid measurement and statistical analysis of fish phenotypic characteristics, thereby improving efficiency, reducing subjectivity, and enabling automated processing on large-scale datasets; next, it constructs an initial self-supervised segmentation model, inputting the generated image containing the coarse mask into the initial self-supervised segmentation model for training, resulting in a trained self-supervised segmentation model and its output fish phenotypic detection results. This unsupervised segmentation model replaces the traditional supervised learning algorithm, requiring only image data preprocessing and eliminating the need for extensive manual data annotation for model training, thus avoiding the significant manual and time costs associated with data annotation and improving the efficiency of fish phenotypic extraction.

[0071] Reference Figure 3 In some embodiments, in step S103, generating an image with a coarse mask based on image features through bilinear downsampling includes:

[0072] Step S201: Obtain the query set by bilinear downsampling based on image features;

[0073] Step S202: Calculate the cosine similarity between the query set and the image features to obtain the score mapping set;

[0074] Step S203: Normalize the fraction mapping set to obtain the soft mask;

[0075] Step S204: Convert the soft mask into a binary mask according to a preset threshold;

[0076] Step S205: Calculate the mask score of the binary mask;

[0077] Step S206: Generate an image containing a coarse mask based on the binary mask and the mask fraction.

[0078] Specifically, this embodiment uses image processing algorithms and pattern recognition technology to achieve rapid measurement and statistics of fish phenotypes, thereby improving efficiency, reducing subjectivity, and enabling automated processing on large-scale datasets.

[0079] In some embodiments, step S204 converts the soft mask into a binary mask according to a preset threshold, including:

[0080] Step S301: Regularize the pixel values ​​of the soft mask according to the preset rules to obtain the regularized value of each pixel in the soft mask;

[0081] Step S302: Select pixels whose normalized values ​​are greater than or equal to a preset threshold as the foreground.

[0082] Step S303: Select pixels whose values ​​are less than a preset threshold after normalization as the background;

[0083] Step S304: Obtain the binary mask based on the foreground and background.

[0084] Specifically, given an input image, a pre-trained convolutional neural network model is used to extract dense feature maps I∈R of the input image. H×W×E A coarse mask is generated by dense feature mapping.

[0085] Specifically, we first construct query Q and key K based on feature I, which will work together to generate a coarse mask. I then perform bilinear downsampling on I to obtain query Q∈R. H'×W'×E Here, H' and W' represent the spatial size of the downsampling. The score mapping is normalized to a soft mask by shifting the scores to the [0,1] range. For each of the N soft masks, a further defined "mask" score is computed, which serves as the confidence score for each extracted mask. The soft masks are then converted to binary masks using a threshold. I itself is the set of keys K. For each query in Q, its cosine similarity to each key in K is computed, thus obtaining a score mapping S∈R. H×W×N Where N = H' × W' is the total number of queries. Then, the binary mask is sorted according to the mask score, and redundant masks are removed by non-maximum mask suppression (NMS).

[0086] In some embodiments, the mask score of the binary mask is calculated in step S205 using the following formula:

[0087]

[0088] Where maskness is the mask score, P i Let N be the pixel value of the i-th binary mask. f Let be the number of foreground pixels in the i-th soft mask.

[0089] In some embodiments, generating an image containing a coarse mask in step S206 based on the binary mask and the mask score includes:

[0090] Step S401: Sort the binary mask according to the mask score to obtain the sorted mask;

[0091] Step S402: Redundant mask removal is performed on the sorted mask using the non-maximum suppression method to obtain an image containing a coarse mask.

[0092] Specifically, in some embodiments, a method of converting a soft mask to a binary mask using a threshold is employed:

[0093] First, restrict the value of each pixel in the soft mask to between 0 and 1. For example, set all pixel values ​​greater than 1 to 1 and all pixel values ​​less than 0 to 0.

[0094] Then, a threshold is selected, and all pixels in the soft mask with pixel values ​​greater than or equal to the threshold are regarded as foreground (1), and all pixels with pixel values ​​less than the threshold are regarded as background (0).

[0095] Finally, the obtained binary mask can be processed using image processing methods such as morphological operations and region growing to eliminate noise and fill holes, resulting in more accurate segmentation results.

[0096] Reference Figure 4 and Figure 5 In some embodiments, in step S104, the image with the generated coarse mask is input into the initial self-supervised segmentation model for training, resulting in a trained self-supervised segmentation model and its output fish phenotypic detection results, including:

[0097] Step S501: Input the image containing the coarse mask into the initial self-supervised segmentation model for prediction to obtain the first self-supervised segmentation model and its output first prediction mask;

[0098] Step S502: Calculate the first total loss value based on the first prediction mask and the coarse mask;

[0099] Step S503: Perform reverse optimization on the initial self-supervised segmentation model based on the first total loss value to obtain the trained self-supervised segmentation model and its output fish phenotypic detection results.

[0100] Specifically, this embodiment replaces the traditional supervised learning algorithm with an unsupervised segmentation model. It only requires preprocessing of image data and does not require a large amount of manual data annotation for model training. This avoids the large amount of manual and time costs associated with data annotation and improves the efficiency of fish phenotypic extraction.

[0101] In some embodiments, calculating a first total loss value based on a first predicted mask and a coarse mask in step S502 includes:

[0102] Step S601: Calculate the first maximum loss using the following formula:

[0103] L max =L(max) x (m), max x (m*))+L(max y (m), max y(m*))

[0104] Among them, L max Let m* be the first maximum loss, m be the coarse mask, m be the predicted mask, and max be the maximum loss. x To perform a Max operation along the X-axis, max y To perform a Max operation along the Y-axis;

[0105] Step S602: Calculate the first prior loss using the following formula:

[0106]

[0107] Among them, L pairwise E is the first prior loss. in Let e ​​be the set of lines connecting each pixel in the mask to its surrounding pixels, and y be an edge connecting each pixel to another pixel in its surrounding area. e Let y be the category value of the two pixels of e. e =1 means that the two pixels of e belong to the same category, y e =0 means that two pixels of e belong to different categories, P is the probability, and N is the probability of E. in Total number of sides;

[0108] Step S603: Calculate the first total loss value based on the first maximum loss and the first prior loss using the following formula:

[0109] L mask =L max +L pairwise

[0110] Among them, L mask This is the first total loss value.

[0111] Specifically, in this embodiment, the first total loss value is calculated by using the first maximum loss and the first prior loss, which improves the convergence efficiency of the model and the accuracy of the model prediction.

[0112] Additionally, referring to FIG6, one embodiment of the present invention provides a fish phenotypic extraction system, including a data acquisition module 1100, an image feature extraction module 1200, a coarse mask generation module 1300, and a fish phenotypic detection module 1400, wherein:

[0113] The data acquisition module 1100 is used to acquire phenotypic images of the fish to be detected;

[0114] The image feature extraction module 1200 is used to input the phenotypic image of the fish to be detected into the trained convolutional neural network model to obtain the image features of the phenotypic image of the fish to be detected.

[0115] The coarse mask generation module 1300 is used to generate an image containing a coarse mask based on image features through bilinear downsampling.

[0116] The fish phenotypic detection module 1400 is used to construct an initial self-supervised segmentation model. The generated image containing a coarse mask is input into the initial self-supervised segmentation model for training, and the trained self-supervised segmentation model and its output fish phenotypic detection results are obtained.

[0117] This system first acquires images of the fish phenotypes to be detected; then, it inputs these images into a trained convolutional neural network model to obtain image features; based on these features, it generates an image with a coarse mask through bilinear downsampling; by using image processing algorithms and pattern recognition techniques, it can achieve rapid measurement and statistical analysis of fish phenotypes, thereby improving efficiency, reducing subjectivity, and enabling automated processing on large-scale datasets; next, it constructs an initial self-supervised segmentation model, inputting the generated image with the coarse mask into the initial self-supervised segmentation model for training, resulting in a trained self-supervised segmentation model and its output fish phenotype detection results. By replacing traditional supervised learning algorithms with an unsupervised segmentation model, only image data preprocessing is required, eliminating the need for extensive manual data annotation for model training, thus avoiding the significant manual and time costs associated with data annotation and improving the efficiency of fish phenotype extraction.

[0118] It should be noted that this system embodiment is based on the same inventive concept as the above system embodiment. Therefore, the relevant content of the above method embodiment is also applicable to this system embodiment, and will not be repeated here.

[0119] This application also provides a fish phenotypic extraction electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the fish phenotypic extraction method as described above.

[0120] The processor and memory can be connected via a bus or other means.

[0121] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0122] The non-transient software program and instructions required to implement the fish phenotypic extraction method of the above embodiments are stored in memory. When executed by a processor, the fish phenotypic extraction method of the above embodiments is executed, for example, the method described above is executed. Figure 1 The method steps S101 to S104.

[0123] This application also provides a computer-readable storage medium storing computer-executable instructions for performing the fish phenotypic extraction method described above.

[0124] The computer-readable storage medium stores computer-executable instructions that are executed by a processor or controller, for example, by a processor in the above-described electronic device embodiment, causing the processor to perform the fish phenotyping method in the above-described embodiment, for example, performing the above-described... Figure 1 The method steps S101 to S104.

[0125] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program units, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program units, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0126] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.

Claims

1. A method for extracting fish phenotypes, characterized in that, The fish phenotypic extraction method includes: Acquire phenotypic images of the fish to be detected; The phenotypic image of the fish to be detected is input into a trained convolutional neural network model to obtain the image features of the phenotypic image of the fish to be detected. Based on the image features, an image with a coarse mask is generated through bilinear downsampling, specifically as follows: The query set is obtained by bilinear downsampling based on the image features; Based on the query set and the image features, a cosine similarity calculation is performed to obtain a score mapping set; Normalize the set of fraction mappings to obtain a soft mask; The soft mask is converted into a binary mask according to a preset threshold. Calculate the mask score of the binary mask; The image containing the coarse mask is generated based on the binary mask and the mask fraction, specifically as follows: The binary mask is sorted according to the mask score to obtain the sorted mask; The sorted mask is subjected to redundant mask removal using a non-maximum suppression method to obtain the image containing the coarse mask; An initial self-supervised segmentation model is constructed by inputting the generated image containing the coarse mask into the initial self-supervised segmentation model for training, thereby obtaining the trained self-supervised segmentation model and its output fish phenotypic detection results, specifically as follows: The image containing the coarse mask is input into the initial self-supervised segmentation model for prediction, resulting in the first self-supervised segmentation model and its output first predicted mask. The first total loss value is calculated based on the first prediction mask and the coarse mask, specifically as follows: The first maximum loss is calculated using the following formula: in, The first and greatest loss, For coarse masking, To predict the mask, To perform a Max operation along the X-axis. To perform a Max operation along the Y-axis; The first prior loss is calculated using the following formula: in, As the first prior loss, To predict the set of lines connecting each pixel in the mask to its surrounding pixels, For each pixel, there is an edge connecting it to another pixel in its vicinity. for The category values ​​of the two pixels, for The two pixels belong to the same category. for The two pixels belong to different categories. For probability, for Total number of sides; The first total loss value is calculated based on the first maximum loss and the first prior loss using the following formula: in, This is the first total loss value; The initial self-supervised segmentation model is back-optimized based on the first total loss value to obtain the trained self-supervised segmentation model and its output fish phenotypic detection results.

2. The method for extracting fish phenotypes according to claim 1, characterized in that, The step of converting the soft mask into a binary mask according to a preset threshold includes: The pixel values ​​of the soft mask are normalized according to a preset rule to obtain the normalized value of each pixel in the soft mask. Pixels whose normalized values ​​are greater than or equal to the preset threshold are used as foreground pixels; Pixels whose normalized values ​​are less than the preset threshold are used as the background. The binary mask is obtained based on the foreground and the background.

3. The method for extracting fish phenotypes according to claim 2, characterized in that, The mask score of the binary mask is calculated using the following formula: in, For masked scores, For the first The pixel values ​​of a binary mask. For the first The number of foreground pixels in a soft mask.

4. A fish phenotypic extraction system, characterized in that, The fish phenotypic extraction system includes: The data acquisition module is used to acquire phenotypic images of the fish to be detected; The image feature extraction module is used to input the phenotypic image of the fish to be detected into a trained convolutional neural network model to obtain the image features of the phenotypic image of the fish to be detected. The coarse mask generation module is used to generate an image containing a coarse mask based on the image features through bilinear downsampling, specifically: The query set is obtained by bilinear downsampling based on the image features; Based on the query set and the image features, a cosine similarity calculation is performed to obtain a score mapping set; Normalize the set of fraction mappings to obtain a soft mask; The soft mask is converted into a binary mask according to a preset threshold. Calculate the mask score of the binary mask; The image containing the coarse mask is generated based on the binary mask and the mask fraction, specifically as follows: The binary mask is sorted according to the mask score to obtain the sorted mask; The sorted mask is subjected to redundant mask removal using a non-maximum suppression method to obtain the image containing the coarse mask; The fish phenotypic detection module is used to construct an initial self-supervised segmentation model. The generated image containing the coarse mask is input into the initial self-supervised segmentation model for training, resulting in a trained self-supervised segmentation model and its output fish phenotypic detection results. Specifically: The image containing the coarse mask is input into the initial self-supervised segmentation model for prediction, resulting in the first self-supervised segmentation model and its output first predicted mask. The first total loss value is calculated based on the first prediction mask and the coarse mask, specifically as follows: The first maximum loss is calculated using the following formula: in, The first and greatest loss, For coarse masking, To predict the mask, To perform a Max operation along the X-axis. To perform a Max operation along the Y-axis; The first prior loss is calculated using the following formula: in, As the first prior loss, To predict the set of lines connecting each pixel in the mask to its surrounding pixels, For each pixel, there is an edge connecting it to another pixel in its vicinity. for The category values ​​of the two pixels, for The two pixels belong to the same category. for The two pixels belong to different categories. For probability, for Total number of sides; The first total loss value is calculated based on the first maximum loss and the first prior loss using the following formula: in, This is the first total loss value; The initial self-supervised segmentation model is back-optimized based on the first total loss value to obtain the trained self-supervised segmentation model and its output fish phenotypic detection results.

5. A fish phenotypic extraction device, characterized in that, It includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, which, when executed by the at least one control processor, enable the at least one control processor to perform a fish phenotype extraction method as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions for causing a computer to perform a fish phenotypic extraction method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Living fish weight estimation method and system based on instance segmentation

    CN114998375A