Inspiration

Human-elephant conflict is a serious issue in forest-border villages and farming areas, where sudden elephant movement can cause crop damage, property loss, and danger to both people and wildlife. We wanted to build a practical early-warning system that can detect elephants in real time and alert nearby users before the situation becomes critical.

What it does

ElephantWatch is a real-time elephant detection and alert system using a Raspberry Pi 4, camera module, YOLOv8 object detection model, and a React Native/Expo mobile application. The Raspberry Pi captures live video, processes each frame locally using the trained model, and detects the presence of elephants without depending on cloud processing. When an elephant is detected, the system sends live video frames and alert data to the mobile app through WebSocket communication. The app displays the live feed and triggers visual, audio, and haptic warnings with detection confidence, elephant count, timestamp, and alert details.

How we built it

We trained a custom YOLOv8 model using elephant images along with negative samples such as animals, people, vehicles, farms, roads, and natural backgrounds to reduce false detections. The Raspberry Pi backend was developed in Python using OpenCV, Ultralytics YOLO, and WebSocket streaming. The backend sends camera frames as binary JPEG data and sends detection alerts as JSON messages to the mobile application. The frontend was built using React Native and Expo, allowing users to connect to the Raspberry Pi IP, view the live camera stream, receive alerts, and monitor detection history.

Challenges we faced

One major challenge was improving detection accuracy because early models sometimes confused random objects with elephants. We addressed this by adding negative samples, increasing confidence thresholds, using consecutive-frame confirmation, and validating bounding-box area before triggering alerts. Another challenge was setting up the Raspberry Pi environment correctly, especially handling camera compatibility, OS setup, and real-time performance limitations on edge hardware. We also had to carefully design the WebSocket communication so that video frames and alert messages could travel through the same connection without breaking the mobile app.

What we learned

Through this project, we learned how to combine computer vision, embedded systems, real-time communication, and mobile development into one working solution. We understood the importance of edge computing for remote areas where internet connectivity may be limited. We also learned how model accuracy depends not only on training images but also on negative data, filtering logic, and practical field testing.

Accomplishments

We successfully built a low-cost and portable prototype that can detect elephants locally on a Raspberry Pi and instantly alert users through a mobile app. The system demonstrates live video streaming, YOLO-based detection, confidence scoring, elephant count reporting, alert history, threat monitoring, and configurable Raspberry Pi connectivity.

What’s next

In the future, ElephantWatch can be improved with solar-powered deployment, multiple camera nodes, GPS-based alert mapping, SMS alerts for areas without internet, better night vision support, and integration with forest department monitoring systems. With further testing and deployment, this system can become a useful early-warning tool for wildlife safety and human-elephant conflict reduction.

Built With

Share this project:

Updates