Individualised Ball Speed Prediction in Baseball Pitching Based on IMU Data

Ball velocity is considered an important performance measure in baseball pitching. Proper pitching mechanics play an important role in both maximising ball velocity and injury-free participation of baseball pitchers. However, an individual pitcher’s characteristics display individuality and may contribute to velocity imparted to the ball. The aim of this study is to predict ball velocity in baseball pitching, such that prediction is tailored to the individual pitcher, and to investigate the added value of the individuality to predictive performance. Twenty-five youth baseball pitchers, members of a national youth baseball team and six baseball academies in The Netherlands, performed ten baseball pitches with maximal effort. The angular velocity of pelvis and trunk were measured with IMU sensors placed on pelvis and sternum, while the ball velocity was measured with a radar gun. We develop three Bayesian regression models with different predictors which were subsequently evaluated based on predictive performance. We found that pitcher’s height adds value to ball velocity prediction based on body segment rotation. The developed method provides a feasible and affordable method for ball velocity prediction in baseball pitching.


Introduction
Proper pitching mechanics play an important role in both success and health of baseball pitchers. In overhead pitching, the lower extremity and trunk generate and transfer energy to the upper extremity. The optimal sequential activation of body parts while pitching, known as the kinetic chain, can result in reduced elbow and shoulder stress and maximise pitching performance [1,2]. On the other hand, poor mechanics can lead to increased loading of the elbow or shoulder, and increase the injury risk. Injuries of the throwing arm, such as the ones to the shoulder and elbow, are common in the overhead pitching motion of baseball. Major League Baseball pitchers are especially prone to injury because of the throwing velocities commonly seen approaching and even exceeding 100 mph. To create such high ball velocities, high energy levels pass through the components of the kinetic chain that affect the weakest links among them, especially the elbow [3]. Therefore, there is a need for assessment of the throwing technique that enables players to throw fast pitches in the strike zone without an overload.
Throwing velocity plays an important role in a success of a baseball game. Pitchers increase their chances for success by throwing faster and diminishing the hitter's decision time of whether or not to strike the ball [4]. Furthermore, high ball velocities restrict the offense's ability to advance bases and score runs [5]. Among other parameters, ball velocity is considered an important performance measure sought after by coaches and scouts. It enables baseball players to improve their ability to play and to be noticed by coaches and scouts for higher levels of competition. Therefore, every pitcher aims to increase the ball velocity [6,7].
The pitching biomechanics in baseball is studied to improve players' performance and prevent sport-related injuries. With development of the measurement and analytical tools, pitching coaches and biomechanists can accurately analyse the rapid and complex movements during the pitching motion [8]. Although professional baseball teams have used biomechanical analysis for years already, recent advances in technology give amateur players and clubs opportunities to measure their mechanics and improve performance. Body worn sensors, such as inertial measurement units (IMUs), are a low-cost alternative to motion capture systems with passive markers, with no space limitation or cumbersome setup procedure. Portable, affordable, and easy-to-use, they monitor athlete's performance without obstructing it [9].
As the quality of the throw is mainly determined by the pitcher's throwing mechanics, we can use IMUs to measure kinematic parameters shown to be linked to ball velocity [7,8,10]. Enhancing pitching technique through the optimal position and timing of proper pitching mechanics, can result in a fast and accurate throw. Estimating ball velocity based on IMU recordings can be the first step towards assessment of the pitching technique that results in fast throws with reduced injury risk.
Ball velocity is mostly measured in high level games and in training situations. Although a radar gun gives an accurate reading of a ball velocity, a required strict protocol and high price represent a big issue for baseball clubs, especially the smaller ones. On the other hand, IMUs do not need a fixed location on the field for measuring ball velocity, thus they can be used on many different occasions. The previous studies demonstrated the potential use of IMUs for estimation of the ball velocity in different overhead-throwing sports, including baseball [11][12][13].
The use of IMUs represent a potential for the estimation of the ball speed in different on-field situations based on kinematic parameters measured by the same sensors. However, each pitcher is a unique individual and his individual characteristic may display individuality contributing to imparted velocity to the ball [7,14]. With IMUs, every throw of an individual pitcher can be recorded: during warm-up, training, before and during the game, which contributes to the element of individualisation. Therefore, in this paper, we present a method for predicting ball velocity in baseball pitching based on pitcher's kinematics measured by IMUs and individual characteristics. We investigate the added value of the individuality to predictive performance of developed models.

