panduan LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 28 Modified Background Subtraction Statistic Models for Improvement Detection and Counting of Active Spermatozoa Motility I G. Susrama Masdiayasa ab1 , I D. G. Hari Wisana c2 , I K. Eddy Purnama ad3 , M. Hery Purnomo ad4 a Department of Electrical Engineering, Institut Teknologi Sepuluh Nopember Surabaya b Departement of Informatics, Universitas of Pembangunan Nasional Veteran East Java c Department of Electromedic Engineering, Politeknik Kesehatan Surabaya d Department of Computer Engineering, Institut Teknologi Sepuluh Nopember Surabaya 1 susrama11@mhs.ee.its.ac.id, 2 dewa@poltekkesdepkes.ac.id, 3 ketut@ee.its.ac.id, 4 hery@ee.its.ac.id Abstract An important early stage in the research of sperm analysis is the phase of sperm detection or separating sperm objects from images/video obtained from observations on semen. The success rate in separating sperm objects from semen fluids has an important role for further analysis of sperm objects. Algorithm or Background subtraction method is a process that can be used to separate moving objects (foreground) and background on sperm video data that tend to uni-modal. In this research, some of the subproject model statistics of substrata model are Gaussian single, Gaussian Mixture Model (GMM), Kernel Density Estimation and compared with some basic subtraction model background algorithm in detecting and counting the number of active spermatozoa. From the results of the tests, the Grimson GMM method has an f- measure value of 0.8265 and succeeded in extracting the sperm form near its original form compared to other methods. Keywords: Spermatozoa, Background Subtraction, Motility, Statistic Model. 1. Introduction Sperm is an important factor in women’s pregnancy. Men should heed their sperm qualities because their sperm might not involve spermatozoa, or motility rates of the sperm lower than 40% (poor rates), as suggested by WHO [1]. Rates of sperm motility could be measured by analyzing ratio between normal and abnormal sperm cells in fertilities laboratory, then result of motility manually calculated under the microscope with some parameters, but this process might not generate constant values of motility. Some laboratories have Computer-Aided Sperm Analysis or CASA, a computerized device used for calculating motility rates. Unfortunately, CASA is too pricey to be placed in diagnosis centers throughout Indonesia. Some researchers had studied several times about detecting and calculating sperm cells [2] [3] [4] [5] [6] [7]. Hidayatullah et al [2] appraised sperms movement in the video, using a combination of Adaptive Local Threshold (ALT) and Ellipse Detection (ED) methods. Step-by- step of this method were: separating objects from the background, removing unwanted objects, then detecting ellipse which assumed as the sperm’s head. Khachane et al [3] classified men’s spermatozoa using fuzzy logic by its head, neck, and tails. The slide specimens were obtained from a stained image (an image which given special fluid), thus achieved a color differentiation between background and sperms. The sperm then recognized by converting the color space from RGB to grayscale, removing noises using a median filter, converting it to a binary image, and finally, sperms were fully recognized. Susrama et al [4] classified a sperm by its head using threshold segmentation and decision tree. The images were taken from WHO standard book [1], therefore the sperm’s shape clearly outlined, although still followed by a few noises. To differentiate between normal and abnormal sperm’s head, the image was adjusted (pre- processed) first, then segmented using Otsu threshold method, and classified using decision LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 29 trees. Li et al. [5] succeeded in order to automatically detected sperm cells in observation video produced by OpenCV microscopy. First, filter Gaussian was applied to reduce the video’s noises. Then, active sperms and another object were separated using foreground segmentation. Any affected video frames or objects were tracked using Gaussian Background Modeling. A study from Nurhadiyatna et al [6] applied methods from their previous studies when detecting sperms. The proposed method (named GMMHF) was an enhance of two combinations, Gaussian Mixture Model (GMM) algorithm, and Hole Filling (HF) algorithm. The proposed method indicating that HF algorithm generated object not so different the post- processing with Morphological Operation. By HF algorithm, noises produced at GMM phase could be removed and the “hole” on the resulted objects were filled. The research [6] used video acquired from Kokopelli Technologies [6]. A study by Imani et al. [7] using frame difference algorithm for subtracting background, but some limitedness were faced when choosing appropriate threshold values because the accuracy of output depending on the chosen threshold value. The research had improved the limitedness by using non-linear filtering diffusion in the time domain. From all the previous studies mentioned, some researchers using Gaussian Filter at pre- processing phase, but did not effective when detecting moving objects, and the average frame rates of the video used were around (sampling rate) 30 fps (frame per second). While this study used a microscopic video of human semen which had average frame rates of 60 fps and recorded by bright field microscope with 40x magnification, the use of 60 fps sampling rate due to active sperm movement can reach 5 times the size of the head, therefore to be able to represent a more accurate sperm movement, the appropriate sampling rate in the video data used is ± 50 fps. Thus, in this study, we proposed a new approach to detect and counting of active spermatozoa motility by modifying some of the statistical model subtraction algorithms (Single Gaussian, Gaussian Mixture Model, and Kernel Density Estimation) compared to ground truth images obtained from manual observations. The comparison of the results is 10x by taking the detection result on every 30 frames of the video, thus forming the frame sequences: 30, 60, 90, 120, 150, 180, 210, 240, 270, and 300. The results are analyzed using ROC Analysis to obtain the accuracy value of each method used in sperm detection. In addition, in this study, the comparison of detection and counting of active spermatozoa motility using background subtraction algorithm of basic model (Weighted Moving Average and Wren Gaussian Average), so it can be concluded with appropriate background subtraction algorithm for case detection and sperm calculation. This study contributes to further research relating to the analysis of sperm infertility rates in determining the right algorithm for sperm detection and counting. 2. Research Methodology The methodology of this study divided into five phases: system design, research data explanation, applied of background subtraction statistical model, applied of morphological operations, and explanation of ground truth image. 2.1. System Design This study had compared some methods for detecting sperm’s movement. Flowchart of this research presents in Figure 1, which showing processes for detecting and counting sperm. In the beginning, there was pre-processing for each frames using a Gaussian filter. The process then followed by background subtraction, giving a binary image which is a representation of frame’s area of moving objects. Next, applied morphological operations which consist of opening and closing, to reduce noises and making the detected sperm more well-shaped. The result of foreground mask from morphological operation would be compared with ground truth image of manual observation, to validate the detected sperm (from the previous background subtraction phase). Every BLOB region (white region in the binary image) in foreground mask image would be bound-marked and calculated to prove that the system really detecting and counting the active-moving sperms accurately. LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 30 Figure 1. Flowchart of Detecting and Counting Spermatozoa’s Movement 2.2. Research Data The video data used here was a microscopy video of semen. Semen was collected from volunteers who were willing to contribute. The semen observed under a bright-field microscope with 40x magnification of objective lenses and recorded using Point Grey FL3- U3-13S2C-CS camera. The observed data then turned into 60fps AVI video. Processes of semen observation shown in Figure 2. Figure 2. Illustration of sperm observation. 2.3. Pre-processing Preprocessing is the initial process of document classification aimed at preparing data to be structured [8]. At pre-processing phase, sperm video data that has been recorded, then performed the process of normalization and image repair. The normalization process gave a rol (the part of sperm which able to move) after modified into 256 x 256 pixels [9] grayscaled (256 level of light) image. To reduce noises in test images, the input images filtered using Gaussian Filter. The filter would generate smooth images, therefore noises and details were reduced. This process would affect the next phases. Filtering with Gaussian Filter could deal with a 5x5 kernel, as used in this study. 2.4. Background Subtraction Background subtraction is a technique for detecting foreground masks (terms for a binary image which contains information of moving objects) in the video frames or captured image. This technique is very common in image processing and computer vision system. The foreground masks calculated by comparing between the current video frame and the background model image. The general way to subtracting background is as follows: a) initializes background from N-frames to obtain the initial background model (an image without any moving objects), b) detects foregrounds (moving objects) by comparing the initial background model with current frame, c) maintenance the background sustainedly in order to refresh the background model, if Sperm Video Pre-Processing Background Subtraction Models Morphological Operations Detect & Count S1 S2 S3 Sn Generating & validating Ground Truth Masking Moving Sperms Result of Sperm’s Visualizations LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 31 any, d) repeats step b) and c) until substracting process has finished. This study used background subtraction algorithm as comparing and implementing 3 statistical model algorithms [10], those were Single Gaussian, Gaussian Mixture Model (GMM), and Kernel Density Estimation. 2.4.1. Single Gaussian This algorithm modeling every pixel based on their normal distribution which grouped by means (μ) and standard deviation (σ). In this study, the fixed constant for classifying a pixel as a background or a foreground was 0.05. 2.4.2. Gaussian Mixture Model For determining a pixel whether it is background or foreground, Gaussian Model Mixture algorithm modeled pixels using mixtures of K-Gaussian. In this study, the amount of K-Gaussian determined as 3 points. Learning rate (α) which used for renewing weight (ω) was determined by 0.01. Threshold (T) value for determining GMM model which refers to background was 9 points. 2.4.3. Kernel Density Estimation This algorithm estimates the value of probability density function of every pixel, by using estimator kernel K for the number of recent N-samples from continuously-taken intensity values at W-time of window sizes. In this study, the first foreground model formed by firstly 10 video frames, where the models were continuously refreshed. Every pixel used 50 samples. The threshold value for indicating a pixel refers to a foreground was 10e -8 . 2.5. Morphological Operation After background subtraction phase, binary images which presenting moving pixels in the video (foreground mask) were obtained. The foreground images still have some noises, and some detected moving pixels might not in a whole shape of a sperm. To solve these problems, morphological operation then applied. This study used opening and continued by closing morphological operation. Element structures on all the morphological operation in this study were ellipses with 5x5 kernels. 2.5.1 Opening Operation The opening operation consists of two processes, the first is morphological erosion then followed by morphological dilation. Erosion helped to reduce noises in foreground image and background-subtracted image. Dilation would expand the result of erosion, so the object restored to the original shape. 2.5.2. Closing Operation This phase consists of two operations, those were morphological dilation and morphological erosion. Morphological dilation process aimed to fill the space of objects, in order to connect the separate parts of a detected sperm. The last morphological erosion in this closing operation fulfilled the entire shape of detected moving sperm. 2.6. Ground Truth Spermatozoa In this study, ground truth image refers to an image containing actual regions of moving sperm in a certain video frame. Ground truth image obtained by manual observations in the regions of video frames which containing moving sperms. The region-containing frames then manually segmented and generated into a ground truth. LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 32 To ensure the availability of active-moving sperms in a region, 10 frames backward and 10 frames forward the ground truth tracked and observed. As shown in Figure 3, ground truth of 30th frame was generated by observing sperm’s movement from 20th frame to 40th frame of the video. The pixel which indicating an active sperm given 255 values (white), while the empty one will be given 0 (black). This method would produce a ground truth which would be a reference when counting sperms. Figure 3. Illustration of Generating Ground Truth Image on the 30 th Frame 2.7. Receiver Operating Characteristic Results of each algorithm were compared to the ground truth, therefore it produced three kinds of value: True Positive (TP), False Negative (FN), and False Positive (FP). True Positive (TP) refers to a condition where the sperm actually existed, and it was rightly detected. False Negative (FN) refers to a condition where the sperm actually did not exist, but wrongly detected as a sperm. False Positive (FP) refers to a condition where the sperm actually did not exist, and it was not detected. The values of precision, recall, and f-measure then able to calculate. Precision is calculated as follows: (1) Recall is calculated as follows: (2) F – Measure is calculated as follows: (3) 3. Literature Review 3.1. Gaussian Filter Gaussian Filter is a filter which is able to smoothen images, reducing noises and details in the image. On a one-dimensional image, formulas of Gaussian is written as follows: (4) Where is the standard deviation of distribution, and the average of the distribution assumed as 0. If it is applied on the 1D (1-dimension) Gaussian distribution, then it needed 2D Gaussian LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 33 distributions. Therefore, there are 2 kinds of 1D Gaussian distribution were used, both of them placed in the x-axis (x) and y-axis (y). Equations of 2D Gaussian distribution written as follows: (5) 2D Gaussian distributions in equation (5) become a Point Spread Function (PSF) for processing the image. The image would be convoluted with a 2D Gaussian function. The discrete approach needed when determining and choosing appropriate Gaussian function. 3.2. Statistical Model Background Subtraction When detecting which part of video’s scene belongs to foregrounds or backgrounds, each pixel in the frame were statistically modeled using background subtraction algorithm. All the parameters would be continuously maintained to keep the algorithm adapting towards the video scenes alteration. Three statistical methods were used in this study, those were Single Gaussian, Gaussian Mixture Model (GMM), and Kernel Density Estimation (KDE). 3.2.1. Single Gaussian Single Gaussian algorithm [11] modeling every background based on their normal distribution which categorized by means and standard deviations in YUV color space. This model needs more than one frame for counting mean and standard deviation in each color of the YUV color space. (6) (7) Where is the intensity of pixel at time period t. A pixel which belonged to a foreground should be in this rule: (8) Where is a specific constant. The pixel which assumed a foreground will be marked as 1, thus the other supposed as backgrounds and marked by 0. This method suits when the video/image taken in a light room with a little change of light intensities but failed in some cases: unexpected light intensity changes, moving background like moved trees and flags. 3.2.1. Gaussian Mixture Model Gaussian Mixture Model algorithm introduced for the first time by Stauffer and Grimson. GMM is a density model includes Gaussian functions. For each pixels, , modeled by mixture of the Gaussian distribution. Probability rates of each pixel were calculated by the following formulas: [12] (9) Where is the total amount of distribution, is weight estimation Gaussian mixture i at time period t, is average Gaussian mixture i at time period t, is covariance matrix Gaussian mixture at time period t, is Probability Density Function of Gaussian which could be written as the following formula: LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 34 (10) is a determinant of covariance, superscript T is the transpose of the matrix, -1 is the inverse of the matrix, is exponential, is phi value, and is the dimensions of scalar image or vector image (RGB). The value of K ranged from 3 to 5. Covariance matrix obtained by the equation: (11) A pixel is a distribution if the position was in the range of 2.5 standard deviations from the following distribution: (12) Vector is the average of RGB image at Gaussian-i, is the standard deviation of Gaussian-i, and is the vector of the RGB image. Component of the GMM which would continuously updated were (weight), (mean), (variance). Weight would be updated every: (13) is the learning rates and would be valued 1 for the appropriate model and 0 for the other. Mean will be updated when any models if and only if adequated: (14) The variance will be updated when any models if and only if adequated: (15) The equation for selecting the first distribution B which would be a background was: (16) 3.2.3. Kernel Density Estimation Elgammal [12] determining Probability Density Function for each color pixels by estimator K- kernel for the number of recent N-samples of intensity values as follows: [13] (17) Foregrounds were detected by the following rules: If then the pixel is a foreground. Other than that, the pixel categorized as a background. This algorithm works like GMM, in the sense of being able adapting to multi-modal backgrounds, however, did not estimate parameters of Gaussian. 3.3. Mathematical Morphology Morphology is a branch of image processing which is purposed for analyzing images. Morphological operations based on the regions of the image (segments). Because it is focused on the object’s morphology, this technique usually applied on binary images (only have 1 and 0 pixel values). This is frequently operated only on the interest parts of an image. Segmentation achieved by distinguishing between the object and the background, sometimes using thresholding and turning the grayscaled image into a binary image. The result of the morphological operations generally would be considered for further analysis. Morphological operations include: contour tracing, dilation, erosion, closing, opening, filling, connected- component labeling, and skeletonization. LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 35 4. Result and Analysis The xperiment result shown here were pre-processing results, statistical model of background subtraction results, morphological operation results, and simultaneously of detecting and counting from ground truth of sperm, which would be analyzed by receiver operating characteristic. 4.1 Pre-processing Results The image was processed at pre-processing phase using filter Gaussian with 5x5 of kernel size. The input was captured frames of the video. Sample of the frame was showing in Figure 4 (a) and Figure 4 (b) referred to the frame which had already pre-processed. Pre-processing phase aimed to reduce white noises effect, blur images, and decrease image details. Figure 4. (a) Original frame of sperm video, (b) Frame which had already pre-processed 4.2 Background Subtraction Results The result of background subtraction phase was foreground masks, a binary image which represents moving pixels in the video. In this study, foreground mask referred to the moving sperms. Three background subtraction methods had tested to detect moving sperms. The results, including explanation, opportunity, and challenges of those three background subtraction method, were present below. The red boxes indicating samples of detected moving backgrounds, and the yellow boxes indicating samples of detected moving sperms. Further explanations for each background subtraction methods were present below. 4.2.1 Single Gaussian When detecting which pixels in the frame are foregrounds, this algorithm modeled every pixel based on their normal distribution which classified based on their averages (μ) and standard deviation (σ). Figure 5 (b) showed the foreground mask of the moving sperms was generated by this algorithm. Seen in Figure 5 (b), a few moving backgrounds correctly detected as backgrounds. This could be seen in Figure 5(b), where the red boxes did not have white areas. Active sperms in the yellow boxes were not detected separately and surrounded by fewer noises. If compared to the other three background subtraction algorithm, this Single Gaussian produced a foreground mask which having more perfect-shaped of detected sperms and fewer noises. Those facts indicated that Single Gaussian was suitable and appropriate for detects moving sperms. 4.2.2 Gaussian Mixture Model Gaussian Mixture Model algorithm classifying pixel to a background or foreground based on the mixture of K Gaussian. Foreground mask of the moving sperms as the output of this algorithm shown in Figure 5 (c). The detected moving sperms in the yellow boxes were not appearing separately as using basic- model background subtraction algorithm. Resulted foreground mask by this algorithm was LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 36 equivalent to the foreground mask from Single Gaussian. Although the sperm’s head completely detected, however, Gaussian Mixture Model produced more noises. A few of moving backgrounds also wrongly-detected as foregrounds, when it should be backgrounds. Seen from the Figure 5 (c), there were little-white noises above the red boxes which indicate the existence of moving objects. 4.2.3 Kernel Density Estimation This algorithm estimating probabilities of the density function of each pixels using estimator K- kernel for the number of recent N-samples from intensity values taken continuously at W-time size window. Foreground mask of the moving sperms as the output of this algorithm shown in Figure 5 (d). Active objects inside the red boxes erroneously detected as foregrounds, when it should be backgrounds. Moving sperms inside the yellow boxes appeared separately with some noises around it. The detected objects seem did not have whole form, vague and noisy. This result did not happen when applying the other background subtraction method. Seeing overall frames, every detected sperm surrounded by noises on the sperm’s head. Figure 5. (a) Ground truth image, (b) Result of foreground mask by Single Gaussian algorithm, (c) Result of foreground mask by Gaussian Mixture Model algorithm, (d) Result of foreground mask by Kernel Density Estimation algorithm 4.3 Morphological Operation Results This study had applied sequenced morphological operation, started with Opening Operations and finished by Closing Operations, in order: erosion – dilation – dilation – erosion. Opening purposed to reduce noises on the foreground mask as the result of background subtraction, and also restore the object after reduced it noises (erosions). Closing aimed to fill the holes in order to link any separates part and completing the shape of detected sperms. The input for this morphological operations was foreground mask as the result of background subtraction process, where it still has noises and some objects were separately detected. Morphological operations would produce a clean image without noises, also enhanced the detected object to be more combined, therefore every blob (binary large object) could be a representation of moving sperms. Each of background subtraction methods produced three different foreground masks, exactly, outputs of morphological operation would be various, which seen in Figure 6. 4.4. Detection and Calculation Sperm Test After passed morphological operation phase, the foreground mask assumed was already in a whole form and clean from noises. Every blob in the foreground mask represented valid moving LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 37 sperms. For visualization purpose, the detection process of all the BLOBs based on it contours, therefore information of contours shape, number of all the contours, and center points of the detected sperm would be recorded. The information helped the system to bound the object with a box (bounding box) and sequenced it. It proofed that the system already made an achievement in order to detect and calculating sperm accurately. Figure 6 (a) Result of foreground mask after the morphological operation by Single Gaussian algorithm, (b) Gaussian Mixture Model algorithm, (c) Kernel Density Estimation algorithm The result of detection and calculation would be evaluated by comparing it with the result of ground truth’s manual calculation. Comparison processed 10 times by selecting and collecting every 30th frame, then grouped into an array with sequences: 30th, 60th, 90th, 120th, 150th, 180th, 210th, 240th, 270th, dan 300th. Result or comparison then analyzed using ROC Analysis, hence the outputs of analysis were: True Positive (TP) which referred to a condition where the sperm actually existed and it is rightly detected, False Negative (FN) which referred to a condition where the sperm actually did not exist but wrongly detected as a sperm, False Positive (FP) which referred to a condition where the sperm actually did not exist and it was not detected. After results of ROC analysis had collected, then the precision, recall, and f-measure from each algorithm used were calculated. The calculation would indicate the most suitable background subtraction algorithm for the detection and calculation of moving sperms. Table 1 and Figure 7 showed the result of experiment of each background subtraction algorithms, which Figure 7(a) referred to the Single Gaussian, Figure 7(b) referred to the Gaussian Mixture Model, Figure 7(c) referred to the Kernel Density Estimation, and Table 1 listed the comparison between results of experiment with those three algorithms and the ground truth. Figure 7. (a) Visualization of detected and counted sperm cells with Single Gaussian algorithm, (b) Gaussian Mixture Model, and (c) Kernel Density Estimation 4.6 Experiment Results The precision, recall dan f-measure value of each tested background subtraction algorithms would be calculated and compared. The result of comparison process of the values presented in Table 1. Figure 8 also presented the comparison in a graphical form. LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 38 Table 1. Calculation result of the precisions, recalls, and f-measures Background Subtraction Models Algorithm Test Results of sperm detection and calculation Results of validation process True Positive False Negative False Positive Precisio n Recall F- Measure Basic Model Weighted Moving Average 23 89 0 1 0.2053 0.3407 Wren Gaussian Average 74 38 0 1 0.6607 0.7956 Statistical Model Single Gaussian 112 0 417 0.2117 1 0.3494 Grimson GMM 112 0 47 0.7044 1 0.8265 Kernel Density Estimation 112 0 73 0.6054 1 0.7542 Figure 8. Graph of f-measures values 5. Conclusions This study presented detection and calculation of human’s sperm using three statistical background modeling and subtraction algorithms. The result of experiments showed that all the tested statistical model background subtraction algorithms were able to detect and calculate moving sperms in the video frames, with only a few noises on the generated foregrounds. The moving backgrounds were exactly detected as backgrounds (not as foregrounds), and the shape of extracted sperms more perfect. When detecting moving sperms, Grimson Gaussian Mixture Model (GMM) resulted in 0,8265 f-measures. This was the highest result than the other two statistical background modeling and subtraction algorithms tried. The result indicating that GMM algorithm was appropriate for the case of detecting and calculating moving sperm cells because it succeeded in facing challenges and bringing advantages to the case. Kernel Density Estimation algorithm reached 0.7542 f-measures value, and Single Gaussian reached 0.3494 f- measures. Comparison between Wren Gaussian Average and Gaussian Mixture Model as two basic background subtraction algorithms, the differences were 0.0723. This indicated that basic background subtraction algorithms were also able to use in the case of detection and calculation of moving sperm. References [1] World Health Organization, WHO laboratory manual for the examination of human semen, Fifth Edition, Cambridge University Press, 2010. [2] P. Hidayatullah and M. Zuhdi, “Automatic Sperms Counting using Adaptive Local Threshold and Ellipse Detection,” in proceeding International Conference on Informat Technology Systems and Innovation (ICITSI)-IEEE, 2014, pp. 56–61 
 LONTAR KOMPUTER VOL. 9, NO. 1, APRIL 2018 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2018.v09.i01.p04 e-ISSN 2541-5832 39 [3] M.Y. Khachane, R.J. Ramteke, and R.R Manza, “Fuzzy Rule Based Classification of Human Spermatozoa”, in proceeding International Conference on Electrical, Electronics, Signals, Communication and Optimization (EESCO), 2015, pp. 1-5. [4] I. G. Susrama, I. K. Eddy Purnama and M. H. Purnomo, “Teratozoospermia Classifi- cation Based on the Sperm Head Using Otsu Threshold and Decision Tree,” Journal Matec Web Of Conferences 58, 2016, pp.03012–03019. 
 [5] Q. Li, X. Chen, H. Zhang, L. Yin, S. Chen, T. Wang, S. Lin, X. Liu, X. Zhang, and R. Zhang, “Automatic human spermatozoa detection in microscopic video streams based on OpenCV,” 5th International Conference on Biomedical Engineering and Informatics (BMEI), 2012, pp. 224- 227. 
 [6] A. Nurhadiyatna, A. L. Latifah, D. Fryantoni, T. Wirahman, R. Wijayanti, dan F. H. Muttaqien, “Comparison and Implementation of Motion Detection Methods for Sperm Detection and Tracking”, International Symposium on Micro-Nano Mechatronics and Human Science (MHS), 2014, pp. 1-5. [7] Y. Imani, N. Teyfouri, M. R. Ahmadzadeh and M. Golabbakhsh, “A New Method for Multiple Sperm Cells Tracking”, Journal of Medical and Signals Sensors, Vol. 4, No.1, pp. 35–42, 2014. 
 [8] I. G. A. Socrates, L.A. Afrizal, A. M. Sonhaji, “Optimasi Naïve Bayes Dengan Pemilihan Fitur Dan Pembobotan Gain Ratio”, Lontar Komputer: Jurnal Ilmiah Teknologi Informasi, Vol. 7, No. 1, pp. 22-30, 2016. . [9] N. L. W Sri Rahayu, “Deteksi Batik Parang Menggunakan Fitur Co-Occurrence Matrix Dan Geometric Moment Invariant Dengan Klasifikasi KNN”, Lontar Komputer: Jurnal Ilmiah Teknologi Informasi, Vol. 7, No. 1, pp. 22-30, 2016. [10] A. Sobral, A. Vacavant, “A comprehensive review of background subtraction algorithms evaluated with synthetic and real videos”, Journal Computer Vision and Image Understanding, Vol. 122, May 2014, pp. 4–21, 2014. [11] J. Vaněk, L. Machlica, J. Psutka, “Estimation of Single-Gaussian and Gaussian Mixture Models for Pattern Recognition”, 18th Iberoamerican Congress, Proceedings CIARP, Havana, Cuba, Vol. 8258, pp. 49-56, 2013. [12] A. Elgammal, D. Harwood, L. Davis, “Non-parametric Model for Background Subtraction”, 6 th European Conference on Computer Vision, Dublin, Vol. 1843, pp. 751-767, 2000. [13] Y. Benezeth, P-M. Jodoin, B. Emile, H. Laurent, C. Rosenberger, “Comparative study of background subtraction algorithms”, Journal of Electronic Imaging, Vol. 19, No. 3, pp. 1-31, 2010.