Theoretical model and simulation analysis
When the sensor cap is subjected to an axial force F, the deformation of the solid segment ΔLs is given by:
$$\Delta {L}_{s}=\frac{F\cdot {L}_{s}}{E\cdot {A}_{0}}$$
(1)
where E is the Young’s modulus of the 304 stainless-steel compliant element, Ls is the original length of the solid segment, and A0 is the cross-sectional area of the solid segment. The deformation of the flexible structure ΔLg is given by:
$$\Delta {L}_{g}=\frac{F\cdot {L}_{g}}{E\cdot {A}_{eff}}$$
(2)
where Lg is the original length of the flexible structure, and Aeff is the cross-sectional area of the flexible structure. The total deformation of the compliant element ΔLt is given by:
$$\Delta {L}_{t}=F\left(\frac{L-N\,{l}_{g}}{E{A}_{0}}+\frac{N{l}_{g}}{E{A}_{eff}}\right)$$
(3)
where lg is the length of the rectangular slot in the flexible structure, L is the suspended length of the optical fiber between two fixed points, and N is the number of rectangular slots arranged along the axial direction. Therefore, under an applied axial force, deformation of the compliant element produces relative displacement between the two fiber anchors, which is transferred to the suspended FBG sensing region as axial strain. The average strain sensed by the FBG εf is:
$${\varepsilon }_{f}=\frac{F}{EL}\left(\frac{L-N\,{l}_{g}}{{A}_{0}}+\frac{N{l}_{g}}{{A}_{eff}}\right)$$
(4)
In the tumor-palpation setting considered in this study, temperature variation is assumed negligible. Under this assumption, the central Bragg wavelength shift of the FBG (Δλ) under axial loading is
$$\frac{\Delta \uplambda }{\lambda }=(1-{\rho }_{e})\,{\varepsilon }_{f}$$
(5)
where λ is the Bragg wavelength of a grating, and ρe is the effective photoelastic coefficient of the FBG. The relationship between the wavelength shift induced by external force on the FBG and the strain (εf) can be expressed as:
$$\Delta \lambda =\lambda (1-{\rho }_{e})\,\frac{1}{EL}\left(\frac{L-N{l}_{g}}{{A}_{0}}+\frac{N{l}_{g}}{{A}_{eff}}\right)F$$
(6)
The Bragg wavelength shifts were acquired using an FBG interrogator with a nominal wavelength resolution of 1 pm. For each sensing channel i, the nominal interrogator-limited force resolution RF,i was estimated from the calibrated force-wavelength sensitivity Si as:
$${R}_{F,i}=\frac{\Delta {\lambda }_{{\rm{int}}}}{{S}_{i}},$$
(7)
where Δλint is the nominal wavelength resolution of the interrogator. This quantity represents a theoretical lower bound determined by the interrogator specification and does not account for baseline noise, thermal drift, mechanical hysteresis, or bonding-induced strain-transfer variations.
Finite element analysis (ANSYS) verified the static linearity of the single sensing unit. Under a 1 N axial load, the structure exhibited significant strain amplification at the fiber core (Fig. 2D). A parametric study from 0 to 1.5 N revealed a linear response with a sensitivity of 116.17 με/N (Fig. 2E), confirming the design’s feasibility for precise force measurement.
FBG-PatchFormer framework
This section presents FBG-PatchFormer, a patch-based time-series Transformer tailored to multi-channel FBG palpation signals for tumor depth estimation. Given a palpation record, the interrogator outputs a multi-sensor wavelength-shift sequence. We segment each record into overlapped windows and predict depth at the record level to suppress transient artifacts (e.g., initial contact and force stabilization). Let \({\bf{X}}\in {{\mathbb{R}}}^{T\times C}\) denote one windowed segment with length T and C = 7 channels, and let y ∈ {1, …, K} be the discrete depth label (including the “blank” class). For a record with windows \({\{{{\bf{X}}}_{m}\}}_{m = 1}^{M}\), FBG-PatchFormer produces window-level logits \({\{{{\bf{s}}}_{m}\}}_{m = 1}^{M}\) with \({{\bf{s}}}_{m}\in {{\mathbb{R}}}^{K}\), and aggregates them as
$$\bar{{\bf{s}}}=\frac{1}{M}\mathop{\sum }\limits_{m=1}^{M}{{\bf{s}}}_{m},\qquad \hat{y}=\arg {\mathop{\max }\limits_{k}}\,{\bar{s}}_{k}.$$
(8)
Architecturally, each window is tokenized into temporal patches, enhanced by multi-scale temporal convolution and gated fusion, and then processed by a Transformer encoder to capture global viscoelastic dynamics. An attention pooling module produces a compact window representation for classification, and Eq. (8) yields the final record-level decision.
To reduce the reliance on dense annotations, the encoder can be optionally pretrained on unlabeled windows via contrastive self-supervised learning (stage-I) and then finetuned on labeled windows for depth classification (stage-II). When stage-I is omitted, the same backbone is trained from scratch under the supervised objective. The overall two-stage learning pipeline and the shared encoder design are summarized in Fig. 10.
Fig. 10: Architecture of the FBG-PatchFormer framework.
The two-stage pipeline consists of contrastive self-supervised pretraining (stage-I) and supervised depth classification (stage-II) with a shared patch-based Transformer encoder.
FBG-PatchFormer backbone and depth prediction
We describe the backbone shared by both stage-I pretraining and stage-II depth estimation. The core design principle is to convert a long, multi-channel palpation window into a short sequence of patch tokens, so that local transients (indentation onset) and slow relaxation patterns can be modeled jointly with manageable computational cost. Given an input window \({\bf{X}}\in {{\mathbb{R}}}^{T\times C}\), we extract overlapped temporal patches from each channel using patch length P and step size S, resulting in
$$N=\left\lfloor \frac{T-P}{S}\right\rfloor +1,\qquad L=C\cdot N.$$
(9)
Each patch \({{\bf{p}}}_{c,n}\in {{\mathbb{R}}}^{P}\) is then mapped into a D-dimensional token and augmented by learnable sensor and temporal position embeddings:
$${{\bf{e}}}_{c,n}={{\bf{W}}}_{p}{{\bf{p}}}_{c,n}+{{\bf{b}}}_{p}+{{\bf{e}}}_{c}^{(s)}+{{\bf{e}}}_{n}^{(t)},$$
(10)
where \({{\bf{W}}}_{p}\in {{\mathbb{R}}}^{D\times P}\) is the patch projection. The sensor embedding \({{\bf{e}}}_{c}^{(s)}\) captures channel-specific response characteristics caused by the array geometry and fabrication tolerances, while the temporal embedding \({{\bf{e}}}_{n}^{(t)}\) preserves the within-window ordering of patches. For implementation, tokens are stacked into a matrix \({\bf{E}}\in {{\mathbb{R}}}^{L\times D}\), where L = C ⋅ N.
To enhance locality and improve sample efficiency under limited labels, we introduce a multi-scale temporal convolution module (MSTC) that processes the token stream with multiple receptive fields (e.g., different kernel sizes and/or dilations). The resulting branch features are fused by a gated fusion unit (GFU), which assigns data-dependent weights to balance short-term transients and longer-term relaxation cues. The fused tokens are then fed into a Transformer encoder to capture global temporal interactions across the entire palpation window:
$$\begin{array}{ll}{{\bf{F}}}^{(b)}\,=\,{{\rm{Conv}}}^{(b)}({\bf{E}}),\quad b=1,\ldots ,B,\\ {\boldsymbol{\gamma }}\quad\,=\,{\rm{softmax}}\,\left({{\bf{W}}}_{g}\,{\rm{Pool}}\,\left([{{\bf{F}}}^{(1)};\ldots ;{{\bf{F}}}^{(B)}]\right)\right),\\ \tilde{{\bf{E}}}\quad=\,\mathop{\sum }\limits_{b=1}^{B}{\gamma }_{b}\,{{\bf{F}}}^{(b)},\qquad {\bf{U}}={\rm{TransEnc}}(\tilde{{\bf{E}}}),\end{array}$$
(11)
where B denotes the number of MSTC branches, and \({\boldsymbol{\gamma }}\in {{\mathbb{R}}}^{B}\) is a branch-level gating vector with \(\mathop{\sum }\nolimits_{b = 1}^{B}{\gamma }_{b}=1\). The encoded token matrix U is then flattened into \({\{{{\bf{u}}}_{i}\}}_{i = 1}^{L}\) with L = C ⋅ N as defined in Eq. (9). Since informative depth cues are not uniformly distributed (e.g., the stabilized contact phase is usually more reliable than the onset), we adopt attention pooling to form a compact window representation:
$${\alpha }_{i}=\frac{\exp ({{\bf{w}}}_{a}^{\top }{{\bf{u}}}_{i})}{\mathop{\sum }\nolimits_{j = 1}^{L}\exp ({{\bf{w}}}_{a}^{\top }{{\bf{u}}}_{j})},\qquad {\bf{h}}=\mathop{\sum }\limits_{i=1}^{L}{\alpha }_{i}\,{{\bf{u}}}_{i},$$
(12)
where wa is a learnable pooling vector. Compared with mean pooling, Eq. (12) allows the model to down-weight noisy tokens caused by slight slippage or transient contact loss.
Given h, we compute window-level logits and class probabilities
$${\bf{s}}={{\bf{W}}}_{c}{\bf{h}}+{{\bf{b}}}_{c},\qquad \hat{{\bf{p}}}={\rm{softmax}}({\bf{s}}),$$
(13)
and optimize the class-weighted cross-entropy loss
$${{\mathcal{L}}}_{{\rm{sup}}}=-\mathop{\sum }\limits_{k=1}^{K}{w}_{k}\,{\bf{1}}[y=k]\log {\hat{p}}_{k},$$
(14)
where wk is inversely proportional to the class frequency in the training split and normalized across classes.
Contrastive self-supervised pretraining
The SSL strategy follows contrastive pretraining, where two stochastic augmented views are generated from the same unlabeled window X to form a positive pair, while other windows in the mini-batch provide negatives. The augmentations mimic practical palpation variations (sensor noise, mild force changes, transient occlusions, and intermittent channel dropouts). We pretrain with the InfoNCE objective and discard the projection head during finetuning.
Let fθ( ⋅ ) denote the Transformer encoder that maps an input window to a representation, and let gϕ( ⋅ ) be a small projection head used only in stage-I. Given two augmented views \({\tilde{{\bf{X}}}}^{(1)}\) and \({\tilde{{\bf{X}}}}^{(2)}\) from the same window, we compute \({{\bf{z}}}^{(1)}={\rm{norm}}({g}_{\phi }({f}_{\theta }({\tilde{{\bf{X}}}}^{(1)})))\) and \({{\bf{z}}}^{(2)}={\rm{norm}}({g}_{\phi }({f}_{\theta }({\tilde{{\bf{X}}}}^{(2)})))\), where norm( ⋅ ) denotes ℓ2 normalization. For a mini-batch of size Nb, the InfoNCE loss for view-(1) as anchor is
$${{\mathcal{L}}}_{{\rm{ssl}}}=-\frac{1}{{N}_{b}}\mathop{\sum }\limits_{i=1}^{{N}_{b}}\log \frac{\exp ({\rm{sim}}({{\bf{z}}}_{i}^{(1)},{{\bf{z}}}_{i}^{(2)})/\tau )}{\mathop{\sum }\nolimits_{j = 1}^{{N}_{b}}\exp ({\rm{sim}}({{\bf{z}}}_{i}^{(1)},{{\bf{z}}}_{j}^{(2)})/\tau )},$$
(15)
where \({\rm{sim}}(\cdot ,\cdot )\) is cosine similarity and τ is a temperature parameter. Specifically, we adopt a cross-view normalized temperature-scaled cross-entropy (NT-Xent) formulation, where negatives are sampled from the opposite view within the same mini-batch. The final SSL objective is symmetrized by averaging the two directional losses.
During contrastive pretraining (stage-I), the same encoder up to h is used to produce representations for the two augmented views, while the classifier in Eq. (13) is replaced by a lightweight projection head for optimizing (15). During supervised finetuning (stage-II), we attach the classifier head and optimize (14). Finally, for a palpation record, we apply the record-level aggregation in (8) to obtain a robust depth prediction.
Fabrication of soft tissue phantoms
To validate the depth estimation performance of the proposed sensor array, silicone-based tissue phantoms were fabricated to mimic the biomechanical properties of human soft tissue. The fabrication process is illustrated in Fig. 5A. A customized mold was treated with a release agent (Ease Release 200, Smooth-On Inc.) to ensure easy demolding and surface integrity of the cured phantom. Ecoflex 00-30 silicone (Smooth-On Inc.) was used as the matrix material. Part A and Part B solutions were mixed at a 1:1 ratio and processed in a planetary centrifugal mixer (FlackTek 1200-300, FlackTek Inc., Landrum, SC, USA) to ensure thorough blending. To eliminate trapped air bubbles that could introduce structural heterogeneity, the mixture was subjected to vacuum degassing in a vacuum drying chamber (DZF-6021, Yiheng, China). After curing at room temperature, the soft matrix was demolded, and inclusions were embedded at predefined depths. For the depth-estimation experiments, rectangular polylactic-acid (PLA) plates (25 × 25 × 2 mm) were embedded in an Ecoflex 00-30 silicone matrix at nominal depths of 2–10 mm; for the shape-estimation experiments, rigid inclusions derived from a nominal 20 mm-diameter circle and 2 mm thick were embedded at a depth of 2 mm.
Animal model, ethics, and in vivo procedure
Ethical approval
All procedures involving the live animal were performed in accordance with relevant institutional guidelines and regulations and were approved by the Institutional Animal Care and Use Committee of Shanghai Jiao Tong University (approval no. 202501590). The fiber Bragg grating (FBG) robotic-palpation measurement was performed as an ancillary procedure within the approved protocol of a joint large-animal study conducted together with an ultrasound research team, in accordance with the Guide for the Care and Use of Laboratory Animals (8th edition) and applicable Chinese regulations for the care and use of laboratory animals. Reporting follows the ARRIVE 2.0 guidelines.
Animal and husbandry
One ordinary-grade female Bama miniature pig (n = 1; the individual animal as the experimental unit), approximately one year old and weighing 30 kg, was used (Shanghai Jiagan Biotechnology Co., Ltd; production licence SCXK (Hu) 2025-0007). A veterinarian performed a preoperative health examination and confirmed qualified quarantine status and fitness for anaesthesia and surgery. The animal was acclimatised for 7 days and group-housed under standard husbandry conditions (controlled temperature, humidity, and light/dark cycle; standard feed; environmental enrichment; daily welfare observation). Food was withheld for 24 h before anaesthesia while water remained available ad libitum, and blood glucose was monitored intraoperatively. Because the experiment was terminal, no recovery or postoperative housing period was involved.
Study design, randomisation, and blinding
The in vivo experiment was a single-animal, single-session, non-survival exploratory feasibility study. The liver region containing the artificial inclusion was compared with adjacent non-implanted liver tissue within the same animal, so no separate control animal was used, in accordance with the reduction principle of the 3Rs. Randomisation was not applicable (one animal, one condition), and no formal power analysis was performed because the objective was a qualitative demonstration. Blinding was not possible because the surgical team and robot operator needed to know the inclusion location. No animals or data were excluded. The prespecified outcome was qualitative localisation of the implanted hard inclusion from the spatial force-distribution map; no inferential statistical analysis was performed (n = 1).
Anaesthesia, analgesia, and monitoring
After the preoperative fast, the pig was sedated with xylazine hydrochloride (0.2 g/2 mL; 0.04 mL/kg, intramuscular (IM)) and anaesthesia was induced with Zoletil 50 (250 mg/5 mL; 0.04 mL/kg, IM). A veterinarian confirmed loss of consciousness and an adequate anaesthetic depth before any incision. The animal was positioned supine, endotracheally intubated, and mechanically ventilated, and anaesthesia was maintained with 1.5–1.8% isoflurane by inhalation. Multimodal analgesia comprised Antongding injection (0.1 mL/kg, IM) and meloxicam (0.2–0.4 mg/kg, IM). Heart rate, electrocardiography, peripheral oxygen saturation, invasive arterial blood pressure, respiratory rate, and body temperature were continuously monitored, and ophthalmic ointment was applied to protect the corneas. The animal remained anaesthetised and unconscious throughout the laparotomy, liver manipulation, inclusion implantation, and FBG robotic palpation, and was not allowed to regain consciousness. The anaesthetic and analgesic agents are summarised in Table 8.
Table 8 Anaesthetic and analgesic agents used in the in vivo experiment
Surgical procedure and robotic palpation
A laparotomy was performed with the animal supine to expose the hepatic lobes. One cylindrical polylactic-acid (PLA) inclusion (\(\varnothing\)20 mm × 1 mm) was implanted into the liver parenchyma at a nominal depth of 3 mm, defined as the distance from the liver capsule to the upper surface of the inclusion. The seven-channel FBG tactile sensor array, mounted on the robotic manipulator, followed a teleoperated raster trajectory over the implanted region at a constant lateral speed of 0.1 mm/s without closed-loop force or indentation-depth control; because the liver surface was curved, deformable, and affected by physiological motion, the operator maintained gentle probe–tissue contact to avoid excessive compression or loss of contact.
Euthanasia
At the end of the joint non-survival session, while the animal remained deeply anaesthetised and was confirmed unconscious by the attending veterinarian, euthanasia was performed by intravenous administration of an overdose of potassium chloride. Death was confirmed by the veterinarian from the permanent cessation of cardiac and respiratory activity.

