Skip to content

SistemaETR/ai-model

Repository files navigation

AI Shooting Deficiency Classifier

Website License: MIT

A machine learning project to analyze shooter performance data, classify deficiencies, and generate a custom model ready for deployment with Firebase ML.


About The Project

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 .tflite model for Firebase and JSON files for data preprocessing on the client-side.

Built With

  • Python
  • TensorFlow
  • Keras
  • scikit-learn
  • Pandas
  • Matplotlib

Getting Started

Follow these steps to set up the project locally and run the full data generation and model training pipeline.

Prerequisites

  • Python 3.8 or higher.
  • pip for package management.

Installation

  1. Clone the repository:

    git clone https://github.com/SistemaETR/ai-model.git
    cd ai-model
  2. 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
  3. Install the required packages:

    pip install -r requirements.txt

Usage

The pipeline is designed to be run in two main steps.

1. Generate the Dataset

Run the data generation script. This will create a large shooting_dataset.csv file and a deficiency_labels.json mapping file.

python dataset_generator.py

2. Train the Model

Once 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.py

This 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.

Project

This repository is part of the Sistema ETR project. Find out more about the complete application at our main website.

Project Website: sistemaetr.com


License

Distributed under the MIT License. See LICENSE file for more information.

About

Clasificador de IA que analiza datos de rendimiento de tiro para diagnosticar deficiencias.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages