A modern CNN-based solution for recognizing Korean Hangul characters with state-of-the-art training techniques.
Training and validation accuracy/loss curves for the Hangul character recognition model
| Feature | Description |
|---|---|
| Advanced CNN Architecture | ResNet-inspired with BatchNorm and Dropout |
| Optimized Training | AdamW optimizer + ReduceLROnPlateau scheduler |
| Smart Augmentation | Rotation, flipping, color jittering |
| Early Stopping | Prevents overfitting automatically |
| Model Checkpointing | Always saves best performing model |
CNN(
(features): Sequential(
Conv2d → BatchNorm2d → ReLU → MaxPool2d → Dropout
[... repeated blocks ...]
)
(classifier): Linear → LogSoftmax
)image_size: 64x64
batch_size: 64
epochs: 50
optimizer: AdamW (lr=0.001)
loss: CrossEntropyLoss
scheduler: ReduceLROnPlateau
early_stopping: patience=5.
├── 📁 dataset/ # Training data (organized by class)
│ ├── 가/ # Example class folder
│ │ ├── img1.jpg
│ │ └── img2.jpg
│ └── 나/
├── 📄 CNN.py # Main training script
├── 📄 testing.py # For testing the model
├── 📄 model.pth # Saved model weights
└── 📄 requirements.txt # Dependencies
- Setup Environment
pip install -r requirements.txt- Organize Dataset
dataset/
├── class_1/
│ ├── image1.jpg
│ └── image2.jpg
└── class_2/
- Start Training
python train.py --gpu # Add --gpu for GPU accelerationExpected performance:
- Training Accuracy: ~98%
- Validation Accuracy: ~95%
- Inference Speed: 15ms/image (on GPU)
MIT License - Free for academic and commercial use
"Perfect for Korean OCR applications, educational tools, and language learning apps" - AI Research Team