Multispectral extended depth-of-field fluorescence microscopy with co-designed meta-optics and neural reconstruction.
The 2 matches
- [1] § Methods › D-CNN ↔ unet.py, lines 127–203 · score 0.70 · UNet, channel attention, decoder, encoder, learnable, identity
- [2] § Methods › D-CNN ↔ lit.py, lines 24–124 · score 0.51 · 0–1, ReLU, bilinear, deblurred, Clamp, batch
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: 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.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
- [2] 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
- [3] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools
- [4] doi:10.7554/elife.105953 [code]
- Top-down feedback in deep neural networks leads to functional differences during audiovisual integration.Journal: eLifeIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools
- [5] doi:10.1038/s41467-026-76939-w [code]
- HIPPIE: a generative model for electrophysiological analysis across species, technologies, and modalities.Journal: Nature communicationsIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools
- [6] doi:10.1162/imag.a.1326 [code]
- RAVEN: Robust, generalizable, multi-resolution structural MRI upsampling using autoencoders.Journal: Imaging neuroscience (Cambridge, Mass.)In common: PyTorch Lightning, Pillow, PyTorch, 2 other tools
- [7] doi:10.1093/bioinformatics/btag652 [code]
- mmVelo: a deep generative model for estimating cell state-dependent dynamics across multiple modalities.Journal: Bioinformatics (Oxford, England)In common: PyTorch Lightning, Pillow, PyTorch, 2 other tools
- [8] doi:10.1007/s12021-026-09803-3 [code]
- NeuroFusion: A Unified Framework for Generalized Visual Stimulus Decoding from fMRI Across Datasets and Subjects.Journal: NeuroinformaticsIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools
- [9] doi:10.1162/imag.a.1299 [code]
- A modular semantic-structural pipeline for visual decoding from primate spiking data via selective temporal integration.Journal: Imaging neuroscience (Cambridge, Mass.)In common: PyTorch Lightning, Pillow, PyTorch, 2 other tools
- [10] doi:10.1016/j.isci.2026.116355 [code]
- Tera-MIND: Tera-scale mouse brain simulation via spatial mRNA-guided diffusion.Journal: iScienceIn common: PyTorch Lightning, Pillow, PyTorch, 2 other tools
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:0d24d4766df1af06…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
