Method for training sperm classification model and related product thereof
By preprocessing and gender-labeling sperm videos and using image analysis technology to classify sperm, the reliability and cost issues of sperm separation in existing technologies are resolved, achieving efficient and accurate sperm gender control.
Patent Information
- Application Number
- CN202510677778.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-23
AI Technical Summary
Existing sperm separation technology lacks reliability, repeatability and accuracy, and the staining process causes a large loss of sperm motility. The commercial production cost is high, making it difficult to achieve efficient and low-cost gender control.
By obtaining sperm videos for preprocessing, extracting individual sperm activity videos, and combining them with gender labeling information for model training, sperm classification is performed using image analysis technology to avoid staining damage and improve the quality and diversity of training data.
It realizes in-situ non-destructive, automated and low-cost sperm classification, improves classification efficiency and accuracy, reduces commercial production costs, and provides a more reliable gender control technology.
Smart Images

Figure CN120689666A_ABST
Abstract
Description
Technical Field
[0001] This application generally relates to the field of video image processing technology. More specifically, this application relates to a method, apparatus, and computer-readable storage medium for training a sperm classification model. Furthermore, this application also relates to a method, apparatus, and computer-readable storage medium for classifying sperm. Background Art
[0002] With the rapid and high-quality development of modern animal husbandry, efficient and precise sex control technology has become a key research focus for improving the economic benefits of livestock production. Artificial sex control of livestock reproduction can maximize farmers' economic benefits. For example, dairy farmers desire heifers, but using traditional breeding methods results in half of the offspring being bulls. The value of a bull is typically less than 5% of that of a heifer. Similar trends exist for other livestock species. Therefore, sex control of livestock has profound implications for the breeding and production of livestock, especially high-value-added livestock. The application of sex control technology not only significantly reduces the cost of livestock breeding but also effectively accelerates the rate of breeding, thereby achieving significant economic benefits.
[0003] For decades, researchers have explored various methods for separating X-chromosome-bearing sperm (female) from Y-chromosome-bearing sperm (male), but most have lacked reliability, reproducibility, and accuracy. Flow cytometry is currently recognized as a reliable, highly accurate, and efficient sperm sorting method. This method uses fluorescent staining to increase the fluorescence of X-chromosome-bearing sperm compared to Y-chromosome-bearing sperm based on the difference in DNA content between X-chromosome-bearing and Y-chromosome-bearing sperm. Using a highly precise detection and capture system, sperm with the desired characteristics are collected, achieving the desired separation. However, this technique suffers from significant loss of motility after sorting, resulting in generally lower pregnancy rates than fresh sperm, and the high cost of commercial production.
[0004] In view of this, there is an urgent need to provide a solution for sperm classification so as to shift from the traditional biomolecular identification paradigm to the image analysis paradigm, thereby providing an in situ non-destructive, automated and low-cost sperm classification method. Summary of the Invention
[0005] In order to at least solve one or more of the technical problems mentioned above, the present application proposes a solution for classifying sperm in the following aspects.
[0006] In a first aspect, the present application provides a method for training a sperm classification model, comprising: obtaining a first sperm video, wherein the first sperm video is a video of the activity of at least one sperm; preprocessing the first sperm video to obtain at least one second sperm video, wherein the second sperm video is a video of the activity of a single sperm; labeling the gender of the sperm contained in each second sperm video to obtain gender labeling information; and inputting each second sperm video and its corresponding gender labeling information as training data into the sperm classification model to train it.
[0007] In some embodiments, preprocessing the first sperm video to obtain at least one second sperm video includes: performing an object detection operation on the first sperm video to obtain a bounding box of the at least one sperm; performing a segmentation operation on the first sperm video based on the bounding box of the at least one sperm to obtain a mask of the at least one sperm; and performing an extraction operation on the first sperm video based on the mask of the at least one sperm to obtain at least one second sperm video.
[0008] In some embodiments, before performing the target detection operation on the first sperm video, the method further includes: determining whether the number of video frames contained in the first sperm video is a preset number; if the number of video frames is the preset number, continuing to perform the target detection operation on the first sperm video; if the number of video frames is not the preset number, determining whether the number of video frames is greater than the preset number; if the number of video frames is greater than the preset number, starting from the first video frame of the first sperm video, obtaining the preset number of video frames to form a new first sperm video.
[0009] In some embodiments, the method further includes: discarding the first sperm video if the number of the video frames is less than the preset number; and continuing to perform the operation of acquiring the first sperm video to acquire a new first sperm video.
[0010] In some embodiments, the preset number is determined by the rotation frequency of sperm; and when the rotation frequency is 8-13 Hz, the preset number is 30 frames.
[0011] In some embodiments, each second sperm video and its corresponding gender labeling information are input as training data into the sperm classification model to train it, including: inputting each second sperm video into the sperm classification model for classification operation to obtain a gender classification result; determining a loss value based on the gender labeling information and the gender classification result, and updating the parameters of the sperm classification model based on the loss value.
[0012] In a second aspect, the present application provides a device for training a sperm classification model, comprising: a processor; and a memory storing program instructions for training a sperm classification model, wherein when the program instructions are executed by the processor, the method described in the first aspect and its multiple embodiments are implemented.
[0013] In a third aspect, the present application provides a method for classifying sperm, comprising: obtaining a third sperm video to be classified, wherein the third sperm video to be classified is an activity video of at least one sperm; preprocessing the third sperm video to be classified to obtain at least one fourth sperm video to be classified, wherein the fourth sperm video to be classified is an activity video of a single sperm; inputting each fourth sperm video to be classified into a sperm classification model trained according to the method described in the first aspect and its multiple embodiments for classification operation to output the gender classification result of the single sperm in each fourth sperm video to be classified.
[0014] In a fourth aspect, the present application provides a device for classifying sperm, comprising: a processor; and a memory storing program instructions for classifying sperm, wherein when the program instructions are executed by the processor, the method described in the aforementioned third aspect and its multiple embodiments are implemented.
[0015] In a fifth aspect, the present application provides a computer-readable storage medium having stored thereon program instructions for training a sperm classification model and / or for classifying sperm. When the program instructions are executed by a processor, the method described in the first aspect and its multiple embodiments and / or the method described in the third aspect are implemented.
[0016] Through the above-provided solution for sperm classification, in the model training stage, the embodiment of the present application obtains a first sperm video and pre-processes it to obtain an activity video of a single sperm, and combines it with gender labeling information as training data, which can provide the model with accurate and representative learning samples, avoiding the damage to sperm caused by traditional biomolecular identification methods, while improving the quality and diversity of training data, so that the model can learn the intrinsic relationship between sperm morphological characteristics (such as head aspect ratio, acrosome integrity, tail thickness) and kinematic characteristics (such as speed, trajectory, tail swing amplitude) and gender.
[0017] In the model application stage, the embodiment of the present application can achieve in-situ non-destructive, automated and low-cost sperm classification by pre-processing the first sperm video to be classified and then inputting it into the trained model, effectively avoiding the impact of staining on sperm motility in flow cytometry sorting technology and the high commercial production costs, significantly improving the efficiency and accuracy of sperm classification, and providing a more reliable and economical technical means for livestock sex control.
[0018] Furthermore, by preprocessing the original sperm video containing at least one sperm (i.e., the first sperm video) into an independent video containing only a single sperm (i.e., the second sperm video) and performing classification based on this, the mutual interference problem caused by the coexistence of multiple sperm can be effectively avoided. In the original sperm video, the movement trajectories of multiple sperm may overlap or intersect, causing the model to introduce noise or confuse key parameters when extracting kinematic features (such as speed, trajectory, tail swing amplitude) and morphological features (such as head aspect ratio, acrosome integrity, and tail thickness). After preprocessing, each independent video contains only a single sperm, ensuring that the model focuses on the dynamic behavior and static morphology of a single target, avoiding feature interference between multiple targets and increased background complexity, thereby improving the model's learning efficiency and classification accuracy for sperm sex-related features. This processing method eliminates multi-target interference factors at the data input level, enabling the sperm classification model to more reliably explore the intrinsic relationship between individual sperm characteristics and sex, ultimately achieving a significant improvement in classification accuracy, providing a more stable and efficient image analysis paradigm for livestock sex control technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the exemplary embodiments of the present application will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0020] Figure 1 is a schematic diagram showing an exemplary structure of a sperm classification system according to an embodiment of the present application;
[0021] Figure 2 is an exemplary flow chart illustrating a method for training a sperm classification model according to an embodiment of the present application;
[0022] Figure 3 is an exemplary schematic diagram showing a first sperm video and a second sperm video according to an embodiment of the present application;
[0023] Figure 4 is an exemplary flow chart illustrating a pre-processing process of a first sperm video according to an embodiment of the present application;
[0024] Figure 5 An exemplary flow chart showing a method for classifying sperm according to an embodiment of the present application;
[0025] Figure 6 A schematic diagram showing an exemplary structure of a device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0027] It should be understood that when the terms "first," "second," "third," and "fourth" are used in the claims, specification, and drawings of this application, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprising" used in the specification and claims of this disclosure indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or combinations thereof.
[0028] It should also be understood that the terminology used in this disclosure is for the purpose of describing specific embodiments only and is not intended to limit the disclosure. As used in this disclosure and the claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should be further understood that the term "and / or" as used in this disclosure and the claims refers to any and all possible combinations of one or more of the associated listed items, including and including these combinations.
[0029] As used in this specification and claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0030] Exemplary Systems
[0031] Figure 1 FIG. 1 is a schematic diagram showing an exemplary structure of a sperm classification system 100 according to an embodiment of the present application. Figure 1As shown in , the system 100 may include, but is not limited to, a video capture device 101, a display device 102, and a data processing device 103. It is understood that the video capture device 101 herein may be an inverted microscope, used to perform a video capture operation on a sperm specimen on its stage to obtain a first sperm video. The display device 102 may be any suitable electronic device capable of displaying video images, and the data processing device 103 may be any suitable electronic device capable of processing video and image data, including, but not limited to, a terminal and a server. In actual operation, the video capture device 101, the display device 102, and the data processing device 103 may work in conjunction to achieve sperm classification.
[0032] During the sperm classification model training phase, user 104 can use video capture device 101 to capture a first sperm video, which is a video of at least one sperm in motion. Subsequently, video capture device 101 can send the first sperm video to data processing device 103, which pre-processes the first sperm video to obtain at least one second sperm video, which is a video of a single sperm in motion. Data processing device 103 can then label the sex of the sperm contained in each second sperm video to obtain sex-labeled information. Furthermore, data processing device 103 can input each second sperm video and its corresponding sex-labeled information as training data into the sperm classification model to train it. After repeated training and parameter optimization, a fully trained sperm classification model can be obtained.
[0033] During the sperm classification model application phase, user 104 may also use video capture device 101 to capture a third sperm video to be classified. This third sperm video is a video of at least one sperm moving around. After completing the video capture, video capture device 101 may send this third sperm video to data processing device 103. In response to receiving the third sperm video to be classified, data processing device 103 may pre-process the third sperm video to obtain at least one fourth sperm video to be classified. This fourth sperm video is a video of a single sperm moving around. Thereafter, data processing device 103 may utilize the trained sperm classification model described above to classify the sperm in each of the fourth sperm videos to be classified, outputting a sex classification result for each individual sperm in each fourth sperm video.
[0034] In some implementation scenarios, the data processing device 103 of the present application can also visually output the sex classification results of each sperm. Additionally or alternatively, the data processing device 103 can also send data such as the third sperm video to be classified, at least one fourth sperm video, and the sex classification results of each sperm to the display device 102 for display. Thus, the user 104 can view this data through the display device 102 or the data processing device 103.
[0035] The sperm classification system of the present application does not require sperm staining. It only needs to perform image analysis on the sperm video to be classified to obtain the sperm sex classification result, thereby realizing in situ non-destructive, high-precision, automated and low-cost sperm sex classification.
[0036] Exemplary Methods
[0037] Figure 2 FIG2 is an exemplary flow chart illustrating a method 200 for training a sperm classification model according to an embodiment of the present application. It is understood that the method 200 can be executed by any appropriate device with data processing capabilities, including but not limited to a terminal device and a server.
[0038] like Figure 2 As shown, at step S201, method 200 may obtain a sperm video (for ease of distinction, may be referred to as a first sperm video), where the first sperm video is an activity video of at least one sperm.
[0039] Next, at step S202, method 200 may pre-process the first sperm video to obtain at least one sperm video (which may be referred to as a second sperm video for ease of distinction), where the second sperm video is a moving video of a single sperm.
[0040] Next, at step S203, method 200 may label the sex of the sperm contained in each second sperm video to obtain sex labeling information. In an embodiment of the present application, the sex of the sperm may include X sperm and Y sperm.
[0041] Finally, at step S204 , the method 200 may input each second sperm video and its corresponding gender labeling information as training data into the sperm classification model to train the model.
[0042] In step S201, when method 200 acquires the first sperm video, a sperm specimen may be first obtained and placed on the stage of the inverted microscope. The inverted microscope may then be used to acquire the first sperm video. It will be appreciated that those skilled in the art may select the data size of the first sperm video based on actual needs, and this application does not impose any specific limitations thereon.
[0043] In developing the present invention, the inventors observed through high-speed photography or microscopy that sperm rotate at a frequency of 8-13 revolutions per second (Hz) during motion. The Nyquist sampling theorem states that to accurately reproduce a signal (such as sperm motion), the sampling frequency (frame rate) must be at least twice the maximum frequency of the signal (i.e., the "Nyquist frequency").
[0044] Therefore, when the sperm rotation frequency is 8-13Hz, the sampling frequency is 26 frames per second (26FPS). In order to meet this theoretical requirement and effectively capture the complete rotation characteristics of sperm, this application sets the sampling frame rate of the sperm video to 30 frames per second (30FPS). Based on this condition, every 30 consecutive frames of images can be selected as an independent training video segment, that is, the aforementioned first sperm video. Since the sampling frame rate is 30FPS, every 30 frames corresponds to a recording duration of exactly 1 second. In this second, based on the sperm rotation frequency of 8-13Hz, its head will complete 8 to 13 complete rotation cycles. Therefore, this training video segment selection method ensures that each sperm video contains multiple complete sperm head rotation cycles, which can provide sufficient and representative dynamic information for subsequent analysis and model training.
[0045] In step S202, the second sperm video contains the same number of video frames as the first sperm video. The position and pixel value of each sperm in the image region of the second sperm video (referred to as the second position and second pixel value for ease of distinction) are the same as the position and pixel value of each sperm in the image region of the first sperm video (referred to as the first position and first pixel value for ease of distinction). Furthermore, in the second sperm video, the pixel value of the image region other than the image region where the sperm resides (i.e., the image background) is 0.
[0046] In one example, if Figure 3 As shown in Figure 1, Figure a is the first sperm video before preprocessing, and Figures b1 and b2 are the two second sperm videos obtained by preprocessing the first sperm video. Comparing Figures a, b1, and b2, we can see that Figure a contains multiple sperm, and the image background is messy, and the pixel values are not unique. Figures b1 and b2 each contain only a single sperm, and the image background is black, with a pixel value of 0. It should be understood that for the purpose of simplicity, Figure 3 Only one video frame from the first sperm video and each second sperm video is shown.
[0047] In practical applications, the above preprocessing steps for the first sperm video can be flexibly implemented according to the data size, accuracy requirements and operating costs. It can be completed manually through manual labeling and frame-by-frame editing (suitable for small-scale samples or scenarios requiring fine-tuning), or it can be completed using an automated process with the help of computing equipment. For ease of understanding, the specific implementation of obtaining at least one second sperm video using an automated process will be discussed later in conjunction with Figure 4 The pre-processing process 400 of the first sperm video is described in detail.
[0048] In the aforementioned step S204, the sperm classification model uses Resnet-36 as the base model. The number of convolutional layers in Resnet-36 is 35, and the number of fully connected layers is 1. Furthermore, the 35 convolutional layers include 1 initial convolutional layer and 34 convolutional layers in the residual block. The initial convolutional layer serves as the model entry and can quickly extract low-level features of the image (such as edges, textures, color gradients) and reduce spatial dimensions. The residual block uses stacking and jump connections to enable the model to learn multi-level features from low-level to high-level (such as from edges → textures → parts → objects), so that the model can be trained to a deeper level.
[0049] In practical applications, ResNet-36 is designed for image classification tasks, and its default number of input channels is 3. To enable it to process the second sperm video and be suitable for the sperm classification task in this application, the number of channels in the initial convolutional layer of ResNet-36 can be modified according to the data size of the second sperm video.
[0050] In one example, the number of channels of the initial convolutional layer in ResNet-36 can be set to the number of video frames contained in the second sperm video, that is, 30. In this way, the second sperm video can be input into the sperm classification model as a large-size image.
[0051] In an embodiment of the present application, at step S204, each second sperm video and its corresponding gender-labeled information are input as training data into the sperm classification model. Training of the sperm classification model can be performed by: inputting each second sperm video into the sperm classification model for classification to obtain a gender classification result; determining a loss value based on the gender-labeled information and the gender classification result, and updating the parameters of the sperm classification model based on the loss value. Typically, based on the obtained loss value, an optimization algorithm such as stochastic gradient descent can be used to update the parameters of the sperm classification model, thereby reducing the error between the output value (i.e., the gender classification result) and the true value (gender-labeled information), thereby improving the accuracy and generalization ability of the model.
[0052] Combination of the above Figure 2A method 200 for training a sperm classification model is described. This method 200 obtains a first sperm video and preprocesses it to obtain a video of individual sperm activity. This video, combined with sex-labeled information, serves as training data. This method provides the model with accurate and representative learning samples, avoiding damage to sperm caused by traditional biomolecular identification methods. It also improves the quality and diversity of the training data, enabling the model to learn the intrinsic correlation between sperm morphological characteristics (e.g., head aspect ratio, acrosome integrity, tail thickness) and kinematic characteristics (e.g., speed, trajectory, and tail swing amplitude) and sex.
[0053] Figure 4 FIG1 shows an exemplary flow chart of the pre-processing process 400 of the first sperm video according to an embodiment of the present application. Figure 4 The description is a specific implementation of the above step S202. Figure 2 The features described can apply analogously here.
[0054] like Figure 4 As shown, at step S401, an object detection operation may be performed on the first sperm video to obtain a bounding box of at least one sperm.
[0055] Next, at step S402 , a segmentation operation may be performed on the first sperm video based on a bounding box of at least one sperm to obtain a mask of at least one sperm.
[0056] Finally, at step S403 , an extraction operation may be performed on the first sperm video based on the mask of the at least one sperm to obtain at least one second sperm video.
[0057] In step S401, an object detection model may be used to perform an object detection operation on the first sperm video to obtain a bounding box for at least one sperm in each video frame. In practice, the object detection model may be any existing or future object detection model. As long as the object detection model can process sperm videos and generate a bounding box for sperm in each video frame, it can be used to implement the sperm classification solution of the present application.
[0058] Additionally or optionally, the target detection model may be a YOLOv8 model, and the bounding box of the sperm in each video frame may be the bounding box of the sperm head, or the bounding box of the entire sperm (head + tail).
[0059] At step S402, a visual segmentation model, such as the SAM2 model, can be used to segment the first sperm video based on the bounding box of the at least one sperm to obtain at least one sperm mask. The number of masks for each sperm equals the number of video frames included in the first sperm video. The sperm mask is a binary image with the same size as the video frames in the first sperm video. The pixel value of the image area occupied by the sperm is 1, and the pixel value of the other image areas is 0.
[0060] Here, the bounding box of at least one sperm is input into the visual segmentation model as an interactive cue, directly telling the model to "focus on the sperm within this area." In other words, the bounding box provides the visual segmentation model with spatial prior information, constraining the segmentation range and providing clear visual guidance, leading the model to produce more accurate segmentation results.
[0061] In the aforementioned step S403, an extraction operation is performed on the first sperm video based on the mask of at least one sperm. In essence, each mask of each sperm is multiplied by each video frame in the first sperm video, so as to extract the sperm image in each video frame according to the position of the mask, thereby obtaining at least one second sperm video.
[0062] In an embodiment of the present application, in step S401, before performing the target detection operation on the first sperm video, the following operations may be performed to obtain a first sperm video that meets the sampling requirements: determining whether the number of video frames contained in the first sperm video is the preset number; if the number of video frames is the preset number, continuing to perform the target detection operation on the first sperm video. Conversely, if the number of video frames is not the preset number, determining whether the number of video frames is greater than the preset number; if the number of video frames is greater than the preset number, obtaining a preset number of video frames starting from the first video frame of the first sperm video to form a new first sperm video.
[0063] Furthermore, if the number of video frames is less than a preset number, the first sperm video is discarded, and the operation of acquiring the first sperm video is continued to acquire a new first sperm video. This improves the quality of training data, enabling the model to better learn the inherent relationship between sperm morphological and kinematic characteristics and sex, thereby increasing the accuracy of the model's sperm classification.
[0064] In an embodiment of the present application, in order to evaluate the generalization ability of the sperm classification model after training, some data can be reserved from the aforementioned training data as a test set, and the performance of the model on the test set can be evaluated using indicators such as F1 score, accuracy (Accuraucy), recall (Recall), and precision (Precision). Here, the accuracy rate measures the overall classification correctness of the model for all samples, the accuracy rate reflects the reliability of the prediction as a certain type of sperm, the recall rate reflects the ability to capture a certain type of sperm, and the F1 score is achieved by reconciling the average accuracy and recall rate to balance the evaluation deviation under the category imbalance scenario. The embodiment of the present application can comprehensively and objectively reveal the generalization ability of the sperm classification model for unseen data by analyzing the confusion matrix and each indicator value on the test set, and provide a key quantitative basis for its deployment and optimization in an actual production environment.
[0065] Next, combine Figure 5 The method 500 for classifying sperm in the embodiment of the present application is exemplarily introduced. Figure 5 As shown, at step S501, the method 500 can obtain a sperm video to be classified (for the sake of distinction, it can be called a third sperm video), and the third sperm video to be classified is a moving video of at least one sperm. In actual operation, the aforementioned video acquisition device 101 can be used to obtain the third sperm video to be classified. The specific acquisition process is the same as above. Figure 2 The acquisition process for the first sperm video is the same as described above and will not be repeated here. To better accommodate the data processing capabilities of the trained sperm classification model, the third sperm video contains 30 frames.
[0066] Next, at step S502, the method 500 may pre-process the third sperm video to be classified to obtain at least one sperm video to be classified (for ease of distinction, it may be referred to as a fourth sperm video), the fourth sperm video to be classified being a video of the activity of a single sperm. It is understood that the pre-processing process of the third sperm video is combined with the above process. Figure 4 The preprocessing process of the first sperm video described is the same and will not be repeated here.
[0067] Finally, at step S503, method 500 may input the fourth sperm video to be classified into the trained sperm classification model for classification, thereby outputting a sex classification result for each individual sperm in the fourth sperm video to be classified. Here, the trained sperm classification model is generated according to the aforementioned method for training a sperm classification model and its various embodiments, and the sex classification result it outputs is either X sperm or Y sperm.
[0068] Next, combine Figure 6An exemplary introduction is given to a device 600 for training a sperm classification model or for classifying sperm provided in an embodiment of the present application. Figure 6 As shown, the device 600 of the embodiment of the present application may include a processor 601 , a memory 602 and a communication bus 603 .
[0069] In a specific embodiment, the processor 601 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It is understood that for different devices, the electronic device used to implement the above-mentioned processor functions may also be other, and this embodiment does not specifically limit this.
[0070] In the embodiment of the present application, the communication bus 603 is used to realize the connection and communication between the processor 601 and the memory 602; the memory 602 stores program instructions for training the sperm classification model or for classifying sperm; when the processor 601 executes the program instructions stored in the memory 602, the present application is realized. Figures 2 to 4 The method for training a sperm classification model described herein or the present application in combination Figure 5 The method described for sorting spermatozoa.
[0071] Combination of the above Figure 6 The present invention describes a device for training a sperm classification model or for classifying sperm that can be used to implement the present application. It should be understood that the device structure or architecture herein is merely exemplary, and the implementation and implementation entities of the present application are not limited thereto, but may be modified without departing from the spirit of the present application. It is understood that the description of the various embodiments in this disclosure emphasizes the differences between the various embodiments, and the similarities or corresponding aspects thereof can be referenced to each other. For the purpose of brevity, this disclosure will not elaborate on each one.
[0072] According to the above description in combination with the accompanying drawings, those skilled in the art can also understand that the embodiments of the present application can also be implemented by software programs. Therefore, the present application also provides a computer-readable storage medium. The computer-readable storage medium can be used to implement the present application in combination with the accompanying drawings. Figures 2 to 4 The method for training a sperm classification model described herein or the present application in combination Figure 5 The method described for sorting spermatozoa.
[0073] It should be noted that although the operations of the present method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in that particular order, or that all of the operations shown must be performed to achieve the desired results. Rather, the steps depicted in the flowcharts may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into a single step, and / or a single step may be broken down into multiple steps.
[0074] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. At the same time, changes or modifications made by those skilled in the art based on the ideas of the present application, the specific implementation methods, and the scope of application of the present application, all fall within the scope of protection of the present application. In summary, the contents of this specification should not be construed as limiting the present application.
Claims
1. A method for training a sperm classification model, comprising: Acquire a first sperm video, wherein the first sperm video is a moving video of at least one sperm; Preprocessing the first sperm video to obtain at least one second sperm video, wherein the second sperm video is a moving video of a single sperm; Labeling the sex of sperm contained in each second sperm video to obtain sex labeling information; as well as Each second sperm video and its corresponding gender labeling information are input as training data into the sperm classification model to train it.
2. The method according to claim 1, wherein Preprocessing the first sperm video to obtain at least one second sperm video includes: performing an object detection operation on the first sperm video to obtain a bounding box of the at least one sperm; performing a segmentation operation on the first sperm video based on a bounding box of the at least one sperm to obtain a mask of the at least one sperm; Based on the mask of the at least one sperm, an extraction operation is performed on the first sperm video to obtain at least one second sperm video.
3. The method according to claim 2, before performing the target detection operation on the first sperm video, the method further comprises: Determining whether the number of video frames included in the first sperm video is a preset number; When the number of the video frames is the preset number, continuing to perform the target detection operation on the first sperm video; If the number of the video frames is not the preset number, determining whether the number of the video frames is greater than the preset number; In the case that the number of the video frames is greater than the preset number, starting from the first video frame of the first sperm video, the preset number of video frames are acquired to form a new first sperm video.
4. The method according to claim 3, further comprising: If the number of the video frames is less than the preset number, discarding the first sperm video; as well as Continue to perform the operation of obtaining the first sperm video to obtain a new first sperm video.
5. The method according to claim 3, wherein The preset number is determined by the rotation frequency of sperm; and when the rotation frequency is 8-13 Hz, the preset number is 30 frames.
6. The method according to claim 1, wherein Inputting each second sperm video and its corresponding gender labeling information as training data into the sperm classification model to train the model includes: Inputting each second sperm video into the sperm classification model for classification operation to obtain a gender classification result; A loss value is determined based on the gender labeling information and the gender classification result, and parameters of the sperm classification model are updated based on the loss value.
7. A device for training a sperm classification model, comprising: processor; as well as A memory storing program instructions for training a sperm classification model, wherein when the program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
8. A method for classifying sperm, comprising: Acquire a third sperm video to be classified, wherein the third sperm video to be classified is a moving video of at least one sperm; Preprocessing the third sperm video to be classified to obtain at least one fourth sperm video to be classified, wherein the fourth sperm video to be classified is a moving video of a single sperm; Each fourth sperm video to be classified is input into the sperm classification model trained according to the method according to any one of claims 1 to 6 for classification operation to output the gender classification result of the single sperm in each fourth sperm video to be classified.
9. An apparatus for sorting sperm, comprising: processor; as well as A memory storing program instructions for classifying sperm, wherein when the program instructions are executed by a processor, the method according to claim 8 is implemented.
10. A computer-readable storage medium having stored thereon program instructions for training a sperm classification model and / or for classifying sperm, wherein when the program instructions are executed by a processor, the method according to any one of claims 1 to 6 and / or the method according to claim 8 are implemented.
Citation Information
Patent Citations
Advancing direction determination method and related equipment
CN110991397A
Sperm motility state classification method and device, medium and electronic equipment
CN111080624A
Motor vibration detection method and device, storage medium and computer equipment
CN119445445A
Video object segmentation by reference-guided mask propagation
US20190311202A1
Sperm picking system
WO2021160347A1