"<!DOCTYPE html>\n<html lang=\"zh\" data-theme=\"light\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>fulltext.txt — Vercel Design System</title>\n<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n<link href=\"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap\" rel=\"stylesheet\">\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css\">\n<style>\n\n:root {\n  /* Vercel Palette */\n  --geist-foreground: #171717;\n  --geist-background: #ffffff;\n  --geist-secondary: #4d4d4d;\n  --geist-tertiary: #666666;\n  --geist-quaternary: #808080;\n  --geist-border: #ebebeb;\n  --geist-surface-tint: #fafafa;\n  \n  /* Workflow Accents */\n  --develop-blue: #0a72ef;\n  --preview-pink: #de1d8d;\n  --ship-red: #ff5b4f;\n  \n  /* Interactive & Status */\n  --link-blue: #0072f5;\n  --ds-focus-color: hsla(212, 100%, 48%, 1);\n  --badge-blue-bg: #ebf5ff;\n  --badge-blue-text: #0068d6;\n  \n  /* Shadow-as-Border Philosophy */\n  --shadow-border: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n  --shadow-border-hover: rgba(0, 0, 0, 0.16) 0px 0px 0px 1px;\n  --shadow-card: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 2px, #fafafa 0px 0px 0px 1px;\n  --shadow-card-hover: rgba(0, 0, 0, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.06) 0px 4px 6px, #fafafa 0px 0px 0px 1px;\n  --shadow-card-full: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 2px, rgba(0, 0, 0, 0.04) 0px 8px 8px -8px, #fafafa 0px 0px 0px 1px;\n  --shadow-ring: rgb(235, 235, 235) 0px 0px 0px 1px;\n  \n  /* Radius Scale */\n  --radius-xs: 2px;\n  --radius-sm: 4px;\n  --radius-md: 6px;\n  --radius-lg: 8px;\n  --radius-xl: 12px;\n  --radius-pill: 9999px;\n}\n\n[data-theme=\"dark\"] {\n  --geist-foreground: #ededed;\n  --geist-background: #000000;\n  --geist-secondary: #a1a1a1;\n  --geist-tertiary: #888888;\n  --geist-quaternary: #666666;\n  --geist-border: #222222;\n  --geist-surface-tint: #0a0a0a;\n  \n  --shadow-border: rgba(255, 255, 255, 0.14) 0px 0px 0px 1px;\n  --shadow-border-hover: rgba(255, 255, 255, 0.28) 0px 0px 0px 1px;\n  --shadow-card: rgba(255, 255, 255, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.4) 0px 2px 4px, #111111 0px 0px 0px 1px;\n  --shadow-card-hover: rgba(255, 255, 255, 0.2) 0px 0px 0px 1px, rgba(0, 0, 0, 0.5) 0px 6px 12px, #111111 0px 0px 0px 1px;\n  --shadow-card-full: rgba(255, 255, 255, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.5) 0px 8px 16px -4px, #111111 0px 0px 0px 1px;\n  --shadow-ring: rgb(40, 40, 40) 0px 0px 0px 1px;\n  \n  --badge-blue-bg: rgba(10, 114, 239, 0.15);\n  --badge-blue-text: #70b5ff;\n}\n\n* { box-sizing: border-box; }\nhtml { scroll-behavior: smooth; }\nbody {\n  margin: 0;\n  font-family: \"Geist\", Arial, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n  background-color: var(--geist-background);\n  color: var(--geist-foreground);\n  font-feature-settings: \"liga\" 1;\n  -webkit-font-smoothing: antialiased;\n  min-height: 100vh;\n}\n\na {\n  color: inherit;\n  text-decoration: none;\n  transition: color 0.15s ease;\n}\n\n/* 导航栏 (Vercel Clean Sticky Nav) */\n.vercel-nav {\n  position: sticky;\n  top: 0;\n  background-color: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  z-index: 100;\n  padding: 0 24px;\n  height: 64px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n}\n.nav-brand {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n}\n.vercel-triangle {\n  width: 22px;\n  height: 19px;\n  fill: var(--geist-foreground);\n}\n.nav-title {\n  font-size: 16px;\n  font-weight: 600;\n  letter-spacing: -0.32px;\n  color: var(--geist-foreground);\n}\n.nav-badge-pill {\n  font-family: \"Geist Mono\", ui-monospace, monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  background: var(--badge-blue-bg);\n  color: var(--badge-blue-text);\n  padding: 2px 8px;\n  border-radius: var(--radius-pill);\n}\n\n.nav-links {\n  display: flex;\n  align-items: center;\n  gap: 24px;\n}\n.nav-link {\n  font-size: 14px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  text-decoration: none;\n  transition: color 0.15s;\n}\n.nav-link:hover, .nav-link.active {\n  color: var(--geist-foreground);\n}\n.nav-link.active {\n  font-weight: 600;\n}\n\n.nav-actions {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n}\n\n/* 按钮规范 */\n.btn-primary-dark {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border: none;\n  padding: 8px 16px;\n  border-radius: var(--radius-md);\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  text-decoration: none;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  transition: opacity 0.15s;\n}\n.btn-primary-dark:hover {\n  opacity: 0.9;\n}\n.btn-secondary-white {\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  box-shadow: var(--shadow-border);\n  border: none;\n  padding: 8px 16px;\n  border-radius: var(--radius-md);\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  text-decoration: none;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  transition: background 0.15s, box-shadow 0.15s;\n}\n.btn-secondary-white:hover {\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border-hover);\n}\n.theme-toggle-btn {\n  background: transparent;\n  border: none;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  width: 36px;\n  height: 36px;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: var(--geist-foreground);\n}\n\n/* 核心容器 */\n.vercel-container {\n  max-width: 1200px;\n  margin: 0 auto;\n  padding: 56px 24px 100px;\n}\n\n/* Hero Section (Gallery Emptiness + Negative Letter-spacing) */\n.vercel-hero {\n  text-align: center;\n  max-width: 860px;\n  margin: 0 auto 56px;\n}\n.hero-stage-badge {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  padding: 4px 14px;\n  border-radius: var(--radius-pill);\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  margin-bottom: 24px;\n}\n.stage-dot {\n  width: 7px;\n  height: 7px;\n  border-radius: 50%;\n}\n.vercel-hero h1 {\n  font-size: 48px;\n  font-weight: 600;\n  line-height: 1.05;\n  letter-spacing: -2.4px;\n  color: var(--geist-foreground);\n  margin: 0 0 16px;\n}\n.vercel-hero p {\n  font-size: 20px;\n  font-weight: 400;\n  line-height: 1.80;\n  color: var(--geist-secondary);\n  margin: 0 auto 28px;\n}\n\n/* Workflow Pipeline (Develop -> Preview -> Ship) */\n.workflow-pipeline {\n  display: grid;\n  grid-template-columns: repeat(3, 1fr);\n  gap: 16px;\n  margin-bottom: 48px;\n}\n@media (max-width: 768px) {\n  .workflow-pipeline { grid-template-columns: 1fr; }\n}\n.workflow-step {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px 22px;\n  transition: box-shadow 0.2s;\n}\n.workflow-step:hover {\n  box-shadow: var(--shadow-card-hover);\n}\n.step-mono-label {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 12px;\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  margin-bottom: 8px;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n}\n.step-title {\n  font-size: 20px;\n  font-weight: 600;\n  letter-spacing: -0.96px;\n  color: var(--geist-foreground);\n  margin-bottom: 6px;\n}\n.step-desc {\n  font-size: 14px;\n  color: var(--geist-secondary);\n  line-height: 1.5;\n}\n\n/* Metric Cards (Section 4 Spec) */\n.metric-grid {\n  display: grid;\n  grid-template-columns: repeat(4, 1fr);\n  gap: 16px;\n  margin-bottom: 48px;\n}\n@media (max-width: 900px) {\n  .metric-grid { grid-template-columns: repeat(2, 1fr); }\n}\n.metric-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n}\n.metric-number {\n  font-size: 40px;\n  font-weight: 600;\n  line-height: 1.0;\n  letter-spacing: -2.4px;\n  color: var(--geist-foreground);\n  margin-bottom: 8px;\n  font-feature-settings: \"tnum\" 1;\n}\n.metric-label {\n  font-size: 14px;\n  color: var(--geist-secondary);\n  line-height: 1.4;\n}\n\n/* VAD 专栏 Banner (Ship Red & Vercel Clean) */\n.vad-showcase {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-xl);\n  padding: 32px;\n  margin-bottom: 48px;\n  position: relative;\n}\n.vad-header-row {\n  display: flex;\n  align-items: baseline;\n  justify-content: space-between;\n  flex-wrap: wrap;\n  gap: 12px;\n  margin-bottom: 12px;\n}\n.vad-header-row h2 {\n  font-size: 32px;\n  font-weight: 600;\n  letter-spacing: -1.28px;\n  color: var(--geist-foreground);\n  margin: 0;\n}\n.vad-pillars-grid {\n  display: grid;\n  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n  gap: 14px;\n  margin-top: 24px;\n}\n.vad-pillar-item {\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  padding: 14px 16px;\n}\n.vad-pillar-title {\n  font-size: 14px;\n  font-weight: 600;\n  color: var(--ship-red);\n  margin-bottom: 4px;\n}\n.vad-pillar-text {\n  font-size: 13px;\n  color: var(--geist-secondary);\n  line-height: 1.5;\n}\n.vad-filter-bar {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n  margin: 24px 0 16px;\n  padding: 12px 16px;\n  background: var(--geist-surface-tint);\n  border-radius: var(--radius-md);\n  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);\n}\n.vad-filter-btn {\n  font-family: 'Geist', sans-serif;\n  font-size: 13px;\n  font-weight: 500;\n  padding: 6px 14px;\n  border-radius: 9999px;\n  border: none;\n  background: transparent;\n  color: var(--geist-secondary);\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n.vad-filter-btn:hover {\n  color: var(--geist-foreground);\n  background: rgba(0,0,0,0.05);\n}\n.vad-filter-btn.active {\n  background: #171717;\n  color: #ffffff;\n}\n.vad-search-input {\n  font-family: 'Geist', sans-serif;\n  font-size: 13px;\n  padding: 7px 12px;\n  border-radius: 6px;\n  border: 1px solid var(--geist-border);\n  background: #ffffff;\n  color: var(--geist-foreground);\n  width: 280px;\n  outline: none;\n  transition: border-color 0.15s, box-shadow 0.15s;\n}\n.vad-search-input:focus {\n  border-color: #0a72ef;\n  box-shadow: 0 0 0 2px rgba(10, 114, 239, 0.2);\n}\n\n/* 控制栏：搜索、视图、筛选 */\n.control-bar {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  margin-bottom: 24px;\n  flex-wrap: wrap;\n}\n.search-input-wrap {\n  position: relative;\n  flex: 1;\n  max-width: 480px;\n}\n.search-input {\n  width: 100%;\n  height: 40px;\n  padding: 0 38px 0 14px;\n  font-family: \"Geist\", sans-serif;\n  font-size: 14px;\n  color: var(--geist-foreground);\n  background: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  border: none;\n  border-radius: var(--radius-md);\n  outline: none;\n  transition: box-shadow 0.15s;\n}\n.search-input:focus {\n  outline: 2px solid var(--ds-focus-color);\n  box-shadow: none;\n}\n.search-kbd {\n  position: absolute;\n  right: 12px;\n  top: 50%;\n  transform: translateY(-50%);\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  color: var(--geist-quaternary);\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  padding: 2px 6px;\n  border-radius: var(--radius-sm);\n}\n\n.view-switcher {\n  display: flex;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  background: var(--geist-background);\n  padding: 2px;\n}\n.view-btn {\n  background: transparent;\n  border: none;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-tertiary);\n  padding: 6px 12px;\n  border-radius: var(--radius-sm);\n  cursor: pointer;\n  transition: color 0.15s, background 0.15s;\n}\n.view-btn.active {\n  background: var(--geist-surface-tint);\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n/* 筛选芯片行 (Filter Pill Strip) */\n.filter-group-strip {\n  display: flex;\n  flex-direction: column;\n  gap: 12px;\n  margin-bottom: 28px;\n  padding: 16px 20px;\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-lg);\n}\n.filter-row {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  flex-wrap: wrap;\n}\n.filter-label-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  color: var(--geist-quaternary);\n  min-width: 68px;\n}\n.pill-badge {\n  background: var(--geist-background);\n  color: var(--geist-secondary);\n  box-shadow: var(--shadow-border);\n  border: none;\n  padding: 3px 12px;\n  border-radius: var(--radius-pill);\n  font-size: 12px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: all 0.15s;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n}\n.pill-badge:hover {\n  color: var(--geist-foreground);\n  box-shadow: var(--shadow-border-hover);\n}\n.pill-badge.active {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  font-weight: 600;\n  box-shadow: none;\n}\n.pill-badge.active-blue {\n  background: var(--develop-blue);\n  color: #ffffff;\n  box-shadow: none;\n}\n.pill-badge.active-red {\n  background: var(--ship-red);\n  color: #ffffff;\n  box-shadow: none;\n}\n\n/* Bento Grid Cards (Section 4 & 6 Spec) */\n.card-grid-bento {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));\n  gap: 16px;\n}\n.vercel-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n  transition: box-shadow 0.2s, transform 0.2s;\n  text-decoration: none;\n  color: inherit;\n  overflow: hidden;\n  min-width: 0;\n  word-break: break-word;\n}\n.vercel-card:hover {\n  box-shadow: var(--shadow-card-hover);\n  transform: translateY(-2px);\n}\n.card-top {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  margin-bottom: 12px;\n  gap: 8px;\n}\n.card-tag-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  color: var(--geist-quaternary);\n  letter-spacing: 0.5px;\n}\n.status-pill-badge {\n  padding: 2px 8px;\n  border-radius: var(--radius-pill);\n  font-size: 11px;\n  font-weight: 500;\n  flex-shrink: 0;\n}\n.pub-accepted { background: #ebfdf2; color: #027a48; }\n.pub-workshop { background: #eff8ff; color: #175cd3; }\n.pub-submitted { background: #fff8e6; color: #b54708; }\n.pub-preprint { background: #f2f4f7; color: #475467; }\n.pub-other { background: #f9f5ff; color: #6941c6; }\n\n[data-theme=\"dark\"] .pub-accepted { background: rgba(2, 122, 72, 0.2); color: #32d583; }\n[data-theme=\"dark\"] .pub-workshop { background: rgba(23, 92, 211, 0.2); color: #84caff; }\n[data-theme=\"dark\"] .pub-submitted { background: rgba(181, 71, 8, 0.2); color: #fec84b; }\n[data-theme=\"dark\"] .pub-preprint { background: rgba(71, 84, 103, 0.2); color: #98a2b3; }\n[data-theme=\"dark\"] .pub-other { background: rgba(105, 65, 198, 0.2); color: #d6bbfb; }\n\n/* 必读标杆徽章 (Vercel Amber Accent) */\n.milestone-badge {\n  display: inline-flex;\n  align-items: center;\n  gap: 3px;\n  padding: 2px 7px;\n  border-radius: var(--radius-pill);\n  font-size: 11px;\n  font-weight: 600;\n  white-space: nowrap;\n  flex-shrink: 0;\n  transition: all 0.15s ease;\n}\n.milestone-badge.ms-idea, .milestone-badge:not([class*=\"ms-\"]) {\n  color: #b54708;\n  background: #fff8e6;\n  border: 1px solid rgba(247, 144, 9, 0.35);\n  box-shadow: 0 1px 2px rgba(181, 71, 8, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-idea, [data-theme=\"dark\"] .milestone-badge:not([class*=\"ms-\"]) {\n  color: #fec84b;\n  background: rgba(181, 71, 8, 0.22);\n  border-color: rgba(254, 200, 75, 0.35);\n}\n.milestone-badge.ms-writing {\n  color: #6941c6;\n  background: #f9f5ff;\n  border: 1px solid rgba(105, 65, 198, 0.3);\n  box-shadow: 0 1px 2px rgba(105, 65, 198, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-writing {\n  color: #d6bbfb;\n  background: rgba(105, 65, 198, 0.22);\n  border-color: rgba(214, 187, 251, 0.35);\n}\n.milestone-badge.ms-value {\n  color: #027a48;\n  background: #ebfdf2;\n  border: 1px solid rgba(2, 122, 72, 0.3);\n  box-shadow: 0 1px 2px rgba(2, 122, 72, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-value {\n  color: #32d583;\n  background: rgba(2, 122, 72, 0.22);\n  border-color: rgba(50, 213, 131, 0.35);\n}\n\n/* 论文正文图表与插图卡片样式 (Geist Design) */\n.paper-figure, .article-body figure {\n  margin: 32px auto;\n  text-align: center;\n  max-width: 100%;\n}\n.paper-figure img, .article-body img {\n  max-width: 96%;\n  height: auto;\n  border-radius: var(--radius-md);\n  border: 1px solid var(--geist-border);\n  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);\n  background: #ffffff;\n  transition: transform 0.2s ease, box-shadow 0.2s ease;\n  display: block;\n  margin: 0 auto;\n}\n.paper-figure img:hover, .article-body img:hover {\n  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);\n}\n.paper-figure figcaption, .article-body figcaption {\n  font-size: 13px;\n  color: var(--geist-secondary);\n  margin-top: 10px;\n  line-height: 1.6;\n  font-style: italic;\n  max-width: 850px;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n/* VAD 视图切换器 View Switcher */\n.vad-view-switcher {\n  display: inline-flex;\n  padding: 3px;\n  background: var(--geist-secondary-bg);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  margin-bottom: 20px;\n  gap: 2px;\n}\n.view-switch-btn {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  padding: 6px 14px;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  border-radius: 6px;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.view-switch-btn:hover {\n  color: var(--geist-foreground);\n  background: rgba(0, 0, 0, 0.04);\n}\n[data-theme=\"dark\"] .view-switch-btn:hover {\n  background: rgba(255, 255, 255, 0.06);\n}\n.view-switch-btn.active {\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  font-weight: 600;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n}\n\n/* 关系图谱 Graph View Styles */\n.graph-container {\n  position: relative;\n  width: 100%;\n  height: 720px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: var(--radius-lg);\n  overflow: hidden;\n  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);\n  margin-bottom: 40px;\n}\n.graph-toolbar {\n  position: absolute;\n  top: 14px;\n  left: 14px;\n  right: 14px;\n  z-index: 10;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  padding: 8px 14px;\n  border-radius: 8px;\n  box-shadow: 0 4px 16px rgba(0,0,0,0.06);\n  flex-wrap: wrap;\n  gap: 8px;\n}\n.graph-tool-title {\n  font-size: 13px;\n  font-weight: 700;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  color: var(--geist-foreground);\n}\n.graph-filter-group {\n  display: flex;\n  gap: 6px;\n  align-items: center;\n  flex-wrap: wrap;\n}\n.graph-chip {\n  font-size: 11px;\n  padding: 3px 8px;\n  border-radius: 4px;\n  border: 1px solid var(--geist-border);\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n.graph-chip:hover { background: var(--geist-secondary-bg); }\n.graph-chip.active {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border-color: var(--geist-foreground);\n}\n.graph-search-input {\n  padding: 3px 8px;\n  font-size: 11px;\n  border-radius: 4px;\n  border: 1px solid var(--geist-border);\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  outline: none;\n  width: 150px;\n}\n#vad-graph-svg {\n  width: 100%;\n  height: 100%;\n  cursor: grab;\n}\n#vad-graph-svg:active { cursor: grabbing; }\n.graph-legend {\n  position: absolute;\n  bottom: 14px;\n  left: 14px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  padding: 10px 14px;\n  font-size: 11px;\n  box-shadow: 0 4px 16px rgba(0,0,0,0.06);\n  z-index: 10;\n  line-height: 1.6;\n  pointer-events: none;\n}\n.graph-legend-row { display: flex; align-items: center; gap: 8px; }\n.graph-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }\n.graph-info-drawer {\n  position: absolute;\n  top: 66px;\n  right: 14px;\n  width: 310px;\n  max-height: 620px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  box-shadow: 0 8px 30px rgba(0,0,0,0.12);\n  z-index: 10;\n  padding: 16px;\n  overflow-y: auto;\n  display: none;\n  backdrop-filter: blur(10px);\n  transition: transform 0.2s ease, opacity 0.2s ease;\n}\n.graph-drawer-close {\n  position: absolute;\n  top: 10px;\n  right: 12px;\n  cursor: pointer;\n  font-size: 16px;\n  color: var(--geist-tertiary);\n}\n.graph-drawer-badge {\n  display: inline-block;\n  padding: 2px 6px;\n  border-radius: 4px;\n  font-size: 10px;\n  font-weight: 600;\n  margin-bottom: 6px;\n}\n.graph-drawer-title {\n  font-size: 13px;\n  font-weight: 700;\n  line-height: 1.4;\n  margin-bottom: 8px;\n  color: var(--geist-foreground);\n}\n.graph-drawer-meta {\n  font-size: 11px;\n  color: var(--geist-secondary);\n  margin-bottom: 12px;\n}\n.graph-drawer-core {\n  font-size: 12px;\n  line-height: 1.6;\n  color: var(--geist-foreground);\n  background: var(--geist-secondary-bg);\n  padding: 8px 10px;\n  border-radius: 6px;\n  margin-bottom: 12px;\n  border: 1px solid var(--geist-border);\n}\n.graph-drawer-link {\n  display: block;\n  text-align: center;\n  padding: 7px 12px;\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border-radius: 6px;\n  font-size: 12px;\n  font-weight: 600;\n  text-decoration: none;\n  transition: opacity 0.15s ease;\n  margin-bottom: 6px;\n}\n.graph-drawer-link:hover { opacity: 0.85; }\n.graph-drawer-pdf-link {\n  display: block;\n  text-align: center;\n  padding: 6px 12px;\n  background: var(--geist-secondary-bg);\n  color: var(--geist-foreground);\n  border: 1px solid var(--geist-border);\n  border-radius: 6px;\n  font-size: 11px;\n  font-weight: 500;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.graph-drawer-pdf-link:hover { background: var(--geist-border); }\n.node-circle {\n  cursor: pointer;\n  transition: r 0.2s, stroke-width 0.2s;\n}\n.node-label {\n  font-size: 10px;\n  font-weight: 600;\n  fill: var(--geist-foreground);\n  pointer-events: none;\n  text-shadow: 0 1px 2px var(--geist-background);\n}\n.link-line {\n  stroke: var(--geist-border);\n  stroke-opacity: 0.6;\n  stroke-width: 1.2;\n  transition: stroke 0.2s, stroke-width 0.2s, stroke-opacity 0.2s;\n}\n.link-label {\n  font-size: 9px;\n  fill: var(--geist-tertiary);\n  pointer-events: none;\n  text-anchor: middle;\n}\n\n/* 引用框与警示框 Alerts */\n.callout-alert {\n  margin: 20px 0;\n  padding: 14px 18px;\n  border-radius: var(--radius-md);\n  transition: all 0.15s ease;\n}\n.callout-important, .callout-idea {\n  border-left: 4px solid #b54708;\n  background: rgba(181, 71, 8, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(247, 144, 9, 0.3);\n}\n[data-theme=\"dark\"] .callout-important, [data-theme=\"dark\"] .callout-idea {\n  border-left-color: #fec84b;\n  background: rgba(181, 71, 8, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(254, 200, 75, 0.25);\n}\n.callout-writing {\n  border-left: 4px solid #6941c6;\n  background: rgba(105, 65, 198, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(105, 65, 198, 0.3);\n}\n[data-theme=\"dark\"] .callout-writing {\n  border-left-color: #d6bbfb;\n  background: rgba(105, 65, 198, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(214, 187, 251, 0.25);\n}\n.callout-value {\n  border-left: 4px solid #027a48;\n  background: rgba(2, 122, 72, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(2, 122, 72, 0.3);\n}\n[data-theme=\"dark\"] .callout-value {\n  border-left-color: #32d583;\n  background: rgba(2, 122, 72, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(50, 213, 131, 0.25);\n}\n\n.card-title {\n  font-size: 16.5px;\n  font-weight: 600;\n  line-height: 1.42;\n  letter-spacing: -0.4px;\n  color: var(--geist-foreground);\n  margin: 0 0 10px;\n  word-break: break-word;\n  overflow-wrap: anywhere;\n  hyphens: auto;\n}\n.card-title a {\n  color: var(--geist-foreground);\n  text-decoration: none;\n  display: inline;\n  transition: color 0.15s ease;\n}\n.card-title a:hover {\n  color: var(--develop-blue);\n  text-decoration: none;\n}\n.card-id-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-quaternary);\n  margin-right: 5px;\n}\n.card-meta-row {\n  display: flex;\n  gap: 6px;\n  flex-wrap: wrap;\n  margin-bottom: 12px;\n}\n.meta-token {\n  font-size: 12px;\n  color: var(--geist-tertiary);\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-ring);\n  padding: 2px 7px;\n  border-radius: var(--radius-sm);\n  white-space: nowrap;\n}\n.card-body-text {\n  font-size: 13.5px;\n  color: var(--geist-secondary);\n  line-height: 1.6;\n  margin-bottom: 16px;\n  flex-grow: 1;\n  word-break: break-word;\n  overflow-wrap: anywhere;\n}\n.card-body-text strong {\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n.card-footer {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  border-top: 1px solid var(--geist-border);\n  padding-top: 14px;\n}\n.card-link-action {\n  font-size: 13.5px;\n  font-weight: 500;\n  color: var(--link-blue);\n  display: inline-flex;\n  align-items: center;\n  gap: 4px;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.card-link-action:hover {\n  opacity: 0.85;\n  transform: translateX(2px);\n}\na.meta-token {\n  transition: all 0.15s ease;\n  cursor: pointer;\n  text-decoration: none;\n}\na.meta-token:hover {\n  background: var(--geist-selection);\n  color: var(--geist-foreground);\n  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);\n}\n\n/* 紧凑列表视图 (List View) */\n.card-list-view {\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n}\n.list-row-item {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-md);\n  padding: 12px 18px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  transition: box-shadow 0.15s;\n}\n.list-row-item:hover {\n  box-shadow: var(--shadow-card-hover);\n}\n\n/* 阅读详情页 (Report Detail) */\n.reading-container {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) 260px;\n  gap: 40px;\n  align-items: start;\n}\n@media (max-width: 960px) {\n  .reading-container { grid-template-columns: 1fr; }\n  .reading-sidebar { display: none; }\n}\n\n.report-header-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 28px 32px;\n  margin-bottom: 28px;\n}\n.crumb-bar {\n  font-size: 13px;\n  color: var(--geist-tertiary);\n  margin-bottom: 10px;\n}\n.report-title {\n  font-size: 32px;\n  font-weight: 600;\n  letter-spacing: -1.28px;\n  margin: 0 0 16px;\n  color: var(--geist-foreground);\n}\n.report-action-buttons {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  flex-wrap: wrap;\n  border-top: 1px solid var(--geist-border);\n  padding-top: 16px;\n  margin-top: 16px;\n}\n\n.article-body {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-lg);\n  padding: 36px 42px 80px;\n  font-size: 16px;\n  line-height: 1.75;\n  color: var(--geist-foreground);\n}\n.article-body h1, .article-body h2, .article-body h3 {\n  color: var(--geist-foreground);\n  scroll-margin-top: 80px;\n}\n.article-body h1 { font-size: 28px; font-weight: 600; letter-spacing: -1.28px; border-bottom: 1px solid var(--geist-border); padding-bottom: 8px; margin-top: 32px; }\n.article-body h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.96px; border-bottom: 1px solid var(--geist-border); padding-bottom: 6px; margin-top: 36px; }\n.article-body h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.32px; margin-top: 26px; }\n.article-body table {\n  width: 100%;\n  border-collapse: collapse;\n  margin: 24px 0;\n  font-size: 14px;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  overflow: hidden;\n}\n.article-body th, .article-body td {\n  padding: 10px 14px;\n  text-align: left;\n  border-bottom: 1px solid var(--geist-border);\n}\n.article-body th {\n  background: var(--geist-surface-tint);\n  font-weight: 600;\n  color: var(--geist-foreground);\n}\n.article-body blockquote {\n  border-left: 2px solid var(--geist-foreground);\n  margin: 20px 0;\n  padding: 8px 18px;\n  color: var(--geist-secondary);\n  font-style: normal;\n}\n.article-body code {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 13.5px;\n  box-shadow: var(--shadow-ring);\n  background: var(--geist-surface-tint);\n  padding: 2px 6px;\n  border-radius: var(--radius-sm);\n}\n.article-body pre {\n  position: relative;\n  background: #000000;\n  color: #ededed;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  padding: 18px;\n  margin: 24px 0;\n  overflow-x: auto;\n}\n.article-body pre code {\n  background: transparent;\n  box-shadow: none;\n  padding: 0;\n  color: inherit;\n  font-size: 13px;\n}\n.copy-code-btn {\n  position: absolute;\n  top: 8px;\n  right: 10px;\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  background: #171717;\n  color: #ffffff;\n  border: 1px solid #333333;\n  padding: 3px 8px;\n  border-radius: var(--radius-sm);\n  cursor: pointer;\n}\n\n/* 侧边大纲 (TOC) */\n.reading-sidebar {\n  position: sticky;\n  top: 80px;\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n  max-height: calc(100vh - 100px);\n  overflow-y: auto;\n}\n.sidebar-toc-title {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 12px;\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  color: var(--geist-quaternary);\n  margin-bottom: 12px;\n}\n.reading-sidebar ul {\n  list-style: none;\n  padding-left: 0;\n  margin: 0;\n  font-size: 13px;\n}\n.reading-sidebar li {\n  margin: 6px 0;\n}\n.reading-sidebar ul ul {\n  padding-left: 14px;\n}\n.reading-sidebar a {\n  color: var(--geist-secondary);\n  text-decoration: none;\n  transition: color 0.15s;\n}\n.reading-sidebar a:hover, .reading-sidebar a.active {\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n/* 后台管理 (/admin) */\n.admin-card-container {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-lg);\n  padding: 32px;\n  margin-bottom: 32px;\n}\n.form-row-2 {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 16px;\n  margin-bottom: 16px;\n}\n@media (max-width: 600px) {\n  .form-row-2 { grid-template-columns: 1fr; }\n}\n.form-field {\n  display: flex;\n  flex-direction: column;\n  gap: 6px;\n  margin-bottom: 16px;\n}\n.form-field label {\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-foreground);\n}\n.form-field input, .form-field select, .form-field textarea {\n  font-family: \"Geist\", sans-serif;\n  font-size: 14px;\n  padding: 9px 12px;\n  background: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  border: none;\n  border-radius: var(--radius-md);\n  color: var(--geist-foreground);\n  outline: none;\n}\n.form-field input:focus, .form-field select:focus, .form-field textarea:focus {\n  outline: 2px solid var(--ds-focus-color);\n  box-shadow: none;\n}\n\n/* 语法高亮 (Console Blue / Purple / Pink) */\n.codehilite .k, .codehilite .kd, .codehilite .kn { color: #eb367f; font-weight: 500; }\n.codehilite .s, .codehilite .s1, .codehilite .s2 { color: #0070f3; }\n.codehilite .nf, .codehilite .na { color: #7928ca; font-weight: 500; }\n.codehilite .c, .codehilite .c1 { color: #666666; font-style: italic; }\n.codehilite .mi, .codehilite .mf { color: #ff5b4f; }\n\n</style>\n\n</head>\n<body>\n\n    <nav class=\"vercel-nav\">\n      <div class=\"nav-brand\">\n        <a href=\"/\" style=\"display:flex;align-items:center;gap:10px;text-decoration:none\">\n          <svg class=\"vercel-triangle\" viewBox=\"0 0 76 65\" fill=\"none\">\n            <path d=\"M37.5274 0L75.0548 65H0L37.5274 0Z\" fill=\"currentColor\"/>\n          </svg>\n          <span class=\"nav-title\">Agent Harness KB</span>\n        </a>\n        <span class=\"nav-badge-pill\">Geist 2.0</span>\n      </div>\n\n      <div class=\"nav-links\">\n        <a class=\"nav-link \" href=\"/\">全景总览</a>\n        <a class=\"nav-link \" href=\"/vad\" style=\"color:var(--ship-red)\">🎯 VAD 专栏 (144)</a>\n        <a class=\"nav-link\" href=\"https://m0rtzz.github.io/paper-notes/\" target=\"_blank\" rel=\"noopener\">顶会 669 篇 ↗</a>\n        <a class=\"nav-link\" href=\"/download/all\">整库打包</a>\n        \n      </div>\n\n      <div class=\"nav-actions\">\n        \n        <button class=\"theme-toggle-btn\" id=\"theme-toggle-btn\" onclick=\"toggleTheme()\" title=\"切换亮暗主题\">🌙</button>\n      </div>\n    </nav>\n    \n<main class=\"vercel-container\">\n\n        <div class=\"report-header-card\">\n          <div class=\"crumb-bar\"><a href=\"/\">Home</a> / <b>fulltext.txt</b></div>\n          <h1 class=\"report-title\">fulltext.txt</h1>\n          <div class=\"report-action-buttons\">\n            <a class=\"btn-primary-dark\" href=\"?dl=1\">Download Text</a>\n          </div>\n        </div>\n        <article class=\"article-body\"><pre><code>Integration of deep generative Anomaly Detection\nalgorithm in high-speed industrial line\nNiccolò Ferrari1,2*, Nicola Zanarini2 , Michele Fraccaroli1 ,\nAlice Bizzarri1 , Evelina Lamma1\n\narXiv:2603.07577v1 [cs.CV] 8 Mar 2026\n\n1*\n\nDepartment of Engineering, University of Ferrara, Via Saragat 1,\nFerrara, 44122, Italy.\n2\nBonfiglioli Engineering, Via Amerigo Vespucci 20, Ferrara, 44124, Italy.\n\n*Corresponding author(s). E-mail(s): niccolo.ferrari@unife.it;\nAbstract\nIndustrial visual inspection in pharmaceutical production requires high accuracy\nunder strict constraints on cycle time, hardware footprint, and operational cost.\nManual inline inspection is still common, but it is affected by operator variability and limited throughput. Classical rule-based computer vision pipelines\nare often rigid and difficult to scale to highly variable production scenarios. To\naddress these limitations, we present a semi-supervised anomaly detection framework based on a generative adversarial architecture with a residual autoencoder\nand a dense bottleneck, specifically designed for online deployment on a highspeed Blow-Fill-Seal (BFS) line. The model is trained only on nominal samples\nand detects anomalies through reconstruction residuals, providing both classification and spatial localization via heatmaps. The training set contains 2,815,200\ngrayscale patches. Experiments on a real industrial test kit show high detection performance while satisfying timing constraints compatible with a 500 ms\nacquisition slot.\nKeywords: Anomaly Detection; Industrial automation; Machine Vision; Generative\nAdversarial Network; Automated Quality Control; Big data\n\n1 Acknowledgments\nThe authors would like to thank Bonfiglioli Engineering for providing a real-case\ndataset to test the software developed in this work. The first author is supported\nby an industrial PhD funded by Bonfiglioli Engineering, Ferrara, Italy. Alice Bizzarri\n1\n\n\fis supported by a National PhD funded by Politecnico di Torino, Torino, Italy and\nUniversità di Ferrara, Ferrara, Italy.\n\n2 Nomenclature\nAutoEncoder\nAE\nVariational AutoEncoder\nVAE\nConvolutional Neural Network\nCNN\nRecurrent Neural Network\nRNN\nLong Short Time Memory\nLSTM\nGenerative Adversarial Network\nGAN\nGenerative subnet of the GAN\nGenerator\nAdversarial subnet of the GAN\nDiscriminator\nDiscriminative net U-Net subsequent to the GAN used for segmentation\nfully-Convolutional Residual AutoEncoder\nCRAE\nDense-bottleneck Residual AutoEncoder\nDRAE\nArea Under the Receiver Operating Characteristic\nAUROC\nRegion Of Interest\nROI\nStructural Similarity Index Measure\nSSIM\nBlow Fill Seal\nBFS\n\n3 Introduction\nIndustrial applications increasingly require machine learning solutions for demanding\ntasks such as inline visual anomaly detection. In real deployments, models must satisfy\nstringent constraints on hardware resources and throughput while preserving high\ninspection accuracy. As a consequence, technical feasibility is as relevant as raw model\nperformance.\nAnomaly detection for machine vision is particularly relevant in the pharmaceutical\nsector, where non-destructive quality controls must be both accurate and fast. For\nthis reason, pharmaceutical manufacturers are investing in integrating deep learning\nsystems into production-line automation. In practice, system design must balance the\nfollowing constraints:\n1. Accuracy (missed rejects and false rejects)\n2. Hardware constraints\n3. Total cost of ownership\nAccuracy has a dual impact: it directly affects patient safety and, in parallel, business\noutcomes. Hardware and cost are correlated but not equivalent; hardware choices\ninfluence footprint, maintainability, and integration complexity in addition to direct\nexpenditure.\nIn many production sites, quality control still relies on manual inspection. This\nprocess is vulnerable to non-systematic errors, including oversight and attention loss,\nand therefore limits both consistency and throughput. Cosmetic inspection and particle detection are especially challenging because decisions rely on perceptual cues that\nare difficult to formalize analytically.\n2\n\n\fClassical procedural algorithms are typically developed ad hoc from limited sets\nof compliant and anomalous examples. They rely on handcrafted thresholds, heuristic\npattern matching, and many tunable parameters. Although this may appear flexible,\nthe resulting systems are usually tightly coupled to a specific product and image\nconfiguration, hence difficult to scale or transfer. In addition, oversimplified analytical\nmodels often fail to separate process noise from true defects (e.g., moving bubbles vs.\nforeign particles), making robust deployment difficult.\nDeep learning is currently the state of the art for real-time anomaly detection in\nmachine vision. Supervised classification is mature and widely studied; however, it is\nmost effective when classes are balanced [28].\nIn industrial production, compliant samples largely outnumber anomalous ones.\nThis imbalance makes supervised training problematic. A practical alternative is semisupervised learning, where the model is trained only on nominal data and anomalies\nare identified as out-of-distribution patterns [3, 43]. Most methods fall into two broad\nfamilies: reconstruction-based and embedding similarity-based.\n\n3.1 Reconstruction-based\nThis family is based on the assumption that a model trained only on conforming samples cannot faithfully reconstruct anomalous regions. It has been extensively studied\nbecause it enables robust reconstruction subspaces without defective training samples.\nRepresentative models include autoencoders (AE) [5, 26], variational autoencoders\n(VAE) [22, 23], generative adversarial networks (GAN) [18], and GAN-based variants\nsuch as GANomaly [1, 2] and DRÆM [45]. Since anomalous regions are out of distribution with respect to training data, they are typically reconstructed poorly and can\nbe detected by thresholding residuals or similarity measures such as SSIM [39]. These\narchitectures are usually computationally heavy in both training and inference, but\nthey produce compact and manageable latent representations.\n\n3.2 Embedding similarity-based\nThis family uses deep neural networks, often pre-trained on large-scale datasets, to\nextract embedding vectors that summarize visual content. The underlying idea is that\nexpressive backbones, such as residual networks [19], can provide robust feature representations even when the target dataset is limited. Regularity can then be modeled\nwith methods such as PaDiM [12], PatchCore [29, 34], and normalizing-flow approaches\nincluding FastFlow [44], PNI [4], and MSFlow [46]. In many formulations, nominal\ndata are approximated with multivariate Gaussian models [13]. The main drawback is\ninterpretability: the anomaly score is a distance in feature space rather than a direct\nreconstruction error [12]. In addition, memory requirements can become prohibitive\non embedded or on-board hardware because latent-space storage often grows with\ndataset size.\n\n3.3 Adopted solution\nBased on the considerations above, we developed an inline real-time anomaly detection\nsystem for cosmetic inspection of BFS plastic vial strips filled with liquid. The main\n3\n\n\fobjective was not only high detection accuracy, but also feasibility under strict project\nconstraints.\nThe hardware infrastructure is very different between training server and inference\ncomputer. For the former:\n\n• Intel® Xeon® Silver 4216 CPU @ 2.10 GHz as CPU\n• 64GB of DDR4 Synchronous @ 3200 MHz as system memory\n• Nvidia® A100 with 40GB of VRAM as GPU.\nFor the latter:\n\n• Intel® Xeon® E-2278GE CPU @ 3.30 GHz as CPU\n• 32GB of DDR4 Synchronous @ 3200 MHz as system memory\n• Nvidia® A4500 with 20GB of VRAM as GPU.\nThe proposed architecture is adapted from previous work [16] to satisfy hardware\nlimits and acceptance-test constraints. The model uses a single GAN with a residual\nautoencoder (RAE) and a dense bottleneck (DRAE). As in DRAEM, Perlin noise is\nrandomly superimposed on input images during training, not to synthesize defects,\nbut to improve denoising behavior and reduce the tendency of the model to copy the\ninput.\nThe training dataset contains 2,815,200 images obtained from 782 strips of 5 vials\neach. Every strip was acquired 10 times with 16 frames per acquisition, plus 2 ranked\nimages. Each image was divided into 20 patches: 5 vial regions, each split into 4\nsub-regions.\nIn summary, the contribution of this work is:\n1. A generative network based on a residual autoencoder (RAE) [24, 40, 47] with a\nfully-connected bottleneck, embedded in a GAN architecture [1].\n2. A preprocessing pipeline that partitions each vial into four logical regions for patchlevel analysis.\n3. Training-time augmentation on nominal samples, including randomized Perlin-noise\nmasking to improve robustness against out-of-distribution perturbations.\n4. A multi-stage evaluation protocol from raw patches to vial- and run-level aggregation, aligned with industrial acceptance criteria.\n5. Online deployment of the inference pipeline in the machine control software through\nC++ TensorFlow APIs.\n\n4 Related Work\nThe implemented approach is primarily based on GRD-Net [16], which is inspired by\nDRÆM [45]. This family belongs to reconstruction-based anomaly detection, where\nmodels reconstruct nominal inputs and expose out-of-distribution regions through\nreconstruction mismatch [25, 41]. Representative architectures include autoencoders\n(AE) [5, 8, 17, 26], variational autoencoders (VAE) [23, 38], and GAN-based methods\n[1, 2, 31, 35]. In these methods, the encoder maps the image into a compact latent space\n[5]. SSIM [8] and pixel-wise reconstruction errors [9] are commonly used both for training and for anomaly scoring at inference. Transformer-based reconstruction models\n4\n\n\fhave also been proposed [27, 42], including hybrid convolutional-transformer designs\n[15]. A key advantage of reconstruction-based methods is interpretability through\nresidual maps; a typical drawback is computational cost. Contrastive extensions have\nshown additional performance gains [37].\nA second major family is embedding similarity-based anomaly detection. These\napproaches extract feature vectors for image-level anomaly detection [7, 33] or patchlevel localization [30]. Compared with reconstruction-based methods, they are often\nlighter at inference because they mainly require an encoder. However, they are\nless interpretable: scores are distances between inferred embeddings and the nominal embedding distribution. Early work such as SPADE [11] modeled normality\nwith hypersphere-based representations. Later methods include PaDiM [12], PatchCore [34], and normalizing-flow variants [4, 14, 44]. These techniques can deliver\nhigh throughput, but memory-bank requirements may become prohibitive on constrained industrial hardware. Moreover, reconstruction-based methods can better\ncapture certain logical defects, as discussed by Batzner et al. [6].\n\n5 Methods\nTo describe our approach, we first summarize the GRD-Net [16] architecture.\n\n5.1 GRD-Net\nInspired by DRÆM [45], GRD-Net [16] is composed of two networks. The first is a\nGAN with a fully-convolutional residual autoencoder (CRAE). The second is a U-Net\nwith skip connections that takes the original image X and the reconstructed image\nX̂ as input. During training, a perturbation function Pq superimposes Perlin noise\non X with probability q , generating a perturbed image Xn and a binary map M . In\nM , perturbed pixels are set to 1.0 and unperturbed pixels to 0.0. The original X is\nunchanged, while Xn is generated as:\n\nXn , M = Pq (X ).\n\n(1)\n\nIn this design, perturbation acts as an augmentation mechanism and forces\nthe autoencoder to solve a denoising task in addition to feature compression. It\n\n(a)\nOriginal\nvial\nregion image (X)\n\n(b)\nOriginal\nregion image\nPerlin noise Xn\n\nvial\nwith\n\n(c) The generated\nPerlin\nnoise\nstandalone N\n\n(d) The map of the\nnoise M\n\nFig. 1 (a) Original vial-region image X. (b) Same image with superimposed Perlin noise Xn . (c)\nIsolated Perlin noise map N . (d) Binary mask M of the superimposed region.\n\n5\n\n\falso produces the supervision map used by the second network for anomaly-region\nprediction.\nThe superimposed noise forces the network to reconstruct masked content and\ntherefore emphasizes essential structure learning. Similar principles were investigated,\nfor example, in masked autoencoding approaches [21].\nIn the initial project, a Region of Interest (ROI) attention map was also used\nduring training to focus learning on predefined areas that vary across samples.\n\n5.1.1 Residual Autoencoders\nAn autoencoder (AE) is trained to reconstruct an input image, ideally filtering out nuisance noise. It is composed of an encoder (E), which maps input features into a latent\nrepresentation z , and a decoder (D), which reconstructs the input from z . To succeed,\nthe model must preserve informative structure while discarding non-relevant variability. This is typically encouraged by constraining the latent dimensionality. Residual\narchitectures are widely adopted because they mitigate optimization degradation (e.g.,\nvanishing gradients) [20]. Although historically dominant in supervised tasks, they are\nnow broadly used in unsupervised and semi-supervised settings [16, 24, 40, 47].\n\n5.1.2 Generative Adversarial Networks\nGANs were originally proposed for realistic synthetic data generation [18]. They consist of a generator and a discriminator trained in competition: the discriminator\ndistinguishes real from generated samples, while the generator learns to fool it. As in\nGANomaly [1], the discriminator in our setting compares reconstructed and original\nimages.\n\n5.1.3 GRD-Net architecture\nThe first component of GRD-Net is the Generator (G), composed of an Encoder (GE )\nthat maps X to a latent space z , a Decoder (GD ) that reconstructs X̂ from z , and a\nsecond Encoder (GÊ ) that maps X̂ to ẑ . The autoencoder corresponds to GE +GD . The\nDiscriminator (C) is a convolutional encoder followed by a dense layer that performs\nbinary real/fake classification.\nThe generator objective is composed of three terms: adversarial, contextual, and\nencoder-consistency losses.\nThe adversarial term Ladv stabilizes optimization by matching feature activations\nfrom C. Let FC denote the output of the last convolutional layer of C:\n\nLadv = L2 (FC (X ), FC (X̂ )),\n\n(2)\n\nwhere L2 is the ℓ2 loss.\nThe contextual (reconstruction) loss combines pixel-level and structural terms:\n\nLcon = wa · L1 (X, X̂ ) + wb · LSSIM (X, X̂ ),\nwhere L1 is the ℓ1 loss and LSSIM = 1 − SSIM(X, X̂ ).\n6\n\n(3)\n\n\fThe encoder-consistency loss, as in Akcay et al. [1], minimizes the distance between\nz from X and ẑ from X̂ :\nLenc = L1 (z, ẑ ).\n(4)\nThe final generator objective is:\n\nLgen = w1 · Ladv + w2 · Lcon + w3 · Lenc ,\n\n(5)\n\nwhere wa and wb weight the contextual subterms, and w1 , w2 , w3 weight the three\ncomponents of Lgen .\n\n5.2 Application specific optimizations\nStarting from the framework described in section 5.1, we introduced applicationspecific augmentations: Perlin-noise perturbation, random rotation in [− π8 , π8 ] rad,\nand random vertical flip. Horizontal flips and rotations larger than π2 were excluded\nbecause they can generate unrealistic anomalous patterns.\nThese augmentations improve generalization but also increase training entropy,\nwhich can reduce optimization stability. To counter this effect, we introduced a Noise\nLoss :\n∗\nLnse = w4 · L2 (|(1.0 − β )M̂ · X̂ − M · X |, βN ),\n(6)\n∗\nwhere X denotes the post-perturbation input generated by Pq (X ):\n\n∗\nX = (1 − M ) · X + (1.0 − β )M · X + βN,\nβ ∼ U (0.5, 1.0),\nN = Perlin noise isolated,\n(\n1, if the pixel belongs to the noise region N,\nM=\n0, otherwise\n\n(7)\n\n∗\nwhere X , M, N, β = Pq (X ), and N is the isolated Perlin-noise map applied to a black\nimage with the same size as X . Equation 7 defines the superimposition mechanism.\nParameter q is the probability of applying Perlin noise; therefore, with probability 1−q ,\n∗\nX = X , M = 0, and N = 0. Perlin noise introduces non-Gaussian perturbations that\nbetter resemble real defects and simultaneously masks non-rectangular regions [21, 32].\nThis discourages trivial identity mapping, a common weakness of vanilla autoencoders\non small defects. Moreover, the ℓ1 term in the contextual loss was replaced with Huber\nloss to improve stability around the origin:\nLcon = wa · LHuber (X, X̂ ) + wb · LSSIM (X, X̂ ),\n\n7\n\n(8)\n\n\fStarting from DRÆM [45] and GANomaly [1], we used an iterative branch-andbound tuning process and obtained the following configuration:\n\nwa = 2.0\nwb = 1.0\nw1 = 1.0\nw2 = 50.0\nw3 = 1.0\nw4 = 3.0,\n\n(9)\n\nAlthough LSSIM provides the strongest contribution to reconstruction quality, it can\nbe unstable on high-entropy images. Increasing wa mitigated this behavior at the cost\nof slower convergence.\n\n5.2.1 Network\nThe network used as generator for training is an encoder-decoder-encoder shaped net,\nwhere the encoder has a ResNet architecture (Figure 2), and the decoder (Figure 3)\na reverse residual shape. As mentioned in section 5.1.1, residual network are widely\nused [20, 24, 40, 47], since they prevent several degradation problems during training,\nas the gradient vanishing. In the context of this work, residual structure was updated\nto the most recent ones, using as starting point the one designed in the previous work\n[16].\n\n5.2.2 Classification and segmentation\nThis application does not require full-resolution semantic segmentation; patch-level\nanomaly classification and heatmap localization are sufficient for process integration.\nTherefore, only the generative branch is used in training and inference. Patch partitioning allows coarse spatial localization of anomalies. The anomaly score is defined\nas:\nϕ = 1 − SSIM(X, X̂ ),\n(10)\nand the heatmap is computed as the absolute difference between input and reconstruction:\n1\n\nH = |X − X̂| ,\n\n(11)\n\n0\n1\n\ndenotes min-max normalization in [0, 1]:\n\nwhere\n0\n\nH =a+b·\n\n|X − X̂| − min(|X − X̂|)\nmax(|X − X̂|) − min(|X − X̂|)\n\n, a = 0 ∧ b = 1.\n\n(12)\n\nThe optimal threshold ϕt is tuned on a dedicated calibration subset containing both\nnominal and defective samples, strictly disjoint from the final test kit used for reporting. During inference, if one patch is classified as reject, the corresponding product is\n8\n\n\fReLU\n\nReLU\n\nReLU\n\nConv2D\n\nConv2D\n\nConv2D\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nReLU\n\nReLU\n\nReLU\nConv2D\nkernel = (3,3)\n\nMaxPooling2D\n\nConv2D\n\nConv2D\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (2,2)\n\nReLU\n\nReLU\n\nReLU\n\nstrides = (1,1)\n\nConv2D\nkernel = (3,3)\n\nConv2D\n\nConv2D\n\nConv2D\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nkernel = (3,3)\nstrides = (2,2)\n\n(a) Residual encoder\n\nFig. 2 Three residual blocks in the encoder network. Only the last one halve the (H, W ) size of the\nlayer\n\nflagged as reject. In that case, 11 is used to generate the heatmap of the anomalous\nsubregion.\n\n9\n\n\fReLU\n\nReLU\n\nReLU\n\nConv2DTranspose\n\nConv2DTranspose\n\nConv2DTranspose\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nReLU\n\nReLU\n\nReLU\nConv2DTranspose\nkernel = (3,3)\n\nUpSampling2D\n\nConv2DTranspose\n\nConv2DTranspose\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (2,2)\n\nReLU\n\nReLU\n\nReLU\n\nstrides = (1,1)\n\nConv2DTranspose\nkernel = (3,3)\n\nConv2DTranspose\n\nConv2DTranspose\n\nConv2DTranspose\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nkernel = (3,3)\nstrides = (2,2)\n\n(a) Residual decoder\n\nFig. 3 Three residual blocks in the decoder network. Only the last one double the (H, W ) size of\nthe layer\n\n6 Experiments\nWe conducted a set of experiments to optimize detection performance while preserving\ninference latency within the 500 ms slot between two consecutive acquisitions. For\ncompleteness, we first summarize the industrial context and the hardware/software\nenvironment.\n\nProduct\nThe inspected product (Figure 41 ) is a BFS strip of 5 vials filled with 10 ml of liquid\nexcipient. During handling, bubbles are frequently generated in the liquid region,\nespecially around the meniscus. In addition, the narrow neck can trap liquid, and\ndroplets are often visible above the liquid level. As shown in Figure 5, each strip\ncontains 5 vials, and each vial is partitioned into 4 logical regions: flag (upper, red),\ntop body (blue), liquid body (green), and bottom (yellow).\n1\n\nBecause of an NDA, the flag (upper part) was blurred to conceal the company logo.\n\n10\n\n\f(a) The product\n\nFig. 4 The product: a BFS strip composed by 5 vials1 .\n\nTrain dataset acquisition\nThe production acquisition setup was replicated at laboratory scale. Both setups used\na telecentric lens to mitigate geometric distortion, especially on side and bottom vial\nregions. Each strip was acquired 10 times with a semicircular motion focused on the\nupper side of the product, yielding 16 frames per acquisition. For each frame set,\ntwo additional images were generated via a rank filter by selecting the minimum and\nmaximum gray-level responses. From MVtec definition of the filter2 : Conceptually, the\nrank filter sorts all gray values within the mask in ascending order and then selects\nthe gray value with rank Rank . The rank 1 corresponds to the smallest gray value and\n2\n\nhttps://www.mvtec.com/doc/halcon/2305/en/rank image.html\n\n11\n\n\fthe rank A3 corresponds to the largest gray value within the mask. As a consequence,\nmoving artifacts are suppressed in lighter-rank images and emphasized in darker-rank\nimages. This increases the variability of nominal samples. After patch extraction, the\ndataset contained 2,815,200 images, split into 90% training and 10% validation. Each\npatch is a grayscale image of size 256 × 256 × 1.\n\nTest dataset acquisition\nA real-case set of defective strips was acquired in order to benchmark the algorithm’s\nperformance. Each acquisition is made of three frames, which are the first, the eighth,\nand the last in the series, respectively, to lessen the computational load on the system\nwhile it is operating. Consequently, the numerosity (N ) of the batch is:\nN = f · v · r = 3 · 5 · 4 = 60,\n\n(13)\n\nwhere f is the frame number, v is the vial number and finally, r is the region number.\n\nMachine handling\nThe machine is a rotating inline quality control machine that inspects the products\nat the end of the production line. Usually these machines are placed right after the\nfilling device and before the packaging ones.\nThe product is gripped from the input conveyor belt and brought into the carousel\nand handled identically to how it was handled during the laboratory acquisitions. The\nhandling and movement inside the carousel is the same as the one in the laboratory\nmockup, but that there is additional movement of the liquid inside due to how the\nproduct is handled before the carousel, but it has been observed on previous machines,\nthat this further movement does not affect the performance of the algorithm, since it is\nmuch less and far away in time than the one produced on the inspection station. After\nhandling the product, acquisitions take place, and the images begin to be processed4 .\nExperiments\nTraining was run for 10 epochs because of the very high numerosity of the training\nset, using the pipeline described in section 5, and specifically in subsections 5.2, 5.2.1,\nand 5.2.2. The residual backbone follows the ResNet v2 design principles [20]. This\nsection reports:\n1. The hardware and software environment\n2. The architecture of the adopted network\n3. The training phase\n4. Performance on positive and negative examples in the test dataset\n5. The results in terms of time and throughput\n6. Experiments on the generative network\n3\n4\n\nIn this case A = 16\nMore specific details about machine hardware cannot be provided due to the NDA and company policies\n\n12\n\n\f6.1 Hardware\nThe hardware, as already mentioned in subsection 3.3 is very different between the\ntraining server and the inference machine. The training process is carried out on a\nserver that has been set up in this way:\n\n• Hardware\n– Intel® Xeon® Silver 4216 CPU @ 2.10 GHz as CPU\n– 64GB of DDR4 Synchronous @ 3200 MHz as system memory\n– Nvidia® A100 with 40GB of VRAM as GPU.\n– 2 TB M.2 NVMe SSD\n\n• Software\n– Ubuntu 22.04.3 LTS Server minimal-based o/s with 5.15.0-94-x86 64 kernel\n– Nvidia® driver Version: 535.104.12\n– CUDA® version: 12.2\n– TensorFlow 2.13.1 compiled from source\nThe inference machine is an industrial cluster installed on board and it is set up in\nthis way:\n\n• Hardware\n– Intel® Xeon® E-2278GE CPU @ 3.30 GHz as CPU\n– 32GB of DDR4 Synchronous @ 3200 MHz as system memory\n– Nvidia® A4500 with 20GB of VRAM as GPU.\n– 32 GB CFast flash for the operative system (read-only mounted)\n– 1 TB M.2 NVMe SSD for the data\n\n13\n\n\f• Software\n– Ubuntu 22.04.3 LTS Server minimal-based o/s with 5.15.0-94-x86 64 kernel\n– Nvidia® driver Version: 535.104.12\n– CUDA® version: 12.2\n– TensorFlow 2.13.1 compiled from source\n\n6.2 Network architecture\nEncoder\nAs mentioned in subsection 5.2.1, the network is residual based on ResNet version 2\narchitecture. Each stage is composed of 3 residual blocks:\n1. The first block (A in Figure 6) concatenates three consecutive 3 × 3 convolutions\nwith one 1 × 1 convolution. Spatial size Hi × Wi is preserved.\n2. The second block (B in Figure 6) concatenates three consecutive 3 × 3 convolutions\nwith the input from block A. Spatial size Hi × Wi is preserved.\n3. The third block (C in Figure 6) concatenates three consecutive 3 × 3 convolutions\nwith a downsampling branch. The middle convolution halves both Hi and Wi .\nThe encoder uses 4 stages, yielding a final embedding size of 16 × 16 with 1024\nchannels.\n\nBottleneck\nThe bottleneck is fully-connected with a size of 64 features, as in figure 7.\nDecoder\nThe decoder is the inverse architecture of the encoder, described above. As in the\nencoder, each stage is composed of 3 residual blocks:\n1. The first block (A in Figure 8) concatenates three consecutive transposed convolutions with 3 × 3 kernel and one 1 × 1 convolution. Spatial size Hi × Wi is\npreserved.\n2. The second block (B in Figure 8) concatenates three consecutive transposed\nconvolutions with the input from block A. Spatial size Hi × Wi is preserved.\n3. The third block (C in Figure 8) concatenates three consecutive transposed convolutions with an upsampling branch. The middle convolution doubles both Hi and\nWi .\nThe decoder uses 4 stages to recover a final output size of 256 × 256 with a single\nchannel and sigmoid activation.\n\n14\n\n\f(a) The vial regions\n\nFig. 5 The vial regions1 : the logic regions in which the vial is divided.\n\n15\n\n\fReLU\n\nReLU\n\nReLU\n\nConv2D\n\nConv2D\n\nConv2D\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nReLU\n\nReLU\n\nReLU\n\nConv2D\nConv2D\n\nkernel = (3,3)\n\nMaxPooling2D\n\nConv2D\n\nConv2D\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (2,2)\n\nReLU\n\nReLU\n\nReLU\n\nConv2D\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nConv2D\n\nConv2D\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\n(a) ResEnc Black A\n\n(b) ResEnc Block B\n\nkernel = (3,3)\nstrides = (2,2)\n\n(c) ResEnc Block C\n\nFig. 6 Three residual blocks in the encoder (ResEnc). One stage consists of three convolutional\nblocks in the order A, B, C.\n\nFlatten\n16x16x1024 → 262144\n\nDense\noutput features = 64\n\nDense\noutput features = 262144\n\nReshape\n262144 → 16x16x1024\n\n(a) Dense bottleneck\n\nFig. 7 The bottleneck stage.\n\n16\n\n\fReLU\n\nReLU\n\nReLU\n\nConv2DTranspose\n\nConv2DTranspose\n\nConv2DTranspose\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nReLU\n\nReLU\n\nReLU\n\nConv2DTranspose\nConv2DTranspose\n\nkernel = (3,3)\n\nUpSampling2D\n\nConv2DTranspose\n\nConv2DTranspose\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (2,2)\n\nReLU\n\nReLU\n\nReLU\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nConv2DTranspose\n\nConv2DTranspose\n\nConv2DTranspose\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nkernel = (3,3)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\nstrides = (1,1)\n\n(a) ResDec Black A\n\n(b) ResDec Block B\n\nkernel = (3,3)\nstrides = (2,2)\n\n(c) ResDec Block C\n\nFig. 8 Three residual blocks in the decoder (ResDec). One stage consists of three transposedconvolution blocks in the order A, B, C.\n\n17\n\n\fInput Image\n(X)\n\nPerturbation:\nPerlin noise + transformation\n(M, Xn) = P(X)\n\nInput tuple: original image,\nnoise mask and image with\nnoise\n(X, M, Xn)\n\nGENERATOR\n\nDISCRIMINATOR\n\nX̂ = G(Xn)\nHuber(X̂ , X) + (1 - SSIM(X̂ , X)) → 0\n\nE = D(X) ∈ [0,1]\nÊ = D(X̂ ) ∈ [0,1]\n\n(a) Train flowchart\n\nFig. 9 The training flowchart.\n\n6.3 Training phase\nTraining follows a standard GAN schedule with alternating optimization of generator\nand discriminator. The initial learning rate is 1.5 × 10−4 , with cosine-decay restarts\nevery 2,533,680 steps and restart amplitude set to 13 of the previous maximum. Adam\nis used for both networks. Batch size is 32, and perturbation probability is set to\nq = 0.75. The training flowchart is shown in Figure 9.\n\n6.4 Results\nExperiments were performed on the client-provided knapp test kit. The set contains\n141 defective products and 120 nominal products. Since the class distribution is relatively balanced, we report accuracy, true positive ratio (TPR), true negative ratio\n(TNR), balanced accuracy, and inference time statistics. Thresholds are calibrated on\na dedicated validation subset, and the final test kit is used only for performance reporting. In this manuscript, we report point estimates; confidence intervals will be included\nin an extended statistical analysis. The analysis is presented at three aggregation levels:\n1. Overall accuracy on the whole test dataset and inference time per patch\n2. Accuracy after image aggregation per product and inference time per product\n3. Accuracy, after image aggregation per product and run, based on acceptance policy\nof the client\nA representative qualitative subset is reported in Appendix A.\nDue to NDA constraints on the proprietary dataset and pipeline, this manuscript\nfocuses on absolute deployment performance and engineering feasibility. A full baseline\ncomparison against representative methods (e.g., PaDiM, PatchCore, FastFlow) on\npublic benchmarks with the same preprocessing and evaluation protocol is planned as\nfollow-up work.\n\n18\n\n\fAcceptance policy\nFor industrial validation, the machine must perform at least as well as human inspectors on the same knapp test kit. Each product is acquired 10 times; each acquisition is\ndefined as one run. A nominal product is considered correctly classified if it is predicted\nas nominal in at least 7 runs out of 10. A defective product is considered correctly\nclassified if it is predicted as defective in at least 7 runs out of 10. Otherwise, it is\ncounted as misclassified.\nOverall results\nOverall results are reported in table 1. A dedicated threshold is estimated for each\nregion due to region-specific pixel distributions. The mean inference time per frame is\nµtb\nµtb\ncomputed as µtf = f ·v·r\n= 60\n, where µtf is the mean time per frame, µtb is the mean\ntime per batch, v is the number of vials per strip, and r is the number of regions per\nvial.\n\nThreshold\nAccuracy\nTrue positive ratio\nTrue negative ratio\nBalanced accuracy\nMean inference time (ms)\n\nOverall results\nR0\nR1\n0.015589 0.038017\n0.9919\n0.9926\n0.9966\n0.9985\n0.9093\n0.9044\n0.9530\n0.9515\n0.1689\n0.1689\n\nR2\n0.046568\n0.9957\n0.9986\n0.9779\n0.9883\n0.1689\n\nR3\n0.029593\n0.9991\n0.9994\n0.9973\n0.9984\n0.1689\n\nVial\n0.9870\n0.9942\n0.9581\n0.9762\n-\n\nTable 1 Overall results using the equation 10 as anomaly score.\n\nPer product aggregation\nWhole-strip classification is designed to minimize GMP5 risk: if at least one region is\nclassified as reject, the entire product is rejected. This policy reduces false acceptance\nat the expense of increased false rejection; therefore, threshold retuning is required to\nsatisfy project constraints. To this end the final score function per vial becomes:\nn\no\nθv = max( 1.0 − SSIM(Xi , X̂i ) ), i ≥ 0 ∧ i &lt; f · v · r,\n(14)\nwhere i is the patch index.\n\nPer run aggregation\nFor final validation, the algorithm must match or exceed the manual-inspection benchmark measured by the client on the same knapp kit. Each product is acquired 10 times\nand is considered correctly classified if the label is confirmed in at least 7 runs out of\n10 (70%). Results are reported in table 3.\n5\nGood Manufacturing Practice (GMP) describes the minimum standard that a medicines manufacturer\nmust meet in their production processes.\n\n19\n\n\fPer strip results\nScore\nThreshold R0\n0.016156\nThreshold R1\n0.038584\nThreshold R2\n0.046635\nThreshold R3\n0.029660\nAccuracy\n0.9593\nTrue positive ratio\n0.9694\nTrue negative ratio\n0.9467\nBalanced accuracy\n0.9581\nMean inference time 0.4873\nTable 2 Per strip results using the equation 14 as anomaly score.\n\nPer strip results\nScore\nThreshold R0\n0.013222\nThreshold R1\n0.034650\nThreshold R2\n0.046201\nThreshold R3\n0.029226\nAccuracy\n0.9641\nTrue positive ratio\n0.9676\nTrue negative ratio 0.9599\nBalanced accuracy\n0.9638\nTable 3 Per run results using the equation 14 as anomaly score.\n\n7 Conclusions and Future work\nWe developed an architecture that performs efficiently in an extremely demanding\nindustrial environment, where performance has both business and GMP impact, which\nin turn affects people’s safety and health. The proposed method manages a large\ndataset while adhering to hardware and time limits and striking a fair balance between\ncosts and outstanding performance. In order to identify the primary features of the\nproduct and identify out-of-distribution anomalies, it completes the denoising process\nduring training. With the use of this strategy, the network can be forced to perform\nbetter than a traditional autoencoder when it comes to compressing and eliminating\nextraneous features from the result. In fact, because autoencoder-based networks, like\nGANomaly, have learnt too smoothly to replicate the source image, they frequently\nhave the issue of being able to repeat the anomaly region even in the reconstructed\nimage. Therefore, selecting the noise to be superimposed on the input image becomes\ncrucial since the more similar it is to the distribution of potential anomalies, the higher\nthe yield will be in terms of detecting anomalies. Modern generative models were\nused as a first instance in the architecture’s development, losses and base network\ndesign was optimized in order to overcome difficult challenges like the large size of the\nacquired images and the high variance between positive examples brought on by the\nmovement of the liquid inside the vials. A heatmap for defective items is displayed\non the HMI to give the operator a visual explanation of the outcome. The ”hot”\n20\n\n\fparts of the heatmap indicate the most anomalous locations in terms of pixels. This\narchitecture was designed jointly by University of Ferrara and Bonfiglioli Engineering,\nwhile tests were conducted on the Bonfiglioli Engineering’s servers.\nWhile this research provides insightful information and specifics about how to\nintegrate and implement an out-of-distribution anomaly detection via deep learning\nalgorithm, several areas warrant further exploration. Nowadays, operators frequently\nneed additional explanations in addition to an anomaly score and the associated categorization in order to assess the efficiency of the production line and the machine\nitself.\nSeveral solutions have been proposed in the embedding similarity-based setting, including PaDiM [12], PatchCore [34], and EfficientAD [6]. In these methods,\ndistances between inferred embeddings and nominal embeddings collected during\ntraining are projected back to image space to obtain anomaly maps; with calibrated\nthresholds, this enables pixel-level classification. The reference representation can be\norganized in multiple forms, such as nominal clusters or probabilistic models. Similarly, reconstruction-based networks provide a heatmap defined as the absolute value\nof the difference between the original and the rebuilt images, whereas the differences\ncorrespond to the hottest parts in the map.\nThe biggest drawback in both situations is the non-parametric classifier’s inability to delve deeper into the result’s perceptual interpretation. Further architectures,\nsuch as GRD-Net [16], DRÆM [45], the described deep perceptual autoencoder by\nN. Shvetsova et al. [36], or the proposed one by P. Bergmann et al. [10], have been\nresearched and developed in order to accomplish the aim of identifying defects, within\nimages, interpreting the inferred features. The mentioned architecture prove to have\nexcellent performance, but with the drawback of extreme computational and architectural complexity, which makes them challenging to use in practical situations,\nparticularly when accessed online.\nConsidering the aforementioned, a promising avenue for future research is to investigate how to obtain information from the latent representation of the input example,\nas a sample of the stochastic process, that might be processed to produce a visual representation of the anomalous regions within the provided image. An excellent starting\npoint can be taken from the work carried out by P. Esser et al. [15], where a discrete representation of the image through a vector quantized variational autoencoder\n(VQVAE), is used to generate high resolution synthetic images, introducing to this\nend the use of transformers for imagine encoding, which does not have a strong local\ncorrelation within images, in contrast to CNN. However, as the products in this work\nare the result of an industrial process, their shape and position vary very little. For\nthis reason, a topological connection between the input image and the derived features\nmay help identify anomalies that deviate from the distribution.\n\nA Result Images\nBelow are shown examples taken from real cases analyzed during algorithm validation\nphase.\n\n21\n\n\f(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 10 Stuck particle in the upper part of the product\n\n(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 11 Stuck particle and anomalous liquid behavior that results in foam formation because of\ncontamination\n\n22\n\n\f(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 12 Stuck particle and anomalous liquid behavior that results in foam formation because of\ncontamination\n\n(a) Original vial region\nimage (X)\n\n(b) The rebuilt image\nX̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 13 Lower body deformation\n\n23\n\n\f(a) Original vial region\nimage (X)\n\n(b) The rebuilt image\nX̂\n\n(c)\nThe\nimage\n\ndifference\n\n(d) The heatmap H\nsuperimposed\n\n(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\nFig. 14 Light lower body deformation\n\ndifference\n\nFig. 15 Lower body deformation\n\n24\n\n\f(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 16 Black spot on upper part of the vial’s body.\n\n(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 17 Burn in the lower part of the vial.\n\n25\n\n\f(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 18 Light scratch near the product neck.\n\n(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 19 External imperfection caused by laser cutting of the product.\n\n26\n\n\f(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 20 Deep scratch on the upper part of the vial’s body.\n\n(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 21 Burn on the vial’s body. It is reproduced as a bubble, since the network does not know how\nto represent the defect features.\n\n27\n\n\f(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\ndifference\n\n(d) The heatmap H\nsuperimposed\n\n(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\nFig. 22 Black spot on the vial’s body\n\ndifference\n\nFig. 23 Black spot of the vial’s body\n\n28\n\n\f(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 24 Bump on the lower part of the vial’s neck, near to a big bubble stuck in the internal layer\nof the BFS surface.\n\n(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 25 Light bump on the vial’s neck\n\n29\n\n\f(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 26 Heavy deformation near the neck region, overlapped to a bubble that the network is still\nable to reproduce.\n\n(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 27 Scratch on the vial’s neck.\n\n30\n\n\f(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 28 Light bump on the lower part of the vial’s cap region.\n\n(a) Original vial region\nimage (X)\n\n(b) The reconstructed\nimage X̂\n\n(c)\nThe\nimage\n\n(d) The heatmap H\nsuperimposed\n\ndifference\n\nFig. 29 Scratch on the vial’s neck.\n\nAcknowledgements. The authors would like to thank Bonfiglioli Engineering for\nproviding a real-case dataset to test the software developed in this work. The first\n31\n\n\fauthor is supported by an industrial PhD funded by Bonfiglioli Engineering, Ferrara,\nItaly. Alice Bizzarri is supported by a National PhD funded by Politecnico di Torino,\nTorino, Italy and Università di Ferrara, Ferrara, Italy.\n\nDeclarations\nFunding The first author is supported by an industrial PhD funded by Bonfiglioli\nEngineering, Ferrara, Italy. Alice Bizzarri is supported by a National PhD funded by\nPolitecnico di Torino, Torino, Italy and Università di Ferrara, Ferrara, Italy.\nConflict of interest/Competing interests The authors declare that they have no\ncompeting interests.\nEthics approval and consent to participate Not applicable.\nConsent for publication Not applicable.\nData availability The datasets generated and/or analyzed during the current study\nare not publicly available due to NDA and commercial confidentiality constraints,\nbut may be available from the corresponding author on reasonable request and where\ncontractually permitted.\nMaterials availability Not publicly available due to NDA and commercial confidentiality constraints.\nCode availability Not publicly available due to NDA and proprietary constraints.\nAuthor contribution All authors contributed to the study conception and design.\nMaterial preparation, data collection, analysis, and manuscript drafting/revision were\nperformed by the authors. All authors read and approved the final manuscript.\n\nReferences\n[1] Akcay S, Atapour-Abarghouei A, Breckon TP (2018) Ganomaly: Semi-supervised\nanomaly detection via adversarial training. In: Asian conference on computer\nvision, Springer, pp 622–637\n[2] Akçay S, Atapour-Abarghouei A, Breckon TP (2019) Skip-ganomaly: Skip connected and adversarially trained encoder-decoder anomaly detection. In: 2019\nInternational Joint Conference on Neural Networks (IJCNN), IEEE, pp 1–8\n[3] Akcay S, Ameln D, Vaidya A, et al (2022) Anomalib: A deep learning library for\nanomaly detection. arXiv:2202.08341\n[4] Bae J, Lee JH, Kim S (2023) Pni : Industrial anomaly detection using position\nand neighborhood information. arXiv:2211.12634\n[5] Bank D, Koenigstein N, Giryes R (2020) Autoencoders. CoRR abs/2003.05991.\nURL https://arxiv.org/abs/2003.05991, 2003.05991\n\n32\n\n\f[6] Batzner K, Heckler L, König R (2023) Efficientad: Accurate visual anomaly\ndetection at millisecond-level latencies. arXiv:2303.14535\n[7] Bergman L, Cohen N, Hoshen Y (2020) Deep nearest neighbor anomaly detection.\narXiv preprint arXiv:200210445\n[8] Bergmann P, Löwe S, Fauser M, et al (2018) Improving unsupervised defect\nsegmentation by applying structural similarity to autoencoders. arXiv preprint\narXiv:180702011\n[9] Bergmann P, Fauser M, Sattlegger D, et al (2019) Mvtec ad–a comprehensive\nreal-world dataset for unsupervised anomaly detection. In: Proceedings of the\nIEEE/CVF conference on computer vision and pattern recognition, pp 9592–9600\n[10] Bergmann P, Batzner K, Fauser M, et al (2022) Beyond dents and scratches:\nLogical constraints in unsupervised anomaly detection and localization. International Journal of Computer Vision 130(4):947–969. https://doi.org/10.1007/\ns11263-022-01578-9, URL https://doi.org/10.1007/s11263-022-01578-9\n[11] Cohen N, Hoshen Y (2020) Sub-image anomaly detection with deep pyramid\ncorrespondences. arXiv preprint arXiv:200502357\n[12] Defard T, Setkov A, Loesch A, et al (2021) Padim: a patch distribution modeling\nframework for anomaly detection and localization. In: International Conference\non Pattern Recognition, Springer, pp 475–489\n[13] Denkena B, Dittrich MA, Noske H, et al (2020) Statistical approaches for semisupervised anomaly detection in machining. Production Engineering 14. https:\n//doi.org/10.1007/s11740-020-00958-9\n[14] Dinh L, Sohl-Dickstein J, Bengio S (2016) Density estimation using real nvp.\narXiv preprint arXiv:160508803\n[15] Esser P, Rombach R, Ommer B (2021) Taming transformers for high-resolution\nimage synthesis. arXiv:2012.09841\n[16] Ferrari N, Fraccaroli M, Lamma E (2023) Grd-net: Generative-reconstructivediscriminative anomaly detection with region of interest attention module.\nInternational Journal of Intelligent Systems 2023:1–18. https://doi.org/10.1155/\n2023/7773481\n[17] Gong D, Liu L, Le V, et al (2019) Memorizing normality to detect anomaly:\nMemory-augmented deep autoencoder for unsupervised anomaly detection. In:\nProceedings of the IEEE/CVF International Conference on Computer Vision, pp\n1705–1714\n\n33\n\n\f[18] Goodfellow I, Pouget-Abadie J, Mirza M, et al (2020) Generative adversarial\nnetworks. Communications of the ACM 63(11):139–144\n[19] He K, Zhang X, Ren S, et al (2015) Deep residual learning for image recognition.\nCoRR abs/1512.03385. URL http://arxiv.org/abs/1512.03385, 1512.03385\n[20] He K, Zhang X, Ren S, et al (2015) Deep residual learning for image recognition.\narXiv:1512.03385\n[21] He K, Chen X, Xie S, et al (2021) Masked autoencoders are scalable vision learners. CoRR abs/2111.06377. URL https://arxiv.org/abs/2111.06377, 2111.06377\n[22] Kingma DP, Welling M (2013) Auto-encoding variational bayes. https://doi.org/\n10.48550/ARXIV.1312.6114, URL https://arxiv.org/abs/1312.6114\n[23] Kingma DP, Welling M (2019) An introduction to variational autoencoders.\nCoRR abs/1906.02691. URL http://arxiv.org/abs/1906.02691, 1906.02691\n[24] Le VT, Kim YG (2023) Attention-based residual autoencoder for video\nanomaly detection. Applied Intelligence 53(3):3240–3254. https://doi.org/10.\n1007/s10489-022-03613-1, URL https://doi.org/10.1007/s10489-022-03613-1\n[25] Mattia FD, Galeone P, Simoni MD, et al (2021) A survey on gans for anomaly\ndetection. arXiv:1906.11632\n[26] Michelucci U (2022) An introduction to autoencoders. CoRR abs/2201.03898.\nURL https://arxiv.org/abs/2201.03898, 2201.03898\n[27] Mishra P, Verk R, Fornasier D, et al (2021) Vt-adl: A vision transformer network\nfor image anomaly detection and localization. In: 2021 IEEE 30th International\nSymposium on Industrial Electronics (ISIE). IEEE, https://doi.org/10.1109/\nisie45552.2021.9576231, URL http://dx.doi.org/10.1109/ISIE45552.2021.9576231\n[28] Mooijman P, Catal C, Tekinerdogan B, et al (2023) The effects of data\nbalancing approaches: A case study. Applied Soft Computing 132:109853.\nhttps://doi.org/https://doi.org/10.1016/j.asoc.2022.109853, URL https://www.\nsciencedirect.com/science/article/pii/S1568494622009024\n[29] Muhr D, Affenzeller M, Küng J (2023) A probabilistic transformation of distancebased outliers. arXiv:2305.09446\n[30] Napoletano P, Piccoli F, Schettini R (2018) Anomaly detection in nanofibrous\nmaterials by cnn-based self-similarity. Sensors 18(1):209\n[31] Pidhorskyi S, Almohsen R, Doretto G (2018) Generative probabilistic novelty detection with adversarial autoencoders. Advances in neural information\nprocessing systems 31\n\n34\n\n\f[32] Prabhakar C, Li HB, Yang J, et al (2023) Vit-ae++: Improving\nvision transformer autoencoder for self-supervised medical image representations. arXiv preprint arXiv:230107382 URL https://arxiv.org/abs/2301.07382,\narXiv:2301.07382 [cs.CV]\n[33] Rippel O, Mertens P, Merhof D (2021) Modeling the distribution of normal data\nin pre-trained deep features for anomaly detection. In: 2020 25th International\nConference on Pattern Recognition (ICPR), IEEE, pp 6726–6733\n[34] Roth K, Pemula L, Zepeda J, et al (2022) Towards total recall in industrial\nanomaly detection. In: Proceedings of the IEEE/CVF Conference on Computer\nVision and Pattern Recognition, pp 14318–14328\n[35] Sabokrou M, Khalooei M, Fathy M, et al (2018) Adversarially learned oneclass classifier for novelty detection. In: Proceedings of the IEEE conference on\ncomputer vision and pattern recognition, pp 3379–3388\n[36] Shvetsova N, Bakker B, Fedulova I, et al (2021) Anomaly detection in medical imaging with deep perceptual autoencoders. IEEE Access 9:118571–118583.\nhttps://doi.org/10.1109/access.2021.3107163, URL http://dx.doi.org/10.1109/\nACCESS.2021.3107163\n[37] Tian Y, Henaff OJ, van den Oord A (2021) Divide and contrast: Self-supervised\nlearning from uncurated data. arXiv:2105.08054\n[38] Venkataramanan S, Peng KC, Singh RV, et al (2020) Attention guided anomaly\nlocalization in images. In: European Conference on Computer Vision, Springer,\npp 485–503\n[39] Wang Z, Bovik AC, Sheikh HR, et al (2004) Image quality assessment: from\nerror visibility to structural similarity. IEEE transactions on image processing\n13(4):600–612\n[40] Wickramasinghe CS, Marino DL, Manic M (2021) Resnet autoencoders for unsupervised feature learning from high-dimensional data: Deep models resistant to\nperformance degradation. IEEE Access 9:40511–40520. https://doi.org/10.1109/\nACCESS.2021.3064819\n[41] Xia X, Pan X, Li N, et al (2022) Gan-based anomaly detection: A\nreview. Neurocomputing 493:497–535. https://doi.org/https://doi.org/10.1016/\nj.neucom.2021.12.093, URL https://www.sciencedirect.com/science/article/pii/\nS0925231221019482\n[42] Xie X, Huang Y, Ning W, et al (2022) Rdad: A reconstructive and discriminative anomaly detection model based on transformer. International Journal of Intelligent Systems 37(11):8928–8946. https://doi.org/https://doi.org/10.\n1002/int.22974, URL https://onlinelibrary.wiley.com/doi/abs/10.1002/int.22974,\n\n35\n\n\fhttps://onlinelibrary.wiley.com/doi/pdf/10.1002/int.22974\n[43] Xu H, Pang G, Wang Y, et al (2023) Deep isolation forest for anomaly detection.\nIEEE Transactions on Knowledge and Data Engineering pp 1–14. https://doi.\norg/10.1109/TKDE.2023.3270293\n[44] Yu J, Zheng Y, Wang X, et al (2021) Fastflow: Unsupervised anomaly detection\nand localization via 2d normalizing flows. arXiv:2111.07677\n[45] Zavrtanik V, Kristan M, Skočaj D (2021) Draem-a discriminatively trained\nreconstruction embedding for surface anomaly detection. In: Proceedings of the\nIEEE/CVF International Conference on Computer Vision, pp 8330–8339\n[46] Zhou Y, Xu X, Song J, et al (2023) Msflow: Multi-scale flow-based framework for\nunsupervised anomaly detection. arXiv:2308.15300\n[47] Zini S, Bianco S, Schettini R (2020) Deep residual autoencoder for blind universal jpeg restoration. IEEE Access 8:63283–63294. https://doi.org/10.1109/access.\n2020.2984387, URL http://dx.doi.org/10.1109/ACCESS.2020.2984387\n\n36\n\n\f</code></pre></article>\n        \n</main>\n\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/contrib/auto-render.min.js\"></script>\n<script>\n\nfunction initTheme() {\n  const saved = localStorage.getItem('kb-theme') || 'light';\n  document.documentElement.setAttribute('data-theme', saved);\n  updateThemeIcon(saved);\n}\nfunction toggleTheme() {\n  const cur = document.documentElement.getAttribute('data-theme') || 'light';\n  const next = cur === 'light' ? 'dark' : 'light';\n  document.documentElement.setAttribute('data-theme', next);\n  localStorage.setItem('kb-theme', next);\n  updateThemeIcon(next);\n}\nfunction updateThemeIcon(t) {\n  const btn = document.getElementById('theme-toggle-btn');\n  if (btn) btn.innerHTML = t === 'dark' ? '☀️' : '🌙';\n}\ndocument.addEventListener('DOMContentLoaded', initTheme);\n\nfunction setViewMode(m) {\n  const grid = document.getElementById('bento-grid-view');\n  const list = document.getElementById('list-table-view');\n  const bGrid = document.getElementById('view-grid-btn');\n  const bList = document.getElementById('view-list-btn');\n  if (m === 'list') {\n    if (grid) grid.style.display = 'none';\n    if (list) list.style.display = 'flex';\n    if (bGrid) bGrid.classList.remove('active');\n    if (bList) bList.classList.add('active');\n  } else {\n    if (grid) grid.style.display = 'grid';\n    if (list) list.style.display = 'none';\n    if (bGrid) bGrid.classList.add('active');\n    if (bList) bList.classList.remove('active');\n  }\n  localStorage.setItem('kb-view', m);\n}\ndocument.addEventListener('DOMContentLoaded', () => {\n  const s = localStorage.getItem('kb-view') || 'grid';\n  setViewMode(s);\n});\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  document.querySelectorAll('pre').forEach(pre => {\n    const b = document.createElement('button');\n    b.className = 'copy-code-btn';\n    b.innerText = 'Copy';\n    b.onclick = () => {\n      const c = pre.querySelector('code') ? pre.querySelector('code').innerText : pre.innerText;\n      navigator.clipboard.writeText(c).then(() => {\n        b.innerText = 'Copied!';\n        setTimeout(() => { b.innerText = 'Copy'; }, 2000);\n      });\n    };\n    pre.appendChild(b);\n  });\n});\n\nwindow.addEventListener('keydown', (e) => {\n  if ((e.key === '/' || (e.metaKey && e.key === 'k')) && document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {\n    e.preventDefault();\n    const q = document.getElementById('global-search-input');\n    if (q) q.focus();\n  }\n});\n\n// Scrollspy for TOC\nwindow.addEventListener('scroll', () => {\n  const headers = document.querySelectorAll('.article-body h1, .article-body h2, .article-body h3');\n  const scrollPos = window.scrollY + 100;\n  headers.forEach(h => {\n    if (h.offsetTop <= scrollPos) {\n      const id = h.getAttribute('id');\n      if (id) {\n        document.querySelectorAll('.reading-sidebar a').forEach(a => {\n          a.classList.toggle('active', a.getAttribute('href') === '#' + id);\n        });\n      }\n    }\n  });\n});\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n  if (window.renderMathInElement) {\n    renderMathInElement(document.body, {\n      delimiters: [\n        {left: '$$', right: '$$', display: true},\n        {left: '$', right: '$', display: false},\n      ],\n      throwOnError : false\n    });\n  }\n});\n</script>\n\n</body>\n</html>\n"