01
Frames can be edited
Our threat model puts the attacker between the camera and the CNN, changing frames after capture.
AI SECURITY · IEEE SOUTHEASTCON 2025
GNAP is an attack that chains two ordinary image filters to cut a face detector's confidence, and GNAG is a sharpening filter that brings it back. Ryan Taylor Thornton and I built both to run live on a Raspberry Pi 5, for a paper at IEEE SoutheastCon 2025.

THE GAP
Face detection now runs on small devices, from phone security to smart-city cameras. Those devices have little compute and thin security, so an attacker who gets between the camera and the model, through a communication channel or a firmware bug, can change frames before the detector sees them.
The standard defense, adversarial training, means retraining the model on attacked examples. That is costly, and a poor fit for a board that has to keep up with live video.
01
Our threat model puts the attacker between the camera and the CNN, changing frames after capture.
02
Random noise is easy to spot. Noise built from the image's own edges is harder to catch.
03
Adversarial training retrains the model, and that cost is hard to carry on an edge device.
WHAT IT DOES
GNAP, the Guided-inspired Noise Attack Pyramid, starts from a CiPer-style Laplacian-of-Gaussian attack and passes the result through a three-level Laplacian pyramid, which spreads the noise across scales. GNAG, the Guided Noise Attack Guard, runs an unsharp mask on each frame before the detector sees it, so the model itself never changes. Both are plain OpenCV code. It is for anyone putting face detection on small devices who wants a cheap way to test and defend it. Ryan Taylor Thornton and I contributed equally, with Syed Rafay Hasan and Uvais Qidwai.
The attack never looks inside the detector. It is a fixed chain of filters applied to each frame.
Attack and defense both ran on a live 1080p webcam feed on a Raspberry Pi 5.
GNAG's sharpening strength tracks the attack's noise scale roughly linearly. At a noise scale of 0.7, it needs about 14.
100 random LFW images for still frames, and a real-time run on live video.
HOW IT WORKS
The attacker grabs a frame between the camera and the CNN.
A guided filter smooths the frame; what it removes is the image's own detail.
A Laplacian of Gaussian on the smoothed frame picks out edges and landmarks.
The combined noise, scaled by 0.7, is subtracted from the original frame.
A three-level Laplacian pyramid rebuilds the frame, spreading the noise across scales.
GNAG sharpens the frame with an unsharp mask before the detector runs.
SYSTEM DESIGN
The attack and the defense are pre-processing steps on the path from camera to CNN, and neither touches the detector's weights. The test rig was a Raspberry Pi 5 with a 1080p webcam, running a pre-trained Caffe face detector through OpenCV.
Input
1080p webcam
Live frames, or LFW still images
Attack (GNAP)
Guided + LoG filter
Edge-shaped noise, subtracted at 0.7
Laplacian pyramid
Three levels, noise across scales
Defense (GNAG)
Unsharp mask
Strength about 14 at noise 0.7
Detector
Caffe face detector
Pre-trained CNN via OpenCV DNN
Raspberry Pi 5
The edge device under test
Output
Confidence and FPS
Logged per image or frame
RESULTS
0.99 → 0.82
mean highest confidence on 100 random LFW images, clean and then under GNAP
0.98
after the GNAG defense, close to the clean 0.99
≈2.83 FPS
mean live frame rate on the Raspberry Pi 5 across the attack runs, and 2.76 with GNAG on
Alone, the LoG filter left confidence at 0.97 and the pyramid at 0.99; only chained together did they pull it down to 0.82.
WHAT IT TAUGHT ME
What stayed with me is that neither filter did much alone. LoG and the pyramid each left the detector almost untouched, but chained together they cut confidence by 18% on average (p < 0.05). The defense has limits I want to be upfront about. We tuned the sharpening strength by hand against a known noise scale, and we tested one pre-trained detector, on 100 LFW images and a live feed. It shows the problem is real on cheap hardware. It is not a general defense.
BUILT WITH
Like what you see?
Thanks for reading. There's more where this came from.