Method and device for determining sperm motility based on neural network

Through dynamic video analysis and neural network models, sperm motility is automatically assessed, which solves the cumbersome and inaccurate problems of traditional detection methods and improves the accuracy and reliability of sperm motility detection.

CN118537320AActive Publication Date: 2024-08-23ZHENGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional manual sperm motility testing methods are cumbersome and time-consuming, and are affected by human errors and subjective factors, resulting in inconsistent and low-accuracy test results, making it difficult to directly quantify sperm motility and morphology.

Method used

Dynamic videos are used to obtain semen samples. By identifying sperm positions in key frames, calculating movement values ​​and morphology scores, and inputting into deep neural networks combined with neural network models to evaluate sperm motility, human errors are reduced and detection accuracy is improved.

Benefits of technology

It realizes the automation of sperm motility assessment, improves the accuracy and reliability of detection, reduces the impact of medical staff's subjectivity on the results, and enables a more comprehensive insight into the movement characteristics of sperm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537320A
    Figure CN118537320A
Patent Text Reader

Abstract

The invention provides a sperm motility determination method and device based on a neural network, and the method comprises the steps: obtaining a dynamic video of a shot sperm sample, selecting a plurality of video frames from the dynamic video as key frames, recognizing the position of sperm in each key frame, and calculating the movement value of sperm to obtain a sample movement value; for the same sperm, extracting sperm images in each key frame, performing convolution and pooling operation on the sperm images to obtain a plurality of sperm images with the same size, extracting sperm image features and inputting the features into the neural network model to obtain sperm morphology scores; taking the average value of the morphological scores of all sperms in the sample as a morphological value; and taking the motion value, the form value and other characteristic values of the sperms as input of a deep neural network to obtain a sperm motility value. According to the method, the movement information of the sperms can be quantified, and the sperm motility can be comprehensively evaluated by integrating other information of the sperms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a method and device for determining sperm motility based on a neural network. Background Art

[0002] Sperm motility is one of the important indicators of male fertility. Healthy sperm should show a high level of activity and strong motility, which helps them move forward effectively and quickly approach the egg, thereby increasing the chance of successful conception. By evaluating sperm motility, it is not only possible to determine male fertility, but also helps doctors identify potential causes of infertility and provide a basis for formulating more accurate treatment plans. In assisted reproductive technology, in vitro fertilization is widely used. This technology combines a woman's egg with a man's sperm in the laboratory to form a fertilized egg, which is then transplanted back into the woman's uterus. In the process of in vitro fertilization, it is particularly important to select healthy sperm. However, the traditional manual sperm motility detection method is cumbersome and time-consuming, and there are subjective factors of different operators, which may lead to inconsistent results. In addition, manual detection is susceptible to human errors, which affects the accuracy of the test results. In order to solve these problems, it has become a trend to introduce automated technology to detect sperm motility.

[0003] The introduction of automated sperm motility testing is of great significance in reducing human errors and effectively improving the accuracy of testing. Compared with manual observation, the use of computer technology can accurately measure and record the motion parameters of sperm, and can even keenly capture tiny motion differences, thereby providing a more comprehensive insight into the motion characteristics of sperm. This provides more detailed information for sperm quality assessment, further improving the reliability and accuracy of the results. The assessment of sperm motility mainly depends 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 way to assess sperm motility through computer analysis. Summary of the invention

[0004] In order to solve the above problems, in a first aspect, the present invention provides a method for evaluating sperm motility, the method comprising the following steps:

[0005] Step 1, obtaining a dynamic video of a semen sample, selecting multiple video frames in the dynamic video as key frames, identifying the position of sperm in each key frame, and calculating the movement value of the sperm to obtain a sample movement value;

[0006] Step 2: for the same sperm, there is one sperm image in each key frame. The sperm image in each key frame is extracted, and convolution and pooling operations are performed on the sperm image to obtain multiple sperm images of the same size. The multiple sperm images of the same size constitute an image sequence of the sperm. The sperm image sequence is input into the neural network model to obtain the sperm morphology score; the average value of the morphology scores of all sperm in the sample is taken as the morphology value;

[0007] Step 3: Using the sample motion value, the morphology value and other characteristic values ​​of sperm as inputs of a deep neural network to obtain a sperm motility value.

[0008] Preferably, the method selects a plurality of video frames as key frames in the dynamic video, identifies the position of sperm in each key frame, and calculates the motion value of sperm to obtain the sample motion value, specifically:

[0009] Step 11, selecting a segment from the dynamic video, determining the length of the segment, and identifying sperm in the image at the middle moment of the segment, dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm, and determining whether the activity area of ​​the sperm overlaps with other sperms, if not, executing S12, otherwise, executing S13;

[0010] Step 12, calculating the grayscale change of the same active area in two adjacent frames of images in the segment, determining a key frame according to the grayscale change and the size of the active area, identifying the position of the sperm in the key frame, and fitting the motion curve of the sperm according to the position using the least square method to obtain the motion trajectory of the sperm; wherein the key frames of different sperm are different;

