<!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>Using 2D and 3D Convolutional Neural Networks to Predict Semen Quality</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jon-Magnus Rosenblad</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Steven Hicks</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Håkon Kvale Stensland</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Trine B. Haugen</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pål Halvorsen</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Michael Riegler</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Kristiania University College</institution>
          ,
          <country country="NO">Norway</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Oslo Metropolitan University</institution>
          ,
          <country country="NO">Norway</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Simula</institution>
          ,
          <country country="NO">Norway</country>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>SimulaMet</institution>
          ,
          <country country="NO">Norway</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <fpage>27</fpage>
      <lpage>29</lpage>
      <abstract>
        <p>In this paper, we present the approach of team Jmag to solve this year's Medico Multimedia Task as part of the MediaEval 2019 Benchmark. This year, the task focuses on automatically determining quality characteristics of human sperm through the analysis of microscopic videos of human semen and associated patient data. Our approach is based on deep convolutional neural networks (CNNs) of varying sizes and dimensions. Here, we aim to analyze both the spatial and temporal information present in the videos. The results show that the method holds promise for predicting the motility of sperm, but predicting morphology appears to be more dificult.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>INTRODUCTION</title>
      <p>
        In an efort to explore how medical multimedia can be used to create
performant and eficient prediction algorithms, the 2019
Multimedia for Medicine Task [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] focuses on the analysis of microscopic
videos of human semen to predict certain quality characteristics
of spermatozoon. The challenge presents three diferent tasks, of
which we decided to focus on the tasks which are required in order
to participate this years challenge, namely, the prediction of motility
task and the prediction of morphology task. Motility and
morphology are two metrics which are commonly used to determine the
quality of a semen sample. Motility is the analysis of how each
spermatozoon moves and is primarily split into three diferent
categories; progressive, non-progressive and immotile. Morphology
refers to the shape and size of the sperm and may be split into three
groups; sperm with head defects, tail defects, and midpiece defects.
More information about the dataset can be found in the original
publication [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
    </sec>
    <sec id="sec-2">
      <title>APPROACH</title>
      <p>Motility and morphology are properties of sperm which appear
diferently in the videos human semen. Motility may be dificult
to assess looking only at the spatial dimension, as it is heavily
dependent on the temporal information present in a video. By
contrast, morphology is highly dependent on the visual features of
the sperm and not necessarily their movement, although there may
be some correlation between the the movement and the morphology,
i.e., a sperm with a tail defect may move slower. Consequently,
predicting these two aspects of semen require diferent approaches.
To preserve the temporal and the spatial information in a video
when predicting motility, we use 3D convolutional neural networks
(CNNs). When predicting morphology, we discard the temporal
information and make a prediction based on a single frame using a</p>
    </sec>
    <sec id="sec-3">
      <title>Motility</title>
      <p>
        We present two methods for predicting the motility. First, we use
a simple 3D CNN to see how well a model using just a few layers
performs on this task. Second, we present a deeper and more
complex 3D CNN to see how this improves over the simpler model. The
simple model uses a very shallow network architecture consisting
of only two convolutional layers. Each convolutional layer extracts
32 filters using a kernel size of 4 × 4 × 4 and 5 × 5 × 5 respectively,
which the output is then passed to a fully-connected layer before
making the prediction. The complex model consists of three
consecutive convolutional blocks, where each block is made up of three
convolutional layers and a pooling layer to reduce the spatial and
temporal dimensions. Following the conventions of Li et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], we
add a 1 × 1 × 1 convolutional layer at the end of the block to act as
a pixel-wise fully-connected layer over the filters. The architecture
for the complex and simple model can be found in Figure 1c.
      </p>
      <p>Due of the limited amount of data, we perform data augmentation
during training. First, we extract 20 random samples from a single
data point for which we perform several augmentation techniques
including random crops, noise injection, and vertical/horizontal
lfips. To decrease training time, we first downsample the resolution
of each sample to 128 × 171 pixels for both the training and the
validation dataset, then we randomly select samples of consecutive
15 frame intervals and randomly crop the image to 128 × 128 pixels.
The frame samples are then randomly flipped both horizontally and
vertically with a probability of 0.5 each. Finally, we add some noise
injecting each pixels with some random values selected from a
uniform distribution in the interval [−0.01, 0.01]. For validation, we
split each video into blocks consisting of 15 consecutive frames and
discard the frames that remain. Each frame block is then cropped
into a 128×128 at the upper left edge of the frame. We then calculate
the average prediction score over all blocks of a video for each video,
and take the average of these averages to get our final prediction
score. We do this to avoid weighing longer videos more than shorter
ones in our final score and rather weigh each video the same.</p>
    </sec>
    <sec id="sec-4">
      <title>Morphology</title>
      <p>
        To predict morphology, we use a relatively deep 2D CNN while
