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

# Compare Models

export const vp = 'Visual Prompting';

export const smartLabel = 'Smart Labeling';

export const productLL = 'LandingLens';

export const mi = 'Mobile Inference';

export const llsf = 'LandingLens on Snowflake';

export const companyName = 'LandingAI';

*This article applies to these versions of LandingLens:*

<table>
  <thead>
    <tr>
      <th>LandingLens</th>
      <th>LandingLens on Snowflake</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><span class="check-icon">✓</span></td>
      <td><span class="check-icon">✓</span></td>
    </tr>
  </tbody>
</table>

The Models page is a great way to get a high-level view of how different models performed on multiple datasets at once. However, if you'd like to see more details about how two specific models compare, use the **Compare Models** tool. The Compare Models tool is a great way to evaluate performance on multiple iterations of the model. It can help you identify if you need to improve your labels, datasets, and hyperparameters.

When you run the Compare Models tool, you set a **baseline** model and a **candidate** model. LandingLens then shows you if the candidate model performed better or worse across several metrics. You can even see a side-by-side comparison of how the baseline and candidate models performed on each image in the dataset.

<img src="https://mintcdn.com/landinglens/hjeGEKEYbDsj6EG_/images/compareModels_overview_Jan_2025.png?fit=max&auto=format&n=hjeGEKEYbDsj6EG_&q=85&s=d71fac27e751aa739a1d2e0d81030187" alt="compareModels_overview_Jan_2025" width="2416" height="1592" data-path="images/compareModels_overview_Jan_2025.png" />

<Info>Comparisons are generated on-demand, and are not saved.</Info>

## Run the Compare Models Tool

To compare two models:

1. Open the project to the **Models** tab.
2. Hover over the cell for one of the models you want to compare and click the **Compare** icon that appears. This model will be the *baseline* in the comparison. In other words, the second model will be compared as either better or worse than this model.
3. Click the cell for the second model you want to compare. This model will be the \*candidate \*in the comparison. In other words, this model will be compared as either better or worse than the first model.
   <Info>Want to switch the baseline and candidate models? Click the **Switch** icon.</Info>
4. Click **Compare**.
   <img src="https://mintcdn.com/landinglens/Hf67pwuPapd1A0aT/images/CompareModels_Jan_2025_01(2).gif?s=ba314a5dd3dc2f4d350c44dd442d730c" alt="CompareModels_Jan_2025_01(2)" width="1920" height="744" data-path="images/CompareModels_Jan_2025_01(2).gif" />
5. The Compare Models window opens and shows the difference in performance between the two models.
   <img src="https://mintcdn.com/landinglens/Hf67pwuPapd1A0aT/images/CompareModels_Jan_2025_02.png?fit=max&auto=format&n=Hf67pwuPapd1A0aT&q=85&s=45bc32e91ce2fce20ad0e28ed1f866d7" alt="CompareModels_Jan_2025_02" width="2298" height="1598" data-path="images/CompareModels_Jan_2025_02.png" />

## Model Performance Scores

The top of the Compare Models window shows how each model performed on the *evaluation set*. It also shows the difference in score between the two models. For example, in the image below, The F1 score for the candidate model is 2.8% higher than the F1 score for the baseline model (92.3 - 89.5 = 2.8).

These performance scores are included:

* F1 (for Object Detection, Classification, and Anomaly Detection)
* IoU (for Segmentation)
* Precision
* Recall

<img src="https://mintcdn.com/landinglens/hjeGEKEYbDsj6EG_/images/compareModels_scores(1).png?fit=max&auto=format&n=hjeGEKEYbDsj6EG_&q=85&s=70a425509f635eb4c38507c768ca0c15" alt="compareModels_scores(1)" width="2410" height="602" data-path="images/compareModels_scores(1).png" />

## Compare Training Settings

To see the model training information for each model, click **Compare Training Settings**.

<img src="https://mintcdn.com/landinglens/hjeGEKEYbDsj6EG_/images/compareModels_settings_1.png?fit=max&auto=format&n=hjeGEKEYbDsj6EG_&q=85&s=fe16390a217639d052fca85a699382bf" alt="compareModels_settings_1" width="2414" height="600" data-path="images/compareModels_settings_1.png" />

This opens a table with a side-by-side comparison of the settings used to train each models. Differences in training settings are highlighted.

<img src="https://mintcdn.com/landinglens/hjeGEKEYbDsj6EG_/images/compareModels_settings_2.png?fit=max&auto=format&n=hjeGEKEYbDsj6EG_&q=85&s=35c39c62b6a6407a64dc8e4014377e54" alt="compareModels_settings_2" width="1954" height="1486" data-path="images/compareModels_settings_2.png" />

## Confusion Matrices

The Compare Models window includes a confusion matrix for both the baseline and candidate model so that you can quickly compare how they performed on each class in the evaluation set.

Each confusion matrix counts ground truth labels versus model predictions. The y-axis represents each ground truth label. The x-axis represents each possible model prediction.

Each cell shows the count of images that correspond to particular ground truth class-predicted class pair. For example, in the image below, the **baseline** model correctly predicted the class "Dolphin" 15 times and misclassified it 7 times, whereas the **candidate** model correctly predicted it 19 times and misclassified it 3 times.

<img src="https://mintcdn.com/landinglens/hjeGEKEYbDsj6EG_/images/compareModels_confusionMatrix.png?fit=max&auto=format&n=hjeGEKEYbDsj6EG_&q=85&s=620742b9bf3148e2ffdf340988bc6e6d" alt="compareModels_confusionMatrix" width="2404" height="1578" data-path="images/compareModels_confusionMatrix.png" />

<Info>For detailed information about confusion matrices and their correspoding Precision and Recall scores, go to [Performance Report](./performance-report).</Info>

## Compare All Images

Click **All Images** to see a visual comparison of all images. This shows three versions of each image in the evaluation dataset:

* **Ground truth**: The original image with the ground truth (labels) that you added.
* **Baseline model**: The predictions of the candidate model.
* **Candidate model**: The predictions of the candidate model. LandingLens highlights an image if the candidate model performed better or worse than the baseline for that specific image.

<img src="https://mintcdn.com/landinglens/hjeGEKEYbDsj6EG_/images/compareModels_AllImages_1.png?fit=max&auto=format&n=hjeGEKEYbDsj6EG_&q=85&s=8551eef8bacfd3b02823c20c8fe88eac" alt="compareModels_AllImages_1" width="2414" height="1474" data-path="images/compareModels_AllImages_1.png" />

Click a set of images to see more information about those images.

<img src="https://mintcdn.com/landinglens/hjeGEKEYbDsj6EG_/images/compareModels_AllImages_2.png?fit=max&auto=format&n=hjeGEKEYbDsj6EG_&q=85&s=0c81e0e78f68aa24adf13c6e5e7c0da4" alt="compareModels_AllImages_2" width="2360" height="1478" data-path="images/compareModels_AllImages_2.png" />

### Compare All Images - Classification and Anomaly Detection

Because classes are assigned to an entire image in Classification and Anomaly Detection projects, it doesn't make sense to show the predictions as an overlay. Therefore, LandingLens shows the images and lists the ground truth and predictions next to the images.

<img src="https://mintcdn.com/landinglens/hjeGEKEYbDsj6EG_/images/compareModels_AllImages_Class.png?fit=max&auto=format&n=hjeGEKEYbDsj6EG_&q=85&s=9f4d22baae4f132ee0bad329e6bef3cb" alt="compareModels_AllImages_Class" width="2404" height="1660" data-path="images/compareModels_AllImages_Class.png" />
