Processing method based on sperm cell detection and storage medium

By improving the YOLO target detection model and sperm cell tracking model, and combining them with a microscope camera to acquire semen images, the detection problem in the field of image processing technology of existing detection methods has been solved. This has enabled the implementation of a sperm cell detection and processing method, which solves the problem of time-consuming and labor-intensive detection methods in existing technologies, and improves the efficiency and accuracy of sperm motility assessment.

CN121121402APending Publication Date: 2025-12-12BEIJING GUOXIN XINYUAN CELL BIOTECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511248282.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing methods for detecting sperm motility are time-consuming and labor-intensive, and cannot achieve precise and rapid image processing, making it difficult to accurately assess the level of sperm cell motility.

Method used

An image processing method based on improved YOLO technology is used to acquire images of semen to be tested through a microscope camera, and sperm cells are detected using an improved YOLO target detection model. An information database is established by combining a sperm cell tracking model, and sperm motility is evaluated by the movement trajectory.

Benefits of technology

It enables precise detection and tracking of sperm cells, provides a scientific basis for objectively assessing sperm motility, and improves the efficiency and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121121402A_ABST
    Figure CN121121402A_ABST
Patent Text Reader

Abstract

The invention discloses a sperm cell detection-based processing method and a storage medium, a microscope camera is used to shoot sperm to be detected at fixed time intervals, and an improved YOLO target detection model is used to carry out sperm cell detection, so that accurate detection of sperm cells is realized; according to the method, sperm cells are tracked by using a sperm cell tracking model, sperm cell information is recorded into a database, data support is provided for subsequent analysis, and a method for judging the motion trail and length of target sperm cells is established according to the sperm cell information database. According to the method, the number of the sperm frame images is set, the motion trail length corresponding to the number of the sperm frame images and the sperm cell activity degree judgment threshold value are set, the sperm activity degree can be objectively evaluated, a scientific basis is provided for sperm quality evaluation, the sperm quality can be efficiently and accurately evaluated, and important data support is provided for reproductive medicine research.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, and more particularly to a sperm cell detection and processing method and storage medium. Background Technology

[0002] Sperm motility has a significant impact on reproductive health; therefore, it is necessary to conduct statistical testing on sperm motility.

[0003] Currently, the detection of sperm motility mainly relies on routine semen analysis, semen microscopy, Papanicolaou staining, pH testing, and semen culture. This method is time-consuming and requires a great deal of manpower and resources. Furthermore, due to the time commitment, sperm may become dead during the motility process, making it impossible to effectively identify and detect the motility of sperm cells.

[0004] Researchers believe that sperm motility analysis, which uses continuous exposure photography to measure the distance of sperm movement over a certain period of time to determine sperm motility, especially forward sperm motility, is an important factor in sperm quality assessment. Semen is placed in a semen analysis system, which records sperm movement trajectories in real time for 3-5 seconds; the resulting trajectory map reflects the true movement of the sperm.

[0005] However, current image processing technology is insufficient for precise and rapid identification and detection of sperm cells, which are delicate and require real-time image processing. Current detection methods mainly involve recording the movement trajectory and then showing it to technicians for observation to determine sperm motility and quality. Summary of the Invention

[0006] The purpose of this invention is to provide a sperm cell detection and processing method and storage medium, which solves the above-mentioned technical problems pointed out in the prior art.

[0007] This invention provides a sperm cell detection and processing method, comprising the following steps:

[0008] The system acquires continuous semen frame images captured at fixed time intervals by a microscope camera of the semen sample to be tested. Based on the improved YOLO target detection model, sperm cells are detected in each semen frame image to obtain a sperm cell detection image containing a rectangular box containing complete sperm cells.

[0009] The sperm cell detection image is input into the sperm cell tracking model to obtain the sperm cell tracking result;

[0010] A sperm cell information database is established based on the sperm cell detection images and sperm cell tracking results;

[0011] The target sperm cell image is extracted from any sperm cell detection image in the sperm cell information database, and the movement trajectory of the target sperm cell corresponding to the target sperm cell image is matched according to the sperm cell information database.

[0012] A threshold for judging sperm cell motility is set based on the length of the motion trajectory corresponding to the number of semen frame images. The motility of the target sperm cell is determined based on the length of the motion trajectory of the target sperm cell and the threshold for judging sperm cell motility based on the length of the motion trajectory corresponding to the number of semen frame images.

[0013] Preferably, the sperm cell tracking results include sperm cell ID and sperm cell movement trajectory.

[0014] Preferably, the improved YOLO object detection model includes a feature extraction network, a convolutional analysis network, and an output network.

[0015] Preferably, the step of using the improved YOLO target detection model to detect sperm cells in each semen frame image to obtain a sperm cell detection image containing a rectangular bounding box of complete sperm cells includes the following steps:

[0016] The input semen frame image is scaled to 640×640 using the feature extraction network; sperm cell feature data is extracted from the scaled semen frame image; the sperm cell feature data includes sperm cell pixels and sperm cell pixel coordinates;

