A method and device for determining sperm motility based on neural networks

By using neural networks to assess sperm motility, the problems of cumbersome and time-consuming traditional testing methods and human error have been solved, enabling the quantification and accurate assessment of sperm motility.

CN118537320BActive Publication Date: 2026-11-20ZHENGZHOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410678705.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2023-09-05
Filing Date
2024-05-29
Publication Date
2026-11-20
Estimated Expiration
2044-05-29

AI Technical Summary

Technical Problem

Traditional manual sperm motility testing methods are cumbersome, time-consuming, and prone to human error, affecting the accuracy of the test results and making it difficult to quantify sperm motility and morphology.

Method used

A neural network-based approach was adopted to acquire dynamic videos of semen samples, identify sperm position and motility values, perform convolution and pooling operations, and combine sperm morphology scores and other feature values, which were then input into a deep neural network to assess sperm motility.

Benefits of technology

This method enables quantitative assessment of sperm motility, reduces the subjectivity of medical staff, and improves the accuracy and reliability of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537320B_ABST
    Figure CN118537320B_ABST
Patent Text Reader

Abstract

The application provides a sperm motility determination method and device based on a neural network, which comprises the following steps: acquiring a dynamic video of a photographed semen sample, selecting multiple video frames as key frames in the dynamic video, identifying the position of sperm in each key frame, and calculating the motion value of the sperm to obtain a sample motion value; for the same sperm, extracting a sperm image in each key frame, performing convolution and pooling operations on the sperm image to obtain multiple sperm images of the same size, extracting sperm image features and inputting the sperm image features into a neural network model to obtain a sperm morphology score; taking the average value of the morphology scores of all sperm in the sample as a morphology value; and taking the motion value, the morphology value and other characteristic values of the sperm as inputs of a deep neural network to obtain a sperm motility value. The application can quantize the motion information of sperm and comprehensively evaluate the motility of sperm by integrating other information of sperm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence, and in particular to a method and apparatus for determining sperm motility based on neural networks. Background Technology

[0002] Sperm motility is a crucial indicator of male fertility. Healthy sperm should exhibit high levels of activity and strong motility, which helps them effectively travel to the egg and quickly reach it, thus increasing the chances of successful conception. Assessing sperm motility not only helps determine male fertility but also helps doctors identify potential causes of infertility, providing a basis for developing more precise treatment plans. In assisted reproductive technologies, in-vitro fertilization (IVF) is widely used. This technique combines a woman's egg with a man's sperm in a laboratory to form a fertilized egg, which is then transferred back to the woman's uterus. Selecting healthy sperm is particularly important in IVF. However, traditional manual sperm motility testing methods are cumbersome, time-consuming, and susceptible to the subjective influence of different operators, potentially leading to inconsistent results. Furthermore, manual testing is prone to human error, affecting the accuracy of the results. To address these issues, the introduction of automated technologies for sperm motility testing has become a trend.

[0003] The introduction of automated sperm motility testing is significant in reducing human error and effectively improving the accuracy of the test. Compared to manual observation, computer technology can precisely measure and record sperm motility parameters, and even keenly capture subtle differences in movement, thus providing a more comprehensive understanding of sperm motility characteristics. This provides more detailed information for sperm quality assessment, further improving the reliability and accuracy of the results. The assessment of sperm motility mainly relies on multiple parameters, including sperm density, sperm motility, sperm morphology, and semen volume. Although sperm density and semen volume are relatively easy to quantify, sperm motility and sperm morphology lack unified standards and therefore cannot be directly quantified. In this context, neural networks provide a new approach to assessing sperm motility through computer analysis. Summary of the Invention

[0004] To address the aforementioned problems, in a first aspect, the present invention provides a method for assessing sperm motility, the method comprising the following steps:

[0005] Step 1: Acquire a dynamic video of the captured semen sample, select multiple video frames as keyframes in the dynamic video, identify the position of the sperm in each keyframe, and calculate the motion value of the sperm to obtain the sample motion value.

[0006] Step 2: For the same sperm, there is one sperm image in each keyframe. Extract the sperm image in each keyframe, and perform convolution and pooling operations on the sperm image to obtain multiple sperm images of the same size. Multiple sperm images of the same size constitute the sperm image sequence. Input the sperm image sequence into the neural network model to obtain the sperm morphology score; take the average of the morphology scores of all sperm in the sample as the morphology value.

[0007] Step 3: Use the sample motion value, the morphological value, and other sperm feature values ​​as input to the deep neural network to obtain the sperm motility value.

[0008] Preferably, the step of selecting multiple video frames as keyframes in the dynamic video, identifying the position of sperm in each keyframe, and calculating the sperm motion value to obtain the sample motion value is as follows:

[0009] Step 11: Select a segment from the dynamic video, determine the length of the segment, and identify the sperm in the mid-moment image of the segment. Divide an activity area for each sperm according to the length and the maximum swimming speed of the sperm. Determine whether the activity area of ​​the sperm overlaps with other sperm. If not, proceed to S12; otherwise, proceed to S13.

[0010] Step 12: Calculate the grayscale change of the same active region in two adjacent frames of the segmented image, determine the keyframe based on the grayscale change and the size of the active region, identify the position of the sperm in the keyframe, and fit the sperm's motion curve using the least squares method based on the position to obtain the sperm's motion trajectory; wherein, the keyframes are different for different sperm.

[0011] Step 13: Divide the overlapping active areas into at least one group. The active areas in the group overlap with at least one other active area in the group. Obtain the area to be identified based on the positional relationship of the active areas in the group. Determine the interval based on the distance of sperm in the area to be identified. Extract the frame image to be identified from the segment according to the interval. Determine the area corresponding to each group in the frame image to be identified. Identify the position of sperm in the area corresponding to each group. Fit the sperm movement curve using the least squares method based on the position to obtain the sperm movement trajectory.

