How We Detect Human Waste Reports
Boston's 311 system has no category for human waste. Reports get filed under "Requests for Street Cleaning" alongside litter, leaves, and oil spills. We built an NLP classifier to find them.
The Problem: No Category, No Routing, No Response
Boston's 311 system has no category for human waste. When a resident reports feces on a sidewalk, the app offers no matching option. Most people select "Requests for Street Cleaning" — the closest available choice — but reports also end up scattered across other ticket types with no consistent routing. The majority land in the street cleaning queue alongside fallen leaves, litter, and oil spills.
This creates a cascade of failures:
- Misrouted on intake — the ticket goes to street sweeping crews, not a biohazard or public health team. Street sweeping is not equipped to handle human waste safely.
- Closed without resolution — the receiving department has no option to reroute the ticket, so it gets closed with notes like "bpw does not service human waste" (BPW = Boston Public Works, the department that handles street cleaning). The ticket is marked resolved in the system, but nothing was actually cleaned up.
- Invisible to the city — because there's no dedicated category, the city has no count of how many human waste reports it receives, no way to track response times for this specific issue, and no data to allocate resources. The problem doesn't exist in their dashboards.
The result: residents report a public health hazard, the system routes it to the wrong department, that department closes it as out of scope, and the waste stays on the sidewalk. Our classifier exists to make this invisible problem visible.
We process all street cleaning requests and use natural language processing to identify which ones actually describe human waste, bodily fluids, or biohazard conditions.
By the Numbers: What Happens to Human Waste Reports
Most residents who report human waste through 311 are submitting a ticket into a system that has no path to resolve it. Whether it lands in street cleaning or another category, there's no biohazard routing. The ticket reaches a department that doesn't handle human waste — and the system offers no way to forward it. It gets closed and disappears into the "resolved" column — even though nothing was cleaned up.
The small fraction of reports that do get handled typically involve an outside contractor dispatch, which we can detect from closure notes mentioning "outside contractor". But this is the exception, not the rule.
Breakdown by Ticket Category
Where most waste reports land. BPW can't handle biohazards and has no option to reroute — tickets are closed as out-of-scope.
How the Classifier Works
We use spaCy, an open-source NLP library, to tokenize and lemmatize the text from each 311 record. Lemmatization reduces words to their root form — "defecating" becomes "defecate", "feces" stays "feces" — so we match meaning rather than exact spelling.
The classifier examines three text fields from each record: the case title, the closure reason (added by city workers when the ticket is resolved), and the Open311 description (the original resident report, which is stripped from the public data export but available through a separate API).
Keyword Scoring
Each record gets a confidence score from 0.0 to 1.0 based on weighted keyword matching across four tiers:
Words that almost certainly indicate human waste. Includes feces, fecal, excrement, biohazard, defecate, and common informal terms. Also catches intentional misspellings.
Multi-word expressions matched as substrings: "human waste", "bodily fluid", "fecal matter", "bio hazard", "outside contractor" (which appears in city worker notes when biohazard cleanup is dispatched).
Ambiguous terms that could mean human waste or something else: urine, vomit, sewage, stool, soiled. These score higher (+0.2) when context boosters are present and no false positive flags exist.
Words that don't indicate waste on their own but strengthen the signal when paired with other matches: encampment, homeless, needle, sidewalk, tent, contractor. Only counted when at least one other signal is present.
The BPW Rejection Signal
One of our strongest signals is the phrase "bpw does not service human waste", which appears in closure notes when Boston Public Works (BPW) closes a ticket because the reported issue falls outside their scope. This single phrase adds +0.8 to the score — nearly maxing it out — because it's the city's own workers confirming the report describes human waste.
This phrase is evidence of the routing failure described above. The pattern is:
- Resident submits report describing human waste
- System routes it to BPW street cleaning
- BPW has no way to reroute the ticket — closes it with "does not service human waste"
- Ticket shows as "closed" in city data — appears resolved, but nothing was cleaned
False Positive Prevention
Many street cleaning requests mention waste from animals, not humans. Our classifier uses a three-layer defense:
- False positive flags — terms like dog, pet, canine, animal, rat, restaurant, and food inspection are tracked separately.
- Score reduction — when false positive flags are present, medium-signal terms only add +0.02 instead of +0.1–0.2.
- 70% penalty — if false positive flags are found and there are no explicit high-signal phrases or BPW rejection notes, the total score is multiplied by 0.3 (a 70% reduction). This lets strong explicit signals override animal context, while ambiguous cases get downgraded.
For example, "dog poop on sidewalk" would match poop (high signal) and sidewalk (context booster), but also dog (false positive). The 70% penalty brings the score low enough to filter it out, while "human feces on sidewalk" has no false positive flags and scores high.
Confidence Levels
| Level | Score | Meaning |
|---|---|---|
| High | ≥ 0.6 | Strong match — explicit waste terms, BPW rejection, or multiple confirming signals. Displayed on the map by default. |
| Medium | ≥ 0.3 | Likely match — medium-signal terms with context boosters, or a single high-signal term without false positive flags. |
| Low | > 0.0 | Possible match — weak signals, ambiguous terms, or high-signal terms with animal context. Not shown on the map. |
| None | 0.0 | No waste-related language detected. |
The map currently shows records classified as high and medium confidence (132 records). This is a conservative threshold — we prefer missing some real cases over showing false positives.
Validation
We validated the classifier against a manually labeled dataset:
- 98% recall on 50 confirmed human waste cases — the classifier correctly identified 49 out of 50.
- 0 false positives across 32,000+ street cleaning records from the test period.
- 1 known miss: a record containing "Human faces" (likely a typo for "human feces") was not caught because the misspelling didn't match any keyword tier.
The classifier is conservative by design. We would rather undercount than overcount, because false positives undermine trust in civic data. As we discover new patterns or edge cases, we update the keyword lists and re-process the full dataset.
Open Source
The full classifier code is open source under the MIT license. You can review the keyword lists, scoring logic, and false positive handling in the pipeline source code:
-
classifier.py— spaCy tokenization, scoring logic, false positive handling -
config.py— keyword tiers, phrases, and threshold values
If you find a misclassified record or have suggestions for improving the keyword lists, please open an issue on GitHub.