avoiding making it deep in order to avoid vanishing gradients [
        <xref ref-type="bibr" rid="ref2 ref4">2, 4</xref>
        ].
The network consists of 5 convolutional layers, each with kernel
size 4 × 4 and strides 4 × 4 and 1 × 1 alternating starting with 4 × 4.
They pad with zeros to keep it’s initial size before striding. They
      </p>
      <p>Method Fold
have 32, 128, 128, 512, and 512 filters each respectively. After the
ifnal convolutional layer, we pass the output through three
fullyconnected layers; one with 1024 nodes, one with 512 nodes and
the output layer with 3 nodes. Each layer in the network uses the
activation function ReLU, except for the output layer which uses a
linear activation.</p>
      <p>For both training and validation, data was prepared similarly to
that of the motility experiments, the only diference being that we
used a single frame to make predictions at a resolution of 240 × 320
and did not perform any cropping. We still, however, performed
noise injection with noise retrieved from the same distribution, and
random flips with using the same probabilities.</p>
    </sec>
    <sec id="sec-5">
      <title>Training</title>
      <p>
        All models were trained for a maximum of 200 epochs, only
interrupting the training if the evaluation loss did not improve over the
last 10 epochs. The models were trained using the deep learning
library Keras [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] with a TensorFlow [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] back-end. The experiments
were run on a machine consisting of a single Nvidia RTX 2080Ti
graphics card, 128 GB of RAM, and an Intel Xeon Gold 5120 CPU
clocked at 2.20 GHz. Each motility model was trained with a batch
size of 64 using the Adam optimizer [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] configured as described in
the original paper. The morphology model was trained using the
same configuration, only with a smaller batch size of 16.
      </p>
    </sec>
    <sec id="sec-6">
      <title>3 RESULTS AND DISCUSSION</title>
      <p>Looking at the motility experiments (Table 1), we see that the
complex model achieves much better results than the simple model. It
is clear that our complex model is able to extract more crucial
information from the data to make better predictions. Comparing the
complex model to the ZeroR baseline, we see a mean absolute error
(MAE) improvement of 0.0436 which shows that the deep learning
at the very least is able to learn to associate some movement of</p>
      <sec id="sec-6-1">
        <title>Input layer</title>
        <p>32 4 × 4 × 4 Conv
32 5 × 5 × 5 Conv</p>
      </sec>
      <sec id="sec-6-2">
        <title>Fully-Connected 256</title>
      </sec>
      <sec id="sec-6-3">
        <title>Prediction</title>
        <p>(a) An illustration of the
simple model architecture.</p>
      </sec>
      <sec id="sec-6-4">
        <title>Input layer</title>
        <p>m n × n × n /i × j × k
m n × n × n Conv
m n × n × n Conv
m n × n × n Conv
i × j × k MaxPool</p>
      </sec>
      <sec id="sec-6-5">
        <title>Output layer</title>
        <p>(b) An illustration of the
convolutional block used in
the complex model.</p>
      </sec>
      <sec id="sec-6-6">
        <title>Input layer</title>
        <p>32 4 × 4 × 4 Conv</p>
      </sec>
      <sec id="sec-6-7">
        <title>Conv Block 1</title>
        <p>32 5 × 5 × 5
/2 × 4 × 4</p>
      </sec>
      <sec id="sec-6-8">
        <title>Conv Block 2</title>
        <p>128 5 × 5 × 5
/2 × 4 × 4</p>
      </sec>
      <sec id="sec-6-9">
        <title>Conv Block 3</title>
        <p>256 4 × 4 × 4
/2 × 2 × 2</p>
      </sec>
      <sec id="sec-6-10">
        <title>Fully-Connected 256</title>
      </sec>
      <sec id="sec-6-11">
        <title>Prediction</title>
        <p>
          (c) An illustration of the
compelx model
architecture.
the sperms with the related motility values. For the morphology
experiments (Table 2), we see that our model fails to beat predicting
the mean value of the labels (ZeroR). It fails to learn the individual
shape of each sperm and collectively predict total of each category.
For future work, we will increase the size of the network to make it
more adaptable, which may bring other challenges such as making
the network harder to train due to the increased risk of vanishing
gradients [
          <xref ref-type="bibr" rid="ref2 ref4">2, 4</xref>
          ].
        </p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>4 CONCLUSION</title>
      <p>In this paper, we presented the work done as part of the Medico
