Sperm agglutination detection method, device, medical equipment and storage medium

By obtaining the sperm head area information and using clustering processing technology, the problem of time-consuming sperm agglutination detection is solved, and fast and accurate sperm agglutination detection is achieved, thereby improving detection efficiency and accuracy.

CN115147767BActive Publication Date: 2025-09-09SUZHOU BASECARE MEDICAL DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210881705.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2025-09-09
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

The existing technology of sperm agglutination detection takes a long time and cannot accurately determine whether the patient has sperm agglutination disorder, which affects the ability to conceive and reproductive health.

Method used

By obtaining the sperm head area information and using clustering processing techniques such as the K-means algorithm and DBSCAN algorithm, the position and number of the sperm head area can be analyzed to determine the sperm aggregation status and improve the detection efficiency.

Benefits of technology

It achieves rapid and accurate detection of sperm agglutination, avoids the tedious process of traditional medical experiments, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115147767B_ABST
    Figure CN115147767B_ABST
Patent Text Reader

Abstract

The present application relates to a method, apparatus, medical device, storage medium, and computer program product for sperm agglutination detection. The method comprises: acquiring a first image frame, the first image frame comprising a plurality of sperm, each of the sperm including a head; determining, based on the first image frame, a head region corresponding to the head of each sperm, first position information of the head region of each sperm, and the number of head regions of each sperm; performing clustering processing based on the number of head regions of each sperm and the first position information of the head region of each sperm to obtain a clustering processing result; and determining a sperm agglutination result based on the clustering processing result. This method can improve the efficiency of sperm agglutination detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of medical detection technology, and in particular to a method, apparatus, medical equipment and storage medium for sperm agglutination detection. Background Art

[0002] Sperm agglutination occurs when antisperm antibodies are present in male blood or seminal plasma, or female serum or cervical mucus. During sperm agglutination tests, motile sperm are observed to aggregate in head-to-head, tail-to-tail, or mixed patterns. Antisperm antibodies can reduce conception potential by inhibiting sperm penetration through cervical mucus, preventing sperm capacitation, inhibiting the acrosome reaction, and reducing sperm survival, potentially leading to embryonic death, miscarriage, and infertility.

[0003] Currently, conventional semen testing cannot determine whether the patient has sperm agglutination disorder. Therefore, specialized medical laboratories are required to perform sperm agglutination tests on semen, which is time-consuming. Therefore, improving the efficiency of sperm agglutination testing while maintaining its accuracy is an urgent issue. Summary of the Invention

[0004] Based on this, it is necessary to provide a method, device, medical equipment and storage medium for sperm agglutination detection that can improve the efficiency of sperm agglutination detection in order to address the above technical problems.

[0005] In a first aspect, the present application provides a method for detecting sperm agglutination. The method comprises:

[0006] Acquire a first image frame, the first image frame including a plurality of sperms, each of the sperms including a head;

[0007] determining, based on the first image frame, a head region corresponding to the head of each sperm, and determining first position information of the head region of each sperm, as well as the number of the head regions of each sperm;

[0008] performing clustering processing based on the number of head regions of each sperm and first position information of the head region of each sperm to obtain a clustering processing result;

[0009] The sperm agglutination results were determined by clustering the results.

[0010] In one embodiment, the clustering processing result is a plurality of sperm cluster categories obtained after clustering the head region of each sperm;

[0011] The sperm agglutination results are determined by clustering the results, including:

[0012] adjusting the number of the head regions of each sperm in each sperm cluster category according to the first position information of the head region of each sperm in each sperm cluster category;

[0013] Sperm agglutination results were determined based on the adjusted number of head regions of each sperm within each sperm cluster category.

[0014] In one embodiment, acquiring a first image frame includes:

[0015] Acquire a video to be detected, where the video to be detected includes multiple video frames to be detected, and the video frames to be detected include multiple sperm;

[0016] Determine a first image frame from each video frame to be detected;

[0017] The sperm agglutination results are determined by clustering the results, including:

[0018] Determine sperm aggregation results based on clustering processing results;

[0019] If the sperm aggregation result is that sperm aggregation exists, determining a second image frame adjacent to the first image frame from each video frame to be detected;

[0020] Determining a movement state result of each sperm based on the first image frame and the second image frame;

[0021] The sperm agglutination results were determined based on the sperm motility results.

[0022] In one embodiment, determining the motion state of each sperm based on the first image frame and the second image frame includes:

[0023] Determining first position information of the head region of each sperm based on the first image frame, and determining second position information of the head region of each sperm based on the second image frame;

[0024] Calculating a first distance between first position information of the head region of each sperm and second position information of the head region of each sperm;

[0025] The motility status of each sperm is determined based on the first distance.

[0026] In one embodiment, clustering is performed based on the number of sperm head regions and the first position information of the sperm head regions to obtain a clustering result, including:

[0027] determining the number of cluster centers based on the number of head regions of each sperm, the cluster centers having corresponding third position information;

[0028] Calculating a second distance between the first position information of the head region of each sperm and the third position information of each cluster center;

[0029] Based on the second distance, the head area corresponding to the head of each sperm is classified into: the sperm cluster category corresponding to each cluster center; wherein the second distance between the first position information of the head area of ​​each sperm in the sperm cluster category and the third position information of the corresponding cluster center is smaller than the second distance between the first position information of the head area of ​​each sperm and the third position information of the cluster center in other sperm cluster categories.

[0030] In one embodiment, the sperm agglutination test further comprises:

[0031] Dividing the first image frame into a plurality of sub-image frames, wherein there are overlapping areas between the sub-image frames;

[0032] Clustering is performed based on the number of sperm head regions and the first position information of the sperm head regions to obtain a clustering result, including:

[0033] determining the number of the head regions of each sperm in each sub-image frame based on the number of the head regions of each sperm;

[0034] performing clustering processing based on the number of sperm head regions in each sub-image frame and first position information of the sperm head region in each sub-image frame to obtain a clustering processing result for each sub-image frame;

[0035] The sperm agglutination results are determined by clustering the results, including:

[0036] The sperm agglutination result of the first image frame is determined based on the clustering processing results of each sub-image frame.

[0037] In a second aspect, the present application further provides a sperm agglutination detection device. The device comprises:

[0038] An acquisition module, configured to acquire a first image frame, wherein the first image frame includes a plurality of sperms, each of which includes a head;

[0039] A determination module is used to determine the head area corresponding to the head of each sperm based on the first image frame, and determine the first position information of the head area of ​​each sperm, as well as the number of head areas of each sperm; and cluster the number of head areas of each sperm and the first position information of the head area of ​​each sperm to obtain a clustering processing result; and determine the sperm agglutination result through the clustering processing result.

[0040] In a third aspect, the present application further provides a medical device. The medical device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:

[0041] Acquire a first image frame, the first image frame including a plurality of sperms, each of the sperms including a head;

[0042] determining, based on the first image frame, the head region corresponding to the head of each sperm, and determining first position information of the head region of each sperm, and the number of the head regions of each sperm;

[0043] performing clustering processing based on the number of head regions of each sperm and first position information of the head region of each sperm to obtain a clustering processing result;

[0044] The sperm agglutination results were determined by clustering the results.

[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0046] Acquire a first image frame, the first image frame including a plurality of sperms, each of the sperms including a head;

[0047] determining, based on the first image frame, the head region corresponding to the head of each sperm, and determining first position information of the head region of each sperm, and the number of the head regions of each sperm;

[0048] performing clustering processing based on the number of head regions of each sperm and first position information of the head region of each sperm to obtain a clustering processing result;

