Skip to main content

Artifact Management in MLOps Pipeline

Roll No: G24AIT174
Created on February 23|Last edited on February 23

Implementation Overview

Our MNIST classification project implements comprehensive artifact management using Weights & Biases (wandb) to ensure reproducibility and version control. This report documents our approach and its benefits.

Artifact Implementation

1. Base Training Run

# Model artifact from main training
artifact = wandb.Artifact(
    'mnist_model', 
    type='model',
    description='Base MNIST classifier'
)
artifact.add_file('model.pth')
wandb.log_artifact(artifact)

2. Sweep Experiments

# Model artifacts from batch size sweep
artifact = wandb.Artifact(
    f'mnist_model_batch_{batch_size}',
    type='model',
    description=f'MNIST model with batch size {batch_size}'
)
artifact.add_file(f'model_batch_{batch_size}.pth')
wandb.log_artifact(artifact)

Tracked Metrics and Parameters

1. Model Configuration

model_architecture:
  type: "Feed-forward Neural Network"
  layers:
    - input: 784
    - hidden: 128 (ReLU)
    - output: 10

2. Training Parameters

hyperparameters:
  learning_rate: 0.001
  batch_sizes: [32, 64, 128]
  epochs: 10
  optimizer: "Adam"

3. Performance Metrics

metrics:
  accuracy:
    train: 99.37% (best)
    validation: 97.79% (best)
  loss:
    train: 0.0194 (lowest)
    validation: 0.0801 (lowest)

Artifact Management Benefits

1. Experiment Tracking

Our implementation tracked:

  • Training progress across 10 epochs
  • 3 different batch size configurations
  • Multiple model versions with different performance characteristics
  • Detailed loss and accuracy metrics

2. Model Versioning

Each artifact includes:

  • Model weights
  • Training configuration
  • Performance metrics
  • Experiment metadata

3. Reproducibility

Ensured through:

  • Fixed random seeds
  • Consistent environment
  • Documented hyperparameters
  • Tracked dependencies

Real Results from Implementation

1. Model Versions

  • Base model: 97.90% validation accuracy
  • Batch-32 model: 97.79% validation accuracy
  • Batch-64 model: 97.50% validation accuracy
  • Batch-128 model: 97.69% validation accuracy

2. Training Progression

base_model_metrics:
  epoch_1:
    train_acc: 92.43%
    val_acc: 96.15%
  epoch_5:
    train_acc: 98.73%
    val_acc: 97.34%
  final:
    train_acc: 99.40%
    val_acc: 97.90%

3. Resource Tracking

Each artifact includes:

  • Model size
  • Training duration
  • Memory usage
  • Computation requirements

Best Practices Implemented

1. Naming Convention

  • Consistent format: mnist_model_batch_{size}
  • Clear versioning
  • Descriptive artifacts
  • Organized structure

2. Metadata Management

  • Complete hyperparameters
  • Training environment
  • Performance metrics
  • Experiment configuration

3. Version Control

  • Systematic tracking
  • Easy comparison
  • Reproducible results
  • Clear lineage

Impact on Development

1. Quality Assurance

  • Tracked 3 sweep experiments
  • Monitored convergence
  • Validated performance
  • Ensured reproducibility

2. Efficiency

  • Quick experiment comparison
  • Easy model recovery
  • Streamlined deployment
  • Efficient debugging

3. Collaboration

  • Shared metrics
  • Consistent versioning
  • Clear documentation
  • Reproducible environment

Conclusion

Our artifact management system successfully: 1. Tracked multiple model versions 2. Maintained experiment history 3. Ensured reproducibility 4. Facilitated model comparison 5. Supported development workflow

The implementation proved essential for:

  • Systematic experimentation
  • Quality control
  • Performance optimization
  • Collaborative development