Image Classification
LiteRT
Keras
Burmese
tensorflow
burmese
myanmar
handwritten
digit-recognition
computer-vision
cnn
lightweight
edge-ai
Instructions to use Drew2456/MyanNet-V1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Drew2456/MyanNet-V1 with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://Drew2456/MyanNet-V1") - Notebooks
- Google Colab
- Kaggle
| language: | |
| - my | |
| license: apache-2.0 | |
| library_name: tensorflow | |
| pipeline_tag: image-classification | |
| tags: | |
| - burmese | |
| - myanmar | |
| - handwritten | |
| - digit-recognition | |
| - computer-vision | |
| - cnn | |
| - tensorflow | |
| - keras | |
| - tflite | |
| - lightweight | |
| - edge-ai | |
| datasets: | |
| - expa-ai/BHDD | |
| # MyanNet V1 | |
| <p align="center"> | |
| <img src="figures/banner.png" width="100%"> | |
| </p> | |
| <p align="center"> | |
| **A Lightweight CNN for Burmese Handwritten Digit Recognition** | |
| TensorFlow • Keras • TensorFlow Lite • Edge AI | |
| </p> | |
| --- | |
| ## Overview | |
| **MyanNet V1** is a lightweight convolutional neural network (CNN) developed for **Burmese handwritten digit recognition**. The model was designed to achieve an excellent balance between recognition accuracy and computational efficiency, making it suitable for deployment on mobile, embedded, and resource-constrained devices. | |
| Instead of maximizing accuracy through increasingly deeper networks, MyanNet V1 focuses on reducing computational complexity while maintaining competitive performance. The architecture combines **depthwise separable convolutions**, **batch normalization**, **global average pooling**, and **dropout regularization** to produce a compact yet highly effective classifier. | |
| The model was trained and evaluated on the **Burmese Handwritten Digit Dataset (BHDD)**, containing **87,561 handwritten digit images** across ten Burmese numeral classes. | |
| --- | |
| # Model Highlights | |
| | Property | Value | | |
| |-----------|-------| | |
| | **Task** | Burmese Handwritten Digit Recognition | | |
| | **Framework** | TensorFlow / Keras | | |
| | **Input Size** | 28 × 28 Grayscale | | |
| | **Classes** | 10 (၀–၉) | | |
| | **Trainable Parameters** | **10,634** | | |
| | **Test Accuracy** | **99.49%** | | |
| | **5-Fold CV Accuracy** | **99.46% ± 0.06%** | | |
| | **Quantized Model Size** | **24.18 KB** | | |
| | **Average CPU Inference** | **0.263 ms/image** | | |
| | **License** | Apache-2.0 | | |
| --- | |
| # Architecture | |
| MyanNet V1 follows a compact two-stage convolutional architecture optimized for lightweight deployment. | |
| ### Feature Extractor | |
| - Standard Convolution | |
| - Batch Normalization | |
| - Max Pooling | |
| - Depthwise Separable Convolution | |
| - Batch Normalization | |
| - Max Pooling | |
| ### Classification Head | |
| - Global Average Pooling | |
| - Dropout | |
| - Fully Connected Layer | |
| - Softmax Output | |
| The architecture significantly reduces parameter count while preserving classification accuracy. | |
| --- | |
| # Performance Comparison | |
| MyanNet V1 achieves competitive accuracy while reducing the number of trainable parameters by approximately **69.5%** compared to the baseline CNN. | |
| <p align="center"> | |
| <img src="figures/model_comparison.png" width="800"> | |
| </p> | |
| | Model | Parameters | Accuracy | | |
| |---------|-----------:|----------:| | |
| | Baseline CNN | 34,826 | 99.58% | | |
| | GAP-BN CNN | 21,418 | 99.51% | | |
| | **MyanNet V1** | **10,634** | **99.49%** | | |
| --- | |
| # Training Curves | |
| The training and validation curves demonstrate stable convergence with minimal overfitting. | |
| <p align="center"> | |
| <img src="figures/training_curves.png" width="800"> | |
| </p> | |
| --- | |
| # Confusion Matrix | |
| The confusion matrix shows strong classification performance across all Burmese digit classes. | |
| <p align="center"> | |
| <img src="figures/confusion_matrix.png" width="700"> | |
| </p> | |
| --- | |
| # 5-Fold Cross Validation | |
| The model was evaluated using stratified five-fold cross validation to assess robustness and generalization. | |
| <p align="center"> | |
| <img src="figures/kfold_results.png" width="700"> | |
| </p> | |
| | Metric | Value | | |
| |---------|------| | |
| | Mean Accuracy | **99.46%** | | |
| | Standard Deviation | **0.06%** | | |
| --- | |
| # Sample Predictions | |
| Example handwritten digit samples from the BHDD dataset. | |
| <p align="center"> | |
| <img src="figures/sample_images.png" width="800"> | |
| </p> | |
| --- | |
| # Failure Cases | |
| Representative misclassified samples produced by MyanNet V1. | |
| <p align="center"> | |
| <img src="figures/misclassified_samples.png" width="800"> | |
| </p> | |
| Although misclassifications are rare, they primarily occur for ambiguous handwriting styles and visually similar digit shapes. | |
| --- | |
| # Dataset | |
| The model was trained and evaluated on the **Burmese Handwritten Digit Dataset (BHDD)**. | |
| Dataset Summary: | |
| - **87,561** handwritten digit images | |
| - **10 Burmese digit classes (၀–၉)** | |
| - **28 × 28 grayscale images** | |
| - MNIST-compatible format | |
| Training Split: | |
| - 60,000 balanced training images | |
| Testing Split: | |
| - 27,561 naturally imbalanced testing images | |
| Please obtain the dataset from the official BHDD repository. | |
| --- | |
| # Usage | |
| ## TensorFlow / Keras | |
| ```python | |
| import tensorflow as tf | |
| model = tf.keras.models.load_model("myannet_best.keras") | |
| prediction = model.predict(image) | |
| ``` | |
| --- | |
| ## TensorFlow Lite | |
| ```python | |
| import tensorflow as tf | |
| import numpy as np | |
| interpreter = tf.lite.Interpreter( | |
| model_path="myannet_quantized.tflite" | |
| ) | |
| interpreter.allocate_tensors() | |
| input_details = interpreter.get_input_details() | |
| output_details = interpreter.get_output_details() | |
| image = np.expand_dims(image / 255.0, axis=(0, -1)).astype(np.float32) | |
| interpreter.set_tensor(input_details[0]["index"], image) | |
| interpreter.invoke() | |
| prediction = interpreter.get_tensor(output_details[0]["index"]) | |
| ``` | |
| --- | |
| # Intended Applications | |
| MyanNet V1 is suitable for: | |
| - Burmese handwriting recognition | |
| - Educational software | |
| - Mobile OCR systems | |
| - Embedded AI devices | |
| - Edge computing | |
| - Research benchmarking | |
| --- | |
| # Limitations | |
| MyanNet V1 was trained exclusively on isolated handwritten Burmese digits contained in the BHDD dataset. | |
| The model has **not** been evaluated on: | |
| - Printed Burmese text | |
| - Burmese characters | |
| - Burmese words or sentences | |
| - Historical manuscripts | |
| - Camera-captured documents | |
| - General OCR tasks | |
| Performance outside the BHDD domain may differ significantly. | |
| --- | |
| # Version Information | |
| This repository contains the **original public release of MyanNet (Version 1).** | |
| Version 1 established the lightweight CNN architecture and serves as the baseline for future iterations. | |
| Future versions aim to improve: | |
| - Model compactness | |
| - Computational efficiency | |
| - Robustness | |
| - Recognition performance | |
| - Support for larger Burmese OCR tasks | |
| --- | |
| # Citation | |
| If you use MyanNet V1 in your research, please cite: | |
| ```bibtex | |
| @software{maung2026myannetv1, | |
| author = {Ah Maung Oo}, | |
| title = {MyanNet V1: A Lightweight CNN for Burmese Handwritten Digit Recognition}, | |
| year = {2026}, | |
| publisher = {Hugging Face}, | |
| url = {https://huggingface.co/Drew2456/MyanNet-V1} | |
| } | |
| ``` | |
| Once the associated journal paper is published, this citation will be updated with the official publication. | |
| --- | |
| # Acknowledgements | |
| - **BHDD** dataset by Swan Htet Aung *et al.* | |
| - TensorFlow & Keras | |
| - Optuna for hyperparameter optimization | |
| - The open-source machine learning community | |
| --- | |
| ⭐ If you find MyanNet V1 useful, please consider starring the GitHub repository and citing this work in your research. |