Sperm automatic detection system and control method thereof
By combining multi-target tracking and Kalman filtering algorithms, three-dimensional compensation and multimodal image acquisition were achieved in the automated sperm detection system, solving the problems of focus loss and efficiency in existing sperm detection technologies, and realizing full-process automation and efficient batch testing of sperm.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING INST OF POPULATION & FAMILY PLANNING SCI & TECH
- Filing Date
- 2026-05-12
- Publication Date
- 2026-06-09
AI Technical Summary
Existing automated sperm detection systems are prone to defocusing under high magnification, failing to meet the efficiency requirements for large-scale clinical testing, and cannot simultaneously achieve three-dimensional positioning of sperm and real-time prediction of their movement trajectory.
A multi-target tracking algorithm is used to identify sperm motility trajectories, combined with a Kalman filter algorithm for three-dimensional compensation. The XY-axis planar motion compensation and Z-axis focusing compensation of sperm are achieved through an electric stage and an inverted high-magnification confocal lens. The entire process of sperm detection is automated by combining multimodal image acquisition and AI analysis.
It has achieved full automation of the sperm testing process, improved testing efficiency, ensured stable imaging of sperm under high magnification, supported simultaneous testing of batches of target sperm, and improved testing accuracy and clinical testing efficiency.
Smart Images

