TL;DR
Analyzing atomic-scale images from electron microscopes usually ends in a frustrating loop of subjective manual tweaks whose underlying logic disappears the moment the scientist closes the file. This paper introduces PhyEvo-Mic-RSI, a framework that captures those fleeting human corrections alongside fundamental physics to autonomously write, test, and inherit better analysis code over time. Instead of relying on static scripts or black-box neural networks, it turns microscopy software into a self-evolving platform that steadily accumulates scientific intuition.
What Problem Does This Paper Address?
Peering into materials at the atomic scale using Transmission Electron Microscopy (TEM/STEM) lets us see point defects, crystal boundaries, and nanoparticles directly. Turning those grayscale pixels into hard physical numbers, however, is notoriously tricky. Image contrast can fluctuate wildly—or even invert—depending on sample thickness, orientation, and noise.
Right now, researchers lean on two imperfect crutches:
- Physics-based math (like Fourier transforms), which needs no training data, is highly interpretable, and assumes nice, repeating crystal lattices—meaning it breaks down right at messy, aperiodic defects where things get interesting.
- Deep learning, which handles complex textures well, but struggles because human annotations in microscopy are sparse; unlabelled defects accidentally get treated as "background," causing models to suppress real features and fail on new materials.
Consequently, scientists spend hours manually fixing outputs image by image, and all that tacit domain expertise evaporates once the task is done.
Methods
PhyEvo-Mic-RSI bridges physics, machine learning, and autonomous code generation through three decoupled layers: Analyse, Research, and Remember.
- Analyse (Routine Inference): Raw images run through both training-free physical operators (the "physical teacher") and a tiny, fast convolutional neural network (the "student," with ~119k parameters). An exclusion halo during training masks out conflicting background signals around sparse human-annotated defects so the student doesn't learn to ignore rare targets. Crucially, routine inference runs locally and deterministically—no LLM calls required—using observable image signals to route tasks to the right operators.
- Research (Self-Improvement): When the system struggles, an autonomous research agent diagnoses failure modes (like disagreements between physics and the student network) and proposes executable Python code updates to operators or routing rules. Every candidate program runs in a sandboxed environment and must pass strict admission gates under a fixed selection budget (e.g., selecting at most 10% of image pixels) alongside rotation/reflection consistency and regression checks.
- Remember (Versioned Inheritance): Admitted updates—comprising code ($B_t$), model weights ($W_t$), routing rules ($A_t$), and full experimental lineage ($E_t$)—become the active parent for future iterations. Even failed trials are logged so future diagnostics learn what not to do.
Datasets
Rather than pooling everything into one benchmark, the authors strictly separated data across distinct physical regimes:
- Expert Review Queue: 154 microscopy cases reviewed by two domain experts (152 geometry corrections across 100 point-defect cases, 51 interface cases, and 1 disordered region), including non-periodic SuperScan and $\text{MoWTe}_2$ point tasks.
- Atomic Point Defects: 107 unseen $\text{WSe}_2$ images with author-provided point references from the EMSeek dataset.
- Cross-Material Interfaces: 51 image planes across $\text{ZrO}_2$ (1 plane), Al orientation I (30 planes), and Al orientation II (20 planes).
- Nanoparticle Segmentation: 73 total micrographs across 27 published papers from the Electron Microscopy Particle Segmentation (EMPS) dataset, grouped strictly by source-paper DOI so no paper spans multiple splits.
Key Insights and Ideas
- Protecting sparse human wisdom: In 21 out of 154 reviewed cases, physics-based baselines predicted zero defects where human experts found real ones. Treating unlabelled pixels as "unknown" rather than negative—and placing an exclusion zone around human positives—let a tiny network outperform models over 60× its size.
- Evolving rules beats retraining weights: You don't need to constantly retrain deep networks to get big gains. Simply evolving executable post-processing and routing rules on top of frozen student predictions boosted point-defect detection by nearly 14 percentage points.
- Pixel accuracy can be a trap: When adapting the system to nanoparticles, optimizing for standard pixel overlap (IoU) actually worsened particle counting because expanding foreground masks merged touching particles together. Aligning the evaluation gate with physical reality—individual particle instances and seam boundaries—unlocked genuine scientific utility.
Key Results
Foundational capability gains showing human review, point F1 on WSe2 images, and progressive interface coverage across materials.
- Point-Defect Detection ($\text{WSe}_2$): Tested zero-shot on 107 unseen $\text{WSe}_2$ images, the compact student (<2% of baseline parameters) hit 64.31% Point F1, beating U-Net (27.46%) and EMSeek Ref-UNet (35.89%). Evolving adoption rules on 53 confirmation images pushed Point F1 to 78.71%.
- Interface Coverage: Under a strict 10% image-area budget, average coverage across $\text{ZrO}_2$, Al I, and Al II climbed from 5.13% (physics alone) to 67.95% (foundational hybrid checkpoint), and finally to 72.11% via autonomous multi-trajectory code evolution ($\text{ZrO}_2$ alone jumped from 76.49% to 88.07% without losing a single previously found positive pixel).
- Nanoparticle Separation: Switching from IoU-only to joint object-level selection on 25 confirmation images raised instance F1 from 25.13% (Otsu baseline) to 53.66%. On a dense nanocube test image (G14), a single qualitative expert hint prompted the agent to trace dark inter-particle seams, leaping from 33.33% to 87.80% instance F1.
Limitations and Future Work
Setting up the initial physical operators, crystal templates, and task-specific admission metrics still requires human domain expertise. Extending this to complex modalities—like 4D-STEM, in situ video, or multimodal spectroscopy—will require automating how physical operators and evaluation functions are extracted from scientific literature.
Looking ahead, because routine inference is tiny, fast, and deterministic while heavy code search happens asynchronously in the background, the active state could be wired directly into microscope hardware for real-time adaptive imaging—and shared across labs as auditable, versioned know-how without ever exposing proprietary raw images.
Summary updated