Class 7 · CBSE AI · Strand B — Python for AI

Using a pre-trained image model — transfer learning for Class 7

How a model trained on millions of images can be reused for your own task. Transfer learning, explained. For Class 7.

What this concept actually says

  • Transfer learning: a model trained on millions of images has learned general visual features that can be reused for your specific problem
  • You do not need to train from scratch — loading a pre-trained model and running inference requires only a few lines of code
  • Understanding the input format a model expects (image size, colour channels, normalisation) is essential to getting correct results

An analogy your child will recognise

Borrowing a trained dog from a breeder

A police dog trained by an expert handler already knows how to detect drugs. You can use that dog for your search without training it yourself — but the dog was trained for specific smells in specific contexts. If you take it to a new type of environment, its performance may surprise you. Pre-trained models are the same: powerful but context-dependent.

Using a national highway vs. building a new road

A pre-trained model is like the national highway network — someone else spent years and crores of rupees building it. You just drive on it. But if you need to reach a village not on the highway, you might need to add a small road at the end. That last stretch is fine-tuning.

Common misconceptions to watch for

  • A pre-trained model works equally well on all types of images — in reality, accuracy drops significantly when input images differ from the training distribution
  • Higher model accuracy on benchmarks means better performance for your specific task — benchmark accuracy is measured on specific test sets that may not represent your use case

Key facts in one breath

  • ImageNet is a dataset of 14 million images across 1,000 categories used to pre-train most famous image models
  • Transfer learning can achieve high accuracy on a new task with as few as a few hundred labelled examples, compared to millions needed for training from scratch
  • MobileNet is optimised for mobile devices; ResNet and VGG are larger and more accurate but computationally heavier
  • Models output a probability distribution across all classes — the top-1 prediction is just the highest probability, not a certainty

How Dhee Learning teaches this — the 3-stage question loop

Every Dhee Learning session for this concept follows three stages. We share the questions Dhee actually asks, so you can hear what a session sounds like.

Stage 1 — Surface

Training an image recognition model from scratch on your laptop might take weeks. But you can use a model that Google or Meta trained in a few lines of code. What is the catch — what might go wrong with using someone else's trained model?

Rote answer

"It might not be accurate for my images"

Understood

"The model was trained on specific data that may not represent my use case — a model trained on Western faces may perform poorly on Indian faces. I also do not know exactly what it was trained on, how biased it is, or whether I am allowed to use it commercially."

Stage 2 — Reasoning

A pre-trained model expects images of size 224x224 pixels. Your photos are 1080x1920. What do you need to do before feeding your photos in, and why does the model not just resize them automatically?

Follow-up Dhee may use: If you resize a tall portrait photo to a square, what happens to the image content? Does that matter for classification?

Stage 3 — Application

Load a pre-trained MobileNet or ResNet model in Colab. Feed it three photos of things around you. What did it predict, and where was it wrong? Why do you think it got those wrong?

Misconception Dhee watches for: Assuming a wrong prediction means the model is broken, rather than understanding that all models have a confidence distribution and fail on out-of-distribution inputs

Related concepts

Want your child to actually understand this?

Dhee turns this concept into a 15-minute spoken session — asking, listening, and probing — so your child builds the idea themselves.

Frequently asked questions

What is using a pre-trained image model — explained for kids? +

How a model trained on millions of images can be reused for your own task. Transfer learning, explained. For Class 7.

What's the most common mistake children make about this concept? +

A pre-trained model works equally well on all types of images — in reality, accuracy drops significantly when input images differ from the training distribution

How does Dhee Learning teach this in a Class 7 session? +

Dhee opens with a question — for example: "Training an image recognition model from scratch on your laptop might take weeks. But you can use a model that Google or Meta trained in a few lines of code. What is the catch — what might go wrong with using someone else's trained model?" — listens to your child's answer, then probes the reasoning behind it. The session ends when the child can apply the idea to a brand-new situation, not just recall it.