[0011] Step 13, dividing the overlapping activity areas into at least one group, wherein the activity areas in the group overlap with at least one other activity area in the group, obtaining the area to be identified according to the positional relationship of the activity areas in the group, determining the interval according to the distance of the sperm in the area to be identified, extracting the frame image to be identified from the segment according to the interval, determining the area corresponding to each group in the frame image to be identified, identifying the position of the sperm in the area corresponding to each group, fitting the motion curve of the sperm using the least square method according to the position, and obtaining the motion trajectory of the sperm;

[0012] S14, determining the motion value of a single sperm according to the position, motion trajectory and length of the sperm, and taking the average of the motion values ​​of all sperm in the sample as the sample motion value.

[0013] Preferably, the step of dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm is as follows:

[0014] The radius is determined according to the length and the maximum swimming speed of the sperm, and two centers are obtained according to the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined according to the length and the maximum swimming speed of the sperm; a rectangular area is obtained, and the rectangular area is a rectangle with the smallest area and contains the two circles. The rectangular area is used as the activity area of ​​the sperm.

[0015] Preferably, the two centers of the circle are obtained according to the target frame for identifying sperm, specifically:

[0016] Obtain the target frame for identifying sperm, obtain the two widths of the target frame, and use the center of the line segment where each width is located as the center of a circle.

[0017] Preferably, the grayscale change of the same active area in two adjacent frames of images in the segment is calculated, and a key frame is determined according to the grayscale change and the size of the active area, specifically:

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

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

[0020] Preferably, the obtaining of the area to be identified according to the positional relationship of the activity areas in the group is specifically:

[0021] A rectangular frame is determined, which includes all active areas in the group and has the smallest area; and the rectangular frame is used as the area to be identified.

[0022] Preferably, the step of determining the interval according to the distance between sperm in the area to be identified and extracting the frame image to be identified from the segment according to the interval is specifically as follows:

[0023] Calculating the average distance of sperm in the area to be identified, determining the interval according to a preset comparison relationship table of average distance and interval, and extracting 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 of sperm in the area to be identified, and calculate the ratio of the shortest distance to the standard distance, take the integer part of the product of the ratio and the standard interval as the 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.

[0026] Preferably, the motion value of a single sperm is determined according to the position, motion trajectory and length of the sperm, specifically:

[0027] Determine the moving distance according to the movement trajectory of the sperm, and calculate the ratio of the moving distance to the length to obtain a first parameter;

[0028] A straight line is obtained by fitting according to the position of the sperm, an r-square coefficient is calculated according to the straight line and the position, and the r-square coefficient is used as the second parameter;

[0029] The first parameter is normalized to between 0 and 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 is as follows:

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

[0032] In addition, the present invention also provides a sperm motility assessment device, which includes the following modules:

[0033] A motion value calculation module is used to obtain a dynamic video of a captured semen sample, select multiple video frames as key frames in the dynamic video, identify the position of sperm in each key frame, and calculate the motion value of the sperm to obtain a sample motion value;

[0034] The morphological value calculation module is used for extracting the sperm image in each key frame for the same sperm, performing convolution and pooling operations on the sperm image to obtain multiple sperm images of the same size, and the multiple sperm images of the same size constitute a sperm image sequence, and inputting the sperm image sequence into the neural network model to obtain the sperm morphological score; the average value of the morphological scores of all sperm in the sample is taken as the morphological value;

[0035] The vitality evaluation module is used to use the sample motion value, the morphology value and other characteristic values ​​of sperm as inputs of a deep neural network to obtain a sperm vitality value.

[0036] Preferably, the method selects a plurality of video frames as key frames in the dynamic video, identifies the position of sperm in each key frame, and calculates the motion value of sperm to obtain the sample motion value, specifically:

[0037] Step 11, selecting a segment from the dynamic video, determining the length of the segment, and identifying sperm in the image at the middle moment of the segment, dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm, and determining whether the activity area of ​​the sperm overlaps with other sperms, if not, executing S12, otherwise, executing S13;

[0038] Step 12, calculating the grayscale change of the same active area in two adjacent frames of images in the segment, determining a key frame according to the grayscale change and the size of the active area, identifying the position of the sperm in the key frame, and fitting the motion curve of the sperm using the least squares method according to the position to obtain the motion trajectory of the sperm;

[0039] Step 13, dividing the overlapping activity areas into at least one group, wherein the activity areas in the group overlap with at least one other activity area in the group, obtaining the area to be identified according to the positional relationship of the activity areas in the group, determining the interval according to the distance of the sperm in the area to be identified, extracting the frame image to be identified from the segment according to the interval, determining the area corresponding to each group in the frame image to be identified, identifying the position of the sperm in the area corresponding to each group, fitting the motion curve of the sperm using the least square method according to the position, and obtaining the motion trajectory of the sperm;

[0040] S14, determining the motion value of a single sperm according to the position, motion trajectory and length of the sperm, and taking the average of the motion values ​​of all sperm in the sample as the sample motion value.

[0041] Preferably, the step of dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm is as follows:

