pika-2026/nppe3_final_best_model
020
Workflow
- Setup — loaded PyTorch, set random seed (19), selected device (cuda/cpu).
- Data — competition dataset with paired low-res/high-res images:
train/train(LR) +train/gt(HR)val/val(LR) +val/gt(HR)test(LR only, for submission)
- EDA — checked LR/HR image sizes and scale factor, visualized a few sample pairs.
- Dataset/Dataloader — built LR-HR file pairs, created a
Datasetthat randomly crops HR patches (256x256) with the matching LR patch, applies random flip/rotation augmentation, and returns normalized tensors. Used a validation subset (every 4th pair) to speed up per-epoch evaluation.
- Model —
RRDBNetarchitecture (23 RRDB blocks, 64 features, growth channel 32, 4x upscaling), matching the Real-ESRGAN design. Initialized from the official pretrained weights (RealESRGAN_x4plus.pth) before fine-tuning.
- Training — L1 loss, Adam optimizer, mixed-precision (
torch.amp), EMA of model weights (decay 0.999). Ran epochs in a time-budgeted loop: timed the first few ("warmup") epochs to estimate how many epochs fit in the time budget, then used a cosine annealing LR schedule for the remaining planned epochs. Saved the EMA model's weights tobest_model.pthwhenever validation PSNR improved.
- Inference — reloaded the best checkpoint, ran tiled super-resolution on the val set (PSNR check) and the test set, with optional test-time self-ensemble (flips/ rotations averaged).
- Submission — converted predicted test images into the competition's flattened pixel-value CSV format matching
sample_submission.csv.
Files in this repo
best_model.pth— trained weights (state_dict)config.json— architecture hyperparameters used to build the model
