OSCR

Multispectral extended depth-of-field fluorescence microscopy with co-designed meta-optics and neural reconstruction.

Code ↔ Paper

2 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

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. [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. [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

  1. __author__ = "Anil Appak"
  2. __email__ = "[email hidden]"
  3. __organization__ = "Tampere University"
  4. import torch
  5. import torch.nn as nn
  6. import torch.nn.functional as F
  7. # ---------- Channel Attention (SE) ----------
  8. class SE(nn.Module):
  9. def __init__(self, C, r=8, bias_to_one=2.0):
  10. super().__init__()
  11. h = max(1, C // r)
  12. self.fc1 = nn.Linear(C, h)
  13. self.fc2 = nn.Linear(h, C)
  14. # start near identity so we don't throttle early
  15. nn.init.constant_(self.fc2.bias, bias_to_one)
  16. def forward(self, x): # x: [B,C,H,W]
  17. s = x.mean(dim=(2, 3)) # [B,C]
  18. a = torch.sigmoid(self.fc2(F.relu(self.fc1(s)))) # (0,1)
  19. gate = 0.5 + 0.5 * a # ~[0.5,1.0], starts ~0.94
  20. return x * gate[:, :, None, None]
  21. # ---------- Fourier Channel Attention (spectral attention) ----------
  22. class FourierChannelAttention(nn.Module):
  23. """
  24. Scores each channel by its Fourier magnitude statistics and gates features.
  25. Cheap and works well with few wavelengths (e.g., 4).
  26. """
  27. def __init__(self, C, r=8, bias_to_one=2.0):
  28. super().__init__()
  29. h = max(1, C // r)
  30. self.mlp = nn.Sequential(
  31. nn.Linear(C, h), nn.ReLU(inplace=True),
  32. nn.Linear(h, C)
  33. )
  34. self.fca_ln = nn.LayerNorm(C, elementwise_affine=False)
  35. # near-identity start
  36. with torch.no_grad():
  37. for m in self.mlp:
  38. if isinstance(m, nn.Linear):
  39. nn.init.kaiming_uniform_(m.weight, a=1.0)
  40. nn.init.zeros_(m.bias)
  41. self.mlp[-1].bias.fill_(bias_to_one)
  42. def forward(self, x): # x: [B,C,H,W]
  43. X = torch.fft.rfft2(x, norm="backward") # [B,C,H,Wf]
  44. mag = X.abs()
  45. fvec = mag.mean(dim=(2, 3)) # [B,C]
  46. #fvec = self.fca_ln(fvec) # remove per-sample channel-scale bias, channels clearly have different contrast/texture across λ,
  47. #which often means different HF energy/SNR. In that case LN (or a scale-invariant statistic) helps.
  48. print('fvec mean per λ:', fvec.mean(0)) # large spread? -> use LN
  49. a = torch.sigmoid(self.mlp(fvec)) # (0,1)
  50. a = a - a.mean(dim=1, keepdim=True) # relative, zero-mean per sample
  51. gate = 1.0 + 0.3 * a # small ±30% modulation around 1
  52. x = x * gate[:, :, None, None]
  53. print('gate mean per λ:', (1+0.3*torch.sigmoid(self.mlp(fvec))).mean(0)) # always same λ on top?
  54. #gate = 0.5 + 0.5 * a # ~[0.5,1.0]
  55. return x #x * gate[:, :, None, None]
  56. # ---------- building blocks ----------
  57. class DoubleConv(nn.Module):
  58. def __init__(self, in_channels, out_channels, mid_channels=None, gn_groups=8):
  59. super().__init__()
  60. if not mid_channels:
  61. mid_channels = out_channels
  62. self.double_conv = nn.Sequential(
  63. nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False),
  64. nn.GroupNorm(num_groups=min(gn_groups, mid_channels), num_channels=mid_channels),
  65. nn.ReLU(inplace=True),
  66. nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False),
  67. nn.GroupNorm(num_groups=min(gn_groups, out_channels), num_channels=out_channels),
  68. nn.ReLU(inplace=True),
  69. )
  70. def forward(self, x):
  71. return self.double_conv(x)
  72. class Down(nn.Module):
  73. def __init__(self, in_channels, out_channels, gn_groups=8):
  74. super().__init__()
  75. self.maxpool_conv = nn.Sequential(
  76. nn.MaxPool2d(2),
  77. DoubleConv(in_channels, out_channels, gn_groups=gn_groups)
  78. )
  79. def forward(self, x):
  80. return self.maxpool_conv(x)
  81. class Up(nn.Module):
  82. def __init__(self, in_channels, out_channels, bilinear=True, gn_groups=8):
  83. super().__init__()
  84. if bilinear:
  85. self.up = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True)
  86. self.conv = DoubleConv(in_channels, out_channels, in_channels // 2, gn_groups=gn_groups)
  87. else:
  88. self.up = nn.ConvTranspose2d(in_channels, in_channels // 2, kernel_size=2, stride=2)
  89. self.conv = DoubleConv(in_channels, out_channels, gn_groups=gn_groups)
  90. def forward(self, x1, x2):
  91. x1 = self.up(x1)
  92. # pad if shapes mismatch
  93. diffY = x2.size()[2] - x1.size()[2]
  94. diffX = x2.size()[3] - x1.size()[3]
  95. x1 = F.pad(x1, [diffX // 2, diffX - diffX // 2,
  96. diffY // 2, diffY - diffY // 2])
  97. x = torch.cat([x2, x1], dim=1) # fusion
  98. return self.conv(x)
  99. class OutConv(nn.Module):
  100. def __init__(self, in_channels, out_channels):
  101. super().__init__()
  102. self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1)
  103. def forward(self, x):
  104. return self.conv(x)
  105. # ---------- UNet ----------
  106. class UNet(nn.Module):
  107. def __init__(self, n_channels, n_classes, bilinear=False, gn_groups=8):
  108. super().__init__()
  109. self.n_channels = n_channels
  110. self.n_classes = n_classes
  111. self.bilinear = bilinear
  112. # Per-channel normalization at the very front (learnable affine)
  113. self.in_norm = nn.InstanceNorm2d(n_channels, affine=True, eps=1e-5)
  114. # Identity-initialized spectral 1x1 mixing
  115. self.spectral_mix = nn.Conv2d(n_channels, n_channels, kernel_size=1, bias=True)
  116. with torch.no_grad():
  117. self.spectral_mix.weight.zero_()
  118. for c in range(n_channels):
  119. self.spectral_mix.weight[c, c, 0, 0] = 1.0
  120. self.spectral_mix.bias.zero_()
  121. # Fourier Channel Attention (spectral attention)
  122. self.fca = FourierChannelAttention(n_channels, r=8, bias_to_one=2.0)
  123. # Encoder
  124. self.inc = DoubleConv(n_channels, 32, gn_groups=gn_groups)
  125. self.down1 = Down(32, 64, gn_groups=gn_groups)
  126. self.down2 = Down(64, 128, gn_groups=gn_groups)
  127. factor = 2 if bilinear else 1
  128. self.down3 = Down(128, 256 // factor, gn_groups=gn_groups)
  129. # Decoder + SE after each fusion
  130. self.up2 = Up(256, 128 // factor, bilinear, gn_groups=gn_groups)
  131. self.se_dec2 = SE(128 // factor)
  132. self.up3 = Up(128, 64 // factor, bilinear, gn_groups=gn_groups)
  133. self.se_dec3 = SE(64 // factor)
  134. self.up4 = Up(64, 32, bilinear, gn_groups=gn_groups)
  135. self.se_dec4 = SE(32)
  136. self.outc = OutConv(32, n_classes)
  137. # If you want residual later:
  138. self.use_residual_head = True
  139. self.res_scale = 0.5 # only used if use_residual_head=True
  140. self.out_gain = nn.Parameter(torch.ones(1, n_classes, 1, 1)) # start ~1–2
  141. self.out_bias = nn.Parameter(torch.zeros(1, n_classes, 1, 1)) # start 0
  142. def forward(self, x):
  143. # front-end normalization and spectral attention
  144. x = self.in_norm(x)
  145. x_mixed = self.spectral_mix(x)
  146. x_mixed = self.fca(x_mixed)
  147. # encoder
  148. x1 = self.inc(x_mixed)
  149. x2 = self.down1(x1)
  150. x3 = self.down2(x2)
  151. x4 = self.down3(x3)
  152. # decoder with SE after fusions
  153. y = self.up2(x4, x3)
  154. #y = self.se_dec2(y)
  155. y = self.up3(y, x2)
  156. #y = self.se_dec3(y)
  157. y = self.up4(y, x1)
  158. #y = self.se_dec4(y)
  159. o = self.outc(y)
  160. # Stable head
  161. if not self.use_residual_head:
  162. out = torch.sigmoid(o) # bounded, non-saturating early
  163. else:
  164. #out = (x_mixed + self.res_scale * o).clamp(0, 1)
  165. out_pre = x_mixed + self.res_scale * o # residual head
  166. out = torch.sigmoid(self.out_gain * out_pre + self.out_bias) # <— no hard clamp
  167. return out

unet.py at commit 3e12bf2, under MIT · at the source

Overview

  1. Physics Unit, Faculty of Engineering and Natural Sciences, Tampere University,Tampere, 33720 Finland
  2. INRIA Rennes, Bretagne Atlantique Research Centre,Rennes, 35042 France
  3. Bio Unit, Faculty of Medicine and Health Technology, Tampere University,Tampere, 33520 Finland
  4. Signal Processing Research Centre, Tampere University,Tampere, 33720 Finland
  5. Department of Electrical Engineering, Photonic Integration Group, Eindhoven University of Technology,Eindhoven, 5600 MB The Netherlands
Journal: Light, science & applications, volume 15, issue 1, article 242
Dates: received 4 December 2025; accepted 28 April 2026; published online 19 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41377-026-02337-y · PMID 42156362 · PMCID PMC13187408 · OpenAlex W7161640643
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: histology / microscopy (modality)
Methods: Connectivity, Machine learning, fMRI & imaging
Keywords: Wide-field fluorescence microscopy, Metamaterials, Nanophotonics and plasmonics
Topic: Advanced Fluorescence Microscopy Techniques (Biophysics, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: Jane ja Aatos Erkon Säätiö (High-speed 3D Microscopy); Academy of Finland (project no. 336357, PROFI 6 - TAU Imaging Research Platform); H2020 Marie Skłodowska-Curie Actions (956770)
Citations: not cited yet (Europe PMC); 36 references in the paper

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

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 3e12bf2e7e1dba9d1b923adc5670084051cbec2f, 27 February 2026
Languages: Python (6)
Size: 28 files, 6 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (5 files), PyTorch Lightning (3 files), NumPy (2 files), Pillow (2 files), Matplotlib (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
8 files

Code availability

Training and inference code for the reconstruction network, together with pretrained model weights and example configuration files, are available on GitHub: https://github.com/humeyracaglayan/MANTIS. A black box version of the optical forward model, which maps ground-truth images to simulated sensor measurements, is also provided. The differentiable implementation of the optics forward model is available from the authors upon reasonable request, subject to intellectual property constraints.

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

Data availability

The MDCK fluorescence dataset acquired in this work has been deposited in Zenodo: https://zenodo.org/records/18609221. Third-party data from the Hyperspectral Image Dataset are publicly available as cited in the manuscript. Additional data supporting the findings of this study are available from the corresponding authors upon reasonable request.

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://doi.org/10.1038/s41377-026-02337-y

BibTeX

@article{atalayappak2026multispectral,
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/s41377-026-02337-y},
url = {https://doi.org/10.1038/s41377-026-02337-y},
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/05/19
VL - 15
IS - 1
SP - 242
SN - 2095-5545
PB - Nature Publishing Group
DO - 10.1038/s41377-026-02337-y
UR - https://doi.org/10.1038/s41377-026-02337-y
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41377-026-02337-y",
"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": "Light Sci Appl",
"volume": "15",
"issue": "1",
"page": "242",
"DOI": "10.1038/s41377-026-02337-y",
"PMID": "42156362",
"PMCID": "PMC13187408",
"ISSN": "2095-5545",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41377-026-02337-y",
"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 biotechnology
In 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 communications
In common: 4 references
[3] doi:10.1038/s41467-021-26443-0 [code]
Neural nano-optics for high-quality thin lens imaging.
Journal: Nature communications
In 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 methods
In 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: eLife
In 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: Neuroinformatics
In 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 reports
In 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 methods
In 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 aging
In 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.

Add the badge to the code's README

OSCR: the badge of this paper

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 -->
[![OSCR](https://openscicode.org/badge/doi/10.1038/s41377-026-02337-y.svg)](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:end
HTML
<!-- 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.