PanelSimulator Academy

Video Surveillance, lesson 11 of 14

Video analytics

Software can now watch video and say "person", "vehicle" or "someone crossed this line". It never gets tired, and it is never completely right. This lesson shows what analytics can do, the two ways it goes wrong, and how to work out whether a feature will help a site or bury it in false alarms.

About 15 minutes. Read Resolution and pixels on target, and Video management software, first.

Set the sensitivity

The software has looked at this yard and given each thing a score: how sure it is that it is a person. Move the slider to choose the score that raises an alarm.

person, alarm raised person, missed not a person, alarm raised
of 4 people detected
people missed
false alarms

The everyday picture

Think of a smoke alarm in a kitchen. Make it very sensitive and it screams every time you make toast. After a week someone takes the battery out. Make it dull and it stays quiet for toast, and also for the first minutes of a real fire.

There is no setting that is right for both. You choose which mistake you can live with, then you move the alarm away from the toaster.

Video analytics is the same bargain. The slider above is the battery-out decision. Where you put the camera, and what you light, is moving the alarm away from the toaster.

What software can detect

Video analytics is software that examines the picture and reports what it finds. It may run in the camera, in the recorder or in the cloud.

KindWhat it reportsHow dependable, in general
Pixel motion"Part of the picture changed"Fires on rain, headlights, shadows, insects and picture noise. Fine for marking a timeline, poor for raising alarms.
Object detection"That shape is a person" or "a vehicle"The big step forward of recent years. Ignores most weather and light changes. Still fooled by odd poses, small targets and poor light.
Rules on objects"A person crossed this line", "entered this area", "stayed longer than a set time"As good as the detection underneath, plus how well the line or area is drawn
Counting and occupancyHow many people went in and outGood from directly overhead at a doorway. Drifts when people walk in groups.
License plate readingThe characters on a plateGood only with a camera set up for the job: narrow view, right angle, enough pixels, controlled exposure
Face matching"This face resembles one on a list"Depends heavily on angle, light and image size. Restricted or regulated by law in some places. See Privacy and the law.
Attribute search"Show people in red tops", "show white vans"Useful for narrowing a search after the event. Colors shift under different lights.

Modern detection is built by showing a program a very large number of labeled pictures until it learns the patterns. This is what the brochure calls smart detection. It has a consequence: the software is good at what it was shown. A person crawling, carrying a ladder, or seen from straight above may look nothing like its training pictures.

Two ways to be wrong

Every detector makes two kinds of mistake, and each has a trade name.

  • A false positive is an alarm with no real cause. Most people call it a false alarm.
  • A false negative is a real event with no alarm. Most people call it a miss.

For each thing it sees, the software produces a score, often called confidence. A setting, the threshold, decides what score counts. Lower the threshold and you catch more real events and more false ones. Raise it and both fall. The slider at the top shows this. No position gives four people and no false alarms, because a crouching person scores lower than a coat on a fence.

Which mistake is worse depends on the job. For an alarm sent to a guard at 3 a.m., false alarms are expensive and the threshold goes up. For a search after an incident, a miss is expensive and a few extra results cost nothing, so the threshold goes down.

Check yourself

You raise the confidence threshold on a person detector. What happens?

Why rare events drown in false alarms

Here is the idea that surprises people most. Suppose a yard is watched by 20 cameras. A real intruder appears perhaps once a month. The detector is good: each camera raises only one false alarm every two days.

Twenty cameras at half a false alarm a day is 10 false alarms a day, or about 300 in a month. Against those 300 stands 1 real event. So when an alarm arrives, the chance that it is real is about 1 in 300.

The detector did nothing wrong. Real events are simply so rare that even a small false alarm rate swamps them. A guard who has dismissed 299 alarms in a row will be slow on the 300th. This is why "99 percent accurate" on a brochure tells you little. Ask how many false alarms per camera per day, on scenes like yours, and do the multiplication.

Alarm load calculator

How many alarms, and how many are real?

Use false alarm figures from a trial on the real site. A brochure figure is a starting guess.

false alarms a day
alarms that are real
of checking each day

What analytics needs from the camera

Software cannot find what the picture does not hold. Most disappointing analytics are camera problems.

  • Enough pixels on the target. Resolution and pixels on target gave the idea. Each analytic has a minimum size for a person or a plate, stated in its data sheet. Below it, detection becomes guesswork.
  • Enough light, of the right kind. A grainy night picture produces both false alarms and misses. Add light or infrared before adding software.
  • The right angle. Line crossing works best when people cross the line sideways to the camera. Counting works best from overhead. Plates and faces need the camera nearly in line with the target.
  • A still camera and a clean lens. A camera shaking on a pole, or a spider web across the lens, looks like motion all night.
  • Rules drawn with care. Draw detection areas on the ground where feet will be. Leave out roads, swaying trees and the neighbor's driveway. Add a schedule so that the yard alarm sleeps during working hours.