[0017] The convolutional analysis network is used to cluster sperm cell pixels in the sperm cell feature data according to the coordinates of the sperm cell pixels, resulting in multiple sperm cell pixel clusters; multiple sperm cell detection images are obtained based on the sperm cell pixel clusters; and rectangular boxes are labeled on the sperm cell detection images.

[0018] The output network is used to fuse and output the rectangular frame and all sperm cell pixels and their coordinates to obtain a sperm cell detection image containing a complete sperm cell rectangular frame.

[0019] Preferably, multiple sperm cell detection images are obtained based on the sperm cell pixel clusters, including the following steps:

[0020] Traverse each of the sperm cell pixel clusters and filter to obtain multiple overlapping clusters based on a preset threshold for the number of pixels in each cluster;

[0021] The sperm cell bounding image is obtained based on the overlapping clusters;

[0022] The image surrounding the sperm cells is segmented to obtain multiple sperm cell detection images.

[0023] Preferably, the sperm cell surrounding image is segmented to obtain multiple sperm cell detection images, including the following steps:

[0024] Traverse each of the sperm cell surrounding images to obtain the body feature points of the sperm cell surrounding images; the body feature points include the head point, the middle point, and the tail point of the sperm cell detection image.

[0025] The midline of the sperm cell detection image is obtained based on body feature points;

[0026] The midline is the line connecting the head point, midpoint, and tail point of the sperm cell detection image;

[0027] The contour line of the sperm cell surrounding image is extracted based on the midline; the sperm cell surrounding image is segmented based on the contour line to obtain multiple sperm cell detection images.

[0028] Preferably, acquiring the body feature points of the sperm cell surrounding image includes the following steps:

[0029] The corner points of the sperm cell surrounding image are obtained by detection.

[0030] Based on the corner points, obtain the body feature points of the sperm cell surrounding image.

[0031] Preferably, the step of detecting and obtaining the corner points of the sperm cell surrounding image includes the following steps:

[0032] The sperm cell bounding image is preprocessed to obtain a preprocessed bounding image;

[0033] For each bounding pixel in the preprocessed bounding image, calculate the gradient value Gx in the X direction and the gradient value Gy in the Y direction of the bounding pixel;

[0034] Define a two-dimensional Gaussian window and obtain the Gaussian weights w of the two-dimensional Gaussian window; traverse each of the enclosing pixels according to the two-dimensional Gaussian window and obtain the number n of the neighboring pixels n of each enclosing pixel within the two-dimensional Gaussian window; calculate and obtain the structure tensor M of each enclosing pixel according to the Gaussian weights, the gradient values ​​Gx and Gy of each enclosing pixel in the X direction, and the number n of the neighboring pixels.

[0035] The Gaussian weight w is calculated as follows:

[0036] ;

[0037] In the formula, a and b are the offsets of the gradient vector; σ is the standard deviation of the two-dimensional Gaussian window;

[0038] The structure tensor M is calculated as follows:

[0039] ;

[0040] The corner response function R is calculated based on the structural tensor M.

[0041] Sort the corner response functions of each surrounding pixel in descending order to obtain a set of corner response function sequences. Iterate through each corner response function in the set in descending order, obtaining p×q neighboring pixels corresponding to the corner response function. Select the surrounding pixel with the highest corner response function among the surrounding pixel and all its neighboring pixels as the candidate target surrounding pixel. After traversing all surrounding pixels, multiple candidate target surrounding pixels are obtained.

[0042] Set a minimum threshold for the corner response function, and filter out all candidate target bounded pixels whose corner response function is greater than or equal to the minimum threshold for the corner response function as corner points.

[0043] Preferably, the corner response function R is calculated as follows:

[0044] ;

[0045] In the formula, M is the structure tensor; det(M) represents the determinant of the matrix; trace(M) represents the trace of the matrix; and k is an adjustable parameter.

[0046] The present invention also provides a storage medium comprising a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to perform the above-described sperm cell detection and processing method.

[0047] Compared with the prior art, the embodiments of the present invention have at least the following technical advantages:

[0048] Analysis of the sperm cell detection and processing method and storage medium provided by this invention reveals that, in practical applications, a microscope camera is used to take pictures of the semen to be tested at fixed time intervals, and an improved YOLO target detection model is used to detect sperm cells, thereby achieving accurate detection of sperm cells. Then, a sperm cell tracking model is used to track sperm cells and record sperm cell information in a database, providing data support for subsequent analysis. By establishing a method for judging the movement trajectory and length of target sperm cells based on the sperm cell information database, and setting a threshold for judging the movement trajectory length corresponding to the number of semen frame images and the sperm cell motility level, the sperm motility level can be objectively assessed, providing a scientific basis for sperm quality assessment. This method can efficiently and accurately assess sperm quality and provides important data support for reproductive medicine research. Attached Figure Description

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

[0050] Figure 1 This is a schematic diagram illustrating the overall operation steps of a sperm cell detection and processing method according to an embodiment of the present invention;