[0042] The radius is determined according to the length and the maximum swimming speed of the sperm, and two centers are obtained according to the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined according to the length and the maximum swimming speed of the sperm; a rectangular area is obtained, and the rectangular area is a rectangle with the smallest area and contains the two circles. The rectangular area is used as the activity area of ​​the sperm.

[0043] Preferably, the two centers of the circle are obtained according to the target frame for identifying sperm, specifically:

[0044] Obtain the target frame for identifying sperm, obtain the two widths of the target frame, and use the center of the line segment where each width is located as the center of a circle.

[0045] Preferably, the grayscale change of the same active area in two adjacent frames of images in the segment is calculated, and a key frame is determined according to the grayscale change and the size of the active area, specifically:

[0046] According to the formula Calculate the grayscale change of the same active area in two adjacent frames of images, where N represents the number of pixels in the same area and N is a positive integer. Represents the gray value of the jth pixel in the i-th frame, represents the gray value of the jth pixel in the i+1th frame, S i Indicates the grayscale change of the same active area in the i+1th frame relative to the ith frame;

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

[0048] Preferably, the obtaining of the area to be identified according to the positional relationship of the activity areas in the group is specifically:

[0049] A rectangular frame is determined, which includes all active areas in the group and has the smallest area; and the rectangular frame is used as the area to be identified.

[0050] Preferably, the step of determining the interval according to the distance between sperm in the area to be identified and extracting the frame image to be identified from the segment according to the interval is specifically as follows:

[0051] Calculating the average distance of sperm in the area to be identified, determining the interval according to a preset comparison relationship table of average distance and interval, and extracting 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 of sperm in the area to be identified, and calculate the ratio of the shortest distance to the standard distance, take the integer part of the product of the ratio and the standard interval as the 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.

[0054] Preferably, the motion value of a single sperm is determined according to the position, motion trajectory and length of the sperm, specifically:

[0055] Determine the moving distance according to the movement trajectory of the sperm, and calculate the ratio of the moving distance to the length to obtain a first parameter;

[0056] A straight line is obtained by fitting according to the position of the sperm, an r-square coefficient is calculated according to the straight line and the position, and the r-square coefficient is used as the second parameter;

[0057] The first parameter is normalized to between 0 and 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 is as follows:

[0059] The features of each sperm image are extracted to obtain a sequence, wherein one sperm image corresponds to one sequence, and the sequence is used as an input of 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 having a computer program stored thereon, wherein the computer program implements the method described above when executed by a processor.

[0061] In view of the problem that in the prior art, sperm motility relies on the experience of medical staff, resulting in great subjectivity and difficulty in quantifying the movement and morphology of sperm, the present invention obtains a sample movement value by calculating the movement value of sperm, and obtains a sperm morphology score by using a neural network, and uses the sample movement value, the morphology value and other characteristic values ​​of sperm as inputs of a deep neural network to obtain a sperm motility value; in addition, the present invention also considers the relationship between the sperm movement trajectory and the straight line when calculating the movement value of sperm. The present invention achieves the effect of quantifying sperm movement and comprehensively calculating sperm motility in combination with other information, thereby reducing the influence of the subjectivity of medical staff on the results in sperm motility assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0063] Figure 1 Flow chart of Embodiment 1

[0064] Figure 2 It is a flowchart of a specific embodiment in Embodiment 1;

[0065] Figure 3 It is a schematic diagram of the center and radius of the sperm activity area;

[0066] Figure 4 Schematic diagram of the sperm activity area. DETAILED DESCRIPTION

[0067] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0068] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0069] Embodiment 1

[0070] The present invention provides a method for evaluating sperm motility. Figure 1 As shown, the method comprises the following steps:

[0071] Step 1, obtaining a dynamic video of a semen sample, selecting multiple video frames in the dynamic video as key frames, identifying the position of sperm in each key frame, and calculating the movement value of the sperm to obtain a sample movement value;

[0072] In the evaluation of sperm motility in semen, it is necessary to obtain a dynamic video of the semen sample. The dynamic video can be shot by a camera on a microscope, and the movement and morphology of the sperm can be observed through the dynamic video. Since the frame rate of the video is relatively high, that is, one second of video contains multiple frames of video images, if each frame is processed, the amount of calculation is large, and the movement speed of the sperm is relatively slow, and the change of the sperm in two adjacent frames is not large. Based on this, the present invention first selects multiple video frames from the dynamic video as key frames. In a specific embodiment, the key frame is determined by selecting a video frame at intervals of a certain number of frames. The above method is too fixed, and different sperms are active in different situations. In another embodiment, a segment in the video is first selected, and then the key frame is determined according to the activity area of ​​the sperm. This embodiment will be described in detail below.

[0073] It should be noted that there are two ways to determine the key frames. The first one is to determine the key frames by using a certain number of frames interval, that is, a certain number of video frames are interval between two key frames. In this way, for different sperms in step 1 and step 2, the position of the sperm is determined and the sperm image is extracted in the same key frame. In addition, there is another way, the key frames of different sperms are different. In this way, for different sperms in step 1 and step 2, the position of the sperm is determined and the sperm image is extracted in the key frame corresponding to the sperm.

