Skip to content

Basic CNN

Basic CNN model

Prerequisite

  • For downloading the MNIST dataset under tensorflow.keras
open /Applications/Python\ 3.x/Install\ Certificates.command

Model Training

  • Train the model using below command:
python model.py
  • Model gets saved as keras format.

Evaluate Model

  • Test the model using below command:
python evaluate.py

Visual Explaination

Training

flowchart TD
    A[Load MNIST Dataset] --> B[Preprocess Data]
    B --> C[Encode Labels]
    C --> D[Define CNN Model]
    D --> E[Compile Model]
    E --> F[Train Model]
    F --> G[Evaluate on Test Set]
    G --> H[Save Trained Model]    

Testing

flowchart TD
    A[Load Trained Model] --> B[Load Test Image]
    B --> C[Preprocess Image]
    C --> D[Make Prediction]
    D --> E[Map Class Index to Label]
    E --> F[Print Predicted Letter]