[0051] Figure 2 This is a schematic diagram illustrating the operational steps of obtaining a sperm cell detection image containing a rectangular frame of a complete sperm cell in a sperm cell detection processing method provided in an embodiment of the present invention;

[0052] Figure 3 This is a schematic diagram illustrating the operational steps for acquiring sperm cell detection images in a sperm cell detection and processing method according to an embodiment of the present invention;

[0053] Figure 4 This is a schematic diagram illustrating the operational steps for obtaining a sperm cell detection image in a sperm cell detection processing method provided in an embodiment of the present invention;

[0054] Figure 5 This is a schematic diagram simulating the midline of a sperm cell detection image in a sperm cell detection processing method provided in an embodiment of the present invention;

[0055] Figure 6 This is a schematic diagram illustrating the operational steps for obtaining body feature points in a sperm cell detection and processing method according to an embodiment of the present invention;

[0056] Figure 7 This is a schematic diagram illustrating the operation steps for detecting corner points in a sperm cell detection and processing method provided in an embodiment of the present invention. Detailed Implementation

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

[0058] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings.

[0059] like Figure 1 As shown, this invention proposes a sperm cell detection and processing method, comprising the following steps:

[0060] Step S10: Acquire continuous semen frame images taken at fixed time intervals in the microscope camera of the semen to be tested, and perform sperm cell detection on each semen frame image based on the improved YOLO target detection model to obtain a sperm cell detection image containing a complete sperm cell bounding box.

[0061] Explanation: The above-described embodiment first requires using a camera mounted on a microscope to continuously capture multiple semen frame images at fixed time intervals. Then, a modified YOLO target detection model is used to detect sperm cells in each semen frame image to obtain a sperm cell detection image containing rectangular frames of complete sperm cells. The main function of the above-described embodiment is to accurately detect sperm cells, providing basic data for subsequent analysis.

[0062] The improved YOLO object detection model described above is based on YOLOv3, which is an object detection algorithm. YOLOv3 uses deep convolutional neural networks to achieve real-time object detection and localization.

[0063] Step S20: Input the sperm cell detection image into the sperm cell tracking model to obtain the sperm cell tracking result; the sperm cell tracking result includes the sperm cell ID and the sperm cell movement trajectory;

[0064] It should be noted that in the above embodiments of this application, the sperm cell detection image is input into the sperm cell tracking model to obtain the sperm cell tracking results, including the sperm cell ID and the sperm cell movement trajectory. The main function of this step is to track the sperm cells, thereby providing data support for subsequent analysis.

[0065] Step S30: Establish a sperm cell information database based on the sperm cell detection images and sperm cell tracking results;

[0066] It should be noted that, according to the above embodiments of this application, a sperm cell information database is established based on sperm cell detection images and tracking results. This database records the detection and tracking results of each sperm cell, providing a comprehensive record and management of sperm cells and offering data for subsequent analysis. In the implementation process of the above embodiments of this application, each sperm cell detection image is first numbered to distinguish it from other images. Then, the sperm cell detection results, movement trajectory, morphological characteristics, and other information are stored in the database to form a complete sperm cell information record. The database is equipped with query and statistical functions to facilitate subsequent sperm cell analysis and management.

[0067] Step S40: Extract a target sperm cell image based on any sperm cell detection image in the sperm cell information database, and match the movement trajectory of the target sperm cell corresponding to the target sperm cell image according to the sperm cell information database;

[0068] It should be noted that the above embodiments of this application are based on the established sperm cell information database. Any sperm cell detection image is selected, a target sperm cell image is captured, and the movement trajectory of the target sperm cell corresponding to the target sperm cell image is matched according to the sperm cell information database. This provides a more detailed understanding of the movement of each sperm cell and provides a basis for subsequent assessment of motility. The above embodiments of this application first search for matching sperm cells in the database based on the sperm cell number and movement trajectory; then calculate the difference in movement trajectory between the target sperm cell image and the matching sperm cell to obtain the matching degree; by setting a matching threshold, it is determined whether the matching degree is greater than the threshold. If so, it is considered that the target sperm cell has been found, thus achieving the matching of the target sperm cell image and the target sperm cell's movement trajectory.

[0069] Step S50: Set the motion trajectory length corresponding to the number of semen frame images and the sperm cell motility judgment threshold, and determine the motility of the target sperm cell based on the length of the motion trajectory of the target sperm cell and the motion trajectory length corresponding to the number of semen frame images and the sperm cell motility judgment threshold.

[0070] It should be noted that the above embodiments of this application set a threshold for judging the length of the motion trajectory corresponding to the number of semen frame images and the degree of sperm cell motility. By quantifying and judging the length of the motion trajectory of sperm cells, the degree of sperm motility can be objectively evaluated.

[0071] The technical solution adopted in the above-described embodiments of this application achieves accurate detection of sperm cells by using a microscope camera to take pictures of the semen to be tested at fixed time intervals and using an improved YOLO target detection model to detect sperm cells. Then, a sperm cell tracking model is used to track the sperm cells and record sperm cell information into a database to provide data support for subsequent analysis. By establishing a method for judging the movement trajectory and length of target sperm cells based on the sperm cell information database, and setting a threshold for judging the movement trajectory length and sperm cell motility corresponding to the number of semen frame images, the motility of sperm can be objectively evaluated, providing a scientific basis for sperm quality assessment. This method can efficiently and accurately assess sperm quality and provides important data support for reproductive medicine research.

