Test First with Fake Data Whose Answers You Know: Building a Test with Planted Answers (1)

Validating an AI or automated measurement system requires correct answers, but field data often has none, and answers assigned by people are inconsistent. In that case you can first build a test with the answers planted in advance. Part 1 uses cases from Korea and abroad, including wine judging, mystery shopping, mutation testing and synthetic cell images, to show how to plant answers and how to build a test for each kind of task.

AXAI transformationValidationSynthetic data

You cannot score an AI on data that has no answers. When that happens, build a test with the answers planted in it first.

There are no answers to score against

There is a point where AI validation often gets stuck: there are no correct answers to check the results against.

For a defect detection AI, past photos need labels saying "this is defective," but most sites only keep pass/fail records, not which area was defective or why. For a document classification AI, there are records of how people classified documents, but nobody knows whether those people were right. In the AI verification design post we suggested "pick cases where the answer is already known," but many tasks have no such cases at all.

Another problem is that answers assigned by people are themselves inconsistent. At the California State Fair wine competition in the US, Robert Hodgson (2008) secretly slipped three glasses poured from the same bottle in among 30 glasses. He tested 65 to 70 judges every year, and only about one judge in ten scored the three glasses within the same medal grade. Another one in ten gave the same wine anything from bronze to gold. Before using expert judgment as the answer, you first need to know how much that answer wobbles.

Diagram marking in red three glasses poured from the same bottle among 30 judged wines, along with the result that only about one judge in ten scored the three glasses within the same medal grade
How samples with a known answer were mixed into the judging, and the result. The arrangement of glasses is illustrative. Source: Hodgson, Journal of Wine Economics, 2008

What deserves attention in this experiment is the method more than the result. Hodgson secretly planted samples whose answer he knew inside the test. Because it was the same wine, he knew in advance that the right answer was the same score. This series is about carrying that method over to AI validation. Part 1 covers how to build a test with planted answers; Part 2 covers how to make that test trustworthy.

Planting answers is already common practice

Testing a system by mixing in fakes whose answers you know is not new.

Korea's financial sector uses mystery shopping. The Financial Supervisory Service (FSS), Korea's financial regulator, disguises investigators as customers, sends them to branch counters and checks whether sales staff explain products as the rules require. In a 2018 check on sales of derivative-linked securities, it surveyed 440 branches at 29 financial firms and reported average scores of 83.9 for securities firms and 64.0 for banks (in Korean). Because the FSS knows what kind of customer each investigator is playing, what should be explained to that customer is also set in advance. They are fake customers with known answers.

The software industry has mutation testing. You deliberately plant small bugs in the code and see whether the existing tests catch them. If they do not, the tests are inadequate. Google published a 2021 paper reporting on running this method in code review for more than 24,000 developers across more than 1,000 projects. In effect, it built a test for the tests.

The life sciences have image sets with the answer written in the file name. BBBC005 from the Broad Institute in the US consists of 19,200 cell images drawn by a simulator, each with 1 to 100 cells, rendered with focus blur varied step by step. Because the cell count is in the file name, algorithms that count cells can be scored immediately.

CaseWho is testedThe answer the tester holds
Wine judging (Hodgson, 2008)JudgesThree glasses from the same bottle deserve the same score
Mystery shopping (FSS, 2018)Sales staffWho the investigator is posing as and what they should be told
Mutation testing (Google, 2021)Existing testsSmall bugs deliberately planted in the code
BBBC005 (Broad Institute)Cell-counting algorithmsThe cell count in the file name

The four cases share one thing. The tester holds the answer, and the one being tested does not know it.

Create data with known answers first

The first step in validation is securing data whose correct answer you know for certain. If you cannot find it in field data, you have to make it.

Synthetic data has already reached the practical stage in research. In a study by Mill et al. (2021), which rendered nanoparticle micrographs with a 3D graphics program for training, a model trained only on synthetic images scored an F1 of 0.930 on silica particle segmentation. A model trained on real images labeled by people scored 0.950. It reached nearly the same level without anyone having to trace outlines image by image. Andrew Ng, too, said in an interview with IEEE Spectrum that when performance is weak on a particular defect type, generating synthetic data lets you target that problem more directly.

Bar chart showing that in silica nanoparticle segmentation, a model trained only on synthetic images had an F1 of 0.930 and a model trained on real images with human labels had 0.950
Segmentation performance (F1) on silica nanoparticle micrographs. Source: Mill et al., 2021

For a small or midsize business, it does not need to be elaborate. A reference part of known size, a quote with deliberate errors, or a few dozen mock customer complaints with predetermined categories are enough to begin. What matters is not the volume of data but the fact that you hold the answers.

Tasks where tests are easy to build

How you plant answers varies by task.

  • Document recognition (OCR) and data entry: Create mock quotes and receipts with predetermined amounts, dates and vendors, print them, then scan them or photograph them with a phone. Deliberately include wrinkles, tilt and faint stamps
  • Customer inquiry classification: Write mock inquiries with unambiguous categories based on past inquiries, but include typos, abbreviations and sentences mixing two requests in realistic proportions
  • Defect detection: Deliberately create defects of known size and position on reference parts, or composite defect shapes onto photos of good products
  • Anomalous transactions and fraud detection: Plant a few rule-violating cases among normal transaction records and count how many get caught

In every case, keep the answer sheet separate from the test. If the answers leak into the AI's input, it is no longer a test but dictation.

What to record on the answer sheet

The answer sheet is not just a list of right and wrong. To find out later what dragged the score down, you also need to record the conditions of each sample. For documents, the degree of tilt and wrinkling; for inquiries, the number of typos and how many requests are mixed; for parts, the defect size and lighting angle. Only with these condition columns can you do the work Part 2 covers: "varying conditions one at a time to find the cause."

In summary

You do not have to give up on validation because field data has no answers. Create samples with known answers, keep the answer sheet separate from the test, and record the conditions of each sample. As wine judging and mystery shopping show, when the side holding the answers designs the test, you can score even where the field offers no answers. Building a test usually costs less than one failed pilot. If you first want to see how many answer records remain in your existing data, see the data readiness post as well.

The next part covers how to check whether that test resembles the real problem, and the sequence for carrying synthetic scores through to real-world validation.


Series: "Test First with Fake Data Whose Answers You Know"

  1. Building a test with planted answers (this post)
  2. Measuring whether fakes resemble the real thing

References