Participants
Data were collected from 25 baseball pitchers with a mean age of 14.7 ± 1.5, mean body height 176.91 ± 11.03 cm and mean body weight 65.6 ± 14.4 kg. Participants were recruited from the national U18 baseball team, as well as all six baseball academies in The Netherlands, at which the most talented baseball players of that region train. This research was conducted in accordance with the Declaration of Helsinki and the Department of Human Movement Sciences' local ethical committee approved the measurement protocol [ECB 2013-53]. Both participants and their parents were informed of the procedure and study aims before the start of the measurements. Informed consent was obtained from the parents of the participants before involvement in the study.

Methodology
The measurements were performed at the indoor facilities of the academies. After performing several anthropometric measurements, pitchers were given unlimited amount of time for their standard warm-up. They were instructed to prepare just as if they were going to pitch in a game. Warm-up included a general warm-up, j-band exercises, and longtoss, which is a standard warm-up for baseball pitchers before the game. The pitchers wore sneakers, athletic shorts, and no shirt. They also wore their catching glove to mimic the game situation as much as possible. After warm-up, the pitcher was instructed to perform 10 fastball pitches with maximal effort towards a catcher sitting behind home plate.
The pitching motion was recorded using two 9-DOF IMUs (MPU-9150, Invensense, San Jose, CA, USA, Accelerometer ± 16 g, Gyroscope ± 2000 deg/s). Sensors were rigidly attached to pelvis and sternum ( Figure 1) using double-sided adhesive tape and used to record body segment rotation. Every sensor was embedded in a protective casing together with a battery and SD-card, onto which the data were logged at a sample frequency of 500 Hz. IMU's gyroscope recorded angular velocities continuously throughout the participant's session. Previous studies used peak values of kinematic measures to address their effect on the ball velocity in baseball pitching [2,6,7,10]. Therefore, for the gyroscope signal, we calculated the peak angular velocity as its Euclidean norm. Each recording was manually segmented into parts containing only a single pitch. We performed the segmentation by plotting the entire gyroscope signal and locating the 10 peaks each corresponding to a pitch (see Figure 2). This was done in a similar way in [11] for ball velocity data obtained in handball. The ball velocity (mph) reached during the pitches was measured from behind the home plate using a Stalker pro 2 radar gun (Stalker Radar, Plano, TX, USA). We coupled recorded ball speed with corresponding peak angular velocities during single pitch.

Statistical Analysis
The repeated measurements of individual pitchers can be grouped into a hierarchical structure. The differences between participants arise from differences in personal characteristics, such as age, body weight, and height, that, next to the kinematic parameters of pitching mechanics, may contribute to increased ball velocity [1,2,8]. Observations in this study are ball throws nested within different participants and the link between individualand group-level is participant's indicator (ID).
Statistical models that can deal with units grouped on different levels are known as multilevel models. Multilevel models extend standard regression models to data which are structured in groups and where coefficients are allowed to vary by groups. The feature that distinguishes multilevel models from classical regression is the modeling of variation between groups. This enables us to study the effects that vary by group. Therefore, in this paper we introduce multilevel modeling as the main method for ball velocity prediction in baseball pitching. Segmenting the baseball pitches using gyroscope peaks. For the gyroscope signal, we calculated the peak angular velocity as its Euclidean norm. Each recording was manually segmented into parts containing only a single pitch. We performed the segmentation by plotting the entire gyroscope signal and locating the 10 peaks each corresponding to a pitch.
At the same time as including repeated measurements of segment rotation per participant, the multilevel approach enables us to examine the added value of the individuality in ball velocity prediction. Group-level predictors were selected among personal characteristics that were collected prior to the measurements. We addressed the high correlation between pitcher's height, weight and age. It is reasonable to expect that older pitchers will be taller and therefore weigh more. To select group-level predictors and avoid poor prediction performance due to correlation of predictors, we applied a random forest (see for instance chapter 8 in [15]), as implemented in the caret package [16]. Based on variable importance ( Figure 3) calculated with varImp from a caret package, we selected pitcher's height as a group-predictor. We developed three multilevel Bayesian regression models for ball velocity prediction using R 4.0.3 [17] and rstanarm [18,19].
In the following, y i denotes the ball speed for the observation indexed i.

Complete-pooling model (Observations)
The complete-pooling model is a single classical regression model completely ignoring group information. In other words, the model treats all ball throws as different observations of the same participant. The model is given by where {x 1i , x 2i } are individual-level predictors, namely peak angular velocity of pelvis and trunk, respectively. The complete-pooling model does not make a distinction between different pitchers and in that way neglects their personal characteristics.

Two-level varying-intercept model (Personal)
The two-level varying-intercept model is a regression that opposed to completepooling includes indicators for groups. In this model an intercept is calculated for every group and one joint slope is assumed for the entire sample. The model is given by where u j is a centered group-level predictor, namely pitcher's height. The group membership j[i] denotes pitcher j throwing a ball i. In this model pitching technique is neglected and the outcome depends only on height of an individual pitcher.

3.
Two-level varying-intercept, varying-slope model (Full) The varying-intercept, varying-slope model represents the model in which both the intercept and the slope vary by group. The model is given by and includes both individual-and group-level predictors. In both (3) and (5), the coefficient γ 0 can be interpreted as the ball speed of a ball thrown without any pelvis and trunk rotation by the pitcher of an average height. The i in (1), (2) and (4) and η j in (3) and (5) represent independent error terms at each of the two levels. All individual-and group-level predictors were rescaled to have sample variance 1. The scaling is done by dividing the centered predictor u by its standard deviation. We used scaling to transform the data to comparable values.
We used leave-one-out (LOO) cross-validation to select out of the three proposed models the model with best predictive performance. LOO resulted in a total of 224 folds as 224 pitches from 25 pitchers were included in the analysis. Following the approach in [20], the predictive performance of a model is defined as the expected log-predictive density (elpd). Predictive performance is a useful quantity in assessing a single model. It can be estimated by training the model on all observations except one and then predicting the hold-out observation. This is then repeated for all n observations where p(y i | y −i ) = p(y i |θ)p(θ|y −i )dθ (7) is the LOO predictive density upon leaving out the ith data point. If the posterior p(θ | y −i ) is summarised by B simulation from θ i,b , then we can approximate log p(y i | y i=1 ) by leading to elpd = ∑ n i=1 elpd i as an estimate for elpd. Different models can be compared against each other according to their elpd-value.
Suppose we wish to compare models M 1 and M 2 , with estimated elpd values elpd 1 and elpd 2 , respectively. Since the same set of n data points is being used to fit all models, we can use a paired estimate to compute a standard error of their difference: Here, for numbers

Results
We included in the analysis 224 pitches from 25 pitchers for which the ball velocity was recorded and sensor clipping did not occur. Characteristics of the measured ball and peak angular velocities of pelvis and trunk are summarised in Table 1. We consider the model called Observations model as base model. The other two proposed models, Personal and Full, are extensions since they have two instead of one level and they introduce the group participation that makes a distinction between pitchers of a different height. Therefore, comparing the developed models determines the contribution of the kinematic parameters related to pitching mechanics and body height of a pitcher to accuracy of ball speed prediction. The graphical representations (Figures 4-6) show that both the models Personal and Full provide a good fit to the observed data, while the fit of Observations is unsatisfactory. The Full model is a preferable model, followed by the Personal and Observations model (see Tables 2 and 3).

