# Few-shot cross-episode adaptive memory for metal surface defect semantic segmentation

**Authors:** Jiyan Zhang, Hanze Ding, Ming Peng, Shuzhen Tu, Guiping Chen, Yanfang Liu

PMC · DOI: 10.1038/s41598-026-36445-x · 2026-01-18

## TL;DR

This paper introduces a new method for segmenting metal surface defects using few annotated samples, improving adaptability and segmentation accuracy across different training episodes.

## Contribution

The paper proposes EAMNet, a novel framework with adaptive memory and attention mechanisms for cross-episode few-shot semantic segmentation.

## Key findings

- EAMNet outperforms existing methods on the Surface Defect-4i and FSSD-12 datasets.
- The proposed modules (EAMU, CAM, GRMAP, and AD) enhance fine-grained segmentation and cross-episode adaptability.
- Attention distillation stabilizes the learning process and improves defect region cue processing.

## Abstract

Few-shot semantic segmentation has gained significant attention in metal surface defect detection due to its ability to segment unseen object classes with only a few annotated defect samples. Previous methods constrained to single-episode training suffer from limited adaptability in semantic description of defect regions and coarse segmentation granularity. In this paper, we propose an episode-adaptive memory network (EAMNet) that specifically addresses subtle variances between episodes during training. The episode adaptive memory unit (EAMU) leverages an adaptive factor to model semantic dependencies across different episodes. The context adaptation module (CAM) aggregates hierarchical features of support-query pairs for fine-grained segmentation. The proposed global response mask average pooling (GRMAP) introduces a global response normalization to obtain fine-grained cues directly from the support prototype. We also introduce an attention distillation (AD), which leverages fine-grained semantic attention correspondence to process defect region cues and stabilize the cross-episode adaptation in EAMU. Extensive experiments demonstrate that our approach establishes new state-of-the-art performance on both Surface Defect-\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$4^i$$\end{document} and FSSD-12 datasets.

## Full-text entities

- **Diseases:** metal (MESH:D013651)

## Figures

3 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12891459/full.md

---
Source: https://tomesphere.com/paper/PMC12891459