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.
Class 7 · CBSE AI · Strand B — Python for AI
How a model trained on millions of images can be reused for your own task. Transfer learning, explained. For Class 7.
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.
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
Dhee turns this concept into a 15-minute spoken session — asking, listening, and probing — so your child builds the idea themselves.
How a model trained on millions of images can be reused for your own task. Transfer learning, explained. For Class 7.
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
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.