CritterSEM: A browser-based virtual scanning electron microscope for people and AI agents
CritterLabs
Project page · 2026
Abstract
CritterSEM is a scanning electron microscope simulator that runs in a browser tab. Its specimens are procedural: for every pixel a ray is traced into a signed-distance model of the specimen on the GPU, and a scan pass adds what an operator has to work against: defocus, astigmatism, probe size, column misalignment, shot noise from beam current and dwell time, detector gain and offset, and optional vibration. There are three detectors (SE, InLens, BSE) and 28 specimens on one holder, and the instrument takes real time: the stage moves at a finite speed, the auto routines run for one to six seconds, and the beam reaches the specimen only with vacuum, high voltage and an open valve. In challenge mode, 15 written tasks at three levels are judged by rules about what a photo shows and by an image-quality score against the photo the best settings would give. The same tasks, clock and judge are open to an AI agent, which drives the microscope in a person's browser through an HTTP interface. All images and read-outs are simulated, and this page reports no comparison with measurements from a real instrument.
Introduction
A good micrograph from a scanning electron microscope depends on several coupled controls: accelerating voltage, spot size, aperture, working distance and focus, the stigmators, brightness and contrast, scan speed and averaging, and the choice of detector. They trade against each other: a slower scan is cleaner but takes longer, and a smaller aperture gives more depth of field but less beam current.
CritterSEM is an instrument for practising that. It runs in a browser tab and needs no installation. A session starts the way one starts at a real instrument: untuned. The specimen is out of focus, brightness and contrast are wrong, there is astigmatism, and in free operation the column is not aligned either. The operator has to set the instrument up before the picture is any good.
The same instrument can be driven by an AI agent through an HTTP interface while a person watches. This makes CritterSEM a place to compare how people and agents handle a real-time instrument that keeps part of its state hidden. Section 2 describes the instrument, Section 3 its specimens, Section 4 how it imitates the imperfections of a real one, Section 5 the challenge tasks and their scoring, and Section 6 operation by an agent. Sections 7 and 8 give the intended uses and the limits.
The instrument
Image formation
A frame is made in three passes (Figure 2). The truth pass traces one ray per pixel into a procedural specimen, a signed-distance field, and writes the ideal secondary-electron (SE), in-lens and backscattered-electron (BSE) signals together with the height of the surface. It runs again only when the view changes (stage, magnification, voltage, tilt), and at half resolution while the view is moving. The scan pass then advances the raster by as many lines as fit in the elapsed time and computes only those lines. The display pass shows the result.
- Truth passOne ray per pixel into a signed-distance specimen on the GPU. Writes the ideal SE, InLens and BSE signals and the surface height. Redone only when the view changes: stage, magnification, voltage, tilt.
- Scan passOnly the lines scanned in the elapsed time. Blur from defocus, astigmatism and probe size; image shift from misalignment; displacement from vibration; shot noise from beam current times dwell time; detector gain and offset.
- DisplayThe picture on the screen. A photo adds the data bar: HV, WD, magnification, detector, field width and scale bar.
The physics is in closed form; electron trajectories are not simulated one by one. The code uses the Kanaya–Okayama range, a backscatter coefficient that depends on atomic number and on the tilt of the surface, the universal secondary-yield curve, and a probe diameter that adds the source image, diffraction, spherical and chromatic aberration in quadrature, for a Schottky field-emission column. A material's secondaries are split into those made by the primary beam (SE1) and those made by the backscattered electrons (SE2); for the latter, the interaction volume is probed in the specimen's own geometry to see how much of it is open to vacuum.
The three detectors weigh these signals differently (Figure 3). SE is modelled on an Everhart–Thornley detector: it collects the secondaries made by the primary beam and by backscattered electrons, and a small share of the backscattered electrons themselves, and faces turned toward the detector look brighter. InLens takes secondaries from near the axis and few of those made on the pole piece and chamber walls, which gives fine surface detail. BSE is an annular detector on the axis: its signal grows with atomic number, and steep faces send their electrons past it.


Two optional hooks extend the signal model for specimens that need them. One describes a thin layer over another material, such as graphene on oxide or the silica shell of a core-shell particle: how much of the material beneath shows through the layer depends on its thickness and on the voltage. The other describes channelling contrast, where the backscatter yield of a grain depends on the beam's direction in the crystal, so that a grain can change brightness with a degree or two of tilt.
Controls
The control deck under the image is drawn as a hardware knob box (Figure 1), and the keyboard is laid out like one. The console comes in English and Chinese. The accelerating voltage runs from 0.5 to 30 kV and the spot size from 1 to 7, each step up giving four times the probe current. The aperture is 20, 30, 50 or 100 µm, the focus (working distance) 0.3 to 45 mm, and the magnification 30 to 1,000,000 times. Two stigmators reach ±100 µm each. Nine scan-speed presets set the dwell time per pixel from 0.05 to 30 µs; line and frame averaging go from 1 to 16; and a small scan window, which refreshes far faster than the whole frame, is used for focusing.
The stage moves in x and y over the 12.7 mm stub (±6.35 mm), in z, in tilt from 0 to 70° and in rotation; the scan can be rotated separately. The column has to be aligned as well: the aperture and the centres of the two stigmators are set with knobs, and an alignment wobbler swings the objective lens or a stigmator so that the operator can see when the beam passes through its centre. Brightness and contrast set the detector's offset and gain.
Specimens
The microscope holds 28 specimens, each on its own pin stub in a numbered slot of one round holder: a square of 4 × 4 slots, 15 mm apart, in the middle and a ring of 12 more, 40 mm from the middle. Going to another slot is a stage move like any other. Every specimen is a program, not an image: a signed-distance description of its shape, its materials (atomic number, density, secondary yield) and lattices of random cells. The picture is computed anew for any position, magnification, tilt and voltage.
They include reference standards (tin balls on carbon for practising focus and stigmation, gold on carbon as a resolution standard, a lithography test chip with numbered fields and a Siemens star); powders and growths (pollen, diatoms, polydopamine spheres, LNMO cathode particles, graphite, nanorods and nanosheets on nickel foam, carbon nanotubes); polished sections (cemented carbide, solder joints, ceramic capacitors, a battery electrode); fracture surfaces (an aluminium fatigue fracture, cryo-fractured epoxy); and thin or layered specimens (graphene on oxide, a multilayer coating, silicon nanowires, core-shell particles, electropolished copper). Some were modelled on kinds of material seen in real micrographs: the kind is kept, not the photographed field of view.






A specimen does not fill its stub. A powder lies in one irregular patch with bare substrate around it, and where the patch lies is drawn anew with every load and is not given away by the stage read-out. Depending on the mode and the level, a session starts on the powder, at its edge, at the middle of the stub with the powder out of sight, or anywhere away from it, and the operator looks for it at low magnification. A used gold standard carries rectangles of carbon contamination where earlier frames were scanned at high magnification; they are dark in SE, darker in InLens and almost invisible in BSE.
A specimen guide, open to approved users, says what each specimen is and what people photograph it for. It lists 97 photo goals in all, 22 for beginners, 38 advanced and 37 expert, each with the requirements a photo has to meet and an example picture rendered by the simulator (Figure 4).
Imitating a real instrument
A simulator that shows the answer teaches little. CritterSEM therefore imitates what makes a real instrument hard to use, and keeps hidden what an instrument does not show.
- An untuned start. Every specimen loads at 50x, out of focus (its height is off by up to a millimetre, so the focus cannot be read off the stage position), with brightness and contrast wrong and 25 to 60 µm of astigmatism, which shows from a few thousand times up. In a challenge the level sets how far off the start is.
- A misaligned column. In free operation an off-centre aperture makes the image move sideways as the focus changes, and a beam that misses the centre of a stigmator makes it move as that stigmator is turned. The operator uses the wobbler to see this and the alignment knobs to correct it; the written challenge tasks start with the column aligned.
- Hidden state. The defocus, the astigmatism and the misalignment are not shown. They have to be inferred from the picture, by a person or by an agent.
- Everything takes time. A scan lasts as long as its pixel count, dwell time and averaging demand. The stage accelerates at 150 mm/s² and cruises at 20 mm/s, so a nudge takes a fraction of a second and a change between slots up to about five; z, tilt and rotation move at 1 mm/s, 5°/s and 15°/s. The auto routines run for 1 s (brightness and contrast), 2 s (focus), 3 s (stigmator) and 6 s (alignment). Venting the chamber takes 20 s and pumping it down 90 s; the high voltage ramps up in 3 s plus 0.2 s per kV, and the column valve opens in 1.5 s. The beam reaches the specimen only with vacuum, high voltage and an open valve.
- Auto routines with limits. Auto focus and auto stigmator judge only what is in the small window, which the operator places. They leave a fraction of a pixel of blur at the present magnification, which shows again after zooming in. They do not fail, whatever the view.
- Vibration. The floor, the pumps and the mains field can each move the beam over the specimen by a nanometre or two; from about 50,000x this shows as torn lines in a slow scan, waves in a fast one and a slight blur when frames are averaged. In free operation it is off until switched on; it is off in beginner tasks and on in advanced (100 %) and expert tasks (160 %).
- A chamber with a pole piece. The holder tilts with the stage. A stage move that would bring any part of it within 0.25 mm of the pole piece is refused, so how far the stage can tilt depends on the slot and on z.
Challenge tasks and scoring
In challenge mode the person chooses who operates (a person or an AI agent), a level, a specimen and which of the four auto functions the run allows. Written tasks exist for 15 specimens: 4 for beginners, 5 advanced and 6 expert (Table 1). A task gives its goal in words, the number of photos to take (1 to 3) and a standard time (1:30 to 8:00). The level sets how far off the start state is and which auto functions are on by default: all four for beginners, only brightness and contrast for advanced tasks, none for experts. A beginner's task runs on an instrument that stands still, with the stage starting on the specimen; from the advanced level on the image shakes, and a powder, where the specimen has one, has to be found on its stub first.
| Task | Specimen | Photos | Standard time |
|---|---|---|---|
| Beginner · 4 tasks | |||
| Balls and substrate | Tin balls on carbon | 1 | 1:30 |
| Two phases | Cemented carbide (WC-Co) | 1 | 1:30 |
| Pollen overview | Pollen on carbon tape | 1 | 2:00 |
| Steps at low voltage | Graphite anode particles | 1 | 2:00 |
| Advanced · 5 tasks | |||
| One field, two detectors | Gold on carbon | 2 | 3:00 |
| Electrode layers | MLCC cross-section | 1 | 2:30 |
| Navigate to the grating | Chip test pattern | 1 | 4:00 |
| One spot, three scales | Nanorod array on nickel foam | 3 | 5:00 |
| A well-dispersed field | LNMO cathode particles | 1 | 5:00 |
| Expert · 6 tasks | |||
| Three residue particles | Gunshot residue on carbon tape | 3 | 7:00 |
| Find the crack | Solder joint cross-section | 2 | 6:00 |
| Depth of field | Electrospun nanofibre mat | 1 | 4:00 |
| Spheres by themselves | Mesoporous polydopamine spheres | 1 | 8:00 |
| A clean place | Used gold standard | 1 | 6:00 |
| Tubes at 100,000x | Carbon nanotubes | 1 | 7:00 |
Each photo is a fresh full frame taken with the present settings, and its scan time counts; the last photo ends the run. A photo is compared with the photo the best settings give of the same view: a slow scan, in focus, with the levels set for it. Four marks from 0 to 100 are combined (Table 2), and the result is multiplied by the share of the task's rules that were met. A rule is judged from what the engine recorded with each photo: the settings, where the image lies on the specimen, and a census of the view, the material under the beam and the surface height at 256 × 192 points. A photo below the target magnification pulls the total down in proportion. The total gives a grade: S from 90, then A, B and C from 80, 65 and 50, otherwise D.
| Mark | What it measures | Weight |
|---|---|---|
| Sharpness | The blur left by defocus and astigmatism, in pixels at the target magnification; full marks at none, falling off as a bell curve 2.5 pixels wide | 0.4 |
| Exposure | How much of the grey scale the picture uses, and how much of it is clipped | 0.3 |
| Noise | The signal-to-noise ratio, on a log scale from 6 (no marks) to 30 (full marks) | 0.1 |
| Time | The time of the run up to the last photo plus the scan time of the photos; full marks within half the standard time, none beyond three times it | 0.2 |
The result page lists each rule as met or not, shows each photo beside the best-settings photo with a divider to drag, and lists how far each setting was from the best. Its ranking panel shows simulated data and is not connected to real scores. An agent's run of a task starts in the same state every time, since the random draws are seeded with the task's identifier, so that the results of different agents can be compared; a person's run is drawn by chance.
Operation by an AI agent
A person who has the microscope open can hand it to an AI agent. The page asks the server for a session and shows a link; the agent opens it and gets a manual written by the server: the task and its rules, every setting with its range, and the endpoints. From then on the agent sends plain HTTP requests. The microscope stays in the browser: the server only relays each request to the open page, which carries it out while the person watches. During a task the person's controls are locked, and the person can stop the run.
The interface covers what an operator can do: reading the state (settings, read-outs, the stage and the beam path); setting any control; centring a point of the picture; the auto functions, where the task allows them; the vacuum, the high voltage, the column valve and the live scan; scanning a frame as JPEG, PNG or TIFF, also in 16 bits; batches of up to 12 steps, each followed by a frame of the small window, returned as one contact sheet or one frame at a time; and taking a photo, whose finished micrograph, with its data bar, can then be fetched.
The agent sees what an operator sees: settings, read-outs and the picture, never the defocus, the astigmatism or the misalignment. Time is real time: a frame takes as long as its scan, a stage move as long as the stage needs, and in a task the clock starts with the agent's first command. During a task the agent is not told whether a photo meets the rules until the run is over. The server writes the manual itself and tells the agent to treat every other reply as data about the instrument, since those replies come from a page in somebody's browser. A session ends after two hours or 3,000 commands.
The agent lab is the same link without a task: no clock, no score and no lock, so the person can operate the microscope together with the agent, and the agent can go to any slot of the holder. A photo taken in the lab is marked at once, but only for the person: the marks, the focus error and the astigmatism left appear in the log, and the agent is told none of it.
Intended uses
Teaching. Several specimens are made to teach one thing each: the tin balls for focus and stigmation, the fibre mat for depth of field, gunshot residue that looks alike in SE and is told apart in BSE, silicon nanowires whose height shows only when tilted, graphene whose layers show at 1 to 2 kV, and copper whose grains change brightness with a degree of tilt.
Operator practice. The same tasks can be repeated against a standard time and a score, so that the sequence of setting up an instrument, finding the place, choosing detector and voltage, and taking the photo can be practised and compared from one attempt to the next.
Evaluating agents. A person and an agent get the same tasks, the same clock and the same judge, and an agent's run always starts in the same state. This allows the results of different agents, or of different versions of one agent, to be compared on a task that runs in real time and has hidden state. The specimen guide can also hand any of its photo goals to an agent as text.
Limitations
- Everything is simulated. The pictures and read-outs are not measurements of real specimens and must not be presented as coming from a real instrument. This page reports no comparison with measurements from a real instrument, and the thresholds of the tasks were set from views measured on the simulated specimens.
- The physics is simplified. It is closed-form: there is no Monte Carlo simulation of electron trajectories, no X-ray signal (so no energy-dispersive spectroscopy) and no specimen charging.
- Specimens are procedural. Some were modelled on kinds of material seen in real micrographs, but none reproduces a photographed field of view, and the view is an orthographic projection.
- Auto routines and focus follow never fail. Whatever the view shows, a press gets there; those of a real instrument can fail, for example on a bare or noisy field.
- It needs WebGL 2. The browser needs WebGL 2 and a graphics processor to match. The first visit to a specimen builds its shader, which can take a few seconds.
Access
CritterSEM is open to people we approve one by one. Tell us who you are and what you want to use it for. Requests are reviewed by hand, and if one is approved the sign-in link arrives by email. Please read the Terms of use and the Privacy notice first.
You are signed in on this browser.
Citation
If you refer to CritterSEM, you can cite it as:
@misc{critterlabs2026crittersem,
title = {CritterSEM: A browser-based virtual scanning electron microscope for people and AI agents},
author = {{CritterLabs}},
year = {2026},
howpublished = {\url{https://critterlabs.dev/sem/}},
note = {Virtual scanning electron microscope}
}