Inspiration
Package theft is one of those problems everyone has seen but no one has solved. A delivery notification arrives, you check the camera later, and the box is already gone. The footage is there — it just never helped. Porch cameras are extraordinary recorders and terrible defenders. We kept coming back to the same gap: a camera can show you what happened, but it cannot understand that a delivery just became something worth protecting. That gap became our project: what if the camera knew a package had arrived, and knew to guard it?
What it does
PorchPiracyAI turns a passive Ring camera into an active protector. A delivery — real, simulated, or manual — activates protection mode. The vision pipeline detects and tracks people and packages, then converts raw tracks into meaningful events like PERSON_NEAR_PACKAGE, LOITERING_DETECTED, and PACKAGE_REMOVED. A deterministic threat engine and protection state machine evaluate those events over time, never a single frame. When the rules fire, the system creates one deduplicated incident with severity, reason codes, and the event IDs behind it, saves a face-blurred evidence clip, notifies the homeowner, and triggers a clearly labeled simulated Alexa deterrent. An optional local LLM explains the incident in plain language — but never makes a decision.
How we built it
We built a modular monolith in Python: FastAPI for the backend, Streamlit for the dashboard, OpenCV and Ultralytics YOLO for vision, ByteTrack via supervision for tracking, SQLModel with SQLite for storage, and Pydantic v2 at every boundary. The protection state machine and threat rules are pure functions — no I/O, no clock reads, no database — so every branch is unit-testable and replayable. The Ring integration sits behind a RingIntegration adapter with local and real modes, so the rest of the app never depends on an SDK we cannot yet test. We worked mock-first: every endpoint ran against samples/mock_events.json before the vision pipeline was finished, which let four people build in parallel from hour one.
Challenges we ran into
The hardest problem was not detection — it was false positives. A package disappearing is not proof of theft; occlusion, camera angle, and a courier picking a box back up all look identical in a single frame. We solved that with event sequences and time windows: a bare disappearance yields monitoring, and only a person association or prior package movement escalates it. COCO also has no "package" class, so we paired person detection with a dedicated package model path and a COCO-proxy fallback to keep the pipeline working end to end. Finally, privacy forced discipline: no uploads, face blurring in exported evidence, no face recognition, and simulated features labeled "Simulated" in the data model itself, not just the UI.
Accomplishments that we're proud of
We built a complete, auditable workflow on real video — detection, tracking, classification, rules, incident, evidence, notification, response — not a mockup. Every incident can be explained with reason codes and event IDs, which we consider non-negotiable for a security product. We kept the decision core pure and tested, kept heavy ML dependencies lazily imported so the API and test suite run on a clean machine, and shipped a UI that is honest about what is real versus simulated. The full demo works end to end from a single command.
What we learned
We learned that the interesting part of AI security is not the model — it is the reasoning around it. Models observe; deterministic rules decide. That separation made the system explainable, testable, and defensible under scrutiny. We also learned that privacy is an architecture decision, not a disclaimer: local processing, face blurring, and labeled simulation are baked into the data model. And we learned the value of mock-first contracts — they kept a four-person team unblocked and made the demo resilient when one piece was still in progress.
What's next for PorchPiracy-AI
Next is real time: live stream processing and live Ring event ingestion instead of prerecorded video. After that, authorized delivery-event integration, real push and SMS notifications, and support for multiple packages and multiple cameras. We also want a broader package model to improve detection quality across camera angles, and eventually real device actions where the Ring ecosystem exposes them. The long-term goal is unchanged: not another camera that records what happened, but a porch that recognizes what is happening and responds.
Built With
- database
- machine-learning
- python
- ring
- streamlit
Log in or sign up for Devpost to join the conversation.