Releases

v0.0.2

2026-10-22 01:02 UTC

Fair comparison of JEV, Clef-Flash and CLIP with the same labeled images, descriptions from a blind loop, Platt calibration of every method and paired tests, with the analysis document beyond_clip_analysis.qmd.

Decisions in v0.0.2
IDDecisionProposed byDecided by
D64Tag commit 33ffd59 as v0.0.1 (pre-alpha) before any change to the code for the redesign.Fadel M. MegahedFadel M. Megahed
D65Do the redesign of the experiment and of its presentation on a separate branch (fair-comparison), not on main.Fadel M. MegahedFadel M. Megahed
D66Write R code in 80 to 90% tidyverse style (stringr for text) and use yardstick for the classification metrics; keep the code simple.Fadel M. MegahedFadel M. Megahed
D67Calibrate CLIP too, on the same images as the decision models, and test the calibrated CLIP model.Fadel M. MegahedFadel M. Megahed
D68Report accuracy, balanced accuracy, specificity, sensitivity, precision, F1 and MCC for each method.Fadel M. MegahedFadel M. Megahed
D69Each method uses one learning set of 50 images per class (pans: 10) and one separate calibration set of 25 images per class; all methods use the same images (option B).Fadel M. MegahedFadel M. Megahed
D70The learning set of each dataset is its CLIP baseline set (pan_10, extrusion_50, textiles_50, pipe_staple_50, microstructure_50); the references of JEV and Clef-Flash come from it.Claude CodeFadel M. Megahed
D71Compare the methods with paired tests on the same test images.Claude CodeFadel M. Megahed
D72Add detail to the replication record: a timeline, the tags and the results.Fadel M. MegahedFadel M. Megahed
D73The record is an honest guide to the co-work with Claude Code and shows the intellectual contributions and decisions of the researchers.Fadel M. MegahedFadel M. Megahed
D74The description loop is blind: its instructions carry no dataset knowledge from the researchers (not the hypotheses of docs/GOAL.md).Claude CodeFadel M. Megahed
D75The 37 back-filled decision rows (D2 to D38) show with the mark "not checked by a person"; fmm checks them before the tag v0.1.0.Claude CodeFadel M. Megahed
D76Approve the design plans/2026-10-20-fair-comparison-design.md, with the Claude calls of its section 13.Claude CodeFadel M. Megahed
D77Approve the plans plans/2026-10-20-record-additions-plan.md and plans/2026-10-20-fair-comparison-plan.md; run their code tasks subagent-driven, and the gated tasks with fmm in the session.Claude CodeFadel M. Megahed
D78Record the execution time of every scoring run (per image and per run, for JEV, Clef-Flash and CLIP) and report time per image for each method in the analysis document.Fadel M. MegahedFadel M. Megahed
D79Report the cost of each JEV call and configuration: the per-call log already holds tokens and an estimated cost; the analysis document sums it by configuration and per image, and the record compares the logged total with the TypeSafe account after the runs.Fadel M. MegahedFadel M. Megahed
D80In the interactive tables of the analysis document, stripe the rows by case study (dataset), not row by row.Fadel M. MegahedFadel M. Megahed
D81Run one fresh, isolated loop agent for each model and dataset (8 agents), each in its own sandbox, started by scripts/fair_run_loop.sh with restricted Claude Code settings (no user settings, plugins, hooks or MCP servers; only Read, Write, Edit, Glob, Grep, Bash and TodoWrite; Bash pre-approved only for the scoring command and simple read commands; model pinned).Claude CodeClaude Code
D82Platt calibration may reverse a method whose raw scores run backwards: keep standard Platt, report the Platt slope of every configuration, and mark each reversed configuration in the tables and the text, with its raw AUC next to it.Claude CodeFadel M. Megahed
D83Approve the loop instructions scripts/fair_loop_instructions.md (filled into LOOP.md in each sandbox) as written.Claude CodeFadel M. Megahed
D84Approve up to 50,000 JEV calls for the fair comparison (loops, checks, calibration and test runs); the account holds over USD 20, so the budget row caps the cost at USD 20. This lifts the 7,000-call cap of D26 and the USD 5 budget of D44.Fadel M. MegahedFadel M. Megahed
D85Freeze the JEV descriptions of the four blind loops: extrusion candidate 3 (design AUC 0.783), textiles candidate 2 (0.991), pipe staple candidate 1, the generic description (0.994), microstructure candidate 2 (0.945).Claude CodeClaude Code
D86Freeze the Clef-Flash descriptions of the four blind loops: extrusion candidate 2 (design AUC 0.764), textiles candidate 4 (0.928), pipe staple candidate 2 (0.997), microstructure candidate 3 (0.936).Claude CodeClaude Code
D87Run the one-time test runs of every configuration of design section 5.6 (JEV, Clef-Flash) and of the CLIP zero_final variant, after the calibration results.Claude CodeFadel M. Megahed
D88Report the P2 row of JEV pipe staple as the run-to-run variation of JEV. Its final and generic texts are the same, and the two runs gave slightly different probabilities. This corrects the impact statement of D85, which says that this P2 difference is zero.Claude CodeClaude Code
D89Keep the test result of CLIP zero_final on textiles as it is, with a flag. All its probabilities are 0.999 or more; the clamp at 0.995 makes the Platt inputs equal, so Platt gives 0.5 to every image. Do not change the calibration code after the test results.Claude CodeClaude Code
D90Push the branch fair-comparison and open a pull request to main. The merge waits for the approval of fmm.Claude CodeFadel M. Megahed
D91Merge the pull request #1 (fair-comparison) into main with a merge commit. The branch commits that the ledger and the records name stay on main.Claude CodeFadel M. Megahed
D92Tag the fair comparison as v0.0.2, not v0.1.0.Fadel M. MegahedFadel M. Megahed
Results in v0.0.2
IDResultValue
H9Fair comparison P1: JEV (final description, k = 2; pans generic) against the CLIP baseline (50 learning images per class, pans 10), both with Platt scaling on the same calibration set: much better on pipe staple and pans, equal on extrusion and textiles, slightly lower on microstructuretest balanced accuracy: extrusion 0.750 vs 0.715, textiles 0.965 vs 0.975, pipe staple 0.940 vs 0.570, microstructure 0.902 vs 0.933 (difference -0.031, interval -0.058 to -0.004; Holm p = 0.17), pans 1.000 vs 0.641
H10Fair comparison P1: Clef-Flash (final description, k = 2; pans generic) against the CLIP baseline: better on pipe staple and pans, equal on extrusion, lower on textiles and microstructuretest balanced accuracy: extrusion 0.710, textiles 0.840, pipe staple 0.990, microstructure 0.867, pans 0.885
H11P2: the description from the blind loop improves the decision models (final against generic, both k = 2)JEV: extrusion +0.130, textiles +0.145, microstructure +0.147 (Holm p < 0.001 each); Clef-Flash: pipe staple +0.530 (p < 0.001), microstructure +0.064 (p = 0.002), textiles +0.085 and extrusion +0.035 (not significant after Holm)
H12P3 and the reference curve: two references per class bring most of the gain over none; on pans and pipe staple, the size of the gain depends on the calibration methodJEV, k = 2 minus k = 0: extrusion +0.090, textiles +0.090, pipe staple +0.210, pans +0.231 (Holm p <= 0.018), microstructure +0.013 (not significant); JEV at k = 4 adds at most +0.016 over k = 2; with isotonic regression (sensitivity analysis, metrics.csv): pipe staple +0.440 (the k = 0 side has a negative Platt slope, D82), pans +0.038
H13Pans, P1: the CLIP baseline ranks the test images almost perfectly, but Platt scaling on the leave-one-out scores of 10 + 10 images in L sets its threshold too highCLIP baseline on pans: AUC 0.999; balanced accuracy 0.641 after Platt (isotonic regression gives the same), 0.910 with the raw rule of the CLIP paper
H14JEV gives slightly different probabilities when it scores the same prompt twice (pipe staple: final and generic texts are the same)AUC on C 0.983 and 0.979; test sensitivity 0.92 and 0.94, specificity 0.96 and 0.94; balanced accuracy difference 0.000 (-0.030 to 0.030)
H15Time and cost on the test setsmedian time per image: JEV 175 to 290 ms (pans 970 ms), Clef-Flash 173 to 257 ms (pans 1,212 ms, local GPU), CLIP baseline 10 to 13 ms (pans 98 ms, local GPU); 6,012 JEV test calls cost about USD 0.53

