"# Soldier Activity & Anomaly Detection"
Project Status: Completed
This project builds a machine learning system to monitor a soldier's well-being and tactical situation using data from a smartwatch. The final model can successfully classify 3 normal activities and 4 distinct anomalies, including critical health and fall events.
The system is designed to fulfill two primary functions:
- Soldier Welfare: Provide real-time alerts by detecting anomalous events like falls or health crises.
- Tactical Awareness: Provide a high-level overview of a soldier's current activity state (e.g., "Resting" or "Running").
The project uses a simulated smartwatch dataset (data/simulated_smartwatch_data.csv). This was necessary because public datasets (like UCI-HAR) do not contain anomaly data or heart rate features.
The simulated dataset contains 4 raw features and 7 specific labels:
heart_rateaccel_x(X-axis acceleration)accel_y(Y-axis acceleration)accel_z(Z-axis acceleration)
- Normal_Resting: Low heart rate, low movement.
- Normal_Walking: Elevated heart rate, moderate rhythmic movement.
- Normal_Running: High heart rate, high-impact movement.
- Anomaly_Fall: High, erratic acceleration.
- Anomaly_HealthEvent: Critically high heart rate without movement.
- Anomaly_SensorFailure: All sensors report an error state (
-1). - Anomaly_DataLoss: All sensors report missing data (
0).
The final model is a Random Forest Classifier trained on the 7 labels.
- Model File:
models/soldier_smartwatch_model.joblib - Training Notebook:
notebooks/03-Smartwatch-Model.ipynb - Performance: The model achieved ~99-100% accuracy on the test set, successfully distinguishing all 7 normal and anomalous classes.
- Environment: The project requires the Conda environment defined in
soldier_env. - Generate Data: Run
python src/generate_smartwatch_data.pyto create the dataset. - Train Model: Open and run the
notebooks/03-Smartwatch-Model.ipynbnotebook. This will train the model and save it to themodels/folder.