> ## 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.

# Splits

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> (see exceptions below)</td>
    </tr>
  </tbody>
</table>

<Info>The information in this section is not applicable to Visual Prompting.</Info>

Computer vision models are trained based on sets of labeled images. The model training process requires the images to be split into three distinct subsets: the **Train set**, **Dev set**, and **Test set**. These sets are referred to as **splits**.

If the concept of setting splits is new to you, you don't have to worry about it—LandingLens will automatically split your dataset into the sets if you use [Fast Training](./train-models) (the default training method). If you are familiar with splits, you can use various tools in LandingLens to manage and assign splits.

Once a set is assigned to an image (either manually or automatically), the image stays in that set unless it is manually assigned to a different set.

Learn more about splits in the following video tutorial.

<iframe width="560" height="315" src="https://www.youtube.com/embed/vAOprIWLH3k?&wmode=opaque&rel=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />

## Sets

Each set serves a different purpose during the model training process. The three sets are:

* [Train Set](./splits#train-set)
* [Dev Set](./splits#dev-set)
* [Test Set](./splits#test-set)

### Train Set

The model is trained on the images in the **Train set**. The model learns about patterns and objects of interest from these images.

In Anomaly Detection projects, the Train set can only include Normal images. For more information, go to [Anomaly Detection](./anomaly-detection).

### Dev Set

After the model trains on images from the Train set, it validates its training and predictions on images from the **Dev** set. LandingLens continues to fine-tune the model based on its performance on the Dev set.

The Dev set helps prevent [overfitting](./splits#splits-prevent-overfitting). Overfitting is when a model simply “memorizes” the pictures and doesn’t understand what characteristics to look for when identifying objects of interest.

The "Dev set" is short for "Development set". This set is also known as the “Validation set”.

### Test Set

After the model trains on the Train set and fine-tunes on the Dev set, it makes predictions on images in the Test set. The model hasn't "seen" (been trained on) images from the Test set, so the performance on the Test set provides insights into how well the model performs in real-world scenarios.

We recommend that your Test set be as exhaustive and representative of your actual use case as possible. The Test set is your opportunity to see how well the model will perform on your real-world images.

The “Test set” is also known as the “Holdout set” and the “golden dataset”.

## LandingLens Automatically Assigns Splits in Fast Training

If you haven't assigned splits to your images, LandingLens automatically assigns splits to labeled images during Fast Training (the default training method). By default, LandingLens assigns sets based on the following percentages to *labeled images that don't have sets assigned yet*:

* **Train**: 80%
* **Dev**: 20%

## Splits Prevent Overfitting

In the machine learning world, you can overtrain a computer vision model. This concept is similar to overstudying for, say, a test. For example, what if Jane uses flashcards to study? If Jane studies too much this way, she'll memorize the answers to the questions without understanding why these are the answers or how to arrive at those answers. Models can have similar results if you overtrain them. This concept is called **overfitting**. Here's how it works:

Suppose you have a model trained to detect cats. What if the cats in all the images used for training all have collars on?

<img src="https://mintcdn.com/landinglens/hjeGEKEYbDsj6EG_/images/cat-with-collar.jpg?fit=max&auto=format&n=hjeGEKEYbDsj6EG_&q=85&s=2677397105a689155f71fe02c0bb7764" alt="cat-with-collar" width="3181" height="4771" data-path="images/cat-with-collar.jpg" />

If you overtrain your model, the model may learn that an important feature of cats is their collars. In this case, if you deploy your model and show it images of wild cats, the model may not detect these cats because they aren't wearing collars.

Detecting whether your model is overfitting can be tricky, which is why LandingLens offers the solution of splitting your images into different sets during model training.

## Assign Splits

You can assign splits using a few different methods. The following table highlights some of the differences, which can help you pick the right method to use for your specific use case.

| Location/Method                                                       | Are the images already uploaded? | Can you apply splits to multiple images at once? | When to use?                                                                                                                                                                      |
| --------------------------------------------------------------------- | -------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Fast Training](./train-models)                                       | Yes                              | Yes                                              | You don't understand the concept of splits. LandingLens automatically assigns splits to labeled images during Fast Training.                                                      |
| [Image View](./splits#set-splits-in-image-view)                       | Yes                              | No                                               | You don't have many images.                                                                                                                                                       |
| [Build tab](./splits#set-splits-for-multiple-images-in-the-build-tab) | Yes                              | Yes                                              | You want to assign a specific split to multiple images.                                                                                                                           |
| [Upload Page](./splits#set-split-at-upload)                           | No                               | Yes                                              | You're uploading labeled images.<br /><br />If you're using {llsf}, setting splits at upload is not supported when [loading images](./load-images-from-snowflake) from Snowflake. |
| [Auto Split](./splits#auto-split)                                     | Yes                              | Yes                                              | You want to assign all unlabeled images to the three splits at the same time.                                                                                                     |
| [Custom Training](./custom-training#split-setup)                      | Yes                              | Yes                                              | You want to assign all unlabeled images to the three splits at the same time during Custom Training.                                                                              |

Learn more about how to assign splits in the following video tutorial.

<iframe width="560" height="315" src="https://www.youtube.com/embed/ibOWg987LaM?&wmode=opaque&rel=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />

### Set Splits in Image View

After you've uploaded images to your project, you can manually split images into different sets one at a time, when viewing an image. To do this:

1. Open the project.
2. Click the image you want to assign to a specific set.
3. Select the set you want to assign the image to from the **Split** drop-down menu.
   <img src="https://mintcdn.com/landinglens/PHcetUd-hiVs_otz/images/Split_0.png?fit=max&auto=format&n=PHcetUd-hiVs_otz&q=85&s=d6202a953b4e4777fc78019a6be5cb30" alt="Split_0" width="1440" height="691" data-path="images/Split_0.png" />
4. LandingLens automatically saves this change.

### Set Splits for Multiple Images in the Build Tab

After you've uploaded images to your project, you can manually assign multiple images into a specific set at once. You can repeat this process for each set. To do this:

1. Open the project.
2. Select the images you want to assign to a specific set.
3. Click **Options** in the action bar near the bottom of the screen and select **Set Split**. (You may need to scroll to see this option.)
   <img src="https://mintcdn.com/landinglens/PHcetUd-hiVs_otz/images/Split_1.png?fit=max&auto=format&n=PHcetUd-hiVs_otz&q=85&s=cc5667afad819d28d8546c078474e8ae" alt="Split_1" width="2006" height="1137" data-path="images/Split_1.png" />
4. Select the set you want to assign the images to.
5. Click **Apply**. The images are assigned to the selected set.
   <img src="https://mintcdn.com/landinglens/PHcetUd-hiVs_otz/images/Split_2.png?fit=max&auto=format&n=PHcetUd-hiVs_otz&q=85&s=2ba6797c78e9e719d562cbe0911b6d09" alt="Split_2" width="2009" height="1136" data-path="images/Split_2.png" />
6. To deselect the images, click **Deselect All**.

### Set Split at Upload

<Info>If you're using, setting splits at upload is not supported when [loading images from Snowflake stages](./load-images-from-snowflake).</Info>
If you're uploading labeled images, you can assign a split to all the images you want to upload. Splits can only be assigned to labeled (annotated) images, so splits can only be assigned at upload if the classes/labels are also assigned at upload, which happens in these situations:

* [You're uploading labeled images to Object Detection projects](./upload-labeled-images-od)
* [You're uploading labeled images to Segmentation projects](./upload-labeled-images-seg)
* [You're applying classes to images when uploading to Classification projects](./classification#upload-classified-images)
* [You're applying classes to images when uploading to Anomaly Detection projects](./anomaly-detection)

When you upload images in any of the scenarios listed above, you can select an option from the **Split** drop-down menu on the Upload window.

<img src="https://mintcdn.com/landinglens/nULG3l07sGmu7vxy/images/split_upload.png?fit=max&auto=format&n=nULG3l07sGmu7vxy&q=85&s=44e61154b004377906209a64ed99f092" alt="split_upload" width="2128" height="1476" data-path="images/split_upload.png" />

### Auto Split

You can automatically split images into all three sets at once by using the Auto Split tool. This tool allows you to select what percentage of images with each class to assign to each set. To do this:

1. Open the project.
2. Click the **Actions** button (ellipses) and select **Auto Split**.
   <img src="https://mintcdn.com/landinglens/Hf67pwuPapd1A0aT/images/AutoSplit_1.png?fit=max&auto=format&n=Hf67pwuPapd1A0aT&q=85&s=1bc7da1457e49a10e0f95f72130e9099" alt="AutoSplit_1" width="1893" height="655" data-path="images/AutoSplit_1.png" />
3. If you want to override sets already assigned to images, select this checkbox: **Include assigned train/dev/test media to reassigned**.
4. Review the **Classes** section. For Object Detection projects, this shows how many bounding boxes are used for each class. For Segmentation and Classification projects, this shows how many images have each class.
   <img src="https://mintcdn.com/landinglens/Hf67pwuPapd1A0aT/images/AutoSplit_2.png?fit=max&auto=format&n=Hf67pwuPapd1A0aT&q=85&s=cc3d342bee459dd93ea4b30dee041acf" alt="AutoSplit_2" width="1738" height="1093" data-path="images/AutoSplit_2.png" />
5. Click **Next**.
6. If you want to adjust the split percentage for all classes at the same, keep this checkbox selected: **Adjust value for all defect types together**. When this checkbox is selected, moving the slider for one class moves the slider for all classes.
7. Adjust the sliders to pick the percentages you want for each set.
   <img src="https://mintcdn.com/landinglens/Hf67pwuPapd1A0aT/images/AutoSplit_3.png?fit=max&auto=format&n=Hf67pwuPapd1A0aT&q=85&s=12a11a18564516dd05e8b38c3883f598" alt="AutoSplit_3" width="1685" height="1233" data-path="images/AutoSplit_3.png" />
8. Refer to the charts on the page to preview the split.
9. When you're done adjusting the split percentages, click **Assign Split**.
10. LandingLens shows you the charts to confirm the split. Click **Close**.