[0049] The sperm agglutination results were determined by clustering the results.

[0050] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:

[0051] Acquire a first image frame, the first image frame including a plurality of sperms, each of the sperms including a head;

[0052] determining, based on the first image frame, a head region corresponding to the head of each sperm, and determining first position information of the head region of each sperm, as well as the number of the head regions of each sperm;

[0053] performing clustering processing based on the number of head regions of each sperm and first position information of the head region of each sperm to obtain a clustering processing result;

[0054] The sperm agglutination results were determined by clustering the results.

[0055] The above-mentioned method, apparatus, medical device, storage medium and computer program product for sperm agglutination detection first obtains a first image frame, the first image frame including multiple sperm, each of which includes a head. Then, based on the first image frame, the head region corresponding to the head of each sperm is determined, and the first position information of the head region of each sperm, as well as the number of the head regions of each sperm, is determined. Clustering processing is performed based on the number of the head regions of each sperm and the first position information of the head regions of each sperm to obtain a clustering processing result, thereby determining the sperm agglutination result based on the clustering processing result. By detecting and identifying the sperm head regions, the position information and number of the head regions are used to perform clustering processing based on the number of the head regions of each sperm and the first position information of the head regions of each sperm. The clustering processing result can describe the degree of discreteness between the head regions of each sperm, thereby judging the aggregation of the sperm, and thus obtaining the corresponding sperm agglutination result. Sperm agglutination detection does not require specialized medical experiments, thereby improving the efficiency of sperm agglutination detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A diagram showing an application environment of a method for detecting sperm agglutination in one embodiment;

[0057] Figure 2 Schematic diagram of a method for detecting sperm agglutination in one embodiment;

[0058] Figure 3 A schematic diagram of an embodiment of sperm in one embodiment;

[0059] Figure 4 A schematic diagram of an embodiment of the head region corresponding to the head of each sperm in one embodiment;

[0060] Figure 5 A partial flow diagram of a method for detecting sperm agglutination in one embodiment;

[0061] Figure 6 FIG1 is a schematic diagram of a process for obtaining a first image frame in one embodiment;

[0062] Figure 7 FIG1 is a schematic diagram of an embodiment of the motility state of sperm in one embodiment;

[0063] Figure 8 Schematic diagram of a process for determining the motility status of each sperm in one embodiment;

[0064] Figure 9 A schematic diagram of a clustering process in one embodiment;

[0065] Figure 10 Schematic diagram of a cluster center in one embodiment;

[0066] Figure 11 A schematic flow chart of a method for detecting sperm agglutination in another embodiment;

[0067] Figure 12 A schematic diagram of a complete process of a method for detecting sperm agglutination in one embodiment;

[0068] Figure 13 A structural block diagram of a sperm agglutination detection device in one embodiment;

[0069] Figure 14 FIG. 1 is a diagram showing the internal structure of a medical device in one embodiment. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0071] The method for detecting sperm agglutination provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store data that server 104 needs to process. The data storage system can be integrated with server 104 or placed in the cloud or on another server. Terminal 102 can be, but is not limited to, a sperm testing instrument, sperm quality analyzer, or other medical equipment. Server 104 can be implemented as a standalone server or a server cluster consisting of multiple servers.

[0072] In one embodiment, Figure 2 As shown, a method for detecting sperm agglutination is provided, which is applied to Figure 1 The terminal 102 in the example is used as an example to illustrate, including the following steps:

[0073] Step 202: Acquire a first image frame, where the first image frame includes a plurality of sperms, each of which includes a head.

[0074] The first image frame is obtained by photographing a glass slide coated with semen. Therefore, the first image frame specifically includes semen, and the semen includes multiple sperms, and the sperm includes a head, and the sperm is specifically composed of a head, a neck, and a tail. Figure 3 As shown, the first image frame 300 includes a plurality of sperms, and heads 301 to 304 are all heads of the sperms.

[0075] Specifically, the terminal may use an image acquisition device to capture a picture of a glass slide coated with semen, thereby obtaining the first image frame. Alternatively, the terminal may use the image acquisition device to capture a video of a group of glass slides coated with semen, and then determine any video frame from the video as the first image frame. In actual applications, the terminal may also obtain the first image frame from a server. Therefore, the specific method for obtaining the first image frame is not limited here.

[0076] It should be understood that the image acquisition device can be directly deployed in the terminal, or can be an independent image acquisition device connected to the terminal, which is not limited here.

[0077] Step 204 : determining the head region corresponding to the head of each sperm based on the first image frame, and determining first position information of the head region of each sperm, and the number of the head regions of each sperm.

[0078] The head region is the target detection frame corresponding to the sperm head. Therefore, the first position information is determined based on the target detection frame. This means the first position information of the head region can be the center point of the target detection frame, a corner of the target detection frame, or an edge of the target detection frame, without limitation. The number of head regions is the same as the number of target detection frames.

[0079] Specifically, the terminal performs target detection on the first image frame to determine the head region corresponding to the head of each sperm in the first image frame, thereby determining the first position information of the head region of each sperm, and determining the number of the head regions of each sperm. Figure 4 As shown, after target detection is performed on the first image frame 300, the following head regions 401 corresponding to the sperm head 301, the head region 402 corresponding to the sperm head 302, the head region 403 corresponding to the sperm head 303, and the head region 404 corresponding to the sperm head 304 can be obtained in the first image frame 300. Specifically, the first image frame 300 includes four head regions.

[0080] Furthermore, the terminal may perform target detection on the first image frame using different target detection algorithms. The target detection algorithm may be PP-YOLO, PP-YOLOv2, or PP-YOLO Tiny, etc. In this embodiment, PP-YOLOv2 is preferred for target detection on the first image frame.

[0081] Preferably, the position information of the center point of the target detection frame is used as the first position information of the head area.

[0082] Step 206 : performing clustering processing based on the number of the head regions of each sperm and the first position information of the head region of each sperm to obtain a clustering processing result.

[0083] The clustering process is used to classify the head region of each sperm, so the clustering process result is specifically the sperm cluster category corresponding to each cluster center, and a sperm cluster category includes a cluster center and the sperm head region.

[0084] Specifically, based on the number of sperm head regions, the terminal determines the number of categories for each sperm head region, i.e., the number of sperm cluster categories in the clustering processing result. The terminal then uses the Euclidean distance between the first position information of each sperm head region and the cluster center corresponding to each sperm cluster category to classify the sperm head regions using the Euclidean distance to obtain a clustering processing result, i.e., determine the number of sperm head regions included in each sperm cluster category.

[0085] Step 208: Determine the sperm agglutination result through clustering processing results.

[0086] The sperm agglutination result is the presence of sperm agglutination or the absence of sperm agglutination.

[0087] Specifically, the terminal determines the sperm aggregation result based on the specific clustering processing result, and then determines the sperm agglutination result based on the sperm aggregation result. The aforementioned clustering algorithm may include but is not limited to the K-means clustering algorithm or the density-based spatial clustering of applications with noise (DBSCAN) algorithm.

[0088] When DBSCAN density clustering is used at the terminal to determine sperm aggregation results, DBSCAN density clustering calculates the density of sperm and then clusters all points of the same density into one category, resulting in a larger number of sperm in each category and a more uniform density within the same category. However, in actual applications, there may be a significant difference between the maximum sperm density and the minimum sperm density, making it difficult to determine the specific classification criteria for sperm aggregation results. Furthermore, DBSCAN density clustering does not consider cluster centers, meaning it cannot eliminate free-floating sperm, which affects the sperm aggregation results. Therefore, in this embodiment, the K-means clustering algorithm is specifically used to determine the sperm aggregation results.

