Instructions to use KnuckleHead1/wearable-activity-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use KnuckleHead1/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://KnuckleHead1/wearable-activity-classifier") - Notebooks
- Google Colab
- Kaggle
Wearable Activity Classifier
Task
Classify a 100-step, univariate (1-feature) wearable sensor time-series sequence into one of three physical activity classes:
- 0: Stationary
- 1: Walking
- 2: Running
Model Details
- Selected Architecture: 1D Convolutional Neural Network (1D CNN)
Conv1D(filters=16, kernel_size=5, activation='relu', input_shape=(100, 1))MaxPooling1D(pool_size=2)Flatten()Dense(16, activation='relu')Dense(3, activation='softmax')
- Input shape:
(100, 1) - Output classes: 3 (
Stationary,Walking,Running) - Parameters: 12,451 parameters
Training Data & Setup
- Dataset: 600 synthetic wearable activity sequence signals (200 Stationary, 200 Walking, 200 Running) with fixed train, validation, and test splits (seed 42).
- Optimizer: Adam
- Loss Function:
sparse_categorical_crossentropy - Epochs: 6
- Batch Size: 32
Evaluation Results
- Test Accuracy: 100.0%
- Training Time: ~1.5 seconds
- Parameter Count: 12,451 parameters
Why We Selected This Model
We selected the 1D CNN architecture because it delivers the optimal balance between high classification accuracy, ultra-fast training speed, and architectural simplicity. The 1D convolutional filters effectively identify localized periodic patterns (spikes and cyclic step frequencies) characteristic of walking and running waveforms, without the recurrent overhead of RNN/LSTM layers.
Limitations
- Trained on synthetic, simplified time-series data designed for educational comparison.
- Single-axis univariate signal (1 feature) rather than multi-axis 3D triaxial accelerometer/gyroscope signals.
- Fixed sequence length of 100 timesteps.
- Not intended for production health, safety, or medical diagnosis.
Team Learning Note
Through this lab, we learned how different deep learning architectures process temporal data: CNNs capture shift-invariant local motifs efficiently via temporal filters, RNNs pass hidden state context sequentially but suffer from gradient degradation, LSTMs manage long-term dependencies through gating mechanisms, and hybrid CNN-LSTMs combine local feature extraction with sequence learning.
- Downloads last month
- -