Boxing punches сlassification during a training fight using data science. Also, the resulting algorithm can be used to classify individual punches.
Make a system that will detect and classify the boxer's punches during training (training fight and individual punches).
For this purpose it is necessary to:
- Come up with a system with which you will collect data
- Collect dataset
- Analyze the obtained data
- Complete the data processing
- Create a machine learning model that will detect and classify punches
- Test and analyze the results
You can see the solution to all these tasks in my presentation (Rudchyk_Boxing_Punch_Classif_ENG).
Later in the README we will talk about filling the repository (Contents of jupyter notebook and сollected dataset).
Files:
- boxing_punches_classification_final.ipynb: This is a completely finished notebook that takes a recording file, then filters the data, detect punches in the recording and classifies them.
- boxing_punches_classification_markup.ipynb: The file that contains dataset markup indexes.
- Rudchyk_Boxing_Punch_Classif_ENG.pptx: A presentation in which all stages of solving the problem are shown in detail.
- Rudchyk_Boxing_Punch_Classif_UA.pptx: Презентація, що зазначена вище, але на українській мові, можливо комусь буде набагато зручніше). Обережно, там немає декількох правок які були внесені в Англ варіант тому краще орієнтуватись на нього.
- boxing_punches_classification_workbook.ipynb: This is my workbook, which records the process of data analysis, selection of filters, search for features for models, selection of models and arguments for their use. There are also graphs I looked at while working and the main thoughts I had. Unfortunately, since this is a workbook, it is not very cleanly designed(. P.S. It's not very interesting and informative, but it might help if you want to use the dataset I've collected.
Folders:
- data: The collected dataset is divided into 3 folders, test and training data for the punches classification model, and training fight records for the punches detection model.
- model: Models for classification and detection have already been trained. There are several punches classification models, CatBoost worked best on my test data.
Data collection was performed with a phone (accelerometer + gyroscope) in the boxer's hand. Position: in the hand, perpendicular to the fingers, the screen towards you, the camera towards the thumb. The data was recorded using the Accelerometer Meter application (you can find it in Google Play) at the settings (in the Graph section) marked in the figure.
That is, the model uses sensor values in
We have 9 (7+2 only test) professional fighters with a well placed punch in the data collection.
There are 2 types of records: Systems of successive separate clean punches of different speeds and made by different hands. It is the Train + the Test data. A total of 33 recordings (550 punches).
A shadow fight in which boxers could move freely, use counters and parry, only 3 types of punches could be used. It is the Fight data. A total of 15 recordings (12 min, 250 punches).
The train record has the following format:
- 5 seconds of rest
- 5 jabs
- 5 seconds of rest
- 5 uppercuts
- 5 seconds of rest
- 5 hooks
- 5 seconds of rest
After each punch there is a 2 second rest so that we can easily separate the punches.
The files include recordings of slow and fast punches, also recordings of left and right handed punches.
P.S. Several files have the format of 2-5 jabs, 10 uppercuts and 10 hooks. In such cases, see the markup file.
The test record has the following format:
- 5 seconds of rest
- 2 jabs (slow + fast)
- 5 seconds of rest
- 2 uppercuts (slow + fast)
- 5 seconds of rest
- 2 hooks (slow + fast)
- 5 seconds of rest
After each punch there is a 2 second rest so that we can easily separate the punches.
The files include recordings of left and right handed punches.
The fight record has a shadow fight in which boxers could move freely, use counters and parry, only 3 types of punches could be used. It was a really free and real shadow fight.
Boxers beat only with the hand that had the phone in it.
Since the boxer did not perform the exact exercise, the data was marked on video recordings.