{'fraction_non_alphanumeric': 0.026169181196735627, 'fraction_numerical': 0.009365495226909989, 'mean_word_length': 4.542981138374228, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A robust sperm cell tracking algorithm using uneven lighting image ﬁxing and improved branch and bound algorithm

An accurate and robust sperm cells tracking algorithm that is able to detect and track sperm cells in videos with high accuracy and efﬁciency is presented. It is fast enough to process approximately 30 frames per second. It can ﬁnd the correct path and measure motility parameters for each sperm. It can also adapt with different types of images coming from different cameras and bad recording conditions. Speciﬁcally, a new way is offered to optimize uneven lighting images to improve sperm cells detection which gives us the ability to get more accurate tracking results. The shape of each detected object is used to specify collided sperms and utilized dynamic gates which become bigger and smaller according to the sperm cell’s speed. For assigning tracks to the detected sperm cells positions an improved version of branch and bound algorithm which is faster than the normal one is offered. This sperm cells tracking algorithm outperforms many of the previous algorithms as it has lower error rate in both sperm detection and tracking. It is compared with six other algorithms, and it gives lower tracking error rates. This method will allow doctors and researchers to obtain sperm motility data instantly and accurately.

The lab technician should specify the start point for tracking. This algorithm works well, but it may fail if several collisions occur in highly concentrated samples.
In 2006, Shi et al. presented a robust single sperm cell tracking algorithm [2]. It creates a region of interest around the selected sperm and uses a modified four-class thresholding method to detect the sperm. Nearest neighbour, speed check and collision detection features are used to track the sperm. The algorithm provides a very good result in tracking the sperm but it needs to be trained by the statistical measurements of normal deviations from closely swimming sperm cells to create costs functions to choose the most likely association before and after a collision occurs.
In 2008, Sørensen et al. used a combination of Kalman filter and particle filter to track multiple human spermatozoa in photo-contrast images [3]. For assignment they used Hungarian algorithm with rectangular cost matrix. The costs were calculated using hidden Markov models. This algorithm has a very good tracking results but sometimes labels swap occurs after collisions between sperm cells. In 2011, Ravanfar et al. focused on solving sperm cells collisions by using particle filter for tracking and Watershed algorithm for segmentation [4]. They used a common camera to take videos to make it easier for laboratories to use the algorithm. An adaptive temporal median filter was used to extract the background of each frame. In addition to particle filter they used knowledge based constrains to estimate collisions, regardless of the sperm head orientation.
In 2013, Liu et al. presented a multi-sperm tracking algorithm [5]. It tracks sperm tail in addition to sperm head. And they detected that there is a correlation between sperm tail beating amplitude and sperm velocity. In 2014, Nurhadiyatna et al. made a comparison between multiple sperm cells detection and tracking algorithms [6], and they got a result that Gaussian mixture model with hole filling algorithm was the best for detection step. In the same year, Imani et al. used frame differencing to extract the background and proposed an improved version of a non-linear diffusion filtering to smooth the image without removing sperm cells edges [7]. They used Hungarian algorithm to make the association. The accuracy of the algorithm is 97% if the sperm cells count is less than 10, but it does not succeed with highly concentrated samples.
In 2015, Jati et al. used particle swarm optimization to track one sperm cell [8]. They used search window technique to reduce the search space. The search window should be tuned carefully because it depends on data and frame resolution. Wrong size for search window will decrease the performance, so the precise size for search window is necessary to get optimal performance.
Beya et al. created a dictionary using SURF, HOG and LBP features with bag-of-words approach and support vector machine SVM classifier to improve the detection step, and they used mean shift filter for tracking step [9]. The results show that this algorithm has high precision and accuracy with low RMSE. In 2016, Jati et al. utilized Kalman filter to estimate sperm cells positions [10]. Then they used Hungarian assignment method to assign each new detected sperm to the correct trajectory. For sperm cells detection they used noise reduction filter. After that they applied Otsu's method for thresholding. To find x-y position for each sperm they tried to find the maximal intensity pixel. Low frame rate videos were used to test the algorithm. It has 90% accuracy in detection step but sometimes it swaps labels between closely swimming sperm cells.
In 2017, Hesar et al. made a modified version of Gaussian mixture probability hypothesis density (GM-PHD) filter to make it able to work with the non-linear movement of the sperm cells [11]. They used local thresholding with sliding window pixel by pixel to segment sperm cells. and they got good results in tracking collided sperm cells. In 2017, Urbano et al. also presented a robust and accurate method for tracking sperm cells in recorded videos [12]. The method starts with smoothing the image with Gaussian filter, then they used Mexican hat filter to enhance the sperm cells in the image. To binarize the image, they used Otsu's method, and after that they used blob analysis to detect sperm cells positions. For sperm cells assignment they presented a new method utilizing the join probabilistic data association filter. But this assignment method has high computational cost. So, they used a clustering algorithm to divide the assignment problem into smaller ones. Urbano et al.'s algorithm was robust. But they said that they only processed two frames in one second. So, the algorithm was not fast enough to work with live video stream coming from a camera.
In 2018, Arasteh et al. used a hybrid dynamic Bayesian network HDBN to solve the tracking problem [13], and they used Munkres algorithm for assignment. They said that their algorithm was better than all other sperm cells tracking algorithm, but it is slow and needs a few seconds for processing one frame. In the same year, Imbachí et al. developed the first version of open-source software for sperm cells tracking [14]. The algorithm utilized Kalman filter for each track. To handle occlusion, they used a simplified occlusion handling method. In 2018, Masdiyasa et al. also presented a new method for sperm cells tracking [15]. They used frame differencing to extract the background, then they used Otsu's method for thresholding. After that they made some morphological operations to remove noise. At tracking step, they checked the tracking paths using linear regression.
Wang et al. compared four algorithms Nearest Neighbour (NN), probabilistic data association (PDA), joint probabilistic data association (JPDA) and joint probability data association filter with track-coalescence-avoiding (JPDA*) [16], and they said that (JPDA*) has the best performance, but it has high Computational Complexity. In 2019, Mostajer et al. presented a new sperm cells tracking method [17]. It starts with detecting sperm cells by a hybrid segmentation method that depends on Kittler and modified-Kittler thresholding methods. Then they removed the non-motile sperm cells form the detections to make tracking step easier and simpler. For tracking, they used an enhanced version of adaptive window average speed AWAS algorithm. They said that this algorithm has superior accuracy and higher speed to the other competitive algorithms, but for low density samples Kalman filter works better than AWAS algorithm.
Qi et al. also presented another sperm tracking algorithm utilizing Gaussian mixture model GMM for segmentation and tracking [18], and they got good results for detecting forward progressive. For counting the non-progressive sperm cells, they used threshold segmentation which is not reliable for noisy images. Separating the motile sperm cells processing from nonmotile sperm cells makes tracking step easier and simpler, but it will need more calculations to determine the non-motile sperm cells. And it may have errors if the non-motile or died sperm cells are moving slowly in the liquid. This paper presents a new sperm cells tracking method that starts by fixing the image light. Then it utilizes Otsu's method to binarize the fixed image. After that, it uses a method similar to [19] to find the contours of the detected objects. Based on the size and shape of each contour, a decision will be made to determine if it is a sperm cell, collided sperm cell or nonsperm object. Every collision is considered as two detections before the assignment (association between the last position of each track and the newly detected sperm cells positions). For assignment, an improved version of branch and bound algorithm (B&B) is proposed. Three results will be obtained from the assignment (assigned tracks, unassigned tracks, and unassigned detections). For the assigned tracks, their Kalman filters

FIGURE 1
Algorithm block diagram will be updated by the newly detected positions and each position will be saved in the corresponding track. For the unassigned tracks, only the estimated position will be saved in the corresponding track. For the unassigned detections, if this detection is not a collision, a new track will be initialized with a new Kalman filter. When the detection is collision, it means that it is added two times to the detections vector. If none of the two added detections has been assigned to any track, one new track will be initialized with a new Kalman filter.

MATERIALS AND METHODS
We present a robust and adaptive sperm detection and tracking method, which gives accurate detection and tracking results for tens of motile sperms in the recorded videos or even in live stream. In addition, it is able to deal with videos taken from multiple cameras, or even videos taken with bad acquisition conditions.
The most difficult problem in tracking sperms is to track closely swimming sperm cells or to track sperms whose trajectories intersect. In the suggested method, uneven lighting images are fixed to get a clear and precious foreground. Collisions can be detected, and every sperm can be assigned to its correct track after the collision happens. An improve version of the (B&B) algorithm is also suggested to assign newly detected sperms positions to the estimated tracks. This assignment algorithm takes in consideration the cost of not assigning a track to any detected sperm. For each track, a Kalman filter is used to estimate the new position of the track. This algorithm is tested by coloured and greyscale videos of various resolution which have been taken by different cameras and different magnifications. Figure 1 shows the algorithm block diagram.
While tracking sperms, trajectories are made for each one, and used to calculate the important sperm motility parameters like curvilinear velocity (VCL), straight line velocity (VSL), average line velocity (VAP), linearity of progressive motility (LIN), curvilinear path wobbling (WOB), average path straightness (STR), the average rate of the curvilinear path crossing the average path (Beat Cross Frequency BCF), amplitude of lateral head displacement (ALH), and mean angular displacement (MAD). These parameters can be used to classify multiple sperms in the recorded videos, and they give us the percentage of progressive motility and total motility. They play important role in determining male fertility, and they can be used in semen production units.
To specify the location of each sperm cell, a processing algorithm was made to enhance the image before binarizing it to get the foreground. The code was written in python with the help of OpenCV library. The recorded videos were in AVI format with multiple dimensions (640 × 480) pixels and (768 × 576) pixels. Frame rate is 25 for some videos and 50 for others. Two coloured videos were taken using phase contrast Olympus BX43 microscope (400× magnification) with Basler piA640-210gc GigE camera. The coloured videos are clear and have green background. Every sperm has a dark grey ellipse head and plain tail. There is a blur liquid moving around the head of the motile sperm cells. The other videos were taken using dark field microscopes (300× magnification). These videos were greyscale where sperm cells, other obstacles and debris appeared in white colour and the background was dark grey. Every sperm cell had ellipse head with blur tail. The videos were taken for multiple species such as bull, stallion, and ram. Ten videos for bull sperm cells. Five videos for stallion and five for ram.

Sperm cells detection
The most important step in sperm cells motility analysis algorithms is the sperm cells detection step. If some sperm cells were missed or if false ones were detected, this will extremely affect tracking and lead to higher error rate in calculating sperm cells motility parameters.
In previous studies, multiple methods are used. Some algorithms depend on filtering the image by low pass filter like Gaussian filter multiple times to reduce noise and then they apply Laplacian of Gaussian filter. Other algorithms enhance the image by applying contrast stretching. After that they apply global thresholding like Otsu's method, or local adaptive thresholding; and sometimes they use ellipse detection algorithm after thresholding. Some algorithms are only interested in motile sperm cells, so they use methods like Gaussian mixture model (GMM) to detect the sperms.
We present a new method to enhance the image and fix uneven light in sperm cells images. The ideal sperm cells image has two classes in general, the background and the sperm cells. The background has single intensity value and sperm cells are small. So, if the image is divided to a 4, 8 or n rectangles they should have the same average. The difference between the average of every part and the average of the whole image will be calculated. Then, the light difference of the image will be extracted and after that this light will be smoothed by average filter. And the last step will be re-adding the fixed light difference to the image.
These steps are illustrated in Equations (1)- (5). And as shown in Figure 2, the original image is in (a). In (b), the light difference. In (c), the light difference after smoothing. The final step in (d) is to re-add the light difference to the original image to get the fixed one.
where, Im is the original image, and AvgIm is the average image.
Average is the mean of the original image. LightDi f is the light difference. FixedLightDi f is the fixed light difference, and FixedImage is the fixed image. M and N are the image's height and width, w is window size. The most difficult thing in image segmentation is to choose the right threshold. But with this method this step becomes very easy by fixing the image light before. To see the result of this method, we compare it with applying Otsu threshold directly to the original image. In Figure 3 the difference between the original image and the fixed image histograms is shown. The background becomes a single big pulse and the segmentation process becomes easier. And as shown in Figure 4, the suggested detection method gives us accurate segmentation of sperm cells when we apply Otsu thresholding.
After getting the black and white image, sperm cells' tails and the small particles will be removed by applying some morphological operations. Erosion will be applied by (3 × 3) disk shaped structural element twice. Then dilation will be applied by the same structural element. The result is shown in Figure 5a.

Collision detection
To detect the positions of the sperm cells, most of the previous studies used blob analysis algorithm. They were concerned about the sperm cells positions. In the suggested method, the sperm shape can be accurately detected, so the shape of every sperm can be analysed. So, we apply a method similar to Suzuki [19] algorithm which does a topological structural analysis of  binary images to find the contour of each object in the image. Figure 5b shows the contour of each sperm in the image. The centre and the area of each contour will be calculated. Then the convex hull algorithm [20] for each contour will be applied to find the smallest convex polygon that contains all the points of the contour. After that the setps in Table 1 will be applied to classify each contour. Average sperm head area ma = Average of detected contours areas. This value can be dynamically calculated because sperm cells have similar head shapes and sizes. Or it can be fixed to a specific number, because the average sperm head area of a specific species can be precalculated if we fix the magnification in the microscope to a specific valued. So, the user can specify it before starting the algorithm.
Minimum Sperm Head Area mina = ma/2. Maximum Sperm Head Area maxa = ma× 3. In this algorithm, for every frame the mean area for all contours will be calculated and used to specify the minimum and maximum area for sperm cells. Secondly, the convex hull area and centre for each contour will be calculated. Then every contour will be checked to decide whether it is a sperm or not. If the area of the current contour is between the minimum and maximum, then this contour represents a sperm cell. After that, the existence of collision or occlusion at this contour will be checked. If the contour area is big enough, it represents two sperm cells not only one. If a big difference between the contour's area and its convex hull area is detected, it means that the current contour is not convex, and it represents a collision between two or more sperm cells. The constants a and b will be controlled by the user.

2.3
Sperm cells tracking

Kalman filter
In order to track sperm cells, a model which can predict the next position of a sperm cell depending on its previous positions is needed. This is very hard and complex to achieve because the abnormal sperm cells in general do not follow a regular physical model. So, Kalman filter is used as an approximated model to predict the new position for each sperm. One Kalman filter will be initialized for each sperm (track). This Kalman filter will predict the position and speed of each sperm and will be corrected by the new measured position of each sperm cell. This is the suggested Kalman filter: (6) (7) are the predication equations. X is 4x1 state matrix and P is 4x4 state covariance matrix. We consider k -the predicted state noise-as zero. Q is the process noise covariance. Q is updated according to [21] where v t is the new detected position minus the predicted position of the sperm cell and + + = 1.
A is the transition matrix and dt = 1 frame rate X k is 2x1 the measured new position for the sperm cell and v k is measurement noise. v k here is considered as 0.
] , K is the Kalman gain. R k is the covariance of the measurement noise. Equations (8)- (12) are the correction equations. After predicating the new position of each sperm cell, each track should be assigned to its correct sperm cell. Multiple algorithms have been used to do this like nearest neighbour, where each track is assigned to the nearest sperm cell detection. Nearest neighbour algorithm is fast but not accurate. Global nearest neighbour algorithm was also used where the assignment between the tracks and the sperm cells detection is done by finding the minimum cost of assigning each track to one sperm cell detection taking in consideration that the track may not be assigned to any sperm. It is fast and accurate. Multi-hypothesis tracker uses all the history of measurements for each track to assign the track to its new correct sperm cell detection. Whereas joint probabilistic data association filter uses only the previous state to find the correct assignment. But both of MHT and JPDAF have high computational complexity.