[0072] Specifically, in step S10, the improved YOLO target detection model includes a feature extraction network, a convolutional analysis network, and an output network;

[0073] like Figure 2 As shown, the improved YOLO target detection model performs sperm cell detection on each semen frame image to obtain a sperm cell detection image containing complete sperm cell bounding boxes, including the following steps:

[0074] Step S11: Scale the input semen frame image to a 640×640 scaled semen frame image using the feature extraction network; extract sperm cell feature data from the scaled semen frame image; the sperm cell feature data includes sperm cell pixels and sperm cell pixel coordinates;

[0075] Step S12: Using the convolutional analysis network, cluster the sperm cell pixels in the sperm cell feature data according to the coordinates of the sperm cell pixels to obtain multiple sperm cell pixel clusters; obtain multiple sperm cell detection images according to the sperm cell pixel clusters; and annotate the sperm cell detection images with bounding boxes.

[0076] Step S13: Use the output network to fuse and output the rectangular frame and all sperm cell pixels and their coordinates to obtain a sperm cell detection image containing a complete sperm cell rectangular frame.

[0077] It should be noted that the above-described embodiments of this application first accurately extract the feature information of each sperm cell in the semen frame image through a specific feature extraction method. Then, through clustering and annotation, multiple discrete pixels can be combined into a complete sperm cell bounding box, thereby more accurately detecting and tracking sperm cells. Compared with traditional clustering algorithms, a convolutional analysis network is used, which can more accurately identify sperm cells and process large amounts of data. Finally, the annotated bounding box and all sperm cell pixels and coordinates are fused and output. This information will be used in subsequent operations such as sperm cell tracking and sperm cell motility assessment. Compared with traditional output algorithms, the fusion technology used can integrate various pieces of information and improve the accuracy of the detection results.

[0078] In the specific implementation of the technical solution adopted in the above-described embodiments of this application, the technicians found that in the sperm cell detection image obtained by clustering sperm cell pixels, there may be two or more overlapping sperm cells. Therefore, in the sperm cell detection image directly obtained from the sperm cell pixel clustering, there will be multiple sperm cells. However, this application needs to annotate the detection box for each sperm cell to track the movement trajectory of each sperm cell and analyze the sperm motility level. Therefore, it is also necessary to analyze the sperm cell pixel clusters in the case of multiple overlapping sperm cells to obtain the sperm cell detection image for each sperm cell.

[0079] Specifically, such as Figure 3 As shown, in step S12, multiple sperm cell detection images are obtained based on the sperm cell pixel clusters, including the following steps:

[0080] Step S121: Traverse each of the sperm cell pixel clusters and filter to obtain multiple overlapping clusters according to the preset threshold for the number of pixels in the cluster;

[0081] It should be noted that the above-described embodiment of this application determines whether the number of sperm cell pixels in each sperm cell pixel cluster is less than or equal to the threshold for the number of pixels in the cluster by setting a preset threshold for the number of pixels in the cluster. If not, the sperm cell pixel cluster is determined to be an overlapping cluster. An overlapping cluster refers to a cluster of sperm cells obtained due to the overlap of multiple sperm cells, where the number of sperm cell pixels is greater than the preset threshold for the number of pixels in the cluster. Through the above-described determination and screening process of this application, overlapping clusters are selected, and the sperm cell pixel clusters corresponding to the overlapping clusters are segmented in the following steps to obtain multiple sperm cell images corresponding to the overlapping clusters, thereby providing strong data support for subsequent identification, judgment, and analysis of sperm motility.

[0082] It is important to note that during sperm cell detection, there may be cases where sperm cells completely overlap. In such cases, the microscope camera cannot capture the lower sperm cells other than the topmost sperm cells in the completely overlapping sperm cells. Therefore, in this embodiment, these lower sperm cells are considered to have a movement trajectory that cannot be detected in the current semen frame image. When they reappear, they are matched and tracked. Therefore, this technology is not the main innovation of this application, and will not be elaborated upon here. Furthermore, the detection and analysis of overlapping sperm cell detection images in this application only targets sperm cell detection images that are not completely overlapping (i.e., the sperm cell surrounding images described below) to identify the overlapping sperm cell detection images. The specific operation is as shown in the following steps.

[0083] Step S122: Obtain the sperm cell surrounding image based on the overlapping clusters;

[0084] It should be noted that the above-mentioned sperm cell surrounding image refers to a sperm cell image composed of multiple overlapping sperm cells (that is, an overlapping image obtained by overlapping multiple sperm cells).

[0085] Step S123: Segment the image surrounding the sperm cells to obtain multiple sperm cell detection images.