[0012] S14, determine the motility value of a single sperm based on the sperm's position, trajectory, and length, and use the average motility value of all sperm in the sample as the sample motility value.

[0013] Preferably, the step of dividing each sperm into an activity zone based on the length and the maximum swimming speed of the sperm specifically involves:

[0014] The radius is determined based on the length and the maximum swimming speed of the sperm. Two centers are obtained based on the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined based on the length and the maximum swimming speed of the sperm. A rectangular area is obtained, which is the smallest rectangle that contains the two circles. The rectangular area is used as the activity area of ​​the sperm.

[0015] Preferably, the step of obtaining two center points based on the target bounding box for sperm identification specifically involves:

[0016] Obtain the target bounding box for sperm identification, and get the two widths of the target bounding box. Take the center of the line segment containing each width as the center of a circle.

[0017] Preferably, the calculation of grayscale changes in the same active region between two adjacent frames in the segmentation, and the determination of keyframes based on the grayscale changes and the size of the active region, specifically involves:

[0018] According to the formula Calculate the grayscale change of the same active region in two adjacent frames, where N represents the number of pixels in the same region, and N is a positive integer. This represents the grayscale value of the j-th pixel in the i-th frame. Si represents the grayscale value of the j-th pixel in the (i+1)-th frame, and Si represents the grayscale change of the (i+1)-th frame relative to the same active area in the i-th frame.

[0019] The first frame of the segment is taken as the first keyframe. The next keyframe and the previous keyframe satisfy the condition that the cumulative grayscale change of the same active area in the adjacent frames between them is greater than a threshold, where the threshold is proportional to the size of the active area. The last frame of the segment is taken as the last keyframe.

[0020] Preferably, obtaining the region to be identified based on the positional relationship of the active areas in the group specifically involves:

[0021] Define a rectangle that includes all active areas in the group and has the smallest area; use this rectangle as the region to be identified.

[0022] Preferably, the step of determining the interval based on the distance of sperm in the region to be identified, and extracting the frame image to be identified from the segment according to the interval, specifically involves:

[0023] Calculate the average distance of sperm in the region to be identified, determine the interval according to the preset comparison table of average distance and interval, and extract the frame image to be identified from the segment according to the determined interval, based on the first frame of the segment.

[0024] or,

[0025] Calculate the shortest distance between sperm in the region to be identified, and calculate the ratio of the shortest distance to the standard distance. Use the integer part of the product of the ratio and the standard interval as the interval. Based on the first frame of the segment, extract the frame image to be identified from the segment according to the determined interval.

[0026] Preferably, determining the motility value of a single sperm based on its position, trajectory, and length specifically involves:

[0027] The movement distance is determined based on the sperm's trajectory, and the ratio of the movement distance to the length is calculated to obtain the first parameter;

[0028] A straight line is fitted based on the location of the sperm, and the r-square coefficient is calculated based on the straight line and the location. The r-square coefficient is used as the second parameter.

[0029] The first parameter is normalized to the range of 0-1, and the sperm motility value is calculated according to the formula w1·a1+w2·a2, where w1 and w2 represent weights, and w1+w2=1, a1 represents the normalized first parameter, and a2 represents the second parameter.

[0030] Preferably, the step of inputting the sperm image sequence into the neural network model specifically involves:

[0031] Features are extracted from each sperm image to obtain a sequence, wherein one sperm image corresponds to one sequence. The sequence is used as the input to a neural network model, wherein the number of input parameters of the neural network model is the same as the number of sequences.

[0032] Furthermore, the present invention also provides a sperm motility assessment device, the device comprising the following modules:

[0033] The motion value calculation module is used to acquire dynamic video of the captured semen sample, select multiple video frames as keyframes in the dynamic video, identify the position of the sperm in each keyframe, and calculate the motion value of the sperm to obtain the sample motion value.

[0034] The morphology value calculation module is used to extract the sperm image from each keyframe for the same sperm, perform convolution and pooling operations on the sperm images to obtain multiple sperm images of the same size, and form a sperm image sequence. The sperm image sequence is then input into a neural network model to obtain a sperm morphology score. The average morphology score of all sperm in the sample is used as the morphology value.

[0035] The sperm motility assessment module is used to take the sample motion value, the morphological value, and other sperm characteristic values ​​as inputs to a deep neural network to obtain the sperm motility value.

[0036] Preferably, the step of selecting multiple video frames as keyframes in the dynamic video, identifying the position of sperm in each keyframe, and calculating the sperm motion value to obtain the sample motion value is as follows:

[0037] Step 11: Select a segment from the dynamic video, determine the length of the segment, and identify the sperm in the mid-moment image of the segment. Divide an activity area for each sperm according to the length and the maximum swimming speed of the sperm. Determine whether the activity area of ​​the sperm overlaps with other sperm. If not, proceed to S12; otherwise, proceed to S13.

[0038] Step 12: Calculate the grayscale change of the same active region in two adjacent frames of the segmented image, determine the key frame based on the grayscale change and the size of the active region, identify the position of the sperm in the key frame, and fit the sperm movement curve using the least squares method based on the position to obtain the sperm movement trajectory.

[0039] Step 13: Divide the overlapping active areas into at least one group. The active areas in the group overlap with at least one other active area in the group. Obtain the area to be identified based on the positional relationship of the active areas in the group. Determine the interval based on the distance of sperm in the area to be identified. Extract the frame image to be identified from the segment according to the interval. Determine the area corresponding to each group in the frame image to be identified. Identify the position of sperm in the area corresponding to each group. Fit the sperm movement curve using the least squares method based on the position to obtain the sperm movement trajectory.