[0074] Step 2: for the same sperm, there is one sperm image in each key frame. The sperm image in each key frame is extracted, and convolution and pooling operations are performed on the sperm image to obtain multiple sperm images of the same size. The multiple sperm images of the same size constitute an image sequence of the sperm. The sperm image sequence is input into the neural network model to obtain the sperm morphology score; the average value of the morphology scores of all sperm in the sample is taken as the morphology value;

[0075] The morphological information of sperm is mainly judged based on the appearance of sperm. The swimming posture of sperm is different at different times. The sperm image is extracted from the key frame. Since there are multiple key frames, there are multiple sperm images for one sperm. The multiple sperm images are input into the trained neural network model to obtain the sperm score. Among them, the neural network model preferably uses a convolutional neural network model, and a ViT network model can also be used. Preferably, the ViT network model is used to extract features from the sperm image in each key frame to obtain a sequence, which is then input into the ViT network model.

[0076] Step 3: Using the sample motion value, the morphology value and other characteristic values ​​of sperm as inputs of a deep neural network to obtain a sperm motility value.

[0077] The motion value, morphology value and other characteristic values ​​of sperm are input into the deep neural network to obtain the vitality value of sperm or semen. The other characteristic values ​​of sperm are one or more of pH value, density and semen volume. Of course, other characteristic values ​​can also be other characteristic values ​​besides pH value, density and semen volume. In an alternative solution, the deep neural network is replaced by MLP.

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

[0079] Step 11, selecting a segment from the dynamic video, determining the length of the segment, and identifying sperm in the image at the middle moment of the segment, dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm, and determining whether the activity area of ​​the sperm overlaps with other sperms, if not, executing S12, otherwise, executing S13;

[0080] After making the sperm sample, the camera of the computer connected to the microscope can shoot the sperm, and the shooting time can be determined by the user. After shooting, the user can select one or more clear sperm videos, in which not only the morphology of the sperm can be observed, but also the movement of the sperm. According to the standards of the World Health Organization, nearly 60% of the sperm with normal vitality should be in motion, and the sperm in good condition should move forward in a straight line.

[0081] Each segment includes several frames of sperm images. The video consists of multiple images. If the frame rate is 50fps, it includes 50 images per second. Assuming that a segment is 3s, there will be 150 images. After obtaining the segmented segments, the intermediate moment images are selected as the basis, and then according to the length and the maximum swimming speed of the sperm, the swimming area or active area of ​​a sperm in the segment can be determined. The length mentioned here can be either the time length or the frame length.

[0082] After obtaining the activity area of ​​each sperm, determine whether the activity area of ​​a sperm overlaps with the activity areas of other sperm. If not, it is only necessary to extract the area of ​​each image frame of the sperm in the segment, and then analyze the activity area of ​​the sperm; if there is overlap, it is necessary to eliminate the impact of the overlap on the sperm trajectory analysis.

[0083] In the present invention, each sperm corresponds to an activity area, and in each frame of the segmented image, the activity area is unchanged. After the activity area of ​​the sperm is determined, the same area can be directly intercepted from other frames. This avoids repeated area identification for each frame. For example, if the activity area of ​​a sperm is (0,0), (0,5), (5,0), (5,5), the same area of ​​other frames can be directly intercepted.

[0084] Step 12, calculating the grayscale change of the same active area in two adjacent frames of images in the segment, determining a key frame according to the grayscale change and the size of the active area, identifying the position of the sperm in the key frame, and fitting the motion curve of the sperm according to the position using the least square method to obtain the motion trajectory of the sperm; wherein the key frames of different sperm are different;

[0085] If the operation of identifying the position of sperm is performed on each frame, the amount of calculation is relatively large. Taking 3s and 50fps as an example, 150 pictures need to be processed. This is just for one sperm. If there are 150 sperm, the amount of data is larger. Based on this, for sperm without overlapping active areas, the key frames in the segment are determined according to the grayscale change and the size of the active area. The grayscale change refers to the grayscale change of the active area. The active areas of different sperm are different, and the corresponding grayscale changes are also different. The key frames of each sperm are also different. For example, according to the grayscale change and the size of the active area, the key frames of sperm 1 are determined to be 1, 51, 101, and the key frames of sperm 2 are determined to be 1, 41, 81, 121. Then, the position of the sperm in the key frame is determined according to the active area. After identifying the trajectory of the sperm's active area in all key frames of the sperm, the least squares method can be used to fit the sperm's motion curve to obtain the sperm's motion trajectory. In an alternative embodiment, the sperm's motion curve is fitted using polynomial fitting or gradient descent method.

[0086] Still taking sperm 1 and sperm 2 as an example, in key frames 1, 51, and 101 of sperm 1, the positions of the sperm are (2.5, 2.5), (2.5, 3), and (2.5, 4), and the motion trajectory of sperm 1 is fitted. Similarly, the motion trajectory of sperm 2 can be fitted according to the position of sperm 2 in its corresponding key frames.

