The project is aimed to the Neural Network course project, which compares the state-of-the-art image classification networks for hand-written hiragana characters.
The experiment will be divided into two parts: single character recognition and multi-characaters recognition. The second task will localize the characters in the image and identify them.
- Install all libraries required in "requirements.txt"
- Change the training configuration in "config.py"
- Use the following command to try the training process.
python inference.py --train --vgg
- To continue training process, run the following command:
python inference.py --train --vgg --load /path/to/checkpoint/file.tar
-
Available models:
- --vgg: Use VGG 19 with Batch Normalization. Minimum input size 224x224x3
- --inception: Use Inception V3 Net. Minimum input size 299x299x3, batch size must > 1.
- --simple: Use customized CNN.
-
Available modes:
- --train: Start training process.
- --test: Start testing process.
-
Available inputs:
- --dataset: Path to the dataset.
- --load: path to the saved 'tar' checkpoint file.
Please refer to the "requirements.txt" file in the project folder.
- torch~=1.4.0
- numpy~=1.18.2
- tqdm~=4.45.0
- torchvision~=0.5.0
- scikit-learn~=0.22.2.post1
- matplotlib~=3.2.1
- opencv-python~=4.2.0
\ | VGG 19 with BN | Inception v3 | Customized CNN |
---|---|---|---|
Input Size | 224x224x3 | 299x299x3 | 50x50x1 |
Normalized | True | True | True |
Batch Size | 8 | 8 | 8 |
Learning Rate | 1e-3 | 1e-3 | 1e-3 |
Train/Test Split | 85%/15% | 85%/15% | 85%/15% |
Epochs | 30 | 30 | 30 |
Parameters | 126,001,031 | 24,543,342 | 1,712,103 |
Validation Loss | 0.7290 | 0.2385 | 0.6475 |
Validation Accuracy | 98.74% | 99.5% | 98.47% |
Inference Time | 0.0294s/it | 0.0189s/it | 0.0020s/it |
VGG 19 with BN |
Inception v3 |
Customized CNN |
---|
Training Accuracy | Training Loss |
---|---|
Validation Accuracy | Validation Loss |
---|---|