Casting inspection, from photo to report

Upload a photo.
Know if the part is good.

Qastra checks each casting photo for defects, marks them on the image, and says which machine reading probably caused them. You get a short report you can act on.

part → scan → sensors → verdict

What happens to each photo

Four stages run in order on the server. Parts that pass stop after stage one.

  1. 01

    Good or bad?

    Every photo is filtered first using EfficientNet for binary OK vs. Defective screening, combined with Grad-CAM for anomaly localization. Nominal parts skip downstream inspection.

    Model 1 · EfficientNet + Grad-CAM

  2. 02

    What's wrong?

    Defective components are categorized across 6 defect classes using ResNet-18 with attention masking (or YOLOv8-seg for single-pass detection, categorization, and segmentation).

    Model 2 · ResNet-18 (or YOLOv8-seg)

  3. 03

    Why did it happen?

    XGBoost correlates the factory telemetry generator with historical casting datasets to isolate the primary culprit sensor and quantify parameter deviation.

    Model 3 · XGBoost Root-Cause

  4. 04

    LLM Layer & Reporting

    Gemini first structures raw XGBoost diagnostic signals into clean JSON, followed by a final Gemini call synthesizing the authoritative 3-sentence incident report.

    Gemini (2-Step Flow)

What you see in the dashboard

Bad parts open on the image. Good parts open on a short “All Good” card.

Image
The photo with defects marked. Opens first for bad parts.
Report
The verdict, likely cause, and the recommended action.
Sensors
Each machine reading with its recent history.
Details
The raw JSON from the pipeline, for engineers.

Architecture

A Next.js frontend sends photos to one FastAPI endpoint. The backend runs the models, saves the readings, and asks Gemini to write the report.

Frontend

Next.js 16, React 19, Tailwind. Uploads images, draws defect outlines and heatmaps, shows the report and sensor history.

/dashboard

multipart upload
FastAPI backend

POST /api/inspect

  • Model 1: EfficientNet (binary OK vs. Defective) + Grad-CAM
  • Model 2: ResNet-18 (6 defect classes with attention masking) or YOLOv8-seg
  • Model 3: XGBoost root-cause with factory telemetry & historical data
  • LLM Layer: Gemini (JSON structurer + 3-sentence incident report)

Runs in Docker on a VPS.

save · summarize
MongoDB Atlas

Each inspection's telemetry is stored with Beanie, which gives the Sensors tab its history.

Gemini

Two-stage pipeline: first structures XGBoost outputs into clean JSON, then generates the final 3-sentence incident report.

Try it on a casting photo

Drop in one image, or a batch of up to ten.

Open dashboard