> ## Documentation Index
> Fetch the complete documentation index at: https://docs.edgeimpulse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Live classification

> Run your impulse on a single new sample to see, window by window, what the model predicts before you deploy it.

Live classification runs your current impulse over one sample and shows you what the model predicts. The sample is usually captured from a connected device, so you can try the model on real data before you deploy it.

[Model testing](/studio/projects/model-testing) scores your whole labeled test set and reports overall accuracy. Live classification shows the results for one sample in detail, so you can see how the model handles a specific input.

## How it works

Edge Impulse moves a sliding window across the sample, using the window size and window increase configured in your [impulse](/studio/projects/impulse-design), runs the DSP and learning blocks on each window, and returns one result per window.

Keep in mind:

* **Each window gets its own result.** A two-second recording with a one-second window and a 100 ms increase produces around eleven results, and they can disagree with each other.
* **The window settings come from the impulse**, so changing the window length in your impulse also changes live classification results.
* **Each learning block reports separately.** An impulse with a classifier and an anomaly block gives you a confidence per label from the first and an anomaly score from the second, for every window.
* **Results are compared against the sample's label** when it has one, so you can see which windows were misclassified.
* **The float32 model is used by default.** You can classify against the int8 model, or against several [model variants](/studio/projects/model-testing) at once, to see where quantization changes a prediction.

If your project has more than one [experiment](/studio/projects/experiments), live classification runs against the impulse you have selected, so switching impulses and reclassifying the same sample is a direct comparison.

<Note>
  Studio warns you if the sample is already in your training set. The model learned from that sample, so classify a new one to see how the model handles data it hasn't seen.
</Note>

## Capturing a sample

Connect the source you want to sample from, then click **Start sampling**. Everything connected to your project appears under [**Devices**](/studio/projects/devices).

* **A development board** connected over the [Edge Impulse CLI](/tools/clis/edge-impulse-cli) or WebUSB. This is the most representative option, because the data passes through the same sensor and firmware as it will in production.
* **Your mobile phone.** Go to **Devices**, click **Connect a new device**, select **Use your mobile phone**, and scan the QR code. Then click **Switch to classification mode** and start sampling.
* **Your computer.** Go to **Devices**, click **Connect a new device**, select **Use your computer**, and grant the browser access to your microphone or camera. Then click **Switch to classification mode** and start sampling.

<Frame caption="Connected devices available for live classification.">
  <img src="https://mintcdn.com/edgeimpulse/_c2MlV3xqBGAqJST/.assets/images/live-classification.PNG?fit=max&auto=format&n=_c2MlV3xqBGAqJST&q=85&s=75bb0c485b368a5481d3222dd552eba1" alt="Live classification devices panel listing connected boards available for sampling" width="1045" height="433" data-path=".assets/images/live-classification.PNG" />
</Frame>

<Frame caption="Connecting a mobile phone for live classification.">
  <img src="https://mintcdn.com/edgeimpulse/O-6Yv5nSVCNsemg-/.assets/images/live-mobile.PNG?fit=max&auto=format&n=O-6Yv5nSVCNsemg-&q=85&s=11ebf0675e000fa3eedd121c8152be65" alt="Mobile phone connection screen with QR code for live classification" width="1351" height="614" data-path=".assets/images/live-mobile.PNG" />
</Frame>

You can also classify a sample that is already in your project, or upload a file, so you can rerun the same input without recapturing it.

<Tip>
  If a model behaves differently on your device than in Studio, sample from the device itself rather than from your phone. Differences in sensor placement, sample rate, or mounting can make the device's data look different from your training data.
</Tip>

## Reading the results for object detection

Object detection projects show detections rather than a confidence per label. Use the dropdown above the image to switch between the **Side by side** and **Overlay** views.