[0086] It should be noted that, in the above-described embodiments of this application, multiple overlapping clusters caused by overlapping sperm cell detection images are obtained by filtering from various clusters through a pre-set threshold for the number of pixels in each cluster. In further operations, sperm cell surrounding images composed of multiple overlapping sperm cell detection images are obtained based on the overlapping clusters. Finally, the sperm cell surrounding images are segmented to obtain individual sperm cell detection images. The overlapping sperm cell surrounding images can be detected intuitively, thereby segmenting the overlapping sperm cell detection images to obtain individual sperm cell detection images.

[0087] Specifically, such as Figure 4 As shown, in step S123, the sperm cell surrounding image is segmented to obtain multiple sperm cell detection images, including the following steps:

[0088] Step S1231: Traverse each of the sperm cell surrounding images to obtain the body feature points of the sperm cell surrounding images; the body feature points include the head point, the middle point, and the tail point of the sperm cell detection image.

[0089] It should be noted that the above embodiments of this application extract the body feature points of the sperm cell surrounding image to obtain the head point, mid point, and tail point of each sperm cell detection image in the sperm cell surrounding image; wherein, the head point of the sperm cell detection image refers to the point at the very top of the sperm cell head; the mid point of the sperm cell detection image refers to the point in the middle of the sperm cell (that is, the point where the head and tail of the sperm cell connect); the tail point of the sperm cell detection image refers to the point at the very top of the sperm cell tail; through the above-mentioned multiple head points, mid points, and tail points of the sperm cell detection image, it is possible to identify and analyze how many sperm cell detection images are contained in the sperm cell surrounding image, and then perform image segmentation on the sperm cell detection image according to the head point, mid point, and tail point to obtain each sperm cell detection image in the accurate cell surrounding image.

[0090] Step S1232: Obtain the midline of the sperm cell detection image based on body feature points;

[0091] The midline is the line connecting the head point, midpoint, and tail point of the sperm cell detection image, and located at the center of the sperm cell detection image (e.g., ...). Figure 5 As shown, since the line connecting the head point, midpoint, and tail point of the sperm cell detection image can divide the sperm cell detection image in two, the midline obtained by connecting the head point, midpoint, and tail point is the line connecting the two points at the midline position of the sperm cell detection image.

[0092] It should be noted that the above-described embodiments of this application use a pre-set distance threshold between the head point, midpoint, and tail point (generally, the distance from the head point to the midpoint of a normal sperm cell detection image is about one-half or one-third of the entire sperm cell detection image, because the head of the sperm cell is large and contains genetic material DNA; the distance from the midpoint to the tail point is about one-half or two-thirds, because the tail of the sperm cell is long and used for propulsion and movement; based on this characteristic of normal sperm cell detection images, this embodiment of the application sets the distance threshold from the head point to the midpoint as α or α', and sets the distance threshold from the midpoint to the tail point as β or β', and classifies each head point, tail point, and midpoint into each sperm cell detection image according to the distance threshold), to identify the sperm cell detection images to which each head point, midpoint, and tail point belong, and then connects the head point, midpoint, and tail point of the sperm cell detection image to obtain the midline located at the center of the sperm cell detection image;

[0093] Step S1233: Extract the contour line of the sperm cell surrounding image based on the midline; segment the sperm cell surrounding image based on the contour line to obtain multiple sperm cell detection images;

[0094] Repeat the above operation until all sperm cell surrounding images have been traversed, and obtain multiple sperm cell detection images corresponding to each of the sperm cell surrounding images.

[0095] It should be noted that the above-mentioned midline refers to the midline of each sperm cell detection image (i.e., the midline of each sperm cell); the above-mentioned contour line actually refers to the contour line of each sperm cell detection image, because the contour lines of each sperm cell detection image together constitute the sperm cell surrounding image. Therefore, based on the contour line, the sperm cell surrounding image can be directly segmented to obtain the individual sperm cell detection image.

[0096] In the above-described embodiments of this application, after extracting the body feature points in the sperm cell surrounding image, the sperm cell detection image to which each head point, middle point, and tail point belongs is identified according to a preset distance threshold between the head point, middle point, and tail point. Then, the head point, middle point, and tail point of the sperm cell detection image are connected to obtain the midline at the center of the sperm cell detection image. After analysis, the contour line of the sperm cell surrounding image is obtained, and the sperm cell detection image is segmented according to the contour line to obtain individual sperm cell detection images.

[0097] Specifically, such as Figure 6 As shown, in step S1231, obtaining the body feature points of the image surrounding the sperm cells includes the following steps:

[0098] Step S12311: Detect the sperm cell surrounding image to obtain the corner points of the sperm cell surrounding image;

[0099] Step S12312: Obtain the body feature points of the sperm cell surrounding image based on the corner points.

