Inspiration

If you live in an Indian city, you share your street with dogs. Some of them have a small V cut in one ear. That notch means a vet caught the dog, sterilised it, vaccinated it against rabies and brought it back to the same street. This is India's Animal Birth Control programme, and it is the legal way cities manage street dogs.

The programme only works if enough dogs are covered. Rabies control work uses 70% as the line to aim for. Cities publish how many dogs they sterilised, but nobody outside the programme checks how many dogs on a real street actually carry the notch. In Chandigarh, the city said it had sterilised about 20,000 dogs, while a census had counted 12,920 strays. Residents called the drive "only on paper".

We wanted a way for ordinary residents to check this for themselves, with a number strong enough that an official cannot wave it away.

What it does

NotchCount turns two morning walks down a street into a real count of the dogs that live there and the share that are sterilised.

Walk and photograph. On two mornings, a small team walks the same route and photographs every dog they see, side and head. The phone app works with no signal, keeps the photos in a queue and uploads them later. Faces and number plates are blurred before any photo is stored.

Match the dogs. The software finds each dog in the photos, recognises the same dog across the two walks, and checks the ear for the notch. When it is not sure, it asks a person. A review screen shows two dogs side by side and you tap "Same dog" or "Different".

Count with honest ranges. It counts the dogs seen on walk 1, the dogs seen on walk 2, and the dogs seen on both. That ratio gives an estimate of how many dogs use the route, the same method wildlife scientists use. It always says how sure it is, for example "About 60 dogs use this route (56 to 74)", and the same for the sterilised share, shown on a dial against the 70% line.

File the evidence. It writes a one page report with a public link and a PDF, and drafts an email to the official in charge. Nothing is sent until a logged-in team member reads it and presses Approve. Replies come back into the case file as plain text that no AI reads or acts on.

How we built it

Phone and web app: SvelteKit and TypeScript, built as an installable web app that works offline (IndexedDB queue, service worker). Maps use MapLibre with OpenFreeMap tiles. API: Python, FastAPI and SQLAlchemy on Postgres (Supabase) with PostGIS for routes and pgvector for dog fingerprints. A job queue in Postgres runs the heavy work. Vision pipeline: YOLO11s (ONNX) finds dogs, people and vehicles. People and plates are blurred, and the detector runs again on the blurred image as a check. DINOv2 turns each dog into a fingerprint for matching. OpenCV and scikit-learn handle crops, calibration and the ear model. The maths: a pure library with no I/O. It uses the Chapman estimate with Chao's interval, and draws 2000 possible matchings so the uncertainty in matching is carried into the final range. Every estimate stores the code version, settings and a hash of the data. Testing the method: on 1,000 simulated surveys per case, our 95% ranges held the true count 93% of the time with perfect matching and 92.3% with 5% wrong matches. On real photos of known dogs, the matcher told same dog from different dog with an AUC of 0.988. Real photos with a known answer went through the whole pipeline and came out exact. Sponsor tools: MojoAuth for sign-in by email code next to one-time invite links. Agentboxd for the case inbox: a draft-only key writes the email, the send key is used only when a person presses Approve, and replies arrive by signed webhook. Deployxa hosts the app from our Dockerfile, with Render as a backup on the same database. AI use: we wrote the spec, the design brief, the field protocol and chose the problem and the method. Claude Code wrote most of the code, tests and docs to that spec. Full details are in docs/AI_DISCLOSURE.md.

Challenges we ran into

Uncertain matches made our ranges too confident. When two brown dogs look alike, a wrong match changes the count. Our first sampler covered the truth only 86.6% of the time in that case. We rebuilt it so each dog from walk 2 picks one match or "not seen before", and coverage rose to 90.8%. We still list the gap in our limitations. Small free servers. The free hosting plans give 512 MB of memory. We run the vision models with one thread inside the web service, so photos are processed even when no laptop is on. Email replies that arrived empty. Agentboxd screens incoming mail first and sends the text in a later event. Our first version stored the first, empty event. We changed it to store each reply once, from the first event that has the text, and added a test. Privacy that holds up. Blurring once was not enough. If a person is still found after blurring, the photo is dropped completely. Deploying through an API. The documented REST paths for our host did not respond, so we used its MCP endpoint to create and deploy the project.

Accomplishments that we're proud of

A citizen audit that gives a range, not a guess, and says plainly where it can be wrong. The method is tested: in simulation, on real photos of known dogs, and end to end. Privacy is built in: blurring before storage, signed links that expire in 5 minutes, and a public report that never shows where an unsterilised dog lives. A human approves every email. No model reads the replies. Every screen was checked at phone and desktop width, with no sideways scrolling and no serious accessibility problems. It is live at https://notchcount.deployxa.online, with a landing page where anyone can walk a made up street twice and watch the same maths work.

What we learned

A number without a range is easy to dismiss. A range that is honest about its limits is much harder to argue with. Machine matching is fast but not perfect. The best results come from letting the software suggest and people decide the hard cases. Recognising the same dog in a new photo is much harder than in a copy of the same photo, so we test on real photos. Safety rules, like approval before sending and never storing an unblurred face, are easier to keep when they are part of the design from day one.

What's next for NotchCount

Walk our own route twice, label the matches and ears, and publish our street's report and the model's accuracy on our labels. A sampling plan so many routes can add up to a ward level number. Work with a sterilisation operator, so they can use the same audit to find streets they missed. Phone number sign-in for walkers without email, and more cities.

Built With

Share this project:

Updates

Submission history