Discussion
The aim of this study was to predict a ball velocity in baseball pitching such that prediction is tailored to the individual pitcher. The proposed method included pitcher's body segment rotation, which determines his technique, and pitcher's height that displays individuality in imparted velocity to a ball. We used multilevel modeling to develop three models with different predictors and examined their predictive performance. By comparing developed models, we investigated the added value of individuality to ball velocity prediction.
Ball velocities presented in this study are similar to the ones reported in the previous studies. Pitchers with a mean age of 14.7 ± 1.5 years threw balls with average velocity 30.6 ± 2.9 m/s, while Dun [21] reported average ball velocity of 26.3 ± 3.8 m/s measured in a population of youth pitchers throwing fastballs.
In the overhead pitching, the lower extremity and trunk generate and transfer energy to the upper extremity. To examine the relationship between ball velocity and variations in pitching biomechanics on individual level, previous studies identified maximum pelvis and trunk angular velocity as kinematic parameters linked to ball velocity [7,8,10]. Recent technological developments brought IMUs to a spotlight as an alternative to marker-based systems used in a laboratory setting. Since IMU's gyroscope enables measuring body segment rotation, we assessed pitching technique by positioning IMU sensors on pelvis and trunk. Measured peak angular velocity of pelvis of 690.2 ± 90.9 deg/s and trunk of 1172.4 ± 239.5 deg/s supports the findings in previous studies [2,21]. As the gyroscopes recorded angular velocities continuously throughout the participant's session, manual segmentation was required. In future work, we wish to develop a method for automatic detection of single throws and segmentation of the continuous-time gyroscope signal when the boundaries between different throws are unclear. This will automatise the use of predictive models for predicting ball velocity. Filtering methods from signal processing may prove to be useful for this purpose.
Among the compared models, model Full shows the best predictive performance ( Table 3). Model Observations is worse than model Full by 308.3 of log predictive probability values. The difference in estimated elpd-values is big compared to estimated standard error of 13.5. Hence, adding pitcher's height to the Observations model improves predictive accuracy. Model Personal includes only the pitcher's height as a predictor and ignores the pitching technique. The model shows that taller pitchers throw faster and it is possible to already estimate ball velocity only by knowing the pitcher's height. This information can be useful for scouts in search for baseball talents. A pitcher's height compared to other personal characteristics, such as age and weight, is the most important predictor for ball velocity in baseball pitching. On the other hand, of course neither pitchers nor coaches can influence height. The outcome of this paper demonstrates the added value of a pitcher's height to predictive accuracy.
The proposed method can potentially be adopted in baseball practice. IMUs are easy-to-wear low cost sensors that do not influence a pitcher's performance and can be a valuable source of data. It can provide information on pitching performance in every situation and with a method proposed in this paper, gain ball velocity without use of a radar gun. Ball velocity prediction can give a better insight into pitcher's performance and represents a potential for predictions of future throwing speed when pitchers grow taller.
For future studies, we suggest also to include separation time and pitch types in the presented model. Following the concept of a kinetic chain, the relative timing of the moments of pelvis and trunk peak angular velocity, when throwing fastballs, is associated with ball velocity in skilled pitchers [22]. Furthermore, to the best of our knowledge, no study has classified pitch types based on IMU data solely. Classification of pitch types outside the laboratory or game environment provides benefits in designing and outlining training routines and represents a potential research direction in the future. Following the segmentation of continuous gyroscope signals, we suggest extracting additional features next to the peak angular velocities, such as skewness, mean, and difference between minimum and maximum. This would result in more parameters that may be included in the model and improve the classification of different pitch types and the prediction of ball velocity.  Informed Consent Statement: Informed consent was obtained from all subjects involved in the study.

Data Availability Statement:
The data presented in this study are openly available in 4TU.ResearchData at https://doi.org/10.4121/16691947.