[0100] It should be noted that the above-described embodiments of this application first detect multiple corner points of the sperm cell surrounding image, and then analyze each corner point to obtain the head point, midpoint, and tail point of the sperm cell detection image in the sperm cell surrounding image. Specifically, a sperm cell detection image head template and a head point template in the sperm cell head image template are set; the identified corner points of the sperm cell surrounding image are matched with the sperm cell detection image head template; after successful matching, the head point template in the sperm cell head image target is used... The process involves matching corner points to obtain the head point of the sperm cell detection image within the sperm cell surrounding image; setting a tail image template and a tail point template within the sperm cell tail image template; matching the corner points of the identified sperm cell surrounding image with the tail template to obtain the tail point of the sperm cell detection image within the sperm cell surrounding image; in the sperm cell detection image, there is usually an abrupt narrowing of the image at the connection between the head and tail of the sperm cell, therefore, the midpoint of the sperm cell detection image within the sperm cell surrounding image can be directly detected through this characteristic.

[0101] Specifically, such as Figure 7 As shown, in step S12311, the corner points of the sperm cell surrounding image are detected, including the following steps:

[0102] Step S123111: Preprocess the sperm cell bounding image to obtain a preprocessed bounding image;

[0103] It should be noted that the above preprocessing includes operations such as grayscale conversion, noise reduction, and image enhancement, which can enhance image contrast, remove noise from the image, and improve the accuracy of subsequent corner detection.

[0104] Step S123112: Calculate the gradient value Gx in the X direction and the gradient value Gy in the Y direction for each bounding pixel in the preprocessed bounding image;

[0105] Step S123113: Define a two-dimensional Gaussian window and obtain the Gaussian weight w of the two-dimensional Gaussian window; traverse each of the surrounding pixels according to the two-dimensional Gaussian window and obtain the number n of the neighboring pixels of each surrounding pixel within the two-dimensional Gaussian window; calculate and obtain the structure tensor M of each surrounding pixel according to the Gaussian weight, the gradient value Gx of each surrounding pixel in the X direction, the gradient value Gy of each surrounding pixel in the Y direction, and the number n of the neighboring pixels.

[0106] The Gaussian weight w is calculated as follows:

[0107] ;

[0108] In the formula, a and b are the offsets of the gradient vectors (for example, if we want to calculate the structure tensor at the current bounding pixel (0,0), then we need to consider the gradient vectors within a certain radius around the point, and the offsets of the coordinates of these gradient vectors relative to (0,0) are a and b); σ is the standard deviation of the two-dimensional Gaussian window.

[0109] The structure tensor M is calculated as follows:

[0110] ;

[0111] It should be noted that the structure tensor is a second-order symmetric matrix used to describe the features of a local image within an image surrounded by sperm cells. Gaussian weighted averaging is typically used to calculate the second-order matrix of gradients within the neighborhood, which can make the structure tensor somewhat smoother as gradient changes occur. Specifically, Gaussian weighted averaging makes the contribution of gradient vectors that are farther away to the structure tensor smaller, and the contribution of gradient vectors that are closer to the structure tensor larger, thereby improving the accuracy and robustness of the structure tensor.

[0112] Step S123114: Calculate and obtain the corner response function R based on the structural tensor M;

[0113] The corner response function R is calculated as follows:

[0114] ;

[0115] In the formula, M is the structure tensor; det(M) represents the determinant of the matrix; trace(M) represents the trace of the matrix; k is an adjustable parameter;

[0116] It should be noted that the corner response function is a key indicator for detecting corners in an image. Common corner response functions include the Harris corner response function and the Shi-Tomasi corner response function. Among them, the Harris corner response function is one of the most classic corner detection methods. It calculates the structure tensor of each pixel and then calculates the corner response function based on the determinant and trace. In the above embodiment of this application, by setting a two-dimensional Gaussian window and using the Gaussian weights of the two-dimensional Gaussian window to calculate the structure tensor, the corner response function of each surrounding pixel is calculated using the structure tensor. This can more accurately identify and detect corners in each region (the region is each surrounding pixel during the traversal and the neighboring pixels of that surrounding pixel in the two-dimensional Gaussian window).

[0117] Step S123115: Sort the corner response functions of each of the surrounding pixels in descending order to obtain a set of corner response function sequences; traverse each corner response function in the set of corner response function sequences in descending order to obtain p×q neighboring surrounding pixels corresponding to the corner response function; select the surrounding pixel with the highest corner response function among the surrounding pixel and all its neighboring surrounding pixels as the candidate target surrounding pixel; after traversing all surrounding pixels, multiple candidate target surrounding pixels are obtained.

[0118] Step S123116: Set the minimum threshold value of the corner response function, and filter out all candidate target surrounding pixels whose corner response function is greater than or equal to the minimum threshold value of the corner response function as corner points.

[0119] The minimum threshold value of the corner response function is set based on empirical values. The higher the minimum threshold value of the corner response function, the fewer corners are selected, but the accuracy of corner detection will also be improved.

