Project layout — this bundle contains five stage directories from the AI-Designer pipeline:
research/(literature survey),architect/(blueprint +ModelConfig),coder/(PyTorch implementation),validator/(tests + benchmarks), anddocumenter/(this README plusdocs/andCHANGELOG.md). An optionalpaper/directory holds the NeurIPS-format writeup when the paper-generation step was triggered.The original research request that produced this bundle is preserved verbatim in
prompt.md— if any URLs in the prompt were fetched server-side for additional context, their cleaned contents are appended there too.
A unified latent diffusion architecture for style-consistent inpainting of heterogeneous damage types in historical artworks, with interpretable per-patch attribution to artist corpus exemplars.
ArtRestore-Diffusion addresses the problem that existing inpainting methods treat all damage types identically and provide no guarantee of artist-specific style consistency. The architecture combines (a) mask-adaptive FiLM conditioning that handles cracks, scratches, large missing regions, fading, and text overlay in a single forward pass, (b) artist-specific style embedding injection via AdaLN and cross-attention, (c) retrieval-augmented denoising through a style exemplar memory bank of undamaged artist patches, and (d) per-patch attribution maps tracing each generated region to its nearest source exemplar.
Status: Pre-experimental infrastructure. All unit tests and domain benchmarks pass on randomly initialized models. Performance targets (LPIPS, DISTS, style certificate) require trained-model evaluation.
- Unified damage-type handling — A single mask-adaptive CNN + FiLM module processes binary (crack, scratch, hole, text) and continuous (fade) masks with no per-type routing; see ARCHITECTURE.md#3-the-core-component
- Style certificate — Formal bound on artist-specific style deviation via embedding distance from artist manifold centroid; violation rate < 10% patches exceeding 3σ is the target; see ARCHITECTURE.md#section-7
- Interpretable by construction — Cross-attention weights to the style exemplar memory bank are rendered into attribution maps linking each generated patch to a real source patch; see docs/ARCHITECTURE.md#43-attribution-map-rendering
- Linear-time inference — 50-step DDIM sampling (vs. 1000-step DDPM) with deterministic, reproducible attribution maps; see BENCHMARKS.md#profiling
pip install -r requirements.txt
python smoke_test.py # 13 tests, verifies all component shapes + gradients + losses
pytest -v test_model.py # 18 unit tests (shapes, gradients, correctness, numerics)
pytest -v test_benchmarks.py # 19 domain-specific benchmarkscoder/
config.py — ArtRestoreConfig dataclass (all hyperparameters)
layers.py — Shared UNet layers (ResBlock, SpatialAttention, etc.)
mask_encoder.py — Mask-adaptive CNN + FiLM modulation
style_block.py — Artist embedding table + AdaLN + cross-attention injection
exemplar_memory.py — Style exemplar memory bank + cross-attention retrieval
boundary_gate.py — Learned per-pixel blending at mask edges
diffusion_schedule.py — Linear beta schedule + DDIM sampling
model.py — ArtRestoreBlock, ArtRestoreUNet, ArtRestoreModel
attribution.py — Attribution map rendering + style certificate
inference.py — End-to-end restoration pipeline
trainer.py — Training harness with EMA, AdamW, LR schedule
smoke_test.py — 13-test smoke suite for shape/gradient/loss verification
validator/
test_model.py — 20 pytest unit tests (shapes, gradients, correctness, numerics)
test_benchmarks.py — 19 domain-specific benchmarks (damage types, style, memory, etc.)
run_ablations.py — 11 single-field ablation configs from architect traceability table
profile_model.py — GPU memory, operator timing, FLOP estimation
research_eval/ — Research-quality scoring, claim grounding, experiment coverage
- docs/ARCHITECTURE.md — Design, inductive biases, equations, shape evolution, design decisions, domain-specific considerations, known limitations
- docs/TRAINING.md — Environment setup, hyperparameters, training recipe, expected behavior, troubleshooting
- docs/BENCHMARKS.md — Damage-type uniformity, style certificate, reconstruction fidelity, ablation studies, profiling
- docs/API.md — Module-level API reference with shape contracts
@misc{artrestore-diffusion,
title = {ArtRestore-Diffusion: Unified Style-Consistent Art Restoration with Interpretable Attribution},
author = {TODO},
year = {2026},
note = {Generated via ml-designer pipeline}
}