[0040] S14, determine the motility value of a single sperm based on the sperm's position, trajectory, and length, and use the average motility value of all sperm in the sample as the sample motility value.

[0041] Preferably, the step of dividing each sperm into an activity zone based on the length and the maximum swimming speed of the sperm specifically involves:

[0042] The radius is determined based on the length and the maximum swimming speed of the sperm. Two centers are obtained based on the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined based on the length and the maximum swimming speed of the sperm. A rectangular area is obtained, which is the smallest rectangle that contains the two circles. The rectangular area is used as the activity area of ​​the sperm.

[0043] Preferably, the step of obtaining two center points based on the target bounding box for sperm identification specifically involves:

[0044] Obtain the target bounding box for sperm identification, and get the two widths of the target bounding box. Take the center of the line segment containing each width as the center of a circle.

[0045] Preferably, the calculation of grayscale changes in the same active region between two adjacent frames in the segmentation, and the determination of keyframes based on the grayscale changes and the size of the active region, specifically involves:

[0046] According to the formula Calculate the grayscale change of the same active region in two adjacent frames, where N represents the number of pixels in the same region, and N is a positive integer. This represents the grayscale value of the j-th pixel in the i-th frame. S represents the grayscale value of the j-th pixel in the (i+1)-th frame. i This represents the grayscale change of the (i+1)th frame relative to the same active area in the i-th frame;

[0047] The first frame of the segment is taken as the first keyframe. The next keyframe and the previous keyframe satisfy the condition that the cumulative grayscale change of the same active area in the adjacent frames between them is greater than a threshold, where the threshold is proportional to the size of the active area. The last frame of the segment is taken as the last keyframe.

[0048] Preferably, obtaining the region to be identified based on the positional relationship of the active areas in the group specifically involves:

[0049] Define a rectangle that includes all active areas in the group and has the smallest area; use this rectangle as the region to be identified.

[0050] Preferably, the step of determining the interval based on the distance of sperm in the region to be identified, and extracting the frame image to be identified from the segment according to the interval, specifically involves:

[0051] Calculate the average distance of sperm in the region to be identified, determine the interval according to the preset comparison table of average distance and interval, and extract the frame image to be identified from the segment according to the determined interval, based on the first frame of the segment.

[0052] or,

[0053] Calculate the shortest distance between sperm in the region to be identified, and calculate the ratio of the shortest distance to the standard distance. Use the integer part of the product of the ratio and the standard interval as the interval. Based on the first frame of the segment, extract the frame image to be identified from the segment according to the determined interval.

[0054] Preferably, determining the motility value of a single sperm based on its position, trajectory, and length specifically involves:

[0055] The movement distance is determined based on the sperm's trajectory, and the ratio of the movement distance to the length is calculated to obtain the first parameter;

[0056] A straight line is fitted based on the location of the sperm, and an r-square coefficient is calculated based on the straight line and the location. The r-square coefficient is used as the second parameter.

[0057] The first parameter is normalized to the range of 0-1, and the sperm motility value is calculated according to the formula w1·a1+w2·a2, where w1 and w2 represent weights, and w1+w2=1, a1 represents the normalized first parameter, and a2 represents the second parameter.

[0058] Preferably, the step of inputting the sperm image sequence into the neural network model specifically involves:

[0059] Features are extracted from each sperm image to obtain a sequence, wherein one sperm image corresponds to one sequence. The sequence is used as the input to a neural network model, wherein the number of input parameters of the neural network model is the same as the number of sequences.

[0060] Finally, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described above.

[0061] To address the problem that existing technologies rely heavily on the experience of medical personnel, leading to significant subjectivity and difficulty in quantifying sperm movement and morphology, this invention calculates sperm movement values ​​to obtain sample movement values ​​and utilizes a neural network to obtain sperm morphology scores. The sample movement values, morphology values, and other sperm characteristic values ​​are used as inputs to a deep neural network to obtain sperm motility values. Furthermore, this invention considers the relationship between sperm movement trajectories and straight lines when calculating sperm movement values. This invention achieves the effect of quantifying sperm movement and comprehensively calculating sperm motility by combining other information, reducing the impact of medical personnel subjectivity on the results of sperm motility assessment. Attached Figure Description

[0062] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0063] Figure 1 The flowchart for Example 1

[0064] Figure 2 This is a flowchart of a specific embodiment in Example 1;

[0065] Figure 3 A schematic diagram showing the center and radius of the sperm motility region;

[0066] Figure 4 This is a schematic diagram of the sperm motility region. Detailed Implementation

[0067] In this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, without necessarily requiring or implying any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0069] Example 1

[0070] This invention provides a method for assessing sperm motility, such as... Figure 1 As shown, the method includes the following steps:

[0071] Step 1: Acquire a dynamic video of the captured semen sample, select multiple video frames as keyframes in the dynamic video, identify the position of the sperm in each keyframe, and calculate the motion value of the sperm to obtain the sample motion value.

[0072] In assessing sperm motility in semen, it is necessary to obtain dynamic video of the semen sample. This dynamic video can be captured by a camera on a microscope, allowing observation of sperm movement and morphology. Due to the high frame rate of the video (multiple frames per second), processing each frame individually would be computationally intensive. Furthermore, sperm movement is slow, and changes between adjacent frames are minimal. Therefore, this invention first selects multiple video frames as keyframes from the dynamic video. In one specific embodiment, keyframes are determined by selecting a video frame at regular intervals. However, this method is too rigid, as different sperm species exhibit varying activity levels. In another embodiment, a segment of the video is selected first, and then keyframes are determined based on the sperm's activity area. This embodiment will be described in detail below.