[0120] It should be noted that the above-described embodiments of this application, through steps such as image preprocessing, calculation of structure tensors, and corner response functions, can effectively improve the accuracy of corner detection, thereby improving detection precision. Using a Gaussian weighted average to calculate the second-order matrix of the gradient within the neighborhood can smooth the changes in the gradient of the corner response function, thus reducing the false detection rate. By setting a two-dimensional Gaussian window and using the Gaussian weights of the two-dimensional Gaussian window to calculate the structure tensor, the robustness of the algorithm can be improved, thus better adapting to different sperm cell-surrounded images. Some parameters in the scheme, such as the standard deviation of the Gaussian window and the minimum threshold of the corner response function, can be adjusted according to actual conditions to better adapt to the detection needs of different sperm cell-surrounded images. The above-described embodiments of this application, based on computer vision technology and image processing algorithms, can achieve automated detection of sperm cell-surrounded images, reducing the cost and error of manual operation.

[0121] In summary, the present invention provides a sperm cell detection and processing method and storage medium. By using a microscope camera to take pictures of the semen sample at fixed time intervals and using an improved YOLO target detection model to detect sperm cells, accurate detection of sperm cells is achieved. Then, a sperm cell tracking model is used to track sperm cells and record sperm cell information into a database, providing data support for subsequent analysis. By establishing a method for judging the movement trajectory and length of target sperm cells based on the sperm cell information database, and setting a threshold for judging the movement trajectory length corresponding to the number of semen frame images and the sperm cell motility level, the sperm motility level can be objectively evaluated.

[0122] Specifically, in the process of sperm cell detection using the improved YOLO object detection model, the feature information of each sperm cell in the semen frame image is accurately extracted through a specific feature extraction method. Then, through clustering and annotation, multiple discrete pixels can be combined into a complete sperm cell bounding box, thereby more accurately detecting and tracking sperm cells. Compared with traditional clustering algorithms, a convolutional analysis network is used, which can more accurately identify sperm cells and process large amounts of data. Finally, the annotated bounding box and all sperm cell pixels and coordinates are fused and output. This information will be used in subsequent operations such as sperm cell tracking and sperm cell motility assessment. Compared with traditional output algorithms, the fusion technology used can integrate various pieces of information, improving the accuracy of the detection results.

[0123] Specifically, when extracting feature information of individual sperm cells from semen frame images, a pre-set threshold for the number of pixels in each cluster is used to filter out overlapping clusters caused by the overlap of multiple sperm cell detection images. In further operations, the overlapping clusters are used to obtain a sperm cell-enclosing image formed by the overlap of multiple sperm cell detection images. Finally, the sperm cell-enclosing image is segmented to obtain individual sperm cell detection images. This allows for the intuitive detection of overlapping sperm cell-enclosing images. By detecting multiple corner points of the sperm cell-enclosing image, further processing is performed based on these corner points. After analyzing the sperm cell detection image to obtain the head point, mid point, and tail point of the sperm cell detection image in the surrounding image, the sperm cell detection image to which each head point, mid point, and tail point belongs is identified according to the preset distance threshold between the head point, mid point, and tail point. Then, the head point, mid point, and tail point of the sperm cell detection image are connected to obtain the midline at the center of the sperm cell detection image. After analysis, the contour line of the sperm cell surrounding image is obtained. Based on the contour line, each sperm cell detection image is segmented to obtain individual sperm cell detection images.

[0124] When detecting corner points in an image surrounded by sperm cells, preprocessing the image, calculating the structure tensor, and calculating the corner response function effectively improves the accuracy of corner detection, thereby increasing detection precision. Using a Gaussian weighted average to calculate the second-order matrix of the gradient within the neighborhood allows the corner response function to have a certain smoothness in response to gradient changes, thus reducing the false detection rate. By setting a two-dimensional Gaussian window and using the Gaussian weights of the two-dimensional Gaussian window to calculate the structure tensor, the robustness of the algorithm can be improved, thus better adapting to different sperm cell-surrounded images. Some parameters in the scheme, such as the standard deviation of the Gaussian window and the minimum threshold of the corner response function, can be adjusted according to actual conditions to better adapt to the detection needs of different sperm cell-surrounded images. The above embodiments of this application, based on computer vision technology and image processing algorithms, can achieve automated detection of sperm cell-surrounded images, reducing the cost and error of manual operation.

