Tag Archives: AI

AI-Powered Motion Detection

In our macOS CCTV software SecuritySpy, deciding whether to trigger recording and actions (e.g. notifications) is a two-step process. Firstly, a motion-detection algorithm determines whether there is some interesting movement happening. Next, the image is cropped to the area of movement and passed to a neural-network classifier to determine whether there is an object of interest present, like a human, vehicle or animal.

The classifier in SecuritySpy is based on a ResNet-50 neural network, custom-trained on over 100,000 real CCTV images from thousands of different cameras. It is a highly optimised, powerful network, producing very accurate results (around 97% for humans and vehicles).

In contrast, until now, the motion detection algorithm has been fairly simple. It has worked via pixel-based comparisons between successive video frames, with some additional filtering to help ignore extraneous movement caused by noise, transient motion and lighting changes.

This standard motion detection is fast and very effective in controlled environments that don’t suffer from a lot of extraneous motion. However, it is less effective in more challenging outdoor environments, where movement caused by shadows, swaying plants, snow, rain and so on can cause a high number of false-positive detections. In such situations, it maintains high sensitivity (ability to detect true motion when it occurs), but suffers from poor specificity (ability to accurately ignore extraneous movement).

SecuritySpy’s classifier is able to filter out virtually all these false-positives, however even if only 3% of false-positive detections get through the classifier, in particularly challenging situations where the motion detector is generating large numbers of false-positives, inevitably there will still be a significant number getting through and causing triggers.

Standard Motion Detection Pipeline

Standard motion detection pipeline: with False Positives (FP) greatly outnumbering True Positives (TP), even though the classifier is very accurate, a significant number still get through and cause triggers

Continue reading

Optimising SecuritySpy’s AI Object Detection

The new AI-powered motion detection features in SecuritySpy version 5 use deep neural networks to detect the presence of humans and vehicles. This allows for highly-accurate triggering of recordings and notifications of just the events that you are interested in.

The AI algorithms output a prediction probability, indicating the likelihood for the presence of a human or vehicle, and you can choose the threshold at which this triggers recording and notifications. Generally, a threshold of 50% gives good results.

However, the accuracy of the AI depends on many factors such as the distance to the subject, lighting, resolution and quality of the camera. You might find that the threshold you have chosen is letting through too many false-positive triggers, or conversely is preventing real motion from generating a trigger.

To see how the AI is performing on your system, create a folder called “AI Predictions” in the SecuritySpy folder within your Home folder (to get to the Home folder, click the Go menu in the Finder and select Home). Then, whenever a video frame is passed through the AI, SecuritySpy will annotate the frame with the motion area and prediction probabilities, and will save it to this folder as an image file. Inspecting these images allows you to determine what the AI is “seeing”, and will therefore allow you to adjust your trigger thresholds for optimum results on your system.

Here are some examples of these annotated images (cropped to just the relevant area):

annotated1 Continue reading