392
A production-ready Docker image for time-series image classification using EfficientNet/NFNet with PyTorch Lightning. This containerized solution implements transfer learning for multi-class classification tasks with selective fine-tuning techniques, supporting both single-modal (image-only) and multi-modal (image + time-series features) learning approaches.
# Pull the latest image
docker pull kechiro/timeseries-image-classifier:latest
# Run with GPU support (recommended)
docker run --gpus all -it kechiro/timeseries-image-classifier:latest
# Run without GPU
docker run -it kechiro/timeseries-image-classifier:latest
# Clone the repository
git clone https://github.com/kechirojp/timeseries-image-classifier.git
cd timeseries-image-classifier
# Run with Docker Compose
docker-compose up
| Variable | Default | Description |
|---|---|---|
MODEL_MODE | single | Training mode: 'single' or 'multi' |
MODEL_ARCHITECTURE | nfnet | Architecture: 'nfnet', 'efficientnet', 'resnet18' |
BATCH_SIZE | 32 | Training batch size |
MAX_EPOCHS | 100 | Maximum training epochs |
PRECISION | 16-mixed | Training precision |
NUM_WORKERS | 4 | DataLoader workers (set to 0 for Windows) |
Mount your data and configuration directories:
docker run --gpus all -it \
-v /path/to/your/data:/app/data \
-v /path/to/your/configs:/app/configs \
-v /path/to/save/checkpoints:/app/checkpoints \
-v /path/to/save/logs:/app/logs \
kechiro/timeseries-image-classifier:latest
Your data directory should follow this structure:
data/
āāā README.md # Data structure documentation
āāā fix_labeled_data_timeseries_15m.csv # Label file (for multi-modal)
āāā timeseries_15m_202412301431.csv # Feature file (for multi-modal)
āāā dataset_a_15m_winsize40/ # Dataset A (image data)
ā āāā README.md # Image data requirements
ā āāā train/ # Training data
ā ā āāā class_0/ # Class 0 images (label 0)
ā ā ā āāā dataset_a_15m_20240101_0900_label_0.png
ā ā ā āāā ...
ā ā āāā class_1/ # Class 1 images (label 1)
ā ā āāā class_2/ # Class 2 images (label 2)
ā āāā test/ # Test data
ā āāā class_0/ # Class 0 images (label 0)
ā āāā class_1/ # Class 1 images (label 1)
ā āāā class_2/ # Class 2 images (label 2)
āāā dataset_b_15m_winsize40/ # Dataset B (same structure)
ā āāā README.md
ā āāā train/
ā ā āāā class_0/
ā ā āāā class_1/
ā ā āāā class_2/
ā āāā test/
ā āāā class_0/
ā āāā class_1/
ā āāā class_2/
āāā dataset_c_15m_winsize40/ # Dataset C (same structure)
āāā README.md
āāā train/
ā āāā class_0/
ā āāā class_1/
ā āāā class_2/
āāā test/
āāā class_0/
āāā class_1/
āāā class_2/
{dataset_name}_{timeframe}_{YYYYMMDD}_{HHMM}_label_{class_id}.png
Examples:
dataset_a_15m_20240101_0900_label_0.png ā class_0 (label 0)dataset_a_15m_20240101_0915_label_1.png ā class_1 (label 1){dataset_name}_{timeframe}_{YYYYMMDD}{HHMM}.csv
Example:
dataset_a_15m_202412301431.csv ā Data for 2024-12-30 14:31Create a config.yaml file in your configs directory:
# Model settings
model_mode: 'single' # or 'multi'
model_architecture_name: 'nfnet' # 'nfnet', 'efficientnet', 'resnet18'
# Training settings
max_epochs: 100
batch_size: 32
precision: '16-mixed'
# Data settings
datasets: ['dataset_a', 'dataset_b', 'dataset_c']
num_classes: 3
class_names: ['class_0', 'class_1', 'class_2']
# Multi-modal settings (for model_mode: 'multi')
timeseries:
data_path: './data/timeseries_15m_202412301431.csv'
feature_columns: ['feature_1', 'feature_2', 'feature_3', 'feature_4', 'feature_5', 'feature_6']
window_size: 40
# Resume training (optional)
resume_from_checkpoint: null # or 'last.ckpt'
# Single-modal training
docker run --gpus all -it \
-v $(pwd)/data:/app/data \
-v $(pwd)/configs:/app/configs \
-e MODEL_MODE=single \
-e MODEL_ARCHITECTURE=nfnet \
kechiro/timeseries-image-classifier:latest
# Multi-modal training with time-series features
docker run --gpus all -it \
-v $(pwd)/data:/app/data \
-v $(pwd)/configs:/app/configs \
-e MODEL_MODE=multi \
-e MODEL_ARCHITECTURE=nfnet \
kechiro/timeseries-image-classifier:latest
# Resume from checkpoint
docker run --gpus all -it \
-v $(pwd)/data:/app/data \
-v $(pwd)/configs:/app/configs \
-v $(pwd)/checkpoints:/app/checkpoints \
kechiro/timeseries-image-classifier:latest
# Run TensorBoard (in separate container or host)
docker run --rm -p 6006:6006 \
-v $(pwd)/logs:/app/logs \
tensorflow/tensorflow:latest \
tensorboard --logdir=/app/logs --host=0.0.0.0
latest: Latest stable version with all featuresstable: Production-ready stable version (same as latest)gpu: GPU-optimized version (same as latest)v1.1.0: Latest version 1.1.0 release (recommended)v1.0.0: Previous version 1.0.0 releaseThis project is licensed under the MIT License. See the LICENSEā file for details.
Built with ā¤ļø using PyTorch Lightning and Docker
Content type
Image
Digest
sha256:0118ffc8aā¦
Size
10.1 GB
Last updated
over 1 year ago
docker pull kechiro/timeseries-image-classifier