[0089] In the above-mentioned method of sperm agglutination detection, the sperm head area is detected and identified, and the position information and number of the head area are used to perform clustering processing according to the number of head areas of each sperm and the first position information of the head area of ​​each sperm. The clustering processing result can describe the degree of discreteness between the head areas of each sperm, thereby judging the aggregation situation between each sperm, and thus obtaining the corresponding sperm agglutination result. There is no need to perform sperm agglutination detection through special medical experiments, thereby improving the efficiency of sperm agglutination detection.

[0090] In one embodiment, the clustering result is a plurality of sperm cluster categories obtained after clustering the head region of each sperm. Figure 5 As shown, step 208, determining the sperm agglutination result through clustering processing results, specifically includes:

[0091] Step 502: Adjust the number of the head regions of each sperm in each sperm cluster category according to the first position information of the head region of each sperm in each sperm cluster category.

[0092] The clustering processing result is a plurality of sperm cluster categories obtained after clustering the head region of each sperm, and each sperm cluster category has a corresponding cluster center.

[0093] Specifically, the terminal calculates the distance between the first position information of the head region of each sperm in each sperm cluster and the position information of the cluster center of the corresponding sperm cluster. Specifically, the aforementioned distance is a Euclidean distance, and the aforementioned maximum distance threshold is 120 microns (μm). It should be understood that the position information described in this embodiment is all two-dimensional position information.

[0094] Based on this, the terminal specifically calculates the distance between the first position information of the head region of each sperm in each sperm cluster category and the position information of the cluster center of the sperm cluster category to which it belongs based on formula (1):

[0095]

[0096] Among them, D i is the distance between the sperm head area and the cluster center of the sperm cluster category to which it belongs, (x0, y0) is the location information of the cluster center, (x i ,y i ) is the first position information of the sperm head area.

[0097] Therefore, when the distance calculated by the terminal is greater than the maximum distance threshold, it means that the sperm is far away from the cluster center of the sperm cluster category to which it belongs. Therefore, the sperm is removed from the sperm cluster category to which it belongs. This type of step is repeated until the distance between the first position information of the head area of ​​each sperm in the sperm cluster category and the position information of the cluster center of the sperm cluster category to which it belongs is less than or equal to the maximum distance threshold, thereby completing the adjustment of the number of head areas of each sperm in each sperm cluster category.

[0098] Step 504 : Determine the sperm agglutination result based on the adjusted number of the head regions of each sperm in each sperm cluster category.

[0099] Specifically, the terminal determines the sperm aggregation result based on the number of head regions of each sperm in each sperm clustering category after adjustment. Based on this, as described in the above embodiment, the sperm aggregation result can be divided into four levels:

[0100] Level 1: Scattered, specifically, the number of sperm head regions in the sperm cluster category is less than 10, indicating that there are many freely moving sperm in the first image frame;

[0101] Level 2: Medium, specifically, the number of head regions of each sperm in the sperm cluster category is greater than or equal to 10 and less than or equal to 30, indicating that there are freely moving sperm in the first image frame;

[0102] Level 3: A large number, specifically, the number of head regions of each sperm in the sperm cluster category is greater than 31 and less than or equal to 50, indicating that there are still some freely moving sperm in the first image frame;

[0103] Level 4: All, specifically, the number of head regions of each sperm in the sperm cluster category is greater than 50, indicating that the sperm are basically stuck together in the first image frame.

[0104] Therefore, when the sperm aggregation result level is level 1, the terminal will determine that the sperm aggregation result in the first image frame is that there is no sperm aggregation. When the sperm aggregation result level is any of level 2, level 3, and level 4, the terminal will determine that the sperm aggregation result in the first image frame is that there is sperm aggregation.

[0105] For example, the sperm cluster category E1 corresponding to the cluster center C1 includes 32 sperm head regions. After the adjustment process in step 502, the head regions of 4 sperm whose distance from the cluster center C1 is greater than the maximum distance threshold are removed. Therefore, the number of head regions of each sperm in each sperm cluster category after adjustment is 28. Based on the above example, the number of head regions is 28, indicating that the level of the sperm aggregation result is level 2, which means that the sperm aggregation result can be determined as the existence of sperm aggregation.

[0106] In this embodiment, by calculating the distance between the first position information of the head area of ​​each sperm in each sperm clustering category and the position information of the cluster center of the sperm clustering category to which it belongs, the free-floating sperm in the same sperm clustering category are removed, thereby further ensuring the accuracy of the sperm aggregation results.

[0107] The above embodiments describe that the terminal can obtain the first image frame in multiple ways. The following describes in detail the method of obtaining the first image frame through video:

[0108] In one embodiment, Figure 6 As shown, obtaining the first image frame specifically includes:

[0109] Step 602: Obtain a video to be detected, where the video to be detected includes multiple video frames to be detected, and the video frames to be detected include multiple sperm.

[0110] The video to be detected is a video of a group of glass slides coated with semen shot by an image acquisition device.

[0111] Specifically, the terminal uses an image acquisition device to capture a video of a glass slide coated with semen, and identifies the video as the video to be tested. The video to be tested includes multiple consecutive video frames to be tested, each of which includes multiple sperm. As described in the previous embodiment, sperm includes a head, and specifically, sperm consists of a head, a neck, and a tail. The video to be tested can be 1 second (s), 3 seconds, or 5 seconds long.

[0112] Step 604: Determine a first image frame from each of the video frames to be detected.

[0113] Specifically, the terminal selects any one video frame from the video frames to be detected as the first image frame. Preferably, the video frames to be detected have corresponding time points, and the terminal specifically selects the video frame to be detected with the earliest time point among the video frames to be detected as the first image frame.

[0114] Furthermore, the terminal determines the head region corresponding to each sperm head based on the first image frame, and determines the first position information of each sperm head region and the number of sperm head regions, using a method similar to that described in the previous embodiment. Clustering is then performed based on the number of sperm head regions and the first position information of each sperm head region to obtain a clustering result.

[0115] Based on this, the sperm agglutination results are determined by clustering the results, including:

[0116] Step 606: Determine the sperm aggregation result based on the clustering processing result.

[0117] The sperm aggregation result is the sperm aggregation result in the first image frame, and the sperm aggregation result may be the presence of sperm aggregation or the absence of sperm aggregation.

[0118] Specifically, the terminal performs clustering based on the number of sperm head regions and the first position information of each sperm head region. After obtaining the clustering result, the terminal determines the sperm aggregation result based on the clustering result. Since the clustering result is specifically the sperm clustering category corresponding to each cluster center, the terminal determines the sperm aggregation result in the first image frame based on the number of sperm head regions included in the sperm cluster category corresponding to each cluster center. For example, the sperm aggregation result can be divided into four levels:

[0119] Level 1: scattered, indicating that there are many freely moving sperm in the first image frame;

[0120] Level 2: moderate, indicating the presence of freely moving sperm in the first image frame;

[0121] Level 3: substantial, indicating that there are still some freely moving sperm in the first image frame;

[0122] Level 4: All, indicating that the sperm in the first image frame are basically stuck together.

[0123] Therefore, when the sperm aggregation result level is level 1, the terminal will determine that the sperm aggregation result in the first image frame is that there is no sperm aggregation. When the sperm aggregation result level is any of level 2, level 3, and level 4, the terminal will determine that the sperm aggregation result in the first image frame is that there is sperm aggregation.

[0124] Step 608: If the sperm aggregation result is that sperm aggregation exists, determine a second image frame adjacent to the first image frame from each video frame to be detected.