[0073] It should be noted that there are two ways to determine keyframes. The first way is to determine keyframes by spacing them at certain intervals, that is, by spacing two keyframes at certain intervals. In this way, for different sperm, determining the location of the sperm and extracting the sperm image in steps 1 and 2 are both done in the same keyframe. In addition, there is another way where different sperm have different keyframes. In this way, for different sperm, determining the location of the sperm and extracting the sperm image in steps 1 and 2 are both done in the keyframe corresponding to the sperm.

[0074] Step 2: For the same sperm, there is one sperm image in each keyframe. Extract the sperm image in each keyframe, and perform convolution and pooling operations on the sperm image to obtain multiple sperm images of the same size. Multiple sperm images of the same size constitute the sperm image sequence. Input the sperm image sequence into the neural network model to obtain the sperm morphology score; take the average of the morphology scores of all sperm in the sample as the morphology value.

[0075] Sperm morphology information is primarily determined based on the sperm's external shape. Sperm motility varies at different times. Sperm images are extracted from keyframes; since there are multiple keyframes, each sperm has multiple images. These multiple images are input into a trained neural network model to obtain a sperm score. Preferably, a convolutional neural network model is used, but a ViT network model can also be used. Preferably, a ViT network model is used. Feature extraction is performed on the sperm images in each keyframe to obtain a sequence, which is then input into the ViT network model.

[0076] Step 3: Use the sample motion value, the morphological value, and other sperm feature values ​​as input to the deep neural network to obtain the sperm motility value.

[0077] Sperm motility, morphology, and other sperm characteristics are input into a deep neural network to obtain sperm motility, or semen motility. These other sperm characteristics include one or more of pH value, density, and semen volume; however, they can also be other characteristics besides pH value, density, and semen volume. In an alternative approach, the deep neural network is replaced by an MLP (Multi-Level Processing).

[0078] Preferably, multiple video frames are selected as keyframes in the dynamic video, the position of sperm in each keyframe is identified, and the motion value of the sperm is calculated to obtain the sample motion value, such as... Figure 2 As shown, specifically:

[0079] Step 11: Select a segment from the dynamic video, determine the length of the segment, and identify the sperm in the mid-moment image of the segment. Divide an activity area for each sperm according to the length and the maximum swimming speed of the sperm. Determine whether the activity area of ​​the sperm overlaps with other sperm. If not, proceed to S12; otherwise, proceed to S13.

[0080] After preparing the sperm sample, the sperm can be photographed using a camera connected to a microscope on a computer. The duration of the photographs can be determined by the user. After photographing, the user can select one or more clear sperm videos. The sperm videos not only show the morphology of the sperm but also their motility. According to the standards of the World Health Organization, approximately 60% of normally motile sperm should be in a motile state, and healthy sperm should move forward in a straight line.

[0081] Each segment includes several frames of sperm images. Since the video consists of multiple images, if the frame rate is 50fps, then each second contains 50 images. Assuming a segment is 3 seconds long, there would be 150 images. After obtaining the segmented data, the image at the midpoint of the time interval is selected as the basis. Then, based on the length and the maximum sperm swimming speed, the swimming area or activity area of ​​a sperm within that segment can be determined. The length mentioned here can be either the duration of the video or the length of a frame.

[0082] After obtaining the motility region of each sperm, it is determined whether the motility region of a sperm overlaps with the motility regions of other sperm. If not, it is only necessary to extract the region of this sperm in each image frame of the segment and then analyze the motility region of this sperm. If there is overlap, it is necessary to eliminate the influence of the overlap on the sperm trajectory analysis.

[0083] In this invention, each sperm corresponds to a motility region, and this motility region remains unchanged in each frame of the segmented image. After determining the motility region of a sperm, the same region can be directly extracted from other frames. This avoids repeatedly performing region identification for each frame. For example, if the motility region of a sperm is (0,0), (0,5), (5,0), (5,5), then the same region can be directly extracted from other frames.

[0084] Step 12: Calculate the grayscale change of the same active region in two adjacent frames of the segmented image, determine the keyframe based on the grayscale change and the size of the active region, identify the position of the sperm in the keyframe, and fit the sperm's motion curve using the least squares method based on the position to obtain the sperm's motion trajectory; wherein, the keyframes are different for different sperm.

[0085] If sperm position identification is performed for every frame, the computational load is substantial. Using a 3-second, 50fps timeframe as an example, this would require processing 150 images. This is just for one sperm; with 150 sperm, the data volume would be even larger. Therefore, for sperm without overlapping motility regions, keyframes are determined within segments based on grayscale changes and the size of the motility region. The grayscale changes refer to the grayscale variations within the motility region; different sperm have different motility regions, resulting in different grayscale changes. Each sperm also has different keyframes. For example, based on grayscale changes and the size of the motility region, the keyframes for sperm 1 are determined to be 1, 51, and 101, while the keyframes for sperm 2 are 1, 41, 81, and 121. Then, the sperm position within the keyframes is determined based on the motility region. After identifying the trajectory of the sperm's motility region in all keyframes, the least squares method can be used to fit the sperm's motility curve, obtaining the sperm's trajectory. In an alternative implementation, polynomial fitting or gradient descent can be used to fit the sperm motility curve.

[0086] Taking sperm 1 and sperm 2 as examples again, in keyframes 1, 51, and 101 of sperm 1, the sperm's position is (2.5, 2.5), (2.5, 3), and (2.5, 4), thus the trajectory of sperm 1 can be fitted. Similarly, the trajectory of sperm 2 can be fitted based on the position of sperm 2 in its corresponding keyframe.

[0087] There are various methods for identifying sperm position, including but not limited to YOLOv4, YOLOv5, or R-CNN, as well as traditional image analysis methods. This invention does not specifically limit these methods. Sperm have a certain length; unless otherwise specified in this invention, the position of the sperm head is used as the sperm position in sperm position identification and trajectory fitting.

