Wizzas commited on
Commit
3b68268
·
verified ·
1 Parent(s): 3e1bf17

DefectRAG phase 5: incremental real-model application migration

Browse files
README.md CHANGED
@@ -17,7 +17,8 @@ short_description: Live React dashboard and DINOv2 inspection on ZeroGPU
17
  Existing React UI, real frozen DINOv2 inspection across all 12 VisA categories,
18
  original normal-reference banks and heatmaps, with versioned normal-only decision
19
  calibration. No training rerun. The q95 sensitivity policy trades more false
20
- alarms for higher recall; historical inspection decisions are preserved.
 
21
  Anonymous browser history is isolated and temporary. Sign in to the configured
22
  staff workspace for durable shared records when available. Do not treat anomaly
23
  scores as probabilities or diagnoses. The operator selects the product category.
 
17
  Existing React UI, real frozen DINOv2 inspection across all 12 VisA categories,
18
  original normal-reference banks and heatmaps, with versioned normal-only decision
19
  calibration. No training rerun. The q95 sensitivity policy trades more false
20
+ alarms for higher recall; Macaroni1/2 use the more sensitive q80 decision policy.
21
+ Historical inspection decisions are preserved.
22
  Anonymous browser history is isolated and temporary. Sign in to the configured
23
  staff workspace for durable shared records when available. Do not treat anomaly
24
  scores as probabilities or diagnoses. The operator selects the product category.
backend/calibration.py CHANGED
@@ -6,13 +6,15 @@ import os
6
 
7
  POLICY = 'normal-q95-v1'
8
  FILENAME = 'sensitive_deployment_evaluation.json'
 
 
9
 
10
 
11
  def active_evaluation(root, baseline):
12
- policy = os.getenv('DEFECTRAG_CALIBRATION', POLICY)
13
  if policy == 'normal-max-v1':
14
  return baseline
15
- if policy != POLICY:
16
  raise ValueError('Unknown decision calibration policy')
17
  path = root / 'results' / FILENAME
18
  if not path.exists():
@@ -33,7 +35,35 @@ def active_evaluation(root, baseline):
33
  not math.isfinite(card['threshold']) or not 0 < card['threshold'] <= original['threshold'] or
34
  not math.isclose(card['uncertainty_margin'], card['threshold'] * .05, abs_tol=1e-12)):
35
  raise ValueError('Invalid calibrated threshold: ' + category)
36
- return candidate
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
 
39
  def calibrated_card(root, original):
 
6
 
7
  POLICY = 'normal-q95-v1'
8
  FILENAME = 'sensitive_deployment_evaluation.json'
9
+ MACARONI_POLICY = 'macaroni-recall-v1'
10
+ MACARONI_FILENAME = 'macaroni_recall_deployment_evaluation.json'
11
 
12
 
13
  def active_evaluation(root, baseline):
14
+ policy = os.getenv('DEFECTRAG_CALIBRATION', MACARONI_POLICY)
15
  if policy == 'normal-max-v1':
16
  return baseline
17
+ if policy not in (POLICY, MACARONI_POLICY):
18
  raise ValueError('Unknown decision calibration policy')
19
  path = root / 'results' / FILENAME
20
  if not path.exists():
 
35
  not math.isfinite(card['threshold']) or not 0 < card['threshold'] <= original['threshold'] or
36
  not math.isclose(card['uncertainty_margin'], card['threshold'] * .05, abs_tol=1e-12)):
37
  raise ValueError('Invalid calibrated threshold: ' + category)
38
+ if policy == POLICY or not (root / 'results' / MACARONI_FILENAME).exists():
39
+ return candidate
40
+ targeted = json.loads((root / 'results' / MACARONI_FILENAME).read_text())
41
+ if targeted.get('decision_policy') != MACARONI_POLICY or set(targeted['categories']) != set(candidate['categories']):
42
+ raise ValueError('Invalid Macaroni calibration manifest')
43
+ for category, previous in candidate['categories'].items():
44
+ card = targeted['categories'][category]
45
+ if category not in ('macaroni1','macaroni2'):
46
+ if card != previous:
47
+ raise ValueError('Macaroni-only policy changed another category')
48
+ continue
49
+ mutable = {'threshold','uncertainty_margin','model_id','calibration','metrics','decision_policy','previous_threshold','previous_model_id'}
50
+ if ({k:v for k,v in card.items() if k not in mutable} !=
51
+ {k:v for k,v in previous.items() if k not in mutable} or
52
+ card['previous_threshold'] != previous['threshold'] or
53
+ card['previous_model_id'] != previous['model_id'] or
54
+ card['model_id'] != baseline['categories'][category]['model_id'] + '-q80-v1' or
55
+ card['decision_policy'] != 'normal-q80-v1' or
56
+ card['calibration'].get('policy') != 'normal-q80-v1' or
57
+ card['calibration'].get('quantile') != .8 or
58
+ card['calibration']['normal'] != previous['calibration']['normal'] or
59
+ card['calibration']['anomalous'] != 0 or
60
+ not math.isfinite(card['threshold']) or not 0 < card['threshold'] <= previous['threshold'] or
61
+ not math.isclose(card['uncertainty_margin'], card['threshold']*.05, abs_tol=1e-12)):
62
+ raise ValueError('Invalid Macaroni-only threshold: ' + category)
63
+ for key in ('image_auroc','average_precision','pixel_auroc_224','pixel_average_precision_224','n_images'):
64
+ if card['metrics'][key] != previous['metrics'][key]:
65
+ raise ValueError('Decision calibration changed ranking metrics')
66
+ return targeted
67
 
68
 
69
  def calibrated_card(root, original):
deployment/space/publish.py CHANGED
@@ -23,7 +23,7 @@ def main():
23
  path=ROOT/relative
24
  if path.exists():
25
  files[relative]=path
26
- for relative in ('results/sensitive_deployment_evaluation.json',):
27
  files[relative]=ROOT/relative
28
  for directory in ('backend','deployment/space'):
29
  for path in (ROOT/directory).glob('*.py'):
@@ -56,7 +56,8 @@ def main():
56
  Existing React UI, real frozen DINOv2 inspection across all 12 VisA categories,
57
  original normal-reference banks and heatmaps, with versioned normal-only decision
58
  calibration. No training rerun. The q95 sensitivity policy trades more false
59
- alarms for higher recall; historical inspection decisions are preserved.
 
60
  Anonymous browser history is isolated and temporary. Sign in to the configured
61
  staff workspace for durable shared records when available. Do not treat anomaly
62
  scores as probabilities or diagnoses. The operator selects the product category.
 
23
  path=ROOT/relative
24
  if path.exists():
25
  files[relative]=path
