Repository navigation
MNIST data set loader #3
Description
Here’s a complete issue drafted using your SKaiNET DARC workflow template, tailored for adding MNIST dataset support, loaders, and baseline MLP/CNN models with notebook examples.
🧠 D: DEFINE — Problem & Opportunity
What is the problem, limitation, or opportunity? Why does this matter for SKaiNET?
Currently, SKaiNET lacks built-in support for canonical benchmark datasets and reference models, limiting its ability to demonstrate training workflows end-to-end. MNIST is the industry-standard entry dataset for validating deep learning pipelines such as data loading, preprocessing, training loops, evaluation, and visualization. Without native MNIST support, onboarding new contributors and validating SKaiNET’s capabilities is unnecessarily difficult.
Adding support for MNIST dataset loading, along with baseline MLP and CNN models plus a notebook following the SKaiNET DARC workflow, will provide a ready-to-run example that showcases core functionality while acting as a regression benchmark and educational reference.
Summary (1–2 sentences):
Add native MNIST dataset support, baseline MLP and CNN models, and a DARC-style demonstration notebook to establish a canonical SKaiNET example workflow for training and evaluation.
🔍 A: ASSESS — Feasibility & Impact
✔️ Feasibility
- Straightforward to implement using existing PyTorch / torchvision dataset abstractions.
- MLP and CNN reference models are simple and lightweight.
- Notebook integration is aligned with current SKaiNET documentation approach.
- Minimal architectural changes required — mostly modular additions.
✔️ Expected Impact
- Establishes a complete, reproducible training workflow example.
- Provides a regression benchmark for future model, optimizer, and training pipeline improvements.
- Significantly improves onboarding for new users and contributors.
- Enables demonstrations for model experimentation (optimizers, schedulers, custom layers).
✔️ Risks / Constraints
- Ensure dataset abstractions align with SKaiNET’s internal dataset APIs.
- Avoid tight coupling to PyTorch-specific constructs to maintain framework flexibility.
- Validate numerical stability and convergence consistency across CPU/GPU builds.
- Keep notebooks lightweight and CI-friendly.
✔️ Dependencies
- SKaiNET dataset module (existing or needs small extension).
- Third-party library:
torchvisionfor MNIST dataset retrieval. - SKaiNET training pipeline utilities (trainer, logging, evaluation metrics).
- Jupyter or equivalent notebook infrastructure for examples.
📚 R: RESEARCH — What Must Be Understood First?
Research Tasks
- Review MNIST dataset handling best practices in PyTorch, TensorFlow, JAX.
- Identify standard MLP and CNN baseline architectures used in benchmarks.
- Compare dataset abstraction patterns for modular loading and preprocessing.
- Investigate optimized data pipelines and caching strategies.
- Review academic/classic benchmarks on MNIST accuracy baselines for validation targets.
Open Questions
- How tightly should dataset loaders integrate with SKaiNET’s dataset API?
- Should preprocessing (normalization/augmentation) be configurable via pipeline YAML or API flags?
- What accuracy thresholds should be used as acceptance benchmarks (e.g., MLP ≥ 97%, CNN ≥ 99%)?
- Should the notebook cover hyperparameter tuning or remain a minimal tutorial?
- Do we provide example visualizations (sample batches, loss curves, confusion matrices)?
🛠️ C: CONTRIBUTE — Implementation Plan
Development Tasks
-
Design
MNISTDatasetinterface aligned with SKaiNET dataset abstractions -
Implement dataset loader using
torchvision.datasets.MNIST -
Add basic transforms pipeline (normalization, tensor conversion)
-
Implement reference
MLPClassifiermodel -
Implement reference
CNNClassifiermodel -
Integrate models into SKaiNET model registry (if applicable)
-
Update training pipeline hooks to support image classification workflows
-
Write unit tests for dataset loading, batching, and transforms
-
Write unit tests for model forward pass and training sanity checks
-
Create DARC-style notebook walkthrough:
- Dataset setup
- Model selection
- Training
- Evaluation
- Visualization
-
Add markdown documentation and API references
-
(Optional) Add benchmark results table (accuracy vs epochs)
-
Submit PR referencing this issue
Acceptance Criteria
-
MNIST dataset loads correctly and supports standard splits (train / test)
-
MLP and CNN baselines train successfully using SKaiNET training loops
-
DARC notebook runs end-to-end without errors
-
Achieves reasonable benchmark accuracy:
- MLP ≥ ~97% test accuracy
- CNN ≥ ~99% test accuracy
-
Code fully documented and follows SKaiNET style conventions
-
Unit tests pass in CI (CPU-only acceptable)
-
Maintainers review and approve PR
-
No regressions introduced elsewhere
💬 Additional Notes
Proposed Model Specs
MLP Baseline
Input: 28x28 → Flatten(784)
Dense(512) → ReLU
Dense(256) → ReLU
Dense(10) → Softmax
CNN Baseline
Conv(32, 3x3) → ReLU → MaxPool
Conv(64, 3x3) → ReLU → MaxPool
Flatten
Dense(128) → ReLU
Dense(10) → Softmax
Notebook Outline (DARC Workflow)
- Define: What MNIST classification is and goals
- Assess: Why MLP vs CNN and expected outcomes
- Research: Brief literature summary (baseline accuracies)
- Contribute: Run experiments, train models, compare results
References
- MNIST Dataset: LeCun et al., 1998
- PyTorch torchvision MNIST examples
- Standard MNIST benchmarks from TensorFlow model zoo
✅ This issue establishes a canonical beginner-to-intermediate demonstration pipeline for SKaiNET while also creating a reusable benchmark foundation for future development.
Activity
Merge pull request #3 from skainet-dev/codex/add-conv2d-support-to-ne…
Implement MNIST data loading as KMP module. Based on Kotlin Notebook
Add code for MNIST image classification. without training first.
Initial version of MLP based MNIST is working
Initial version of MLP based MNIST is working
michalharakal commentedon Dec 7, 2025
See nice article on MNIST data sets
https://www.geeksforgeeks.org/machine-learning/mnist-dataset/