IMU Activity Classifier — Pruning + INT8 Quantization
Compact 1D-CNN for human activity recognition from 6-axis IMU signals. Trained on UCI HAR dataset, compressed via magnitude pruning (78% sparsity)
- INT8 quantization for edge/microcontroller deployment.
Results
| Model | Size | Accuracy | Latency |
|---|---|---|---|
| Baseline FP32 | 358 KB | 93.99% | 46.1 ms |
| Pruned FP16 TFLite | 191 KB | 92.40% | 0.054 ms |
| Pruned INT8 TFLite | 113 KB | 92.43% | 0.026 ms |
- Size reduction: 68.4%
- Latency speedup: 1775x
- Accuracy drop: 1.56%
Classes
WALKING · WALKING_UPSTAIRS · WALKING_DOWNSTAIRS · SITTING · STANDING · LAYING
Compression Pipeline
- Baseline 1D-CNN trained on UCI HAR (93.99% accuracy)
- Magnitude pruning with PolynomialDecay → 78% sparsity
- INT8 post-training quantization → 113KB TFLite model
Confusion Matrix
Compression Summary
Training Curves
Usage
import tensorflow as tf
import numpy as np
interpreter = tf.lite.Interpreter("imu_pruned_int8.tflite")
interpreter.allocate_tensors()
input_det = interpreter.get_input_details()
output_det = interpreter.get_output_details()
# sample shape: (1, 128, 9) — float32
sample = np.random.randn(1, 128, 9).astype(np.float32)
interpreter.set_tensor(input_det[0]['index'], sample)
interpreter.invoke()
output = interpreter.get_tensor(output_det[0]['index'])
ACTIVITIES = ['WALKING','WALKING_UPSTAIRS','WALKING_DOWNSTAIRS',
'SITTING','STANDING','LAYING']
print(ACTIVITIES[np.argmax(output)])
Links
- GitHub: https://github.com/RAj5517/imu_activity_classifier
- Dataset: UCI HAR (University of California Irvine)
- Downloads last month
- 27
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support


