Welcome to the Paddle vs Tennis Classification Project! This project focuses on developing a machine learning model to distinguish between features (acceleration) of paddle and tennis sports. By leveraging advanced classification techniques, our goal is to accurately classify images into either the paddle or tennis category. This project is ideal for demonstrating skills in machine learning.
- Project Description
- Features
- Installation
- Usage
- Data
- Model Training
- Evaluation
- Results
- Contributing
- Contact
This project uses machine learning algorithms to classify images of paddle and tennis. We apply feature extraction, and classification methods to achieve high accuracy. The end result is a robust classifier that can differentiate between the two sports based on acceleration data.
- Feature Extraction: Utilization of advanced features for better classification accuracy.
- Machine Learning Models: Implementation of various parameters and techniques to find the best Support Vector Machines (SVM) classifier.
- Evaluation Metrics: Comprehensive evaluation of model performance using metrics like accuracy, F1-score, and confusion matrix.
- Visualization: Graphical representation of results including decision boundaries and confusion matrices.
To get started with this project, follow the instructions below to set up your environment:
-
Clone the repository:
git clone https://github.com/luisgrana2/paddletenisAI.git
-
Navigate to the project directory:
cd paddletenisAI
-
Install required packages:
pip install -r requirements.txt
To use the classifier, follow these steps:
-
Prepare your dataset: Ensure that your images are organized into 'pl' and 'tl' directories within the
data
folder. DataSet -
Run the training script, evalute the model and classify:
python source.ipynb
The dataset for this project consists of accelerations in the 3 different axis for paddle and tennis. The data is organized into two directories: data/pl
and data/tl
. Ensure your dataset follows this structure for the code to work correctly.
The data for this project was obtained using the MATLAB mobile application, that use phone sensors to record the accelerations. The creators of the code played real matches to collect this data, ensuring its authenticity and relevance for training and testing the classification models.
We used various machine learning models for classification, including:
- SVM were chosen for this project due to their high precision and effectiveness with the volume of data obtained. Given the nature of our data and the need for accurate classification, SVMs provide robust performance and reliable results.
The best-performing model was selected based on cross-validation and evaluation metrics.
Model performance was evaluated using:
- Accuracy
- Precision
- Recall
- F1-Score
- Confusion Matrix
These metrics provide a comprehensive understanding of the classifier's performance.
The project results indicate the accuracy and effectiveness of the classifier in distinguishing between paddle and tennis images. Visualizations include confusion matrices and decision boundaries that illustrate the model's performance.
With a sigmoid kernel, a C of 0.1, and a gamma of 10, obtained as the best case through cross-validation, the model achieves an accuracy of 82%, validating the main hypothesis and efficiently classifying both sports.
Class | Precision | Recall | F1-Score | Support |
---|---|---|---|---|
Paddle | 0.80 | 0.89 | 0.84 | 9 |
Tenis | 0.86 | 0.75 | 0.80 | 8 |
Accuracy | 0.82 | 17 | ||
Macro Avg | 0.83 | 0.82 | 0.82 | 17 |
Weighted Avg | 0.83 | 0.82 | 0.82 | 17 |
We welcome contributions to improve this project! Please fork the repository and submit pull requests with your enhancements or bug fixes. For major changes, please open an issue to discuss what you would like to change.
For any questions or inquiries, please contact:
- Luis Granados - lgsgranados@gmail.com
- GitHub Profile - luisgrana2
- LinkedIn Profile - Luis Granados