[0087] There are many ways to identify the position of sperm, including but not limited to YOLOv4, YOLOv5 or R-CNN, and traditional image analysis methods can also be used, which is not specifically limited in the present invention. Sperm has a certain length. In the present invention, unless otherwise specified, the position of the sperm head is used as the position of the sperm in the sperm position identification and motion trajectory fitting.

[0088] Step 13, dividing the overlapping activity areas into at least one group, wherein the activity areas in the group overlap with at least one other activity area in the group, obtaining the area to be identified according to the positional relationship of the activity areas in the group, determining the interval according to the distance of the sperm in the area to be identified, extracting the frame image to be identified from the segment according to the interval, determining the area corresponding to each group in the frame image to be identified, identifying the position of the sperm in the area corresponding to each group, fitting the motion curve of the sperm using the least square method according to the position, and obtaining the motion trajectory of the sperm;

[0089] If the activity areas of different sperms overlap, the position that needs to be identified is more precise, so as to prevent other sperms from influencing each other in the overlapping area. The present invention regards the sperms in a group as a collective. Specifically, the area to be identified is obtained according to the activity area of ​​each sperm in the group, and then the interval is determined according to the distance between the sperms in the area to be identified. In a specific embodiment, if the distance between the sperms in the area to be identified is relatively close, that is, the sperms are relatively dense, then the interval is small, otherwise the interval can be appropriately enlarged, and then the frame image to be identified is extracted from the segment according to the interval.

[0090] One group corresponds to one area to be identified, and one area to be identified corresponds to one interval. For example, sperms 3, 4, and 5 are located in group 1. The area to be identified can be obtained based on the activity areas of sperms 3, 4, and 5. Similarly, the position of the area to be identified in all frames in the segment is the same. The overlap between the 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, sperms 3, 4, and 5 are located in group 1, and the activity area of ​​sperm 3 overlaps with the activity area of ​​at least one of sperms 4 and 5.

[0091] Then the positions of all sperms in the group are identified, and the trajectory of each sperm is fitted according to the position of each sperm to obtain the motion trajectory of each sperm in the group. In an alternative embodiment, the motion curve of the sperm is fitted using polynomial fitting or gradient descent method.

[0092] In step S3, there are multiple sperms in a to-be-identified area, and the locations of the multiple sperms are identified by instance segmentation, or by Mask R-CNN, YOLACT++, or SOLOv2, etc., which is not specifically limited in the present invention.

[0093] S14, determining the motion value of a single sperm according to the position, motion trajectory and length of the sperm, and taking the average of the motion values ​​of all sperm in the sample as the sample motion value.

[0094] The sperm's swimming speed can be obtained from the sperm's movement trajectory. In addition, the sperm's movement trajectory also reflects the sperm's movement direction. Sperm with good quality mostly move in one direction. The sperm's movement direction can be determined by the sperm's position. If the sperm's movement trajectory is close to a straight line, the sperm quality is higher.

[0095] The maximum activity area of ​​sperm in a segment is related to the swimming speed of sperm and the segment duration. At the same time, sperm also has a certain length. In a specific embodiment, an activity area is divided for each sperm according to the length and the maximum swimming speed of sperm, specifically:

[0096] The radius is determined according to the length and the maximum swimming speed of the sperm, and two centers are obtained according to the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined according to the length and the maximum swimming speed of the sperm; a rectangular area is obtained, and the rectangular area is a rectangle with the smallest area and 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 by the maximum swimming speed. If the time is the number of frames, the time is calculated according to the number of frames, and then the radius can be obtained by multiplying the calculated time by the maximum swimming speed. The maximum swimming speed of the sperm is set in advance. According to the standards of the World Health Organization, the normal speed of sperm is 25 microns / second.

[0098] The center of the circle can be determined by identifying sperm. In a simple embodiment, two centers of the circle are obtained based on the target frame for identifying sperm, specifically:

[0099] Obtain the target frame for identifying sperm, obtain the two widths of the target frame, and use the center of the line segment where each width is located as the center of a circle. Figure 3 Shows the two centers and radii of a sperm, Figure 4 The sperm motility zone is shown.

[0100] When sperm moves in the activity area, it will cause the grayscale of the activity area to change. The activity of sperm can be obtained according to the grayscale change. In a specific embodiment, the grayscale change of the same activity area in two adjacent frames of images in each segment is calculated, and the key frame is determined according to the grayscale change and the size of the activity area, specifically:

[0101] According to the formula Calculate the grayscale change of the same active area in two adjacent frames of images, where N represents the number of pixels in the same area and N is a positive integer. Represents the gray value of the jth pixel in the i-th frame, represents the gray value of the jth pixel in the i+1th frame, Si Indicates the grayscale change of the same active area in the i+1th frame relative to the ith frame;

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

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

[0104] For a sperm, its active area has N pixels, that is, there are N pixels in the active area in each frame in the segment. Then, the change of the same pixel in two adjacent frames is calculated, and the change of the pixel value of N pixels is accumulated to get the grayscale change of the active area.

