Contains
An open-source allergen detection tool that reads recipes or ingredient lists and outputs Contains declarations according to the nine major US allergens. It uses a three-tier determination of contains, does not contain, and needs verification, combining a fine-tuned model with an ingredient rule layer.
Timeline (last 90 days)
Contains is an open-source tool that reads recipes or ingredient lists and outputs a Contains: statement for the nine major US allergens, with three possible verdicts: contains, does not contain, or needs verification.
The delivered system uses a two-layer structure of a fine-tuned model plus ingredient rules, with merge logic as follows: if a rule hits or the model judges "contains", output "contains"; if the model says "not sure" and an unnamed source word is present, output "needs verification"; otherwise output "does not contain"; a rule-layer hit always overrides the model's "does not contain".
On the frozen test set, the delivered system (LoRA + rules) caught 73 (recall 0.86), with 11 confident errors, 1 "not sure", and 0 false positives, outperforming the keyword baseline, LoRA-only fine-tuning, and zero-shot Qwen3.5-4B.
Among the 11 confident errors, wheat accounts for 6, milk 2, egg 2, and fish 1; specifics include bare "flour", the wheat binder in imitation crab meat, and white sauce.
The rule matches bechamel while the test row says béchamel, and the accent causes the checker to miss it; this issue was discovered after the test set was frozen, and the author records it as a finding without fixing it.
There is a four-line rule that downgrades "not sure" to "does not contain", causing 5 of the 11 confident errors to be results that the fine-tuned model had originally correctly judged as "not sure" but that were overridden to a definite "does not"; the author did not modify this rule.
The local version uses Gemma 3 4B running on the user's machine via Ollama, reads photos of ingredient labels and extracts the text into the same decision pipeline; on a real package of dairy product it returned Contains: Milk.
The online demo is deployed on Render's free tier, where instances sleep; the timeout is set to 25 seconds while warm-up takes 34 seconds, causing the first request after any quiet period to silently fall back to pure rule mode.
The fixed cold-start logic now waits and tells the user the model is waking up, then returns the real answer; during the fix it was also found that the label endpoint blocks the event loop during the wait, which under concurrency freezes the health check.
The first user (a home baker) said she would use the tool but is not yet willing to pay, with an expected price of two or three dollars per month, provided it is reliable enough to prepare products for customers and remember frequently used brands.
All Facts (10)
Contains is an open-source tool that reads recipes or ingredient lists and outputs a Contains: statement for the nine major US allergens, with three possible verdicts: contains, does not contain, or needs verification.
50%UnverifiedThe delivered system uses a two-layer structure of a fine-tuned model plus ingredient rules, with merge logic as follows: if a rule hits or the model judges "contains", output "contains"; if the model says "not sure" and an unnamed source word is present, output "needs verification"; otherwise output "does not contain"; a rule-layer hit always overrides the model's "does not contain".
50%UnverifiedOn the frozen test set, the delivered system (LoRA + rules) caught 73 (recall 0.86), with 11 confident errors, 1 "not sure", and 0 false positives, outperforming the keyword baseline, LoRA-only fine-tuning, and zero-shot Qwen3.5-4B.
50%UnverifiedAmong the 11 confident errors, wheat accounts for 6, milk 2, egg 2, and fish 1; specifics include bare "flour", the wheat binder in imitation crab meat, and white sauce.
50%UnverifiedThe rule matches bechamel while the test row says béchamel, and the accent causes the checker to miss it; this issue was discovered after the test set was frozen, and the author records it as a finding without fixing it.
50%UnverifiedThere is a four-line rule that downgrades "not sure" to "does not contain", causing 5 of the 11 confident errors to be results that the fine-tuned model had originally correctly judged as "not sure" but that were overridden to a definite "does not"; the author did not modify this rule.
50%UnverifiedThe local version uses Gemma 3 4B running on the user's machine via Ollama, reads photos of ingredient labels and extracts the text into the same decision pipeline; on a real package of dairy product it returned Contains: Milk.
50%UnverifiedThe online demo is deployed on Render's free tier, where instances sleep; the timeout is set to 25 seconds while warm-up takes 34 seconds, causing the first request after any quiet period to silently fall back to pure rule mode.
50%UnverifiedThe fixed cold-start logic now waits and tells the user the model is waking up, then returns the real answer; during the fix it was also found that the label endpoint blocks the event loop during the wait, which under concurrency freezes the health check.
50%UnverifiedThe first user (a home baker) said she would use the tool but is not yet willing to pay, with an expected price of two or three dollars per month, provided it is reliable enough to prepare products for customers and remember frequently used brands.
50%