The Problem: Surveillance Without Consent
Traditional farm surveillance systems record all activity continuously — capturing every interaction between workers, owners, and visitors throughout the day. These systems store and transmit identifiable footage of staff without their meaningful consent, creating legal exposure and eroding trust between farm management and workforce.
The challenge is fundamental: how do you maintain security and situational awareness while protecting the privacy of the people who work and live on the farm? AgriShield is our answer to that question.
System Overview
The prototype runs on a Raspberry Pi 5 (8 GB) using a combination of OpenCV for video processing, MediaPipe for real-time face detection, and NumPy for pixel-level operations. The entire pipeline runs locally — no cloud uploads, no remote storage, no third-party data sharing.
This entirely local approach eliminates privacy risks associated with cloud transmission while also improving system reliability in rural areas where connectivity is intermittent or unavailable. A farm in rural Maryland with spotty LTE coverage gets the same protection as one with fiber broadband.
AgriShield processes every frame locally on a Raspberry Pi 5. No image data leaves the device. No identity is ever stored or transmitted.
Live Video & Face Detection
Each incoming frame goes through a preprocessing pipeline before face detection is applied. The pipeline includes bilateral filtering to reduce noise while preserving edge detail, a BGR-to-RGB conversion for MediaPipe compatibility, and optional upscaling for improved detection on lower-resolution streams.
MediaPipe's face detection outputs relative bounding boxes for each detected face. These are mapped back to the original frame resolution for accurate overlays and anonymization targeting.
Privacy-Preserving Face Obfuscation
The core innovation in AgriShield is the circular_blur function, which anonymizes detected faces through a seven-step process:
- Region expansion — slightly enlarging the bounding box to catch hair and ears
- Pixelation — reducing the face region to a low-resolution block
- Gaussian blur — softening the pixelated result
- Random jitter — adding noise to prevent reconstruction attacks
- Elliptical masking — applying anonymization only within a face-shaped region
- Feathered edges — blending the boundary naturally with the surrounding frame
- Merging — compositing the anonymized region back into the live frame
The result is real-time, face-shaped anonymization that runs smoothly on a Raspberry Pi — preserving context and situational awareness while making individual identity irrecoverable.
System Control & Visualization
The interface provides a live preview window so operators can verify the system is running correctly. Keyboard controls let an authorized user toggle privacy mode on and off (SPACE) or quit the application (Q). Color-coded bounding boxes give a visual indicator of detection confidence and estimated distance from the camera.
Critically, the preview itself only shows anonymized footage — even the operator monitoring the live feed cannot see individual faces.
Current Capabilities
The current prototype demonstrates several key properties that we believe are essential for any farm security system:
- Edge-capable detection at real-time frame rates on Raspberry Pi hardware
- High-quality anonymization with no visual artifacts in the surrounding scene
- Modular architecture allowing easy swapping of detection or obfuscation components
- Zero identity recognition or storage — the system cannot identify who it has seen
What's Next
The current version anonymizes all detected faces indiscriminately. The next development phase will explore selective privacy — allowing pre-enrolled authorized individuals to opt out of anonymization for access-control purposes, while maintaining full privacy for unrecognized persons.
We're also investigating event-driven storage (recording only when novel activity is detected), alert generation for unknown faces appearing in restricted zones, and a rigorous performance evaluation framework with formal GDPR compliance documentation.
AgriShield is part of AI SENSE's broader commitment to building technology that respects the people who use it. Security and privacy are not a trade-off — they're co-requirements.