Sperm automatic detection and tracking method and device and storage medium
By combining multidimensional feature fusion scoring and particle filter prediction with the YOLOv8_OBB rotating bounding box detection model, the problem of identifying and tracking stationary and motile sperm in complex environments was solved, achieving continuity and accuracy of sperm trajectory and improving the accuracy of sperm motility index calculation.
Patent Information
- Application Number
- CN202511842732.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-12-09
AI Technical Summary
Existing sperm detection and tracking systems struggle to effectively distinguish between stationary and motile sperm in complex environments, leading to broken tracks and repeated counting, which affects the accuracy of sperm motility index calculations. Furthermore, they lack a stable identification and preservation mechanism for stationary sperm.
By employing a multi-dimensional feature fusion scoring system and particle filter prediction method, and combining position consistency, motion direction consistency, velocity consistency, color consistency, and trajectory continuity scores with the YOLOv8_OBB rotating bounding box detection model, we can achieve accurate matching and trajectory sealing of sperm targets, thus avoiding interference from stationary sperm with matching of motile sperm.
It enables continuous and unique tracking of sperm trajectories in complex scenarios, improves the accuracy of sperm motility index calculation, and ensures stable system operation and reliable sperm classification.
Smart Images

Figure CN121281053A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sperm detection technology, specifically to an automated sperm detection and tracking method, device, and storage medium. Background Technology
[0002] In the field of reproductive health, a large number of sperm samples need to be tested and analyzed every moment. However, many sperm quality assessment methods still rely on manual observation, leading to low efficiency and a high risk of error. Sperm motility and morphology directly affect fertility outcomes; failure to analyze these sperm in a timely and accurate manner may result in missed opportunities for effective treatment. Furthermore, sperm samples are diverse, with significant differences in quality among different sperm, requiring classification and different processing and analysis methods. For example, highly motile sperm should be selected for assisted reproductive technologies, while sperm with abnormal morphology or insufficient motility should be excluded. Given the large number of sperm samples, manual testing alone requires substantial manpower and resources. Therefore, using deep learning technology to detect, classify, and analyze sperm samples can significantly improve testing efficiency and accuracy, providing strong support for research and treatment in the field of reproductive health.
[0003] Early sperm detection technology typically relied on traditional image processing methods, which extracted information such as sperm morphology and motility features for target detection. However, manually designed features not only require significant time and effort, but these features are often only effective under specific conditions, such as ideal experimental environments. With the diversification of application scenarios, traditional methods have encountered bottlenecks in accuracy and efficiency when handling complex environments. This limitation has spurred the application of deep learning technology in sperm detection, which can automatically extract and learn image features, improving the generalization ability and accuracy of detection, while also better adapting to sperm target detection and tracking tasks in different scenarios.
[0004] Existing computer vision-based sperm detection and tracking systems mostly employ a "tracking-by-detection" mechanism to match sperm targets across consecutive frames to obtain complete motion trajectories for subsequent sperm motility indices, such as curve velocity (VCL), linear velocity (VSL), and linearity of motility (LIN). However, current technologies generally lack a mechanism to effectively distinguish between stationary and motile sperm, which can lead to serious tracking errors in densely packed sperm and complexly occluded microscopic image environments.
[0005] For example, when a motile sperm approaches a stationary sperm, current technology can easily misclassify the stationary sperm as a continuation of the motile sperm's trajectory in subsequent frames, thus incorrectly splitting the trajectory belonging to the same sperm into two trajectories. This trajectory breakage and misconnection not only disrupts the continuity of the trajectory but also leads to the duplicate counting of the same sperm, severely interfering with the calculation of sperm motility indicators. For instance, when counting progressively motile (PR) sperm, the system may overestimate the proportion of this type of sperm due to duplicate counting, causing a shift in the LIN value and distortion of motility classification, affecting the basis for subsequent reproductive medicine diagnosis and assisted reproductive treatment.
[0006] Furthermore, while some systems possess rudimentary velocity filtering mechanisms, they lack multi-frame historical analysis of the trajectory, making them susceptible to interference from single-frame noise, short-term occlusion, and other factors, thus failing to achieve stable identification of stationary sperm. They also lack a mechanism for "sealing" stationary targets, failing to effectively exclude sperm that should no longer participate in trajectory association in subsequent frames, thereby increasing the target matching error rate. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides an automated sperm detection and tracking method, comprising the following steps:
[0008] Step S1: Process the sperm image, and add rotated bounding boxes to the sperm head and tail to generate a training set containing the center point coordinates, width, height and rotation angle.
[0009] Step S2: Use the training set to train the target detection model to generate a model that can automatically detect sperm and output rotated bounding boxes;
[0010] Step S3: Use the trained model to detect sperm video images and obtain the sperm rotation bounding box for each frame, including the position, orientation and size of the sperm;
[0011] Step S4: Match sperm targets in adjacent frames and evaluate the reliability of the match through a multi-dimensional feature fusion scoring system. The scoring system includes position consistency, movement direction consistency, speed consistency, color consistency, and trajectory continuity. The scores are weighted and fused according to preset weights to generate a comprehensive matching score. Based on the score, the sperm targets in the preceding and following frames are associated to generate a continuous temporal trajectory and a unique identifier for each sperm.
[0012] Step S5: For the sperm trajectories generated in step S4, determine whether they are in a stationary or low-activity state, based on the velocity and maximum displacement of the most recent N frames; perform sealing processing on the trajectories of sperm determined to be stationary or low-activity, exclude them from participating in the matching in subsequent matching logic, but retain their detection data, filter them in subsequent matching, and only perform matching on non-sealed trajectories, thereby avoiding interference from stationary sperm in the generation of motile sperm trajectories; at the same time, calculate sperm motility parameters based on each non-sealed trajectory and unique identifier.
[0013] Preferably, the method for determining whether sperm is in a static or low-activity state in step S5 is as follows: statistically analyze the motion characteristics of each sperm trajectory in multiple consecutive frames within a window length N, extract the historical position points of the most recent N frames, calculate the average velocity of adjacent frames within the window and the maximum displacement of all points within the window relative to the starting point, and when the average velocity and the maximum displacement are both lower than a set threshold, the sperm trajectory is determined to be static or low-activity and marked as a sealed state, and excluded from the matching in subsequent frame matching logic.
[0014] Preferably, the multi-dimensional feature fusion scoring system is used for matching and trajectory generation of sperm targets in continuous video frames, and the multi-dimensional feature scoring includes: position consistency score, motion direction consistency score, velocity consistency score, color consistency score, and trajectory continuity score.
[0015] The positional consistency score quantifies the degree of sperm positional matching by evaluating the spatial deviation or intersection-over-union (IoU) value of the sperm target center point coordinates in consecutive frames.
[0016] The consistency score for the movement direction is determined by comparing the difference between the movement direction of the sperm's historical trajectory and the direction of the sperm detection box in the current frame, thereby avoiding erroneous swapping of sperm trajectories.
[0017] The speed consistency score is calculated by comparing the average speed of sperm in the historical trajectory with the current frame speed to assess changes in sperm motility and avoid matching errors caused by speed abnormalities.
[0018] The color consistency score is determined by analyzing the similarity of the color histograms within the sperm detection boxes of consecutive frames to assess sperm identity consistency.
[0019] The trajectory continuity score is calculated by using particle filtering to predict the sperm position and the deviation between the current frame detection box, thereby evaluating the continuity and stability of the sperm trajectory to support the generation of continuous temporal trajectories.
[0020] Preferably, the target detection model in step S2 adopts the YOLOv8_OBB detection model, which includes a backbone network, a feature fusion layer, and a detection head;
[0021] The backbone network is used to extract multi-scale features from sperm images;
[0022] The feature fusion layer connects the backbone network and the detection head, and is used to perform bidirectional fusion of the multi-scale feature maps to output a fused feature map.
[0023] The detection head is used to predict the fused feature map to obtain the center coordinates, width, height, and rotation angle of each sperm.
[0024] Preferably, when training the YOLOv8_OBB detection model in step S2, the joint loss function of CIoU and DFL is used for training;
[0025] The CIoU loss function The expression is:
[0026] ;
[0027] ;
[0028] In the formula, Represents the intersection and union of sets; This represents the distance between the center points of the target bounding box and the predicted bounding box; This represents the diagonal distance of the smallest bounding rectangle; Indicates the correction factor; and These represent the width and height of the actual target bounding box, respectively. and These represent the width and height of the prediction box, respectively;
[0029] The DFL loss function The expression is:
[0030] ;
[0031] In the formula, and These represent the output predicted value and the nearest neighbor predicted value, respectively. This represents the actual value of the label; and These represent the probabilities of the two positions closest to the actual value of the label, one to the left and one to the right.
[0032] Preferably, the motion direction consistency score The expression is:
[0033] ;
[0034] In the formula, This represents the average direction and angle of sperm trajectory. No. Frame relative to the first The motion direction angle of the frame, and N represents the total number of frames in the entire video.
[0035] Preferably, the method for calculating sperm motility parameters based on each non-sealed trajectory and unique identifier in step S5 includes:
[0036] Step S5.1: Based on the position information of each sperm in the continuous frame, calculate its curve velocity VCL, which is the total length of the sperm head along the movement trajectory divided by the movement time;
[0037] Step S5.2: Calculate its linear velocity VSL, which is the linear distance between the sperm head in the starting frame and the current frame divided by the motion time;
[0038] Step S5.3: Calculate the linearity LIN of motion based on the ratio of VCL to VSL;
[0039] Step S5.4: Calculate the continuous trajectory of each sperm to obtain numerical motion parameters that can be used for sperm classification or subsequent analysis.
[0040] Preferably, the multi-dimensional feature fusion scoring system is implemented through a dynamic weighted fusion strategy, wherein the weight of each feature score is dynamically adjusted according to the spatial distance between the sperm candidate point and the historical trajectory point, and the weighted comprehensive matching score is combined with the sperm position predicted by particle filtering, so as to select the optimal historical trajectory and associate it with the current sperm candidate point during the target matching process, thereby forming a continuous sperm time-series trajectory and maintaining the consistency of sperm identity.
[0041] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the program to implement the steps of the above method.
[0042] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0043] The beneficial effects of the present invention include at least the following:
[0044] 1. The multi-dimensional feature fusion scoring system proposed in this invention comprehensively weights sperm position, direction of movement, speed, color, and trajectory continuity to achieve accurate matching of sperm targets in adjacent frames. This method is particularly suitable for sperm-dense scenarios, effectively avoiding mismatches and trajectory breaks by integrating multi-dimensional features, ensuring the continuity and uniqueness of each sperm trajectory, and providing reliable technical support for motion trajectory analysis;
[0045] 2. This invention proposes a trajectory archiving method for stationary or low-motility sperm. Stationary sperm are identified through multi-frame historical trajectory analysis, and their participation is dynamically excluded during subsequent matching. This method avoids interference from stationary sperm in matching motile sperm, eliminates trajectory splitting and duplicate counting, and retains stationary sperm data for statistical analysis, improving the accuracy of motility index calculation.
[0046] 3. This invention combines particle filter prediction with a dynamic weighted fusion strategy to achieve sperm matching. The spatial distance between candidate sperm points and historical trajectories is used for near-distance and far-distance weight allocation, and trajectory association is performed based on the particle filter prediction location. This method can maintain trajectory continuity and ensure the consistency of identity for each sperm trajectory even when sperm are moving rapidly, obstructed, or changing direction.
[0047] 4. This invention can handle high-density, multi-target, and frequently appearing or disappearing sperm. Through multi-dimensional feature scoring, dynamic weighting, and sealing processing strategies, it automatically selects the optimal matching path to achieve independent and continuous tracking of each sperm. This method ensures that sperm trajectories are not disturbed in complex scenarios, supports sperm motility typing, motility parameter analysis, and assisted reproductive technology applications, and provides technical support for the stable operation of the system. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention;
[0049] Figure 2 This is a schematic diagram of sperm training images according to an embodiment of the present invention;
[0050] Figure 3 This is a schematic diagram of the feature fusion layer structure according to an embodiment of the present invention;
[0051] Figure 4 This is a schematic diagram illustrating a mismatch between motile sperm during an encounter, according to an embodiment of the present invention.
[0052] Figure 5 This is a schematic diagram illustrating the intersection and union set solution calculation according to an embodiment of the present invention;
[0053] Figure 6 This is a schematic diagram illustrating the application of intersection and union scoring in an embodiment of the present invention;
[0054] Figure 7 This is a schematic diagram illustrating a matching error that occurs when a motile sperm encounters a non-motile sperm, according to an embodiment of the present invention.
[0055] Figure 8 This is a schematic diagram of the sealed static sperm according to an embodiment of the present invention;
[0056] Figure 9 This is a schematic diagram showing the selected area of sealed, stationary sperm according to an embodiment of the present invention;
[0057] Figure 10 This is a partially obscured schematic diagram of sperm in an embodiment of the present invention;
[0058] Figure 11 This is a schematic diagram illustrating the sudden disappearance and reappearance of sperm trajectory in an embodiment of the present invention. Detailed Implementation
[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0060] like Figure 1 As shown, this embodiment of the invention provides an automatic sperm detection and tracking method, including the following steps:
[0061] Step S1: Process the sperm image, rotate the bounding box annotation of the sperm head and tail, and generate a training set containing the center point coordinates, width, height and rotation angle.
[0062] Specifically, the data used in this embodiment is sperm video data captured by a sperm quality analyzer, with each frame of the video extracted. To simplify the processing flow and fully utilize the advantages of grayscale images, relevant functions from the OpenCV library are used to convert the images to grayscale and improve their contrast, thereby enhancing the training and inference capabilities of the subsequent model.
[0063] When creating a sperm dataset, such as Figure 2 As shown, the roLabelImg location annotation software tool was used to annotate the preprocessed image. A normal sperm morphology typically includes a head, neck, midpiece, principal segment, and terminal segment. Since the terminal segment of a sperm is difficult to observe with an optical microscope, it can be considered that a sperm is composed of a head, neck, tail, midpiece, and principal segment. During the creation of the training dataset, the sperm head and the portion of the tail connecting the head in the image were annotated.
[0064] The bounding boxes for sperm are rotated to introduce sperm head orientation parameters into the training dataset. An Oriented Bounding Box (OBB) is a bounding box definition method that can more accurately encompass targets at any angle in an image. The definition of a rotated bounding box consists of five parameters: center point coordinates... ,width ,high and rotation angle The rotation angle is usually defined in or Between. This embodiment uses the long side definition method, taking the long side of the bounding box as a reference, and determines the orientation of the object by defining the rotation angle of the border relative to the long side.
[0065] The sperm images were rotated and bounding boxes were labeled using the roLabelImg software. The generated dataset was an XML file, which saved the center point coordinates. The model requires input of a dataset with the coordinates of all four vertices, including height, width, and rotation angle. Therefore, the generated XML file needs to be converted. The specific steps are as follows:
[0066] 1) Calculate the coordinates of the four vertices of the object in a state without rotation.
[0067] 2) Calculate the coordinates of the rotated vertices based on the geometric transformation of the rotation matrix.
[0068] By following the steps above, a dataset with the four vertices of a rotated bounding box is obtained.
[0069] Step S2: Use the training set to train the target detection model and generate a model that can automatically detect sperm and output a rotated bounding box.
[0070] The target detection model described in this embodiment of the invention uses a model that supports rotating bounding box annotation and detection, including but not limited to the YOLOv5_OBB model, the YOLOv8_OBB model, and the YOLOv11_OBB model.
[0071] In recent years, with the rapid development of computer technology, deep learning has also made significant breakthroughs in the field of medical image analysis, especially in sperm detection and analysis, demonstrating enormous potential. Traditional sperm detection methods often rely on manual observation and basic image processing techniques, while the introduction of deep learning provides strong support for automated and precise detection. Convolutional Neural Network (CNN)-based models in sperm detection can be divided into two categories: one is the "two-stage model" represented by RCNN, which has high detection accuracy but relatively slow inference speed; the other is the "one-stage model" represented by YOLO, which, although slightly less accurate, is fast and suitable for real-time sperm analysis. Regardless of the type of deep learning model, its core task is to accurately locate sperm in microscopic images, analyze their movement trajectory and morphological characteristics, and classify them. Therefore, these models also rely on techniques such as Intersection over Union (IoU) to evaluate detection accuracy, providing a scientific basis for subsequent analysis and screening.
[0072] To address the inefficiencies and low accuracy of traditional sperm detection methods, which typically rely on manual operation and observation, especially when processing a large number of targets simultaneously, leading to cumbersome procedures and increased error rates, this invention proposes an improved YOLOv8_OBB model based on existing networks. This model combines the YOLOv8 model with a sperm trajectory detection method based on a multi-feature fusion scoring system to detect and track sperm images under a microscope. This method enables rapid and accurate identification of sperm targets under complex backgrounds and motion conditions, achieving efficient trajectory tracking. This not only improves the accuracy and efficiency of sperm detection but also provides reliable data support for subsequent reproductive medicine research.
[0073] The following explanation uses the YOLOv8_OBB model, which is used for training and subsequent tracking processing.
[0074] As another implementation method, this embodiment also makes the following improvements to the YOLOv8_OBB model, aiming to improve the accuracy and efficiency of sperm target detection and tracking. Its network structure includes the following key parts:
[0075] Network module overview: It includes a backbone, a feature fusion layer, and a detection head, which can efficiently extract multi-scale features and achieve accurate sperm detection through rotated bounding box (OBB) prediction.
[0076] CIoU Loss and DFL Loss: By improving the CIoU loss function and DFL loss function, the accuracy and stability of bounding box regression are improved, thereby enhancing the overall target detection performance.
[0077] Rotated bounding box detection: Using the rotated bounding box (OBB) annotation method can more accurately wrap targets at any angle in the image, improving detection accuracy and tracking performance.
[0078] In this embodiment, the YOLOv8_OBB backbone network, based on a convolutional neural network (CNN), is responsible for extracting multi-scale features from the input image. This part inherits the lightweight design of YOLOv8, achieving efficient feature extraction through multi-layer convolutional operations, residual blocks, and pooling operations. Convolutional layers capture local features of the image by sliding convolution kernels; low-level convolutions extract details such as edges and corners, while high-level convolutions capture abstract semantic information of the target. Pooling layers reduce the spatial size of the feature map through downsampling, lowering computational complexity and the number of parameters, thereby improving the model's efficiency and generalization ability.
[0079] The feature fusion layer (Neck) acts as a bridge in the entire network structure, connecting the backbone network and the detection head. Its main responsibility is to fuse feature maps of different scales extracted from the backbone network, ensuring the model can simultaneously handle large, small, and rotating targets. Figure 3 As shown, Neck employs a combination of Feature Pyramid Network (FPN) and Path Aggregation Network (PAN) to improve multi-scale detection and feature accuracy. FPN combines high-level semantic information with low-level detail information via a top-down path, while PAN further enhances the transmission of feature information flow via a bottom-up path. This bidirectional information transmission path ensures mutual influence of feature maps at different levels, thereby improving detection accuracy.
[0080] The YOLOv8_OBB detection head in this embodiment is similar to YOLOv8, but adds a rotated bounding box (OBB) prediction mechanism. The detection head, based on a combination of convolutional and fully connected layers, transforms the feature map into a prediction result. The output includes the center coordinates, width, height, and rotation angle of the target. The rotation angle regression is achieved through convolutional layers, and the predicted angle typically ranges within a certain range. or This design allows the model to adapt to targets at various angles, improving detection accuracy and tracking performance.
[0081] As an example, as another implementation, training is performed using CIoU loss and DFL loss.
[0082] The CIoU loss function in this embodiment improves upon the traditional IoU loss by considering the complete intersection between bounding boxes and introducing a correction factor to more accurately measure the similarity between them. CIoU loss introduces concepts such as the minimum bounding rectangle of the labeled and predicted boxes, the diagonal length of the minimum bounding rectangle, and the distance between the center points of the labeled and predicted boxes, thus better describing the intersection of the labeled and predicted boxes. The formula for calculating CIoU loss is as follows:
[0083] ;
[0084] In the formula, Represents the intersection and union of sets. The distance between the center points of the target box and the predicted box. The distance between the diagonals of the minimum bounding rectangle. This is a correction factor used to further adjust the loss function, taking into account the shape and orientation of the target box. The specific calculation method is as follows:
[0085] ;
[0086] in and These are the width and height of the actual target bounding box. and These are the width and height of the prediction box.
[0087] The calculation method of CIoU loss function is more complex than that of traditional IoU. It takes into account multiple factors such as position, shape and orientation, so that the model can learn the features of the target box more comprehensively, which helps to improve the performance of the model in complex scenes.
[0088] The DFL loss function models the bounding box location as a probability distribution rather than a single deterministic value, allowing the network to focus more quickly on distributions close to the target location. The formula for calculating the DFL loss is as follows:
[0089] ;
[0090] in and This represents the network's output predicted value and its nearest neighbor predicted value. The actual value of the label. , These represent the probabilities of the two positions closest to the actual label value, one to the left and one to the right, respectively, as in ltrb. When making a prediction, if the actual If it is 9.3, then It is 9.3. It is 9. The value is 10. For model prediction The probability of being 9, For model prediction The probability is 10. By using DFL as the loss function, the probability of the two positions closest to the label (left and right) is optimized in the form of cross-entropy, allowing the network to focus on the distribution of the target location and its neighborhood more quickly.
[0091] Step S3: Use the trained model to detect sperm video images and obtain the sperm rotation bounding box for each frame, which includes the position, orientation and size of the sperm.
[0092] Step S4: Match sperm targets in adjacent frames and evaluate the reliability of the match using a multi-dimensional feature fusion scoring system, which includes positional consistency, movement direction consistency, speed consistency, color consistency, and trajectory continuity. The scores are then weighted and fused according to preset weights to generate a comprehensive matching score. Based on this score, sperm targets in consecutive frames are associated to generate a continuous temporal trajectory and a unique identifier for each sperm. The continuous temporal trajectory and unique identifier can be used to calculate the sperm's motility parameters.
[0093] In order to further enhance the performance of the system, this invention combines sperm detection and tracking functions. The invention designs a multi-dimensional feature fusion scoring system to achieve real-time, multi-target tracking of sperm in dynamic video streams and to distinguish sperm in static and near-static states.
[0094] The multi-dimensional feature fusion scoring system proposed in this invention is a comprehensive evaluation mechanism that utilizes multiple features of sperm during motility to assess and match sperm trajectories. This method quantifies the similarity and matching degree between sperm detection frames through multiple scoring dimensions, thereby achieving accurate tracking of sperm motility trajectories.
[0095] In practice, it has been found that when sperm meet, their subsequent trajectories may exchange, such as... Figure 4 As shown, the purple and green trajectories were swapped, resulting in incorrect trajectory information. Both sperm no longer moved in a straight line, and the distance between the starting and ending points of the sperm trajectories decreased. When calculating the curvilinear velocity VCL and the linear velocity VSL, VCL will be calculated with an error, and VSL will become smaller. Because VSL is smaller, LIN will have a larger error when calculating the linearity of movement LIN=VSL / VCL, which will have a greater impact on subsequent classification. It may classify forward-moving sperm as non-forward-moving sperm.
[0096] Therefore, this system evaluates the accuracy of matching reliability through a multi-dimensional feature fusion scoring system. The multi-dimensional feature scoring system includes position consistency score, movement direction consistency score, velocity consistency score, color consistency score, and trajectory continuity score. Each score is weighted and fused according to preset weights to generate a comprehensive matching score. Based on this score, sperm targets in consecutive frames are associated to generate a continuous temporal trajectory and a unique identifier for each sperm. The continuous temporal trajectory and unique identifier can be used to calculate the sperm's motility parameters.
[0097] Step S4.1: Calculate the positional consistency score. In this embodiment, the positional consistency score is used to assess the degree of difference in the coordinates of the sperm target center point between consecutive frames, and to quantify the degree of sperm position matching. In practice, the methods used include, but are not limited to, spatial deviation and intersection-over-union (IoU) value evaluation.
[0098] IoU (Intersection over Union) is a performance metric used to evaluate the accuracy of annotation, segmentation, and object detection algorithms. This method was introduced to accurately assess the overlap of sperm detection boxes between consecutive frames. Figure 5 As shown, this metric is measured by quantifying the degree of overlap between the sperm detection box in the later frame and the sperm detection box in the previous frame.
[0099] The Intersection over Union (IoU) is calculated by dividing the area of the intersection of the sperm detection bounding boxes in the later frame by the area of their union. The formula for IoU can be expressed as:
[0100] ;
[0101] A higher IoU value indicates better alignment between the detection boxes in the later frame and the previous frame, increasing the likelihood that the two boxes belong to the same sperm, and reflecting a more accurate model. When two bounding boxes do not overlap, the IoU is 0. When two bounding boxes completely overlap, the IoU is 1. We can set a threshold for IoU; when the calculated IoU value is greater than the set threshold, the two boxes are considered to belong to the same sperm. Figure 6 As shown, the position information of each sperm detection box is first obtained in the previous frame image, and the sperm are divided into 1, 2, 3, and 4. Then, combined with the position of each sperm detection box in the subsequent frame image, the IoU score is performed on each detection box in the previous frame and each detection box in the subsequent frame. The score value is used to determine whether they belong to the same sperm.
[0102] In the scoring system, especially in matching scenarios where the sperm detection frames are far apart, the importance of the IoU score is appropriately increased to ensure that different sperm targets can still be effectively distinguished even when the detection frame position is significantly offset.
[0103] Step S4.2: Calculate the motion direction consistency score. In high-density semen samples, severe occlusion between sperm makes them difficult for high-performance detection models to fully identify. In these abnormal situations, it is often necessary to rely on subsequent image frames to re-detect those sperm that were initially missed, or to re-identify those sperm that are detected again, leading to frequent changes in sperm IDs. To maintain tracking accuracy and trajectory consistency in the event of detection failure, we introduce a motion direction consistency score. By comparing the motion direction of the historical sperm trajectory with the direction of the sperm detection box in the current frame (i.e., the motion direction consistency), we determine the degree of consistency in the sperm motion direction and avoid erroneous exchange of sperm trajectories.
[0104] In this embodiment, the consistency of sperm motility direction is measured by calculating the average angle of the sperm trajectory and comparing it with the angle of the detection box in the current frame. A higher score indicates greater consistency in motility direction. The expression is:
[0105] ;
[0106] In the formula, No. Frame relative to the first The motion direction angle of the frame, and N represents the total number of frames in the entire video.
[0107] The consistency score for sperm motility direction maintains tracking accuracy and trajectory coherence even in cases of detection failure. It measures the consistency of sperm motility direction. By calculating the average angle of the sperm trajectory and comparing it to the angle of the detection box in the current frame, a higher score indicates a more consistent trajectory direction, thus achieving correct trajectory connection.
[0108] Step S4.3: Calculate the velocity consistency score. In this embodiment of the invention, the velocity score is calculated by analyzing the historical trajectory of sperm, calculating the average motility velocity, and comparing it with the velocity change in the current detection frame to evaluate changes in sperm motility. The smaller the velocity change, the higher the score, thereby verifying the rationality of the match and avoiding erroneous matches caused by sudden velocity changes or abnormalities.
[0109] Step S4.4: Color Histogram Similarity Scoring assesses sperm color consistency during motility by calculating the similarity of color distribution within the detection boxes in consecutive frames. The code uses Bhattacharyya distance. This is used to quantify the difference between two color histograms. If the color histograms of two image regions are similar, their Bhattacharyya distance will be small, indicating that their color distributions are similar; the smaller the distance, the higher the similarity. Therefore, when assessing the color consistency of sperm during motility, a smaller Bhattacharyya distance means that the color distribution of sperm is more similar in consecutive frames, thus helping to confirm that they are the same sperm. The solution formula is shown below:
[0110] ;
[0111] in, The color histogram of the target model. For the target color histogram of the current frame, This represents the total number of pixels in the histogram or the normalization factor.
[0112] Step S4.5: Calculate the trajectory continuity score. In this embodiment, the deviation between the sperm position predicted by particle filtering and the detection box in the current frame is used to evaluate the continuity and stability of the sperm trajectory, so as to support the generation of continuous temporal trajectories.
[0113] Specifically, for sperm whose identity cannot be determined, their position is predicted using linear motion velocity and average motion angle to complete the identity matching:
[0114] ;
[0115] in, This represents the predicted location of the k-th sperm in frame t. It is the x-coordinate of the k-th sperm in the (t-1)-th frame. It is the ordinate of the k-th sperm in the (t-1)-th frame. It is the linear velocity of the k-th sperm in the (t-1)-th frame. It is the average motion angle of k sperm in frame t-1.
[0116] Meanwhile, in high-density sperm samples, a coarse distance score was added to the scoring system to effectively narrow down the possible matching range. This score calculates the distance between the current detection frame and each sperm in the previous frame; shorter distances receive higher scores, playing a basic screening role in the matching process.
[0117] To further improve the accuracy and robustness of sperm target matching, this invention dynamically employs different feature weighting fusion strategies based on the spatial distance between sperm candidate points and historical trajectories. Specifically, this includes:
[0118] Near-distance weighting: When the spatial distance between a candidate point and a historical trajectory point is within a preset near-distance threshold, the following near-distance weighting scheme is adopted. In this scheme, the weights are adjustable parameters and are weighted according to relative ratios:
[0119] For location consistency scoring, the IoU feature weight is set to 0.6;
[0120] For color consistency scoring, the feature weight for appearance similarity (Bhattacharyya distance) is set to 0.2;
[0121] For the consistency score of motion direction, the weight of the angle similarity feature is set to 0.4;
[0122] For trajectory continuity scoring, the trajectory distance feature weight is set to 0.3;
[0123] For speed consistency scoring, the speed feature weight is set to 0.4.
[0124] Long-distance weighting: When the spatial distance between a candidate point and a historical trajectory point exceeds the short-distance threshold, the following long-distance weighting scheme is adopted. In this scheme, the weights are adjustable parameters, weighted according to relative ratios:
[0125] For location consistency scoring, the IoU feature weight is set to 0.45;
[0126] For color consistency scoring, the feature weight for appearance similarity (Bhattacharyya distance) is set to 0.2;
[0127] For the consistency score of motion direction, the weight of the angle similarity feature is set to 0.4;
[0128] For trajectory continuity scoring, the trajectory distance feature weight is set to 0.3;
[0129] For speed consistency scoring, the speed feature weight is set to 0.2.
[0130] The above weight allocation scheme can be flexibly adjusted according to actual application needs. Each feature score is denoted as a score. k The final score is a weighted sum of the scores of each feature and their corresponding weights. By dynamically adjusting the weight distribution of each feature, adaptive matching optimization for sperm targets under different motion states is achieved, effectively improving the overall recognition and tracking performance of the system.
[0131] In sperm tracking and identification, relying solely on spatial distance or appearance features for target matching is susceptible to interference from occlusion, deformation, and changes in lighting, leading to sperm trajectory loss or identity switching. Therefore, as an alternative implementation, this embodiment proposes a sperm matching method that integrates particle filter prediction and multi-feature scoring. By combining dynamic prediction of historical trajectories and multi-dimensional feature scoring for each detected sperm candidate point in each frame, highly robust sperm identification tracking is achieved.
[0132] For each tracked sperm, a set of particles and corresponding weights are maintained to describe its possible motion states. At the arrival of each frame, Gaussian noise is first added to each particle to simulate the uncertainty of sperm motion, and the currently detected sperm position is expanded to match the particle state dimension. The predicted sperm position is obtained by weighted averaging of the states of all particles. The calculation formula is as follows:
[0133] ;
[0134] Among them, w i p is the weight of the i-th particle. i Let represent the state of the i-th particle.
[0135] Particle filtering effectively estimates the most probable location of sperm in the current video frame and evaluates the deviation between the predicted and actual detected locations. Smaller deviations indicate higher prediction accuracy. Therefore, in close-matching scenarios, particle filtering predictions are given higher weight because this method effectively captures subtle sperm movements across consecutive video frames.
[0136] Based on the spatial distance between the sperm and the detection point, different feature weights (near distance / far distance weights) are dynamically selected, and the final total score is:
[0137] ;
[0138] in, The weights of each feature, Score each feature. This represents the particle filter prediction score.
[0139] Step S5: Calculate sperm motility parameters based on each non-sealed trajectory and its unique identifier.
[0140] Sperm tracking is used to better calculate sperm motility indicators. The classification criteria for sperm motility are shown in Table 1.
[0141] Table 1
[0142]
[0143] Methods for calculating sperm motility parameters based on each non-sealed trajectory and unique identifier include:
[0144] Step S5.1: Based on the position information of each sperm in the continuous frame, calculate its curve velocity VCL, which is the total length of the sperm head along the movement trajectory divided by the movement time;
[0145] VCL represents curvilinear velocity, measured in µm / s. It is calculated by measuring the total length L of the sperm head along its trajectory in a two-dimensional plane and then dividing it by the movement time T, i.e., VCL = L / T.
[0146] Step S5.2: Calculate its linear velocity VSL, which is the linear distance between the sperm head in the starting frame and the current frame divided by the motion time;
[0147] VSL stands for linear velocity, measured in µm / s. It is calculated by dividing the linear distance R between the sperm head's initial and final positions by the movement time T, i.e., VSL = R / T.
[0148] Step S5.3: Calculate the linearity LIN of motion based on the ratio of VCL to VSL;
[0149] LIN = VSL / VCL, observe whether the sperm move in a straight line to classify sperm into forward-moving sperm (PR), non-forward-moving sperm (NP), and completely immobile sperm (IM).
[0150] Calculate the total number of sperm N. If the model detection accuracy is high, the number of sperm detected by the model can be considered equal to the actual number of sperm. Therefore, the number of sperm is taken as the average number of sperm detected by the YOLO model in the last 10 frames.
[0151] Then, divide the number of sperm of each type (PR, NP, IM) by the total number of sperm N to obtain the ratio.
[0152] Step S5.4: Calculate the continuous trajectory of each sperm to obtain numerical motion parameters that can be used for sperm classification or subsequent analysis.
[0153] To better calculate the metrics, we need to obtain the complete and accurate trajectory of each sperm, that is, the position of the sperm in each frame. To obtain the complete trajectory of a sperm, we need to correctly identify and match the same sperm between consecutive frames. However, many problems are often encountered in the process of obtaining sperm trajectories:
[0154] 1) A mismatch occurs when a motile sperm encounters a non-motile sperm.
[0155] like Figure 7 As shown in the figure, the trajectory changes from pink to purple, indicating a matching error. The same sperm generated two trajectories. If both trajectories are considered as motile sperm, the number of motile sperm will be one more than the actual number, meaning the number of forward (PR) sperm will increase by one. Subsequently, when calculating the ratio using the formula PR / N, the PR index will be too high, which is incorrect.
[0156] To eliminate this error, a method of sealing stationary sperm was used. During the tracking process, sperm with excessively slow speed or minimal positional movement were considered stationary and sealed. After sealing, the location was treated as if there were no sperm there. Thus, when motile sperm approached, they would ignore the stationary sperm, preventing matching errors. Figure 8 As shown in the figure, the red box represents the sealed, quiescent sperm.
[0157] Accurately distinguishing between quiescent and motile sperm is crucial in automated sperm tracking and motility analysis. If quiescent sperm cannot be effectively identified, the system may repeatedly count the same quiescent target as a new target, leading to an inflated total sperm count, distorted motility parameter analysis, and even affecting subsequent motility classification and medical diagnosis.
[0158] In step S5, the sperm trajectories generated in step S4 are determined to be either stationary or in a low-activity state, based on the velocity and maximum displacement of the most recent N frames. Trajectories determined to be stationary or in a low-activity state are archived, excluding them from subsequent matching logic, but their detection data is retained for filtering in subsequent matching. Matching is only performed on non-archived trajectories, thereby preventing stationary sperm from interfering with the generation of motile sperm trajectories. In this invention, for sperm trajectories determined to be stationary or in a low-activity state, an archiving process is used instead of simple filtering. This technique can prevent stationary sperm from interfering with the matching of motile sperm trajectories, ensuring the continuity and uniqueness of motile sperm trajectories, thereby preventing trajectory splitting, duplicate counting, or deviations in motility index calculation.
[0159] This method realizes the robust discrimination of stationary sperm by statistically analyzing the motion characteristics of each sperm trajectory in multiple consecutive frames, comprehensively considering two indicators: average velocity and maximum displacement. In this embodiment, the window length is set to N, and the typical value is processed within 10 frames. The specific steps are as follows:
[0160] (1) Trajectory window extraction: For each sperm trajectory, extract the historical position points of its last N frames , denoted as:
[0161] ;
[0162] (2) Average velocity calculation: Calculate the average velocity velocity between adjacent frames within this window:
[0163] ;
[0164] (3) Maximum displacement calculation: Calculate the maximum displacement max_disp of all points within the window relative to the starting point:
[0165] ;
[0166] (4) Stationary discrimination condition: Set the stationary velocity threshold static_velocity_threshold and the maximum displacement threshold max_disp_threshold. When and only when velocity < static_velocity_threshold and max_disp < max_disp_threshold, this sperm trajectory is determined to be a stationary sperm, as Figure 9 shown by the box selection.
[0167] The sperm trajectories determined to be stationary will be specially marked and filtered during the target detection and matching process of subsequent frames to prevent duplicate counting and false matching. This method can effectively identify and isolate stationary sperm in a complex motion environment, greatly improving the accuracy of sperm tracking and motility analysis and the automation level of the system, providing a solid data foundation for subsequent sperm motility typing, quantity statistics and related medical research.
[0168] In this embodiment, sperm trajectories determined to be stationary or in a low-activity state are archived instead of simply filtered. This invention analyzes the motion characteristics of sperm historical trajectories across multiple consecutive frames, including average velocity and maximum displacement, to determine whether a sperm is in a stationary or low-activity state, and marks its trajectory as archived. During target matching in subsequent frames, the archived trajectory does not participate in the matching calculation with motile sperm, but its detection data is still retained in the system for statistical or subsequent analysis. This technique avoids interference from stationary sperm in matching motile sperm trajectories, ensuring the continuity and uniqueness of motile sperm trajectories, thereby preventing trajectory splitting, duplicate counting, or deviations in motility index calculation.
[0169] 2) The sudden appearance and disappearance of sperm (going out of bounds)
[0170] In complex sperm imaging situations, there may be conditions such as... Figure 10 The sperm shown is barely visible. Because the sperm is so inconspicuous, the model may not be able to detect it in every frame, which could lead to sperm appearing out of nowhere.
[0171] like Figure 11 As shown, during tracking, the appearance of a new red trajectory could occur out of nowhere. A previous purple sperm trajectory might have been lost for a period, then re-detected, resulting in a new red trajectory. In reality, the previous and newly appearing trajectories should be counted as one sperm. Therefore, recent frame detection can be used to delete the previous purple trajectory, keeping only the current red one, thus maintaining one trajectory per sperm. If both trajectories are treated as moving sperm, the number of moving sperm will be one more than the actual number, meaning the forward (PR) sperm count will increase by one. This will lead to an overestimation of the PR index when calculating the ratio using the PR / N formula.
[0172] Disappearance occurs when sperm moves out of bounds or when sperm suddenly darkens and cannot be detected or tracked for a long time. Both of these situations will have their trajectories filtered out by the nearest frame detection.
[0173] This approach ensures that each sperm value in the graph corresponds to a trajectory, providing a correct premise for subsequent indicator calculations.
[0174] In the detection phase, this embodiment primarily uses accuracy (Accuracy, Accuracy, Precision, P), recall (Recall, R), and mean average precision (mAP) as evaluation metrics. Their calculation formulas are as follows:
[0175] ;
[0176] ;
[0177] ;
[0178] ;
[0179] ;
[0180] Defined in object detection (True Positive) means that the predicted value is the same as the true value, which is a positive sample, that is, the number of positive samples that are correctly identified; (True Negative) is the number of negative samples correctly identified, where the predicted value is the same as the true value; FP (False Positive) is the number of falsely reported negative samples, where the predicted value is a positive sample and the true value is a negative sample; FN (False Negative) is the opposite of FP, representing the number of falsely reported positive samples. The categories in the dataset; since there is only one category, therefore... It is 1. Secondly, Average Precision (AP) is represented by the formula above, with recall on the horizontal axis and precision on the vertical axis. The area enclosed by the PR curve and the two axes is AP. The Intersection over Union (IOU) of mAP is set to 0.5. To protect patient privacy, sperm data obtained from the hospital was centrifuged and tested. Five representative videos from the provided dataset were selected for testing. Table 2 below shows the YOLOv8_OBB model parameters and the statistical results of the test dataset.
[0181] Table 2
[0182]
[0183] The data results show that the YOLOv8_OBB detection head significantly improves the adaptability of the sperm detection model by adding regression prediction of rotation angle. Multi-scale detection and an efficient loss function further optimize detection accuracy and speed. Whether for complex sperm rotation trajectories or real-time detection tasks, the YOLOv8_OBB detection head provides a robust and efficient solution for sperm detection, meeting various needs in reproductive medicine research and clinical applications.
[0184] Multi-object tracking (MOT), as the name suggests, involves tracking multiple objects simultaneously within a video stream. Because it involves multiple objects, the problem of new objects entering and old objects disappearing arises, which is the biggest difference between MOT and single-object tracking algorithms. This difference leads to different tracking strategies. A commonly used strategy in multi-object tracking is TBD (Tracking by Detection). This involves detecting objects in each frame and then using the detection results for object tracking; this step is called data association. MOTA (MOT Accuracy) and MOTP (MOT Precision) are two important metrics in this tracking strategy. MOTA (Multiple Object Tracking Accuracy) is a metric that measures the accuracy of an algorithm in tracking objects. It considers three issues: false positives (FP), false negatives (FN), and ID switching, providing a comprehensive measure of tracking performance. MOTA is calculated as a weighted average of the number of missed detections, false positives, and ID changes across all frames. A higher MOTA value indicates better tracking performance, but MOTA can also be negative if the tracker's errors exceed the number of objects in the scene. MOTP (Multiple Object Tracking Precision) measures localization accuracy, focusing primarily on detector performance rather than the tracker itself. It calculates the distance between the detected target and its corresponding ground truth in each frame, using methods such as IOU or Euclidean distance. A higher MOTP value indicates better detector localization accuracy. The MOTA calculation formula is as follows:
[0185] ;
[0186] in: It refers to the sum of the false negatives of all frames, i.e., assuming If the value is a false negative in frame t, then Similarly, . This refers to the sum of the actual number of targets in all frames, that is, assuming there are targets in frame t. One goal, then ; This refers to the number of jumps that occur across all frame targets. Let be the target jump number in frame t, then .
[0187] The MOTP calculation formula is as follows:
[0188] ;
[0189] in, This represents the number of matches in frame t; the matching error is calculated for each match. , indicating the target in frame t The distance between its paired hypothetical location and the location.
[0190] The statistical results of the tracking data from the test video are shown in Table 3.
[0191] Table 3
[0192]
[0193] In summary, the sperm target detection and tracking technology provided by this invention aims to significantly improve the accuracy and automation level of sperm motility analysis. It efficiently identifies and locates sperm targets in sperm images, accurately capturing key information such as their position and direction of movement. Furthermore, in the field of sperm target tracking, it innovatively proposes a sperm trajectory detection method that integrates a multi-feature scoring system, encompassing multiple advanced technologies such as IoU scoring, color histograms, Bhattacharyya distance, and Bayesian estimation-based particle filtering, achieving accurate tracking of sperm movement trajectories.
[0194] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the program to implement the steps of the above method.
[0195] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0196] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described; only preferred embodiments of the present invention are illustrated. The descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. As long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0197] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this invention should be determined by the appended claims.
Claims
1. A method for automated sperm detection and tracking, characterized in that: The method comprises the following steps: Step S1: processing the sperm image, rotating the boundary box of the sperm head and tail, and generating a training set containing the center point coordinates, width, height and rotation angle; Step S2: training the target detection model using the training set to generate a model capable of automatically detecting sperm and outputting a rotating boundary box; Step S3: using the trained model to detect the sperm video image, obtaining the rotating boundary box of each frame of sperm, including the position, orientation and size of the sperm; Step S4: matching the sperm targets of adjacent frames, evaluating the matching reliability through a multi-dimensional feature fusion scoring system, the multi-dimensional feature fusion scoring system comprising position consistency, motion direction consistency, speed consistency, color consistency and trajectory continuity; weighting and fusing each score according to a preset weight to generate a comprehensive matching score, and associating the sperm targets of the previous and subsequent frames according to the score to generate the continuous time sequence trajectory and unique identification of each sperm, which can be used to calculate the motion parameters of the sperm; Step S5: determining whether the sperm trajectory generated in step S4 is in a stationary or low-activity state, determining the speed and maximum displacement based on the last N frames; performing archiving processing on the trajectory of the sperm determined as stationary or low-activity, excluding it from participating in matching in the subsequent matching logic, but retaining its detection data for filtering in the subsequent matching, and only performing matching in non-archived trajectories, thereby avoiding the interference of stationary sperm with the generation of motion sperm trajectories; and calculating the motion parameters of the sperm based on each non-archived trajectory and unique identification.
2. The method of claim 1, wherein: The method for determining whether the sperm is in a stationary or low-activity state in step S5 is: statistically analyzing the motion features of multiple consecutive frames within a window length N of each sperm trajectory, extracting the historical position points of the last N frames, calculating the average speed of adjacent frames within the window and the maximum displacement of all points within the window relative to the starting point, and when both the average speed and the maximum displacement are lower than the set threshold, determining the sperm trajectory as stationary or low-activity and marking it as an archived state, which is excluded from participating in matching in the subsequent frame matching logic.
3. The automatic sperm detection and tracking method according to claim 1, wherein, The multi-dimensional feature fusion scoring system is used for matching and trajectory generation of sperm targets in consecutive video frames, and the multi-dimensional feature scoring comprises: position consistency score, motion direction consistency score, speed consistency score, color consistency score and trajectory continuity score. The position consistency score is obtained by evaluating the spatial deviation or intersection over union (IoU) value of the center point coordinates of the sperm targets in the previous and subsequent frames to quantify the matching degree of the sperm position; The motion direction consistency score is obtained by comparing the difference between the motion direction of the sperm historical trajectory and the direction of the sperm detection box in the current frame to determine the consistency degree of the sperm motion direction, thereby avoiding the wrong exchange of sperm trajectories; The speed consistency score is obtained by calculating the difference between the average speed of the sperm in the historical trajectory and the speed of the current frame to evaluate the change in the motion state of the sperm, thereby avoiding matching errors caused by abnormal speed; The color consistency score is obtained by analyzing the similarity of the color histogram within the sperm detection box in the previous and subsequent frames to determine the identity consistency of the sperm. The trajectory continuity score is obtained by predicting the sperm position by particle filtering and deviating from the current frame detection box, evaluating the continuity and stability of the sperm trajectory, to support continuous time trajectory generation.
4. The method of claim 1, wherein: The target detection model in step S2 adopts a YOLOv8_OBB detection model, which includes a backbone network, a feature fusion layer, and a detection head. The backbone network is configured to extract multi-scale features of the sperm image. The feature fusion layer is connected to the backbone network and the detection head, and is configured to perform bidirectional fusion on the multi-scale feature maps and output fused feature maps. The detection head is configured to predict the fused feature maps to obtain the center coordinates, width, height, and rotation angle of each sperm.
5. The method of claim 4, wherein: When training the YOLOv8_OBB detection model in step S2, a CIoU and DFL joint loss function is used for training. The CIoU loss function The expression is: ; ; In the formula, represents the intersection set; represents the distance between the center points of the target frame and the predicted frame; represents the diagonal distance of the minimum circumscribed rectangle; represents the correction factor; and respectively represent the width and height of the real target frame; and respectively represent the width and height of the predicted frame; The DFL loss function The expression is: ; In the formula, and respectively represent the output predicted value and the neighboring predicted value; represents the actual value of the label; and respectively represent the probability of the left and right positions closest to the actual value of the label.
6. The method of claim 3, wherein: The motion direction consistency score The expression is: ; wherein The The motion direction angle of the frame relative to the first frame, while N represents the total number of frames of the entire video.
7. The method of claim 1, wherein: The method for calculating sperm motion parameters based on each non-occluded trajectory and unique identifier in step S5 includes: Step S5.1: According to the position information of each sperm in the continuous frames, the curve velocity VCL of the sperm head along the motion trajectory is calculated, i.e., the total length of the motion trajectory divided by the motion time. Step S5.2: Calculate the straight-line velocity VSL, i.e., the straight-line distance between the sperm head in the starting frame and the current frame divided by the motion time. Step S5.3: Calculate the motion linearity LIN according to the ratio of VCL and VSL. Step S5.4: Calculate the continuous trajectory of each sperm to obtain numerical motion parameters that can be used for sperm classification or subsequent analysis.
8. The method of claim 3, wherein the method further comprises: The multi-dimensional feature fusion scoring system is realized through a dynamic weighting fusion strategy, wherein the weight of each feature score is dynamically adjusted according to the spatial distance between the sperm candidate point and the historical trajectory point, and the weighted comprehensive matching score is combined with the particle filtering predicted sperm position to select the optimal historical trajectory and the current sperm candidate point for association in the target matching process, thereby forming a continuous sperm time trajectory and maintaining the consistency of the sperm identity.
9. An electronic device, comprising: A computer program is stored in the memory, and the processor executes the program to realize the steps of the method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the memory, and the processor executes the program to realize the steps of the method according to any one of claims 1-8.
Citation Information
Patent Citations
Method and system for rapidly detecting remains
CN104881643A
Pedestrian tracking method based on interactive image labeling technology
CN118115949A
Method and system for determining moving / stationary state of tracking target based on neural network
US20220397671A1
Systems and methods for trajectory-based object search using edge computing
US20240386715A1
Object-level grouping and identification for tracking objects in a video
US9898677B1
Cited By
Dynamic screening and trajectory tracking method and system for accurate evaluation of sperm motility
CN121861451A