v0.0.1

2026-10-20 23:32 UTC

Pre-alpha. JEV tuned on validation and tested once; comparison with CLIP and Clef-Flash; calibration; the MSEC 2027 abstract and the replication document.

Decisions in v0.0.1
IDDecisionProposed byDecided by
D1Keep a replication record with the replication-materials skill.Fadel M. MegahedFadel M. Megahed
D2Make all manifest paths relative to the local imgs/ folder.Fadel M. MegahedFadel M. Megahed
D3Pin the model to jev-1.13.0 in the runner, because jev-latest can change.Claude CodeClaude Code
D4Run batch 1: a baseline and a repeat baseline for microstructure, textiles and extrusion.Claude CodeFadel M. Megahed
D5Freeze 50 validation images per class.Claude CodeFadel M. Megahed
D6Add an opt-in upscale argument (default FALSE) to the JEV client.Claude CodeFadel M. Megahed
D7Set up the replication record after the experiments.Claude CodeFadel M. Megahed
D8Make a panelled progress chart like the autoresearch chart.Fadel M. MegahedFadel M. Megahed
D9Include center crop and downsizing as experiments to reduce tokens.Fadel M. MegahedFadel M. Megahed
D10Run the rest of the queue for the three priority datasets, with a cap of 1,000 calls.Claude CodeFadel M. Megahed
D11Judge criteria, reference and size changes by AUC (+0.02) and tune the threshold last.Claude CodeFadel M. Megahed
D12Choose each threshold as the midpoint of the widest run of thresholds with the maximum validation BA.Claude CodeClaude Code
D13Tune pipe_staple and pan before one final test of all datasets.Claude CodeFadel M. Megahed
D14Stop pan tuning while its validation images have copies in the test set.Claude CodeClaude Code
D15Delete the duplicate pan images from the test folder.Fadel M. MegahedFadel M. Megahed
D16Raise the paid-call cap to 5,000.Fadel M. MegahedFadel M. Megahed
D17Delete all files with the word copy in their names.Fadel M. MegahedFadel M. Megahed
D18Keep a smaller pan image size when it is no worse, because the aim is to save tokens.Claude CodeClaude Code
D19Use the bright-clip wording for pipe_staple; at the AUC ceiling, compare BA at tuned thresholds.Claude CodeFadel M. Megahed
D20Match the test sizes of the prior CLIP study, not its few-shot learning sizes.Fadel M. MegahedFadel M. Megahed
D21Delete pan test image 21.JPG, which the prior test folder does not have.Claude CodeFadel M. Megahed
D22Add the real textile images as a transfer test.Claude CodeFadel M. Megahed
D23Run the one-time final test for the frozen configurations.Claude CodeFadel M. Megahed
D24Run CLIP on the same partition, a zero-shot JEV ablation and a calibration check.Fadel M. MegahedFadel M. Megahed
D25Give the zero-shot ablation its own validation threshold, with the same rule.Claude CodeClaude Code
D26Raise the paid-call cap to 7,000 if needed.Fadel M. MegahedFadel M. Megahed
D27Run CLIP in a separate, pinned conda environment.Claude CodeClaude Code
D28Replicate CLIP with the learning-set size that the CLIP paper reports for each experiment.Fadel M. MegahedFadel M. Megahed
D29Compare Platt scaling with isotonic regression.Fadel M. MegahedFadel M. Megahed
D30Drop the real-textile transfer example.Fadel M. MegahedFadel M. Megahed
D31Exclude copies of test images from the CLIP learning pool.Claude CodeClaude Code
D32Wait with the repository, because the scope and name can change with Clef-Flash.Fadel M. MegahedFadel M. Megahed
D33Back-fill the decisions of this session into the record.Claude CodeFadel M. Megahed
D34Run Clef-Flash locally with the same protocol.Claude CodeFadel M. Megahed
D35Delete only the extrusion pool frames that copy test frames.Claude CodeFadel M. Megahed
D36Send images to Clef-Flash as an ordered list with a text legend, because its SystemOne server ignores TypeSafe assets.Claude CodeClaude Code
D37Submit the MSEC 2027 title and abstract in the rewrite of the owner.Fadel M. MegahedFadel M. Megahed
D38Add Ying-Ju (Tessa) Chen as a co-author.Fadel M. MegahedFadel M. Megahed
D39Name the R package decisionqc and the research repository decision-models-for-industrial-image-qc.Claude CodeFadel M. Megahed
D40Organize the repository before the first push.Fadel M. MegahedFadel M. Megahed
D41Make the research repository public, so the record website works on the free plan.Claude CodeFadel M. Megahed
D42License the repository under MIT.Claude CodeFadel M. Megahed
D43Cite the CLIP study as the 2026 Journal of Quality Technology article, which is open access.Fadel M. MegahedFadel M. Megahed
D44Set the JEV budget to about USD 5, the free credit for a new user.Fadel M. MegahedFadel M. Megahed
D45Use APA 7 style for citations, with the published metadata of each work.Fadel M. MegahedFadel M. Megahed
D46Use short, direct section headers in all documents.Fadel M. MegahedFadel M. Megahed
D47Make one Quarto document that reproduces all paper figures and tables; it reads saved predictions by default and has switches to re-run the paid and GPU steps.Claude CodeFadel M. Megahed
D48Produce tables T1 to T7, figures F1 to F7 and the appendix table of all trials.Claude CodeFadel M. Megahed
D49Use theme_bw with Dark2, annotations and a polished font; save each figure as PNG, PDF and SVG in one-column and two-column sizes.Claude CodeFadel M. Megahed
D50Use Outfit for figure titles and Cabin for all other figure text.Fadel M. MegahedFadel M. Megahed
D51Name groups in their chart color in the subtitle (ggtext) in place of a legend.Fadel M. MegahedFadel M. Megahed
D52Round reported numbers half up (0.725 to 0.73), as in the submitted abstract, because floating point makes round() and sprintf() give 0.72.Claude CodeClaude Code
D53Show all tables of the replication document as interactive DT tables; keep the CSV and LaTeX files for the paper.Fadel M. MegahedFadel M. Megahed
D54In figures F3 and F4, give each method its own row or column, with larger points and no vertical nudging.Fadel M. MegahedFadel M. Megahed
D55Publish figure F1 with its image sources on the figure; its AutoVI (pipe staple) tiles stay under CC BY-NC-SA 4.0.Fadel M. MegahedFadel M. Megahed
D56Keep beyond_clip_analysis.html in the repository and show it on the record website as an extra page (replication-materials 1.1.0).Fadel M. MegahedFadel M. Megahed
D57Put "(Few-Shot)" in parentheses in the title: Beyond CLIP: Calibrated (Few-Shot) Defect Detection With Structured Decision Models.Fadel M. MegahedFadel M. Megahed
D58Also report CLIP with the learning sets of the CLIP paper at a threshold tuned like ours, next to the rule of that paper.Fadel M. MegahedFadel M. Megahed
D59Tune that CLIP threshold by leave-one-out on the learning set (identical frames left out together), because the learning sets hold most of our validation images (all 16 for pans).Claude CodeClaude Code
D60In the interactive T4, mark each JEV and Clef-Flash result against the best CLIP result on the same dataset: up, level or down at a margin of 0.02 balanced accuracy.Fadel M. MegahedClaude Code
D61Record the R packages in an renv lockfile (renv.lock) without activating renv in the project, because the project folder is in Dropbox.Fadel M. MegahedClaude Code
D62The benchmark is a CLIP baseline with 50 learning images per class (pans: 10), the low end of the abstract of the CLIP paper, with the defect images split evenly over the defect types; it replaces the best CLIP result as the reference of the glyphs, and the other columns stay.Fadel M. MegahedFadel M. Megahed
D63Add a dot-chart column to the interactive T4: one row per method, balanced accuracy on a common axis, dashed line at the CLIP baseline (inline SVG, no script).Fadel M. MegahedFadel M. Megahed
Results in v0.0.1
IDResultValue
H1JEV with 2 to 4 references: test balanced accuracy on the five datasets0.73 to 1.00 (pans 1.00, extrusion 0.73, textiles 0.86, pipe staple 0.98, microstructure 0.92)
H2JEV against CLIP with the same references: equal or better on all five datasetsmicrostructure equal (0.92 and 0.92); JEV better on the other four
H3JEV against CLIP with the learning sets of the CLIP paper (20 to 700 labeled images): JEV better on three datasets, CLIP slightly better on twopipe staple 0.98 vs 0.57, pans 1.00 vs 0.91, microstructure 0.92 vs 0.85; textiles 0.86 vs 0.975, extrusion 0.73 vs 0.82
H4Calibration of the JEV probabilities on the test setsraw ECE 0.11 to 0.23; isotonic regression 0.01 to 0.04 on four of the five datasets
H5Clef-Flash with the frozen JEV configurations: test balanced accuracy0.68 to 0.99
H6Benchmark of the analysis document: the best CLIP result on the test set for each datasetpans 0.94, extrusion 0.83, textiles 0.98, pipe staple 0.61, microstructure 0.96
H7JEV with references against the CLIP baseline (50 learning images per class, pans 10; rule of the CLIP paper): JEV higher on four datasets, lower on textilespans 1.00 vs 0.91, extrusion 0.73 vs 0.70, textiles 0.86 vs 0.98, pipe staple 0.98 vs 0.57, microstructure 0.92 vs 0.84
H8Validation size (JEV with references): test balanced accuracy settles at about 10 to 20 validation images per class; the calibration error keeps falling up to 50mean test balanced accuracy at 20 and at 50 per class: extrusion 0.726 and 0.725, textiles 0.848 and 0.855, pipe staple 0.991 and 0.980, microstructure 0.920 and 0.920 (pans have 8 per class only)