Can you spot the bad batch before inspection does?

Sixty-four batches with four process readings and the inspection result. The network scores 81% on batches it never saw against 66% for calling every batch good, and the twelve-point gap between that and its training score is the lesson.

Operations Advanced Neural Net free

After you install, this is the model to open.

Predict the Defect Before It Ships

  1. In your spreadsheet, click the Sortia icon in the strip of icons down the right-hand edge. No strip? Click the arrow at the bottom-right to open it. You can also use Extensions, then Sortia, then Open Sortia.
  2. Click Start from a template and put that name in the search box.
  3. Pick the card with that name and click Load this template. It arrives on a new tab with real numbers already in it.

The answer

Held-out accuracy
81.3% 13 of 16 unseen production runs called correctly
Training accuracy
93.8% on the 48 training rows; the gap is the memorisation warning
The three pending batches
2 flagged batches one and three predicted defective, the middle one clear

Sixty-four batches, four readings taken while each one ran, and whether inspection found a defect. Twenty-two of the sixty-four were defective, so calling every batch good already scores 65.6%, and that is the number to beat. Click Run. The network trains on 48 rows, scores itself on the 16 it never saw, and comes back with 93.75% on the training rows and 81.25% on the held-out ones.

Read those two together and never one alone. Twelve points between them is the network partly learning your sixty-four batches by heart, and the held-out figure is the only one that would survive contact with tomorrow's production. Now do the run that makes the point. Push Epochs from 400 to 1500 and run it again: training accuracy reaches 100.00% while held-out accuracy collapses to 56.25%, below the call-everything-good bar, which is a model that has memorised the answer sheet.

Training the model harder made it worse where it counts. Drop Epochs to 150 instead and training accuracy falls to 79.17% while the held-out score holds at 81.25%, so a third of the passes buys the same real-world accuracy with none of the memorising. Fewer passes, a smaller gap and no loss on rows it has not seen is the whole of what tuning a small network means.

Run the same training range through Logistic Regression for comparison and it scores 73.4%, but that number is measured on all 64 rows it fitted, so it is the in-sample figure and the network's in-sample figure is 93.75%. The two are not comparable, and setting them against each other is the most common way an accuracy claim goes wrong. What logistic regression gives you that the network does not is a reason: on this data it finds exactly one significant coefficient, dwell time, with a p-value of 0.0005 and an odds ratio of 0.275, so every extra second in the oven cuts the odds of a defect by about three quarters.

Line speed, temperature and humidity are all short of the bar. The seed is set to 7 so your first run reproduces these figures exactly. Clear it and run five times and held-out accuracy moves between about 50% and 94% on identical data, because sixteen test rows means one row is worth six points, so never quote a single accuracy off a sample this size.

The three rows beside the training block are batches waiting to run, feature columns only and in the same order, and the model calls them defect, good, defect. Treat that as a queue for the inspector rather than a verdict. To use your own line, put the process readings in the first columns, the inspection result in the last column of the training range as a 1 or a 0, and the batches you want scored in a separate block.

The model

It arrives on a tab called Template: Predict the Defect, carrying these columns:

  • Line speed (units/min)
  • Oven temperature (C)
  • Humidity (%)
  • Dwell (seconds)
  • Defect found (1 = yes)
  • Line speed (units/min)
  • Oven temperature
  • Humidity (%)
  • Dwell (seconds)

Once it is in your sheet

  1. The model arrives with real numbers in it and runs as it stands, so you can press the button first and understand it second.
  2. Change the numbers to yours. The sheet marks which cells are inputs and which hold formulas, and most labels carry a note explaining the row.
  3. Press the run button at the bottom of the panel. It is labeled for the tool you are in, and the result lands on its own tab, with a written reading of it beside the figures.

Never used Google Sheets? Start here goes the whole way, in seven steps, and assumes nothing.