[0088] Step 13: Divide the overlapping active areas into at least one group. The active areas in the group overlap with at least one other active area in the group. Obtain the area to be identified based on the positional relationship of the active areas in the group. Determine the interval based on the distance of sperm in the area to be identified. Extract the frame image to be identified from the segment according to the interval. Determine the area corresponding to each group in the frame image to be identified. Identify the position of sperm in the area corresponding to each group. Fit the sperm movement curve using the least squares method based on the position to obtain the sperm movement trajectory.

[0089] If the activity areas of different sperm overlap, the location to be identified needs to be more precise in order to prevent other sperm from influencing each other in the overlapping area. In this invention, sperm in a group are treated as a collective. Specifically, the area to be identified is obtained according to the activity area of ​​each sperm in the group. Then, the interval is determined according to the distance between sperm in the area to be identified. In a specific embodiment, if the distance between sperm in the area to be identified is relatively close, that is, the sperm are relatively dense, the interval is smaller. Otherwise, the interval can be appropriately increased. Then, the frame image to be identified is extracted from the segment according to the interval.

[0090] One group corresponds to one region to be identified, and one region to be identified corresponds to one interval. For example, sperm 3, 4, and 5 are located in group 1. The region to be identified can be obtained based on the activity areas of sperm 3, 4, and 5. Similarly, the position of the region to be identified is the same in all frames of the segment. The overlap between an activity area in a group and at least one other activity area in the group means that each activity area in the group overlaps with at least one of the remaining activity areas. For example, if sperm 3, 4, and 5 are located in group 1, then the activity area of ​​sperm 3 overlaps with the activity areas of at least one of sperm 4 and 5.

[0091] Then, the positions of all sperm in the group are identified, and the trajectory of each sperm is fitted based on its position to obtain the movement trajectory of each sperm in the group. In an alternative implementation, polynomial fitting or gradient descent method is used to fit the sperm movement curve.

[0092] In step S3, a region to be identified contains multiple sperm. The location of multiple sperm is identified by instance segmentation, or Mask R-CNN, YOLACT++, SOLOv2, etc. This invention does not specifically limit the method.

[0093] S14, determine the motility value of a single sperm based on the sperm's position, trajectory, and length, and use the average motility value of all sperm in the sample as the sample motility value.

[0094] The sperm's movement trajectory can indicate its swimming speed. In addition, the sperm's movement trajectory also reflects its direction of movement. High-quality sperm mostly move in one direction. The sperm's position can determine its direction of movement. If the sperm's movement trajectory is close to a straight line, the sperm quality is relatively high.

[0095] Within a segment, the maximum motility area of ​​sperm and the sperm's swimming speed are related to the segment duration. Sperm also have a certain length. In one specific embodiment, the process of dividing each sperm into a motility area based on its length and maximum swimming speed is as follows:

[0096] The radius is determined based on the length and the maximum swimming speed of the sperm. Two centers are obtained based on the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined based on the length and the maximum swimming speed of the sperm. A rectangular area is obtained, which is the smallest rectangle that contains the two circles. The rectangular area is used as the activity area of ​​the sperm.

[0097] If the length is time, the radius can be obtained by multiplying the length and the maximum swimming speed. If the time is frames, the time is calculated based on the number of frames, and then the radius is obtained by multiplying the calculated time and the maximum swimming speed. The maximum swimming speed of the sperm is preset; according to the World Health Organization standard, the normal speed of sperm is 25 micrometers per second.

[0098] The center of the circle can be determined by identifying sperm. In a simple embodiment, the process of obtaining two centers based on the target box for sperm identification is as follows:

[0099] Obtain the target bounding box for sperm identification, and get the two widths of the target bounding box. Take the center of the line segment containing each width as the center of a circle. Figure 3 This shows the two centers and radii of a sperm. Figure 4 The area of ​​sperm activity is shown.

[0100] When sperm move within the motile region, they cause changes in the grayscale of that region. These grayscale changes indicate sperm motility. In one specific embodiment, the grayscale change of the same motile region is calculated between two adjacent frames in each segment. Keyframes are then determined based on these grayscale changes and the size of the motile region. Specifically:

[0101] According to the formula Calculate the grayscale change of the same active region in two adjacent frames, where N represents the number of pixels in the same region, and N is a positive integer. This represents the grayscale value of the j-th pixel in the i-th frame. S represents the grayscale value of the j-th pixel in the (i+1)-th frame.i This represents the grayscale change of the (i+1)th frame relative to the same active area in the i-th frame;

[0102] The first frame of each segment is taken as the first keyframe. The next keyframe and the previous keyframe satisfy the condition that the cumulative grayscale change of the same active area in the adjacent frames between them is greater than a threshold, and the threshold is proportional to the size of the active area. The last frame of each segment is taken as the last keyframe.

[0103] In the above process, the active area in each frame is fixed in the image, but the grayscale of the active area changes due to the movement of sperm. The sperm activity can be determined by the change in the active area between two adjacent frames.

[0104] For a sperm, its active area has N pixels, which means that the active area has N pixels in each frame of the segment. Then, the change of the same pixel in two adjacent frames is calculated, and the grayscale change of the active area can be obtained by accumulating the pixel value changes of N pixels.

[0105] After calculating the grayscale changes of the same active region in two adjacent frames, the changes in the same active region across multiple adjacent frames are accumulated to obtain a cumulative result. If the accumulated result exceeds a threshold, it indicates that sperm movement has reached a certain level, at which point sperm identification is performed. This method effectively reduces the amount of data required for image recognition and improves recognition speed.

[0106] Figure 3 The diagram illustrates the region to be identified, which is the activity area of ​​a sperm. When there are multiple sperm, the identification process is similar. Specifically, a rectangle is defined that includes all the activity areas in the group and has the smallest area; this rectangle is then used as the region to be identified.

