Image Classifier Settings Explained

January 30, 2024

Intro to model settings

Model Settings can be an intimidating or confusing step in the training process for those not well versed in machine learning, but are an important part of creating an accurate and efficient model. So we're here to break down what each setting means and how it all works together to make the best model for your use case.

There are a couple of considerations to balance when training models.

Tuning the model settings is an experimental process of trial and error. While there are defaults provided from our team, to create the best model for your use case you'll need to try at least a few combinations of different settings to tune the model.

Here's a brief overview of what each setting impacts your model and training.

  1. Model Backbone: Size of model backbone. Larger the number, the more complex the space can be learned but the longer it takes to train.
  2. Early Stopping Patience: How many epochs to wait after the loss flattens out before stopping
  1. Random Seed: This is a starting point for generation of pseudorandom numbers. Setting the seed ensures reproducibility in experiments.
  1. Number of Epochs: An epoch is one complete pass through the entire training dataset. The number of epochs defines how many times the model will see the entire dataset during training. Too few epochs may result in under-fitting, while too many may lead to overfitting.
  2. Batch Size: Batch size determines the number of training samples used in one iteration. It's a trade-off; larger batch sizes can provide computational efficiency but may require more memory. Smaller batch sizes, on the other hand, may provide more stable convergence but could be computationally inefficient.
  3. Number of Head Layers: This is a custom head on top of the base model. This is where a lot of the training takes place. More layers, means more complexity but also longer training.
  1. Head Layer Units: Similar to head layers. Treat it the same way.
  1. Validation Split: Split of data to be used for validation during training. 0.2-> 20 percent
  1. Optimizer: The optimizer determines the update rule for the model weights during training. Popular choices include stochastic gradient descent (SGD), Adam, RMSprop, and others. The choice of optimizer can impact training speed and model performance.
  1. Learning Rate: Learning rate controls the step size during the optimization process. It's a critical hyperparameter that influences how quickly the model learns. Setting an appropriate learning rate is essential for stable and efficient training

Learning from each run

At the end of each run you can you'll need to evaluate your model's outputs to understand where you need to focus your next run. Classification Models have multiple categorical outputs. Most error measures will calculate the total error in our model, but we cannot find individual instances of errors in our model. The model might misclassify some categories more than others, but we cannot see this using a standard accuracy measure. Furthermore, suppose there is a significant class imbalance in the given data. In that case, i.e., a class has more instances of data than the other classes, a model might predict the majority class for all cases and have a high accuracy score; when it is not predicting the minority classes. This is where confusion matrices are useful.

A confusion matrix presents a table layout of the different outcomes of the prediction and results of a classification problem and helps visualize its outcomes.

It plots a table of all the predicted and actual values of a classifier.

Confusion Matrix in Navigator

You can access the Confusion Matrix by opening up the model drawer and clicking on the model.

Open the Confusion Matrix from the AI Model Drawer

Based on your use case, you may be okay with a bias toward positive or negative identification. Focus your time on where your model is performing relative to your use case, not trying to optimize it to be perfect (unless you need or are into that.)

As you work through your model tuning, if you get stuck or want input reach out to us and the community on Discord.

Happy training!