Deep learning-based method for analyzing the optically trapped sperm rotation

Optical tweezers exert a strong trapping force on cells, making it crucial to analyze the movement of trapped cells. The rotation of cells plays a significant role in their swimming patterns, such as in sperm cells. We proposed a fast deep-learning-based method that can automatically determine the projection orientation of ellipsoidal-like cells without additional optical design. This method was utilized for analyzing the planar rotation of trapped sperm cells using an optical tweezer, demonstrating its feasibility in extracting the rotation of the cell head. Furthermore, we employed this method to investigate sperm cell activity by examining variations in sperm rotation rates under different conditions, including temperature and laser output power. Our findings provide evidence for the effectiveness of this method and the rotation analysis method developed may have clinical potential for sperm quality evaluation.

expansion.The resulting linear polarized laser beam was then directed onto a dichroic mirror, which reflected it onto the back aperture of an oil immersion microscope objective (Nikon, 100× oil immersion; NA = 1.4;WD = 0.13 mm).The beam is modulated through a reflective and pure phase-only liquid crystal spatial light modulator (Holoeye, HED6010-L-VIS) in the shaping system.The sample solution of interest was loaded onto a sample pool and positioned at the back focal plane of the oil mirror, which was controlled using a voltage-controlled stage (Thorlabs; ZFM2030).The illumination of the sample chamber was provided by a LED light source and the imaging of the sample was performed using a CMOS camera (Sentech; STC-mbs241U3V; 163 fps).

Rotational angular speed measurement using U-Net++
Prior to the experiment, we calibrated the position of the optical trap and used a 150 × 150 pixel region around the trap center as the region of interest (ROI) to exclude interference from other swimming sperms, as shown in Fig. 1b.For the extracted image area, we used image segmentation to perform contour detection to obtain the projection phase of the head shape.Then, the rotational angular speed was calculated from the phase difference between consecutive frames.

Segmentation of sperm images using U-Net++.
To achieve faster and more accurate segmentation results, we introduced a deep-learning segmentation algorithm.This is because traditional gray threshold segmentation, such as level set and clustering method, is greatly affected by noise in the segmentation of high-magnification cell images under high-NA lens imaging, as shown in Fig. 2b.Moreover, these methods rely on manual or adaptive adjustment of parameters, which may not be effective in complex scenes.Deep learning-based image segmentation algorithms have become a hot topic in recent years.In this study, we used the U-Net++ network for image segmentation.U-Net++ is a supervised learning network based on the fully convolutional neural network, U-Net.By redesigning the skip connections, it aggregates information features of different semantic scales in the decoder sub-network, forming a highly flexible feature fusion solution, and has performed well on many biological datasets and backbone architectures 21 .As a type of supervised learning, the training of this model requires a certain amount of data to generate better segmentation results.Figure 2a shows the schematic diagram of our solution.The loss function we used is the hybrid loss which combined the cross-entropy loss and soft dice-coefficient loss.The hybrid loss is defined as 22 where y n,c ∈ Y and p n,c ∈ P denotes the target labels and predicted probabilities for class c (here just two classes) and nth pixel in the training batch.Our training dataset consisted of 125 images of trapped sperm cells with a size of 120 × 120 pixels and the corresponding manually segmented results.The network depth was set to 4 lay- ers, and the optimal network parameters were calculated using cross-validation.After processing the segmented sperm images, a threshold method can be used for binarization to extract the mask.Despite the small size of the training dataset, the segmentation results are remarkable, particularly when compared to the other two models, as is shown in Fig. 2b, where the intersection over union (IoU) and Dice coefficients can reach around 90%.The IoU and Dice coefficients are defined as follows 23 , where the S represents the segmented mask and T represents the truth mask.For each of them, a higher value indicates a higher degree of overlap and similarity between the segmentation result and the reference mask The level set and clustering models in the study utilized modules provided by ImageJ 1.53v 24 .This approach can achieve rapid and accurate image segmentation in milliseconds by deploying on high-performance GPUs, achieving real-time segmentation, as shown in Table 1.The experiments are performed using NIVIDA GeForce RTX 2080 GPU with 8 GB memory.
Rotational angular speed determined by elliptical fitting.The projected orientation of the sperm needs to be determined from the segmented image.The human sperm head is flat and elliptical, with a length of about 4-5 µ m and a width of about 2.5-3.5 µm 25 .This elliptical shape is different from the circular shape of typical cells, so the two-dimensional orientation of the sperm can be determined visually.In this study, the elliptical fitting tool provided by OpenCV 26 is used to approximate the shape of the sperm head in the grayscale image obtained from the segmented sperm image, and the phase information α of the head is obtained, as  www.nature.com/scientificreports/shown in Fig. 1b. Figure 2c depicts a series of images of segmented sperm at four different time points, along with the results of ellipse fitting.It can be observed that the phase is accurately extracted.Despite the fact that the segmented result appears oval when the sperm is in a sideways position, the phase is still acquired accurately.
The absolute angular speed is then obtained using the forward difference method, as shown in the following equation,where k means the kth frame, fps denotes the recording rate of 163 frames per second:

Result and discussion
The aforementioned methodology was employed to determine the phase value of a rotating sperm under optical trapping control using sperm samples obtained from a single healthy male.The experiment was conducted at a temperature of 23 • C. The laser output power was set to 400 mW.The laser trapping power reaching the sperm can be measured with a power meter and is approximately 120 mW, resulting in a temperature increase of around 1 • C [27][28][29] .To try to minimize the potential for light-induced damage to the sperm, the capture duration of the trapped sperm was limited to no more than 4 s 30 .To facilitate comparative analysis, we opted to select three representative sperms for evaluation, namely S 0 , S 1 , and S 2 .S 0 appeared to be inactive under microscopic observation with minimal or no detectable movement, while both S 1 and S 2 exhibited rapid head oscillatory movements in a trapped state contrasting with the dead-like state of S 0 .Figure 3a-c,d-f illustrate the phase information and calculated angular speed rate for the three sperm cells mentioned above .It can be seen that for the basically inactive sperm cell, the signal in Fig. 3d shows low-frequency sparsity, while the signal in Fig. 3e,f is high-frequency density.For the angular speed signal, we used a box plot for statistical analysis.The results are shown in Fig. 3g.
It can be seen that for S 0 , both the mean and median tend to be 0, while for the other two trapped more active sperm cells, their mean and median are relatively larger.Furthermore, we used a two-sample t-test in statistics to determine whether there is a significant difference in the mean angular speed between the two groups.And the www.nature.com/scientificreports/results suggest that the rotation activity levels of S 2 sperm were likely higher than those of S 1 sperm, as indicated by a statistically significant p value of less than 0.01.Accordingly, we could select S 2 sperm as the target of our research due to its relatively higher motility levels when compared to S 1 sperm.
In addition, we manually tracked the trajectory of the untrapped sperm (about 40 frames) with the aid of ImageJ 24 and used the method of tracking ROI to provide the angular speed of the swimming sperm prior to capture, as shown in Fig. 3f.It can be seen that the speed distribution of the untrapped sperm signal is larger.This is because the sperm will experience the torque of the optical trap during rotation, which will cause the rotation speed to decrease, as shown in the wider range of 25-75% of the swimming group compared to the trapped group.However, the average output power of trapped and untrapped sperm is basically the same.
In order to further confirm the feasibility of the method.We divided the sperm from the same sample into two parts (about 800 µ L each), one was refrigerated at 4 • C for 6 h, and the other was stored at room temperature( 23• C) for 6 h for statistical analysis of the average angular speed at a laser output power of 400 mW.In order to avoid the increase in motility of the refrigerated sperm caused by rewarming as much as possible, we replaced the sample and captured sperms after 5 captures.The results are shown in Fig. 4a.It can be seen that the average activity of refrigerated sperm is reduced by about 30%, which is consistent with the expected decrease in sperm activity after refrigeration.Meanwhile, we chose 300 mW, 400 mW, and 500 mW as the laser output power with other conditions held constant to acquire the angular speed of trapped sperm under different trapping energy potentials.Regarding the temperature increase caused by optical trapping, due to a difference of 30 mW between actual laser trapping powers, the maximum temperature difference induced by different laser powers remains within 1 • C [27][28][29] .This temperature difference has a minimal impact on the experiment.As shown in Fig. 4b, it can be seen that at these power levels, the sperm can be stably trapped.It is evident that at 400 mW, the trapped sperm have the highest average angular speed and widest distribution range.While at 500 mW and 300 mW, their speeds are relatively low and their ranges narrow.This is probably due to two reasons: the torque exerted on the captured target exhibits a positive correlation with the increase in intensity, which is directly linked to the laser output power 31,32 .At 500 mW, the resistance torque is too high, resulting in excessive damping of the sperm and limiting its rotation; while at 300 mW, the energy is too low to capture highly active sperm 33 , resulting in lower captured sperm rotation motility.Therefore, 400 mW is the ideal output power with the largest range of captured sperm rotation motility, and the selected power in practical applications needs to be above the appropriate output power to achieve maximum distinguishability.

Conclusion
This research paper proposes a deep learning-based method for image segmentation of sperm heads, which enables the dynamic extraction of rotation angular speed as a criterion for optically trapped sperm motility detection.The study demonstrates the reliability of the method by comparing refrigerated and normal sperm samples and identifies the optimal laser power range for maximizing the distinction between sperm.This research provides a strong foundation for subsequent sperm selection using optical tweezers and has a potential for clinical applications such as ICSI, which could improve outcomes for couples facing fertility challenges (Supplementary Information).

Sample preparation.
The human semen samples were collected from individual patients at the Reproductive Medicine Center, the First Affiliated Hospital of Anhui Medical University.All patients gave informed consent prior to being included in the study.The semen samples were diluted in fertilization medium (Cook

Figure 1 .
Figure 1.The experimental apparatus (a) and the schematic diagram of phase angle extraction (b), the white scale bar represents 10 µm.

Figure 2 .
Figure 2. Diagram of the model training process (a); showing the training set used for training, including the original image and pre-segmented image, and the image segmentation process below.Qualitative comparison among U-net++, Level set, and Clustering method (b); showing segmented result and final mask output for the trapped sperm.The corresponding quantitative scores are provided at the bottom of each prediction (IoU|Dice).Frames of a sperm trapped at 0 ms, 100 ms, 200 ms, and 300 ms (c), with the original images shown at the top, the segmented images in the middle, and the contour extracted results at the bottom.The green label represents the phase of the fitted ellipse.

Figure 3 .
Figure 3. Phase angle signal and corresponding angular speed rate for different motilities of sperm S 0 (a,c), S 1 (b,e), and S 2 (c,f) when they are trapped in the OT.Comparison of angular speed rate for sperms before (green data) and after (blue data) they are trapped.Mean values with 25-75% of data are depicted.The significance level was set at **p < 0.01.

Figure 4 .
Figure 4. Comparison of sperm angular speed at different temperatures (a), with non-refrigerated sperms on the left and refrigerated sperms on the right.Mean values ± SD with 25-75% data (green data and blue dots) are depicted.Comparison of sperm angular speed for different laser output power (b).Mean values ± SD with 25-75% data are depicted.In both of them, n represents the total sample number.

Table 1 .
Comparison of segmentation models based on IoU and cost time.