NYCU Visual Recognition using Deep Learning (Spring 2026) - Homework 2
This repository contains the official implementation for the Digit Detection Problem (Homework 2). By leveraging the RT-DETRv2 architecture with a ResNet-50 backbone, this project successfully secured high rank on the NYCU Visual Recognition Course (Spring 2026) Homework 2 CodaBench competition leaderboard with a Test score of 0.41.
The core objective of this project is to localize and classify multiple digits in dense environments. To maximize performance under strict course constraints, we implemented several key strategies:
eos_coef) background penalty to understand the balance between local precision and test-set generalization.We evaluated 14 distinct configurations to bridge the gap between local validation and the unseen CodaBench test set.
| Experimental Group | Queries ($q$) | Base LR | Batch Size | Weight Decay | Local mAP | CodaBench Score |
|---|---|---|---|---|---|---|
| 🏆 Best Model | 1000 | $1 \times 10^{-4}$ | 24 | $5 \times 10^{-4}$ | 0.4497 | 0.41 |
| Baseline (Standard) | 1000 | $1 \times 10^{-4}$ | 16 | $1 \times 10^{-3}$ | 0.4630 | 0.40 |
| High Penalty Exp | 1000 | $1 \times 10^{-4}$ | 32 | $1 \times 10^{-3}$ | 0.4717 | 0.37 |
| Query Variant ($q300$) | 300 | $1 \times 10^{-4}$ | 16 | $5 \times 10^{-4}$ | 0.4468 | 0.39 |
Key Finding: While increasing the background penalty (
eos_coef = 1e-3) yielded a superior local mAP of 0.47, it caused a performance drop on CodaBench. This suggests that a more balanced regularization approach is necessary to handle noisy annotations in the test set.
The learning curves below demonstrate the training progression of our optimized configuration.
Install the necessary packages via pip:
pip install -r requirements.txt
There are two primary methods to execute training depending on your hardware environment.
train.py (Direct Execution)Best for single-GPU setups or debugging. This provides direct access to Python's error logs and single-process execution.
python train.py --run_name --batch_size --epochs --lr --wd --queries --gpu --workers --eof --data_path --save_path
train.sh (Distributed Execution)Best for Multi PC/Container setups. Generate output name based on the parameters it used.
bash train.sh --batch_size --epochs --lr --wd --queries --gpu --workers --eof
train.py vs train.sh| Aspect | train.py | train.sh |
|---|---|---|
| Execution | Single-process | Multi-process (DDP) |
| Hardware | Single GPU / CPU | Multiple GPUs |
| Performance | Slower for large datasets | Maximum speed via parallelization |
| Use Case | Debugging and testing | Production-level training |
Muhammad Rayhan Athaillah (賴瑞涵)
Student ID: 313540001
Affiliation: National Yang Ming Chiao Tung University (NYCU)
29 commits
Python
87.2%
Shell
12.8%
NYCU Visual Recognition using Deep Learning (Spring 2026) - Homework 2
This repository contains the official implementation for the Digit Detection Problem (Homework 2). By leveraging the RT-DETRv2 architecture with a ResNet-50 backbone, this project successfully secured high rank on the NYCU Visual Recognition Course (Spring 2026) Homework 2 CodaBench competition leaderboard with a Test score of 0.41.
The core objective of this project is to localize and classify multiple digits in dense environments. To maximize performance under strict course constraints, we implemented several key strategies:
eos_coef) background penalty to understand the balance between local precision and test-set generalization.We evaluated 14 distinct configurations to bridge the gap between local validation and the unseen CodaBench test set.
| Experimental Group | Queries ($q$) | Base LR | Batch Size | Weight Decay | Local mAP | CodaBench Score |
|---|---|---|---|---|---|---|
| 🏆 Best Model | 1000 | $1 \times 10^{-4}$ | 24 | $5 \times 10^{-4}$ | 0.4497 | 0.41 |
| Baseline (Standard) | 1000 | $1 \times 10^{-4}$ | 16 | $1 \times 10^{-3}$ | 0.4630 | 0.40 |
| High Penalty Exp | 1000 | $1 \times 10^{-4}$ | 32 | $1 \times 10^{-3}$ | 0.4717 | 0.37 |
| Query Variant ($q300$) | 300 | $1 \times 10^{-4}$ | 16 | $5 \times 10^{-4}$ | 0.4468 | 0.39 |
Key Finding: While increasing the background penalty (
eos_coef = 1e-3) yielded a superior local mAP of 0.47, it caused a performance drop on CodaBench. This suggests that a more balanced regularization approach is necessary to handle noisy annotations in the test set.
The learning curves below demonstrate the training progression of our optimized configuration.
Install the necessary packages via pip:
pip install -r requirements.txt
There are two primary methods to execute training depending on your hardware environment.
train.py (Direct Execution)Best for single-GPU setups or debugging. This provides direct access to Python's error logs and single-process execution.
python train.py --run_name --batch_size --epochs --lr --wd --queries --gpu --workers --eof --data_path --save_path
train.sh (Distributed Execution)Best for Multi PC/Container setups. Generate output name based on the parameters it used.
bash train.sh --batch_size --epochs --lr --wd --queries --gpu --workers --eof
train.py vs train.sh| Aspect | train.py | train.sh |
|---|---|---|
| Execution | Single-process | Multi-process (DDP) |
| Hardware | Single GPU / CPU | Multiple GPUs |
| Performance | Slower for large datasets | Maximum speed via parallelization |
| Use Case | Debugging and testing | Production-level training |
Muhammad Rayhan Athaillah (賴瑞涵)
Student ID: 313540001
Affiliation: National Yang Ming Chiao Tung University (NYCU)
29 commits
Python
87.2%
Shell
12.8%