<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Tracking and Prediction Of Human Spermatozoa Motility Using Yolov8n with Greedy Shape Geometry Technique</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Muhammad Osaid</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Abdul Samad</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Omer Qureshi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Muhammad Atif Tahir</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Muhammad Nouman Durrani</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>National University of Computer and Emerging Sciences</institution>
          ,
          <addr-line>Karachi</addr-line>
          ,
          <country country="PK">Pakistan</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, we present the two deep learning methods for eficient detection and tracking of spermatozoa. In this task, human recorded video of sperm was provided by the Mediaeval task organizers. Our goal is to detect the motility of spermatozoa, for which we use two deep learning approaches. The first approach is to detect and track human sperm using Yolov8n and Byte-Track Algorithm. Its tracking speed was 80.4ms and flops were 8.7B which is outstanding. Then, we predict the motility of sperm using the Greedy Shape Geometry Technique for detecting progressive, non-progressive, and immotile sperm. In the second approach, we predict sperm motility using the provided graph data structure. We train yolov8n algorithm from scratch for the detection of healthy and unhealthy sperm which shows outstanding Mean Average Precision (MAP50) of 0.965.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Human sperm motility prediction is a complex and time-consuming task. Automation of this
task can minimize the time for the patient to see their test results. In this paper, we automate
this task by using computer vision techniques to get some accurate predictions of the human
sperm motility rate.</p>
      <p>
        Predicting sperm motility and morphology from video is a challenging task. The video
