Skip to main content

Vigil AI Detection

Vigil is O.D.I.N.'s built-in AI print failure detection system. It analyzes camera frames in real time using on-device ONNX inference to detect print issues before they waste filament or damage your printer.

What It Detects

Detection TypeDescription
SpaghettiExtruded filament not adhering to the model, producing tangled strands
DetachmentPrint separating from the build plate mid-print
First-Layer IssuesPoor first layer adhesion, warping, or inconsistent extrusion
Build Plate EmptyNothing detected on the build plate when a print should be present

How It Works

Camera → go2rtc → Frame Capture → ONNX Model → Detection → Action
  1. go2rtc streams video from your cameras (RTSP, USB, or Bambu built-in cameras)
  2. Vigil captures frames from the go2rtc stream at regular intervals
  3. Each frame is passed through an ONNX object detection model running locally
  4. If the model detects an issue, a confirmation buffer validates the detection
  5. On confirmed detection, Vigil triggers the configured action (alert, auto-pause, or both)

All inference runs locally on the O.D.I.N. host. No frames or data are sent to external services.

Setup

Prerequisites

  • At least one camera configured in go2rtc and streaming
  • The camera must have a clear, stable view of the print bed
  • The printer must be linked to a camera in Settings > Printers > [Printer] > Camera

Enabling Detection

  1. Navigate to Settings > Vigil AI
  2. Enable detection for each printer that has a camera assigned
  3. Detection starts automatically when the printer begins a print job
info

Vigil runs per-printer in its own thread. Enabling detection on many printers simultaneously increases CPU usage. On low-powered hosts, consider enabling detection only on printers running unattended or high-value prints.

Threshold Tuning

Each detection type has an independent sensitivity slider (0-100):

  • Higher sensitivity — Catches more issues but may produce more false positives
  • Lower sensitivity — Fewer false alarms but may miss subtle failures

Recommended starting points:

Detection TypeDefaultNotes
Spaghetti70Reliable. Lower if you get false positives from support structures.
Detachment60Can false-trigger on raft edges. Lower if using rafts frequently.
First-Layer50Highly dependent on camera angle and lighting. Tune carefully.
Build Plate Empty80Very reliable. Only lower if transparent filaments cause issues.

Adjust thresholds under Settings > Vigil AI > [Printer] > Thresholds.

Confirmation Buffer

To avoid false positives, Vigil requires multiple consecutive detections before confirming an issue. A single frame showing a potential problem is not enough to trigger an action.

The confirmation buffer ensures:

  • Transient anomalies (lighting changes, camera vibration) are ignored
  • Only sustained, consistent detections trigger alerts or pauses
  • You can adjust the buffer length per detection type for more or less conservative behavior

Auto-Pause

When enabled, Vigil automatically pauses the print on a confirmed detection. This prevents wasted filament and potential printer damage.

Auto-pause behavior:

  • The pause command is sent immediately to the printer via its native protocol
  • An alert notification is dispatched to all configured channels
  • The detection frame is saved for review in the Detections page
  • The print remains paused until a user manually resumes or cancels it
warning

Auto-pause sends a pause command through the printer's protocol (MQTT for Bambu, REST for Moonraker/PrusaLink, SDCP for Elegoo). If the printer's communication is interrupted, the pause may not reach the printer. Auto-pause is not a substitute for physical safety measures like smoke detectors and thermal cutoffs.

tip

Enable auto-pause for unattended prints. For attended prints, you may prefer alert-only mode so you can visually confirm before deciding to pause.

Detection History

All detections (confirmed and unconfirmed) are logged and viewable at Detections in the sidebar. Each entry includes:

  • Timestamp
  • Printer and detection type
  • Confidence score
  • Captured frame image
  • Whether auto-pause was triggered

Frames are stored at /data/vision_frames/{printer_id}/ inside the container.

Vision Models

ONNX models are stored at /data/vision_models/ inside the container. Default models are copied from the image on first boot.

To use a custom or updated model:

  1. Place the .onnx file in /data/vision_models/
  2. Register it via Settings > Vigil AI > Models
  3. Assign it to printers as needed
caution

Custom models must follow the same input/output tensor format as the default models. Incompatible models will fail silently or produce inaccurate detections. Test thoroughly before deploying custom models to production printers.