[0125] In order to avoid the occurrence of sperm aggregation due to dead sperm or sperm aggregation due to impurities or cells sticking together, if the sperm aggregation result shows sperm aggregation, the terminal needs to further determine whether the sperm is alive, or whether the sperm is able to move.

[0126] Based on this, a second image frame adjacent to the first image frame is determined from each video frame to be detected. The second image frame can be an image frame. For example, if the first image frame is the most preceding video frame to be detected among each video frame to be detected, then the second image frame can be the next video frame to be detected adjacent to the most preceding video frame to be detected. Alternatively, if the first image frame is the third video frame to be detected among each video frame to be detected, then the second image frame can be the second video frame to be detected adjacent to the third video frame to be detected, or the fourth video frame to be detected adjacent to the third video frame to be detected.

[0127] Secondly, the second image frame may also be a plurality of image frames, as long as there is at least one image frame adjacent to the first image frame, which is not limited here.

[0128] It should be understood that if the sperm aggregation result is that sperm aggregation does not exist, the terminal can directly determine that the sperm agglutination result is that sperm agglutination does not exist.

[0129] Step 610: Determine the movement status of each sperm based on the first image frame and the second image frame.

[0130] The motility state result is that the sperm is in a motile state, or the sperm is not in a motile state. Figure 7 As shown, Figure 7 Figures (A) to (C) show the process of tracking the head region of each sperm in the first image frame and the second image frame. Figure 7 From (A) to (B), it can be seen that the head area 701 has moved, and the specific movement trajectory is the motion trajectory 702. Figure 7 As can be seen from Figures (B) to (C), the head region 701 moves again, and the specific movement trajectory is the motion trajectory 703. Therefore, it can be determined that the motion state of the sperm corresponding to the head region 701 is specifically that the sperm is in a motion state.

[0131] Specifically, the terminal determines the movement state result of each sperm based on the first position information of the head area of ​​each sperm in the first image frame and the position information of the head area of ​​each sperm in the second image frame.

[0132] Step 612: Determine the sperm agglutination result based on the sperm motility result.

[0133] Specifically, if the motility state result indicates that the sperm is in a motile state, the terminal will determine that the sperm agglutination result is present. Conversely, if the motility state result indicates that the sperm is not in a motile state, the terminal will determine that the sperm agglutination result is absent.

[0134] In this embodiment, capturing a first image frame through video ensures that a second image frame adjacent to the first image frame can be captured, thereby ensuring the feasibility of this solution. Secondly, if the sperm aggregation result is determined to be sperm aggregation, further analysis of the sperm motility state can avoid the presence of sperm aggregation caused by dead sperm or sperm aggregation caused by impurities or cell adhesion, thereby improving the accuracy of sperm agglutination detection.

[0135] The terminal needs to determine the same sperm from adjacent image frames based on the intersection over union (IOU) between the sperm head regions in adjacent image frames, and then determine the sperm's motion state based on the position information of the sperm head region in adjacent image frames. The following details how to determine the motion state result:

[0136] In one embodiment, Figure 8 As shown, step 610, based on the first image frame and the second image frame, determines the movement state of each sperm, including:

[0137] Step 802: Determine first position information of the head region of each sperm based on the first image frame, and determine second position information of the head region of each sperm based on the second image frame.

[0138] The head region is the target detection frame corresponding to the sperm head. Based on this, the first position information is specifically determined based on the target detection frame corresponding to the sperm head in the first image frame, while the second position information is specifically determined based on the target detection frame corresponding to the sperm head in the second image frame. Similar to the previous embodiment, the position information of the head region can be the position information of the center point of the target detection frame, the position information of a vertex of the target detection frame, or the position information of a side of the target detection frame, without specific limitation.

[0139] Specifically, the terminal performs target detection on the first image frame to determine the head region corresponding to the head of each sperm in the first image frame, and thereby determines the first position information of the head region of each sperm. Similarly, the terminal performs target detection on the second image frame to determine the head region corresponding to the head of each sperm in the second image frame, and thereby determines the second position information of the head region of each sperm.

[0140] It should be understood that, specifically, during the process of performing target detection on the first image frame, the terminal can also determine the head region corresponding to the head of each sperm in the first image frame, and during the process of performing target detection on the second image frame, the terminal can also determine the head region corresponding to the head of each sperm in the second image frame. Therefore, the terminal also needs to calculate the IOU between the head region corresponding to the head of each sperm in the first image frame and the head region corresponding to the head of each sperm in the second image frame, so as to identify the same sperm in the first image frame and the second image frame. That is, if the IOU between the head region of the sperm in the first image frame and the head region of the sperm in the second image frame is less than the maximum intersection-under-union threshold, it can be determined that the sperm corresponding to the head region are the same sperm.

[0141] Step 804 : Calculate a first distance between the first position information of the head region of each sperm and the second position information of the head region of each sperm.

[0142] The first distance is specifically the Euclidean distance between the first position information and the second position information, and the aforementioned position information is specifically the position information of the center point of the target detection frame.

[0143] Specifically, the terminal calculates the Euclidean distance between the position information of the center point of the target detection frame corresponding to the head of each sperm in the first image frame and the position information of the center point of the target detection frame corresponding to the head of each sperm in the second image frame. The obtained value is the first distance of each sperm.

[0144] That is, the target detection method is used to detect sperm in each frame of the sperm video, and the same sperm is tracked based on the IOU of the sperm target detection frame in adjacent frames and the distance between the center point of the sperm head target detection frame. Finally, the motion trajectory of the center point is used to determine whether the sperm is active.

[0145] Step 806: Determine the motion status of each sperm based on the first distance.

[0146] Specifically, if the first distance of each sperm is less than or equal to a minimum distance threshold, the motility state of each sperm is determined to be non-motile. If the first distance of each sperm is greater than the minimum distance threshold, the motility state of each sperm is determined to be motile. The minimum distance threshold is a value close to 0.

[0147] In this embodiment, the same sperm is determined from adjacent image frames based on the intersection-and-union ratio between the head regions of each sperm in adjacent image frames, and the motion state of the sperm is then determined based on the position information of the sperm head region in the adjacent image frames, so as to ensure the reliability and feasibility of the determined motion state results of each sperm.

[0148] Since the K-means clustering algorithm is an unsupervised clustering algorithm, its essence is to iterate through a loop, continuously recalculating cluster centers, calculating the distance between each sperm and the new cluster center, and reclassifying the sperm based on the closest distance to the new cluster center. Iteration stops when the intra-cluster distance is minimized and the inter-cluster distance is maximized. Based on this, the following describes in detail how to perform clustering based on the number of sperm head regions and the first position information of each sperm head region:

[0149] In one embodiment, Figure 9 As shown, in step 208, clustering is performed based on the first position information of the head region of each sperm and the third position information of each cluster center, including:

[0150] Step 902: Determine the number of cluster centers based on the number of head regions of each sperm, where the cluster centers have corresponding third position information.

[0151] Specifically, the terminal determines the number of cluster centers based on the number of head regions of each sperm, and each cluster center has corresponding third position information. Since the number of cluster centers is determined based on the number of head regions of each sperm, the number of cluster centers is exemplarily determined as follows:

[0152] 1. The number of sperm head regions in the first image frame is less than 10, and the number of cluster centers is 2;

[0153] 2. The number of sperm head regions in the first image frame is greater than or equal to 10 and less than or equal to 30, and the number of cluster centers is 3;

[0154] 3. The number of sperm head regions in the first image frame is greater than 30 and less than or equal to 50, and the number of cluster centers is 4;