[0107] The denser the sperm, the more images need to be identified in order to better obtain the movement trajectory of sperm in a dense state. In one embodiment, determining the interval based on the distance of sperm in the region to be identified, and extracting the frame image to be identified from the segment according to the interval, specifically involves:

[0108] Calculate the average distance of sperm in the region to be identified, determine the interval according to the preset comparison table of average distance and interval, and extract the frame image to be identified from the segment according to the determined interval, based on the first frame of the segment.

[0109] or,

[0110] Calculate the shortest distance between sperm in the region to be identified, and calculate the ratio of the shortest distance to the standard distance. Use the integer part of the product of the ratio and the standard interval as the interval. Based on the first frame of the segment, extract the frame image to be identified from the segment according to the determined interval.

[0111] Sperm motility is related not only to its movement speed but also to whether it is close to a straight line. In one specific embodiment, determining sperm motility based on the sperm's position, trajectory, and length specifically involves:

[0112] The movement distance is determined based on the sperm's trajectory, and the ratio of the movement distance to the length is calculated to obtain the first parameter;

[0113] A straight line is fitted based on the location of the sperm, and an r-square coefficient is calculated based on the straight line and the location. The r-square coefficient is used as the second parameter.

[0114] The first parameter is normalized to the range of 0-1, and the sperm motility is calculated according to the formula w1.a1+w2.a2, where w1 and w2 represent weights, and w1+w2=1, a1 represents the normalized first parameter, and a2 represents the second parameter.

[0115] The first parameter is the sperm's movement speed, and the second parameter represents how closely the sperm's movement approximates a straight line. The R-squared coefficient, also known as the coefficient of determination, is 1 when the sperm's position falls entirely on the straight line, and 0 if it has no relation to the line.

[0116] In another embodiment, the r-square coefficient can be replaced by the average distance from the sperm position to the line, with the average distance being used as a second parameter.

[0117] For a single sperm cell, when there are multiple segments, the average motility of the sperm in all segments is used as the final sperm motility. If it is necessary to obtain the motility of a single semen sample based on the motility of multiple sperm cells, the average motility of all sperm cells in each segment is used as the final motility value of the semen sample.

[0118] Preferably, the step of inputting the sperm image sequence into the neural network model specifically involves:

[0119] Features are extracted from each sperm image to obtain a sequence, where one sperm image corresponds to one sequence. These sequences are used as input to a neural network model, where the number of input parameters is the same as the number of sequences. For example, if there are 5 keyframes, then each sperm has 5 sperm images, forming a sperm image sequence. Each image undergoes feature extraction to obtain a sequence, and these 5 sequences are input into the neural network model.

[0120] In an alternative embodiment, features are extracted from each image of the sperm, with one sperm image corresponding to one image feature. The image features of multiple images corresponding to the sperm are used as input to the neural network. For example, if there are 5 keyframes, then there are 5 sperm images for each sperm. These 5 sperm images constitute the image sequence of the sperm. Each image undergoes feature extraction to obtain a feature map, and the 5 feature maps are input into the neural network model.

[0121] Example 2

[0122] The present invention also provides a sperm motility assessment device, the device comprising the following modules:

[0123] The motion value calculation module is used to acquire dynamic video of the captured semen sample, select multiple video frames as keyframes in the dynamic video, identify the position of the sperm in each keyframe, and calculate the motion value of the sperm to obtain the sample motion value.

[0124] The morphology value calculation module is used to extract the sperm image from each keyframe for the same sperm, perform convolution and pooling operations on the sperm images to obtain multiple sperm images of the same size, and form a sperm image sequence. The sperm image sequence is then input into a neural network model to obtain a sperm morphology score. The average morphology score of all sperm in the sample is used as the morphology value.

[0125] The sperm motility assessment module is used to take the motility value, the morphology value, and other sperm characteristic values ​​as inputs to a deep neural network to obtain the sperm motility value.

[0126] Preferably, the step of selecting multiple video frames as keyframes in the dynamic video, identifying the position of sperm in each keyframe, and calculating the sperm motion value to obtain the sample motion value is as follows:

[0127] Step 11: Select a segment from the dynamic video, determine the length of the segment, and identify the sperm in the mid-moment image of the segment. Divide an activity area for each sperm according to the length and the maximum swimming speed of the sperm. Determine whether the activity area of ​​the sperm overlaps with other sperm. If not, proceed to S12; otherwise, proceed to S13.

[0128] Step 12: Calculate the grayscale change of the same active region in two adjacent frames of the segmented image, determine the keyframe based on the grayscale change and the size of the active region, identify the position of the sperm in the keyframe, and fit the sperm's motion curve using the least squares method based on the position to obtain the sperm's motion trajectory; wherein, the keyframes are different for different sperm.

[0129] Step 13: Divide the overlapping active areas into at least one group. The active areas in the group overlap with at least one other active area in the group. Obtain the area to be identified based on the positional relationship of the active areas in the group. Determine the interval based on the distance of sperm in the area to be identified. Extract the frame image to be identified from the segment according to the interval. Determine the area corresponding to each group in the frame image to be identified. Identify the position of sperm in the area corresponding to each group. Fit the sperm movement curve using the least squares method based on the position to obtain the sperm movement trajectory.

[0130] S14, determine the motility value of a single sperm based on the sperm's position, trajectory, and length, and use the average motility value of all sperm in the sample as the sample motility value.

[0131] Preferably, the step of dividing each sperm into an activity area based on the length and the maximum swimming speed of the sperm specifically involves:

[0132] The radius is determined based on the length and the maximum swimming speed of the sperm. Two centers are obtained based on the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined based on the length and the maximum swimming speed of the sperm. A rectangular area is obtained, which is the smallest rectangle that contains the two circles. The rectangular area is used as the activity area of ​​the sperm.

[0133] Preferably, the step of obtaining two center points based on the target bounding box for sperm identification specifically involves:

[0134] Obtain the target bounding box for sperm identification, and get the two widths of the target bounding box. Take the center of the line segment containing each width as the center of a circle.

[0135] Preferably, the calculation involves determining the grayscale change of the same active region in two adjacent frames within a segment, and then determining keyframes based on the grayscale change and the size of the active region. Specifically:

[0136] According to the formula Calculate the grayscale change of the same active region in two adjacent frames, where N represents the number of pixels in the same region, and N is a positive integer. This represents the grayscale value of the j-th pixel in the i-th frame. Si represents the grayscale value of the j-th pixel in the (i+1)-th frame, and Si represents the grayscale change of the (i+1)-th frame relative to the same active area in the i-th frame.

[0137] The first frame of the segment is taken as the first keyframe. The next keyframe and the previous keyframe satisfy the condition that the cumulative grayscale change of the same active area in the adjacent frames between them is greater than a threshold, and the threshold is proportional to the size of the active area. The last frame of the segment is taken as the last keyframe.

[0138] Preferably, obtaining the region to be identified based on the positional relationship of the active areas in the group specifically involves:

[0139] Define a rectangle that includes all active areas in the group and has the smallest area; use this rectangle as the region to be identified.

[0140] Preferably, the step of determining the interval based on the distance of sperm in the region to be identified, and extracting the frame image to be identified from the segment according to the interval, specifically involves:

[0141] Calculate the average distance of sperm in the region to be identified, determine the interval according to the preset comparison table of average distance and interval, and extract the frame image to be identified from the segment according to the determined interval, based on the first frame of the segment.

[0142] or,

[0143] Calculate the shortest distance between sperm in the region to be identified, and calculate the ratio of the shortest distance to the standard distance. Use the integer part of the product of the ratio and the standard interval as the interval. Based on the first frame of the segment, extract the frame image to be identified from the segment according to the determined interval.

[0144] Preferably, determining the motility value of a single sperm based on its position, trajectory, and length specifically involves:

[0145] The movement distance is determined based on the sperm's trajectory, and the ratio of the movement distance to the length is calculated to obtain the first parameter;

[0146] A straight line is fitted based on the location of the sperm, and an r-square coefficient is calculated based on the straight line and the location. The r-square coefficient is used as the second parameter.

[0147] The first parameter is normalized to the range of 0-1, and the sperm motility value is calculated according to the formula w1·a1+w2·a2, where w1 and w2 represent weights, and w1+w2=1, a1 represents the normalized first parameter, and a2 represents the second parameter.

[0148] Preferably, the extraction of sperm image features and input into the neural network model specifically involves:

[0149] Features are extracted from each sperm image to obtain a sequence, wherein one sperm image corresponds to one sequence. The sequence is used as the input to a neural network model, and the number of input parameters of the neural network model is the same as the number of sequences.

[0150] Example 3

[0151] The present invention provides a computer-readable storage medium on which a computer program is stored, the computer program implementing the method described in the first embodiment when executed by a processor.

[0152] Example 4

[0153] The present invention also provides a computer device, the computer device including a processor and a memory, the memory storing a computer program, the computer program implementing the method as described in the first embodiment when executed by the processor.

[0154] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of a necessary general-purpose hardware platform, or by a combination of hardware and software. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a computer product. The present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for determining sperm motility based on neural networks, characterized in that, The method includes the following steps: Step 1: Acquire a dynamic video of the captured semen sample, select multiple video frames as keyframes in the dynamic video, identify the position of the sperm in each keyframe, and calculate the motion value of the sperm to obtain the sample motion value. Step 2: For the same sperm, there is one sperm image in each keyframe. Extract the sperm image in each keyframe, and perform convolution and pooling operations on the sperm image to obtain multiple sperm images of the same size. Multiple sperm images of the same size constitute the sperm image sequence. Input the sperm image sequence into the neural network model to obtain the sperm morphology score; take the average of the morphology scores of all sperm in the sample as the morphology value. Step 3: Use the sample motion value, the morphological value, and other sperm feature values ​​as input to the deep neural network to obtain the sperm motility value; The process involves selecting multiple video frames as keyframes in the dynamic video, identifying the position of sperm in each keyframe, and calculating the sperm's motion value to obtain the sample motion value. Specifically: Step 11: Select a segment from the dynamic video, determine the length of the segment, and identify the sperm in the mid-moment image of the segment. Divide an activity area for each sperm according to the length and the maximum swimming speed of the sperm. Determine whether the activity area of ​​the sperm overlaps with other sperm. If not, proceed to step 12; otherwise, proceed to step 13. Step 12: Calculate the grayscale change of the same active region in two adjacent frames of the segmented image, determine the keyframe based on the grayscale change and the size of the active region, identify the position of the sperm in the keyframe, and fit the sperm's motion curve using the least squares method based on the position to obtain the sperm's motion trajectory; wherein, the keyframes are different for different sperm. Step 13: Divide the overlapping active areas into at least one group. The active areas in the group overlap with at least one other active area in the group. Obtain the area to be identified based on the positional relationship of the active areas in the group. Determine the interval based on the distance of sperm in the area to be identified. Extract the frame image to be identified from the segment according to the interval. Determine the area corresponding to each group in the frame image to be identified. Identify the position of sperm in the area corresponding to each group. Fit the sperm movement curve using the least squares method based on the position to obtain the sperm movement trajectory. Step 14: Determine the motility value of a single sperm based on its position, trajectory, and length, and use the average motility value of all sperm in the sample as the sample motility value.

