Neural network training and evaluation in the GUI#

DLC LIVE!

Network training#

Creating a training dataset#

Before training your model, the first step is to assemble your training dataset. This involves:

  • Splitting labeled data into training and evaluation subsets

  • Creating each shuffle folder with the model configuration ready for training.

Create Training Dataset: Move to the corresponding tab and click Create Training Dataset. For starters, the default settings will do just fine. While there are more powerful models and data augmentations you might want to consider, you can trust that for most projects the defaults are a good place to start.

Note

This guide assumes you have a (CUDA-enabled) GPU on your local machine. If you’re CPU-bound and training is not feasible, consider using Google Colab. Our Colab Guide can help you get started!

Starting the training process#

With your training dataset ready, it’s time to train your model.

  • Navigate to Train Network: Head over to the Train Network tab.

  • Set Training Parameters: Here, you’ll specify:

    • Display iterations/epochs: To specify how often the training progress will be visually updated. Note that our TensorFlow models are “iterations” while PyTorch is epochs.

    • Maximum Iterations/epochs: Decide how many iterations to run. For TensorFlow models for a quick demo, 10K is great. For PyTorch models, 200 epochs is fine!

    • Number of Snapshots to keep: Choose how many snapshots of the model you want to keep, Save iterations: and at what iteration intervals they should be saved.

  • Launch Training: Click on Train Network to begin.

You can keep an eye on the training progress via your terminal window. This will give you a real-time update on how your model is learning (added bonus of the PyTorch model is it also shows you evaluation metrics after each epoch!).

DeepLabCut Training in Terminal with TF

Network evaluation#

After training, it’s time to see how well your model performs.

Step-by-step#

  1. Find and click on the Evaluate Network tab.

  2. Choose Evaluation Options:

    • Plot Predictions: Select this to visualize the model’s predictions, similar to standard DeepLabCut (DLC) evaluations.

    • Compare Bodyparts: Opt to compare all the bodyparts for a comprehensive evaluation.

  3. Click the Evaluate Network button, located on the right side of the main window.

Tip

If you wish to evaluate all saved snapshots, go to the configuration file and change the snapshotindex parameter to all.

Interpreting the results#

  • Performance Metrics: DLC will assess the latest snapshot of your model, generating a .CSV file with performance metrics. This file is stored in the evaluation-results (for TensorFlow models) or the evaluation-results-pytorch (for PyTorch models) folder within your project.

Combined Evaluation Results in DeepLabCut

  • Visual Feedback: Additionally, DLC creates subfolders containing your frames overlaid with both the labeled bodyparts and the model’s predictions, allowing you to visually gauge the network’s performance.

Evaluation Example in DeepLabCut

Next steps#

Head over the Video analysis in the GUI section to learn about applying your trained model to videos, and creating labeled videos with the results of your analysis!