[0105] After calculating the grayscale change of the same active area in two adjacent frames, the changes of the same active area in multiple adjacent frames are accumulated to obtain the cumulative result. If the accumulated result is greater than the threshold, it means that the sperm has moved to a certain extent, and then the sperm can be identified. The above method can effectively reduce the amount of data for image recognition and improve the recognition speed.

[0106] Figure 3 A schematic diagram of the area to be identified, i.e., the activity area of ​​a sperm, is shown. When there are multiple sperms, the identification process is similar. Specifically, a rectangular frame is determined, which includes all the activity areas in the group and has the smallest area; the rectangular frame is used as the area to be identified.

[0107] The denser the sperm, the more images need to be identified, so that the movement trajectory of the sperm in the dense state can be better obtained. In one embodiment, the interval is determined according to the distance of the sperm in the area to be identified, and the frame image to be identified is extracted from the segment according to the interval, specifically:

[0108] Calculating the average distance of sperm in the area to be identified, determining the interval according to a preset comparison relationship table of average distance and interval, and extracting 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 of sperm in the area to be identified, and calculate the ratio of the shortest distance to the standard distance, take the integer part of the product of the ratio and the standard interval as the 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.

[0111] The motility of sperm is not only related to the moving speed, but also to whether it is close to a straight line. In a specific embodiment, the motility of sperm is determined according to the position, movement trajectory and length of the sperm, specifically:

[0112] Determine the moving distance according to the movement trajectory of the sperm, and calculate the ratio of the moving distance to the length to obtain a first parameter;

[0113] A straight line is obtained by fitting according to the position of the sperm, an r-square coefficient is calculated according to the straight line and the position, and the r-square coefficient is used as the second parameter;

[0114] The first parameter is normalized to between 0 and 1, and the sperm motility is calculated according to the formula w1.a1+w2.a2, wherein 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 speed of sperm movement, and the second parameter represents the degree of proximity of sperm movement to the straight line. The R-square coefficient is also called the coefficient of determination. When the positions of sperm all fall on the straight line, the r-square coefficient is 1. If there is no relationship with the straight line, the r-square coefficient is 0.

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

[0117] For a sperm, when there are multiple segments, the average of the motility of the sperm in all segments is used as the final sperm motility. If the motility of a semen sample needs to be obtained based on the motility of multiple sperm, the average of the motility of all sperm in the segment is used as the motility value of the final semen sample.

[0118] Preferably, the step of inputting the sperm image sequence into the neural network model is as follows:

[0119] The features of each sperm image are extracted to obtain a sequence, wherein one sperm image corresponds to one sequence, and the sequence is used as the input of the neural network model, and the number of input parameters of the neural network model is the same as the number of sequences. For example, if there are 5 key frames, each sperm has 5 sperm images, and these 5 sperm images constitute the sperm image sequence. Each image is subjected to feature extraction to obtain a sequence, and the 5 sequences are input into the neural network model.

[0120] In an alternative embodiment, the features of each sperm image are extracted, one sperm image corresponds to one image feature, and the image features of multiple images corresponding to the sperm are used as inputs of the neural network. For example, if there are 5 key frames, each sperm has 5 sperm images, and these 5 sperm images constitute a sperm image sequence. Each image is subjected to feature extraction to obtain a feature map, and the 5 feature maps are input into the neural network model.

[0121] Embodiment 2

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

[0123] A motion value calculation module is used to obtain a dynamic video of a captured semen sample, select multiple video frames as key frames in the dynamic video, identify the position of sperm in each key frame, and calculate the motion value of the sperm to obtain a sample motion value;

[0124] The morphological value calculation module is used for extracting the sperm image in each key frame for the same sperm, performing convolution and pooling operations on the sperm image to obtain multiple sperm images of the same size, and the multiple sperm images of the same size constitute a sperm image sequence, and inputting the sperm image sequence into the neural network model to obtain the sperm morphological score; the average value of the morphological scores of all sperm in the sample is taken as the morphological value;

[0125] The vitality evaluation module is used to use the movement value, the morphology value and other characteristic values ​​of sperm as inputs of a deep neural network to obtain a sperm vitality value.

[0126] Preferably, the method selects a plurality of video frames as key frames in the dynamic video, identifies the position of sperm in each key frame, and calculates the motion value of sperm to obtain the sample motion value, specifically:

[0127] Step 11, selecting a segment from the dynamic video, determining the length of the segment, and identifying sperm in the image at the middle moment of the segment, dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm, and determining whether the activity area of ​​the sperm overlaps with other sperms, if not, executing S12, otherwise, executing S13;

[0128] Step 12, calculating the grayscale change of the same active area in two adjacent frames of images in the segment, determining a key frame according to the grayscale change and the size of the active area, identifying the position of the sperm in the key frame, and fitting the motion curve of the sperm according to the position using the least square method to obtain the motion trajectory of the sperm; wherein the key frames of different sperm are different;