2. The method as described in claim 1, characterized in that, The process of dividing each sperm into an activity zone based on its length and maximum sperm motility is specifically as follows: The radius is determined based on the length and the maximum swimming speed of the sperm. Two centers are obtained based on the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined based on the length and the maximum swimming speed of the sperm. A rectangular area is obtained, which is the smallest rectangle that contains the two circles. The rectangular area is used as the activity area of ​​the sperm.

3. The method as described in claim 2, characterized in that, The process of obtaining two circle centers based on the target bounding box for sperm identification is as follows: Obtain the target bounding box for sperm identification, and get the two widths of the target bounding box. Take the center of the line segment containing each width as the center of a circle.

4. The method as described in claim 1, characterized in that, The calculation involves determining the grayscale change of the same active region in two adjacent frames within a segment, and then determining keyframes based on the grayscale change and the size of the active region. Specifically: According to the formula Calculate the grayscale change of the same active region in two adjacent frames, where N represents the number of pixels in the same region, and N is a positive integer. This represents the grayscale value of the j-th pixel in the i-th frame. S represents the grayscale value of the j-th pixel in the (i+1)-th frame. i This represents the grayscale change of the (i+1)th frame relative to the same active area in the i-th frame; The first frame of the segment is taken as the first keyframe. The next keyframe and the previous keyframe satisfy the condition that the cumulative grayscale change of the same active area in the adjacent frames between them is greater than a threshold, and the threshold is proportional to the size of the active area. The last frame of the segment is taken as the last keyframe.

5. The method as described in claim 1, characterized in that, The process of obtaining the region to be identified based on the positional relationship of the active regions in the group specifically involves: Define a rectangle that includes all active areas in the group and has the smallest area; use this rectangle as the region to be identified.

6. The method as described in claim 1, characterized in that, The step of determining the interval based on the distance of sperm in the region to be identified, and extracting the frame image to be identified from the segment according to the interval, specifically involves: Calculate the average distance of sperm in the region to be identified, determine the interval according to the preset comparison table of average distance and interval, and extract the frame image to be identified from the segment according to the determined interval, based on the first frame of the segment. or, Calculate the shortest distance between sperm in the region to be identified, and calculate the ratio of the shortest distance to the standard distance. Use the integer part of the product of the ratio and the standard interval as the interval. Based on the first frame of the segment, extract the frame image to be identified from the segment according to the determined interval.

7. The method as described in claim 1, characterized in that, The determination of the motility value of a single sperm based on its position, trajectory, and length is specifically as follows: The movement distance is determined based on the sperm's trajectory, and the ratio of the movement distance to the length is calculated to obtain the first parameter; A straight line is fitted based on the sperm position, and an rsquare coefficient is calculated based on the straight line and the position. The rsquare coefficient is used as a second parameter. The first parameter is normalized to the range of 0-1, and the sperm motility value is calculated according to the formula w1·a1+w2·a2, where w1 and w2 represent weights, and w1+w2=1, a1 represents the normalized first parameter, and a2 represents the second parameter.

8. The method as described in claim 1, characterized in that, The process of inputting the sperm image sequence into the neural network model specifically involves: Features are extracted from each sperm image to obtain a sequence, wherein one sperm image corresponds to one sequence. The sequence is used as the input to a neural network model, wherein the number of input parameters of the neural network model is the same as the number of sequences.

9. A sperm motility determination device based on a neural network, characterized in that, The device includes the following modules: The motion value calculation module is used to acquire dynamic video of the captured semen sample, select multiple video frames as keyframes in the dynamic video, identify the position of the sperm in each keyframe, and calculate the motion value of the sperm to obtain the sample motion value. The morphology value calculation module is used to extract the sperm image from each keyframe for the same sperm, perform convolution and pooling operations on the sperm images to obtain multiple sperm images of the same size, and form a sperm image sequence. The sperm image sequence is then input into a neural network model to obtain a sperm morphology score. The average morphology score of all sperm in the sample is used as the morphology value. The sperm motility assessment module is used to take the sample motion value, the morphological value, and other sperm characteristic values ​​as inputs to a deep neural network to obtain the sperm motility value. The process involves selecting multiple video frames as keyframes in the dynamic video, identifying the position of sperm in each keyframe, and calculating the sperm's motion value to obtain the sample motion value. Specifically: Step 11: Select a segment from the dynamic video, determine the length of the segment, and identify the sperm in the mid-moment image of the segment. Divide an activity area for each sperm according to the length and the maximum swimming speed of the sperm. Determine whether the activity area of ​​the sperm overlaps with other sperm. If not, proceed to step 12; otherwise, proceed to step 13. Step 12: Calculate the grayscale change of the same active region in two adjacent frames of the segmented image, determine the keyframe based on the grayscale change and the size of the active region, identify the position of the sperm in the keyframe, and fit the sperm's motion curve using the least squares method based on the position to obtain the sperm's motion trajectory; wherein, the keyframes are different for different sperm. Step 13: Divide the overlapping active areas into at least one group. The active areas in the group overlap with at least one other active area in the group. Obtain the area to be identified based on the positional relationship of the active areas in the group. Determine the interval based on the distance of sperm in the area to be identified. Extract the frame image to be identified from the segment according to the interval. Determine the area corresponding to each group in the frame image to be identified. Identify the position of sperm in the area corresponding to each group. Fit the sperm movement curve using the least squares method based on the position to obtain the sperm movement trajectory. S14, determine the motility value of a single sperm based on the sperm's position, trajectory, and length, and use the average motility value of all sperm in the sample as the sample motility value.

Citation Information

Patent Citations

  • Key frame screening method based on interested target distribution

    CN113112519A

  • A method and system for determining quality of semen sample

    IN201847008379A