Skip to content

Privacy and preparation

Agriculture inspection evidence dataset: photos, notes and lab results

By SourceX Editorial · Reviewed by Noah Loul ·

10 sections

Short answer

To verify that photos, notes and lab results describe the same sample, assign one sample ID at collection, write it on the container, into every photo and note, onto the custody record and the lab request, and tie it to the traceability lot code it was drawn from. Then validate the joins: identical IDs, collection before photo, photo before shipment, intact seals, matching lot and location. Any record that fails is held, not guessed.

Document stack

Agriculture inspection

This page covers agriculture inspection evidence dataset: photos, notes and lab results.Illustrative

Key takeaways

  • Assign one sample ID before collection and carry it on every container, photo, note, custody record and lab request.
  • Keep sample IDs, traceability lot codes and lab accession numbers distinct and linked.
  • Normalize photo times to UTC only when the device recorded an offset; flag the rest.
  • Run mechanical checks for identity, lineage, lot, order, custody, method and outcome on every manifest.
  • Record corrections as new events that point to the record in error, so both the mistake and the fix stay visible.

How do you verify that photos, notes and lab results refer to the same sample?

You verify it by giving the sample one identity at the moment it is taken and then checking, record by record, that every photo, note and result carries that identity and fits the sample's timeline. Matching by date, field name or file folder is not verification; it is a guess that fails the first time two lots are sampled on the same morning.

In practice that means a sample ID printed on the container label, captured in or next to each photo, entered in the inspection note, carried on the custody record and quoted on the lab submission, plus a link from that sample ID to the lot it represents. A validator then confirms the joins and rejects any record whose ID, time, place or lot disagrees.

An agriculture inspection evidence dataset built this way can be replayed: a reviewer can start from a lab result, walk back to the photo of the bag it came from and the lot it represents, and see the quality decision that followed.

Why do inspection photos, notes and lab results drift apart?

They drift because each is created by a different tool with its own identifier and clock. Photos come from a phone or tablet camera that names files by sequence and stamps a capture time; notes come from an inspection app or a paper form typed in later; results come from a laboratory system keyed by the lab's own accession number.

Camera time is a common trap. The Exif standard records DateTimeOriginal as a local date and time without a time zone; the separate OffsetTimeOriginal tag, added in Exif 2.31, records its offset from UTC. Photos from devices that do not write the offset cannot be ordered reliably against lab or ERP timestamps taken in another zone.

Sampling itself multiplies identities. A composite of several sub-samples, a split sent to two labs, a re-test after an out-of-specification result, or a substitute sample taken when the first was compromised each creates a new record that must point back to its parent, or the chain breaks.

Which identifiers must exist before anything is collected?

Three identifiers must be distinct and linked before collection starts: the sample ID, the traceability lot code of the product sampled, and the lab's accession number once the sample arrives. Mixing them is the most frequent cause of misattributed results.

Regulatory sampling practice shows the discipline. FDA's Investigations Operations Manual describes marking each sampled container with the sample number, the date and the collector's initials, listing associated records on a collection report identified by the same sample number, and using official seals; FDA's laboratory manual describes the receiving lab checking that any seal is intact and that the sample's identification matches the accompanying records, recording discrepancies such as conflicting sample numbers or broken seals, and holding the sample while they are reconciled.

For foods on FDA's Food Traceability List, 21 CFR 1.1310 defines a traceability lot code as the descriptor that uniquely identifies a traceability lot within the records of the firm that assigned it, and 21 CFR 1.1350 requires transformation records to list each input lot's code and quantity alongside the new lot code. A sample linked to the right lot code inherits that traceability; a sample linked only to a field name does not.

The sample identity and evidence alignment manifest

This is the asset: one manifest row per evidence item, all sharing a sample ID. Values in the example column are illustrative and invented; field names are a suggested vocabulary you can map to your own systems.

