Multispectral extended depth-of-field fluorescence microscopy with co-designed meta-optics and neural reconstruction.
2 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 2 matches
- [1] § Methods › D-CNN ↔ unet.py, lines 127 to 203 · score 0.70 · UNet, channel attention, decoder, encoder, learnable, identity · block
oscr:b:ZCXBE2DCHM871-U· Report a mismatch - [2] § Methods › D-CNN ↔ lit.py, lines 24 to 124 · score 0.51 · 0–1, ReLU, bilinear, deblurred, Clamp, batch · block
oscr:b:NB7ACGNVKSS8M-H· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 203 lines · 7.7 KB · MIT · 1 match
- __author__ = "Anil Appak"
- __email__ = "[email hidden]"
- __organization__ = "Tampere University"
- import torch
- import torch.nn as nn
- import torch.nn.functional as F
- # ---------- Channel Attention (SE) ----------
- class SE(nn.Module):
- def __init__(self, C, r=8, bias_to_one=2.0):
- super().__init__()
- h = max(1, C // r)
- self.fc1 = nn.Linear(C, h)
- self.fc2 = nn.Linear(h, C)
- # start near identity so we don't throttle early
- nn.init.constant_(self.fc2.bias, bias_to_one)
- def forward(self, x): # x: [B,C,H,W]
- s = x.mean(dim=(2, 3)) # [B,C]
- a = torch.sigmoid(self.fc2(F.relu(self.fc1(s)))) # (0,1)
- gate = 0.5 + 0.5 * a # ~[0.5,1.0], starts ~0.94
- return x * gate[:, :, None, None]
- # ---------- Fourier Channel Attention (spectral attention) ----------
- class FourierChannelAttention(nn.Module):
- """
- Scores each channel by its Fourier magnitude statistics and gates features.
- Cheap and works well with few wavelengths (e.g., 4).
- """
- def __init__(self, C, r=8, bias_to_one=2.0):
- super().__init__()
- h = max(1, C // r)
- self.mlp = nn.Sequential(
- nn.Linear(C, h), nn.ReLU(inplace=True),
- nn.Linear(h, C)
- )
- self.fca_ln = nn.LayerNorm(C, elementwise_affine=False)
- # near-identity start
- with torch.no_grad():
- for m in self.mlp:
- if isinstance(m, nn.Linear):
- nn.init.kaiming_uniform_(m.weight, a=1.0)
- nn.init.zeros_(m.bias)
- self.mlp[-1].bias.fill_(bias_to_one)
- def forward(self, x): # x: [B,C,H,W]
- X = torch.fft.rfft2(x, norm="backward") # [B,C,H,Wf]
- mag = X.abs()
- fvec = mag.mean(dim=(2, 3)) # [B,C]
- #fvec = self.fca_ln(fvec) # remove per-sample channel-scale bias, channels clearly have different contrast/texture across λ,
- #which often means different HF energy/SNR. In that case LN (or a scale-invariant statistic) helps.
- print('fvec mean per λ:', fvec.mean(0)) # large spread? -> use LN
- a = torch.sigmoid(self.mlp(fvec)) # (0,1)
- a = a - a.mean(dim=1, keepdim=True) # relative, zero-mean per sample
- gate = 1.0 + 0.3 * a # small ±30% modulation around 1
- x = x * gate[:, :, None, None]
- print('gate mean per λ:', (1+0.3*torch.sigmoid(self.mlp(fvec))).mean(0)) # always same λ on top?
- #gate = 0.5 + 0.5 * a # ~[0.5,1.0]
- return x #x * gate[:, :, None, None]
- # ---------- building blocks ----------
- class DoubleConv(nn.Module):
- def __init__(self, in_channels, out_channels, mid_channels=None, gn_groups=8):
- super().__init__()
- if not mid_channels:
- mid_channels = out_channels
- self.double_conv = nn.Sequential(
- nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False),
- nn.GroupNorm(num_groups=min(gn_groups, mid_channels), num_channels=mid_channels),
- nn.ReLU(inplace=True),
- nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False),
- nn.GroupNorm(num_groups=min(gn_groups, out_channels), num_channels=out_channels),
- nn.ReLU(inplace=True),
- )
- def forward(self, x):
- return self.double_conv(x)
- class Down(nn.Module):
- def __init__(self, in_channels, out_channels, gn_groups=8):
- super().__init__()
- self.maxpool_conv = nn.Sequential(
- nn.MaxPool2d(2),
- DoubleConv(in_channels, out_channels, gn_groups=gn_groups)
- )
- def forward(self, x):
- return self.maxpool_conv(x)
- class Up(nn.Module):
- def __init__(self, in_channels, out_channels, bilinear=True, gn_groups=8):
- super().__init__()
- if bilinear:
- self.up = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True)
- self.conv = DoubleConv(in_channels, out_channels, in_channels // 2, gn_groups=gn_groups)
- else:
- self.up = nn.ConvTranspose2d(in_channels, in_channels // 2, kernel_size=2, stride=2)
- self.conv = DoubleConv(in_channels, out_channels, gn_groups=gn_groups)
- def forward(self, x1, x2):
- x1 = self.up(x1)
- # pad if shapes mismatch
- diffY = x2.size()[2] - x1.size()[2]
- diffX = x2.size()[3] - x1.size()[3]
- x1 = F.pad(x1, [diffX // 2, diffX - diffX // 2,
- diffY // 2, diffY - diffY // 2])
- x = torch.cat([x2, x1], dim=1) # fusion
- return self.conv(x)
- class OutConv(nn.Module):
- def __init__(self, in_channels, out_channels):
- super().__init__()
- self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1)
- def forward(self, x):
- return self.conv(x)
- # ---------- UNet ----------
- class UNet(nn.Module):
- def __init__(self, n_channels, n_classes, bilinear=False, gn_groups=8):
- super().__init__()
- self.n_channels = n_channels
- self.n_classes = n_classes
- self.bilinear = bilinear
- # Per-channel normalization at the very front (learnable affine)
- self.in_norm = nn.InstanceNorm2d(n_channels, affine=True, eps=1e-5)
- # Identity-initialized spectral 1x1 mixing
- self.spectral_mix = nn.Conv2d(n_channels, n_channels, kernel_size=1, bias=True)
- with torch.no_grad():
- self.spectral_mix.weight.zero_()
- for c in range(n_channels):
- self.spectral_mix.weight[c, c, 0, 0] = 1.0
- self.spectral_mix.bias.zero_()
- # Fourier Channel Attention (spectral attention)
- self.fca = FourierChannelAttention(n_channels, r=8, bias_to_one=2.0)
- # Encoder
- self.inc = DoubleConv(n_channels, 32, gn_groups=gn_groups)
- self.down1 = Down(32, 64, gn_groups=gn_groups)
- self.down2 = Down(64, 128, gn_groups=gn_groups)
- factor = 2 if bilinear else 1
- self.down3 = Down(128, 256 // factor, gn_groups=gn_groups)
- # Decoder + SE after each fusion
- self.up2 = Up(256, 128 // factor, bilinear, gn_groups=gn_groups)
- self.se_dec2 = SE(128 // factor)
- self.up3 = Up(128, 64 // factor, bilinear, gn_groups=gn_groups)
- self.se_dec3 = SE(64 // factor)
- self.up4 = Up(64, 32, bilinear, gn_groups=gn_groups)
- self.se_dec4 = SE(32)
- self.outc = OutConv(32, n_classes)
- # If you want residual later:
- self.use_residual_head = True
- self.res_scale = 0.5 # only used if use_residual_head=True
- self.out_gain = nn.Parameter(torch.ones(1, n_classes, 1, 1)) # start ~1–2
- self.out_bias = nn.Parameter(torch.zeros(1, n_classes, 1, 1)) # start 0
- def forward(self, x):
- # front-end normalization and spectral attention
- x = self.in_norm(x)
- x_mixed = self.spectral_mix(x)
- x_mixed = self.fca(x_mixed)
- # encoder
- x1 = self.inc(x_mixed)
- x2 = self.down1(x1)
- x3 = self.down2(x2)
- x4 = self.down3(x3)
- # decoder with SE after fusions
- y = self.up2(x4, x3)
- #y = self.se_dec2(y)
- y = self.up3(y, x2)
- #y = self.se_dec3(y)
- y = self.up4(y, x1)
- #y = self.se_dec4(y)
- o = self.outc(y)
- # Stable head
- if not self.use_residual_head:
- out = torch.sigmoid(o) # bounded, non-saturating early
- else:
- #out = (x_mixed + self.res_scale * o).clamp(0, 1)
- out_pre = x_mixed + self.res_scale * o # residual head
- out = torch.sigmoid(self.out_gain * out_pre + self.out_bias) # <— no hard clamp
- return out
unet.py at commit 3e12bf2, under MIT · at the source
Overview
- Physics Unit, Faculty of Engineering and Natural Sciences, Tampere University,Tampere, 33720 Finland
- INRIA Rennes, Bretagne Atlantique Research Centre,Rennes, 35042 France
- Bio Unit, Faculty of Medicine and Health Technology, Tampere University,Tampere, 33520 Finland
- Signal Processing Research Centre, Tampere University,Tampere, 33720 Finland
- Department of Electrical Engineering, Photonic Integration Group, Eindhoven University of Technology,Eindhoven, 5600 MB The Netherlands
Abstract
High numerical aperture fluorescence microscopy provides subcellular resolution, but its depth of field is extremely limited, so thick specimens quickly fall out of focus and typically require axial scanning. Multispectral imaging further compounds this problem because chromatic aberrations shift the best focus plane and distort registration across emission channels, especially in thick samples. In this work, we present MANTIS (Multispectral All-Depth meta-opTic Imaging System), a co-designed computational microscopy imaging system that achieves extended depth-of-field from a single acquisition without axial scanning. MANTIS combines a learned meta-optic with a physics-guided neural network trained end-to-end to reconstruct sharp multispectral images from depth, and wavelength-dependent blurred sensor measurements. We experimentally demonstrate a 50 μm extended depth of field at NA 1.1, corresponding to an 82-fold increase over a conventional wide-field microscope. In addition, simulations show that MANTIS can target different depth-of-field ranges, with the expected trade-off that larger depth-of-field ranges come at a cost in reconstruction fidelity. We validate the approach on biologically relevant fluorescence specimens, including 50 μm thick three-dimensional cultured MDCK II spheroids, and show that, compared with conventional wide-field fluorescence microscopy, reconstructions maintain contrast and lateral detail across depth, with reduced defocus blur and consistent performance across spectral channels.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.
humeyracaglayan/MANTIS
3e12bf2e7e1dba9d1b923adc5670084051cbec2f, 27 February 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
8 files
- dataset.py, Python, 85 lines
- lit.py, Python, 124 lines, 1 match
- load_models_and_predict.
py , Python, 180 lines - main.py, Python, 121 lines
- optic_blackbox.py, Python, 51 lines
- unet.py, Python, 203 lines, 1 match
- LICENSE, License, 21 lines
- README.md, Text, 62 lines
Code availability
Training and inference code for the reconstruction network, together with pretrained model weights and example configuration files, are available on GitHub: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 6 scripts, each with its path and the digest of its content;
- 2 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
- zenodo:18609221, at Zenodo; found in “Data availability”
Data availability
The MDCK fluorescence dataset acquired in this work has been deposited in Zenodo: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 3 keywords, 3 funders, 31 references.
Cite
This paper
Atalay Appak, I. A., Singh, H. J., Korpela, S., Ihalainen, T. O., Sahin, E., Guillemot, C., & Caglayan, H. (2026). Multispectral extended depth-of-field fluorescence microscopy with co-designed meta-optics and neural reconstruction. Light, science & applications, 15(1), 242. https://
BibTeX
@article{atalayappak2026
author = {Atalay Appak, Ipek Anil and Singh, Haobijam Johnson and Korpela, Sanna and Ihalainen, Teemu O. and Sahin, Erdem and Guillemot, Christine and Caglayan, Humeyra},
title = {{Multispectral extended depth-of-field fluorescence microscopy with co-designed meta-optics and neural reconstruction}},
journal = {Light, science \& applications},
year = {2026},
month = may,
volume = {15},
number = {1},
pages = {242},
publisher = {Nature Publishing Group},
issn = {2095-5545},
doi = {10.1038/
url = {https://
pmid = {42156362},
pmcid = {PMC13187408}
}
RIS
TY - JOUR
AU - Atalay Appak, Ipek Anil
AU - Singh, Haobijam Johnson
AU - Korpela, Sanna
AU - Ihalainen, Teemu O.
AU - Sahin, Erdem
AU - Guillemot, Christine
AU - Caglayan, Humeyra
TI - Multispectral extended depth-of-field fluorescence microscopy with co-designed meta-optics and neural reconstruction
T2 - Light, science & applications
J2 - Light Sci Appl
PY - 2026
DA - 2026/
VL - 15
IS - 1
SP - 242
SN - 2095-5545
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Multispectral extended depth-of-field fluorescence microscopy with co-designed meta-optics and neural reconstruction",
"container-title": "Light, science & applications",
"author": [
{
"family": "Atalay Appak",
"given": "Ipek Anil"
},
{
"family": "Singh",
"given": "Haobijam Johnson"
},
{
"family": "Korpela",
"given": "Sanna"
},
{
"family": "Ihalainen",
"given": "Teemu O."
},
{
"family": "Sahin",
"given": "Erdem"
},
{
"family": "Guillemot",
"given": "Christine"
},
{
"family": "Caglayan",
"given": "Humeyra"
}
],
"container-title-short":
"volume": "15",
"issue": "1",
"page": "242",
"DOI": "10.1038/
"PMID": "42156362",
"PMCID": "PMC13187408",
"ISSN": "2095-5545",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
19
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.3389/fbioe.2024.1411680 [code]
- ML-driven segmentation of microvascular features during histological examination of tissue-engineered vascular grafts.Journal: Frontiers in bioengineering and biotechnologyIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools, histology / microscopy, 1 reference
- [2] doi:10.1038/s41467-022-29568-y
- Trilobite-inspired neural nanophotonic light-field camera with extreme depth-of-field.Journal: Nature communicationsIn common: 4 references
- [3] doi:10.1038/s41467-021-26443-0 [code]
- Neural nano-optics for high-quality thin lens imaging.Journal: Nature communicationsIn common: Matplotlib, NumPy, 3 references
- [4] doi:10.1038/s41592-022-01417-2 [code]
- DaXi-high-resolution, large imaging volume and multi-view single-objective light-sheet microscopy.Journal: Nature methodsIn common: Pillow, Matplotlib, NumPy, histology / microscopy, 2 references
- [5] doi:10.7554/elife.91979 [code]
- Expansion-assisted selective plane illumination microscopy for nanoscale imaging of centimeter-scale tissues.Journal: eLifeIn common: Pillow, Matplotlib, NumPy, histology / microscopy, 2 references
- [6] doi:10.1007/s12021-026-09815-z [code]
- BasNet: Attention U-Net-Based Automated Axon Segmentation in Bielschowsky Silver-Stained Histology.Journal: NeuroinformaticsIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools, histology / microscopy
- [7] doi:10.1038/s41598-026-61605-4 [code]
- Learning precise segmentation of neurofibrillary tangles from rapid manual point annotations.Journal: Scientific reportsIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools, histology / microscopy
- [8] doi:10.1162/imag.a.1079 [code]
- From fibers to cells: Fourier-based registration enables virtual Cresyl violet staining from 3D polarized light imaging.Journal: Imaging neuroscience (Cambridge, Mass.)In common: PyTorch Lightning, Pillow, PyTorch, 2 other tools, histology / microscopy
- [9] doi:10.1038/s41592-025-02770-8 [code]
- Scaling up spatial transcriptomics for large-sized tissues: uncovering cellular-level tissue architecture beyond conventional platforms with iSCALE.Journal: Nature methodsIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools, histology / microscopy
- [10] doi:10.1038/s41514-025-00235-y [code]
- Identification of markers for neurescence through transcriptomic profiling of postmortem human brains.Journal: npj agingIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools, histology / microscopy
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 6 scripts, and 2 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:88e97c3ec450ee65…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41377-026-02337-y)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41377-026-02337-y.svg
:target: https://openscicode.org/badge/doi/10.1038/s41377-026-02337-y
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41377-026-02337-y"><img src="https://openscicode.org/badge/doi/10.1038/s41377-026-02337-y.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
