Object Classification
Object classification allows you to train a custom MobileNetV2 classification model to run on tracked objects (persons, cars, animals, etc.) to identify a finer category or attribute for that object. Classification results are visible in the Tracked Object Details pane in Explore, through the frigate/tracked_object_details MQTT topic, in Home Assistant sensors via the official Frigate integration, or through the event endpoints in the HTTP API.
Training a custom object classification model requires an internet connection to download MobileNetV2 base weights. By default these weights are not cached in /config/, so they are downloaded again after the container is recreated. Once trained, the model runs fully offline. See Network Requirements for details.
Minimum System Requirementsâ
Object classification models are lightweight and run very fast on CPU.
Training the model does briefly use a high amount of system resources for about 1-3 minutes per training run. On lower-power devices, training may take longer.
A CPU with AVX + AVX2 instructions is required for training and inference.
Classesâ
Classes are the categories your model will learn to distinguish between. Each class represents a distinct visual category that the model will predict.
For object classification:
- Define classes that represent different types or attributes of the detected object
- Examples: For
personobjects, classes might bedelivery_person,resident,stranger - Include a
noneclass for objects that don't fit any specific category - Keep classes visually distinct to improve accuracy
Classification Typeâ
-
Sub label:
- Applied to the object's
sub_labelfield. - Ideal for a single, more specific identity or type.
- Example:
catâLeo,Charlie,None.
- Applied to the object's
-
Attribute:
- Added as metadata to the object, visible in the Tracked Object Details pane in Explore,
frigate/eventsMQTT messages, and the HTTP API response as<model_name>: <predicted_value>. - Ideal when multiple attributes can coexist independently.
- Example: Detecting if a
personin a construction yard is wearing a helmet or not, and if they are wearing a yellow vest or not.
- Added as metadata to the object, visible in the Tracked Object Details pane in Explore,
A tracked object can only have a single sub label. If you are using Triggers or Face Recognition and you configure an object classification model for person using the sub label type, your sub label may not be assigned correctly as it depends on which enrichment completes its analysis first. This could also occur with car objects that are assigned a sub label for a delivery carrier. Consider using the attribute type instead.
Assignment Requirementsâ
Sub labels and attributes are only assigned when both conditions are met:
- Threshold: Each classification attempt must have a confidence score that meets or exceeds the configured
threshold(default:0.8). - Class Consensus: After at least 3 classification attempts, 60% of attempts must agree on the same class label. If the consensus class is
none, no assignment is made.
This two-step verification prevents false positives by requiring consistent predictions across multiple frames before assigning a sub label or attribute.
Example use casesâ
Sub labelâ
- Known pet vs unknown: For
dogobjects, set sub label to your pet's name (e.g.,buddy) ornonefor others. - Mail truck vs normal car: For
car, classify asmail_truckvscarto filter important arrivals. - Delivery vs non-delivery person: For
person, classifydeliveryvsvisitorbased on uniform/props.
Attributesâ
- Backpack: For
person, add attributebackpack: yes/no. - Helmet: For
person(worksite), addhelmet: yes/no. - Leash: For
dog, addleash: yes/no(useful for park or yard rules). - Ladder rack: For
truck, addladder_rack: yes/noto flag service vehicles.
Configurationâ
Object classification is configured as a custom classification model. Each model has its own name and settings. Specify which object labels should be classified.
- Frigate UI
- YAML
Navigate to the Classification page from the main navigation sidebar, then click Add Classification.
In the Create New Classification dialog:
| Field | Description |
|---|---|
| Name | A name for your classification model (e.g., dog) |
| Type | Select Object for object classification |
| Object Label | The object label to classify (e.g., dog, person, car) |
| Classification Type | Whether to assign results as a Sub Label or Attribute |
| Classes | The class names the model will learn to distinguish between |
The threshold (default: 0.8) can be adjusted in the YAML configuration.
classification:
custom:
dog:
threshold: 0.8
object_config:
objects: [dog] # object labels to classify
classification_type: sub_label # or: attribute
An optional config, save_attempts, can be set as a key under the model name. This defines the number of classification attempts to save in the Recent Classifications tab. For object classification models, the default is 200.
Training the modelâ
Creating and training the model is done within the Frigate UI using the Classification page. The process consists of two steps: