NPPE3 Super Resolution - Hybrid Ensemble
Overview
This repository contains the trained weights for a high-performance Super Resolution ensemble used in the NPPE3 competition. The solution achieved a 98.1% grading equivalent (39.50+ dB) by combining the local geometric edge-detection of a Pure CNN with the global texture-reconstruction of a Transformer.
Models Included in this Repository
best_realesrnet.pth(The Architect)- Architecture: RRDBNet (Residual-in-Residual Dense Block)
- Training: 90 Epochs using Charbonnier Loss and FP16 Mixed Precision.
- Purpose: Acts as a hardcore edge-detector to perfectly reconstruct geometric boundaries.
best_swinir.pth(The Painter)- Architecture: SwinIR-Medium (Swin Transformer)
- Purpose: Uses self-attention to flawlessly reconstruct repeating global textures (fabric, grass, etc.) that CNNs typically over-smooth.
The Ensemble Strategy
To achieve the final Kaggle Leaderboard score, the predictions from these two architectures were mathematically blended using a 75% RealESRNet / 25% SwinIR ratio. This specific weighting ensures maximum edge preservation while injecting just enough Transformer attention to patch localized texture blind spots.
Validation Results (Competition Metric-Style PSNR)
- RealESRNet (Validation Set): 39.58 dB
- SwinIR (Validation Set): 39.47 dB
- Final 75/25 Ensemble (Kaggle Leaderboard): 39.501 dB
Files
best_realesrnet.pthโ best RealESRNet checkpoint (state_dict)best_swinir.pthโ best SwinIR-Medium checkpoint (state_dict)
Usage
import torch
from model import RRDBNet # see Kaggle notebook for the class definition
# Initialize the RealESRNet Architecture
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32)
# Load the golden weights
ckpt = torch.load("best_realesrnet.pth", map_location="cpu")
model.load_state_dict(ckpt['params_ema'] if 'params_ema' in ckpt else ckpt, strict=True)
model.eval()