SCUNet color real_psnr (LiteRT / TFLite)
Blind real-image denoising for on-device use, converted from
cszn/SCUNet (scunet_color_real_psnr.pth from the
KAIR v1.0 release, Apache-2.0) to a
LiteRT/TFLite model.
| File | scunet_color_real_psnr.tflite (47200352 bytes) |
| SHA-256 | a0def81002254ee05676bd4a4708dea27c4276d264e22bb3f4dc70b44fcd45df |
| Input | float32 NHWC [1, 256, 256, 3], sRGB in [0, 1] |
| Output | float32 NHWC [1, 256, 256, 3], sRGB in [0, 1] (may slightly exceed; clamp) |
| Weights | FP16 storage with DEQUANTIZE (TRANSPOSE_CONV weights FP32); activations FP32 |
| Compute | ~77 GMACs per 256 x 256 tile |
Process images in overlapping 256 x 256 tiles. The network has no global operations; the shifted-window attention mask is built for this tile size.
Conversion
Equivalent rewrites of the official network (FP32 difference to PyTorch ~1e-6; TFLite with FP16 weights vs PyTorch: min 75 dB PSNR over 54 test tiles):
- window partition / merge with tensors of rank <= 4; q / k / v as separate linears with the attention scale folded into q;
- relative position bias and shifted-window mask as precomputed additive constants (row and column terms; -1e4 instead of -inf);
- cyclic shift as slices + concat; channel split / concat of the conv-transformer block folded into 1x1 convolutions;
- LayerNorm evaluated on x / 8 (eps / 64) so its variance stays within FP16 range; runs correctly with GPU FP16 precision (simulated FP16 vs FP32: >= 69.7 dB).
Citation
@article{zhang2023practical,
author = {Zhang, Kai and Li, Yawei and Liang, Jingyun and Cao, Jiezhang and Zhang, Yulun and Tang, Hao and Fan, Deng-Ping and Timofte, Radu and Gool, Luc Van},
title = {Practical Blind Image Denoising via Swin-Conv-UNet and Data Synthesis},
journal = {Machine Intelligence Research},
volume = {20}, number = {6}, pages = {822--836}, year = {2023},
doi = {10.1007/s11633-023-1466-0}
}