Download RESEARCH_REPORT.md from User-2468/mini-unet-colorizer: direct link, hf CLI and curl.
- Browser
- Download file 9.8 kB
-
https://huggingface.co/User-2468/mini-unet-colorizer/resolve/677b57ca066247f33be0afd39df40692f821ef0b/RESEARCH_REPORT.md
- Command line
-
hf download hf://User-2468/mini-unet-colorizer@677b57ca066247f33be0afd39df40692f821ef0b/RESEARCH_REPORT.md
-
curl -L -o RESEARCH_REPORT.md https://huggingface.co/User-2468/mini-unet-colorizer/resolve/677b57ca066247f33be0afd39df40692f821ef0b/RESEARCH_REPORT.md
Mini U-Net Colorizer — research and validation, 20 September 2026
Result and release decision
A confirmed bin-mapping bug was repaired. On the reserved 100-image test subset, mean per-image Lab chroma error fell from 31.27 to 13.90 (55.5% lower). 92/100 images improved. The model still has 3,968,892 learned parameters. No learned weights changed in the recommended release; only the 236-by-2 nonlearned color lookup buffer changed.
Two actual 100-update fine-tuning runs completed. Neither beat the repaired model on the 50-image validation subset, and both lost colorfulness. Their final trained checkpoints and optimizer states are retained, but they were not selected for release. The current recommendation is the validated decoding repair, not either new trained model.
Production status: improved release candidate, not a general-purpose production model. The coffee example still shows substantial blotching, and colors can be semantically wrong. The root cause of all remaining artifacts is not established.
Confirmed failure mechanism
The audited main revision was 6c47ea40724d8fcd67d4f36ce837dc1cb5b1b2a8; stable was b875f0fd5ff7f2e39f2c6068a60b268fb35586cc. Both have 236 bins. In both checkpoints, 232 rows of config.json differ from the serialized bin_centers buffer, with coordinate differences up to 170 Lab units.
The original code creates target labels from freshly estimated bins. It then warm-starts all matching tensor shapes, including bin_centers. This can replace the decoder's vocabulary without changing the target encoder. Training therefore optimizes channels in one vocabulary while previews and inference interpret those channels through another. Cross-entropy does not use the decode buffer, so an improving training loss cannot catch the problem.
Re-running the original source on the original data, seed-0 split, low-chroma training filter and 3,000-image bin sample recreated exactly the config vocabulary: 11,943 filtered training examples, 236 bins. This is evidence for using config for these particular snapshots. It is not a general rule to trust config whenever it conflicts with weights.
Integrity verification found only bin_centers changed; every learned tensor is equal. Original and revised implementations produced bit-identical raw logits on a divisible-by-eight test input. These findings distinguish a decode repair from retraining or a change to architecture.
Validation and experiments
Validation used 50 images, five per class, from the historical seed-0 5% holdout. All variants use 256-by-256 square preprocessing and temperature 0.38 for comparability. CE is unweighted soft cross-entropy against the same confirmed target bins. Chroma ratio is mean predicted chroma divided by mean reference chroma; proximity to 1 is useful but cannot prove realism. Excess chroma edge is a heuristic for excessive predicted color discontinuities in low-luminance-gradient regions; a gray output can score well, so it must not be optimized alone.
| Candidate | CE, lower better | ab error, lower better | Chroma ratio | Excess color edge |
|---|---|---|---|---|
| Existing stable | 2.9584 | 31.40 | 1.895 | 0.907 |
| Repaired stable | 2.9584 | 14.05 | 1.152 | 0.637 |
| Existing main | 2.8444 | 30.84 | 1.830 | 0.719 |
| Repaired main | 2.8444 | 12.77 | 1.021 | 0.520 |
| Low-context-LR pilot | 2.9927 | 13.20 | 0.616 | 0.351 |
| High-context-LR pilot | 2.9886 | 13.31 | 0.569 | 0.308 |
The two pilots started from repaired main with identical data order, seed, optimizer, augmentation and loss. Each used 100 updates, batch size 2, 256px inputs, a 400-image stratified training pool, backbone/head LR 5e-5, cosine decay, AdamW, gradient clipping and frozen BatchNorm running statistics. The only between-pilot difference was context LR: 5e-5 versus 3e-4. Their priors were re-estimated identically on the fixed checkpoint vocabulary using the small pilot training pool. These settings differ from the historical full-data run; this is not a definitive test of longer high-LR training. The candidate-selection criterion was validation CE with visual/colorfulness checks. Neither trained model was promoted.
Reserved test results
The mapping repair was chosen using source reconstruction and the validation subset. A separate 100-image subset, ten per class, was then scored with the same temperature and preprocessing, without using it to tune parameters.
| Metric | Existing main | Repaired main |
|---|---|---|
| Mean per-image ab error | 31.274 | 13.904 |
| Mean predicted chroma | 27.399 | 14.767 |
| Reference mean chroma | 15.553 | 15.553 |
| Chroma ratio | 1.762 | 0.949 |
| Excess color edge | 0.835 | 0.551 |
| Soft CE | 2.9750 | 2.9750 |
Paired bootstrap over 100 images, 10,000 resamples: mean improvement 17.37 Lab units; conditional 95% interval [15.12, 19.87]. This interval describes this small, stratified benchmark, not broad deployment performance. The equal CE is expected because only decoding changes. Seven test references have low mean chroma; color-source-only metrics are also recorded in JSON.
The reconstructed split has no exact-file duplicate leakage among 13,394 examples. Near duplicates and exposure during older upstream training runs have not been ruled out. All split indices and the Parquet SHA-256 are saved. No claims of a pristine never-seen test set across the model's entire history are made.
Visual and application checks
See reports/branch_bin_comparison.png, reports/test_comparison.png, and reports/out_of_domain.png. The comparison removes much of the blue cast and makes many ordinary surfaces more plausible. Four scikit-image examples were used as qualitative probes outside the ten-class benchmark: astronaut, coffee, cat, and rocket. They are far too few to establish out-of-domain reliability. Coffee remains a clear failure case.
The production inference wrapper preserves aspect ratio, handles EXIF orientation and odd image dimensions, bounds model input by the longest side, retains original-resolution luminance, and upsamples only chroma. This avoids square stretching and loss of luminance detail. It is a separate preprocessing change from the square-input quantitative benchmark and still needs broader application-specific validation. No GPU/mobile/browser latency claim is made; evaluation timings were collected under concurrent CPU workloads and are unsuitable for performance comparisons.
Seven integrity tests pass: sparse versus dense CE and gradients, stable soft encoding, identity context initialization, checkpoint roundtrip and mismatch rejection, shape/temperature/inference handling, and exact reproduction of Hugging Face's split. The original UV trainer is also supplied with guards against repeating the bin mismatch, stable loss reductions, identity initialization and better local saving. The modular fine-tuner is the preferred experiment path because it fixes vocabulary semantics across runs.
Research implications and next work
The original project log overstated the certainty of the receptive-field explanation. It also described the context block as an identity at initialization, but its last BatchNorm scale was initialized to one. New code initializes it to zero; loaded historical context weights are preserved. This audit did not identify whether the remaining blotches originate mainly from semantic uncertainty, limited data, upsampling, or training objectives.
Zhang, Isola and Efros (2016) supports classification and rebalancing, but also reports training on roughly one million images and warns about dataset bias. Our inference is that ten Imagenette categories are insufficient evidence for a broad photo product. The paper does not establish that this particular small model must use this formulation forever.
Odena, Dumoulin and Olah (2016) motivates testing resize-convolution if periodic artifacts remain. The present 2x2/stride-2 layers do not have uneven overlap; their existence alone does not prove they cause these blotches. Any replacement needs a controlled learned-weight comparison.
DDColor (ICCV 2023) emphasizes semantic features and multiscale color reasoning. A possible future experiment is teacher-guided training or a compact pretrained semantic encoder, keeping the deployed student under 4M parameters. This is a proposal, not an experiment completed here.
Next experiments should first expand diverse, permitted training and evaluation coverage (people, indoor scenes, foliage, food, low-light and historical scans), preserve an untouched external test set, and run a full-data conservative fine-tune against this repaired baseline. Then compare single interventions such as context LR, a coarse chroma output head, or semantic distillation. Choose explicit product targets for acceptable visible artifacts, latency and maximum image size before calling the result production-ready.
Publication and retained artifacts
The connected Hugging Face OAuth credential allowed Jobs/read access but lacked write-repos. A small direct-main upload failed with HTTP 403; the suggested PR route also failed with 403. No Hub branch was modified. The later user-selected Huggingface custom plugin did not expose separately callable tools in this session; its actual permissions could not be tested.
release/ is ready for an atomic main-branch upload via upload_main.py after normal write authentication. The complete trained checkpoints, logs, scripts, split manifests, metrics and recommended repair are included in the experiment bundle. Stable remains at the original revision. No training job remains running.