← back

neural_network_handwritten_digits

View on GitHub β†’

🌟 Architectural Vision & System Design

The system is architected as a modular, deterministic machine learning pipeline designed for reproducible training, evaluation, and inference. Rather than treating the model as an isolated script, the codebase is structured to mirror production-grade ML workflows, separating data ingestion, preprocessing, model compilation, and evaluation phases.

[ Raw Image Data ] ──> [ Vectorized Normalization ] ──> [ Tensor Reshaping ]
                                                                β”‚
                                                                β–Ό
[ Evaluation / Metrics ] <── [ Backpropagation ] <── [ Dense Neural Network ]

Core Data & System Flow

  • Ingestion / Input: Raw 28x28 grayscale pixel matrices are ingested as vectorized NumPy arrays. The ingestion layer handles boundary validation to ensure input tensors conform to expected dimensional constraints.
  • Processing / Logic: The execution pipeline performs deterministic min-max scaling, mapping pixel intensities from $[0, 255]$ to a normalized $[0.0, 1.0]$ float32 space. This prevents gradient explosion and ensures numerical stability. The normalized tensors are then flattened into a 1D feature vector ($784$ dimensions) to feed the input layer of the network.
  • Persistence & Caching: Training states, weight matrices, and bias vectors are managed in-memory via TensorFlow’s computational graph. The architecture is designed to support serialization to standard HDF5/SavedModel formats for downstream deployment to edge devices or cloud inference APIs.

πŸ’» Tech Stack & Engineering Decisions

Every technology choice was guided by the balance between mathematical precision, execution speed, and developer velocity.

  • Frontend / Presentation Layer: Jupyter Notebooks serve as the interactive execution and visualization layer. This allows for real-time inspection of intermediate tensor states, loss curves, and confusion matrices, accelerating the iterative feedback loop.
  • ML Engine & APIs: TensorFlow & Keras were selected to leverage their highly optimized C++ backends, automatic differentiation engines, and seamless abstraction of computational graphs. This ensures that the underlying matrix multiplications are executed