Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 6

How AI Models Learn: Reducing Errors Through Labeled Examples

Recommended resources

Hello! Welcome to your sixth and final lesson in the "AI Fundamentals for Clinicians" module.

In our last lesson, we identified the three main "jobs" an AI can do with an image: classification, detection, and segmentation. We learned what these systems do. Today, we'll answer the more fundamental question: how do they learn to do it?

This lesson addresses the learning outcome: Explain how an AI model 'learns' by comparing its predictions to expert-labeled examples and adjusting itself to reduce errors. This is the heart of the "learning" in machine learning and is a crucial concept for you to grasp as a future clinical user of AI.

1. The Core Idea: Learning from a Supervisor

At its core, the most common way an AI model learns is similar to how you learn in dental school. You are presented with a case (e.g., a radiograph), you make a diagnosis (a prediction), and an instructor (an expert) tells you if you are correct. If you're wrong, you study the radiograph again, note the features you missed, and update your internal "rules" to do better next time.

In AI, this process is called supervised learning.

  • The "expert" is a set of data that has been carefully labeled by human specialists. This is called the ground truth.
  • The collection of these expert-labeled examples used for learning is called the training dataset.

This is formally defined in the ADA's white paper on AI in dentistry.

Overview of Artificial and Augmented Intelligence Uses in Dentistry

The American Dental Association's paper, "Overview of Artificial and Augmented Intelligence Uses in Dentistry," defines some key terms for us. Understanding these official definitions is important for reading professional literature.

In the PDF, find the section '2 Terms and Definitions.' Read the definitions for Training Dataset and Ground Truth. These two concepts form the foundation of the learning process.

To see this concept in action, let's watch a short video that introduces the idea using the teacher-student analogy.

Supervised Learning: Crash Course AI #2

This video from CrashCourse AI provides an excellent high-level explanation of supervised learning and introduces the idea of an AI making a guess and being corrected by a supervisor.

Watch from 01:37 to 02:52. Focus on the core relationship: the AI needs data, it makes a classification, and a 'supervisor' provides the correct answers to help it learn.


2. The Goal of Learning: Minimizing Error

So, the AI makes a prediction and compares it to the ground truth. What happens next? The difference between the AI's prediction and the correct answer is the error. The entire goal of the training process is to minimize this error over thousands of examples.

Let's introduce two important terms that formalize this idea:

  • Loss Function: A function that measures the error for a single example. If the AI's prediction is far from the ground truth, the loss is high. If it's close, the loss is low.
  • Cost Function: This is simply the average loss over the entire training dataset.

The model "learns" by trying to find the internal configuration that makes the value of the cost function as low as possible. This is the central principle of the training process.

A Non-technical Introduction to Machine Learning - NCBI

The paper 'A Non-technical Introduction to Machine Learning' from the NCBI explains this concept clearly without getting bogged down in complex mathematics. It will help you build the right mental model for the learning process.

Read the section titled '3.2. Overview of the Learning Process'. Focus on understanding the relationship between the model's prediction, the true output, the 'loss function' (measuring error on one example), and the 'cost function' (the average error). The goal of learning is to minimize this cost function.


3. How a Model "Adjusts Itself": A Simple Example

We've established that the model adjusts itself to reduce error, but what is it actually adjusting? Inside the model are thousands or millions of numerical values called weights and biases. You can think of these as tiny dials or knobs. The training process is an automated search for the perfect setting for all these knobs.

When the model makes a mistake, an algorithm calculates exactly how to turn each knob slightly to reduce the error for that specific example. When this is repeated over the entire training set, the model's weights are gradually nudged into a configuration that performs the task well.

The following video provides a brilliant and intuitive demonstration of this. It shows a simple AI (a "Perceptron") learning to distinguish between bagels and donuts based on their mass and diameter. Pay close attention to how the decision boundary (the line separating the two categories) moves each time the model makes a mistake. This is the "adjustment" in action.

Supervised Learning: Crash Course AI #2

Let's return to the CrashCourse AI video. This section provides a step-by-step walkthrough of a simple model learning from its mistakes. It makes the abstract idea of 'adjusting weights' very concrete.

Watch from 03:30 to 10:45. This is a longer segment, but it's the core of today's lesson. Focus on: How the initial guess is random. When the prediction is wrong, the 'no' button is pushed, and the weights are updated. How this update visually changes the decision boundary on the graph. When the guess is correct, nothing changes.


4. Scaling Up: How a Neural Network Learns

The bagel-and-donut example uses a single neuron. Modern AI systems, especially in image analysis, use vast neural networks with many layers of interconnected neurons. The learning principle is the same but applied on a much larger scale.

A fantastic way to visualize this is to think of the neural network as a team of students working together.

  • Each neuron in the first layer is a junior student responsible for a very simple task (e.g., detecting a tiny edge or curve).
  • Neurons in the next layer are more senior students who combine the findings of the junior students to spot more complex features (e.g., combining edges to spot the curve of a tooth root).
  • The final neuron is the "team leader" who makes the final diagnosis based on all the evidence gathered.

When the team leader gets the answer wrong, the feedback (the error) is passed backward through the team. This process is called backward error propagation. Each "student" (neuron) is told how their individual contribution led to the mistake, and they all adjust their approach slightly for the next time.

AI Basics for Beginners

The channel 'codebasics' offers a superb analogy to explain how a complex neural network learns. This will help you understand how the simple error-correction mechanism scales up to solve difficult problems like medical image analysis.

Watch the segment from 18:51 to 26:28. Follow the 'koala detection team' analogy. Pay special attention to what happens when the final student, Sergey, gets the answer wrong and the supervisor corrects him. This process of passing the error backward is the key to training deep neural networks.

This is precisely what the ADA paper refers to when it states, "Neural network training is a process of adjusting connection weights. Each input sample is tagged with a desired result and contributes to this training."

Test your understanding!

Imagine an AI is being trained to detect early-stage caries on bitewing radiographs. The training set consists of 10,000 images, each one meticulously labeled by a team of oral radiologists (this is the ground truth).

During training, the AI is shown a radiograph of tooth #30 that the radiologists labeled as "healthy." The AI, however, predicts "caries present" with a high score.

Based on what you've learned, describe in simple terms the three key steps that happen next in the training process.

Show answer
  1. Comparison and Error Calculation: The AI's prediction ("caries present") is compared to the ground truth label ("healthy"). Since they don't match, a high error value is calculated by the loss function.
  2. Backward Propagation: This error signal is propagated backward through the network. The algorithm calculates how much each individual weight and bias contributed to the wrong decision.
  3. Adjustment: The model's weights and biases are adjusted slightly in a direction that would make it less likely to classify that specific healthy tooth pattern as carious. This single adjustment is very small, but when repeated millions of times with different images, the model learns to distinguish healthy from carious tissues accurately.

Conclusion

This lesson completes our journey through the fundamentals of AI. We have now covered the "what" (classification, detection, segmentation) and the "how" (the process of learning from error).

Key Takeaways:

  • AI models typically learn through supervised learning, where they are trained on a large dataset of expert-labeled examples (ground truth).
  • The learning process is an iterative cycle: the model makes a prediction, compares it to the ground truth to calculate an error (loss), and adjusts its internal parameters (weights) to minimize future errors.
  • This adjustment is guided by algorithms that pass the error signal backward through the network, a process called backward error propagation.
  • The ultimate goal of training is to find the set of weights that minimizes the average error (cost function) across the entire training dataset.

You now have a solid conceptual foundation for understanding how AI works. In our next module, "Training AI for Dental Vision," we will start getting more specific. The very first lesson will address a critical starting point: how a digital dental image, like a radiograph, is represented as numerical data that an AI can process.