Model Cricket

0 views
Skip to first unread message

Danel Potvin

unread,
Aug 3, 2024, 10:55:06 AM8/3/24
to randmosife

LinkedIn and 3rd parties use essential and non-essential cookies to provide, secure, analyze and improve our Services, and to show you relevant ads (including professional and job ads) on and off LinkedIn. Learn more in our Cookie Policy.

Inspired by a blog post by Dale Markowitz, I used Google's Person Detection API (part of their Video Intelligence API) to create a machine learning model to recognise and classify three different cricket shots.

In my previous article, I discussed a paper which used a Long Short Term Memory network to predict which shot a batsman would play in cricket (The paper, The article), given a specific match scenario. I was keen to use an LSTM for my own purposes and by luck I came across Dale's blog and it encouraged me to use the Person Detection API for my own means.

The purpose of the API is to track the movement of key points in your body as they move through space. The output is a file that can be converted into a Pandas dataframe which shows the position of each key join at 0.2s intervals.

To create the training data, I recorded myself playing three different cricket shots; the backfoot defensive, the forward defensive and the cover drive. These were shots that I could consistently perform with similar motions which is an important consideration when training the model. Also, the forward defensive and cover drive have similar motions so it's a useful challenge to see if the algorithm could differentiate between the two shots consistently.

One of the most challenging parts of this project was understanding how to prepare my data so that it could be used to train the model. How does one label multiple rows of data with a single label? How do I make the model understand that several rows of data correspond to a specific shot? Luckily, I found help from this article which went through an example of time series classification. So after getting my data into the right format and splitting it into training and testing sets, I was ready to create my machine learning model.

As I previously mentioned, I used an LSTM network for this projet. This is because an LSTM is able to understand sequences. The model consisted of two LSTM cells with 256 nodes each, and a dropout layer in between. Finally, I had a dense layer with a "softmax" activation.

The results were extremely surprising. After using a limited training set, 38 videos per shot, the model was able to correctly classify a test set with 97% accuracy. When a further six videos were run through the model, it was able to classify six out of the eight videos correctly. Below is a video showing this.

The success of my model is extremely promising; with a very limited amount of training data, the model was able to classify almost all of the videos correctly. With more training data, I am certain the model can reach 99% accuracy, on a wider variety of shots.

Crickets and other orthopteran insects sense air currents with a pair of abdominal appendages resembling antennae, called cerci. Each cercus in the common house cricket Acheta domesticus is covered with between 500 to 750 filiform mechanosensory hairs. The distribution of the hairs on the cerci, as well as the global patterns of their movement axes, are very stereotypical across different animals in this species, and the development of this system has been studied extensively. Although hypotheses regarding the mechanisms underlying pattern development of the hair array have been proposed in previous studies, no quantitative modeling studies have been published that test these hypotheses. We demonstrate that several aspects of the global pattern of mechanosensory hairs can be predicted with considerable accuracy using a simple model based on two independent morphogen systems. One system constrains inter-hair spacing, and the second system determines the directional movement axes of the hairs.

Copyright: Heys et al. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

In this study, we considered four aspects of the structural organization of the array of receptor hairs that have been shown to display low inter-animal variance. Specifically, a) the hairs are organized into bands of uniform movement directionality along the long axis of the cerci, b) there is a systematic rotation in the movement directions of the hairs around the circumference of each cercus, c) there is a non-uniform distribution of hair densities along the length of the cercus, with greater density nearer the base than near the tip, and d) there is a slightly higher density of hairs on the ventral surface of the cercus than on its dorsal surface [2], [3], [6], [7], [8], [9], [10]. These highly-conserved global features of the filiform hair array may be the basis for a substantially increased sensitivity of the system over other possible arrangements with different global organization patterns. The fact that these characteristics are highly preserved across animals, and that they are important determinants of the cercal stimulus sensitivity, suggest that they would be susceptible to selective pressure and subject to control during development.