[0155] 4. The number of sperm head regions in the first image frame is greater than 50, and the number of cluster centers is 5.

[0156] Based on this, in this embodiment, the terminal specifically determines the sperm aggregation result according to the K-means clustering algorithm. The terminal first determines multiple cluster centers from the first image frame based on the number of head regions of each sperm, and determines the third position information of each cluster center. Figure 4 For example, Figure 10 As shown, since the first image frame 300 specifically includes head region 401, head region 402, head region 403, and head region 404, that is, the first image frame 300 specifically includes four head regions. Therefore, based on the above example, when the number of sperm head regions in the first image frame is less than 10, the number of cluster centers is 2, and the terminal can determine cluster center 1001 and cluster center 1002 in the first image frame 300. The center position information of cluster center 1001 is the third position information of cluster center 1001. Similarly, the center position information of cluster center 1002 is the third position information of cluster center 1002.

[0157] Step 904 : Calculate the second distance between the first position information of the head region of each sperm and the third position information of each cluster center.

[0158] The second distance is specifically the Euclidean distance.

[0159] Specifically, the terminal calculates the Euclidean distance between the first position information of the head region of each sperm and the third position information of each cluster center, and the obtained value is the second distance of each sperm.

[0160] Step 906: Based on the second distance, classify the head area corresponding to the head of each sperm into: the sperm cluster category corresponding to each cluster center; wherein the second distance between the first position information of the head area of ​​each sperm in the sperm cluster category and the third position information of the corresponding cluster center is smaller than the second distance between the first position information of the head area of ​​each sperm and the third position information of the cluster center in other sperm cluster categories.

[0161] Among them, the sperm clustering categories correspond one to one with the cluster centers, so one sperm clustering category only includes one cluster center.

[0162] Specifically, based on the principle that each sperm is closest to the cluster center, the terminal determines which cluster center the head region corresponding to the head of each sperm is closest to based on the second distance between the first position information of the head region of each sperm and the third position information of each cluster center. The terminal then classifies the head region corresponding to each sperm head into the sperm cluster category corresponding to the cluster center with the closest distance. Therefore, the second distance between the first position information of the head region of a sperm classified into a sperm cluster category and the third position information of the cluster center corresponding to that sperm cluster category is smaller than the second distance between the first position information of the head region of that sperm and the third position information of the cluster center corresponding to another sperm cluster category.

[0163] For example, if it is determined that the first image frame includes the head region B1 of sperm A1, the head region B2 of sperm A2, the head region B3 of sperm A3, and the head region B4 of sperm A4, and the cluster centers C1 and C2 are determined, based on this, the terminal calculates:

[0164] The second distance between the first position information of the head region B1 of the sperm A1 and the cluster center C1 is 150 um, and the second distance between the first position information of the head region B1 of the sperm A1 and the cluster center C2 is 110 um.

[0165] The second distance between the first position information of the head region B2 of the sperm A2 and the cluster center C1 is 60 um, and the second distance between the first position information of the head region B2 of the sperm A2 and the cluster center C2 is 100 um.

[0166] The second distance between the first position information of the head region B3 of the sperm A3 and the cluster center C1 is 110 um, and the second distance between the first position information of the head region B3 of the sperm A3 and the cluster center C2 is 90 um.

[0167] The second distance between the first position information of the head region B4 of the sperm A4 and the cluster center C1 is 50 um, and the second distance between the first position information of the head region B4 of the sperm A4 and the cluster center C2 is 120 um.

[0168] Thus, it can be seen that the head region B1 of sperm A1 is closest to cluster center C2, the head region B2 of sperm A2 is closest to cluster center C1, the head region B3 of sperm A3 is closest to cluster center C2, and the head region B4 of sperm A4 is closest to cluster center C1. Therefore, the head region B1 of sperm A1 and the head region B3 of sperm A3 are classified into the sperm cluster category corresponding to cluster center C2. And the head region B2 of sperm A2 and the head region B4 of sperm A4 are classified into the sperm cluster category corresponding to cluster center C1. It should be understood that the above examples are only used to understand this solution and should not be understood as limiting this solution.

[0169] Furthermore, the following is a detailed implementation of how to perform clustering processing through loop iteration:

[0170] After determining each sperm cluster category, the terminal further calculates the average value of the first position information of the head region of each sperm in each sperm cluster category, and determines the position information obtained from the calculation result as the third position information of the new cluster center. Based on this, since the position information in this embodiment is all two-dimensional position information, that is, the first position information specifically consists of an x-coordinate and a y-coordinate, the terminal performs the following calculation for each sperm cluster category: calculating the average value of the x-coordinate of the head region of all sperm, and the average value of the y-coordinate of the head region of all sperm, and determining the average value of the x-coordinate of the head region of all sperm and the average value of the y-coordinate of the head region of all sperm as the third position information of the new cluster center. In other words, based on the first position information of the head region of each sperm in each sperm cluster category, a new cluster center can be determined, and the number of new cluster centers obtained is equal to the number of cluster centers.

[0171] For example, if the first position information of the head region B1 of sperm A1 is (30, 40), the first position information of the head region B2 of sperm A2 is (10, 20), the first position information of the head region B3 of sperm A3 is (40, 60), and the first position information of the head region B4 of sperm A4 is (10, 30), based on the example of step 902, the sperm cluster categories corresponding to the cluster center C1 include the head region B2 of sperm A2 and the head region B4 of sperm A4, and the sperm cluster categories corresponding to the cluster center C2 include the head region B1 of sperm A1 and the head region B3 of sperm A3.

[0172] Based on this, the third position information of the new cluster center D1 can be calculated as (10, 25) based on the first position information (10, 20) of the head region B2 in the sperm cluster category corresponding to cluster center C1, and the first position information (10, 30) of the head region B4. Similarly, the third position information of the new cluster center D2 can be calculated as (35, 50) based on the first position information (30, 40) of the head region B1 in the sperm cluster category corresponding to cluster center C2, and the first position information (40, 60) of the head region B3.

[0173] Furthermore, the terminal needs to calculate the difference between the third position information of each new cluster center and the first position information of each cluster center.

[0174] Based on this, if the difference between the third position information of each new cluster center and the first position information of each cluster center is less than the cluster distance threshold, it means that the cluster centers determined twice have basically not moved. Therefore, the distance from the head area of ​​each sperm to the re-determined new cluster center has not changed much compared to the distance of the cluster center. Therefore, there is no need for further loop iteration, and the sperm aggregation result is determined directly based on the number of head areas of each sperm in each sperm cluster category.

[0175] Conversely, if the difference between the third position information of each new cluster center and the first position information of each cluster center is greater than or equal to the cluster distance threshold, it indicates that the two determined cluster centers have changed. Therefore, the distance from the head region of each sperm to the newly determined cluster center will change compared to the distance to the cluster center. In other words, the head region of the sperm included in the sperm cluster category will change and be adjusted. Therefore, the terminal needs to re-determine the sperm cluster category corresponding to each new cluster center based on the third position information of each new cluster center.

[0176] Specifically, similar to the aforementioned embodiment, the terminal specifically calculates the Euclidean distance between the first position information of the head region of each sperm and the third position information of each new cluster center, then determines which new cluster center the head region corresponding to the head of each sperm is closest to, and classifies the head region corresponding to the head of each sperm into the sperm cluster category corresponding to the new cluster center with the closest distance. Then, the terminal again executes a similar implementation as described in the aforementioned steps. The difference between the third position information of each new cluster center and the first position information of each cluster center is calculated again. At this time, if the difference is less than the cluster distance threshold, the sperm aggregation result is determined based on the number of head regions of each sperm in the sperm cluster category corresponding to the new cluster center. Conversely, if the difference is greater than or equal to the cluster distance threshold, the loop iteration is executed again.

[0177] It should be understood that in actual applications, the terminal may stop the loop iteration when the difference is less than the cluster distance threshold, or when the number of loop iterations reaches the maximum number of iterations, the terminal determines the sperm clustering result based on the number of head regions of each sperm in the last determined sperm cluster category. The specifics are not limited here.

[0178] In this embodiment, the head region of each sperm is classified according to the first position information of the head region of each sperm and the distance between the third position information of each cluster center, and the sperm cluster category corresponding to each cluster center is obtained to ensure the reliability of the sperm cluster category. Secondly, by further judging the distance between the cluster center position information determined twice adjacently, it is ensured that the sperm cluster category finally determined can achieve the minimum intra-class distance and the maximum inter-class distance, so as to ensure the reliability of the sperm cluster category, thereby improving the reliability of the sperm aggregation result. Secondly, by cyclically iterating the cluster center to adjust the classification of the head region of each sperm in the sperm cluster category, the reliability of the sperm cluster category finally determined, that is, the reliability of the sperm aggregation result is further ensured.

[0179] In practice, sperm are generally active and dispersed when not agglutinated. The number of sperm in the first image frame of semen collected from a normal individual is generally greater than 20. This can easily lead to the aggregation of more dispersed sperm into the cluster of agglutinated sperm, thereby interfering with the determination of the cluster center and its location, affecting the sperm agglutination results. Therefore, the following describes a method for dividing the first image frame into multiple sub-image frames and analyzing each sub-image frame individually for the presence of sperm agglutination:

[0180] In one embodiment, Figure 11 As shown, the method of sperm agglutination detection also includes:

[0181] Step 1102 : Divide the first image frame into a plurality of sub-image frames, where there are overlapping areas between the sub-image frames.

[0182] The first image frame is a rectangular image frame with a size of 1536×1024, and the sub-image frame is a square image frame with a size of 512×512.

[0183] Specifically, the terminal moves a 512x512 square block from left to right five times with a step of 256, thereby obtaining five 512x512 square image areas. Similarly, it moves it from top to bottom three times with a step of 256, thereby obtaining three 512x512 square image areas. The entire process moves a total of 15 times to obtain 15 square image areas with overlapping areas, and the size of each area is 512x512. The terminal determines the obtained square image area as a sub-image frame.

[0184] It should be understood that the number of sub-image frames needs to be determined based on the size of the first image frame and the movement step.

[0185] Step 206, performing clustering processing based on the number of sperm head regions and the first position information of the sperm head regions to obtain a clustering processing result, including:

[0186] Step 1104 : Determine the number of head regions of each sperm in each sub-image frame based on the number of head regions of each sperm.

[0187] Specifically, the terminal determines the number of sperm head regions in each divided sub-image frame based on the number of sperm head regions in the first image frame. The specific number needs to be determined based on the number of sub-image frames and the division rule.

[0188] Step 1106 , performing clustering processing based on the number of sperm head regions in each sub-image frame and the first position information of the sperm head region in each sub-image frame to obtain a clustering processing result for each sub-image frame.

[0189] Among them, clustering processing is used to classify the head area of ​​each sperm in each sub-image frame, so the clustering processing result is specifically the sperm cluster category corresponding to each cluster center in each sub-image frame, and in each sub-image frame, each sperm cluster category includes a cluster center and the sperm head area.

[0190] Specifically, based on the number of sperm head regions in each sub-image frame, the terminal determines the number of sperm head regions to be classified in each sub-image frame, i.e., the number of sperm cluster categories in each sub-image frame in the clustering processing result. The terminal then uses the Euclidean distance between the first position information of each sperm head region in each sub-image frame and the cluster center corresponding to each sperm cluster category in each sub-image frame to classify the sperm head regions in each sub-image frame using the Euclidean distance to obtain a clustering processing result, i.e., determine the number of sperm head regions included in each sperm cluster category in each sub-image frame.

[0191] Step 208, determining the sperm agglutination result based on the clustering processing result, includes:

[0192] Step 1108 : Determine the sperm agglutination result of the first image frame through the clustering processing results of each sub-image frame.

[0193] The sperm agglutination result is the presence of sperm agglutination or the absence of sperm agglutination.

[0194] Specifically, the terminal determines the sperm aggregation result based on the clustering processing result, and then determines the sperm agglutination result based on the sperm aggregation result. The aforementioned clustering algorithm may include but is not limited to the K-means clustering algorithm, or DBSCAN, etc.

[0195] It is understood that, in a manner similar to the aforementioned embodiment, the terminal can classify the head regions of each sperm based on the Euclidean distance of each sub-image frame to obtain clustering results for each sub-image frame. The clustering results for each sub-image frame are then used to determine the sperm agglutination results for each sub-image frame, i.e., whether sperm agglutination exists in the sub-image frame or whether sperm agglutination does not exist in the sub-image frame. As long as sperm agglutination exists in any of the sub-image frames, the sperm agglutination result for the first image frame can be determined as present. Conversely, if sperm agglutination is absent in all sub-image frames, the sperm agglutination result for the first image frame can be determined as absent.

[0196] In this embodiment, without the need for special medical experiments to perform sperm agglutination detection, thereby improving the efficiency of sperm agglutination detection, the first image frame is divided into multiple sub-image frames by taking into account that sperm are generally active and scattered when not agglutinated, so as to avoid aggregating the scattered sperm into the sperm cluster category with agglutination, avoid interfering with the cluster center, and improve the accuracy of judging the sperm agglutination situation.

[0197] Based on the above examples, the complete process of the method for sperm agglutination detection will be described in detail below. Figure 12 As shown, a method for detecting sperm agglutination is provided, which is applied to Figure 1 Taking the terminal 102 in FIG. 1 as an example, the method includes the following steps:

[0198] Step 1201: Obtain the video to be detected.

[0199] The video to be detected is a video of a group of glass slides coated with semen shot by an image acquisition device.

[0200] Specifically, the terminal uses an image acquisition device to capture a video of a glass slide coated with semen, and identifies the video as the video to be tested. The video to be tested includes multiple consecutive video frames to be tested, each of which includes multiple sperm. As described in the previous embodiment, sperm includes a head, and specifically, sperm consists of a head, a neck, and a tail. The video to be tested can be 1 second (s), 3 seconds, or 5 seconds long.

[0201] Step 1202: Determine a first image frame from each video frame to be detected.

[0202] Specifically, the terminal selects any one video frame from the video frames to be detected as the first image frame. Preferably, the video frames to be detected have corresponding time points, and the terminal specifically selects the video frame to be detected with the earliest time point among the video frames to be detected as the first image frame.

[0203] Step 1203 : determining the head region corresponding to the head of each sperm based on the first image frame, and determining first position information of the head region of each sperm, and the number of the head regions of each sperm.

[0204] The head region is the target detection frame corresponding to the sperm head. Based on this, the first position information is specifically based on the target detection frame. The first position information of the head region can be the position information of the center point of the target detection frame, the position information of a corner of the target detection frame, or the position information of an edge of the target detection frame, without specific limitation. The number of head regions is specifically the number of target detection frames.

[0205] Specifically, the terminal performs target detection on the first image frame to determine the head area corresponding to the head of each sperm in the first image frame, thereby determining the first position information of the head area of ​​each sperm, and determining the number of the head areas of each sperm.