The sample identity and evidence alignment manifest
FieldPurposeIllustrative valueRule
sample_idThe one identity every artifact must carryS-24-0817-03Assigned before collection; never reused
parent_sample_idLinks composites, splits, re-tests and substitutes to their originS-24-0817-01 or blankRequired when sample_kind is not primary
sample_kindPrimary, composite, split, retest or substitutesplitSubstitute requires an approval_ref
lot_codeTraceability lot code of the product sampledTLC-GR-2408-117Must exist in the lot register on the collection date
evidence_type and evidence_refWhich artifact this row describes and where it livesphoto, IMG_4412.jpgOne row per photo, note, custody record and result
captured_at_utcWhen the artifact was created, normalized to UTCExif local time plus offset, or app timestampPhotos without a time zone offset are flagged, not converted by guess
collector_role and location_refWho collected, in role terms, and whereQA technician, field block 12 or dock 3Location must match the lot's recorded location for that date
seal_id and custody_eventsSeal number and each hand-off timeSeal 55021; packed, couriered, receivedReceived time after collection time; seal intact at receipt
lab_accession and method_refLab's own ID and the test method versionLab accession A-77310, method rev CLab report must quote sample_id or a mapped accession
decision_ref and outcomeQuality decision that used the result and its verified effectHold released, or lot rejectedOutcome taken from the lot status record, not from the note

Which validation checks catch a mismatched record?

A short set of mechanical checks catches most mismatches before a person has to read anything. Run them on every manifest and record which check failed, because the failures are as informative as the passes.

At a glance

Which validation checks catch a mismatched record

  • V1 identity: every row for a sample carries the same sample_id, and every lab report maps to exactly one sample_id.
  • V2 lineage: any row with sample_kind other than primary names a parent_sample_id that exists and was collected earlier.
  • V3 lot: lot_code exists in the lot register and its location on the collection date matches location_ref.
  • V4 order: captured_at_utc for collection is earlier than every photo of the sealed container, which is earlier than courier pickup, which is earlier than lab receipt.
  • V5 clock: photos without an offset tag are flagged clock_unknown and excluded from ordering checks rather than assigned a zone.
  • V6 custody: seal_id on the custody record equals the seal recorded at receipt, and the lab marked it intact.
  • V7 method: method_ref names a version in effect on the analysis date.
  • V8 outcome: the outcome comes from the lot status record dated after the result, not from the inspection note.

A worked record that passes every check

This record is made up for illustration only; it is not SourceX customer data. It follows one split sample of a grain lot from field collection to the quality decision.

  • Collection, 07:40 local with a UTC offset written by the device: a QA technician draws primary sample S-24-0817-01 from lot TLC-GR-2408-117 at dock 3 and splits it; the split becomes S-24-0817-03 with parent S-24-0817-01.
  • Photos, 07:44 to 07:46: three images show the labeled bag, the seal and the open sample; each file is listed in the manifest against S-24-0817-03 with its offset-corrected time.
  • Note, 07:50: the inspection app entry quotes S-24-0817-03, the lot code and a visual observation category.
  • Custody: seal 55021 applied at 07:52, courier pickup at 09:15, lab receipt the next morning with seal recorded intact and accession A-77310 mapped to the sample ID.
  • Result, two days after receipt: the report quotes both the accession and the sample ID and names method revision C.
  • Decision: the lot status record moves from hold to released after the result date. All eight checks pass, and the manifest is marked aligned.

A failing example: the photo from the neighboring lot

The failure case uses the same invented lot and shows why the checks exist. Keep failing manifests in the dataset with their failure codes; they teach a model to stop rather than to stitch.

  • Two lots are sampled at dock 3 within ten minutes. One photo file is filed under S-24-0817-03, but the visible label in the image reads a different sample ID.
  • The photo has no time zone offset, so V5 flags it clock_unknown and it cannot support the ordering check.
  • V1 fails on the label reading, and V3 cannot confirm the location because the other lot was staged at the same dock.
  • The correct action is to hold the photo as unlinked and record the failure codes; reassigning it by guess would quietly attach evidence from one lot to another lot's decision.

Can the task be replayed through the traceability chain?

Yes, if each step is written as an event rather than an overwrite. GS1's EPCIS 2.0 schema is a useful model: its business step vocabulary includes sampling and inspecting, its dispositions include conformant and non_conformant, and a sensor report can carry a chemical substance or microorganism reference, a value, a unit and the data processing method. Transformation events list input and output lots, which mirrors the FSMA transformation records.

Corrections follow the same pattern. EPCIS lets a firm declare an earlier event in error, with a declaration time, a reason such as incorrect_data or did_not_occur, and the IDs of the corrective events that replace it. A manifest that handles a mislabeled photo or a wrong lot link this way keeps both the mistake and the fix, which is exactly what a reviewer, or a model learning the work, needs to see.

How do you align an archive that was never collected this way?

Align it in tiers of confidence rather than forcing every old record into a match. Historical archives rarely carry one sample ID across photos, notes and results, so the honest output is a manifest that says how each link was made and lets a reviewer decide which tiers are usable.