<Tabs>
  <Tab title="SSD MobileNet V2">
    Employs a Single Shot MultiBox Detector (SSD) with a MobileNet V2 backbone for object detection. This model is optimized for running on MCUs and CPUs.

    #### Side by side

    <Frame caption="The labeled ground truth above the model's predictions.">
      <img src="https://mintcdn.com/edgeimpulse/gFdZuMrTME9p3UIR/.assets/images/od-side-by-side-lamp.png?fit=max&auto=format&n=gFdZuMrTME9p3UIR&q=85&s=267f60d63f9f28927278ab28f93f9706" alt="Object detection result in side-by-side mode with detections and confidence scores" width="1600" height="806" data-path=".assets/images/od-side-by-side-lamp.png" />
    </Frame>

    The top image shows the ground truth labels and the bottom image shows the predicted bounding boxes, each with a class and a confidence score. Comparing the two makes it easy to spot objects the model missed.

    #### Overlay

    <Frame caption="Detections superimposed on the original image.">
      <img src="https://mintcdn.com/edgeimpulse/gFdZuMrTME9p3UIR/.assets/images/od-overlay-lamp.png?fit=max&auto=format&n=gFdZuMrTME9p3UIR&q=85&s=f18fa57262394b183b6bed37f737404c" alt="Object detection overlay mode with detections drawn over the original image" width="1600" height="806" data-path=".assets/images/od-overlay-lamp.png" />
    </Frame>

    Bounding boxes are drawn directly on the image, with labels and confidence scores in context. Use this view to check how closely the boxes fit the objects.

    #### Summary table

    <Frame caption="Per-sample summary of what the model detected.">
      <img src="https://mintcdn.com/edgeimpulse/gFdZuMrTME9p3UIR/.assets/images/od-table-lamp.png?fit=max&auto=format&n=gFdZuMrTME9p3UIR&q=85&s=d4d739a777fcd1732718a5dd2cd516fd" alt="Object detection summary table with predictions for a selected sample file" width="801" height="527" data-path=".assets/images/od-table-lamp.png" />
    </Frame>

    * **Name** is the name of the classified sample, for example `sample.jpg.22l74u4f`.
    * **Category** lists the classes the model was trained to detect, here `coffee` and `lamp`.
    * **Count** is how many times each class was detected in this sample.
    * **Info** shows the precision score, the model's accuracy across a range of Intersection over Union (IoU) values, known as mean average precision (mAP).
  </Tab>

  <Tab title="FOMO">
    Employs centroids for detecting object locations. Runs on high-end MCUs as well as CPUs and GPUs.

    #### Side by side

    <Frame caption="The labeled ground truth above FOMO's centroid predictions.">
      <img src="https://mintcdn.com/edgeimpulse/8gSv6x4dEVbIP2Vj/.assets/images/fomo-side-by-side.png?fit=max&auto=format&n=8gSv6x4dEVbIP2Vj&q=85&s=3c5c03cd78a0710906bdc7a4979f03ae" alt="FOMO side-by-side live classification view with centroid detections" width="1600" height="826" data-path=".assets/images/fomo-side-by-side.png" />
    </Frame>

    In the image above, the model found 7 of the 11 labeled cars. FOMO predicts centroids rather than boxes, so check whether each object was found and counted.

    #### Overlay

    <Frame caption="FOMO detections drawn over the original image.">
      <img src="https://mintcdn.com/edgeimpulse/8gSv6x4dEVbIP2Vj/.assets/images/fomo-overlay.png?fit=max&auto=format&n=8gSv6x4dEVbIP2Vj&q=85&s=324a4706830131c252f51adca73ebbb4" alt="FOMO overlay live classification view with detections over the image" width="1600" height="826" data-path=".assets/images/fomo-overlay.png" />
    </Frame>

    #### Summary table

    <Frame caption="Per-sample summary of FOMO detections.">
      <img src="https://mintcdn.com/edgeimpulse/8gSv6x4dEVbIP2Vj/.assets/images/fomo-predictions-right.png?fit=max&auto=format&n=8gSv6x4dEVbIP2Vj&q=85&s=97abae0ff12efe43733291e85789bf09" alt="FOMO prediction summary table listing classes and confidence scores" width="1600" height="826" data-path=".assets/images/fomo-predictions-right.png" />
    </Frame>

    * **Category** is the class label, for example `car`.
    * **Count** is how many instances were detected.
    * **Info** shows metrics for counting tasks:
      * **F1 score** balances precision and recall.
      * **Precision** is how many detections were correct.
      * **Recall** is how many of the objects actually present were found.

    High precision with low recall means the model is missing objects. High recall with low precision means it is detecting objects that aren't there. Check both numbers together.

    #### Display controls

    Use the controls in the bottom right to filter what is drawn, which helps you find errors in a crowded image.

    **Predictions**

    * **Show all** displays every detection with its confidence score.
    * **Show correct only** isolates the detections that matched a ground truth label.
    * **Show incorrect only** isolates the false positives.

    **Ground truth**

    * **Show all** or **Hide all** the original labels.
    * **Show detected only** displays the labels the model found.
    * **Show undetected only** displays the labels the model missed.
  </Tab>
</Tabs>

## API reference

| Endpoint | Use |
| - | - |
| [Classify sample](/apis/studio/classify/classify-sample) | Run the current impulse over one sample and get a result per window |
| [Classify sample for the given set of variants](/apis/studio/classify/classify-sample-for-the-given-set-of-variants) | Classify the same sample with several model variants at once |

## Additional resources

* [Model testing](/studio/projects/model-testing) for aggregate accuracy across the test set
* [Devices](/studio/projects/devices) for connecting a board, phone, or computer
* [Impulse design](/studio/projects/impulse-design) for the window settings that live classification uses
