Training a Model
Training an AI model is a crucial step in the process of creating a functional AI system. During training, the model learns from the data you provide, identifying patterns and insights that allow it to make predictions or decisions. The quality of training directly affects the performance of the AI model, so it’s important to follow the correct steps for optimal results.
 
          Training Process
1. Set Parameters and Hyperparameters
Models typically come with adjustable settings, known as parameters and hyperparameters. Parameters are learned during training (such as the weights of a neural network), while hyperparameters are set before training and influence the model’s learning process (such as learning rate or the number of training epochs). Experiment with different hyperparameters to find the combination that gives the best results.
2. Start the Training Process
Once everything is set up, initiate the training process. The model will begin to learn by processing the data in batches. Depending on the model and dataset size, training may take time, so be patient and allow the model to go through multiple iterations (epochs) to refine its understanding.
3. Monitor Training
Keep track of the model’s performance throughout the training process. Use metrics like accuracy, loss, or other relevant measurements to assess how well the model is learning. If the performance plateaus or decreases, consider adjusting the model, the data, or the hyperparameters.
Teachable Machine Example
1. Choose Project Type
An example project of distinguishing between images of cats and dogs has been chosen because it is a simple and well-known example that demonstrates how machine learning models recognize visual patterns like shapes and features.
 
          2. Upload Training Data
To teach a model to tell the difference between cats and dogs, you need pictures of both. For example, you could use 100–200 pictures of cats and the same amount for dogs.
The more different types of pictures you have (like different breeds or lighting), the better the model will learn. Having an equal number of pictures for cats and dogs helps the model avoid favouring one over the other. Starting with a few hundred pictures for each should work well for a simple classifier.
 
          3. Train Model
Now it is time to train the model. The advanced settings are explained below.
- Epochs: The number of times the model looks at all the training data; more epochs mean the model gets more chances to learn.
- Batch Size: How many examples the model looks at once before learning from them; smaller batches help it learn more carefully.
- Learning Rate: How quickly the model changes as it learns; a smaller number makes it learn slowly and steadily, while a bigger number makes it learn faster but might get less accurate.
Click Train Model when ready.
 
          4. Test Model
After the model is trained, it can be tested to see how well it works.
In these examples, an image of a dog and an image of a cat were uploaded.
The model successfully identified each animal correctly.
 
           
          