Dataset construction and inference pipeline
This page records how the menu conflict corpus was assembled, how controlled price edits were produced, and how the explorer retrieves and answers from image evidence.
End-to-end overview
Corpus preparation and online inference are separate phases.
Conflict dataset construction
The image edit is localized; the rest of the photograph is copied from the source.
-
2.1
Prepare the menu-photo corpus
Menu-labelled photographs are extracted from the Yelp Open Dataset photo archive. The prepared local corpus contains 1,678 menu images associated with 1,338 businesses. Business and photo identifiers are preserved as metadata.
data/yelp-menu/images · data/yelp-menu/metadata.json -
2.2
Select source photographs
Ten real, user-contributed menu photographs are selected as the working source set. Each source contributes five independent conflict cases. A case is a pair—not a six-image temporal sequence.
data/conflict-sources.json · data/menu-conflicts-50/originals -
2.3
Locate an item-price target
A vision model identifies a readable menu item, its displayed price, and a normalized price bounding box. The detector output is cached so reruns reuse the same localization.
Detector gpt-5.6-terra Cached output target_cache.json -
2.4
Construct deterministic edit inputs
The normalized box is converted to pixel coordinates. A small context crop is calculated around the target, then an edit mask is restricted to the price region. Crop, mask, and paste coordinates are stored in the manifest.
input cropalpha maskprice boxedit boxcrop box -
2.5
Generate and composite the replacement
A deterministic seed selects a different target price. The crop and mask are sent to the image editor, which renders the new price in local photographic context. Only the permitted edit region is pasted back into the full-resolution source.
Editor gpt-image-2 Seed 20260729 Variants 5 per source -
2.6
Assign experimental metadata
Each sample records source and synthetic paths, item name, intended prices, edit coordinates, model provenance, QA state, and a synthetic observation date. Synthetic dates support conflict experiments; they are not claims about when a real menu was photographed.
data/menu-conflicts-50/manifest.json · samples.jsonl
Worked image example
One source image and one localized counterfactual from the released corpus.
original_source_01
conflict_f9f4d0487b4b
Inspect the localized edit
The full-menu pair above establishes image-level context. These stored generation artifacts expose the small region sent to the editor before compositing.
- Target item
- Galbitang
- Manifest annotation
- 14.99 → 16.99
- Source
- Yelp menu photograph
- Intervention
- Price-region inpainting
- Case semantics
- Independent original/counterfactual pair
- Inclusion
- Retained in the 50-case corpus
The full image is retained at its source dimensions. Generation operates on a context crop, and compositing copies only the permitted edit region back into the original photograph.
Verification and QA policy
Structural validity is enforced. Visual QA is reported but does not remove samples.
Structural verification
Checks that all files exist, dimensions match their sources, each source has five cases, and pixels outside the allowed region remain unchanged.
- Missing files
- 0
- Size mismatches
- 0
- Outside-region violations
- 0
- Result
- valid
Batch visual audit
A separate vision pass assesses whether the intended price is readable and whether the edit appears visually plausible.
- Exact-price passes
- 34 / 50
- Realism passes
- 49 / 50
- Accepted
- 33
- Needs review
- 17
Explorer RAG pipeline
The current baseline favors a transparent retrieval path over a large precomputed index.
Question + evidence scope
The user supplies an item-price question, top K, one of three scopes—originals, conflicts, or both—and whether conflict reporting should be requested.
Manifest-backed image records
Original records aggregate the item labels associated with their source. Each conflict record carries only its target item label and non-price provenance.
Lexical + fuzzy item matching
Question tokens are matched against item names with overlap, substring, and sequence-similarity signals. The result is a small ranked image set.
Expected prices are removed
Manifest prices are available for dataset inspection but are not placed in retrieval captions or answer metadata. The answer model must read prices from retrieved pixels.
Multimodal evidence package
The vision model receives the question, each retrieved image, its image ID, evidence type, source ID, and available observation metadata. When “Report conflicts” is enabled, the prompt also requests explicit comparison and disagreement reporting; when disabled, that instruction is omitted.
Direct answer with citations
Claims cite image identifiers in the form [image:IMAGE_ID]. When images disagree, the answer is instructed to report both observations and cite each side.
Models and retrieval components
Model assignments for corpus construction, the current explorer, and the general image index.
The 50-case conflict explorer does not use embedding retrieval. It uses supervised item labels from the manifest, then sends the retrieved pixels to the answer model. The SigLIP2 embedding path belongs to the broader place-photo RAG service and is included below for completeness.
gpt-5.6-terra
Reads a source menu and returns item name, original price, and normalized price box.
Deterministic Python
Samples a changed numeric price from the fixed experiment seed.
Pillow geometry
Converts boxes to pixels and creates the localized crop, mask, and paste region.
gpt-image-2
Inpaints the replacement price within the cropped menu context.
gpt-5.6-luna
Checks expected-price visibility and association with the intended item.
gpt-5.6-terra
Audits exact rendered price and visible editing artifacts after generation.
Lexical + fuzzy scoring
Ranks manifest item labels using token overlap, substring match, and sequence similarity. No embedding model is called.
GPT-5.6 → GPT-4o
Selected per query from vision-capable OpenAI models: GPT-5.6 Sol/Terra/Luna, GPT-5.5, GPT-5.4, GPT-5, GPT-4.1, or GPT-4o. Terra is the configured default.
google/siglip2-base-patch16-224
Places queries, images, and retrieval text in a shared normalized embedding space.
gpt-5.6-luna
Produces retrieval transcriptions containing readable menu items, prices, and sections.
RRF + diversity penalty
Combines image similarity, text similarity, and lexical rankings, then discourages redundant images.
Interpretation and limitations
Important constraints for reading baseline results.
Counterfactual, not longitudinal
The conflicting price is generated. It does not establish that the restaurant charged that price at the synthetic date.
Independent pair semantics
Five edits from one source are five independent evaluation cases. They should not be interpreted as five historical versions of one menu.
Retrieval labels are supervised
Item names come from target detection and are used for retrieval. This baseline evaluates conflict-aware visual answering more directly than open-world OCR retrieval.
Vision extraction can fail
Small, blurred, angled, or stylized prices may be misread. QA labels and retrieved pixels should be inspected alongside aggregate accuracy.
Small working corpus
Ten sources and fifty cases support rapid baseline experiments, not claims about general restaurant-menu performance.
Metadata is incomplete
Original capture times are generally unavailable. Missing metadata is retained as missing rather than inferred.
Implementation artifacts
Primary modules and outputs used by the current prototype.
src/place_rag/conflicts.pysrc/place_rag/explorer.pysrc/place_rag/vision.pysrc/place_rag/api.pydata/menu-conflicts-50/manifest.jsondata/menu-conflicts-50/verification.jsondata/menu-conflicts-50/audit.json