[0129] Step 13, dividing the overlapping activity areas into at least one group, wherein the activity areas in the group overlap with at least one other activity area in the group, obtaining the area to be identified according to the positional relationship of the activity areas in the group, determining the interval according to the distance of the sperm in the area to be identified, extracting the frame image to be identified from the segment according to the interval, determining the area corresponding to each group in the frame image to be identified, identifying the position of the sperm in the area corresponding to each group, fitting the motion curve of the sperm using the least square method according to the position, and obtaining the motion trajectory of the sperm;

[0130] S14, determining the motion value of a single sperm according to the position, motion trajectory and length of the sperm, and taking the average of the motion values ​​of all sperm in the sample as the sample motion value.

[0131] Preferably, the step of dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm is as follows:

[0132] The radius is determined according to the length and the maximum swimming speed of the sperm, and two centers are obtained according to the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined according to the length and the maximum swimming speed of the sperm; a rectangular area is obtained, and the rectangular area is a rectangle with the smallest area and contains the two circles. The rectangular area is used as the activity area of ​​the sperm.

[0133] Preferably, the two centers of the circle are obtained according to the target frame for identifying sperm, specifically:

[0134] Obtain the target frame for identifying sperm, obtain the two widths of the target frame, and use the center of the line segment where each width is located as the center of a circle.

[0135] Preferably, the grayscale change of the same active area in two adjacent frames of images in the segment is calculated, and a key frame is determined according to the grayscale change and the size of the active area, specifically:

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

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

[0138] Preferably, the obtaining of the area to be identified according to the positional relationship of the activity areas in the group is specifically:

[0139] A rectangular frame is determined, which includes all active areas in the group and has the smallest area; and the rectangular frame is used as the area to be identified.

[0140] Preferably, the step of determining the interval according to the distance between sperm in the area to be identified and extracting the frame image to be identified from the segment according to the interval is specifically as follows:

[0141] Calculating the average distance of sperm in the area to be identified, determining the interval according to a preset comparison relationship table of average distance and interval, and extracting 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 of sperm in the area to be identified, and calculate the ratio of the shortest distance to the standard distance, take the integer part of the product of the ratio and the standard interval as the 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.

[0144] Preferably, the motion value of a single sperm is determined according to the position, motion trajectory and length of the sperm, specifically:

[0145] Determine the moving distance according to the movement trajectory of the sperm, and calculate the ratio of the moving distance to the length to obtain a first parameter;

[0146] A straight line is obtained by fitting according to the position of the sperm, an r-square coefficient is calculated according to the straight line and the position, and the r-square coefficient is used as the second parameter;

[0147] The first parameter is normalized to between 0 and 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 sperm image features are extracted and input into the neural network model, specifically:

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

[0150] Embodiment 3

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

[0152] Embodiment 4

[0153] The present invention further provides a computer device, which includes a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, the method described in the first embodiment is implemented.

[0154] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in 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 codes.