[0206] Furthermore, the terminal may perform target detection on the first image frame using different target detection algorithms. The target detection algorithm may be PP-YOLO, PP-YOLOv2, or PP-YOLO Tiny, etc. In this embodiment, PP-YOLOv2 is preferred for target detection on the first image frame.

[0207] Preferably, the position information of the center point of the target detection frame is used as the first position information of the head area.

[0208] Step 1204 : Divide the first image frame into a plurality of sub-image frames, where there are overlapping areas between the sub-image frames.

[0209] The first image frame is a rectangular image frame with a size of 1536×1024, and the sub-image frame is a square image frame with a size of 512×512.

[0210] Specifically, the terminal moves a 512x512 square block from left to right five times with a step of 256, thereby obtaining five 512x512 square image areas. Similarly, it moves it from top to bottom three times with a step of 256, thereby obtaining three 512x512 square image areas. The entire process moves a total of 15 times to obtain 15 square image areas with overlapping areas, and the size of each area is 512x512. The terminal determines the obtained square image area as a sub-image frame.

[0211] It should be understood that the number of sub-image frames needs to be determined based on the size of the first image frame and the movement step.

[0212] Step 1205 : Determine the number of head regions of each sperm in each sub-image frame based on the number of head regions of each sperm.

[0213] Specifically, the terminal determines the number of sperm head regions in each divided sub-image frame based on the number of sperm head regions in the first image frame. The specific number needs to be determined based on the number of sub-image frames and the division rule.

[0214] Step 1206 , performing clustering processing based on the number of sperm head regions in each sub-image frame and the first position information of the sperm head region in each sub-image frame to obtain a clustering processing result for each sub-image frame.

[0215] Among them, clustering processing is used to classify the head area of ​​each sperm in each sub-image frame, so the clustering processing result is specifically the sperm cluster category corresponding to each cluster center in each sub-image frame, and in each sub-image frame, each sperm cluster category includes a cluster center and the sperm head area.

[0216] Specifically, based on the number of sperm head regions in each sub-image frame, the terminal determines the number of sperm head regions to be classified in each sub-image frame, i.e., the number of sperm cluster categories in each sub-image frame in the clustering processing results. The terminal then uses the Euclidean distance between the first position information of each sperm head region in each sub-image frame and the cluster center corresponding to each sperm cluster category in each sub-image frame to classify the sperm head regions in each sub-image frame using the Euclidean distance to obtain a clustering processing result, i.e., determining the number of sperm head regions included in each sperm cluster category in each sub-image frame. The specific clustering processing method is similar to that of the previous embodiment and will not be repeated here.

[0217] Step 1207: Determine the sperm aggregation result through the clustering processing results of each sub-image frame.

[0218] The sperm agglutination result is the presence of sperm agglutination or the absence of sperm agglutination.

[0219] Specifically, the terminal determines the sperm aggregation result through the clustering processing results of each sub-image frame in a manner similar to the aforementioned embodiment, which will not be repeated here.

[0220] It is understood that, in a manner similar to the aforementioned embodiment, the terminal can classify the head regions of each sperm based on the Euclidean distance of each sub-image frame to obtain clustering results for each sub-image frame. The clustering results for each sub-image frame are then used to determine the sperm aggregation results for each sub-image frame, i.e., whether sperm aggregation exists in the sub-image frame or whether sperm aggregation does not exist in the sub-image frame. As long as sperm aggregation exists in any of the sub-image frames, the sperm aggregation result for the first image frame can be determined as the presence of sperm aggregation. Conversely, if sperm aggregation does not exist in all sub-image frames, the sperm aggregation result for the first image frame can be determined as the absence of sperm aggregation.

[0221] Step 1208 : If the sperm aggregation result is that sperm aggregation exists, a second image frame adjacent to the first image frame is determined from each video frame to be detected.

[0222] In order to avoid the occurrence of sperm aggregation due to dead sperm or sperm aggregation due to impurities or cells sticking together, if the sperm aggregation result shows sperm aggregation, the terminal needs to further determine whether the sperm is alive, or whether the sperm is able to move.

[0223] Based on this, a second image frame adjacent to the first image frame is determined from each video frame to be detected. The second image frame can be an image frame. For example, if the first image frame is the most preceding video frame to be detected among each video frame to be detected, then the second image frame can be the next video frame to be detected adjacent to the most preceding video frame to be detected. Alternatively, if the first image frame is the third video frame to be detected among each video frame to be detected, then the second image frame can be the second video frame to be detected adjacent to the third video frame to be detected, or the fourth video frame to be detected adjacent to the third video frame to be detected.

[0224] Secondly, the second image frame may also be a plurality of image frames, as long as there is at least one image frame adjacent to the first image frame, which is not limited here.

[0225] It should be understood that if the sperm aggregation result is that sperm aggregation does not exist, the terminal can directly determine that the sperm agglutination result is that sperm agglutination does not exist.

[0226] Step 1209: Determine the movement status of each sperm based on the first image frame and the second image frame.

[0227] The motility state result is that the sperm is in a motile state, or the sperm is not in a motile state.

[0228] Specifically, the terminal determines the movement state result of each sperm based on the first position information of the head area of ​​each sperm in the first image frame and the position information of the head area of ​​each sperm in the second image frame.

[0229] Step 1210: Determine the sperm agglutination result based on the sperm motility result.

[0230] Specifically, if the motility state result indicates that the sperm is in a motile state, the terminal will determine that the sperm agglutination result is present. Conversely, if the motility state result indicates that the sperm is not in a motile state, the terminal will determine that the sperm agglutination result is absent.

[0231] It should be understood that Figure 12 The specific implementation of each step in the above embodiment has been described in detail and will not be repeated here.

[0232] It should be understood that, although the steps in the flowcharts involved in the above-mentioned embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the above-mentioned embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0233] Based on the same inventive concept, embodiments of the present application further provide a sperm agglutination detection device for implementing the aforementioned method for sperm agglutination detection. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the sperm agglutination detection device provided below can be found in the above-described limitations of the sperm agglutination detection method and will not be further elaborated here.

[0234] In one embodiment, Figure 13 As shown, a sperm agglutination detection device is provided, including: an acquisition module 1302 and a determination module 1304, wherein:

[0235] An acquisition module 1302 is configured to acquire a first image frame, where the first image frame includes a plurality of sperms, each of which includes a head.

[0236] Determination module 1304 is used to determine the head area corresponding to the head of each sperm based on the first image frame, and determine the first position information of the head area of ​​each sperm, as well as the number of head areas of each sperm; and cluster the number of head areas of each sperm and the first position information of the head area of ​​each sperm to obtain a clustering processing result; and determine the sperm agglutination result through the clustering processing result.

[0237] In one embodiment, the clustering processing result is a plurality of sperm cluster categories obtained after clustering the head region of each sperm;

[0238] The determination module 1304 is further configured to adjust the number of head regions of each sperm in each sperm cluster category according to the first position information of the head region of each sperm in each sperm cluster category; and determine the sperm agglutination result based on the adjusted number of head regions of each sperm in each sperm cluster category.

[0239] In one embodiment, the acquisition module 1302 is further configured to acquire a video to be detected, wherein the video to be detected includes a plurality of video frames to be detected, each of which includes a plurality of sperm; and determine a first image frame from each of the video frames to be detected;

[0240] The determination module 1304 is also used to determine the sperm aggregation result based on the clustering processing result; if the sperm aggregation result is that sperm aggregation exists, determine the second image frame adjacent to the first image frame from each video frame to be detected; and based on the first image frame and the second image frame, determine the movement state result of each sperm; and determine the sperm agglutination result based on the sperm movement state result.

[0241] In one embodiment, the determination module 1304 is further used to determine the first position information of the head region of each sperm based on the first image frame, and determine the second position information of the head region of each sperm based on the second image frame; and calculate the first distance between the first position information of the head region of each sperm and the second position information of the head region of each sperm; and determine the movement state result of each sperm based on the first distance.

[0242] In one embodiment, the determination module 1304 is further used to determine the number of first sperm clustering categories based on the number of head regions of each sperm, and the first sperm clustering categories have corresponding third position information; and calculate the second distance between the first position information of the head region of each sperm and the third position information of each first sperm clustering category; and based on the second distance, classify the head region corresponding to the head of each sperm into: the sperm clustering category corresponding to each first sperm clustering category; wherein, the second distance between the first position information of the head region of each sperm in the sperm clustering category and the third position information of the corresponding first sperm clustering category is smaller than the second distance between the first position information of the head region of each sperm and the third position information of the first sperm clustering category in other sperm clustering categories.

[0243] In one embodiment, the sperm agglutination detection device further includes a dividing module 1306;

[0244] A division module 1306 is configured to divide the first image frame into a plurality of sub-image frames, where there are overlapping areas between the sub-image frames;

[0245] The determination module 1304 is further used to determine the number of head regions of each sperm in each sub-image frame based on the number of head regions of each sperm; and to perform clustering processing based on the number of head regions of each sperm in each sub-image frame and the first position information of the head region of each sperm in each sub-image frame to obtain the clustering processing results of each sub-image frame; and to determine the sperm agglutination result of the first image frame through the clustering processing results of each sub-image frame.

[0246] Each module in the sperm agglutination detection device described above can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor within the medical device as hardware, or can be stored in a memory within the medical device as software, allowing the processor to call and execute the corresponding operations of each module.

[0247] In one embodiment, a medical device is provided. The medical device may be a sperm quality analyzer, and its internal structure diagram may be as follows: Figure 14 As shown. The medical device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the medical device is used to provide computing and control capabilities. The memory of the medical device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the medical device is used to exchange information between the processor and an external device. The communication interface of the medical device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for detecting sperm agglutination is implemented. The display unit of the medical device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the medical device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the medical device housing, or an external keyboard, touchpad or mouse, etc.

[0248] Those skilled in the art will understand that Figure 14The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the medical device to which the solution of the present application is applied. The specific medical device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0249] In one embodiment, a medical device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0250] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0251] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0252] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0253] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0254] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0255] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for detecting sperm agglutination, characterized in that: The method comprises: Acquire a video to be detected, wherein the video to be detected includes a plurality of video frames to be detected, and the video frames to be detected include a plurality of sperm; Determining a first image frame from each of the to-be-detected video frames, wherein the first image frame includes a plurality of the sperms, each of which includes a head; determining, based on the first image frame, a head region corresponding to the head of each sperm, and determining first position information of the head region of each sperm, and the number of the head regions of each sperm; performing clustering processing based on the number of the head regions of each sperm and the first position information of the head region of each sperm to obtain a clustering processing result; the clustering processing is used to classify the head regions of each sperm; Determining sperm agglutination results based on the clustering processing results; Determining the sperm agglutination result by the clustering processing result includes: determining a sperm aggregation result in the first image frame based on the clustering processing result; If the sperm aggregation result in the first image frame is that sperm aggregation exists, determining a second image frame adjacent to the first image frame from each of the video frames to be detected; Determining a motion state result of each of the sperm based on the first image frame and the second image frame; the motion state is determined based on position information of a head region of the same sperm in adjacent image frames, and the same sperm is determined based on an intersection-over-union ratio between the head regions of each sperm in the first image frame and the second image frame; The sperm agglutination result is determined based on the sperm motility result.

2. The method according to claim 1, characterized in that The clustering processing result is a plurality of sperm clustering categories obtained after clustering the head region of each sperm; Determining the sperm agglutination result by the clustering processing result includes: adjusting the number of the head regions of each sperm in each sperm cluster category according to the first position information of the head region of each sperm in each sperm cluster category; The sperm agglutination result is determined based on the adjusted number of the head region of each sperm in each sperm cluster category.

3. The method according to claim 1, characterized in that The determining of the movement state of each sperm based on the first image frame and the second image frame includes: determining first position information of the head region of each sperm based on the first image frame, and determining second position information of the head region of each sperm based on the second image frame; calculating a first distance between the first position information of the head region of each sperm and the second position information of the head region of each sperm; The movement status of each sperm is determined based on the first distance.

4. The method according to claim 1, wherein The clustering process is performed based on the number of the head regions of each sperm and the first position information of the head region of each sperm to obtain a clustering process result, including: determining the number of cluster centers based on the number of head regions of each of the sperm, wherein the cluster centers have corresponding third position information; Calculating a second distance between the first position information of the head region of each sperm and the third position information of each cluster center; Based on the second distance, the head area corresponding to the head of each sperm is classified into: the sperm cluster category corresponding to each cluster center; wherein, the second distance between the first position information of the head area of ​​each sperm in the sperm cluster category and the third position information of the corresponding cluster center is smaller than the second distance between the first position information of the head area of ​​each sperm and the third position information of the cluster center in other sperm cluster categories.

5. The method according to claim 1, wherein The method further comprises: Dividing the first image frame into a plurality of sub-image frames, wherein there are overlapping areas between the sub-image frames; The clustering process is performed based on the number of the head regions of each sperm and the first position information of the head region of each sperm to obtain a clustering process result, including: determining the number of the head regions of each of the sperm in each of the sub-image frames based on the number of the head regions of each of the sperm; performing clustering processing based on the number of the head regions of each sperm in each of the sub-image frames and the first position information of the head regions of each of the sperm in each of the sub-image frames to obtain a clustering processing result for each of the sub-image frames; Determining the sperm agglutination result by the clustering processing result includes: The sperm agglutination result of the first image frame is determined based on the clustering processing results of each of the sub-image frames.

6. A sperm agglutination detection device, characterized in that: The device comprises: An acquisition module is configured to acquire a video to be detected, wherein the video to be detected includes a plurality of video frames to be detected, each of which includes a plurality of sperm; and determine a first image frame from each of the video frames to be detected, wherein the first image frame includes the plurality of sperm, each of which includes a head. A determination module is used to determine the head area corresponding to the head of each sperm based on the first image frame, and determine the first position information of the head area of ​​each sperm, as well as the number of head areas of each sperm; and cluster the number of head areas of each sperm and the first position information of the head area of ​​each sperm to obtain a clustering processing result; the clustering processing is used to classify the head area of ​​each sperm; and determine the sperm aggregation result in the first image frame based on the clustering processing result; if the sperm aggregation result in the first image frame is that sperm aggregation exists, determine a second image frame adjacent to the first image frame from each of the video frames to be detected; based on the first image frame and the second image frame, determine the motion state result of each sperm; the motion state is determined based on the position information of the head area of ​​the same sperm in adjacent image frames, and the same sperm is determined based on the intersection-union ratio between the head areas of each sperm in the first image frame and the second image frame; the sperm agglutination result is determined based on the motion state result of the sperm.

7. The device according to claim 6, characterized in that The clustering processing result is a plurality of sperm clustering categories obtained after clustering the head region of each sperm; The determining module is further configured to adjust the number of the head regions of each sperm in each sperm cluster category according to the first position information of the head region of each sperm in each sperm cluster category; The sperm agglutination result is determined based on the adjusted number of the head region of each sperm in each sperm cluster category.

8. A medical device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Sperm quality tester and sperm quality testing system

    CN109064469A