26
+ for relative in ('results/sensitive_deployment_evaluation.json','results/macaroni_recall_deployment_evaluation.json'):
27
  files[relative]=ROOT/relative
28
  for directory in ('backend','deployment/space'):
29
  for path in (ROOT/directory).glob('*.py'):
 
56
  Existing React UI, real frozen DINOv2 inspection across all 12 VisA categories,
57
  original normal-reference banks and heatmaps, with versioned normal-only decision
58
  calibration. No training rerun. The q95 sensitivity policy trades more false
59
+ alarms for higher recall; Macaroni1/2 use the more sensitive q80 decision policy.
60
+ Historical inspection decisions are preserved.
61
  Anonymous browser history is isolated and temporary. Sign in to the configured
62
  staff workspace for durable shared records when available. Do not treat anomaly
63
  scores as probabilities or diagnoses. The operator selects the product category.
frontend/dist/assets/TeamWorkspace-8cqcirZC.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as h,r as n,a as Q,b as d,R as e,L as X,S as $,A as ee,d as te}from"./index-CWVSOzCk.js";/**
2
+ * @license lucide-react v0.468.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ae=h("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
7
+ * @license lucide-react v0.468.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const _=h("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
12
+ * @license lucide-react v0.468.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const re=h("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
17
+ * @license lucide-react v0.468.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const ne=h("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
22
+ * @license lucide-react v0.468.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const le=h("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
27
+ * @license lucide-react v0.468.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const se=h("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
32
+ * @license lucide-react v0.468.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const ce=h("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
37
+ * @license lucide-react v0.468.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const oe=h("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);function me(){var D;const[c,A]=n.useState(null),[l,x]=n.useState(null),[v,M]=n.useState([]),[S,H]=n.useState({}),[g,F]=n.useState(""),[R,L]=n.useState(""),[o,q]=n.useState(!1),[P,y]=n.useState(""),[E,W]=n.useState(!1),[s,w]=n.useState(null),[B,V]=n.useState([]),[K,G]=n.useState([]),[k,z]=n.useState(""),[Y,I]=n.useState(!1),[U,O]=n.useState(""),[Z,N]=n.useState(!1),C=Q();async function i(t){q(!0),y("");try{await t()}catch(r){y(r.message||"Team request failed.")}finally{q(!1)}}async function b(){const{client:t,staff:r}=await te();x(r);let a=t.from("shared_inspections").select("*").order("created_at",{ascending:!1}).limit(200);a=E?a.not("archived_at","is",null):a.is("archived_at",null);const[{data:m,error:f},{data:u,error:p}]=await Promise.all([a,t.from("staff_members").select("*")]);if(f)throw f;if(p)throw p;M(m||[]),H(Object.fromEntries((u||[]).map(T=>[T.user_id,T.display_name])))}n.useEffect(()=>{if(!C)return;let t=!1,r;return d().then(async a=>{r=a.auth.onAuthStateChange((f,u)=>{t||(A((u==null?void 0:u.user)||null),f==="PASSWORD_RECOVERY"&&I(!0))}).data.subscription;const{data:m}=await a.auth.getUser();t||A(m.user)}).catch(a=>{t||y(a.message)}),()=>{t=!0,r==null||r.unsubscribe()}},[C]),n.useEffect(()=>{if(!c)return;let t=!1;b().catch(a=>{t||y(a.message)});const r=setInterval(()=>b().catch(a=>{t||y(a.message)}),15e3);return()=>{t=!0,clearInterval(r)}},[c==null?void 0:c.id,E]);async function j(t){await i(async()=>{const r=await d(),a=r.storage.from("team-inspections"),m=await Promise.all([t.image_path,t.heatmap_path].map(p=>a.createSignedUrl(p,900)));if(m.some(p=>p.error))throw new Error("Private images could not be loaded. Check staff/storage policies.");const{data:f,error:u}=await r.from("staff_notes").select("*").eq("inspection_id",t.id).order("created_at");if(u)throw u;w(t),V(m.map(p=>p.data.signedUrl)),G(f||[])})}async function J(){await i(async()=>{const t=await d(),r=v.filter(a=>a.owner_id===c.id).map(a=>a.id);if(r.length){const{error:a}=await t.rpc("archive_team_inspections",{p_ids:r});if(a)throw a}w(null),N(!1),await b()})}return C?e.createElement(e.Fragment,null,e.createElement("section",{className:"card"},e.createElement("div",{className:"section-title"},e.createElement("div",null,e.createElement("h2",null,e.createElement(oe,{size:21})," Staff workspace"),e.createElement("p",null,"Signed-in staff share saved inspections and review notes. Live AI runs on the connected inspection backend.")),e.createElement("span",{className:"subtle-tag"},e.createElement(_,{size:13})," SUPABASE")),P&&e.createElement("div",{className:"error",role:"alert"},P),c?e.createElement(e.Fragment,null,e.createElement("div",{className:"team-toolbar"},e.createElement("div",null,e.createElement($,{size:18}),e.createElement("strong",null,(l==null?void 0:l.display_name)||c.email),e.createElement("span",{className:"subtle-tag"},(l==null?void 0:l.role)||"CHECKING MEMBERSHIP")),e.createElement("button",{className:"secondary",disabled:o,onClick:()=>i(b)},e.createElement(se,{size:16})," Refresh"),e.createElement("button",{className:"secondary",onClick:()=>i(async()=>{await(await d()).auth.signOut(),M([]),w(null),x(null)})},e.createElement(le,{size:16})," Sign out")),Y&&e.createElement("form",{className:"login-form",onSubmit:t=>{t.preventDefault(),i(async()=>{const r=await d(),{error:a}=await r.auth.updateUser({password:U});if(a)throw a;O(""),I(!1)})}},e.createElement("label",{className:"field"},"Set a new password",e.createElement("input",{type:"password",minLength:12,autoComplete:"new-password",value:U,onChange:t=>O(t.target.value),required:!0})),e.createElement("button",{className:"primary",disabled:o},"Save password")),e.createElement("div",{className:"team-toolbar"},e.createElement("span",null,"Latest ",v.length," shared records · refreshes every 15 seconds"),(l==null?void 0:l.role)==="developer"&&e.createElement("button",{className:"secondary",onClick:()=>{W(!E),w(null)}},e.createElement(ae,{size:16}),E?"Active history":"Developer recovery"),!E&&e.createElement("button",{className:"secondary danger",disabled:o||!v.some(t=>t.owner_id===c.id),onClick:()=>N(!0)},e.createElement(ee,{size:16})," Archive my visible history")),Z&&e.createElement("div",{className:"note"},e.createElement("div",null,e.createElement("strong",null,"Archive your visible records?"),e.createElement("p",null,"They will leave the shared active history. Original files and conversations remain recoverable by a developer. Other staff members’ records will stay active."),e.createElement("div",{className:"button-row"},e.createElement("button",{className:"primary",disabled:o,onClick:J},"Archive my records"),e.createElement("button",{className:"secondary",onClick:()=>N(!1)},"Cancel")))),e.createElement("div",{className:"table-wrap"},e.createElement("table",null,e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Inspection"),e.createElement("th",null,"Product"),e.createElement("th",null,"Result"),e.createElement("th",null,"Shared by"),e.createElement("th",null,"Saved"),e.createElement("th",null))),e.createElement("tbody",null,v.map(t=>{var r;return e.createElement("tr",{key:t.id},e.createElement("td",null,e.createElement("strong",null,t.id.slice(0,8))),e.createElement("td",null,t.payload.category),e.createElement("td",null,e.createElement("span",{className:"badge "+((r=t.payload.verdict)==null?void 0:r.toLowerCase())},t.payload.verdict)),e.createElement("td",null,S[t.owner_id]||"Staff member"),e.createElement("td",null,new Date(t.created_at).toLocaleString()),e.createElement("td",null,e.createElement("button",{className:"text-button",onClick:()=>j(t)},"Review"),E&&(l==null?void 0:l.role)==="developer"&&e.createElement("button",{className:"text-button",disabled:o,onClick:()=>i(async()=>{const a=await d(),{error:m}=await a.rpc("restore_team_inspections",{p_ids:[t.id]});if(m)throw m;await b()})},"Restore")))}))),!v.length&&e.createElement("div",{className:"empty"},e.createElement(_,{size:30}),e.createElement("p",null,E?"No archived records to recover.":"No shared inspections yet. In the local app, open a result and select Share with staff.")))):e.createElement("form",{className:"login-form",onSubmit:t=>{t.preventDefault(),i(async()=>{const r=await d(),{error:a}=await r.auth.signInWithPassword({email:g,password:R});if(a)throw a;L("")})}},e.createElement("label",{className:"field"},"Work email",e.createElement("input",{type:"email",autoComplete:"username",value:g,onChange:t=>F(t.target.value),required:!0})),e.createElement("label",{className:"field"},"Password",e.createElement("input",{type:"password",autoComplete:"current-password",value:R,onChange:t=>L(t.target.value),required:!0})),e.createElement("button",{className:"primary",disabled:o},o?e.createElement(X,{className:"spin",size:17}):e.createElement(ne,{size:17})," Sign in"),e.createElement("button",{type:"button",className:"text-button",disabled:!g||o,onClick:()=>i(async()=>{const t=await d(),{error:r}=await t.auth.resetPasswordForEmail(g,{redirectTo:location.origin+location.pathname});if(r)throw r;y("Password reset requested. Check your email.")})},"Reset password"),e.createElement("p",{className:"caption"},"Accounts must be invited and approved by your workspace developer. Signing up alone does not grant staff access."))),c&&s&&e.createElement("section",{className:"card"},e.createElement("div",{className:"section-title"},e.createElement("div",null,e.createElement("h2",null,"Shared inspection · ",s.id.slice(0,8)),e.createElement("p",null,"Saved snapshot from ",S[s.owner_id]||"a colleague",". This page does not run a new prediction.")),e.createElement("button",{className:"text-button",onClick:()=>w(null)},"Close")),e.createElement("div",{className:"shared-images"},B.map((t,r)=>e.createElement("img",{key:t,src:t,alt:r?"Saved anomaly heatmap":"Saved inspected product"}))),e.createElement("div",{className:"observation"},e.createElement("strong",null,"SAVED MEASUREMENTS"),e.createElement("span",null,s.payload.verdict," · score ",Number(s.payload.score).toFixed(5)," · threshold ",Number(s.payload.threshold).toFixed(5))),e.createElement("h3",{className:"section-gap"},"Recorded evidence"),(D=s.conversation)!=null&&D.length?s.conversation.map((t,r)=>e.createElement("p",{className:"cloud-message",key:r},e.createElement("strong",null,t.role==="user"?"Inspector":"Evidence Assistant",": "),t.question||t.answer)):e.createElement("p",{className:"caption"},"No conversation was included when this inspection was shared."),e.createElement("h3",{className:"section-gap"},"Staff review notes"),K.map(t=>e.createElement("div",{className:"cloud-message",key:t.id},e.createElement("strong",null,S[t.author_id]||"Staff member"),e.createElement("p",null,t.body),e.createElement("small",null,new Date(t.created_at).toLocaleString()))),!s.archived_at&&e.createElement("form",{className:"question-form",onSubmit:t=>{t.preventDefault(),i(async()=>{const r=await d(),{error:a}=await r.from("staff_notes").insert({inspection_id:s.id,author_id:c.id,body:k.trim()});if(a)throw a;z(""),await j(s)})}},e.createElement("input",{"aria-label":"Staff review note",maxLength:2e3,placeholder:"Add a review note for your colleagues…",value:k,onChange:t=>z(t.target.value)}),e.createElement("button",{className:"primary",disabled:o||!k.trim()},e.createElement(ce,{size:16})," Add note")))):e.createElement("section",{className:"card cloud-setup"},e.createElement("div",{className:"setup-icon"},e.createElement(_,{size:32})),e.createElement("span",{className:"eyebrow"},"TEAM WORKSPACE"),e.createElement("h2",null,"One shared view of inspection."),e.createElement("p",null,"The staff workspace is ready to connect to your own Supabase project. No cloud project or account has been created for you."),e.createElement("div",{className:"setup-grid"},[["01","Create a free project","Use your Supabase account and select an eligible Free plan."],["02","Set up staff access","Run the supplied schema, add your developer account and invite colleagues."],["03","Connect this dashboard","Add the project URL and publishable key to config.js, then reload."]].map(([t,r,a])=>e.createElement("div",{key:t},e.createElement("b",null,t),e.createElement("h3",null,r),e.createElement("p",null,a)))),e.createElement("a",{className:"primary",href:"https://supabase.com/dashboard",target:"_blank",rel:"noreferrer"},"Open Supabase ",e.createElement(re,{size:16})),e.createElement("p",{className:"caption"},"Setup files: deployment/SUPABASE_SETUP.md and deployment/supabase.sql. Never place a service-role key in the browser. Local inspection works without cloud setup."))}export{me as default};
frontend/dist/assets/index-CWVSOzCk.js ADDED
The diff for this file is too large to render. See raw diff
 
frontend/dist/index.html CHANGED
@@ -1,3 +1,3 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="theme-color" content="#132e32"/><meta name="description" content="Local visual anomaly inspection with traceable evidence."/><title>DefectRAG · Inspection intelligence</title><link rel="icon" type="image/svg+xml" href="./logo.svg"><script src="./config.js"></script> <script type="module" crossorigin src="./assets/index-BdEpy7cy.js"></script>
2
  <link rel="stylesheet" crossorigin href="./assets/index-Bn4HF2vD.css">
3
  </head><body><div id="root"></div></body></html>
 
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="theme-color" content="#132e32"/><meta name="description" content="Local visual anomaly inspection with traceable evidence."/><title>DefectRAG · Inspection intelligence</title><link rel="icon" type="image/svg+xml" href="./logo.svg"><script src="./config.js"></script> <script type="module" crossorigin src="./assets/index-CWVSOzCk.js"></script>
2
  <link rel="stylesheet" crossorigin href="./assets/index-Bn4HF2vD.css">
3
  </head><body><div id="root"></div></body></html>
results/macaroni_recall_deployment_evaluation.json ADDED
@@ -0,0 +1,715 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
3
+ "profile": "dinov2_highres_v1",
4
+ "protocol": "Same frozen DINOv2 banks and official VisA assignments. Macaroni1/2 use the fixed linear 80th percentile of held-out training-normal scores; the other ten products retain their q95 policy. Higher recall with substantially more false alarms. Retrospective development evaluation, not independent validation.",
5
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
6
+ "device": "cuda",
7
+ "categories": {
8
+ "pcb1": {
9
+ "category": "pcb1",
10
+ "available": true,
11
+ "model_id": "dinov2-highres-pcb1-v1-q95-v1",
12
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
13
+ "profile": "dinov2_highres_v1",
14
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
15
+ "bank_sha256": "14e71cb6285f22e3d12d2b0d6357c552a26685a8f03a9b626a3e8999e8a89c65",
16
+ "threshold": 0.1414354294538498,
17
+ "uncertainty_margin": 0.00707177147269249,
18
+ "heatmap_scale": 0.10316987216472613,
19
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
20
+ "bank_size_bytes": 23237446,
21
+ "encoder_size_bytes": 88249960,
22
+ "calibration": {
23
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
24
+ "normal": 91,
25
+ "anomalous": 0,
26
+ "seed": 42,
27
+ "policy": "normal-q95-v1",
28
+ "quantile": 0.95,
29
+ "calibration_above_threshold": 5,
30
+ "future_false_positive_rate_guaranteed": false
31
+ },
32
+ "train_normal_count": 813,
33
+ "metrics": {
34
+ "image_auroc": 0.9597,
35
+ "average_precision": 0.9564653221826244,
36
+ "precision": 0.9148936170212766,
37
+ "recall": 0.86,
38
+ "f1": 0.8865979381443299,
39
+ "confusion_matrix": [
40
+ [
41
+ 92,
42
+ 8
43
+ ],
44
+ [
45
+ 14,
46
+ 86
47
+ ]
48
+ ],
49
+ "n_images": 200,
50
+ "pixel_auroc_224": 0.9946015614062951,
51
+ "pixel_average_precision_224": 0.8562862818777615,
52
+ "uncertain_fraction": 0.07,
53
+ "latency_median_ms": null,
54
+ "peak_gpu_mb": null,
55
+ "false_positive_rate": 0.08
56
+ },
57
+ "resolution_short_edge": 448,
58
+ "patch_size": 14,
59
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
60
+ "baseline_threshold": 0.16181933879852295,
61
+ "decision_policy": "normal-q95-v1"
62
+ },
63
+ "capsules": {
64
+ "category": "capsules",
65
+ "available": true,
66
+ "model_id": "dinov2-highres-capsules-v1-q95-v1",
67
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
68
+ "profile": "dinov2_highres_v1",
69
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
70
+ "bank_sha256": "fa34f8c1a203e609450e57156d5f75ca157140d88d07d0bf46947c3029675c55",
71
+ "threshold": 0.1439922600984573,
72
+ "uncertainty_margin": 0.007199613004922866,
73
+ "heatmap_scale": 0.1274158811569204,
74
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
75
+ "bank_size_bytes": 22108790,
76
+ "encoder_size_bytes": 88249960,
77
+ "calibration": {
78
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
79
+ "normal": 55,
80
+ "anomalous": 0,
81
+ "seed": 42,
82
+ "policy": "normal-q95-v1",
83
+ "quantile": 0.95,
84
+ "calibration_above_threshold": 3,
85
+ "future_false_positive_rate_guaranteed": false
86
+ },
87
+ "train_normal_count": 487,
88
+ "metrics": {
89
+ "image_auroc": 0.9683333333333333,
90
+ "average_precision": 0.9798232872953215,
91
+ "precision": 0.9425287356321839,
92
+ "recall": 0.82,
93
+ "f1": 0.877005347593583,
94
+ "confusion_matrix": [
95
+ [
96
+ 55,
97
+ 5
98
+ ],
99
+ [
100
+ 18,
101
+ 82
102
+ ]
103
+ ],
104
+ "n_images": 160,
105
+ "pixel_auroc_224": 0.9704973188279925,
106
+ "pixel_average_precision_224": 0.403655563796705,
107
+ "uncertain_fraction": 0.0875,
108
+ "latency_median_ms": null,
109
+ "peak_gpu_mb": null,
110
+ "false_positive_rate": 0.08333333333333333
111
+ },
112
+ "resolution_short_edge": 448,
113
+ "patch_size": 14,
114
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
115
+ "baseline_threshold": 0.19718621671199799,
116
+ "decision_policy": "normal-q95-v1"
117
+ },
118
+ "cashew": {
119
+ "category": "cashew",
120
+ "available": true,
121
+ "model_id": "dinov2-highres-cashew-v1-q95-v1",
122
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
123
+ "profile": "dinov2_highres_v1",
124
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
125
+ "bank_sha256": "4b908b22f79158fb46c0e591610d5c9470d588d4f0d017dd0bb493a58e64c693",
126
+ "threshold": 0.1289861112833023,
127
+ "uncertainty_margin": 0.006449305564165116,
128
+ "heatmap_scale": 0.10505769878625872,
129
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
130
+ "bank_size_bytes": 18366576,
131
+ "encoder_size_bytes": 88249960,
132
+ "calibration": {
133
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
134
+ "normal": 45,
135
+ "anomalous": 0,
136
+ "seed": 42,
137
+ "policy": "normal-q95-v1",
138
+ "quantile": 0.95,
139
+ "calibration_above_threshold": 3,
140
+ "future_false_positive_rate_guaranteed": false
141
+ },
142
+ "train_normal_count": 405,
143
+ "metrics": {
144
+ "image_auroc": 0.9608000000000001,
145
+ "average_precision": 0.9817707260519815,
146
+ "precision": 0.9090909090909091,
147
+ "recall": 0.9,
148
+ "f1": 0.9045226130653266,
149
+ "confusion_matrix": [
150
+ [
151
+ 41,
152
+ 9
153
+ ],
154
+ [
155
+ 10,
156
+ 90
157
+ ]
158
+ ],
159
+ "n_images": 150,
160
+ "pixel_auroc_224": 0.9960830910862268,
161
+ "pixel_average_precision_224": 0.7034966403298871,
162
+ "uncertain_fraction": 0.06,
163
+ "latency_median_ms": null,
164
+ "peak_gpu_mb": null,
165
+ "false_positive_rate": 0.18
166
+ },
167
+ "resolution_short_edge": 448,
168
+ "patch_size": 14,
169
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
170
+ "baseline_threshold": 0.13224798440933228,
171
+ "decision_policy": "normal-q95-v1"
172
+ },
173
+ "candle": {
174
+ "category": "candle",
175
+ "available": true,
176
+ "model_id": "dinov2-highres-candle-v1-q95-v1",
177
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
178
+ "profile": "dinov2_highres_v1",
179
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
180
+ "bank_sha256": "bb6767014719520899e8d2336ea2811ae8dadabb210a8855f7497f2ac48ab7ad",
181
+ "threshold": 0.15027016177773475,
182
+ "uncertainty_margin": 0.007513508088886738,
183
+ "heatmap_scale": 0.1193666505813595,
184
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
185
+ "bank_size_bytes": 23244689,
186
+ "encoder_size_bytes": 88249960,
187
+ "calibration": {
188
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
189
+ "normal": 90,
190
+ "anomalous": 0,
191
+ "seed": 42,
192
+ "policy": "normal-q95-v1",
193
+ "quantile": 0.95,
194
+ "calibration_above_threshold": 5,
195
+ "future_false_positive_rate_guaranteed": false
196
+ },
197
+ "train_normal_count": 810,
198
+ "metrics": {
199
+ "image_auroc": 0.9410000000000001,
200
+ "average_precision": 0.9459465742669609,
201
+ "precision": 0.8787878787878788,
202
+ "recall": 0.87,
203
+ "f1": 0.8743718592964824,
204
+ "confusion_matrix": [
205
+ [
206
+ 88,
207
+ 12
208
+ ],
209
+ [
210
+ 13,
211
+ 87
212
+ ]
213
+ ],
214
+ "n_images": 200,
215
+ "pixel_auroc_224": 0.9911336061961822,
216
+ "pixel_average_precision_224": 0.33767271945011856,
217
+ "uncertain_fraction": 0.055,
218
+ "latency_median_ms": null,
219
+ "peak_gpu_mb": null,
220
+ "false_positive_rate": 0.12
221
+ },
222
+ "resolution_short_edge": 448,
223
+ "patch_size": 14,
224
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
225
+ "baseline_threshold": 0.22504067420959473,
226
+ "decision_policy": "normal-q95-v1"
227
+ },
228
+ "chewinggum": {
229
+ "category": "chewinggum",
230
+ "available": true,
231
+ "model_id": "dinov2-highres-chewinggum-v1-q95-v1",
232
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
233
+ "profile": "dinov2_highres_v1",
234
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
235
+ "bank_sha256": "37165883dcc6304f60346c2052c7fa4151d4048b44fdb80a4f60ffc48477ed7d",
236
+ "threshold": 0.15658171474933624,
237
+ "uncertainty_margin": 0.007829085737466813,
238
+ "heatmap_scale": 0.11275605440139722,
239
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
240
+ "bank_size_bytes": 18458527,
241
+ "encoder_size_bytes": 88249960,
242
+ "calibration": {
243
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
244
+ "normal": 46,
245
+ "anomalous": 0,
246
+ "seed": 42,
247
+ "policy": "normal-q95-v1",
248
+ "quantile": 0.95,
249
+ "calibration_above_threshold": 3,
250
+ "future_false_positive_rate_guaranteed": false
251
+ },
252
+ "train_normal_count": 407,
253
+ "metrics": {
254
+ "image_auroc": 0.9885999999999999,
255
+ "average_precision": 0.9944721280040146,
256
+ "precision": 0.9795918367346939,
257
+ "recall": 0.96,
258
+ "f1": 0.9696969696969697,
259
+ "confusion_matrix": [
260
+ [
261
+ 48,
262
+ 2
263
+ ],
264
+ [
265
+ 4,
266
+ 96
267
+ ]
268
+ ],
269
+ "n_images": 150,
270
+ "pixel_auroc_224": 0.9952665200400623,
271
+ "pixel_average_precision_224": 0.6597053568827396,
272
+ "uncertain_fraction": 0.0,
273
+ "latency_median_ms": null,
274
+ "peak_gpu_mb": null,
275
+ "false_positive_rate": 0.04
276
+ },
277
+ "resolution_short_edge": 448,
278
+ "patch_size": 14,
279
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
280
+ "baseline_threshold": 0.1614319533109665,
281
+ "decision_policy": "normal-q95-v1"
282
+ },
283
+ "fryum": {
284
+ "category": "fryum",
285
+ "available": true,
286
+ "model_id": "dinov2-highres-fryum-v1-q95-v1",
287
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
288
+ "profile": "dinov2_highres_v1",
289
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
290
+ "bank_sha256": "ca73c0cd2b2e75d80874f7dd6270f09b13c55292fa93b1da1eeef361d8375ba4",
291
+ "threshold": 0.13227128088474271,
292
+ "uncertainty_margin": 0.006613564044237136,
293
+ "heatmap_scale": 0.10057919770479187,
294
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
295
+ "bank_size_bytes": 18381371,
296
+ "encoder_size_bytes": 88249960,
297
+ "calibration": {
298
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
299
+ "normal": 45,
300
+ "anomalous": 0,
301
+ "seed": 42,
302
+ "policy": "normal-q95-v1",
303
+ "quantile": 0.95,
304
+ "calibration_above_threshold": 3,
305
+ "future_false_positive_rate_guaranteed": false
306
+ },
307
+ "train_normal_count": 405,
308
+ "metrics": {
309
+ "image_auroc": 0.9924,
310
+ "average_precision": 0.9963591766254614,
311
+ "precision": 0.9894736842105263,
312
+ "recall": 0.94,
313
+ "f1": 0.964102564102564,
314
+ "confusion_matrix": [
315
+ [
316
+ 49,
317
+ 1
318
+ ],
319
+ [
320
+ 6,
321
+ 94
322
+ ]
323
+ ],
324
+ "n_images": 150,
325
+ "pixel_auroc_224": 0.9735429349543053,
326
+ "pixel_average_precision_224": 0.4360142987071739,
327
+ "uncertain_fraction": 0.03333333333333333,
328
+ "latency_median_ms": null,
329
+ "peak_gpu_mb": null,
330
+ "false_positive_rate": 0.02
331
+ },
332
+ "resolution_short_edge": 448,
333
+ "patch_size": 14,
334
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
335
+ "baseline_threshold": 0.15253151953220367,
336
+ "decision_policy": "normal-q95-v1"
337
+ },
338
+ "macaroni1": {
339
+ "category": "macaroni1",
340
+ "available": true,
341
+ "model_id": "dinov2-highres-macaroni1-v1-q80-v1",
342
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
343
+ "profile": "dinov2_highres_v1",
344
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
345
+ "bank_sha256": "28ebf491e124df62266c5c3b72ea5bfebb50ef93c189d5615d3ae866e8675432",
346
+ "threshold": 0.11047504395246506,
347
+ "uncertainty_margin": 0.0055237521976232535,
348
+ "heatmap_scale": 0.09929629743099211,
349
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
350
+ "bank_size_bytes": 23251984,
351
+ "encoder_size_bytes": 88249960,
352
+ "calibration": {
353
+ "method": "Fixed linear 80th percentile of heldout normal scores; no anomalous calibration",
354
+ "normal": 90,
355
+ "anomalous": 0,
356
+ "seed": 42,
357
+ "policy": "normal-q80-v1",
358
+ "quantile": 0.8,
359
+ "calibration_above_threshold": 18,
360
+ "future_false_positive_rate_guaranteed": false
361
+ },
362
+ "train_normal_count": 810,
363
+ "metrics": {
364
+ "image_auroc": 0.909,
365
+ "average_precision": 0.9254645749095916,
366
+ "precision": 0.7798165137614679,
367
+ "recall": 0.85,
368
+ "f1": 0.8133971291866028,
369
+ "confusion_matrix": [
370
+ [
371
+ 76,
372
+ 24
373
+ ],
374
+ [
375
+ 15,
376
+ 85
377
+ ]
378
+ ],
379
+ "n_images": 200,
380
+ "pixel_auroc_224": 0.9932559185087934,
381
+ "pixel_average_precision_224": 0.22125282869927704,
382
+ "uncertain_fraction": 0.155,
383
+ "latency_median_ms": null,
384
+ "peak_gpu_mb": null,
385
+ "false_positive_rate": 0.24
386
+ },
387
+ "resolution_short_edge": 448,
388
+ "patch_size": 14,
389
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
390
+ "baseline_threshold": 0.21722275018692017,
391
+ "decision_policy": "normal-q80-v1",
392
+ "previous_threshold": 0.14440965577960013,
393
+ "previous_model_id": "dinov2-highres-macaroni1-v1-q95-v1"
394
+ },
395
+ "macaroni2": {
396
+ "category": "macaroni2",
397
+ "available": true,
398
+ "model_id": "dinov2-highres-macaroni2-v1-q80-v1",
399
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
400
+ "profile": "dinov2_highres_v1",
401
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
402
+ "bank_sha256": "8dfe4f82ece83668ea4a97c18ef134ab16bea8ab6d2913959eb810942537737a",
403
+ "threshold": 0.12732562720775603,
404
+ "uncertainty_margin": 0.006366281360387802,
405
+ "heatmap_scale": 0.11770220518112187,
406
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
407
+ "bank_size_bytes": 23243554,
408
+ "encoder_size_bytes": 88249960,
409
+ "calibration": {
410
+ "method": "Fixed linear 80th percentile of heldout normal scores; no anomalous calibration",
411
+ "normal": 90,
412
+ "anomalous": 0,
413
+ "seed": 42,
414
+ "policy": "normal-q80-v1",
415
+ "quantile": 0.8,
416
+ "calibration_above_threshold": 18,
417
+ "future_false_positive_rate_guaranteed": false
418
+ },
419
+ "train_normal_count": 810,
420
+ "metrics": {
421
+ "image_auroc": 0.845,
422
+ "average_precision": 0.8446602099722114,
423
+ "precision": 0.7407407407407407,
424
+ "recall": 0.8,
425
+ "f1": 0.7692307692307692,
426
+ "confusion_matrix": [
427
+ [
428
+ 72,
429
+ 28
430
+ ],
431
+ [
432
+ 20,
433
+ 80
434
+ ]
435
+ ],
436
+ "n_images": 200,
437
+ "pixel_auroc_224": 0.9942242061289198,
438
+ "pixel_average_precision_224": 0.15769057747120718,
439
+ "uncertain_fraction": 0.23,
440
+ "latency_median_ms": null,
441
+ "peak_gpu_mb": null,
442
+ "false_positive_rate": 0.28
443
+ },
444
+ "resolution_short_edge": 448,
445
+ "patch_size": 14,
446
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
447
+ "baseline_threshold": 0.15817631781101227,
448
+ "decision_policy": "normal-q80-v1",
449
+ "previous_threshold": 0.144144269824028,
450
+ "previous_model_id": "dinov2-highres-macaroni2-v1-q95-v1"
451
+ },
452
+ "pcb2": {
453
+ "category": "pcb2",
454
+ "available": true,
455
+ "model_id": "dinov2-highres-pcb2-v1-q95-v1",
456
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
457
+ "profile": "dinov2_highres_v1",
458
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
459
+ "bank_sha256": "694689b6703e399ea4076343a40ddff6a920f67c0c344048f0b2ef6402f3abb8",
460
+ "threshold": 0.1252228133380413,
461
+ "uncertainty_margin": 0.006261140666902066,
462
+ "heatmap_scale": 0.09851976394653338,
463
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
464
+ "bank_size_bytes": 23253151,
465
+ "encoder_size_bytes": 88249960,
466
+ "calibration": {
467
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
468
+ "normal": 91,
469
+ "anomalous": 0,
470
+ "seed": 42,
471
+ "policy": "normal-q95-v1",
472
+ "quantile": 0.95,
473
+ "calibration_above_threshold": 5,
474
+ "future_false_positive_rate_guaranteed": false
475
+ },
476
+ "train_normal_count": 810,
477
+ "metrics": {
478
+ "image_auroc": 0.9062,
479
+ "average_precision": 0.9098166487308751,
480
+ "precision": 0.875,
481
+ "recall": 0.84,
482
+ "f1": 0.8571428571428572,
483
+ "confusion_matrix": [
484
+ [
485
+ 88,
486
+ 12
487
+ ],
488
+ [
489
+ 16,
490
+ 84
491
+ ]
492
+ ],
493
+ "n_images": 200,
494
+ "pixel_auroc_224": 0.9714470671684394,
495
+ "pixel_average_precision_224": 0.26303790724220233,
496
+ "uncertain_fraction": 0.09,
497
+ "latency_median_ms": null,
498
+ "peak_gpu_mb": null,
499
+ "false_positive_rate": 0.12
500
+ },
501
+ "resolution_short_edge": 448,
502
+ "patch_size": 14,
503
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
504
+ "baseline_threshold": 0.341839998960495,
505
+ "decision_policy": "normal-q95-v1"
506
+ },
507
+ "pcb3": {
508
+ "category": "pcb3",
509
+ "available": true,
510
+ "model_id": "dinov2-highres-pcb3-v1-q95-v1",
511
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
512
+ "profile": "dinov2_highres_v1",
513
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
514
+ "bank_sha256": "704ee7d0827ede2b0a795a0efae8eb524751d2d1cb054cf7278c22888550a44c",
515
+ "threshold": 0.1346755474805832,
516
+ "uncertainty_margin": 0.00673377737402916,
517
+ "heatmap_scale": 0.1029075479507446,
518
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
519
+ "bank_size_bytes": 23242572,
520
+ "encoder_size_bytes": 88249960,
521
+ "calibration": {
522
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
523
+ "normal": 91,
524
+ "anomalous": 0,
525
+ "seed": 42,
526
+ "policy": "normal-q95-v1",
527
+ "quantile": 0.95,
528
+ "calibration_above_threshold": 5,
529
+ "future_false_positive_rate_guaranteed": false
530
+ },
531
+ "train_normal_count": 814,
532
+ "metrics": {
533
+ "image_auroc": 0.9547524752475247,
534
+ "average_precision": 0.9645187368797429,
535
+ "precision": 0.90625,
536
+ "recall": 0.87,
537
+ "f1": 0.8877551020408163,
538
+ "confusion_matrix": [
539
+ [
540
+ 92,
541
+ 9
542
+ ],
543
+ [
544
+ 13,
545
+ 87
546
+ ]
547
+ ],
548
+ "n_images": 201,
549
+ "pixel_auroc_224": 0.9805302802001331,
550
+ "pixel_average_precision_224": 0.33774957148695994,
551
+ "uncertain_fraction": 0.08955223880597014,
552
+ "latency_median_ms": null,
553
+ "peak_gpu_mb": null,
554
+ "false_positive_rate": 0.0891089108910891
555
+ },
556
+ "resolution_short_edge": 448,
557
+ "patch_size": 14,
558
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
559
+ "baseline_threshold": 0.16282716393470764,
560
+ "decision_policy": "normal-q95-v1"
561
+ },
562
+ "pcb4": {
563
+ "category": "pcb4",
564
+ "available": true,
565
+ "model_id": "dinov2-highres-pcb4-v1-q95-v1",
566
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
567
+ "profile": "dinov2_highres_v1",
568
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
569
+ "bank_sha256": "8847deec2a0b8daab9139e7680d502352161e994bb5d2fe4bc313df6af4cc5d5",
570
+ "threshold": 0.1401524841785431,
571
+ "uncertainty_margin": 0.007007624208927155,
572
+ "heatmap_scale": 0.10422959923744202,
573
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
574
+ "bank_size_bytes": 23248613,
575
+ "encoder_size_bytes": 88249960,
576
+ "calibration": {
577
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
578
+ "normal": 91,
579
+ "anomalous": 0,
580
+ "seed": 42,
581
+ "policy": "normal-q95-v1",
582
+ "quantile": 0.95,
583
+ "calibration_above_threshold": 5,
584
+ "future_false_positive_rate_guaranteed": false
585
+ },
586
+ "train_normal_count": 813,
587
+ "metrics": {
588
+ "image_auroc": 0.9865346534653465,
589
+ "average_precision": 0.9822685098306626,
590
+ "precision": 0.96,
591
+ "recall": 0.96,
592
+ "f1": 0.96,
593
+ "confusion_matrix": [
594
+ [
595
+ 97,
596
+ 4
597
+ ],
598
+ [
599
+ 4,
600
+ 96
601
+ ]
602
+ ],
603
+ "n_images": 201,
604
+ "pixel_auroc_224": 0.9806894408642699,
605
+ "pixel_average_precision_224": 0.3216614985757051,
606
+ "uncertain_fraction": 0.04477611940298507,
607
+ "latency_median_ms": null,
608
+ "peak_gpu_mb": null,
609
+ "false_positive_rate": 0.039603960396039604
610
+ },
611
+ "resolution_short_edge": 448,
612
+ "patch_size": 14,
613
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
614
+ "baseline_threshold": 0.17516569793224335,
615
+ "decision_policy": "normal-q95-v1"
616
+ },
617
+ "pipe_fryum": {
618
+ "category": "pipe_fryum",
619
+ "available": true,
620
+ "model_id": "dinov2-highres-pipe_fryum-v1-q95-v1",
621
+ "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation",
622
+ "profile": "dinov2_highres_v1",
623
+ "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1",
624
+ "bank_sha256": "e28bf35ca2e553dd21821230f34682b94b11a5d203459f61049a774663c0d819",
625
+ "threshold": 0.17671903371810913,
626
+ "uncertainty_margin": 0.008835951685905457,
627
+ "heatmap_scale": 0.1333938717842105,
628
+ "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence",
629
+ "bank_size_bytes": 18401041,
630
+ "encoder_size_bytes": 88249960,
631
+ "calibration": {
632
+ "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration",
633
+ "normal": 45,
634
+ "anomalous": 0,
635
+ "seed": 42,
636
+ "policy": "normal-q95-v1",
637
+ "quantile": 0.95,
638
+ "calibration_above_threshold": 3,
639
+ "future_false_positive_rate_guaranteed": false
640
+ },
641
+ "train_normal_count": 405,
642
+ "metrics": {
643
+ "image_auroc": 0.9891999999999999,
644
+ "average_precision": 0.9951337553868363,
645
+ "precision": 0.9801980198019802,
646
+ "recall": 0.99,
647
+ "f1": 0.9850746268656716,
648
+ "confusion_matrix": [
649
+ [
650
+ 48,
651
+ 2
652
+ ],
653
+ [
654
+ 1,
655
+ 99
656
+ ]
657
+ ],
658
+ "n_images": 150,
659
+ "pixel_auroc_224": 0.9927315263511816,
660
+ "pixel_average_precision_224": 0.47984772131593945,
661
+ "uncertain_fraction": 0.013333333333333334,
662
+ "latency_median_ms": null,
663
+ "peak_gpu_mb": null,
664
+ "false_positive_rate": 0.04
665
+ },
666
+ "resolution_short_edge": 448,
667
+ "patch_size": 14,
668
+ "foreground": "Unsupervised PCA threshold/sign heuristic; can fail",
669
+ "baseline_threshold": 0.18373285233974457,
670
+ "decision_policy": "normal-q95-v1"
671
+ }
672
+ },
673
+ "macro_mean": {
674
+ "image_auroc": 0.950126705170517,
675
+ "average_precision": 0.956391637511357,
676
+ "precision": 0.9046976613151382,
677
+ "recall": 0.8883333333333333,
678
+ "f1": 0.895741481363831,
679
+ "pixel_auroc_224": 0.9861669559777334,
680
+ "pixel_average_precision_224": 0.4315059138196397,
681
+ "false_positive_rate": 0.1110038503850385
682
+ },
683
+ "decision_policy": "macaroni-recall-v1",
684
+ "baseline_evaluation_sha256": "4265f2fe45c49d3e71dacba9883e935b190829511fa42ecbc45c26e495984ec0",
685
+ "validation_scope": "Normal-only calibration and cached-score/software consistency checks; future recall and false-alarm rates are not guaranteed.",
686
+ "decision_policy_reason": "User authorized focusing only on Macaroni1/2 recall, prioritizing anomaly detection with more false alarms and minimal compute.",
687
+ "policy_selection_context": "Operating policy adopted after examining development-exposed test-score diagnostics. Numeric thresholds use normal calibration only; no test-optimal threshold search or independent-validation claim.",
688
+ "source_sha256": {
689
+ "experiments\\dinov2_highres_v1\\pcb1\\normal_calibration.json": "8224a5c38e21ae2b65497c109f45ce586e231525d43946779e0309225faf7010",
690
+ "experiments\\dinov2_highres_v1\\pcb1\\test_progress.json": "ba9bdde38b06df345c8f5a72ff1358a40d04287f609cac4bbac629cd652e6640",
691
+ "experiments\\dinov2_highres_v1\\capsules\\normal_calibration.json": "05a2f76ac29bb3d3e794155587f90e2ad3099b2df1bc14b0c8b6447aaab6f4f6",
692
+ "experiments\\dinov2_highres_v1\\capsules\\test_progress.json": "a214382658449bec9468a1d1103775cfa989b9f4d96c728ea756b1539c7a05e6",
693
+ "experiments\\dinov2_highres_v1\\cashew\\normal_calibration.json": "20b872ab18468386c96cee420ecddff58d4d9bb40ceb16edbb77a7965413dac2",
694
+ "experiments\\dinov2_highres_v1\\cashew\\test_progress.json": "dc236ba067baeac20b431da6b323abdcccadbfdd4fb58148f26dd0b2fd4733c1",
695
+ "experiments\\dinov2_highres_v1\\candle\\normal_calibration.json": "097689c7796940d5bcb30117fa22f454b906c519d7a4472bdd87e6434a3eb500",
696
+ "experiments\\dinov2_highres_v1\\candle\\test_progress.json": "2ec3a02bcc0c95d94242d4d31469b53126ddeae9ce5d777f0706dec984c362b2",
697
+ "experiments\\dinov2_highres_v1\\chewinggum\\normal_calibration.json": "012178e1e91e311e511a7f8b2ebabbff4fe1146a7d6a2227e374c264c763b995",
698
+ "experiments\\dinov2_highres_v1\\chewinggum\\test_progress.json": "ea5102f1d9e668ad8ff256dfcba10813b3f3723e0b09606b87745f71347b1a0f",
699
+ "experiments\\dinov2_highres_v1\\fryum\\normal_calibration.json": "6cd8984692afd2c20825b45a2c18d07550367510e376ce6c70d5bb2e44990432",
700
+ "experiments\\dinov2_highres_v1\\fryum\\test_progress.json": "52e7dababf991acdeda16907ae38cc9a2599a0164becbfcd7b3bbd96658c944f",
701
+ "experiments\\dinov2_highres_v1\\macaroni1\\normal_calibration.json": "6c83ed692639479b8b18914c7bea0c884eea7a1c0583106ea9bcd3d30c01dfde",
702
+ "experiments\\dinov2_highres_v1\\macaroni1\\test_progress.json": "d67ebfb2159c5dbe1cee314c300deb04123751caefd99288e99961dcfac1bb04",
703
+ "experiments\\dinov2_highres_v1\\macaroni2\\normal_calibration.json": "8c80102797cc6d81fd1862ec5c27465b3293e206ccb0b2af40973526a93a96a6",
704
+ "experiments\\dinov2_highres_v1\\macaroni2\\test_progress.json": "12bfe59625f5039623c341451c9e4ce0721271d98d7a8a815b2dc443465a88d8",
705
+ "experiments\\dinov2_highres_v1\\pcb2\\normal_calibration.json": "3b0713db8eebc9f7ea81ac1e758c42799e325aa0050a3c0c2ac1454e7457cd3a",
706
+ "experiments\\dinov2_highres_v1\\pcb2\\test_progress.json": "3b08920766efc75a65d1f7f4518adb086241b0ba71e2659a20edcf57a783afdb",
707
+ "experiments\\dinov2_highres_v1\\pcb3\\normal_calibration.json": "2c0e355bca9f8554fad3715d3a31acf733b30788c7b7e97a931cd24fb4d6ebd3",
708
+ "experiments\\dinov2_highres_v1\\pcb3\\test_progress.json": "e5e8d8d7adb1198b6cdca2f5bda7da0e71b4e30a672ae93714eb6efe7aefff0b",
709
+ "experiments\\dinov2_highres_v1\\pcb4\\normal_calibration.json": "2b364ef709f3ead9196871d7f0351ae38f477fbf98d6f94ca8607128a853b28a",
710
+ "experiments\\dinov2_highres_v1\\pcb4\\test_progress.json": "dd844a6415590d7effee5ba32eb7f2fbd737d7967efafebd845af506fd7685ae",
711
+ "experiments\\dinov2_highres_v1\\pipe_fryum\\normal_calibration.json": "21b3357ff4836e8b4d7fb7fee7e48fc7579a62d9c11dbf888f2de05397a88d56",
712
+ "experiments\\dinov2_highres_v1\\pipe_fryum\\test_progress.json": "0af8805dd69be9f39b2bedb13f8bd15e853f326e1ed9940b540d26ff01cf6dbf"
713
+ },
714
+ "previous_evaluation_sha256": "8cb2bb91ed4a108e48dcbaa8744984e68b07d101d4d4262aa66592fd66927e22"
715
+ }