<!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>A Hybrid Approach To Stroke Detection In Swimming</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>A Ankitha Reddy</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pranav Moorthi</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Samyuktaa Sivakumar</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Shwetha S</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Prabavathy Balasundaram</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pravinkrishnan K</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Sri Sivasubramaniya Nadar College Of Engineering</institution>
          ,
          <country country="IN">India</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This research explores technology integration in sports, focusing on video-assisted performance diagnostics for swimming. Motion capture techniques, particularly using machine learning models, aim to automate stroke classification, ofering eficient analysis of swimmers' techniques. The study proposes a hybrid approach with VGG16 for feature extraction and a Random Forest classifier for stroke classification. Despite challenges stemming from limited data, resulting in an accuracy of 0.28125, the study emphasises the potential of deep learning neural networks for both feature extraction and classification with the aid of larger datasets in the context of swimming performance analysis.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>In recent times, technology has become a crucial part of the world of sports. From being used to
scrutinise and analyse athletes’ performance during their training period to identifying minor
edges that can lead an athlete to victory, cameras and performance monitoring systems are used
at every stage of the journey. Applying motion capture techniques through video cameras can
go a long way in enhancing a person’s capabilities and preventing risks of injuries and player
fatigue.</p>
      <p>In today’s day and age, video-assisted performance diagnostics in the context of swimming
have become an indispensable part of improving and enhancing a swimmer’s technique. This
sort of evaluation of stroke rates, the body postures, and the diferent phases of a stroke cycle are
of great importance to athletes to help them understand how to make movements with minimum
movement economy and maximum speed. But it is still largely done manually by replaying and
physically noting important features from the video playback. This is not only labour-intensive
but also exhausting and time-consuming. Automating this process using state-of-the-art models
will largely help in catering to swimmers and athletes who do not have the skill and knowledge
to evaluate their technique and are largely dependent on skilled experts for the same.</p>
      <p>
        Using machine learning models to detect the type of swimming stroke is an eficient way
to analyse sports performance and derive conclusions about the improvements required in
terms of technique and posture. The task [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] given to us is to classify an image into diferent
swimming styles: Freestyle, Backstroke, Breaststroke, Butterfly. All four strokes have their
specific technique, and movement economy and have diferent requirements.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        In a study by Hosseini Fani [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], swimming strokes were analysed to predict arm stroke eficiency
in videos utilising the OpenPose python library to extract joint features and angles. The
classification task utilized the Random Forest technique, achieving an accuracy of 67%.
      </p>
      <p>
        In another study on recognising basketball turning and dribbling, Zhang et al. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] introduced
lfow images to capture the relationship between basketball motions. A convolutional neural
network model was utilised with multi-feature learning to extract spatiotemporal features for
basketball turning and dribbling recognition efectively.
      </p>
      <p>
        Furthermore, a study [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] on basketball shooting action eficiency employed a Sparse Gaussian
Process Latent Variable Model for motion tracking. Classification methods included Random
Forest, Support Vector Machine, SOM neural network, and Bayesian network.
      </p>
      <p>
        A study [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] addressing stroke detection in tennis videos employed particle filters, motion
descriptors and event detectors. The process involved player tracking, extraction of
playercentred images, and the use of the Lucas Kanade algorithm for optical flow analysis. Motion
descriptors are generated, and feature detection is performed using a 3-D extension of the Viola
Jones algorithm. Training utilized the Adaptive Boosting algorithm in machine learning.
      </p>
      <p>
        Another study [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] on detecting football player activities used CNN and GCN to decipher
spatial and temporal patterns in player poses and motions and classify them based on both
visual appearances and pose configurations. The model is enhanced with data augmentation
and regularisation. The model achieved an F1 score of 0.90.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Dataset</title>
      <p>The dataset comprised 96 labeled images which were partitioned into an 80 per cent training
set and a 20 per cent validation set. The images belonged to 4 classes - backstroke, freestyle,
breaststroke, and butterfly, as shown in figures 1-4, with the class-wise distribution being 24.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Methodology</title>
      <sec id="sec-4-1">
        <title>4.1. Convolutional Neural Networks</title>
        <p>Convolutional Neural Network is a widely used machine learning model and is a fundamental