[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; those skilled in the art can modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting and processing sperm cells, characterized in that, The following steps are included: The system acquires continuous semen frame images captured at fixed time intervals by a microscope camera of the semen sample to be tested. Based on the improved YOLO target detection model, sperm cells are detected in each semen frame image to obtain a sperm cell detection image containing a rectangular box containing complete sperm cells. The sperm cell detection image is input into the sperm cell tracking model to obtain the sperm cell tracking result; A sperm cell information database is established based on the sperm cell detection images and sperm cell tracking results; The target sperm cell image is extracted from any sperm cell detection image in the sperm cell information database, and the movement trajectory of the target sperm cell corresponding to the target sperm cell image is matched according to the sperm cell information database. A threshold for judging sperm cell motility is set based on the length of the motion trajectory corresponding to the number of semen frame images. The motility of the target sperm cell is determined based on the length of the motion trajectory of the target sperm cell and the threshold for judging sperm cell motility based on the length of the motion trajectory corresponding to the number of semen frame images.

2. The sperm cell detection and processing method according to claim 1, characterized in that, The sperm cell tracking results include sperm cell ID and sperm cell movement trajectory.

3. The sperm cell detection and processing method according to claim 2, characterized in that, The improved YOLO object detection model includes a feature extraction network, a convolutional analysis network, and an output network.

4. The sperm cell detection and processing method according to claim 3, characterized in that, The improved YOLO target detection model performs sperm cell detection on each semen frame image to obtain a sperm cell detection image containing complete sperm cell bounding boxes, including the following steps: The input semen frame image is scaled to 640×640 using the feature extraction network; sperm cell feature data is extracted from the scaled semen frame image; the sperm cell feature data includes sperm cell pixels and sperm cell pixel coordinates; The convolutional analysis network is used to cluster sperm cell pixels in the sperm cell feature data according to the coordinates of the sperm cell pixels, resulting in multiple sperm cell pixel clusters; multiple sperm cell detection images are obtained based on the sperm cell pixel clusters; and rectangular boxes are labeled on the sperm cell detection images. The output network is used to fuse and output the rectangular frame and all sperm cell pixels and their coordinates to obtain a sperm cell detection image containing a complete sperm cell rectangular frame.

5. The sperm cell detection and processing method according to claim 4, characterized in that, Multiple sperm cell detection images are obtained based on the clustering of sperm cell pixels, including the following steps: Traverse each of the sperm cell pixel clusters and filter to obtain multiple overlapping clusters based on a preset threshold for the number of pixels in each cluster; The sperm cell bounding image is obtained based on the overlapping clusters; The image surrounding the sperm cells is segmented to obtain multiple sperm cell detection images.

6. The sperm cell detection and processing method according to claim 5, characterized in that, The sperm cell surrounding image is segmented to obtain multiple sperm cell detection images, including the following steps: Traverse each of the sperm cell surrounding images to obtain the body feature points of the sperm cell surrounding images; the body feature points include the head point, the middle point, and the tail point of the sperm cell detection image. The midline of the sperm cell detection image is obtained based on body feature points; The midline is the line connecting the head point, midpoint, and tail point of the sperm cell detection image; The contour line of the sperm cell surrounding image is extracted based on the midline; the sperm cell surrounding image is segmented based on the contour line to obtain multiple sperm cell detection images.

7. The sperm cell detection and processing method according to claim 6, characterized in that, The process of acquiring the body feature points of the sperm cell-enclosed image includes the following steps: The corner points of the sperm cell surrounding image are obtained by detection. Based on the corner points, obtain the body feature points of the sperm cell surrounding image.

8. The sperm cell detection and processing method according to claim 7, characterized in that, The step of detecting and obtaining the corner points of the sperm cell surrounding image includes the following steps: The sperm cell bounding image is preprocessed to obtain a preprocessed bounding image; For each bounding pixel in the preprocessed bounding image, calculate the gradient value Gx in the X direction and the gradient value Gy in the Y direction of the bounding pixel; Define a two-dimensional Gaussian window and obtain the Gaussian weights w of the two-dimensional Gaussian window; traverse each of the enclosing pixels according to the two-dimensional Gaussian window and obtain the number n of the neighboring pixels n of each enclosing pixel within the two-dimensional Gaussian window; calculate and obtain the structure tensor M of each enclosing pixel according to the Gaussian weights, the gradient values ​​Gx and Gy of each enclosing pixel in the X direction, and the number n of the neighboring pixels. The Gaussian weight w is calculated as follows: ; In the formula, a and b are the offsets of the gradient vector; σ is the standard deviation of the two-dimensional Gaussian window; The structure tensor M is calculated as follows: ; The corner response function R is calculated based on the structural tensor M. The corner response functions of each of the surrounding pixels are sorted from largest to smallest to obtain a set of corner response function sequences. Traverse each corner response function in the set of corner response function sequences from largest to smallest, obtain p×q neighboring pixels corresponding to the corner response function, and select the pixel with the highest corner response function among the surrounding pixel and all the neighboring pixels as the candidate target surrounding pixel. After traversing all the surrounding pixels, multiple candidate target surrounding pixels are obtained; Set a minimum threshold for the corner response function, and filter out all candidate target bounded pixels whose corner response function is greater than or equal to the minimum threshold for the corner response function as corner points.

9. The sperm cell detection and processing method according to claim 8, characterized in that, The corner response function R is calculated as follows: ; In the formula, M is the structure tensor; det(M) represents the determinant of the matrix; trace(M) represents the trace of the matrix; and k is an adjustable parameter.

10. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the storage medium to perform a sperm cell detection and processing method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Mammary glandular cell segmentation method based on multi-scale growth and double-strategy adhesion-removing model

    CN104933701A

  • Islet cell statistical calculation method based on microscope image

    CN115526844A

  • In-vitro induced pluripotent stem cell defect morphology detection and recognition processing method and system

    CN118429316A

  • Boar semen quality analysis method, device, equipment and medium

    CN119625591A

  • Artificial intelligence-based sperm cell classification statistical method and related equipment

    CN119625725A