dataset has been provided with ground truth values. There is a lot of work going around related
to video classification [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], segmentation [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], and video generation [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The significance of
computer-aided sperm analysis helps automate the sperm detection task[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>Transparent tracking of spermatozoa involves the application of advanced technologies to
precisely track human sperm. By using Computer vision techniques in predicting sperm motility
rate, it will enhance the ecfiiency and accuracy. Deep Learning algorithms play crucial role in
automating the detection process, it also allows real time analysis will speed up the process
for pathologists. These types of automated AI based solutions will be available 24 hours for
patients and Patients can get their instant report because of its eficiency and speed.</p>
      <p>Analyzing sperm samples manually is a time-consuming process which requires skilled
experts with substantial training and years of experience. Manual sperm analysis is not reliable
due to limited reproducibility and susceptibility to high inter-personal variations. Tracking and
identifying sperm count in fresh samples is a complex task. Current computer-aided systems
are not reliable therefore more research is required in this area.</p>
      <p>
        The 2023 Medico task involves diferent challenges [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Detection and Tracking of sperm cells
in videos. They provided a dataset containing videos from 20 participants. We perform eficient
sperm detection and tracking, and prediction of motility on videos and graph data structures.
For prediction of motility, we introduce our own algorithm which is discussed in 3.2 .
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        This section provides a brief literature review of the previous work related to to Human
Spermatozoa task. In the paper [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], the authors presented VISEM-Tracking, a multi-modal
sperm dataset containing videos, biological analysis data, and participant data of 85 individuals.
They conducted baseline analysis to predict the motility and morphology of sperm. The authors
analyzed microscopic images of sperms to deduce indicators such as sperm count to better
understand human fertility. The main problem with sperm-related data is that it is often
restricted to share such information due to legal matters and researchers need to have sound
subject knowledge about the matter to come up with reasonable conclusions.
      </p>
      <p>
        There is an increasing use of machine learning to analyze the videos of spermatozoa [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] as
it is dificult to study their motility due to the fast-moving view. In the paper [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], the authors
provide a dataset called VISEM-Tracking which has 20 videos of 30 seconds each and comprised
of 29,196 frames. In the videos, wet semen was observed with manual bounding boxes along
with sperm characteristics. The VISEM-Tracking dataset is an extension of the VISEM dataset
[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and performs better for training supervised ML models due to the presence of annotated
bounding boxes. In addition to the sperm tracking annotation, the sperms are categorized into
three categories: “normal sperm”, “pin-head” and “cluster”. The pinhead category has small
blackheads when studied under a microscope, whereas the cluster category consists of sperm
that are grouped together.
      </p>
      <p>
        In the paper [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], the authors used a CNN to analyze sequence of frames to predict sperm
motility and categorize it into progressive, non-progressive, and immotile spermatozoa.
Subsequently, the video recordings are integrated with the participant data to determine how it may
improve performance while using diferent modalities.
      </p>
      <p>
        To solve the problem of predicting morphology and motility from videos, [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] presents two
methods: stacked pure video frames and dense optical flows of video frames. To address the
regression task, stacked dense optical flows and extracted original frames from sperm videos
were utilized in combination of modified CNNs. For modification, they included an additional
MLP layer to address the overfitting problem. The authors conducted experiments using a
pre-trained ResNet-34[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] for predicting sperm motility and morphology.
      </p>
      <p>
        In another paper [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] the authors present two deep learning techniques for predicting sperm
motility and morphology on a video dataset. First, they used autoencoder to extract temporal
features from videos and then plot those images into image space. Secondly, they used these
extracted features to perform transfer learning to predict the required morphology and motility
of human sperm. Their two-step process is diferent from previous approaches[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Approach</title>
      <p>The Medico 2023 involves diferent tasks, which are categorized below.</p>
      <sec id="sec-3-1">
        <title>3.1. Detection and Tracking of spermatozoa in Videos</title>
        <p>
          For the detection of sperm in videos, we apply the yolov8n algorithm [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. For training we used
High performance machine with Nvidia RTX 3080 GPU, 64GB RAM and Corei9-10900k CPU.
We use Cuda Version 11.7 and used Windows OS. We trained our model for 30 epochs and 32
batch size. And it gives a detection accuracy of 96.5%. For tracking the motion of sperm we
use the tracking algorithm “Byte Track”. It gives motion tracking of each sperm, which will be
helpful in predicting the motility rate.
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Proposed Algorithm for Motility Prediction on Spermatozoa Videos</title>
        <p>
          We proposed an algorithm for the prediction of motility rate on spermatozoa videos. First, we
got the detections and tracking values of each sperm in videos using a detection and tracking
algorithm as discussed in section 3.1. Then we applied greedy shape geometry technique for
predicting motility rate using tracking values of each sperm. First, if the sperm moves in a
circle, then algorithm will count it as non-progressive sperm. If the sperm is moving forward
then it counts it as a progressive sperm and if the sperm is at rest and showing no movement
then it will count it as immotile sperm. We track a sperm by its tracking values. The tracking
algorithm Byte Track [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] gives positional values of each sperm in x and y points. By applying
this simple logic we are able to get the motility predictions from the videos.
        </p>
        <sec id="sec-3-2-1">
          <title>3.2.1. Proposed Algorithm for Motility Prediction on Spermatozoa Graph Data</title>
        </sec>
        <sec id="sec-3-2-2">
          <title>Structures</title>
          <p>For motility predictions on graph data structure, we used the same approach as before. We
extract detections and tracking values of spermatozoa from graphs and then use the same
approach for predicting motility rate.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Results and Analysis</title>
      <p>The sperm motility prediction results is categorized into three classes: Progressive, Non
Progressive and Immotile sperms. Table 1 shows the prediction results of sperm motility on videos
using the proposed Greedy Shape Geometry Algorithm. As we can see progressive sperm on
video ID 66 is 3.24%. Similarly in Video ID 80 the The ration of Immotile sperm is too high
therefore Progressive sperm Count is almost zero. We also calculated the MAE, to check the our
model predicted values accuracy as shown in Table 1 and Table 2. As we can see Progressive and
Non-Progressive Motility predicted values MAE (Mean Absolute Error) is less than Immotile
Sperm Means our model is good at predicting Progressive and Non-Progressive Sperm Motility.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Discussion and Outlook</title>
      <p>Our proposed algorithm shows quite impressive results on Videos. As there is a lot of research
scope in this area, we can make a lot of improvements using diferent machine learning based
approaches like Regression, K-Nearest Neighbors (KNN) or Support Vector Machines (SVM)
based Techniques for motility prediction part. To do more accurate predictions we can use some
hybrid approaches and other SOTA Deep Learning models.</p>
      <p>In Future we will advance our algorithm by using hybrid approach in which we will
concatenate greedy shape geometry with convex hull in combination to Regression based approaches to
get better prediction results. Furthermore, tracking algorithms can be optimized using Gaussian
Mixture and Kalman Filter.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Karpathy</surname>
          </string-name>
          , G. Toderici,
          <string-name>
            <given-names>S.</given-names>
            <surname>Shetty</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Leung</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Sukthankar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Fei-Fei</surname>
          </string-name>
          ,
          <article-title>Large-scale video classification with convolutional neural networks</article-title>
          ,
          <source>in: Proceedings of the IEEE conference on Computer Vision and Pattern Recognition</source>
          ,
          <year>2014</year>
          , pp.
          <fpage>1725</fpage>
          -
          <lpage>1732</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>I.</given-names>
            <surname>Koprinska</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Carrato</surname>
          </string-name>
          ,
          <article-title>Temporal video segmentation: A survey</article-title>
          ,
          <source>Signal processing: Image communication 16</source>
          (
          <year>2001</year>
          )
          <fpage>477</fpage>
          -
          <lpage>500</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>V.</given-names>
            <surname>Thambawita</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Halvorsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Hammer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Riegler</surname>
          </string-name>
          , T. B.
          <string-name>
            <surname>Haugen</surname>
          </string-name>
          ,
          <article-title>Stacked dense optical flows and dropout layers to predict sperm motility and morphology</article-title>
          , arXiv preprint arXiv:
          <year>1911</year>
          .
          <volume>03086</volume>
          (
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>V.</given-names>
            <surname>Thambawita</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Halvorsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Hammer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Riegler</surname>
          </string-name>
          , T. B.
          <string-name>
            <surname>Haugen</surname>
          </string-name>
          ,
          <article-title>Extracting temporal features into a spatial domain using autoencoders for sperm video analysis</article-title>
          ,
          <source>arXiv preprint arXiv:1911</source>
          .
          <volume>03100</volume>
          (
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>V.</given-names>
            <surname>Thambawita</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. M.</given-names>
            <surname>Storås</surname>
          </string-name>
          , T.-L. Huynh, H.
          <string-name>
            <surname>-D. Nguyen</surname>
            , M.-T. Tran,
            <given-names>T.-N.</given-names>
          </string-name>
          <string-name>
            <surname>Le</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Halvorsen</surname>
            ,
            <given-names>M. A.</given-names>
          </string-name>
          <string-name>
            <surname>Riegler</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Hicks</surname>
          </string-name>
          , Medico Multimedia Task at MediaEval 2023:
          <article-title>Transparent Tracking of Spermatozoa</article-title>
          ,
          <source>in: Proceedings of MediaEval 2023 CEUR Workshop</source>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>V.</given-names>
            <surname>Thambawita</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Hicks</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. M.</given-names>
            <surname>Storås</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Nguyen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Andersen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Witczak</surname>
          </string-name>
          , T. B.
          <string-name>
            <surname>Haugen</surname>
            ,
            <given-names>H. L.</given-names>
          </string-name>
          <string-name>
            <surname>Hammer</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Halvorsen</surname>
            ,
            <given-names>M. A.</given-names>
          </string-name>
          <string-name>
            <surname>Riegler</surname>
          </string-name>
          ,
          <article-title>Visem-tracking, a human spermatozoa tracking dataset</article-title>
          ,
          <source>Scientific Data</source>
          <volume>10</volume>
          (
          <year>2023</year>
          )
          <fpage>1</fpage>
          -
          <lpage>8</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>T. B.</given-names>
            <surname>Haugen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Hicks</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Andersen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Witczak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. L.</given-names>
            <surname>Hammer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Borgli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Halvorsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Riegler</surname>
          </string-name>
          ,
          <article-title>Visem: A multimodal video dataset of human spermatozoa</article-title>
          ,
          <source>in: Proceedings of the 10th ACM Multimedia Systems Conference</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>261</fpage>
          -
          <lpage>266</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Hicks</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Andersen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Witczak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Thambawita</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Halvorsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. L.</given-names>
            <surname>Hammer</surname>
          </string-name>
          , T. B.
          <string-name>
            <surname>Haugen</surname>
            ,
            <given-names>M. A.</given-names>
          </string-name>
          <string-name>
            <surname>Riegler</surname>
          </string-name>
          ,
          <article-title>Machine learning-based analysis of sperm videos and participant data for male fertility prediction</article-title>
          ,
          <source>Scientific reports 9</source>
          (
          <year>2019</year>
          )
          <fpage>16770</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>K.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , S. Ren,
          <string-name>
            <given-names>J.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <article-title>Deep residual learning for image recognition</article-title>
          ,
          <source>in: Proceedings of the IEEE conference on computer vision and pattern recognition</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>770</fpage>
          -
          <lpage>778</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>J.</given-names>
            <surname>Redmon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Divvala</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Girshick</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Farhadi</surname>
          </string-name>
          ,
          <article-title>You only look once: Unified, real-time object detection</article-title>
          ,
          <source>in: Proceedings of the IEEE conference on computer vision and pattern recognition</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>779</fpage>
          -
          <lpage>788</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , P. Sun,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Jiang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Weng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Yuan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Luo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>Bytetrack: Multi-object tracking by associating every detection box</article-title>
          ,
          <source>in: European Conference on Computer Vision</source>
          , Springer,
          <year>2022</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>21</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>