# Concepts

This section introduces the key concepts, ideas, and terms that will help you use the Model Registry platform effectively.

## Model

Model is the basic element in the AI & Models area of Hub, consisting of:

 * Model File(s) - Model file(s) or NN archive file(s) if model file(s) are packaged together with JSON metadata, and
 * Model Card - Comprehensive description of the model.

Models can be public or private (team-owned), and can freely be uploaded to or downloaded from the collection. For details, refer
to the [Upload/Download](https://docs.luxonis.com/cloud/hubai/model-registry/upload-download.md) guide.

Each Model File constitutes a separate Variant, characterized by its training configuration and usage context. To support
efficient model development and precise referencing in deployed applications, we structure Model Files in three nested levels.
This structure helps you:

 * Track your model's evolution,
 * Differentiate semantically distinct models,
 * And reference the correct artifact via the appropriate identifier.

Each nesting level — Variant, Version, and Instance — has its own unique ID, which can be used in your DepthAI pipeline to fetch
the corresponding model from Hub.

> Note: DepthAI always attempts to retrieve the
> ***latest***
> model available for a given identifier. For example, providing only a Variant ID will cause DepthAI to use the most recent
Instance of the latest Version. If you want to lock your application to a specific model build, use the
> **Instance ID**
> instead.

The following diagram illustrates the hierarchical structure:

```markdown
├── Variant 1
|   ├── Version 1
|   |   ├── Instance 1
|   |   └── Instance 2
|   └── Version 2
|       ├── Instance 1
|       └── Instance 2
├── Variant 2
...
```

#### Variant

A Variant is a specific version of a model, typically distinguished by input resolution (e.g., 224x224), dataset used for training
(e.g., COCO), or some smaller variation in model architecture. Each variant is associated with a Variant ID.

#### Version

Each model Variant can have multiple Versions. Semantically, this can be used to track different weights of your model that you
are developing. You can have an initial version, then a version finetuned, and a version that is, for example, used in production.
Each Version has its Version ID.

#### Instance

An Instance is a compiled, platform-targeted version of a Variant — the actual artifact deployed to hardware. For more information
about the conversion to a platform-specific instance, see the [Detailed
Conversion](https://docs.luxonis.com/cloud/hubai/model-registry/detailed-conversion.md) guide

Each instance is identified by a unique Instance ID that points to a specific platform export rather than a general model
variant/version. Therefore, when integrating an Instance into your pipeline, ensure the Instance ID corresponds to the correct
platform for your deployment environment.

### Model File(s)

Model file(s) (also referred to as model executable(s)) come standalone or packed into a [NN
Archive](https://docs.luxonis.com/software-v3/ai-inference/nn-archive.md). The model file(s) must be either in ONNX (.onnx),
OpenVINO IR (.xml and .bin), or TensorFlow Lite (.tflite) or one of the RVC compiled formats.

### Model Card

A Model Card is a collection of information about the model. You can choose your own structure for private models. For public
models, we suggest the following structure (check out the [Model Card
Template](https://docs.luxonis.com/cloud/hubai/model-registry/modelcard-template.md) ):

```markdown
# Model Details

## Model Description
... Description of the model functionality.

- Developed By - Name of the model developer(s).
- Shared By - Source of the model file/weights.
- Model Type - General model type (e.g. computer vision).
- License - Link to the license that governs the use/distribution of the model.
- Resources - Link(s) to the model resouces (e.g. paper, sourecode, etc.)

# Training Details

## Training Data
... Describe and link to the data used to train the model.

# Testing Details

## Metrics
... Describe and report the metrics used to validate the model.

# Technical Specifications

## Input/Output Details
... Name and a short description for each input/output tensor.

## Model Architecture
... Describe the model architecture (e.g. backbone, head, etc.).

## Throughput
... Report model throughput on RVC platform(s) for which the model is converted.

## Quantization
... Describe quantization data if quantization is used during conversion.

# Utilization
... Explain how to utilize the model in a DepthAI pipeline. Ideally provide or link to an example.
```
