Materials Science · Research Infrastructure · Stage 2

A Personal Lab Database for Experimental Alloys stage 2

Validated characterization pipelines · multi‑instrument integration · ML‑ready schema
Status
✅ Complete · production ready
Instruments
XRD · VSM · SEM (Zeiss / JEOL / Tescan)
Tables
16 · fully populated
Samples
4 (with full composition + characterisation)
3
characterisation pipelines
690
SEM images imported
170
XRD peaks · fitted & validated
0.001
eV/atom — cross‑database agreement

Stage 2 transforms the lab‑book foundation into a validated research platform. Every instrument pipeline is built on real data, not synthetic tests. The schema is designed for machine learning — and the infrastructure is now ready for Stage 3.

From scattered spreadsheets to a single source of truth

The project started with a messy desktop folder, years of Origin projects, and a growing set of manual spreadsheets. Stage 1 built the data‑capture layer — composition calculator, literature cross‑checking, and basic file import. Stage 2 adds the analytical layer: real, validated characterisation pipelines for every instrument in the lab, with results stored in a structured schema designed for machine learning.

XRD

Neighbour‑aware peak fitting

NIST LaB6 validation, Kα2 stripping, R² quality, Scherrer crystallite size, d‑spacing. 170 peaks, mean R² ≈ 0.938.

VSM

Multi‑segment hysteresis

Hc, Mr, BHmax, temperature coefficients α/β, entropy change ΔSm. Handles PPMS/MPMS3/ACMS, mass from filename.

SEM

Unified metadata parser

Zeiss, JEOL, Tescan (16‑bit). Adaptive thresholding, phase fraction with operator judgment. 690 images imported.

“The hard, instrument‑specific work is done. What remains is science.”
— Stage 2 completion summary, 2 September 2026

What was planned vs. what was built

The original design sketch included a full Docker Compose stack with MinIO, Redis, Jupyter, and a file‑watcher service. Real use showed that a leaner system — Postgres, a Python API layer, and a proper desktop interface — covered everything actually needed, without the operational overhead of running five services to enter one sample.

Knowing what to cut turned out to matter more than the original breadth of the plan.

alloy_lab
├── samples            composition (JSONB), lineage, VEC/δ/ΔH_mix
├── synthesis          method, temperature, atmosphere, duration
├── characterization   one row per XRD/VSM/SEM measurement
├── properties         extracted numeric results per measurement
├── literature_checks  deduped matches from 3 external databases
└── material_classes
PostgreSQL 17 Docker customtkinter Materials Project API OQMD Alexandria

Stage 2 — core deliverables

PipelineValidationKey features
XRDNIST LaB6, lattice param within 0.0001 ÅBackground subtraction, Kα2 stripping, neighbour‑aware fitting, R², Scherrer size, d‑spacing
VSMEnd‑to‑end on real production DBInstrument detection (PPMS/MPMS3/ACMS), mass extraction, segmentation, Hc/Mr, α/β, ΔSm, BHmax
SEM16 real images (Zeiss/JEOL/Tescan)Unified metadata, adaptive thresholding, auto footer crop, phase fraction with operator threshold

Schema additions (Stage 2)

TablePurpose
xrd_peakslong format, one row per peak
xrd_featureswide format, ML‑ready, one row per sample
vsm_mh_detailsHc, Mr, flag, branch_found, BHmax
vsm_temperature_coefficientsα, β, R², n_points
compositions.composition_type'aimed' / 'measured' / 'reference'

Interactive tools — with Save to DB

Three standalone tools, each launched from the Data Viewer with the file pre‑loaded. The operator adjusts parameters, confirms the result, and saves directly to the database. No manual transcription, no copy‑paste errors.

Tool

XRD analyzer

Live sensitivity controls, per‑peak accept/reject, Save to DB

Tool

VSM MH analyzer

Multi‑segment, per‑segment accept/reject, Save to DB

Tool

SEM phase fraction

Live threshold slider, Otsu suggestion, Save to DB

Real data, real validation

The database now contains real, validated measurements from real samples, stored in a schema designed from the start to feed a machine learning model.

SampleXRD peaksmean R²VSM Hc (Oe)
RP1a570.94198.6
RP2a580.93—
RP3a550.94—
La103Fe115Mn01Si14———

What was fixed along the way

⚙️
Tescan 16‑bit support — pixel size now parsed correctly from .hdr sidecar (270.31 nm). Grain analyzer uses universal metadata parser.
📐
Element‑fraction auto‑wiring — add_compositions() automatically stores wt% + at% for every new sample, using the mass calculator’s output. No separate atomic‑percent computation needed.
🧪
Synthesis route auto‑save — screening results (mechanical alloying, powder sintering, diffusion bonding) are now persisted in the synthesis table with full reasoning in notes.
🧹
outdated/ cleanup — removed dozens of intermediate versions. All history preserved in git. Active codebase is now clean.

Database migration to home server

3 September 2026 — the database was migrated from a local Docker container on the M4 Mac to the home server (192.168.2.42), completing the infrastructure setup for Stage 3. All three machines — Mac, ML Desktop, and the server itself — now share a single canonical database.

50
samples
30
composition records
170
XRD peaks
92
characterisation records

.env updated on all machines (POSTGRES_HOST=192.168.2.42). Connections verified: Mac ✅   ML Desktop ✅   new sample added end‑to‑end. Full step‑by‑step record — every command, the dump/restore, the final architecture: Database Migration: Alloy Lab Moves to the Home Server →

What this enables for Stage 3

The database now contains a complete, validated feature set ready for ML:

Proposed ML workflow: feature matrix (compositions + structural features) → Gaussian Process or Neural Network regression → property prediction + optimisation suggestions → new composition recommendations → back into calculator → new samples.

“What started as a lab organisation tool is now a research platform.”
— 3 September 2026

Stage 2 represents several months of careful, methodical engineering work: building instrument‑specific parsers validated against real lab data and certified reference standards, designing a database schema that serves both the lab‑book needs of today and the ML needs of tomorrow, and building interactive tools that enforce good scientific practice.

The project is now in a strong position for Stage 3. The hard, instrument‑specific work is done.

Additional Resources

Here you can download the presentation of the project in pdf format :