Multimedia Task where we participated in two of the three available
subtasks. We used deep CNNs for both tasks, where we achieved an
average MAE of 0.0883 for the motility task and an average MAE
of 0.0613 for the morphology task.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Martín</given-names>
            <surname>Abadi</surname>
          </string-name>
          , Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis,
          <string-name>
            <given-names>Jefrey</given-names>
            <surname>Dean</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Matthieu</given-names>
            <surname>Devin</surname>
          </string-name>
          , Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geofrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke,
          <string-name>
            <given-names>Yuan</given-names>
            <surname>Yu</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Xiaoqiang</given-names>
            <surname>Zheng</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <source>TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems</source>
          . (
          <year>2015</year>
          ). https://www.tensorflow.org/ Software available from tensorflow.
          <source>org.</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Yoshua</given-names>
            <surname>Bengio</surname>
          </string-name>
          , Patrice Simard, Paolo Frasconi, and others.
          <year>1994</year>
          .
          <article-title>Learning long-term dependencies with gradient descent is dificult</article-title>
          .
          <source>IEEE transactions on neural networks 5</source>
          ,
          <issue>2</issue>
          (
          <year>1994</year>
          ),
          <fpage>157</fpage>
          -
          <lpage>166</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>François</given-names>
            <surname>Chollet</surname>
          </string-name>
          and others.
          <source>2015</source>
          . Keras. https://keras.io. (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Xavier</given-names>
            <surname>Glorot</surname>
          </string-name>
          and
          <string-name>
            <given-names>Yoshua</given-names>
            <surname>Bengio</surname>
          </string-name>
          .
          <year>2010</year>
          .
          <article-title>Understanding the dificulty of training deep feedforward neural networks</article-title>
          .
          <source>In Proceedings of the thirteenth international conference on artificial intelligence and statistics</source>
          . 249-
          <fpage>256</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Trine</surname>
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Haugen</surname>
          </string-name>
          , Steven A.
          <string-name>
            <surname>Hicks</surname>
          </string-name>
          ,
          <string-name>
            <surname>Jorunn M. Andersen</surname>
            , Oliwia Witczak, Hugo L. Hammer, Rune Borgli, Pål Halvorsen, and
            <given-names>Michael A.</given-names>
          </string-name>
          <string-name>
            <surname>Riegler</surname>
          </string-name>
          .
          <year>2019</year>
          .
          <article-title>VISEM: A Multimodal Video Dataset of Human Spermatozoa</article-title>
          .
          <source>In Proceedings of the 10th ACM on Multimedia Systems Conference (MMSys'19)</source>
          . https://doi.org/10.1145/3304109.3325814
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Steven</given-names>
            <surname>Hicks</surname>
          </string-name>
          , Pål Halvorsen, Trine B Haugen,
          <string-name>
            <surname>Jorunn M Andersen</surname>
            ,
            <given-names>Oliwia</given-names>
          </string-name>
          <string-name>
            <surname>Witczak</surname>
          </string-name>
          , Konstantin Pogorelov, Hugo L Hammer,
          <string-name>
            <surname>Duc-Tien</surname>
            Dang-Nguyen,
            <given-names>Mathias</given-names>
          </string-name>
          <string-name>
            <surname>Lux</surname>
            , and
            <given-names>Michael</given-names>
          </string-name>
          <string-name>
            <surname>Riegler</surname>
          </string-name>
          .
          <year>2019</year>
          .
          <article-title>Medico Multimedia Task at MediaEval 2019</article-title>
          . In CEUR Workshop Proceedings - Multimedia Benchmark Workshop (MediaEval).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Diederik</surname>
            <given-names>P</given-names>
          </string-name>
          <string-name>
            <surname>Kingma and Jimmy Ba</surname>
          </string-name>
          .
          <year>2014</year>
          .
          <article-title>Adam: A method for stochastic optimization</article-title>
          .
          <source>arXiv preprint arXiv:1412.6980</source>
          (
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Min</given-names>
            <surname>Lin</surname>
          </string-name>
          , Qiang
          <string-name>
            <surname>Chen</surname>
            , and
            <given-names>Shuicheng</given-names>
          </string-name>
          <string-name>
            <surname>Yan</surname>
          </string-name>
          .
          <year>2013</year>
          .
          <article-title>Network in network</article-title>
          .
          <source>arXiv preprint arXiv:1312.4400</source>
          (
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>