A machine learning project to analyze shooter performance data, classify deficiencies, and generate a custom model ready for deployment with Firebase ML.
This repository contains the complete pipeline for creating a custom AI model that diagnoses a shooter's performance based on data from training sessions. The model is designed to be lightweight and efficient, making it ideal for integration into a mobile application using Firebase ML.
The core functionality includes:
- Synthetic Data Generation: A detailed script (
dataset_generator.py) that creates a large, realistic dataset simulating various shooter profiles and performance scenarios. - Model Training: A robust training script (
train_model.py) that preprocesses the data, builds a neural network with TensorFlow/Keras, and trains it to classify performance deficiencies. - Deployment-Ready Artifacts: The process automatically generates all necessary files for production, including the
.tflitemodel for Firebase and JSON files for data preprocessing on the client-side.
Follow these steps to set up the project locally and run the full data generation and model training pipeline.
- Python 3.8 or higher.
pipfor package management.
-
Clone the repository:
git clone https://github.com/SistemaETR/ai-model.git cd ai-model -
Create and activate a virtual environment (recommended):
# For macOS/Linux python3 -m venv venv source venv/bin/activate # For Windows python -m venv venv .\venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
The pipeline is designed to be run in two main steps.
Run the data generation script. This will create a large shooting_dataset.csv file and a deficiency_labels.json mapping file.
python dataset_generator.pyOnce the dataset is created, run the training script. This will load the data, preprocess it, train the model, and save all the necessary artifacts for deployment.
python train_model.pyThis script will produce the following key files:
shooting_model.tflite: The final, optimized model ready to be uploaded to Firebase ML.best_model.keras: The best version of the model saved during training.scaler_params.json: The mean and scale values for normalizing input data in the mobile app.feature_columns.json: The exact feature order the model expects.learning_curve.png: A plot showing the model's training and validation performance over epochs.
This repository is part of the Sistema ETR project. Find out more about the complete application at our main website.
Project Website: sistemaetr.com
Distributed under the MIT License. See LICENSE file for more information.