1.3 Types of Machine Learning

Overview: Types of Machine Learning

Machine learning is a way for software to learn patterns from examples instead of following only rules a person wrote. Lesson 1.1 showed where machine learning sits inside the bigger idea of AI. This lesson shows the different ways it learns, the kinds of answers it gives, and why the learning happens before the product ever reaches your job site.

Lesson 1.3: Introduction

By the end of this lesson, you will be able to do the following.

  • Describe the main ways machine learning software learns, with a security example of each.
  • Tell what kind of answer an AI feature gives, such as a label, a number, a group, or an "unusual" score.
  • Explain why the AI is trained before it ships and what that means on the job.
Why it matters

Knowing how it learned tells you what it can do

How an AI feature was taught decides what it can recognize, what it will miss, and what you can and cannot change on site.

The request

A warehouse manager asks for the new cameras to "learn our forklifts" so they stop sending alerts about them.

The reality

The camera's AI was taught at the factory. It does not learn new objects on its own after you install it.

What helps

Knowing that, you can offer real options, such as a different detection zone, a schedule, or a product trained on forklifts.

Start here

What "learning from examples" means

Think about training a new employee to spot delivery drivers. You would not write a rule book. You would show them many examples until they could recognize a driver on their own.

Machine learning works the same way. Instead of a programmer writing "IF this, THEN that," the software is shown a very large number of examples and finds the pattern itself. Once it has learned, it can recognize new examples it has never seen before.

Written rule

"Alarm if more than 25 percent of the picture changes." A person chose that number. The software never learns anything.

Machine learning

The software is shown thousands of pictures marked "person" and "not a person" and works out for itself what a person looks like.

Who does the teaching. The manufacturer teaches the AI before the product ships. Installers choose the product, set it up for the site, and keep it working. You will see why that matters later in this lesson.
Try it

Five ways software can learn

Each way learns from a different kind of example. Select each card to see what it looks like on a camera and at a door.

1. Supervised learningLearns from examples a person labeled with the right answerSelect to see examples

People mark thousands of pictures as "person," "vehicle," or "animal," and the software learns to match new pictures to those labels. Nearly every camera analytic you install was built this way.

On a camera. Person and vehicle detection, and license plate reading.

At a door. Matching a face at the reader to a cardholder photo.

2. Unsupervised learningFinds groups and patterns with no labels at allSelect to see examples

Nobody tells it what to look for. It sorts the data into groups on its own, and a person decides later what each group means.

On a camera. Learning the usual paths people and cars take across a parking lot.

At a door. Noticing that badge-ins fall into a morning group, a day group, and a night group, without anyone typing in shift names.

3. Semi-supervised learningLearns from a few labeled examples plus many unlabeled onesSelect to see examples

Labeling is slow and costly. This method uses a small labeled set to steer what the software learns from a much larger unlabeled set. A manufacturer or software company does this on a computer, not on the camera.

On a camera. Adapting a general person detector to a warehouse by labeling a few thousand pictures of its forklifts and adding many hours of unlabeled video.

At a door. Marking a few hundred door alarms as real or nuisance, then adding months of unmarked alarms so the software can sort future ones.

4. Self-supervised learningMakes up its own practice questions from unlabeled dataSelect to see examples

For example, it hides part of a picture and tries to fill it in. No person labels anything at that stage. Large AI models are often taught this way first, then finished with a smaller labeled set for a security job.

On a camera. A model first practices on huge amounts of unlabeled video, then is finished with labeled pictures to become a person detector.

At a door. Software that studies long runs of door events and tries to predict the next one, so an odd sequence stands out.

5. Reinforcement learningLearns by trial and error, with rewards and penaltiesSelect to see examples

It takes an action, gets a reward or a penalty, and adjusts. It needs something that can act, such as a robot that moves. A fixed camera only watches, so this is rare in video analytics.

On a camera. A patrol robot with a camera learns an efficient route, rewarded for covering ground and penalized for bumping into things.

At a door. Unlikely. Nobody wants software learning by trial and error on a real door.

What to ask the manufacturer. "Which of these methods built the model, and does anything keep learning after I install it?" On most products the answer is that it was trained before shipping and does not change until a firmware update.
What it tells you

Four kinds of answers an AI feature can give

