This is a final submission for final project
This project trains a simple CNN model on the Kuzushiji-MNIST dataset(all links below)
- It takes as input KMNIST image(28x28p grayscale) and classifies it in 10 classes. It does so by breaking down each image into features(edges-strokes-shapes) then makes images smaller and converts it into a vector for linear layers to decide which class it belongs to.
- Loads a dataset, then normalizes and batches data. Builds cnn from module.py, and for each epoch loads data into a model. Computes predictions, loss; backpropagate gradients, updates weights, prints progress, saves the trained model.
- Evaluation script loads the trained model and a dataset. Runs the model to get prediction And computes: accuracy, macro F1, confusion matrix, classification report. Saves results to: output/results.json output/confusion_matrix.png Prints the results
Ideally, this all should run perfectly within this platform(Google Colab), it would install all needed things on its own, and it shouldn't take much time.
Changes: created new file called func.py that contains the duplicate functions updated the parameters, made it smaller, prevented overfitting created constant for data set called DATA_ROOT
References https://www.kaggle.com/code/gpreda/classifying-cursive-hiragana-kmnist-using-cnn https://www.kaggle.com/datasets/anokas/kuzushiji https://github.com/rois-codh/kmnist