[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions 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 a neural network, characterized in that: The method comprises the following steps: Step 1, obtaining a dynamic video of a semen sample, selecting multiple video frames in the dynamic video as key frames, identifying the position of sperm in each key frame, and calculating the movement value of the sperm to obtain a sample movement value; Step 2: for the same sperm, there is one sperm image in each key frame. The sperm image in each key frame is extracted, and convolution and pooling operations are performed on the sperm image to obtain multiple sperm images of the same size. The multiple sperm images of the same size constitute an image sequence of the sperm. The sperm image sequence is input into the neural network model to obtain the sperm morphology score; the average value of the morphology scores of all sperm in the sample is taken as the morphology value; Step 3, using the sample motion value, the morphology value and other characteristic values ​​of sperm as inputs of a deep neural network to obtain a sperm motility value; The method of 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 the sample motion value is as follows: Step 11, selecting a segment from the dynamic video, determining the length of the segment, and identifying sperm in the image at the middle moment of the segment, dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm, and determining whether the activity area of ​​the sperm overlaps with other sperms, if not, executing S12, otherwise, executing S13; Step 12, calculating the grayscale change of the same active area in two adjacent frames of images in the segment, determining a key frame according to the grayscale change and the size of the active area, identifying the position of the sperm in the key frame, and fitting the motion curve of the sperm according to the position using the least square method to obtain the motion trajectory of the sperm; wherein the key frames of different sperm are different; Step 13, dividing the overlapping activity areas into at least one group, wherein the activity areas in the group overlap with at least one other activity area in the group, obtaining the area to be identified according to the positional relationship of the activity areas in the group, determining the interval according to the distance of the sperm in the area to be identified, extracting the frame image to be identified from the segment according to the interval, determining the area corresponding to each group in the frame image to be identified, identifying the position of the sperm in the area corresponding to each group, fitting the motion curve of the sperm using the least square method according to the position, and obtaining the motion trajectory of the sperm; S14, determining the motion value of a single sperm according to the position, motion trajectory and length of the sperm, and taking the average of the motion values ​​of all sperm in the sample as the sample motion value.

2. The method according to claim 1, characterized in that The step of dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm is specifically as follows: The radius is determined according to the length and the maximum swimming speed of the sperm, and two centers are obtained according to the target frame for identifying the sperm, and then two circles are determined. The radii of the two circles are determined according to the length and the maximum swimming speed of the sperm; a rectangular area is obtained, and the rectangular area is a rectangle with the smallest area and contains the two circles. The rectangular area is used as the activity area of ​​the sperm.

3. The method according to claim 2, characterized in that The two centers of the circles are obtained according to the target frame for identifying sperm, specifically: Obtain the target frame for identifying sperm, obtain the two widths of the target frame, and use the center of the line segment where each width is located as the center of a circle.

4. The method according to claim 1, characterized in that The grayscale change of the same active area in two adjacent frames of images in the calculation segment and the key frame are determined according to the grayscale change and the size of the active area, specifically: According to the formula Calculate the grayscale change of the same active area in two adjacent frames of images, where N represents the number of pixels in the same area and N is a positive integer. Represents the gray value of the jth pixel in the i-th frame, represents the gray value of the jth pixel in the i+1th frame, S i Indicates the grayscale change of the same active area in the i+1th frame relative to the ith frame; The first frame of the segment is taken as the first key frame, and the next key frame and the previous key frame satisfy that the cumulative grayscale change of the same active area in the adjacent frames between the two is greater than a threshold, and the threshold is proportional to the size of the active area; and the last frame of the segment is taken as the last key frame.

5. The method according to claim 1, characterized in that The area to be identified is obtained according to the positional relationship of the activity areas in the group, specifically: A rectangular frame is determined, the rectangular frame includes all active areas in the group and has the smallest area; the rectangular frame is used as the area to be identified; the rectangular frame is used as the area to be identified.

6. The method according to claim 1, characterized in that The step of determining the interval according to the distance of sperm in the to-be-identified area and extracting the to-be-identified frame image from the segment according to the interval is specifically as follows: Calculating the average distance of sperm in the area to be identified, determining the interval according to a preset comparison relationship table of average distance and interval, and extracting 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 of sperm in the area to be identified, and calculate the ratio of the shortest distance to the standard distance, take the integer part of the product of the ratio and the standard interval as the 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.

7. The method according to claim 1, characterized in that The motion value of a single sperm is determined according to the position, motion trajectory and length of the sperm, specifically: Determine the moving distance according to the movement trajectory of the sperm, and calculate the ratio of the moving distance to the length to obtain a first parameter; A straight line is obtained by fitting according to the position of the sperm, an r-square coefficient is calculated according to the straight line and the position, and the r-square coefficient is used as a second parameter; The first parameter is normalized to between 0 and 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 according to claim 1, characterized in that The sperm image sequence is input into the neural network model, specifically: The features of each sperm image are extracted to obtain a sequence, wherein one sperm image corresponds to one sequence, and the sequence is used as an input of 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 device for determining sperm motility based on a neural network, characterized in that: The device comprises the following modules: A motion value calculation module is used to obtain a dynamic video of a captured semen sample, select multiple video frames as key frames in the dynamic video, identify the position of sperm in each key frame, and calculate the motion value of the sperm to obtain a sample motion value; The morphological value calculation module is used for extracting the sperm image in each key frame for the same sperm, performing convolution and pooling operations on the sperm image to obtain multiple sperm images of the same size, and the multiple sperm images of the same size constitute a sperm image sequence, and inputting the sperm image sequence into the neural network model to obtain the sperm morphological score; the average value of the morphological scores of all sperm in the sample is taken as the morphological value; A vitality evaluation module, used for taking the sample motion value, the morphology value and other characteristic values ​​of sperm as inputs of a deep neural network to obtain a sperm vitality value; The method of 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 the sample motion value is as follows: Step 11, selecting a segment from the dynamic video, determining the length of the segment, and identifying sperm in the image at the middle moment of the segment, dividing an activity area for each sperm according to the length and the maximum swimming speed of the sperm, and determining whether the activity area of ​​the sperm overlaps with other sperms, if not, executing S12, otherwise, executing S13; Step 12, calculating the grayscale change of the same active area in two adjacent frames of images in the segment, determining a key frame according to the grayscale change and the size of the active area, identifying the position of the sperm in the key frame, and fitting the motion curve of the sperm according to the position using the least square method to obtain the motion trajectory of the sperm; wherein the key frames of different sperm are different; Step 13, dividing the overlapping activity areas into at least one group, wherein the activity areas in the group overlap with at least one other activity area in the group, obtaining the area to be identified according to the positional relationship of the activity areas in the group, determining the interval according to the distance of the sperm in the area to be identified, extracting the frame image to be identified from the segment according to the interval, determining the area corresponding to each group in the frame image to be identified, identifying the position of the sperm in the area corresponding to each group, fitting the motion curve of the sperm using the least square method according to the position, and obtaining the motion trajectory of the sperm; S14, determining the motion value of a single sperm according to the position, motion trajectory and length of the sperm, and taking the average of the motion values ​​of all sperm in the sample as the sample motion value.