The kind of answer a feature gives limits what it can tell your customer. Learn to spot which one a product offers.

A label

Picks one name from a fixed list. The technical name is classification.

Example"Person," "vehicle," or "animal" on a parking lot camera.

A number

Estimates an amount on a scale. The technical name is regression.

Example42 visitors through a hospital entrance in the last hour.

A group

Sorts things into groups it found on its own. The technical name is clustering.

ExampleApartment residents who badge in mostly at night versus mostly in the morning.

An "unusual" score

Rates how different something is from normal. The technical name is anomaly detection.

ExampleA badge used at a warehouse door at 3 a.m. for the first time.
On the job. If a customer with person detection asks "can it tell me how many people are in the lobby?", that is a number, not a label. They need a counting feature, which is a different product or license.
Watch out

"Unusual" depends on what it saw first

Anomaly detection learns what normal looks like by watching a site for a set time, often two to four weeks. That time is called the baseline. Whatever happens during the baseline becomes normal.

The baseline

During two weeks of learning at a warehouse, a contractor props the loading dock door open every day.

Three months later

A stranger props the same door at 2 a.m. The system stays quiet, because propping that door is "normal" to it.

How to prevent it

Write down the baseline dates and what normal looks like, and start a new baseline when staffing, schedules, or construction change.

Keep in mind. "Unusual" does not always mean "a problem." A fire exit opened once a week may be normal. Opened five times in an hour is unusual. Whether that matters depends on the site.
The big idea

Trained at the factory, run on your job site

This is the most important idea in this lesson. The learning, called training, happens before the product ships. What happens on your job site is the finished AI running on live video, called inference.

Training
Where and whenAt the manufacturer, before the product ships, using powerful computers for days or weeks.
What it producesA finished file, called the model, that is loaded into the camera or software. You will never do this step.
Inference
Where and whenOn your job site, all day, many times per second on every camera.
What you controlWhich features are on, the zones and schedules, how sure it must be before alerting, and the camera's view and lighting.

The manufacturer

Collects and labels the examples, trains the model, tests it, and sends updates through firmware.

The installer

Picks the right product, mounts and aims the camera, sets it up for the site, tests it, and rechecks it after updates or site changes.

Watch (optional)How Machine Learning Works, End to End

A full hour on how machine learning is trained, from data and labels to neural networks. You do not need to watch it all. The most useful parts for this lesson are data, features, and labels (8:40), training and inference (13:37), and supervised versus unsupervised learning (32:48). The video mentions hands-on labs that involve code. You can skip those.

On the job

Five field rules that follow from this

Select each rule to see what it means and what to do.

1. You are almost never training the AI

What it means. When someone says a camera "learns your site," it usually means it is adjusting background settings or alert levels, not learning new objects.

What to do. Ask the manufacturer, "What exactly changes after installation?"

2. A firmware update can change the AI

What it means. An update can include a new model. Detection can change even if you never touched a setting.

What to do. Write down the firmware version and your settings at setup, and test again after every update.

3. Settings cannot fix what the AI never learned

What it means. If the model was mostly trained on clear, dry scenes, lowering the alert level will not teach it to see people in a heavy summer downpour. It will mostly add false alerts.

What to do. Your real options are to re-aim the camera, add lighting, adjust zones or schedules, or choose a product trained for those conditions.

4. Same picture, same answer, so check the scene first

What it means. The AI gives the same answer every time it sees the same picture. When results change, something in the scene usually changed.

What to do. Look for new lighting, a dirty dome, moved equipment, plant growth, or a camera that shifted before blaming the software.

5. Too many features slow them all down

What it means. Each camera has a fixed amount of processing power for AI. If it is rated for two analytics at once and you turn on six, all six get worse.

What to do. Check the datasheet for how many analytics can run at once, turn on only what the customer needs, and write it down.

Scenario

What to tell the customer

A hotel general manager is reviewing a new camera system with you.

Hotel general manager"Will the cameras learn our property over time and get better at spotting problems?"
You"The AI in these cameras was trained by the manufacturer before it shipped. It recognizes people and vehicles very well, but it does not keep learning on its own. What we can do is set it up for your property, with the right zones and schedules, and check it again after updates or changes like new lighting. If you want alerts for unusual activity, that feature learns what normal looks like during a set period, and we will document that period with you."
It explains what the AI really does.
It avoids promising it will improve.
It shows what you will do to keep it working.
Go deeper (optional)How a camera AI looks at a picture

