brain-circuitAI Classification

Running ONNX AI models on recorded seed images for classification

The AI Classification screen is where you run deep learning models on your recorded seed images. Select an ONNX model, configure duplicate removal and similarity search options, then execute the analysis on a single file or an entire batch of files. Results are written back to the HDF5 file and can be viewed on the Dashboard and Image Mosaic screens.

Prerequisites

  • An analysis file with recorded seed images (or a folder of files for batch mode).

  • An ONNX model (.onnx) exported from Csmart Studio Desktop, with its accompanying JSON metadata file in the same directory.

  • The Python runtime installed (from Runtime Environment).

Step-by-Step Walkthrough

1. Select the AI Model

Click Select Model to browse for your .onnx model file. After selection, the application reads the accompanying JSON metadata and displays:

  • Model Name: The name defined during export.

  • Model Description: A summary of the model's training dataset and architecture.

  • Model Classes: The classification categories the model can identify.

The selected model path is persisted in the Electron Store and restored on subsequent visits.

circle-info

The ONNX file and its JSON metadata file must be in the same directory and share the same base name (e.g., model_v1.onnx and model_v1.json).

2. Choose Single or Batch Processing

Use the File or Batch Selector at the top to switch between modes:

Mode
Description

Single File

Runs the model on the currently open analysis file

Batch (Folder)

Runs the model on all .hdf5 files in a selected folder

In batch mode, select a folder containing your analysis files. The application validates the folder and displays the number of files found.

3. Configure Duplicate Removal

The Duplicate Removal dropdown controls how the application handles near-duplicate seed images that may have been captured multiple times during recording:

Option
Description

Coffee - Default AI

Optimized for coffee seeds using AI-based similarity detection

Generic - Light

Conservative duplicate detection with fewer removals

Generic - Strict

Aggressive duplicate detection for maximum deduplication

Do Not Remove Duplicates

Skips duplicate detection entirely

circle-info

For most coffee analysis workflows, Coffee - Default AI is recommended. It uses model-specific features to identify duplicates while preserving unique seeds.

4. Enable Similarity Search (Optional)

Toggle Similarity Search to enable feature-based similarity analysis during classification. When enabled, the model extracts embedding vectors for each seed, which can be used later for finding visually similar seeds across analyses.

5. Adjust Pixel Calibration (If Needed)

The screen displays the current Pixel/cm and Sieve Offset values stored in the analysis file. If these differ from your system calibration:

  • Use the increment/decrement controls to adjust the values.

  • Click Save to write the updated calibration to the HDF5 file.

circle-exclamation

6. Run the Analysis

Click Run AI Analysis to begin. A progress bar modal appears showing:

  • Title: The current operation phase.

  • Progress Bar: Percentage of completion.

  • Message: Details about the current step (loading model, processing images, writing results).

  • Header: The file currently being processed (in batch mode).

The sidebar is locked during execution to prevent accidental navigation.

circle-exclamation

7. Review Results

When the analysis completes:

  • The progress modal closes automatically.

  • The total analysis counter is incremented.

  • The application navigates to the Dashboard screen to display results.

  • In batch mode, processing continues to the next file automatically.

Configuration Persistence

All settings on this screen are saved to the Electron Store:

  • Selected ONNX model path

  • Duplicate removal mode

  • Similarity search toggle

These are restored automatically when you return to the screen.

Troubleshooting

Issue
Possible Cause
Solution

"Select Model" shows no files

Wrong folder selected or missing .onnx files

Navigate to the folder containing your exported ONNX model

Model description not showing

JSON metadata file missing or misnamed

Ensure the .json file is in the same directory as the .onnx file with the same base name

Analysis fails with timeout

Python runtime issue or corrupted file

Check runtime installation; try re-opening the analysis file

Progress stalls at 0%

Model loading failed or GPU out of memory

Check Runtime Environment for GPU status; try a smaller model

Batch mode finds no files

Selected folder contains no .hdf5 files

Verify the folder path and file extensions

Pixel calibration mismatch warning

File was recorded with different hardware settings

Update pixel/cm and sieve offset values before running analysis

Last updated