Fully On-Device Edge-AI Intrusion Detection for Restricted Zones
A real-time wildlife protection and intrusion detection system using Arduino Nicla Vision with TensorFlow Lite for edge AI processing.
Who Goes There is an intelligent surveillance system designed to protect restricted forest zones and wildlife areas. The system uses computer vision and machine learning to detect human intrusions in real-time, sending alerts and capturing evidence while operating entirely on edge devices for maximum privacy and reliability.
- π€ Edge AI Processing: TensorFlow Lite model runs directly on Arduino Nicla Vision
- π‘ Real-time Monitoring: Continuous surveillance with WiFi connectivity
- π― Human Detection: Trained to distinguish between forest environment and human intrusions
- π Live Dashboard: Beautiful Streamlit web interface with forest-themed UI
- πΈ Evidence Capture: Automatic image capture and transmission when threats detected
- β‘ Low Power: Optimized for battery-powered remote deployment
- π Privacy-First: All processing happens on-device, no cloud dependencies
βββββββββββββββββββ WiFi βββββββββββββββββββ HTTP βββββββββββββββββββ
β Arduino Nicla β βββββββββββΊ β Flask Server β ββββββββββΊ β Streamlit Dashboard β
β Vision β β (server.py) β β (dashboard.py) β
β β β β β β
β β’ Camera β β β’ Image Storage β β β’ Live Monitoring β
β β’ TensorFlow β β β’ HTTP Endpoint β β β’ Threat Analysis β
β β’ WiFi Module β β β’ File Managementβ β β’ Statistics β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββ
WhoGoesThere/
βββ Nicla/ # Arduino Nicla Vision code
β βββ main.py # Main detection script
β βββ trained.tflite # TensorFlow Lite model
β βββ labels.txt # Model class labels
βββ received/ # Captured intrusion images
β βββ intruder_20260104_122347.jpg
β βββ intruder_20260104_122357.jpg
βββ dashboard.py # Streamlit monitoring dashboard
βββ server.py # Flask image receiver server
βββ dataset_capture_script.py # Training data collection
βββ README.md # This file
- Arduino Nicla Vision board
- Python 3.8+
- WiFi network
- PC/Server for dashboard
- Flash the Arduino Nicla Vision with OpenMV firmware
- Upload the contents of
Nicla/folder to the device - Mount the device in your surveillance location
Edit Nicla/main.py with your network details:
SSID = "YOUR_WIFI_SSID"
PASSWORD = "YOUR_WIFI_PASSWORD"
BACKEND_HOST = "<YOUR_PC_IP>" # Your computer's IP address# Install dependencies
pip install flask streamlit plotly pandas pillow
# Start the image receiver
python server.py# Start the monitoring dashboard
streamlit run dashboard.py- Power on your Nicla Vision device
- Access the dashboard at
http://localhost:8501 - Monitor real-time detections and threat levels
Modify detection parameters in Nicla/main.py:
TARGET_LABEL = "human" # Detection target
CONF_THRESHOLD = 0.80 # Confidence threshold (0.0-1.0)
SEND_INTERVAL_MS = 5000 # Minimum time between alerts (ms)Adjust camera parameters for your environment:
sensor.set_pixformat(sensor.RGB565) # Color format
sensor.set_framesize(sensor.QVGA) # Resolution (320x240)
sensor.set_windowing((240, 240)) # Crop to square- Threat Level Assessment: Dynamic risk evaluation based on detection frequency
- Live Statistics: Total detections, daily activity, surveillance duration
- Peak Activity Analysis: Hourly intrusion patterns and wildlife behavior insights
- Date-organized Gallery: Chronological view of all detections
- Image Analysis Modal: Detailed threat assessment for each detection
- Auto-refresh: Updates every 5 seconds for real-time monitoring
- System Health: Device connectivity and power status
- Network Status: WiFi connection and data transmission monitoring
- Battery Optimization: Power consumption tracking
The system uses a custom TensorFlow Lite model trained to distinguish between:
- Forest Environment: Natural forest scenes, wildlife, vegetation
- Human Intrusion: People entering restricted areas
- Format: TensorFlow Lite (.tflite)
- Input: 240x240 RGB images
- Output: Binary classification (forest/human)
- Optimization: Quantized for edge deployment
Use dataset_capture_script.py to collect training data:
- Deploy the script on your Nicla Vision
- Capture images in various lighting conditions
- Label images as "forest" or "human"
- Train using TensorFlow/Keras
- Convert to TensorFlow Lite format
- Edge Processing: All AI inference happens on-device
- Local Storage: Images stored locally, no cloud uploads
- Network Security: HTTP communication over local network only
- Data Retention: Configurable image retention policies
Optimized for remote deployment:
- Sleep Modes: Automatic power saving between detections
- Efficient Processing: Optimized inference pipeline
- Battery Monitoring: Low power alerts and status reporting
- Solar Compatible: Designed for solar panel integration
- Wildlife Conservation: Protect endangered species habitats
- Forest Management: Monitor restricted logging areas
- Research Stations: Secure remote scientific equipment
- Private Property: Perimeter security for remote locations
- Archaeological Sites: Protect historical locations
Device Not Connecting to WiFi
- Check SSID and password in
main.py - Ensure 2.4GHz network (5GHz not supported)
- Verify signal strength at deployment location
Images Not Appearing in Dashboard
- Confirm Flask server is running on port 8502
- Check firewall settings on host computer
- Verify IP address configuration
False Detections
- Adjust
CONF_THRESHOLDvalue - Retrain model with more diverse data
- Check camera positioning and lighting
Enable verbose logging in main.py:
DEBUG = True # Add at top of file- Prawin Kumar (SSN)
- Keerthi G (Nokia)
- Yashwanth A (Kalasalingam University)
- Bhargavi (Kalasalingam University)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Arduino Team: For the amazing Nicla Vision platform
- OpenMV: For the computer vision framework
- TensorFlow: For edge AI capabilities
- Streamlit: For the beautiful dashboard framework
For questions, issues, or contributions:
- Create an issue on GitHub
- Join our community discussions
- Check the troubleshooting guide above
π² Protecting Wildlife Since 2025 π²
Built with β€οΈ for forest conservation and wildlife protection