Instructions to use muzammil-khan/wearable-activity-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use muzammil-khan/wearable-activity-classifier with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://muzammil-khan/wearable-activity-classifier") - Notebooks
- Google Colab
- Kaggle
Wearable Activity Classifier
A CNN-based deep learning model for classifying wearable sensor signals into three activity classes:
- Stationary
- Walking
- Running
Model Details
The model was trained as part of a deep learning laboratory activity using wearable sensor data.
Architecture
The selected model is a 1D Convolutional Neural Network:
- Conv1D: 32 filters, kernel size 3, ReLU activation
- MaxPooling1D: pool size 2
- Flatten
- Dense: 32 units, ReLU activation
- Dense: 3 units, Softmax activation
Input
The model expects:
- 100 sensor readings
- 1 sensor feature
- Input shape:
(100, 1)
Output Classes
The model predicts three classes:
- Stationary
- Walking
- Running
Evaluation Results
The CNN achieved the following results on the test set:
| Metric | Result |
|---|---|
| Test Accuracy | 100% |
| Parameters | 50,435 |
| Training Time | ~2.9 seconds |
The CNN was selected because it achieved the highest test accuracy while also having a relatively short training time compared with the other tested models.
Comparison with Other Models
Three other architectures were also tested:
| Model | Test Accuracy | Parameters | Train Time |
|---|---|---|---|
| CNN | 100% | 50,435 | ~2.9 s |
| SimpleRNN | 100% | 2,243 | ~4.1 s |
| CNN + LSTM | 66.67% | 9,603 | ~6.8 s |
| LSTM | 64.67% | 5,507 | ~6.5 s |
The CNN was selected for the final activity because it provided excellent classification performance and fast training on this dataset.
Usage
The model can be loaded with TensorFlow/Keras:
import tensorflow as tf
model = tf.keras.models.load_model("activity_model.keras")
- Downloads last month
- -