B8 · Computational Thinking and the AI Project Cycle

Pattern Recognition

Pattern recognition means spotting similarities, repeats or trends in problems or data. Once a pattern is found, a solution that worked before can be reused, and predictions can be made about what will happen next.

6 min Beginner Jump to the activity

What you need: Nothing. This page starts from the beginning, with no programming and no formulas.

Definition

You notice the bus is always late on Mondays, your plant droops when you forget to water it for two days, and your little brother gets cranky just before lunch. You are already recognising patterns.

Pattern recognition means spotting similarities, repeats or trends in problems or data. Once a pattern is found, a solution that worked before can be reused, and predictions can be made about what will happen next.

In simple words

If you learn how to tie one shoelace, you can tie every shoelace, because they all work the same way. Spotting that "this is like something I have solved before" saves you from starting from zero every time.

Why it matters

Pattern recognition is the heart of machine learning. AI systems learn by finding patterns in thousands of examples: the shapes that make a cat, the words that signal spam, the symptoms that suggest an illness. Understanding patterns helps you understand what AI can and cannot do.

Key terms

Pattern
Something that repeats or stays similar across different cases.
Trend
A pattern of change over time, such as prices rising each year.
Generalisation
Using a pattern found in some cases to handle new cases.
Feature
A property that helps tell things apart, such as whiskers or pointed ears.
Coincidence
Something that looks like a pattern but happened by chance.
Prediction
A guess about the future or an unseen case, based on a pattern.

Explained in detail

Patterns in problems

Suppose you have to work out the total cost of items in three different shopping lists. Once you notice that each one is the same job, adding the prices of every item, you can use the same method for all three, and for any list in the future. Recognising that a new problem is like an old one is one of the most useful skills in maths, science and computing. It is why practice matters: the more problems you have seen, the more patterns you can recognise.

Patterns in data

DataPatternWhat it lets you do
Electricity use by hourPeaks every evening between 7 and 10Plan power supply
Monsoon rainfall over decadesArrives in Kerala around the start of JuneHelp farmers plan sowing
Shop salesSweets sell much more before DiwaliOrder stock in advance
EmailsSpam often contains "urgent", "prize" and strange linksFilter spam automatically

How AI finds patterns

Nobody tells a photo-recognition model the rules for a cat. Instead it is shown many thousands of labelled photos and finds, by itself, the features that tend to appear in cat photos and not in others: certain ear shapes, eye shapes, fur textures. This is pattern recognition on a massive scale. Then it generalises: given a new photo, it checks how well it matches the patterns it learned.

When patterns fool us

Humans and machines both see patterns that are not really there. A cricket fan wears the same shirt for three wins and decides it is lucky. A model trained on photos where every wolf stands on snow may learn "snow means wolf" and call a husky on snow a wolf. A pattern needs to be checked on enough new cases before it is trusted. Ask: could this be chance? Is there a real reason behind it? Does it hold for cases I have not seen yet?

Pattern recognition also works across very different problems. Sorting library books, arranging a cricket batting order and ranking exam results all follow the same idea: put items in order by some value. Once you see that they are the same kind of problem, a single method can solve all of them. Experienced problem-solvers keep a mental collection of such patterns.

How it works

  1. Look at several examples side by side.
  2. Ask what is the same and what is different.
  3. Describe the pattern in one sentence.
  4. Test it on a new example you have not used yet.
  5. If it holds, reuse it; if not, look again.

Try it yourself

The wolf that was really snow

A team trains a model to tell wolves from husky dogs.

Real pattern or coincidence?

Decide whether each is likely a real pattern.

  • Traffic is heavier at 9 a.m. on weekdays

  • Ice-cream sales rise every summer

  • A coin landed heads three times, so it must be a heads coin

  • My team won twice when I sat on the left of the sofa

Common mistakes

  • Trusting a pattern after only a few examples.
  • Mistaking a feature of the background for the real pattern.
  • Never testing a pattern on new cases.

Check yourself

Question 1

1. What is pattern recognition?

Question 2

2. Why did the wolf model fail on a husky in snow?

Question 3

3. How should you check whether a pattern is real?

Summary

  • Pattern recognition spots what is similar or repeating.
  • It lets us reuse solutions and make predictions; it is the core of machine learning.
  • Check patterns on new cases; some are coincidences or hidden shortcuts.

Finished reading?

Sources: BBC Bitesize: Introduction to computational thinking · Bebras Computational Thinking Challenge (India)