Three examples

Simple: the flag

A car dealer's recorder sends a phone alert on any motion in the lot after hours. A flag and passing headlights trigger it forty times a night, and the owner turns alerts off. The installer changes the rule to "person or vehicle inside the lot area" and redraws the area to leave out the road. Alerts fall to one or two a night, mostly the night cleaner, and the owner turns them back on.

Medium: the plates that would not read

A gated community adds plate reading to an existing wide-angle camera at the entrance. It reads about one plate in three by day and almost none at night, when headlights wash out the picture.

Nothing is wrong with the software. A plate in that wide view is only a few dozen pixels across, and the camera exposes for the whole scene. A dedicated camera goes in: a narrow view of one lane, mounted to look almost straight at the plate, with infrared light and a fast shutter. Reading becomes dependable. The wide camera stays for the overview.

Advanced: the trial that saved the contract

A logistics yard wants its 40 fence cameras to alert a remote monitoring center to intruders. The vendor quotes high accuracy. The designer asks for a two-week trial on six cameras, with every alarm reviewed and labeled.

The trial shows 3 false alarms per camera per night, mostly from a rail line's lights and from deer. Across 40 cameras that would be 120 a night, far more than the center would accept. The team adds infrared lighting, trims the detection areas away from the rail line, sets a minimum object size, and requires a person to be inside the area for two seconds. A second trial gives about 0.2 per camera per night, or 8 a night across the site. The center agrees to take it, and the designer writes the measured rate into the handover record so that drift can be spotted later.

From the field

  • Walk test every rule. Cross the line yourself, slowly, quickly, crouching, and at night, and see what the system reports.
  • Count false alarms for two weeks before anyone relies on an alert. Weather and seasons change the number.
  • Fix the scene first. A light, a trimmed branch or a re-aimed camera does more than any setting.
  • Use analytics to point a person at video, and let the person decide. Software that acts alone on a mistaken match can do real harm.
  • Check where the analytic runs. In-camera features can load the camera's processor, and cloud features need upload bandwidth.
  • Re-test after any update or camera move. Both change the results.

Common mistakes

  • Believing an accuracy percentage without asking about false alarms per camera per day.
  • Turning on every feature on every camera on day one.
  • Expecting a wide overview camera to read plates or match faces.
  • Sending raw alerts to people until they learn to ignore them.
  • Treating a match from software as proof, with no person checking the video.

Summary

  • Analytics turns pictures into reports: motion, objects, rules, counts, plates, faces.
  • Every detector has false alarms and misses. The threshold trades one for the other.
  • When real events are rare, most alarms are false, however good the detector.
  • Good analytics starts with pixels, light and angle, then carefully drawn rules.
  • Trial on the real site, count the results, and keep a person in the decision.

Exercises

Answer each one yourself first, then open the answer.

Exercise 1. In the yard at the top, set the threshold to 50. How many people are detected, how many missed, and how many false alarms are there?

Show answer
Three of the four people are detected. The crouching person, who scores 45, is missed. There is one false alarm, the coat on the fence, which scores 55.

Exercise 2. A site has 12 cameras, each averaging 2 false alarms a day. How many false alarms arrive in a 30-day month? If there are 3 real events in that month, roughly what share of alarms are real?

Show answer
12 × 2 = 24 a day, and 24 × 30 = 720 in the month. With 3 real events there are 723 alarms, of which 3 are real: about 1 in 240, or under half of one percent.

Exercise 3. A person-detection rule works well by day and raises many false alarms at night. Name two things to try before touching the threshold.

Show answer
Any two of: add visible or infrared light so the night picture is clean; clean the lens and remove webs; redraw the area to leave out headlights and moving plants; require the object to stay in the area for a second or two; set a minimum object size; check that the camera is firmly mounted.

Exercise 4 (think, don't memorize). A school asks for software that will alert staff whenever a "suspicious person" is on the grounds. How do you answer?

Show answer
Software cannot judge "suspicious". It can report things that can be defined: a person in a set area at a set time, a person staying by a door longer than a set time, a vehicle in the bus lane. Help the school turn its worry into rules like those, for example "a person inside the fence between 10 p.m. and 5 a.m.". Then run a trial, count the false alarms, and make sure each alert goes to a person who looks at the video before acting. If the school asks about matching faces, that raises legal and privacy questions to settle with its lawyer first.