Back to work

Research engineering · Computer vision

Dislocation Extraction Pipeline

From hand-picked frames to automated measurement across entire electron microscopy films.

of line fragmentation removed
75%of line fragmentation removed
median per image on one CPU core
0.59 smedian per image on one CPU core
dislocations extracted
17,144dislocations extracted

The problem

Materials scientists study dislocations, the line defects of a crystal, in electron microscopy films of aluminium under strain. Measuring their density and curvature was done by hand on a few chosen frames, while each film holds thousands. The lines cover about 3% of the pixels, two thirds of the corpus had no annotation, and the usual segmentation score rewarded masks that looked right but broke lines apart.

What I built

  1. 1

    Built a human-in-the-loop annotation tool (FastAPI and React) with magnetic live-wire tracing, then grew the dataset from 318 to 890 image-mask pairs under a single line-width convention.

  2. 2

    Replaced pixel overlap with topological metrics, each checked on hand-built failure cases, and hardened the training protocol to cut run-to-run dispersion 20 to 40 times.

  3. 3

    Ran a controlled benchmark of 4 segmentation architectures with architecture as the only variable; MA-Net won on every metric.

  4. 4

    Wrote a CPU-only instance separation library (Hungarian matching, integer programming, smoothing splines) with 387 tests and 94% line coverage.

  5. 5

    Packaged the full chain as a desktop application with SHA-256 manifests, provenance-carrying exports and 130 automated tests.

Outcome

  • A simple connected-component filter removed 75% of line fragmentation, a larger gain than the whole architecture search.

  • 17,144 dislocations extracted over the corpus at 0.59 s median per image, turning a manual task into a repeatable measurement of density and curvature.

  • Caught two silent defects that had invalidated a full training period, including a library argument ignored without error that injected 15 times too much noise.

Have a similar problem?

Tell me about it. I reply within 48 hours with a first read of the problem and an honest opinion on fit.

Book a call