The general questions that motivated our analysis were as follows: Can these salient aspects of the distribution of hair densities and directional movement vectors be captured with a model based on the current understanding of how morphogen systems function? If so, what is the simplest model that can capture these complex patterns? All data used for this study were drawn from our detailed study of the functional anatomy of the filiform mechanosensory hair array on the cerci of Acheta domesticus [2].

The specific goal of the study presented here was to develop the simplest quantitative model for the development of the distribution and directional alignments of filiform hairs, consistent with the observed patterns and with the hypotheses proposed in the earlier developmental studies [1], [2], [3], [6], [14]. The biological basis for the model lies in the body of research by Rod Murphey and his colleagues [3], [8], [9], [14], [15], [16], [17]. Studies of the development of the cercal sensory system indicate that each cercus is divided into two compartments by lines of lineage restriction. One line lies along the medial surface and one lies along the lateral surface [3], thereby dividing each cercus into dorsal and ventral compartments. Studies which analyzed the results of transplanting small strips of cercal epidermis from one animal to another indicated that the two lines of lineage restriction may be serving as sources or sinks for some diffusible morphogen signal that functions to organize the global pattern of hair movement axes. Specifically, mechanosensory hairs along the medial and lateral lineage restriction lines are thought to be constrained to move in the longitudinal direction (i.e., along the long axis of the cercus), whereas hairs located away from the compartmental boundaries are thought to be constrained to move along directions that are oblique to the long axis. This general hypothesis was the basis for our model.

We modeled a segment of the surface of a cone, corresponding to an equivalent segment of the surface of a cercus. The model was developed with the goal of predicting: (a) the sites at which hair sockets would be induced on a cercus, and (b) the alignment of the movement axis for the hair associated with each of these sockets. We hypothesized that the location of the hairs is determined by developmental processes mediated by two different morphogens which diffuse throughout the 2-dimensional conical sheet, and which interact with receptors through a first-order reaction. One set of equations in the model was associated with a morphogen gradient that determines the movement vector of each hair. Specifically, the direction of motion of each hair was influenced by the distance of the hair socket from the lines of lineage restriction. The second set of equations was associated with a morphogen that determines inter-hair spacing. The morphogen mediating this patterning is assumed to originate at the base of each hair socket. This simple model yielded remarkably good replication of the pattern of the cercal filiform mechanoreceptor hair array. We note that the model was developed at a general level, and does not stipulate the chemical natures of the morphogens, nor the specific mechanisms through which their gradients are established or interpreted by target cells.

There are many examples of similar signaling mechanisms in biology (see, for example, [21], [22], and recent reviews [23], [25]). Chemical diffusion and first-order decay imply that the strength of the chemical signal decays exponentially with distance away from the source [26], , where is the distance from the hair socket generating the signal to other hairs, c0 is the concentration at the socket (), and λ is the characteristic decay distance. Since this chemical is believed to inhibit the growth of new hairs near existing hairs, we express this cost function mathematically as being proportional to the normalized concentration, . Palka et al. observed that filiform hair density is highest at the base of the cercus and lowest near the tip [5], and the hair density gradients on three cerci were recently measured quantitatively [2]. Parameters in our model were set to match these measurements: the decay distance, λ, was set to 0.2 mm at the base and was set to increase linearly to 0.4 mm at the end of the model domain near the cercus tip. The characteristic decay distance was chosen to be approximately half the distance between filiform hairs.

It has been suggested that this simple diffusion and linear, first-order degradation model is not as robust as an alternative model that has diffusion and nonlinear, second-order degradation [27], [28]. For the case of second-order degradation, the chemical signal decays at with a power law rate and is proportional to . We have chosen to use the simpler and more common first-order decay law, but we also tested a second-order degradation law in the model described below and noted that the predictions, after scaling to fit the experimental data, were similar (results not shown).

c80f0f1006
Reply all
Reply to author
Forward
0 new messages