element of deep learning algorithms.</p>
        <p>
          A CNN consists of four components: A convolutional layer, an Activation operation, a
Pooling layer and a Fully Connected layer. The convolutional layer is the heart of the neural
network and is responsible for feature extraction. It involves applying a filter to the image to
identify and locate significant features. An element-wise multiplication is performed between
the two-dimensional array of weights called the filter and the two-dimensional input array and
the result is summed up. This computation is performed using a sliding window [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
        </p>
        <p>The second component of the CNN is the activation operation. This component is responsible
for recognizing specific features in the images it is being trained on and allows the network to
learn the non-linear relationships between the weighted sum of the inputs and the output. The
most widely used activation functions are Rectified linear unit (ReLU), Sigmoid and Hyperbolic
tangent functions.</p>
        <p>The third part comprises the pooling layer that is used to reduce the size of the feature map
which leads to dimensionality reduction. This sort of down sampling helps in maintaining a
lower-resolution feature map while retaining the important features that are important to the
classification task. There are largely two types of pooling: Average pooling and Maximum
Pooling.</p>
        <p>The final component is the Fully Connected(FC) layer. The FC is a densely connected layer
whose weights and biases are learned during the training process. This layer’s functionality is
to flatten the 2D feature map obtained from the previous layers into a 1D array and output a
score for each one of the classification classes.
4.2. VGG16
VGG 16 represents a convolutional neural network designed for image classification tasks.
Pre-trained on the extensive ImageNet database, this model serves as a feature extractor,
demonstrating its proficiency in learning hierarchical representations of visual features. Comprising
a total of 16 layers, VGG 16 consists of 13 convolutional layers followed by 3 fully connected
layers. The model operates by constructing a 3D tensor, which is subsequently flattened into a
2D vector before being fed into the Random Forest Classifier. The utilisation of a pre-trained
model facilitates the extraction of intricate and abstract features.
4.2.1. Random Forest
The Random Forest algorithm serves as an ensemble classification method that leverages
the collective decision-making capabilities of multiple decision trees. This method involves
the aggregation of individual decision trees to collectively determine the class output. The
fundamental unit of the Random Forest is the decision tree, and each tree is trained independently
on a randomly selected subset of the training data. An advanced form of the bagging algorithm
is employed, introducing an element of randomness to enhance the diversity of the individual
trees within the ensemble.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Implementation</title>
      <sec id="sec-5-1">
        <title>5.1. Convolutional Neural Networks</title>
        <p>The network architecture consists of subsequent Conv2D and MaxPooling2D layers, with
the Conv2D layers employing 32 filters of size 3x3 to learn the hierarchical representations.
This layer is followed by a MaxPooling2D layer with a 2x2 pooling size, providing a degree
of translational invariance. The third Conv2D layer introduces 64 filters, succeeded by a
MaxPooling2D layer with a 2x2 pooling size, resulting in a down-sampled output that is
reshaped into a one-dimensional array. The architecture includes two dense layers, helping the
model understand complex combinations of lower-level features related to diferent strokes. To
enhance regularisation, a Dropout layer with a dropout rate of 0.24 is applied. The architecture
employs Rectified Linear Unit (ReLU) activations after each convolutional layer ensuring
nonlinearity and spatial down-sampling. Additionally, Softmax activation in the final layer facilitates
the generation of output class scores through probabilistic distributions.
5.1.1. VGG16</p>
        <p>The implementation leverages the VGG16 architecture, consisting of a total of 19 layers with
16 convolutional and 3 fully connected layers. However, only the 16 layers comprising the
convolutional base of VGG16 are utilised for the specific purpose of feature extraction. The
convolutional layers employ 3x3 filters with a stride of 1, facilitating precise pixel movement.
The number of filters increases with the depth of the model, and the architecture is characterised
by multiple Conv2D and MaxPooling blocks, each contributing to the extraction of intricate
features. Max pooling is executed with 2x2 windows and a stride of 2, eficiently down-sampling
the input. Rectified Linear Unit (ReLU) functions are applied to activate the convolutional
blocks, providing non-linearity to the model. Addressing the advantages of using smaller filter
sizes, hierarchical feature learning and parameter sharing contributes extensively to capturing
ifne-grained details and reducing the risk of overfitting. The dataset was used to further train
VGG16, which was pre-trained incipiently on the extensive ImageNet dataset. Figures 5 and 6
represent the feature maps extracted in each filter before and after the application VGG16 layer.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Results and Analysis</title>
      <p>The final accuracy of the random forest model on the test data was 0.28125. This low accuracy
score is a result of training a neural network like VGG16 on a smaller dataset consisting of 96
images. To accommodate the limited nature of the dataset, we performed data augmentation
and opted to use hybrid models that combined deep learning neural networks like VGG16 for
feature extraction and traditional models like Random Forest for classification. The CNN model
was also applied on the training data which yielded a low validation accuracy of 0.30 due to the
extensive dataset requirement of the model. We aimed to extract the most significant features
by leveraging state-of-the-art technology and tuning it to fit our dataset by making changes in
the hyperparameters, but it underperformed and overfit due to the smaller size of the training
dataset.</p>
    </sec>
    <sec id="sec-7">
      <title>7. Conclusion References</title>
      <p>Through the scope of this research, we implemented a hybrid approach. The capability of the
CNN and VGG16 models to extract and capture fine-grained details was utilised in identifying
the significant features in the images consisting of swimming strokes to correctly classify them.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Erades</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Martin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. V. B.</given-names>
            <surname>Mansencal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Péteri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Morlier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dufner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Benois-Pineau</surname>
          </string-name>
          ,
          <article-title>Sportsvideo: A multimedia dataset for event and position detection in table tennis and swimming</article-title>
          ,
          <source>in: Working Notes Proceedings of the MediaEval 2023 Workshop</source>
          , Amsterdam,
          <source>The Netherlands and Online and Online, 1-2 February</source>
          <year>2024</year>
          , CEUR Workshop Proceedings, CEUR-WS.org,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>H.</given-names>
            <surname>Fani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Mirlohi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Hosseini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Herperst</surname>
          </string-name>
          ,
          <article-title>Swim stroke analytic: Front crawl pulling pose classification</article-title>
          ,
          <source>in: 2018 25th IEEE International Conference on Image Processing (ICIP)</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>4068</fpage>
          -
          <lpage>4072</lpage>
          . doi:
          <volume>10</volume>
          .1109/ICIP.
          <year>2018</year>
          .
          <volume>8451756</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>B.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , T. Wang,
          <article-title>Visual image recognition of basketball turning and dribbling based on feature extraction</article-title>
          .,
          <source>Traitement du Signal</source>
          <volume>39</volume>
          (
          <year>2022</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Ji</surname>
          </string-name>
          ,
          <article-title>Research on basketball shooting action based on image feature extraction and machine learning</article-title>
          ,
          <source>IEEE Access 8</source>
          (
          <year>2020</year>
          )
          <fpage>138743</fpage>
          -
          <lpage>138751</lpage>
          . doi:
          <volume>10</volume>
          .1109/ACCESS.
          <year>2020</year>
          .
          <volume>3012456</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>K.</given-names>
            <surname>Dokic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Mesic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Martinovic</surname>
          </string-name>
          ,
          <article-title>Table tennis forehand and backhand stroke recognition based on neural network</article-title>
          ,
          <source>in: International Conference on Advances in Computing and Data Sciences</source>
          , Springer,
          <year>2020</year>
          , pp.
          <fpage>24</fpage>
          -
          <lpage>35</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>L.</given-names>
            <surname>Lamport</surname>
          </string-name>
          ,
          <article-title>LaTeX User's Guide and Document Reference Manual</article-title>
          , Addison-Wesley Publishing Company, Reading, Massachusetts,
          <year>1986</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>P.</given-names>
            <surname>Martin</surname>
          </string-name>
          ,
          <article-title>Baseline method for the sport task of mediaeval 2023 3d cnns using attention mechanisms for table tennis stoke detection and classification</article-title>
          .,
          <source>in: Working Notes Proceedings of the MediaEval 2023 Workshop</source>
          , Amsterdam,
          <source>The Netherlands and Online and Online, 1-2 February</source>
          <year>2024</year>
          , CEUR Workshop Proceedings, CEUR-WS.org,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>