Most camera AI uses a design called a convolutional neural network, or CNN. You do not need the math, but the idea helps explain why camera placement matters.

A small window slides across the picture

The CNN checks a tiny patch of the picture at a time, like a stencil slid across a photo, asking "is this pattern here?"

Simple shapes build into objects

Early layers find edges. Later layers combine edges into shapes such as shoulders, legs, or wheels. The last layers decide "person" or "vehicle."

Size on screen matters

The model learned from people of a certain size on screen. A person who appears too small has too few pixels for those shapes to show up.

Because the same small window is reused across the whole picture, a CNN is small enough to run on a chip inside the camera, and it can find a person anywhere in the frame. How many pixels a person covers, called pixels on target, is covered in detail in Lesson 2.2.

Go deeper (optional)Words you may see on a spec sheet

These terms show up in manufacturer documents and sales conversations. Select each one for a plain explanation and the question it helps you ask.

Model

The finished AI file that ships in the camera or software. A "new model" in a firmware update can change how detection behaves.

Weights

The numbers inside the model that were set during training. They are the model's "experience." You cannot change them on site.

Dataset

The collection of examples used to teach and test the model. Ask. "What kinds of scenes, lighting, weather, and camera heights were in the training examples?"

Labeling

People marking the right answer on each example, such as drawing a box around a person. Mistakes or gaps in labeling teach the model the wrong thing.

Overfitting

When a model memorized its training examples instead of learning the general pattern. It looks great on familiar video and struggles on anything new. This is one reason a demo can look better than your install.

Validation and test results

Validation data is used while the model is being built. Test data is held back until the end for a fair check. Ask. "Did your accuracy number come from a held-back test set?"

Generalization

How well a model works on video it has never seen, such as your customer's site. This is what matters in the field.

Confidence score

A number, often from 0 to 1, that shows how sure the model is. A score of 0.90 does not mean it is right 90 percent of the time. Treat it as a setting you test on site.

Summary

Lesson summary

  1. Machine learning finds patterns from examples instead of following only written rules.
  2. There are five main ways it learns. Supervised learning, from labeled examples, builds nearly every camera analytic.
  3. AI features give one of four kinds of answers, a label, a number, a group, or an "unusual" score. Match the feature to what the customer wants to know.
  4. Anomaly detection treats whatever happened during its baseline as normal, so document and refresh the baseline.
  5. The AI is trained at the factory and only runs on site. Settings cannot teach it something new, but firmware updates can change it.
Key terms for Lesson 1.3
Supervised learning

Learning from examples a person labeled with the right answer. Used for most camera analytics.

Unsupervised learning

Finding groups or patterns in data that has no labels.

Semi-supervised learning

Learning from a small labeled set plus a large unlabeled set.

Self-supervised learning

Learning from practice questions the software makes from unlabeled data.

Reinforcement learning

Learning by trial and error, with rewards and penalties.

Classification

An answer that is a label from a fixed list, such as person or vehicle.

Regression

An answer that is a number on a scale, such as a count.

Clustering

Sorting things into groups the software found on its own.

Anomaly detection

Scoring how different something is from what was normal during the baseline.

Baseline

The learning period when anomaly detection decides what normal looks like.

Training

Teaching the model with examples. Done by the manufacturer before the product ships.

Inference

The finished model running on live video or door events at the job site.

Model

The finished AI file that ships in the product.

Firmware

The software inside a camera or device. An update can include a new model.

References
  1. Duong, H.-T., Le, V.-T., & Hoang, V. T. (2023). Deep learning-based anomaly detection in video surveillance: A survey. Sensors, 23(11), 5024.
  2. Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep learning. MIT Press.
  3. LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436-444.
  4. Russell, S., & Norvig, P. (2021). Artificial intelligence: A modern approach (4th ed.). Pearson.

Explore & Complete

Complete the Knowledge Check below. Navigate through each slide and answer every question. You have unlimited attempts to answer each question correctly.

Next Steps

After you have earned a perfect score on the Explore & Complete activity, click the Mark Complete button to complete this lesson. You can then move to the next lesson.