This repository contains the official implementation of the paper "Ensemble Learning for Fine-Grained Chinese Minority Costume Classification: A Comprehensive Empirical Study".
The project provides an automated framework to train, evaluate, and compare various deep learning architectures (CNNs, Vision Transformers, and Hybrid models) on the detailed classification of costumes from five Chinese ethnic groups.
- Goal: Fine-grained classification of minority costumes.
- Classes: 5 (Hui, Zhuang, Man, Yao, and Bai).
- Dataset: 3,000 high-resolution images (600 per class), split 80/20 for training and validation.
- Performance: The proposed Ensemble method achieves 94.50% accuracy, outperforming individual baselines.
The core script auto_baseline_runner.py is a complete pipeline that handles:
- Automated Training: Runs multiple models (ResNet, EfficientNet, ViT, etc.) in sequence.
- Ablation Studies: Can test training strategies like "Training from Scratch" vs. "Transfer Learning".
- Analytics: Automatically generates confusion matrices, accuracy plots, and comparison tables (CSV/LaTeX).
- Ensembling: Supports voting-based fusion of top-performing models.
git clone https://github.com/TiandaSun/CMC-Classification.git
cd CMC-ClassificationThis project requires PyTorch and timm (PyTorch Image Models).
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
pip install timm numpy pandas matplotlib seaborn scikit-learn tqdm(Note: Adjust the PyTorch installation command based on your CUDA version).
Organize your dataset in standard ImageFolder format:
dataset/
├── Hui/
│ ├── image_01.jpg
│ └── ...
├── Zhuang/
├── Man/
├── Yao/
└── Bai/
The auto_baseline_runner.py script is the main entry point.
Train and evaluate all supported models (ResNet, VGG, EfficientNet, ViT, Swin, etc.):
python auto_baseline_runner.py --data_dir ./path/to/dataset --output_dir ./resultsRun only the 5 core models to save time:
python auto_baseline_runner.py --data_dir ./dataset --essential_onlyInclude experiments like training from scratch (no pre-trained weights):
python auto_baseline_runner.py --data_dir ./dataset --ablations| Argument | Default | Description |
|---|---|---|
--data_dir |
./dataset |
Path to the dataset root directory. |
--output_dir |
./baseline_results |
Folder to save logs, plots, and checkpoints. |
--batch_size |
32 |
Batch size for training. |
--max_epochs |
100 |
Maximum epochs per model. |
--patience |
15 |
Early stopping patience (epochs). |
--essential_only |
False |
Run only the core 5 baseline models. |
--ablations |
False |
Run additional ablation study experiments. |
The code supports the following architectures via the timm library:
| Category | Models |
|---|---|
| Traditional CNNs | ResNet50, VGG16 |
| Efficient CNNs | EfficientNet-B0, MobileNetV2 |
| Transformers | ViT-Small, DeiT-Tiny, DeiT-Small |
| Hybrid / Modern | ConvNeXt-Tiny, Swin-Tiny |
(Based on paper results on the validation set)
| Model | Accuracy |
|---|---|
| Ensemble (Voting) | 94.50% |
| ConvNeXt-Tiny | 93.17% |
| VGG16 | 92.00% |
| ResNet50 | 90.17% |
| DeiT-Small | 83.67% |