Deep learning-enabled versatile shape perception for soft robots via single-ended multimode fiber.
The 4 matches
- [1] § MATERIALS AND METHODS › Continuous super-resolution regression strategy ↔ 2-1-code.zip/model.py, lines 57–163 · score 0.77 · skip connections, ReLU, block, linear, channel, adaptively
- [2] § RESULTS › Continuous super-resolution tracking via geometric priors ↔ 2-2-code.zip/class_unet_fan_nosplit.py, lines 609–664 · score 0.67 · interval hit rate, adjacent anchors, unseen intervals, predicted angle
- [3] § MATERIALS AND METHODS › Discrete state confirmation ↔ 2-1-code.zip/model.py, lines 57–163 · score 0.62 · MaxPool2d, Conv2d, connected, blocks, activation, classifier
- [4] § MATERIALS AND METHODS › Discrete state confirmation ↔ 1-1-code.zip/code/class180.py, lines 88–127 · score 0.58 · MaxPool2d, Conv2d, Dropout, Tanh
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 · 163 lines · 6.4 KB · CC-BY-4.0 · 2 matches
- # # model.py
- import torch
- import torch.nn as nn
- import torch.nn.functional as F
- from typing import Optional
- # 定义通道注意力模块
- class ChannelAttentionModule(nn.Module):
- def __init__(self, channel: int, ratio: int = 16):
- super(ChannelAttentionModule, self).__init__()
- self.avg_pool = nn.AdaptiveAvgPool2d(1)
- self.max_pool = nn.AdaptiveMaxPool2d(1)
- # Shared 1×1 MLP implemented as Conv2d for efficiency (same weights for avg/max branches)
- self.shared_mlp = nn.Sequential(
- nn.Conv2d(channel, channel // ratio, kernel_size=1, bias=False),
- nn.ReLU(inplace=True),
- nn.Conv2d(channel // ratio, channel, kernel_size=1, bias=False)
- )
- self.sigmoid = nn.Sigmoid()
- def forward(self, x: torch.Tensor) -> torch.Tensor: # (B,C,H,W)
- avg_out = self.shared_mlp(self.avg_pool(x))
- max_out = self.shared_mlp(self.max_pool(x))
- return self.sigmoid(avg_out + max_out)
- # 定义空间注意力模块
- class SpatialAttentionModule(nn.Module):
- def __init__(self, kernel_size=7):
- super(SpatialAttentionModule, self).__init__()
- self.conv = nn.Conv2d(2, 1, kernel_size=kernel_size, padding=kernel_size//2)
- def forward(self, x):
- avg_out = torch.mean(x, dim=1, keepdim=True)
- max_out, _ = torch.max(x, dim=1, keepdim=True)
- x = torch.cat([avg_out, max_out], dim=1)
- x = self.conv(x)
- return torch.sigmoid(x)
- # 定义CBAM模块
- class CBAM(nn.Module):
- def __init__(self, channels, reduction=16, kernel_size=7):
- super(CBAM, self).__init__()
- self.channel_attention = ChannelAttentionModule(channels, reduction)
- self.spatial_attention = SpatialAttentionModule(kernel_size)
- def forward(self, x):
- x = x * self.channel_attention(x)
- x = x * self.spatial_attention(x)
- return x
- class UNet(nn.Module):
- def __init__(self, input_channels: int = 1, output_channels: int = 1, init_features: int = 64, num_classes: Optional[int] = None):
- super(UNet, self).__init__()
- features = init_features
- self.num_classes = num_classes
- # ---------------- Encoder ----------------
- self.encoder1 = self._block(input_channels, features)
- self.pool1 = nn.MaxPool2d(kernel_size=2, stride=2)
- self.encoder2 = self._block(features, features * 2)
- self.pool2 = nn.MaxPool2d(kernel_size=2, stride=2)
- self.encoder3 = self._block(features * 2, features * 4)
- self.pool3 = nn.MaxPool2d(kernel_size=2, stride=2)
- self.encoder4 = self._block(features * 4, features * 8)
- self.pool4 = nn.MaxPool2d(kernel_size=2, stride=2)
- # ---------------- Bottleneck ----------------
- self.bottleneck = self._block(features * 8, features * 16)
- # ---------------- Decoder ----------------
- self.upconv4 = nn.ConvTranspose2d(features * 16, features * 8, kernel_size=2, stride=2)
- self.decoder4 = self._block(features * 16, features * 8)
- self.upconv3 = nn.ConvTranspose2d(features * 8, features * 4, kernel_size=2, stride=2)
- self.decoder3 = self._block(features * 8, features * 4)
- self.upconv2 = nn.ConvTranspose2d(features * 4, features * 2, kernel_size=2, stride=2)
- self.decoder2 = self._block(features * 4, features * 2)
- self.upconv1 = nn.ConvTranspose2d(features * 2, features, kernel_size=2, stride=2)
- self.decoder1 = self._block(features * 2, features)
- # ---------------- Output ----------------
- self.conv_final = nn.Conv2d(features, output_channels, kernel_size=1)
- self.activation = nn.Sigmoid()
- # ---------------- CBAM Attention ----------------
- self.cbam1 = CBAM(features)
- self.cbam2 = CBAM(features * 2)
- self.cbam3 = CBAM(features * 4)
- self.cbam4 = CBAM(features * 8)
- # ----------- 分类头(阶段1用) -----------
- if num_classes is not None:
- self.gap = nn.AdaptiveAvgPool2d(1)
- self.flatten = nn.Flatten()
- self.classifier = nn.Linear(features * 16, num_classes)
- def _block(self, in_channels, out_channels):
- return nn.Sequential(
- nn.Conv2d(in_channels, out_channels, kernel_size=3, padding=1),
- nn.BatchNorm2d(out_channels),
- nn.ReLU(inplace=True),
- nn.Conv2d(out_channels, out_channels, kernel_size=3, padding=1),
- nn.BatchNorm2d(out_channels),
- nn.ReLU(inplace=True)
- )
- def _encode(self, x: torch.Tensor) -> torch.Tensor:
- enc1 = self.encoder1(x)
- enc1 = self.cbam1(enc1) + enc1
- enc2 = self.encoder2(self.pool1(enc1))
- enc2 = self.cbam2(enc2) + enc2
- enc3 = self.encoder3(self.pool2(enc2))
- enc3 = self.cbam3(enc3) + enc3
- enc4 = self.encoder4(self.pool3(enc3))
- enc4 = self.cbam4(enc4) + enc4
- bottleneck = self.bottleneck(self.pool4(enc4))
- return bottleneck
- def forward_classify(self, x: torch.Tensor) -> torch.Tensor:
- feats = self._encode(x)
- pooled = self.gap(feats)
- flat = self.flatten(pooled)
- logits = self.classifier(flat)
- return logits
- def forward(self, x: torch.Tensor) -> torch.Tensor:
- # -------- 编码器 --------
- bottleneck = self._encode(x)
- # -------- 解码器 --------
- # 需要重新获取enc1-enc4用于skip connection
- enc1 = self.encoder1(x)
- enc1 = self.cbam1(enc1) + enc1
- enc2 = self.encoder2(self.pool1(enc1))
- enc2 = self.cbam2(enc2) + enc2
- enc3 = self.encoder3(self.pool2(enc2))
- enc3 = self.cbam3(enc3) + enc3
- enc4 = self.encoder4(self.pool3(enc3))
- enc4 = self.cbam4(enc4) + enc4
- dec4 = self.upconv4(bottleneck)
- dec4 = torch.cat((dec4, enc4), dim=1)
- dec4 = self.decoder4(dec4)
- dec3 = self.upconv3(dec4)
- dec3 = torch.cat((dec3, enc3), dim=1)
- dec3 = self.decoder3(dec3)
- dec2 = self.upconv2(dec3)
- dec2 = torch.cat((dec2, enc2), dim=1)
- dec2 = self.decoder2(dec2)
- dec1 = self.upconv1(dec2)
- dec1 = torch.cat((dec1, enc1), dim=1)
- dec1 = self.decoder1(dec1)
- out = self.conv_final(dec1)
- return self.activation(out)
model.py, under CC-BY-4.0 · at the source
Overview
- Department of Precision Instrument, Tsinghua University, Beijing 100084, China
- State Key Laboratory of Precision Space-time Information Sensing Technology, Beijing 100084, China
- Weixian College, Tsinghua University, Beijing 100084, China
- West China Biomedical Big Data Center, West China Hospital, Sichuan University, Chengdu 610041, China
Abstract
The evolution of soft robots into embodied intelligent systems relies fundamentally on precise proprioception. However, a universal solution for capturing continuous deformations during diverse interactions, particularly in spatially confined interventional scenarios, remains lacking. Here, we introduce a deep learning–enabled versatile shape perception method based on a single-ended multimode fiber (MMF). By leveraging the intrinsic integration advantages of optics, our minimalist reflective architecture physically eliminates the dependence on complex demodulation units and distal devices. Furthermore, treating chaotic optical speckle fields as data streams encoding high-dimensional shape information, reconfigurable neural decoders resolve a single physical channel into versatile perception modes tailored to heterogeneous tasks: discrete state confirmation on soft grippers (>99% accuracy), continuous shape tracking on bionic dexterous hands (~5-fold spatial resolution enhancement), and intuitive 3D morphological reconstruction of soft surgical robots (IoU>0.93). Overall, our work establishes a versatile framework for breaking hardware adaptability limits via computation, laying a solid foundation for closed-loop control in digital twins of soft robots.
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 4 matches between paragraphs and lines of code.
Zenodo 19601658
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
28 files
- 1-1-code.zip/
code/ , Python, 336 lines, 1 matchclass180.py - 1-2-code.zip/
WEEL_DAQ.py , Python, 122 lines - 1-2-code.zip/
common.py , Python, 69 lines - 1-2-code.zip/
data_prepare.py , Python, 215 lines - 1-2-code.zip/
test_all.py , Python, 563 lines - 1-2-code.zip/
train.py , Python, 181 lines - 2-1-code.zip/
__init__.py , Python, 1 line - 2-1-code.zip/
class_unet_fan_nosplit.p , Python, 796 linesy - 2-1-code.zip/
decode_fan.py , Python, 227 lines - 2-1-code.zip/
fan_label_utils.py , Python, 318 lines - 2-1-code.zip/
fan_loss_utils.py , Python, 151 lines - 2-1-code.zip/
generate_fan_label_overl , Python, 211 linesay.py - 2-1-code.zip/
model.py , Python, 163 lines, 2 matches - 2-1-code.zip/
test_angle_system.py , Python, 108 lines - 2-1-code.zip/
test_classification_inte , Python, 132 linesgration.py - 2-1-code.zip/
viz_utils.py , Python, 1,065 lines - 2-2-code.zip/
__init__.py , Python, 1 line - 2-2-code.zip/
class_unet_fan_nosplit.p , Python, 1,714 lines, 1 matchy - 2-2-code.zip/
decode_fan.py , Python, 227 lines - 2-2-code.zip/
fan_label_utils.py , Python, 318 lines - 2-2-code.zip/
fan_loss_utils.py , Python, 151 lines - 2-2-code.zip/
plot_error_curves.py , Python, 272 lines - 2-2-code.zip/
visualize_class_masks.py , Python, 285 lines - 2-2-code.zip/
viz_utils.py , Python, 1,033 lines - 3-code2.zip/
1_extract_2d_skeletons_s , Python, 283 linesparse.py - 3-code2.zip/
2_reconstruct_3d_curve.p , Python, 307 linesy - 3-code2.zip/
3_visualization.py , Python, 203 lines - readme.txt, Text, 53 lines
The paper's code and data availability statement is in the Data section.
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;
- 27 scripts, each with its path and the digest of its content;
- 4 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
No dataset and no data link were found in the paper.
Data, code, and materials availability
All data and code needed to evaluate and reproduce the results in the paper are present in the paper and/
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, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 14 authors, 2 funders, 33 references.
Cite
This paper
He, Z., Wang, L., Geng, H., Lu, Z., He, T., Zhong, H., Zhang, H., Zhu, R., Zhao, Q., Meng, Y., Li, D., Yan, P., Liu, Q., & Xiao, Q. (2026). Deep learning-enabled versatile shape perception for soft robots via single-ended multimode fiber. Science advances, 12(24), eaef6263. https://
BibTeX
@article{he2026deep,
author = {He, Zhaofan and Wang, Lele and Geng, Haidi and Lu, Zhengyang and He, Tiantian and Zhong, Hongkun and Zhang, Hailong and Zhu, Runfeng and Zhao, Qingxiang and Meng, Yuan and Li, Dan and Yan, Ping and Liu, Qiang and Xiao, Qirong},
title = {{Deep learning-enabled versatile shape perception for soft robots via single-ended multimode fiber}},
journal = {Science advances},
year = {2026},
month = jun,
volume = {12},
number = {24},
pages = {eaef6263},
publisher = {American Association for the Advancement of Science},
issn = {2375-2548},
doi = {10.1126/
url = {https://
pmid = {42284416},
pmcid = {PMC13262633}
}
RIS
TY - JOUR
AU - He, Zhaofan
AU - Wang, Lele
AU - Geng, Haidi
AU - Lu, Zhengyang
AU - He, Tiantian
AU - Zhong, Hongkun
AU - Zhang, Hailong
AU - Zhu, Runfeng
AU - Zhao, Qingxiang
AU - Meng, Yuan
AU - Li, Dan
AU - Yan, Ping
AU - Liu, Qiang
AU - Xiao, Qirong
TI - Deep learning-enabled versatile shape perception for soft robots via single-ended multimode fiber
T2 - Science advances
J2 - Sci Adv
PY - 2026
DA - 2026/
VL - 12
IS - 24
SP - eaef6263
SN - 2375-2548
PB - American Association for the Advancement of Science
DO - 10.1126/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1126/
"type": "article-journal",
"title": "Deep learning-enabled versatile shape perception for soft robots via single-ended multimode fiber",
"container-title": "Science advances",
"author": [
{
"family": "He",
"given": "Zhaofan"
},
{
"family": "Wang",
"given": "Lele"
},
{
"family": "Geng",
"given": "Haidi"
},
{
"family": "Lu",
"given": "Zhengyang"
},
{
"family": "He",
"given": "Tiantian"
},
{
"family": "Zhong",
"given": "Hongkun"
},
{
"family": "Zhang",
"given": "Hailong"
},
{
"family": "Zhu",
"given": "Runfeng"
},
{
"family": "Zhao",
"given": "Qingxiang"
},
{
"family": "Meng",
"given": "Yuan"
},
{
"family": "Li",
"given": "Dan"
},
{
"family": "Yan",
"given": "Ping"
},
{
"family": "Liu",
"given": "Qiang"
},
{
"family": "Xiao",
"given": "Qirong"
}
],
"container-title-short":
"volume": "12",
"issue": "24",
"page": "eaef6263",
"DOI": "10.1126/
"PMID": "42284416",
"PMCID": "PMC13262633",
"ISSN": "2375-2548",
"publisher": "American Association for the Advancement of Science",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
12
]
]
}
}
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.1038/s41467-026-74358-5 [code]
- Brain-inspired spatial intelligence for embodied agents.Journal: Nature communicationsIn common: NetworkX, OpenCV, Pillow, 7 other tools, cognitive, 1 reference
- [2] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: NetworkX, OpenCV, scikit-image, 8 other tools
- [3] doi:10.1371/journal.pcbi.1014571 [code]
- SynAPSeg: A novel dataset and image analysis framework for deep learning-based synapse detection and quantification.Journal: PLoS computational biologyIn common: NetworkX, OpenCV, scikit-image, 8 other tools
- [4] doi:10.1016/j.isci.2026.116825 [code]
- Social hierarchy shapes behavioral and transcriptional responses to chronic stress and ketamine in male mice.Journal: iScienceIn common: NetworkX, OpenCV, scikit-image, 8 other tools
- [5] doi:10.1016/j.isci.2026.116206 [code]
- Gut distension evokes rapid neural dynamics in vagal and hindbrain populations of larval zebrafish.Journal: iScienceIn common: NetworkX, OpenCV, scikit-image, 8 other tools
- [6] doi:10.1038/s41593-026-02232-0 [code]
- Entorhinal cortex represents task-relevant remote locations independently of CA1.Journal: Nature neuroscienceIn common: NetworkX, OpenCV, scikit-image, 8 other tools
- [7] doi:10.1038/s41598-026-43529-1 [code]
- A spiking neural network inspired by neuroscience and psychology for Western mode- and key-conditioned music learning and composition.Journal: Scientific reportsIn common: NetworkX, OpenCV, Pillow, 7 other tools, cognitive
- [8] doi:10.1126/sciadv.aed3650 [code]
- Truthful visualizations for mass spectrometry imaging enable high-spatial-resolution interactive &
lt;i& gt;m/ z& lt;/ i& gt; mapping and exploration. Journal: Science advancesIn common: NetworkX, OpenCV, scikit-image, 7 other tools - [9] doi:10.7554/elife.110074 [code]
- Disentangling cephalopod chromatophores motor units with computer vision.Journal: eLifeIn common: NetworkX, OpenCV, scikit-image, 7 other tools
- [10] doi:10.1038/s41598-026-57519-w [code]
- Automated segmentation of neurons and spinal cord structures in immunofluorescence images using SpineDL.Journal: Scientific reportsIn common: NetworkX, OpenCV, scikit-image, 7 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, 27 scripts, and 4 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:901d82012c3aa061…
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
[.
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.
