UNet++ for skyrmion detection in MOKE microscopy
Semantic segmentation of magnetic skyrmions in magneto-optical Kerr effect (MOKE) microscopy frames into three classes: skyrmion, defect, background (in that order). It is used to detect and track skyrmions in videos of an H-shaped skyrmion-flow logic device (cf. Zhang et al., PNAS 2025).
- Architecture: UNet++ (nested U-Net), base width 32, 9.2 M parameters, single grayscale frame input.
- Training data: Zenodo 7636110 (MOKE skyrmion detection dataset, 2001/200/200 train/val/test 512×512 images), with strong GPU augmentation (flips/rotations, affine, blur, contrast and gamma changes, noise, contrast inversion p = 0.5), 60 epochs.
- Test split: pixel IoU skyrmion 0.856, defect 0.599, background 0.983, mIoU 0.813 (published 2023 Keras model: 0.728).
- Input: grayscale frame scaled as
pixel / 256, skyrmions dark. Any frame size (tiled in 672×512 windows).
Usage
pip install "git+https://github.com/jedcheng/skyrmion-unet#subdirectory=skyunet"
from skyunet import load_pretrained
unet = load_pretrained("jed351/skyrmion-unetpp-moke")
probs = unet(frame / 256, proba=True) # [H, W, 3]: p(skyrmion), p(defect), p(background)
Files: config.json (architecture + constructor arguments) and model.safetensors (weights).
Code, training script and the tracking notebook: https://github.com/jedcheng/skyrmion-unet.