This page is based on the DAMN model accompanying:
Dominik Vašinka, Filip Juráň, Jaromír Běhal, and Miroslav Ježek, From stars to molecules: AI guided device-agnostic super-resolution imaging, Nature Communications 17, 8705 (2026).
- Paper: https://www.nature.com/articles/s41467-026-75584-7
- Original repository: https://github.com/VasinkaD/DAMN
- Repository commit used:
5df294f5e434de4fee30f4de55d0efbb6b18d1a8 - Original model: https://zenodo.org/records/18912038/files/DAMN_ResNet.keras
Application source
The complete browser application source is served directly in index.html, assets/style.css, assets/app.js, assets/imaging.js, assets/colormap.js, and assets/inference-worker.js. The local browser adaptation is distributed under AGPL-3.0-only, consistent with the original DAMN repository; see licenses/DAMN-AGPL-3.0.txt. Preserve attribution and applicable license terms when redistributing this application. The model weights are published on Zenodo under GPL-3.0-or-later; see licenses/Model-GPL-3.0.txt. The model's upstream metadata is included in model/zenodo-record.json.
source/func_file_Model.py is the original Python architecture. source/export_browser_model.py exports the original model weights without training, pruning, or quantization. To reproduce the export, create a Python environment with TensorFlow 2.17.0, Keras 3.7.0, and NumPy 1.26.4. Download the original .keras file above and run:
python source/export_browser_model.py --model /path/to/DAMN_ResNet.keras --output model
The script writes model.json and weights.bin. Neither Python nor the original .keras file is needed to serve or run this page.
Bundled third-party software
All runtime libraries are included locally in vendor/:
- TensorFlow.js 4.22.0 and its WebAssembly backend: Apache License 2.0;
licenses/TensorFlow.js-LICENSE. Source: https://github.com/tensorflow/tfjs/tree/tfjs-v4.22.0 - GeoTIFF.js 2.1.3: MIT License;
licenses/GeoTIFF-LICENSE. Source: https://github.com/geotiffjs/geotiff.js/tree/v2.1.3
No runtime CDN access is needed. Library bundles retain their embedded notices. The browser downloads and uses weights, so those weights are necessarily public on the host.
Landing example and display colors
assets/andromeda-example.bin contains little-endian float32 arrays in this order: 50 × 50 input, 400 × 400 SR reconstruction, and 400 × 400 Gaussian-smoothed reconstruction (sigma = 4 output pixels). The input is the [100:150, 100:150] crop from DAMN's Double_star_LR.tiff. The saved results come from the validated local Python notebook. assets/colormap.js is the 256-entry Inferno RGB lookup table sampled from Matplotlib.
To regenerate these display assets from the notebook result (requires NumPy and Matplotlib):
python source/build_example.py --input /path/to/results/Double_star.npz --output assets
The color map is never applied to model input or internal numerical reconstruction arrays. PNG downloads export the reconstruction with or without Gaussian smoothing in grayscale, without a color palette. Each export linearly scales zero to 0 and its maximum intensity to 255, then rounds to 8-bit grayscale values; it does not preserve exact float32 values or absolute intensity scale.