Start from the record with the strongest identifier, usually the lab report, because labs quote their own accession number and often the submitter's sample reference. Join it to the submission form or custody record, then to the lot register, and only then look for photos and notes that carry the same reference. Each join gets a method value so later readers know how much to trust it.

How do you align an archive that was never collected this way?
Link tierHow the link was madeUse in a datasetReview needed
linked_by_idThe same sample ID appears in both recordsTraining and evaluationSpot check a sample of links
linked_by_label_readA person or model read the ID from the label visible in a photoTraining, with the method recordedSecond reader on a sample of links
linked_by_contextSame lot, place and a time window, with no shared IDExploratory analysis onlyFull review before any other use
unlinkedNo defensible link foundExcluded, or kept as a negative exampleNone beyond recording the reason

What rights and safety limits apply, and how are such records licensed?

The records describe quality decisions, not food safety advice, and should be labeled that way; a dataset of past results never tells anyone whether a product is safe today. Results tied to a named grower, buyer or brand are confidential business information, and photos can show workers, vehicles or neighboring operations that need review.

Ownership is often split. A lab report may be governed by the lab's terms, a customer's specification may belong to the customer, and grower agreements may restrict use of field data. Holding the files is not the same as the right to license them, and de-identification does not create that right; counsel should review the contracts for the specific dataset.

Food and agriculture operations with years of aligned samples, photos, results and decisions hold training and evaluation material that generic image sets lack: verified links between what an inspector saw, what a lab measured and what the business decided.

For operations that want to offer such records, SourceX handles the licensing work from rights review and contracting to data preparation and delivery to AI developers. The company signs off on scope and terms before any sample record is delivered, and eligibility is checked through a short company assessment without data uploads.

Frequently asked questions

What is the difference between a sample ID and a traceability lot code?

A traceability lot code identifies a lot of food within the records of the firm that assigned it; a sample ID identifies one portion drawn from that lot for inspection or testing. One lot can have many samples, and each sample record should name the lot code it represents.

Can photo timestamps be trusted to order inspection evidence?

Only when the time zone is known. Exif DateTimeOriginal is a local time; the OffsetTimeOriginal tag records its offset from UTC. Photos without the offset should be flagged and kept out of ordering checks rather than assigned a zone by guess.

How should a lab re-test be recorded?

As a new sample record with sample_kind retest and a parent_sample_id pointing to the original, plus its own lab accession and method version. The original result stays in place, so the sequence of results and the decision that followed can both be seen.

What should happen when a photo cannot be matched to a sample?

Hold it as unlinked with the failure codes recorded. Do not reassign it by date or folder, because attaching it to the wrong sample would place another lot's evidence behind a quality decision.

Are inspection and lab records useful as AI data?

They can be when photos, notes, results and decisions are reliably linked and the company holds the rights to use them. Aligned records with documented failures let a developer train or evaluate models that must connect visual evidence, measurements and decisions, and they still require rights and confidentiality review first.

Sources

  • GS1's EPCIS 2.0 JSON schema includes the business steps sampling and inspecting, dispositions conformant and non_conformant, sensor reports with chemical substance, microorganism, value, unit and data processing method, transformation events with input and output lists, and error declarations with reason incorrect_data or did_not_occur and corrective event IDs. Source
  • 21 CFR 1.1310 defines a traceability lot code as a descriptor, often alphanumeric, used to uniquely identify a traceability lot within the records of the code's source. Source
  • 21 CFR 1.1350 requires transformation records to include, for each traceability lot used, its code, product description and quantity, and for the new lot its code, location, date, quantity and the reference document type and number. Source
  • FDA's Investigations Operations Manual (2025, chapter 4) describes marking sampled containers with the date, the investigator's initials and the sample number, identifying associated records on the collection report by sample number, and the use of official seals. Source
  • FDA's ORA Laboratory Manual describes the receiving lab confirming that the package is acceptable, that any official seal is intact and that the sample identification matches the accompanying records, with discrepancies such as conflicting sample numbers or broken seals recorded and reconciled and the sample possibly held meanwhile. Source
  • CIPA's Exif specification (DC-X008, 2016 translation, Exif 2.31) defines OffsetTimeOriginal (tag 36881) as the offset from UTC for DateTimeOriginal, which is otherwise recorded without a time zone. Source

See if your company qualifies

A short company assessment. No data uploads are needed.

See if your company qualifies