Assignment algorithm
In the proposed tracking algorithm an improved version of branch and bound algorithm is suggested as shown in Table 2. It is considered as global nearest neighbour algorithm. Urbano et al. [12] have compared some tracking algorithms with some synthesis images and found that JPDAF and GNN are the best. GNN is faster than JPDAF and MHT and gives as accurate results as them when they are applied to track sperm cells. The suggested assignment algorithm is fast enough to be used to track live stream of frames coming from a camera.
In order to assign tracks to their newly detected sperm cells we need to calculate the distance between the estimated position of the track which comes from the Kalman filter and the detected sperm cells. In some previous studies statistical distance is used to calculate distance. But statistical distance is not accurate and may mislead us when we have noisy image or when we deal with sperm cells which move fast in a random way. It can suddenly turn to another direction like Figure 6. The statistical distance here will appear farther than the real distance. To solve this, we use Euclidean distance because it is accurate and gives real value. As shown in Figure 6b the sperm in the fifth position was lost and became out of gate G4.
The distance from each track predicated position to each newly detected sperm cell will be calculated. Every track has its own gate. The gate is used to reduce calculation and prevent errors in tracking. The gate of each track is a circle around the predicted position of each track. The radius of the gate is calculated again at every new frame by the following equation where b 1 , b 2 and b 3 are between 0 and 1. G 0 is the initial gate, so it will be large enough to detect the fast-moving sperms. meanSpeed i t −1 and maxSpeed i t −1 are the mean and maximum speeds of the track i at frame t−1. G i t −1 is the gate size for track i at frame t. So, this will allow the gate to shrink and expand according to the sperm cell's speed.
where i is the track's number.
j is the newly detected sperm's number.
X i k|k−1 is the predicted position for track i and it is multiplied by H to take only the predicted position without the predicted velocity. X j k is the measured newly detected sperm cell j position. G i is the gate for track i. DM is the distance matrix (or cost matrix). SIM is the indices matrix of sorted distance matrix For example if DM is [[90, 40, 30], [20,10,50]], SIM will be [ [2,1,0], [1,0,2]].
m is the number of tracks. n is the number of detections. Assigned detections Vector AV is a Boolean vector with length of n and the default value of every element is false.
Every node in the search tree of the improved B&B has a trackID, detectionID, pathCost, cost, and the assigned vector.
The pathCost is the cost of the path between the root node and the current node. The node cost is the pathCost plus the minimum cost from the current node to any leaf node.
The assigned vector of the node is a Boolean vector with length of n.
Available vector AL is a boolean vector with default true and its length is n (n is the detected sperm cells count). mi is the minimum index. md is the minimum distance. The cost of not assigning the track (i) to any detection will be taken in consideration. In normal B&B algorithm for job assignment problem every worker is obligated to take one job, but in the improved B&B we allow a track to be not assigned to any detection. In row 5.1, 5.2, 5.3, and 5.4 of the pseudo code: a track can be not assigned to any detection. The cost of not assigning a track to any detection will be the gate size of this track G i . Taking the indices of the sorted distance matrix (sorting rows only) and using the gate (from 1.3.1 to 1.3.4 in calculateCost function) made the branch and bound algorithm faster because we will not need too many searching steps to find the minimum cost for each row. The result vector will be the assigned detection IDs for all the tracks. If the result vector value on any track ID is −1, it means that the track is not assigned to any detection.
After that, three vectors will be extracted from the result vector: the assigned tracks vector which contains all the tracks assigned to detections, the unassigned tracks which contains all of the unassigned tracks (which have −1 value in result vector), and the unassigned detected sperm cells vector which contains all of the unassigned detection.
In GNN algorithms like Hungarian algorithm, to allow a track to be not assigned to any detection we need to double the cost matrix size. To explain that suppose that we have the following cost matrix with two detections and three tracks [ [11,15], [16,12], [11,61]] and the gate size for each track is 30. If we use Hungarian algorithm, we need to expand the matrix to allow tracks to be not assigned to any detection like this [ [11,15,30,30,30], [16,12,30,30,30], [11,61,30 In the beginning of the algorithm shown in Table 3 we will not have any track. A new track will be created for every unassigned detected sperm cell (create only one track for collided sperms in the beginning). And a Kalman filter will be created for every newly created track. The start position will be the position of the detected sperm cell.
For each assigned track, the position and velocity of the track's Kalman filter will be corrected using the new measurement by applying Equations (9)- (12).
For each unassigned track, the predicted position will be saved to the track.
The consecutive positions of each track will be saved in a coordinates list. If a track has been labelled as unassigned track three consecutive times, it will be considered as noise and deleted.

Parameters calculation
While tracking sperm cells, coordinates list (trajectories) for each track will be saved and used to calculate the important sperm motility parameters like curvilinear velocity (VCL), straight line velocity (VSL), average line velocity (VAP), linearity of progressive motility (LIN), curvilinear path wobbling (WOB), average path straightness (STR), the average rate of the curvilinear path crosses the average path (Beat Cross Frequency BCF), amplitude of lateral head displacement (ALH), and mean angular displacement (MAD). These parameters can be used to classify multiple sperms in the recorded videos. According to this classification we can calculate the percentage of progressive motility and total motility which play important role in determining fertility. Figure 9 shows the difference between VCL, VSL and VAP. Figure 8 shows VCL, VSL and VAP on a sperm cell. where VCL is in black colour, VSL in red and VAP in green colour.

Test samples
Twenty video samples were used for testing the algorithm collected from various places. They were collected by various cameras and microscopes. Ten videos were for bull, five videos for ram and five videos for stallion. They are in AVI format with multiple dimensions (640 × 480) pixels and (768 × 576) pixels. Frame rate was 25 for some videos and 50 for others. Some videos were greyscale where sperm cells and other obstacles appeared in white colour and the background was dark grey. Every sperm cell had an ellipse head with blurred tail. The coloured videos had a green background. Every sperm had a dark grey ellipse head. The code was written in python utilizing OpenCV library. The algorithm was tested on windows 10 operating system with Intel Core i5 2.60 GH and 8 GB ram. We also used the OR library test data for assignment problem to compare the branch and bound algorithm with the improved branch and bound http://people.brunel.ac.uk/ ∼ mastjjb/jeb/ orlib/assigninfo.html

Performance metrics
To test the algorithm the test parameters defined in [22] were used. Four parameters of them FP, FN, FIT, and FIO were used. All the samples have been tested by the suggested algorithm to find sperm cells count and motility parameters for every sperm. In each sample performance metrics and the average time needed for processing one frame are calculated. We also compare the suggested algorithm with six other algorithms. The source code for them is written using Matlab. Five of them use the same segmentation method. This segmentation method is taken from Urbano et al.'s paper [12]. The algorithms are the Exact Nearest Neighbour extension to the JPDAF (ENN-JPDAF), the joint probabilistic data association filter (JPDAF), the probabilistic data association filter (PDAF), global nearest neighbour (GNN) and NN nearest neighbour algorithms. The sixth algorithm is the adaptive window average speed algorithm (AWAS) [17]  The results for the algorithm are in Table 4. As shown in the result table, eight of the 20 sample videos have no tracking errors (FIT = 0 and FIO = 0). False positive error sometime occurs because of sperm-like objects. They will not affect tracking results because they will be considered as dead sperm cells. False negative error happens when a sperm cell gets lost. This happens when the sperm cell collides with large non-sperm cells or when lots of sperm cells collide. Large objects are excluded in detection steps, and Kalman filter will be used to specify the location of the lost sperm.
As shown in Table 5 the improved B&B is many times faster than normal B&B. It takes only 24 milliseconds to solve 100 × 100 problem set. In general sperm cells will not exceed 100 per frame. So, the improved B&B can work fast enough to make the suggested tracking algorithm process more than 30 frames per second. The suggested algorithm was compared with six other algorithms ENN-JPDAF, JPDAF, PDAF, GNN, NN, and AWAS [17]. As shown in the results in Tables 6 and 7, the suggested algorithm outperforms the other algorithms. The test is made on sample 1 and 2 videos. The suggested algorithm has zero tracking errors and just 4 false negative in sample 1. So, it was the best. ENN-JPDAF result is also very good with only 7 tracking errors. From results we can say that the suggested algorithm is the best in this test. Algorithms are ordered according to tracking error rates in descending order.
NN, GNN, AWAS, and the suggested algorithm are the fastest. PDAF, JPDAF and ENN-JPDAF are slower because they have high computational complexity. So, we can say that the suggested algorithm is robust, fast, and more accurate than many of the state-of-the-art algorithms. So, it can be used to work with recorded videos or live stream of images come from cameras.

DISCUSSION
The proposed algorithm outperforms most of the previous algorithms because we solve most of the weak points of the previous algorithms. In the detection step the light of the image is fixed and depending on the area and the shape of the object a decision will be made to check whether it is a sperm cell or not. Kalman filter is not enough to estimate the new position of sperm cells specially when the sperm is moving randomly. To solve this, a collision detection step is added. This step is very important because without it, we will have lots of lost sperm cells. JPDAF ellipse shaped gate which uses statistical distance is not suitable for fast non-progressive sperm cells because they move randomly, and they change their directions rapidly. The time between two video frames is not always equal. Sometimes the same frame is repeated twice when we use high frame rate to capture the video. So, the algorithms will be affected by video capturing conditions. The circular gate used by the suggested algorithm is more robust when we deal with lot of fast randomly moving sperm cells and when we deal with bad video capturing conditions. The suggested algorithm has lower complexity in detection and tracking than PDAF and JPADF, so it is working faster. As shown in Table 6 the suggested algorithm has zero tracking error and has just 4 false negative. Whereas JPDAF has 7 errors in tracking, 6 false negative, and 2 false positive.

CONCLUSION
A new fast tracking algorithm is created. It is able to track tens of sperm cells in the recorded video or even from live camera stream. It is also able to deal with bad recording conditions and bad lighting. It fixes the uneven lighting images and detects sperm cells even if they collide depending on the shape and area of the sperm cell. It accurately tracks sperm cells even if they are moving randomly. It can find the correct track for each sperm cell even if they swim near each other or if their paths intersect with lower error rate than the other algorithms. It can calculate all the important motility parameters for every sperm. It has outperformed many of the previous tracking algorithms.
In future we will work on improving a model to estimate the new position of the sperm cell better than Kalman filter. We will do this by studying the various sperm motility models to improve the performance of the tracking algorithm.