Figure CN122171541A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of cell detection technology, specifically relating to an automated sperm detection system and its control method. Background Technology
[0002] Sperm quality testing is a core component of male reproductive health assessment and a crucial basis for sperm selection in assisted reproductive technologies. Sperm quality testing primarily encompasses four core dimensions: sperm motility analysis, morphological analysis, viability testing, and acrosome integrity assessment. Specifically: sperm motility analysis requires continuous tracking of sperm movement trajectories under a wide field of view to prevent sperm from escaping the field of view; morphological analysis and acrosome integrity assessment require high-magnification microscopy (100x oil immersion microscopy and above) to clearly distinguish the microscopic structures of the sperm head, acrosome, midpiece, and tail; and viability testing typically requires fluorescence staining imaging to differentiate between live and dead sperm through staining for cell membrane integrity.
[0003] In the prior art, Chinese Patent No. CN118883551B discloses an automatic sperm detection system. This system performs motility analysis using an upright low-power microscope, and then uses planar motion compensation via an electric stage to keep the target sperm within the imaging field of view of an inverted high-power microscope for morphological analysis, thus solving the fundamental problem of motile sperm easily escaping the field of view under high magnification. However, actual experiments have verified its limitations as follows: First, it only achieves planar motion compensation along the X and Y axes, without considering the Z-axis movement of sperm within the semen fluid. This easily leads to defocusing during high-power imaging, resulting in blurred morphological images. Second, the single-sperm polling detection mode cannot meet the efficiency requirements of large-scale clinical testing. Third, the motion compensation is based solely on static coordinate conversion and does not incorporate real-time sperm trajectory prediction. For rapidly forward-moving sperm, the compensation lag time is long, and the target is easily lost under high magnification. Therefore, an improved automatic sperm detection system and its control method have been designed. Summary of the Invention
[0004] In view of the above-mentioned shortcomings in the prior art, the present invention provides an automated sperm detection system and its control method to solve the problems in the background art.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The first aspect of this invention provides a control method for an automated sperm detection system, comprising the following steps: S1. Obtain a large-field continuous bright-field image of the semen sample collected by an upright low-power microscope. Identify all sperm in the field of view through a multi-target tracking algorithm, generate the initial movement trajectory of each sperm, determine the motility grade of all sperm based on the initial movement trajectory, and determine the target sperm set to be detected based on the sperm motility grade. S2. Based on the Kalman filter algorithm, the motion trajectory of the target sperm is modeled in time to obtain the XY-axis plane compensation displacement and Z-axis floating amount of the target sperm within a preset time window, and generate three-dimensional compensation parameters with the target sperm. S3. Based on the three-dimensional compensation parameters of the target sperm, control the electric stage to complete the XY-axis planar motion compensation of the target sperm and the Z-axis focusing compensation of the inverted high-magnification confocal lens, so that the target sperm is located at the center of the imaging field of view of the inverted high-magnification confocal lens. S4. Acquire the morphological image of the target sperm acquired by the inverted high-magnification confocal microscope and the fluorescence feature image of the target sperm acquired by the inverted fluorescence imaging module. Input the morphological image and the fluorescence feature image into the sperm analysis model to perform morphological analysis, survival rate detection and acrosome integrity assessment on the target sperm. S5. Select the next target sperm and repeat steps S2-S4 until all sperm in the target sperm set have been tested; S6. Based on the results of the target sperm motility grade, morphological analysis, survival rate detection, and acrosome integrity assessment, select the best sperm; perform three-dimensional motion compensation on the best sperm to lock the best sperm at the center of the imaging field of view of the inverted high-magnification confocal lens.
[0006] A second aspect of the present invention provides an automated sperm detection system, comprising: frame; An electric stage, located in the middle of the frame, is used to carry semen samples and perform high-precision XY axis displacement; A vertical motion stage is located on the upper part of the frame, and a low-powered objective lens is mounted on the vertical motion stage; A horizontal motion stage is located at the lower part of the frame. The inverted high-magnification confocal microscope is a laser scanning confocal inverted microscope with integrated fluorescence imaging function, which is mounted on the horizontal motion stage. The inverted fluorescence imaging module is integrated inside the inverted high-magnification confocal microscope body. The imaging module includes an upright low-power lens, an inverted high-power confocal lens, and an inverted fluorescence imaging module; A control device, mounted on the rack, includes a memory, a processor, and a control program stored in the memory and executable on the processor. The control program is configured to implement the control method of the aforementioned automated sperm detection system.
[0007] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention integrates six core processes—target sperm tracking, 3D compensation, multimodal image acquisition, AI analysis, batch detection, and optimal selection—into a single system, eliminating the need for manual equipment switching and repetitive operations, thus achieving fully automated control of the sperm testing process. Compared to traditional manual testing (single sample time ≥30 minutes, only single sample simultaneous testing is possible), this invention shortens the single sample testing time, supports batch simultaneous detection of target sperm, and significantly improves clinical testing efficiency.
[0008] 2. This invention generates three-dimensional compensation parameters through Kalman filtering time-series modeling and linear regression floating prediction, ensuring that XY-axis motion compensation and Z-axis focusing compensation are completed synchronously. Combined with dual-mirror confocal field-of-view calibration, the target sperm is always stably positioned in the confocal focal plane and center of the field of view of the inverted high-magnification confocal mirror and the inverted fluorescence imaging module. This solves the problems of large three-dimensional positioning errors, easy defocusing, and easy deviation of sperm in traditional detection, providing a precise imaging foundation for subsequent image acquisition and analysis. Attached Figure Description
[0009] Figure 1 This is a flowchart of the control method for the automatic sperm detection system of the present invention; Figure 2 This is a schematic diagram of the structural layout of the automatic sperm detection system of the present invention; Reference numerals: 1 - frame, 2 - motorized stage, 3 - vertical stage, 4 - upright low-power lens, 5 - horizontal stage, 6 - inverted high-power confocal lens. Detailed Implementation
[0010] 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 a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0011] In one embodiment of the present invention, a control method for an automated sperm detection system includes the following steps; S1. Obtain a large-field continuous bright-field image of the semen sample collected by an upright low-power microscope. Identify all sperm in the field of view through a multi-target tracking algorithm, generate the initial movement trajectory of each sperm, determine the motility grade of all sperm based on the initial movement trajectory, and determine the target sperm set to be detected based on the sperm motility grade. S2. Based on the Kalman filter algorithm, the motion trajectory of the target sperm is modeled in time to obtain the XY-axis plane displacement and Z-axis floating amount of the target sperm within a preset time window, and three-dimensional compensation parameters with the target sperm are generated. S3. Based on the three-dimensional compensation parameters of the target sperm, control the electric stage to complete the XY-axis planar motion compensation of the target sperm and the Z-axis focusing compensation of the inverted high-magnification confocal lens, so that the target sperm is located at the center of the imaging field of view of the inverted high-magnification confocal lens. S4. Acquire the morphological image of the target sperm acquired by the inverted high-magnification confocal microscope and the fluorescence feature image of the target sperm acquired by the inverted fluorescence imaging module. Input the morphological image and the fluorescence feature image into the sperm analysis model to perform morphological analysis, survival rate detection and acrosome integrity assessment on the target sperm. S5. Select the next target sperm and repeat steps S2-S4 until all sperm in the target sperm set have been tested; S6. Based on the results of the target sperm motility grade, morphological analysis, survival rate detection, and acrosome integrity assessment, select the best sperm; perform three-dimensional motion compensation on the best sperm to lock the best sperm at the center of the imaging field of view of the inverted high-magnification confocal lens.
[0012] This invention uses the Kalman filter algorithm to perform temporal modeling of sperm motility, simultaneously predicting the sperm's XY-plane displacement and Z-axis float, generating three-dimensional compensation parameters, and synchronously controlling the motorized stage and focusing servo module to complete XY+Z-axis linkage compensation. This fundamentally solves the core problems of compensation lag, imaging defocusing, and target loss, achieving stable locking of live sperm under high magnification. A coaxial confocal optical path enables simultaneous acquisition of bright-field morphology and fluorescence feature images of the same sperm. A multimodal feature fusion analysis model is then constructed based on the Transformer architecture, completing morphological analysis, viability detection, and acrosome integrity assessment in a single imaging session. This eliminates the need for batch processing using multiple devices, achieving integrated detection of all dimensions of sperm quality indicators while protecting sperm motility. The target sperm are divided into parallel detection groups by spatial grouping algorithm. Combined with the stepping displacement of the horizontal motion stage and the regional compensation of the motorized stage, multiple sperm can be tracked and imaged synchronously. A multi-dimensional fertilization potential scoring model is constructed by analytic hierarchy process. High fertilization potential sperm are screened by comprehensively considering four core indicators: motility, morphology, viability, and acrosome integrity. Then, the selected sperm are stably locked in the microscopic operation field of view by continuous three-dimensional motion compensation, realizing a closed loop of the whole process from "detection-screening-operation", which greatly improves the matching degree between screening results and clinical fertilization success rate.
[0013] In one embodiment, step S1, the step of identifying all sperm within the field of view using a multi-target tracking algorithm and generating the initial motion trajectory of each sperm, includes: using the YOLOv8 target detection model to identify sperm targets in multiple consecutive frames of large-field bright-field images, obtaining the position coordinates and bounding box information of all sperm in each frame; based on the SORT multi-target tracking algorithm, combined with intersection-over-union (IoU) matching and motion feature matching, where IoU refers to the ratio of the overlapping area to the merged area of two sperm bounding boxes in two consecutive frames (ranging from 0 to 1, with a higher overlap between the two bounding boxes), identifying and stitching the trajectory of the same sperm in consecutive frames, generating the initial motion trajectory of each sperm within a preset detection time. The step of determining the motility grade of all sperm based on the initial motion trajectory includes extracting the average motility speed, linear motility rate, and forward motility percentage of the sperm from the initial motion trajectory, determining the sperm motility grade, which includes four levels: fast forward motility, slow forward motility, non-forward motility, and no motility. Sperm of three grades—rapid forward motility (PRa), slow forward motility (PRb), and non-progressive motility (NP)—were all included in the target sperm set to be tested.
[0014] Specifically, a low-power objective lens was activated and the focus adjusted to achieve clear imaging. Continuous bright-field image acquisition of the semen sample was performed at a frame rate of 30fps and a duration of 1s, resulting in 30 consecutive large-field bright-field images of the semen sample. These images served as the foundational data for sperm target identification and trajectory generation. The 30 consecutive large-field bright-field images were then input into a trained YOLOv8 target detection model. The model performed feature extraction and sperm target detection on each frame. The input image size was set to 640×640 pixels, the confidence threshold to 0.5, and the IOU threshold to 0.3. Detection results with a confidence level below 0.5 were filtered to exclude interference from seminal plasma particles, cell debris, and other impurities within the field of view. The final output included the position coordinates (x, y) and bounding box information of all valid sperm in each frame. The SORT multi-target tracking algorithm was then used for sperm identification and association across the consecutive frames.
[0015] (1) Assign a unique ID to each valid sperm detected in each frame as an identifier for sperm trajectory tracking; (2) Use Intersection over Union (IoU) matching for preliminary association: calculate the ratio of the overlapping area to the merged area of the sperm bounding boxes in two consecutive frames. If the IoU value is ≥0.3, determine that the sperm in the corresponding bounding box is the same sperm and complete the preliminary identity association; (3) Use motion feature matching for supplementary optimization: compare the motion features (speed, direction of motion) of sperm in consecutive frames based on the IoU matching results. If the feature deviation is within the preset threshold (speed deviation ≤5%, direction deviation ≤10°), it is confirmed that it is the same sperm; if the feature difference is too large, even if the IoU value meets the standard, it is determined to be different sperm to avoid false association; (4) Complete the interrupted sperm trajectory: if the trajectory of the same ID sperm is interrupted for no more than 3 frames, complete the trajectory through the algorithm to avoid trajectory breakage caused by short-term detection deviation.
[0016] The initial motion trajectory is generated by stitching together images. The position coordinates of sperm with the same unique ID in 30 consecutive frames are concatenated in chronological order. Combined with the motion speed and direction information corresponding to each frame, the complete initial motion trajectory of each sperm within a 1-second collection period is generated. The trajectory contains the spatiotemporal motion characteristics of the sperm during the detection period, providing data support for subsequent motility grading.
[0017] Based on the initial trajectory, complete the motility grading and target sperm set delineation; (1) Extract core motility indicators such as average curve velocity (VCL), average linear velocity (VSL), linearity (LIN), and forward motility percentage from the initial motility trajectory of each sperm, and complete the initial screening motility grading of sperm according to the WHO fifth edition semen testing standard, which is divided into four levels: fast forward motility (VCL≥25μm / s), slow forward motility (5μm / s≤VCL<25μm / s), and non-forward motility (VCL<5μm / s and no clear direction of movement). (1) Proactive and non-motile (VCL≤1μm / s); (2) Based on the motility grading results, the target sperm set to be tested is defined by three-layer rules: ① Rigidly remove all non-motile sperm; ② Include all sperm with rapid forward movement and slow forward movement; ③ For non-motile sperm, include them according to the sample concentration (not included when the sample concentration is >15 million / mL, and included when the sample concentration is ≤15 million / mL), and finally determine the target sperm set to be tested, and record the initial position of each target sperm in the world coordinate system.
[0018] YOLOv8, as a general object detection model, cannot directly identify sperm. It needs to be customized for sperm detection scenarios in large-field bright-field images of semen samples. The specific training steps are as follows: Step 1: Construct a dedicated dataset for sperm testing. Collect large-field bright-field images of semen samples consistent with the actual testing scenario, and collect ≥5 valid images in total, covering scenarios with different semen concentrations, different sperm motility (fast forward / slow forward / non-forward / non-motile), and different background interference (seminal plasma particles, cell debris).
[0019] Annotation specifications: The LabelImg annotation tool was used, and annotations were performed in the txt format required by YOLOv8. Only valid sperm within the field of view were annotated (excluding seminal plasma particles, cell debris, air bubbles, and other impurities). Bounding boxes were drawn closely following the overall outline of the sperm (head + tail). Only one type of label was set – “sperm”. The dataset was divided into a training set (40,000 images), a validation set (5,000 images), and a test set (5,000 images) in an 8:1:1 ratio. The datasets were randomly shuffled after division to avoid consecutive frames from the same sample being concentrated in a single set.
[0020] Step 2: Dataset Preprocessing. Targeting the characteristics of bright-field semen images, the training set images undergo specific preprocessing to improve the model's generalization ability: Size Normalization: All images are uniformly scaled to the default YOLOv8 input size of 640×640 pixels, maintaining the aspect ratio, and edge padding is applied to avoid image stretching that could distort sperm morphology; Gray-scale Enhancement: Since bright-field images are grayscale, contrast (±20%) and brightness (±15%) are adjusted to simulate imaging effects under different lighting conditions; Noise Suppression: Gaussian filtering is used to remove background noise while preserving sperm edge features; The following enhancement operations are performed (for the training set only), expanding the dataset to 100,000 images: Random Rotation (0-10°, to avoid excessive bending of sperm tails causing bounding box failure); Random Translation (±5 pixels, to simulate slight sperm displacement); Random Cropping; Horizontal Flip.
[0021] Step 3: YOLOv8 Model Configuration and Initialization: Select YOLOv8n as the base model; Based on the default YOLOv8 configuration file, only modify the number of classes: change the default 80 classes in the COCO dataset to 1 class (only recognize sperm), and keep the other parameters (such as backbone network, neck structure, and detection head) at their default values to avoid excessive modification that could lead to model instability; Load the COCO pre-trained weights of YOLOv8n, and utilize the general feature extraction capabilities of the pre-trained weights to shorten the training cycle and improve accuracy in small sample scenarios.
[0022] Step 4: Model training. The batch size is set to 32 to fit the 640×640 input size, balancing memory usage and training efficiency. The initial learning rate is set to 1e-3, decaying to 1e-4 after 50 epochs and to 1e-5 after 80 epochs, using a cosine annealing learning rate strategy to avoid oscillations in later training. The number of training epochs is set to 100 to ensure model convergence and stable validation set accuracy. The optimizer used is AdamW, with β1=0.9, β2=0.999, and weight decay=0.0005, suitable for gradient optimization of small target (sperm) detection. The loss function uses the default CIoU loss of YOLOv8 combined with class loss. CIoU loss is more suitable for bounding box regression, improving sperm selection accuracy. The confidence threshold during training is set to 0.01 to lower the screening threshold during training and improve the learning effect of small targets. After training, the model is exported in ONNX format and deployed to the embedded processor of the system control module. The parameters for the inference stage are set as follows: confidence threshold 0.5 and IoU threshold 0.3 to ensure that the model outputs the position coordinates and bounding boxes of valid sperm in actual detection.
[0023] YOLOv8 extracts sperm features through a three-tiered structure of "backbone network - neck network - head". For bright-field semen images, the extracted features are divided into shallow visual features and deep semantic features: 1. Shallow visual features (extracted from the first 3 layers of the backbone network) Extraction Layer: Extracted jointly by the Conv2d convolutional layer, BN layer, and SiLU activation layer from the first three C2f modules of the YOLOv8 backbone network. Feature Types: First, edge features, namely the circular outline of the sperm head, the linear edge of the tail, and the transition boundary of the neck (the edge formed by the gray-scale difference between the sperm and the background in the bright field image); second, texture features, namely the uniform gray-scale texture of the sperm head and the filamentous texture of the tail (distinguishing it from the messy texture of seminal plasma particles); finally, size features, namely the overall size of the sperm (4-5μm for the head, 45-55μm for the tail) and aspect ratio (approximately 1:10), distinguishing it from large impurities (such as cell debris) or small particles; initially distinguishing sperm from the background, filtering out most non-sperm areas, and narrowing the scope for deep feature extraction.
[0024] 2. Deep semantic features (extracted from the last 3 layers of the backbone network + the neck network) Extraction Layer: Extracted jointly by the three C2f modules of the backbone network, the SPPF module of the neck network, and the PAN-FPN structure. Feature Types: First, morphological features, i.e., the overall shape of the sperm (the combined structure of head + neck + tail), distinguishing it from irregularly shaped impurities; second, contextual features, i.e., the spatial distribution characteristics of sperm in the field of view (such as clustered distribution, single distribution), combined with the background grayscale distribution to further exclude isolated impurity particles; finally, multi-scale features, which fuse feature maps of different scales through the PAN-FPN structure to adapt to sperm of different sizes (such as sperm with larger / smaller heads, sperm with broken tails); accurately locating the bounding box of the sperm, outputting the position coordinates of the sperm, ensuring that even if the sperm is partially occluded or has a bent tail, it can still be effectively identified.
[0025] In one embodiment, step S2 involves performing time-series modeling of the target sperm's trajectory based on the Kalman filter algorithm to obtain the XY-axis plane compensation displacement and Z-axis float, and generating three-dimensional compensation parameters, as follows: In the early stages of temporal modeling, the complete initial motion trajectory of each sperm in the target sperm set is extracted, and a preset time window is set (consistent with the imaging period of the inverted high-magnification confocal microscope, set to 0.03s, i.e., the acquisition time of 1 frame). The XY axis position coordinate sequence of sperm within the preset time window is extracted from the initial motion trajectory as the core input data for Kalman filter temporal modeling. At the same time, the temporal continuity of the coordinate sequence is ensured, and abnormal coordinate points (coordinates with deviation > 10nm) in the trajectory are removed to avoid interfering with the modeling accuracy.
[0026] Kalman filter motion state equation construction: Based on the uniform motion characteristics of the target sperm, an adapted Kalman filter motion state equation is constructed to complete the temporal modeling of the sperm motion trajectory. The specific parameters and structure are as follows: (1) Definition of state vector: Set the state vector at the current time k as ,in , The coordinates of the target sperm in the XY coordinate system at the current moment (unit: μm, the coordinate system is based on the center of the field of view of the upright low-power microscope as the origin, the X-axis is horizontal to the right and the Y-axis is vertical to the front). The instantaneous velocity of the target sperm in the XY axis direction at the current moment (unit: μm / s); the state vector dimension is 4×1, corresponding one-to-one with the motion characteristics of the sperm's XY axis position and velocity. (2) State transition matrix: Define the state transition matrix Adapted to a uniform sperm motility model, specifically in the form of ,in The preset time window duration (synchronized with the 30fps frame rate of the upright low-magnification lens and the imaging cycle of the inverted high-magnification confocal lens) has a matrix dimension of 4×4. Its core function is to realize the linear transfer from the state vector of the previous moment to the state vector of the current moment, that is, to deduce the position of the current moment (position = previous position + velocity × time) by using the position and velocity of the previous moment. (3) Process noise: The process noise vector in Kalman filtering, dimension and state vector Consistent, following a Gaussian distribution ,in The process noise covariance matrix is in the following form: The value is set to , This value is suitable for small random disturbances in sperm motility (such as fluid flow disturbances in semen samples and fluctuations in sperm motility itself). It will not cause prediction deviations due to excessive noise, nor will it fail to offset actual disturbances due to insufficient noise, thus ensuring the stability of time series modeling. (4) Complete motion state equation: The complete expression of the motion state equation of Kalman filter is Its physical meaning is as follows: the current sperm motility state is obtained from the previous motility state through linear transition, and a small random process noise is superimposed to achieve temporal modeling of the sperm motility trajectory; using the coordinate sequence within a preset time window extracted from the initial motility trajectory as the initial input, the state vector at time k=0 (the start time of the time window) is first determined. (Determined by the initial position and initial velocity of the initial trajectory), and then iterated through the above complete equations to obtain the state vectors at times k=1, k=2...k=n, thus completing the sperm motility time series modeling within the entire preset time window.
[0027] Temporal iterative prediction and state update are based on the constructed motion state equation. The temporal iterative prediction of the target sperm motion trajectory within the preset time window is performed to complete the state update. The specific steps are as follows: (1) Input the state vector of the previous time step (k-1 time step). (Including the position coordinates and instantaneous velocity at time k-1), through the state transition matrix (2) Perform linear transfer of position and velocity; (3) Add process noise (2) Counteract minor random disturbances to obtain the state prediction value at the current time (time k); (3) Combine the initial sperm movement trajectory coordinate sequence within the preset time window to perform time-series calibration on the state prediction value, and finally output the accurate state vector at the current time. Extract it , (Current instantaneous velocity) provides data support for subsequent compensation displacement calculation.
[0028] The calculation of XY-axis plane compensation displacement is combined with the fixed imaging period of the inverted high-magnification confocal lens (consistent with the preset time window). Based on the instantaneous velocity extracted from the current state vector, the XY-axis plane compensation displacement within the preset time window is calculated. The calculation formula is as follows: (1) X-axis plane compensation displacement: (2) Y-axis plane compensation displacement: in , The unit is nm, used for XY axis motion compensation of the motorized stage to ensure that the target sperm is in the center of the high-power imaging field of view.
[0029] Z-axis float prediction is based on the depth-of-field imaging sequence acquired by the upright low-power lens to complete the prediction of the target sperm Z-axis float, which is synchronized with the XY-axis compensation displacement to avoid defocusing or target offset caused by compensation asynchrony. The specific steps are as follows: (1) Depth-of-field sequence acquisition: control the upright low-power lens to acquire 10-20 frames of bright field images along the Z-axis in the range of 5-10μm with a step size of 0.5μm to form a depth-of-field imaging sequence. The acquisition time is synchronized with the XY-axis time-of-field modeling to ensure data correlation; (2) Focus feature extraction: use Ten The `engrad` gradient function calculates the focus evaluation value for each frame of the depth-of-field image and extracts the Z-axis coordinates corresponding to the position with the highest evaluation value. The specific operations are as follows: ① Function parameter settings: A 3×3 Sobel convolution kernel is selected. Gradient convolution operations are performed in the X and Y directions for each frame of the bright-field depth-of-field image. The convolution stride is set to 1, and zero padding is used to ensure that the image size is not distorted; ② Gradient calculation: The X-direction gradient value Gx and Y-direction gradient value Gy of each pixel in the image are calculated using the Sobel convolution kernel, using the formula... Calculate the comprehensive gradient value of each pixel, where G is the gradient intensity of that pixel, reflecting the sharpness of the pixel (the larger the gradient value, the sharper the pixel edge and the better the focus effect); ③ Focus evaluation value calculation: sum the comprehensive gradient values G of all pixels in a single frame image to obtain the Tenengrad focus evaluation value of that frame image. The larger the evaluation value, the higher the overall focus sharpness of that frame image, that is, the optimal imaging effect of sperm at that Z-axis position; ④ Z-axis coordinate extraction: calculate the Tenengrad coordinate of each frame image in the depth imaging sequence one by one. Rad focus evaluation value, compare the evaluation values of all frames, select the frame image with the highest evaluation value, record the Z-axis acquisition coordinates corresponding to the frame image (i.e., the Z-axis height when the frame image is acquired by the upright low magnification lens), and use this as the optimal Z-axis coordinates of the sperm at the current moment; organize all the selected optimal Z-axis coordinates to form the Z-axis coordinate sequence of the target sperm; (3) Float prediction: use the linear regression algorithm to fit the linear change trend of the Z-axis coordinate sequence and predict the Z-axis axial float of the target sperm within the preset time window (0.03s). (Unit: nm), prediction error ≤ 20nm, ensuring the accuracy of Z-axis focus compensation and avoiding defocusing in high-magnification imaging. Specific operations are as follows: ① Model definition: A univariate linear regression model is selected, with "time" as the independent variable and "optimal Z-axis focus coordinates" as the dependent variable. The model expression is: ,in: Here, t represents the predicted Z-axis coordinate of the sperm at time t (unit: nm); t is the time variable (unit: s), corresponding to the acquisition time node of the depth sequence (e.g., acquisition time t=0s for frame 1, t=0.03s for frame 2, consistent with the preset time window); k is the regression coefficient (unit: nm / s), reflecting the rate of change of the Z-axis coordinate with time (i.e., the Z-axis floating speed); b is the intercept term (unit: nm), reflecting the initial Z-axis coordinate at time t=0. ② Data preprocessing: The processed Z-axis coordinate sequence is mapped one-to-one with the corresponding acquisition time node to form a dataset. (n is the number of valid data points in the Z-axis coordinate sequence, n≥8), and outlier data points (coordinates with a deviation from the fitted trend >30nm) are checked and removed again. ③ Regression parameter solution: The least squares method is used to solve for the model parameters k (regression coefficients) and b (intercept) to ensure that the fitting error is minimized. The specific solution formula is as follows: Regression coefficients Intercept term in, Let i be the time of the i-th data point. Let be the optimal Z-axis focus coordinate for the i-th data point, and n be the number of valid data points. ④ Model Validation: Calculate the goodness of fit. (Judgment coefficient), requirements To avoid excessive fitting bias affecting prediction accuracy; if Then increase the number of valid data points in the Z-axis coordinate sequence (supplement by acquiring 2-3 additional depth images) and refit. ⑤ Float prediction: Based on the fitted linear regression model. Predict the current time (set as) ) and the end time of the preset time window ( The Z-axis coordinates of ) are denoted as . and The difference between the two is the Z-axis axial float within the preset time window, calculated using the following formula: The sign directly reflects the Z-axis floating direction, and the specific judgment rules are as follows: When ΔZ_pred > 0, the target sperm floats upward along the Z-axis, and the focusing servo module needs to control the Z-axis to move upward by the magnitude of |ΔZ_pred|; when ΔZ_pred < 0, the target sperm floats downward along the Z-axis, and the focusing servo module needs to control the Z-axis to move downward by the magnitude of |ΔZ_pred|; when ΔZ_pred = 0, there is no Z-axis floating, and the Z-axis position remains unchanged.
[0030] The three-dimensional compensation parameters are integrated to generate the calculated XY-axis plane compensation displacement. , Z-axis float Timeline synchronization is performed to ensure consistency among the three parameters and avoid compensation lag or asynchrony issues; integrated to form three-dimensional compensation parameters corresponding to the target sperm. , , .
[0031] In one embodiment, step S3 involves controlling the motorized stage to perform XY-axis planar motion compensation and Z-axis focusing compensation of the inverted high-magnification confocal lens based on the three-dimensional compensation parameters of the target sperm, so that the target sperm is positioned at the center of the imaging field of view of the inverted high-magnification confocal lens.
[0032] Based on the three-dimensional compensation parameters of the target sperm The synchronously controlled motorized stage completes XY-axis planar motion compensation, and the inverted high-magnification confocal lens completes Z-axis focusing compensation, as detailed below:
[0033] The integrated 3D compensation parameters are synchronously sent as digital pulse signals to two execution modules: a dedicated controller for the motorized stage (responsible for XY-axis planar motion compensation) and a focusing servo module for the inverted high-magnification confocal lens (responsible for Z-axis focusing compensation). The motorized stage controller will... Converted into pulse commands recognizable by the stage drive motor; the focusing servo module will... It is converted into a voltage control signal for the confocal lens focusing drive mechanism.
[0034] The electric stage performs XY-axis planar motion compensation. (1) Coordinate system alignment: The XY-axis coordinate system of the electric stage is completely consistent with the XY-axis coordinate system (with the center of the field of view of the upright low-power lens as the origin, the X-axis is horizontal to the right, and the Y-axis is vertical to the front). (2) Displacement execution: Based on the analyzed pulse command, the electric stage is controlled to perform linear displacement synchronously along the XY-axis. The specific execution logic is: ① If Control the stage to move along the positive X-axis (to the right). Size; if Control the stage to move along the negative X-axis (to the left). Size; ② If Control the stage to move along the positive Y-axis (forward). Size; if Control the stage to move along the negative Y-axis (backward). Size. (3) Accuracy verification: After the compensation is completed, the electric stage controller collects the actual displacement data of the stage in real time through the built-in displacement sensor. ,Δ , with preset compensation displacement , Compare and calculate displacement deviation. If the deviation is greater than 50nm, the controller will automatically issue a fine-tuning command to control the stage to perform a second fine-tuning until the deviation is less than or equal to 50nm, ensuring that the XY axis compensation accuracy meets the standard and that the target sperm is within the high-power imaging field of view.
[0035] Inverted high-magnification confocal lens Z-axis focusing compensation execution (1) Coordinate system alignment: The Z-axis coordinate system of the inverted high-magnification confocal lens is completely consistent with the Z-axis coordinate system (based on the current mechanical origin of the upright low-magnification lens, +Z is away from the stage, -Z is close to the stage). (2) Focusing execution: Based on the analyzed voltage control signal, the confocal lens focusing drive mechanism is controlled to drive the lens to move axially along the Z-axis. The specific execution logic is: ① If Control the confocal lens along the positive Z-axis (away from the stage, upwards). ; ②If Control the confocal lens to move along the negative Z-axis (near the stage, downwards). Size; ③ If (3) Accuracy verification: After the focus compensation is completed, the focus servo module collects the actual focusing displacement of the confocal lens through the built-in displacement encoder. , and preset floating amount Compare and calculate the focusing deviation. If the deviation is greater than 20nm, the servo module will automatically fine-tune the focusing position until the deviation is less than or equal to 20nm, ensuring accurate focusing and placing the target sperm on the focal plane of the confocal lens.
[0036] Dual-mirror confocal imaging field of view calibration (1) Calibration prerequisites: After XY axis motion compensation and Z axis focus compensation are completed and the accuracy is met, start the confocal calibration process of the inverted high-magnification confocal mirror and the inverted fluorescence imaging module to ensure that the imaging fields of the two overlap and the target sperm is simultaneously in the imaging field of view of both lenses. (2) Calibration steps: ① Start the inverted high-magnification confocal mirror, acquire the confocal image of the target sperm, and record the coordinates of the sperm in the confocal field of view. ② Simultaneously activate the inverted fluorescence imaging module to acquire fluorescence images of the same target sperm and record the coordinates of the sperm in the fluorescence field of view. ③ Calculate the coordinate deviation between the two. ④ If the deviation is >100nm, the position of the motorized stage (XY axis) and confocal mirror (Z axis) is finely adjusted by the controller until the deviation is ≤100nm, thus completing the dual-mirror confocal field of view calibration and ensuring that the target sperm is in the target position of the dual-mirror confocal imaging field of view (the center of the field of view, the area with the clearest imaging).
[0037] In one embodiment, step S4 acquires the morphological image of the target sperm acquired by the inverted high-magnification confocal microscope and the fluorescence feature image of the target sperm acquired by the inverted fluorescence imaging module. The morphological image and the fluorescence feature image are input into the sperm analysis model to perform morphological analysis, survival rate detection and acrosome integrity assessment on the target sperm.
[0038] The specific sperm analysis model is a CNN+attention mechanism multi-task convolutional neural network, which includes an input layer: a dual-channel input structure, one channel inputting a preprocessed sperm morphology image (reflecting sperm morphological details), and the other channel inputting a preprocessed FDA+PI fused fluorescence image (reflecting sperm motility and acrosome fluorescence characteristics). The two channel images are registered and aligned before being input synchronously.
[0039] Feature extraction layer: ResNet50 is used as the backbone network and connected in series with the spatial attention module. The feature output of the last layer of ResNet50 is directly connected to the input of the spatial attention module. ResNet50 is responsible for extracting general features of sperm images (including the contour and texture features of the head, acrosome, and tail). The spatial attention module focuses on key regions of the sperm head, acrosome, and tail through weight allocation (weight ratio ≥70%), and suppresses the interference of background impurities.
[0040] Output Layer: Connected in parallel to the output of the spatial attention module of the feature extraction layer, it has three independent branches: ① Morphological Scoring Branch: Receives sperm morphological features (head size, neck curvature, tail integrity, etc.) output from the feature extraction layer, connected by two fully connected layers, corresponding to the quantitative determination of sperm morphology; ② Viability Determination Branch: Receives fluorescence features (FDA / PI fluorescence intensity, distribution) output from the feature extraction layer, connected by one fully connected layer and an activation function, outputting live / dead binary classification results and corresponding probability values, adapting to the correlation analysis between fluorescence signals and sperm activity; ③ Acrosome Integrity Grading Branch: Receives acrosome region features (contour, fluorescence uniformity) output from the feature extraction layer, connected by two fully connected layers, outputting the grading requirements for acrosome integrity.
[0041] (2) Specific steps of model training Step 1: Select 100,000+ fully annotated sperm morphology / fluorescence images as the training set, 5,000 images as the validation set, and 3,000 images as the test set; the annotation content strictly follows the WHO fifth edition sperm morphology standards, the gold standard for artificial counting viability, and the gold standard for acrosome staining.
[0042] Step 2: Perform targeted enhancement on the training set images. Specific enhancement methods and parameters include: random rotation (0-10° to avoid sperm morphology distortion), random cropping, brightness adjustment, and horizontal flipping. After enhancement, the number of training set images is expanded to 200,000+, which avoids model overfitting and improves the model's adaptability to sperm images under different imaging conditions.
[0043] Step 3: Model Initialization: The ResNet50 backbone network is initialized with ImageNet pre-trained weights, and the spatial attention module and the fully connected output layer are initialized with He normal distribution (mean 0, variance 0.02). The initial learning rate of the model is set to 1e-4, the optimizer is Adam optimizer (β1=0.9, β2=0.999, weight decay=1e-5), and the loss function is multi-task joint loss, with the weight ratio of the three branches of loss being 1:1:1 (morphological branch MSE loss, survival rate branch cross-entropy loss, and acrosome integrity branch Focal loss).
[0044] Step 4: Iterative training: Set the training batch size to 32 and the number of iterations to 50; adopt an early stopping strategy (patience=5), that is, stop training when the validation set loss does not decrease for 5 consecutive epochs to avoid model overfitting; output the training set loss and validation set loss once every 1 epoch during training, and verify the model accuracy on the test set once every 5 epochs.
[0045] The model input consists of dual-channel data: "morphological image + FDA-PI fused fluorescence image". This provides details of sperm morphology (size and shape of head, neck, and tail) for morphological analysis and acrosome region localization. The FDA-PI fused fluorescence image provides sperm activity signals (FDA green fluorescence) and acrosome fluorescence characteristics (fluorescence enrichment in the acrosome region) for viability detection and acrosome integrity assessment.
[0046] In one embodiment, S5, select the next target sperm and repeat steps S2-S4 until all sperm in the target sperm set have been detected; the specific execution logic is as follows: Target sperm selection rules: Select the next target sperm in ascending order of the unique ID of the sperm in the target sperm set to avoid duplicate testing or omission. If a target sperm fails to be analyzed due to imaging abnormalities (such as field of view obstruction or image blurring), it is marked as a detection failure, and the reason for failure is recorded (such as "weak fluorescence signal" or "missing sperm outline"). Skip the sperm and continue to select the next target sperm. After all sperm have been tested, the sperm that failed the test will be retested.
[0047] Step reuse and parameter adaptation: When repeating steps S2-S4, the target sperm set information defined in S1, the preset image acquisition parameters (such as objective lens type, fluorescence channel parameters, model inference parameters) and preprocessing standards in S4 are reused without the need to reset; only for the next target sperm, the three-dimensional compensation parameter generation in S2, the compensation execution in S3, and the image acquisition and multi-dimensional analysis in S4 need to be re-executed to ensure that the detection standards for each target sperm are consistent and the results are comparable.
[0048] Termination condition: When all sperm corresponding to unique IDs in the target sperm set have completed testing (including those that failed but were retested), the repeated execution of S2-S4 will be terminated, and the process will proceed to the subsequent S6 sperm selection stage. After the testing is completed, a summary table of the target sperm set will be automatically generated, recording the ID of each sperm, the testing status (success / failure), and the core testing results (motility level, morphological score, etc.) to facilitate subsequent screening and traceability.
[0049] S6. Based on the target sperm's motility grade, morphological analysis, survival rate, and acrosome integrity assessment, select the best sperm; perform three-dimensional motion compensation on the best sperm to lock them at the center of the imaging field of view of the inverted high-magnification confocal microscope; details are as follows: Preferred sperm selection criteria: Based on clinical sperm selection needs, four core indicators are set as screening thresholds. Target sperm that meet all of the following conditions are judged as preferred sperm: Motility level: meets the criteria of rapid forward motility (VCL≥25μm / s) or slow forward motility (5μm / s≤VCL<25μm / s), and excludes non-motile or non-motile sperm. Morphological analysis: Morphological score ≥8 points (corresponding to normal sperm morphology in the WHO fifth edition standard, with no obvious abnormalities in the head, neck, and tail, only slight tail curvature <10° is allowed); Viability test: judged as live sperm (FDA channel fluorescence intensity ≥2000, PI channel fluorescence intensity <500), excluding dead sperm and suspicious sperm; Acrosome integrity assessment: acrosome integrity graded as 0 (intact) or 1 (mild damage), excluding sperm with moderate or complete acrosome damage (grade 2 and 3).
[0050] Screening execution: Based on the target sperm set detection summary table generated by S5, the four core indicators and screening thresholds of each target sperm are automatically compared to select all qualified sperm to form a set of qualified sperm. Each qualified sperm is assigned a unique qualified ID and bound to the original sperm ID for easy traceability in subsequent microscopic operations.
[0051] 3D Motion Compensation and Field of View Locking for Selected Sperm: For each selected sperm in the selected sperm set, the 3D compensation parameter generation step in S2 is re-executed to generate 3D compensation parameters adapted to the real-time motion state of the selected sperm. Following the compensation execution process in S3, the motorized stage is synchronously controlled to complete XY-axis planar motion compensation, and the inverted high-magnification confocal lens completes Z-axis focusing compensation, maintaining the same synchronization requirement for compensation actions. After compensation, microscopic operation field of view calibration is initiated (consistent with the dual-mirror confocal calibration logic in step S3), locking the selected sperm at the target position in the microscopic operation field of view, i.e., the central region of the field of view, and on the confocal focal plane of the inverted high-magnification confocal lens and the inverted fluorescence imaging module. The motion state of the selected sperm is monitored in real time, and the 3D compensation parameters are updated every 0.03s (synchronized with the imaging cycle), continuously executing compensation actions to ensure that the selected sperm is always locked at the target position, providing stable field of view support for subsequent microscopic operations (such as sperm pickup and fertilization operations). After screening, a selected sperm screening report is output, including the selected sperm ID, the original sperm ID, the values of the four core indicators, and the compensation parameters; at the same time, the locking location coordinates of each selected sperm are recorded and stored in the system database.
[0052] This invention also provides an automated sperm detection system, with an overall support structure for the frame system, on which all functional components are directly or indirectly mounted. An electric stage 2, located in the middle of the frame, carries the semen sample, receives commands from the control device, and performs high-precision XY-axis displacement to achieve XY-axis planar motion compensation for the target sperm.
[0053] Vertical motion stage 3: Located on the upper part of the frame, it can move the upright low-power lens 4 in the vertical direction, adjust the focal length of the upright low-power lens, and complete the acquisition of large field bright field images.
[0054] Horizontal motion stage 5: Located at the lower part of the frame, it can drive the inverted high-magnification confocal lens 6 to move in a stepping manner in the horizontal direction, realizing lens switching and positioning during parallel detection of multiple target sperm. The inverted high-magnification confocal lens is a laser scanning confocal inverted microscope with integrated fluorescence imaging function. The inverted fluorescence imaging module is integrated inside the inverted high-magnification confocal lens body.
[0055] Imaging module: Includes upright low-power lens, inverted high-power confocal lens, and inverted fluorescence imaging module, which respectively complete the acquisition of wide-field bright-field images, sperm morphology images, and sperm fluorescence characteristic images.
[0056] Control device: Located on the rack, including a memory, a processor, and a control program stored in the memory and executable on the processor. The control program is configured to implement the control method of the above-mentioned automatic sperm detection system, and its specific functions are as follows: receiving various image signals acquired by the upright low-power microscope, the inverted high-power confocal microscope, and the inverted fluorescence imaging module (imaging module), and transmitting them to the processor for processing; the processor runs a preset control program, executes target sperm delineation related algorithms (YOLOv8 target detection, SORT multi-target tracking, Kalman filter temporal modeling, Z-axis linear regression fitting), and generates three-dimensional compensation parameters. Subsequently, control commands are issued to control the electric stage to perform XY-axis planar motion compensation, the vertical stage to move the upright low-power lens up and down to adjust the focal length, the horizontal stage to move the inverted high-power confocal lens, and the inverted fluorescence imaging module to move horizontally. At the same time, the processor runs the sperm analysis model to complete morphological analysis, viability detection, and acrosome integrity assessment, and then executes batch detection logic and optimal sperm screening and locking control. The memory is used to store all acquired image data, detection results, model weights, compensation parameters, and control programs to ensure that the detection process is traceable and reproducible, and ultimately realize the automated control of the entire sperm automatic detection process.
[0057] The above are merely embodiments of the present invention. The circuits, electronic components, and modules involved are all prior art, fully achievable by those skilled in the art, and require no further explanation. The scope of protection in this application does not involve improvements to the software and methods. Commonly known structures and characteristics in the solutions are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are aware of all prior art in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the application.
Claims
1. A control method for an automated sperm detection system, characterized in that: Includes the following steps: S1. Obtain a large-field continuous bright-field image of the semen sample collected by an upright low-power microscope, identify all sperm in the field of view, generate the initial movement trajectory of each sperm, determine the sperm motility grade based on the initial movement trajectory, and determine the target sperm set to be detected based on the sperm motility grade. S2. Based on the Kalman filter algorithm, the motion trajectory of the target sperm is modeled in time to obtain the XY-axis plane compensation displacement and Z-axis floating amount of the target sperm within a preset time window, and the three-dimensional compensation parameters of the target sperm are generated. S3. Based on the three-dimensional compensation parameters of the target sperm, control the electric stage to complete the XY-axis planar motion compensation of the target sperm and the Z-axis focusing compensation of the inverted high-magnification confocal lens, so that the target sperm is located at the center of the imaging field of view of the inverted high-magnification confocal lens. S4. Acquire the morphological image of the target sperm acquired by the inverted high-magnification confocal microscope and the fluorescence feature image of the target sperm acquired by the inverted fluorescence imaging module. Input the morphological image and the fluorescence feature image into the sperm analysis model to perform morphological analysis, survival rate detection and acrosome integrity assessment on the target sperm. S5. Select the next target sperm and repeat steps S2-S4 until all sperm in the target sperm set have been tested; S6. Based on the target sperm's motility grade, morphological analysis results, survival rate test results, and acrosome integrity assessment results, select preferred sperm. The preferred sperm must simultaneously meet the following conditions: motility grade is rapid forward movement or slow forward movement; morphological analysis results are normal morphology with a morphological score ≥ 8 points; survival rate test results are live sperm; and acrosome integrity assessment results are intact or slightly damaged. Three-dimensional motion compensation is applied to the selected sperm to lock them at the center of the imaging field of view of the inverted high-magnification confocal lens.
2. The control method of the automatic sperm detection system as described in claim 1, characterized in that: In step S1, the step of identifying all sperm within the field of view using a multi-target tracking algorithm and generating the initial movement trajectory of each sperm includes: Sperm target identification is performed on multiple consecutive frames of large field-of-view bright-field images to obtain the position coordinates and bounding box information of all sperm in each frame; Based on the SORT multi-target tracking algorithm, combined with cross-union matching and motion feature matching, the identity of the same sperm in consecutive frames is associated and the trajectory is stitched together to generate the initial motion trajectory of each sperm within a preset detection time.
3. The control method of the sperm automatic detection system as described in claim 2, characterized in that: In step S1, determining the motility grade of all sperm based on the initial movement trajectory includes extracting the average movement speed, linear movement rate, and forward movement percentage of sperm from the initial movement trajectory to determine the sperm motility grade, which includes four levels: fast forward movement, slow forward movement, non-forward movement, and no movement.
4. The control method of the automatic sperm detection system as described in claim 2, characterized in that: The specific process by which the SORT multi-target tracking algorithm generates the initial sperm trajectory is as follows: Obtain the position coordinates and bounding box information of all sperm in each frame of a continuous multi-frame large field-of-view bright-field image; A unique ID is assigned to each detected sperm in each frame, and the same sperm in consecutive frames is associated by combining crossover ratio matching and motion feature matching. The position coordinates of sperm with the same ID in consecutive frames are concatenated in chronological order to form the initial motion trajectory.
5. The control method for the automated sperm detection system as described in claim 1, characterized in that: In step S2, the XY-axis plane compensation displacement is specifically obtained through the following steps: Using the historical trajectory of the target sperm as input, a Kalman filter motion state equation is constructed. ,in The state transition matrix has the following specific form: ,in The preset time window duration; This is the process noise vector in Kalman filtering; The precise state vector at the current moment is obtained through iterative calculation of the state equation. , ,in , The X and Y coordinates of the target sperm at the current moment. , These represent the instantaneous velocities of the target sperm along the X and Y axes at the current moment; Based on the fixed imaging period of the inverted high-magnification confocal lens The predicted displacements along the X and Y axes within the imaging period are calculated based on the current state vector. The specific calculation formula is as follows: , , = ,Will As the displacement amount for XY axis plane compensation.
6. The control method of the automatic sperm detection system as described in claim 5, characterized in that: In step S2, the steps for generating the Z-axis focusing compensation amount include: Multiple frames of bright-field images were acquired using a low-magnification upright lens to form a depth-of-field sequence. The Tenengrad gradient function was used to extract the Z-axis coordinates of the focus peak position in each frame. The linear trend of sperm Z-axis fluctuation was fitted to predict the Z-axis axial fluctuation during the imaging cycle. As the Z-axis focusing compensation amount.
7. The control method for the automated sperm detection system as described in claim 6, characterized in that: The steps for obtaining the three-dimensional compensation parameters of the target sperm include: synchronizing the XY-axis planar compensation displacement and the Z-axis focusing compensation amount over time to generate the three-dimensional compensation parameters corresponding to the target sperm. .
8. The control method of the automatic sperm detection system as described in claim 1, characterized in that: The sperm analysis model includes; Input layer: Dual-channel input structure, one channel is connected to the preprocessed sperm morphology image, and the other channel is connected to the preprocessed FDA+PI fused fluorescence image. The two channel images are registered and aligned before being input synchronously. Feature extraction layer: ResNet50 is used as the backbone network and connected in series with the spatial attention module. The feature output of the last layer of ResNet50 is directly connected to the input of the spatial attention module. Output layer: Connected in parallel to the output of the spatial attention module of the feature extraction layer, containing 3 independent branches; Morphological scoring branch: Receives sperm morphological features from the feature extraction layer and outputs sperm morphological analysis results; Survival rate determination branch: Receives fluorescence features from the feature extraction layer, outputs live / dead binary classification results and corresponding probability values, and outputs the hierarchical requirements for acrosome integrity; Topbody integrity hierarchical branch: Receive the top body region features output by the feature extraction layer.
9. An automated sperm detection system, characterized in that: include: frame; An electric stage, located in the middle of the frame, is used to carry semen samples and perform high-precision XY axis displacement; A vertical motion stage is located on the upper part of the frame, and a low-powered objective lens is mounted on the vertical motion stage; A horizontal motion stage is located at the lower part of the frame. The inverted high-magnification confocal microscope is a laser scanning confocal inverted microscope with integrated fluorescence imaging function, which is mounted on the horizontal motion stage. The inverted fluorescence imaging module is integrated inside the inverted high-magnification confocal microscope body. The imaging module includes an upright low-power lens, an inverted high-power confocal lens, and an inverted fluorescence imaging module; A control device, disposed on the rack, includes a memory, a processor, and a control program stored in the memory and executable on the processor, the control program being configured to implement the control method of the sperm automatic detection system according to any one of claims 1 to 8.