"<!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>AnoStyler: Text-Driven Localized Anomaly Generation\nvia Lightweight Style Transfer\nYulim So, Seokho Kang*\n\narXiv:2511.06687v1 [cs.CV] 10 Nov 2025\n\nSungkyunkwan University\nyou0715@skku.edu, s.kang@skku.edu\n\nAbstract\nAnomaly generation has been widely explored to address the\nscarcity of anomaly images in real-world data. However, existing methods typically suffer from at least one of the following limitations, hindering their practical deployment: (1)\nlack of visual realism in generated anomalies; (2) dependence\non large amounts of real images; and (3) use of memoryintensive, heavyweight model architectures. To overcome\nthese limitations, we propose AnoStyler, a lightweight yet effective method that frames zero-shot anomaly generation as\ntext-guided style transfer. Given a single normal image along\nwith its category label and expected defect type, an anomaly\nmask indicating the localized anomaly regions and two-class\ntext prompts representing the normal and anomaly states are\ngenerated using generalizable category-agnostic procedures.\nA lightweight U-Net model trained with CLIP-based loss\nfunctions is used to stylize the normal image into a visually realistic anomaly image, where anomalies are localized\nby the anomaly mask and semantically aligned with the text\nprompts. Extensive experiments on the MVTec-AD and VisA\ndatasets show that AnoStyler outperforms existing anomaly\ngeneration methods in generating high-quality and diverse\nanomaly images. Furthermore, using these generated anomalies helps enhance anomaly detection performance.\n\nCode — https://github.com/yulimso/AnoStyler\n\n1\n\nIntroduction\n\nAnomaly detection aims to identify patterns or regions in an\nimage that deviate from the learned notion of normality (Li\net al. 2025). Due to the rarity and diversity of anomalies,\nunsupervised learning (Defard et al. 2021; Roth et al. 2022;\nBatzner, Heckler, and König 2024; Hyun et al. 2024; Wu\net al. 2025; Fang et al. 2025) on normal images has emerged\nas the dominant paradigm. Despite their success, these methods lack the capacity to model diverse real-world anomaly\ndistributions, which limits their performance, particularly in\ncomplex or unseen domains (Cui, Liu, and Lian 2023; Cao,\nZhu, and Pang 2023). This underscores the necessity of generating realistic and diverse anomaly images as alternative\nsupervisory signals, leading to active research on Anomaly\nGeneration to mitigate the scarcity of real anomaly images.\n* Corresponding author.\nCopyright © 2026, Association for the Advancement of Artificial\nIntelligence (www.aaai.org). All rights reserved.\n\nNormal Image\n\nGenerated Anomaly Image by AnoStyler\n\n[c]=“carpet”\n\n[d]=“hole”\n\n[d]=“thread”\n\n[c]=“pill”\n\n[d]=“color”\n\n[d]=“crack”\n\n[c]=“cashew”\n\n[d]=“burnt”\n\n[d]=“rotten”\n\n[c]=“candle”\n\n[d]=“crack”\n\n[d]=“defect”\n\nFigure 1: Examples of anomaly images generated by AnoStyler. Given a normal image and a category-defect pair\n([c], [d]), our method generates visually realistic and semantically aligned anomalies.\n\nExisting anomaly generation methods can be broadly categorized into two paradigms: few-shot and zero-shot methods. Few-shot methods typically train generative models to\nsynthesize anomaly images based on a few real anomaly images, assuming access to these real anomalies (Zhang et al.\n2021; Duan et al. 2023; Hu et al. 2024; Gui et al. 2024).\nZero-shot methods, on the other hand, operate under a more\nchallenging yet practical scenario where no anomaly images\nare available, thus have emerged as promising research directions. Earlier zero-shot methods relied on direct manipulation of normal images using handcrafted operations (Lin\net al. 2021; Li et al. 2021; Zavrtanik, Kristan, and Skočaj\n2021; Schlüter et al. 2022) , whereas more recent methods\neither employ generative models trained solely on normal\nimages to synthesize anomalies by perturbing the generation\nprocess (Zhang, Xu, and Zhou 2024) or leverage pre-trained\ngenerative models guided by text prompts (Sun et al. 2025).\nWhile effective, existing methods still face one or more of\nthe following limitations that restrict their practical applicability. First, the generated anomalies lack visual realism and\n\n\fsemantic fidelity, especially for methods that directly manipulate normal images (Li et al. 2021; Zavrtanik, Kristan, and\nSkočaj 2021; Schlüter et al. 2022). Using such low-quality\nanomalies may result in poor generalization to real-world\nanomalies. Second, the generation process necessitates access to large amounts of real normal images (Zhang, Xu,\nand Zhou 2024), and further requires even a small number of\nreal anomalies in the case of few-shot methods (Duan et al.\n2023; Hu et al. 2024; Gui et al. 2024), making it challenging\nin scenarios where collecting real data is costly or difficult.\nThird, the generation process depends on memory-intensive\nheavyweight architectures like diffusion models (Duan et al.\n2023; Hu et al. 2024; Gui et al. 2024; Zhang, Xu, and Zhou\n2024; Sun et al. 2025), rendering it impractical for real-time\nor resource-constrained scenarios.\nIn this work, we propose AnoStyler, a lightweight yet\neffective zero-shot anomaly generation method that simultaneously addresses the aforementioned limitations. AnoStyler frames anomaly generation as a text-driven style transfer task, in which a normal image is transformed into\nan anomaly image by locally modifying its visual attributes while preserving its overall structural content. Compared to mainstream methods that leverage generative models (Goodfellow et al. 2014; Ho, Jain, and Abbeel 2020),\nstyle transfer (Gatys, Ecker, and Bethge 2016) can better\npreserve the overall content of the original image while injecting localized anomalies, making it inherently more suitable for anomaly generation. Nevertheless, it remains underexplored in this context; to the best of our knowledge,\nwe present the first approach that effectively leverages style\ntransfer for this purpose. AnoStyler integrates shape-guided\nmasking and state-aware prompt generation with tailored\nlosses to achieve semantically aligned anomaly stylization.\nAs illustrated in Figure 1, AnoStyler generates realistic and\ndiverse anomalies that are semantically consistent with text\nprompts while preserving the global structure of the input\nimage. Leveraging these components, AnoStyler achieves\nstate-of-the-art performance among zero-shot methods on\nMVTec-AD and VisA, and its generated anomalies significantly enhance downstream anomaly detection.\nOur main contributions are summarized as follows:\n• We propose a method that generates high-quality and realistic anomalies in various types, with precise semantic\nalignment to text prompts.\n• We design a zero-shot anomaly generation framework\nthat requires only a single normal image to synthesize\neach anomaly, removing the dependency on large collections of normal or anomaly images that hinder scalability.\n• We introduce a lightweight model architecture that enables computationally and memory-efficient anomaly\ngeneration while preserving competitive performance.\n\n2\n2.1\n\nRelated Work\n\nAnomaly Generation\n\nDepending on the availability of anomalies in the training\ndata, anomaly generation can be formulated as either a fewshot or zero-shot task. Few-shot methods leverage a small\n\nnumber of anomaly images to train generative models, such\nas DFMGAN (Duan et al. 2023) based on generative adversarial networks (GANs) (Goodfellow et al. 2014), and AnoDiff (Hu et al. 2024) and AnoGen (Gui et al. 2024) based\non diffusion models (Ho, Jain, and Abbeel 2020), which are\ntrained using a large number of normal images in addition\nto the few anomaly images.\nIn contrast, zero-shot methods operate under the assumption that no anomaly images are available. Heuristic methods generate synthetic anomalies by directly manipulating\nnormal images using handcrafted operations. For example,\nCutPaste (Li et al. 2021) and NSA (Schlüter et al. 2022)\nuse cut-and-paste operation, and DRAEM (Zavrtanik, Kristan, and Skočaj 2021) uses external texture injection. Recent studies have proposed methods that leverage generative\nmodels to produce more realistic anomalies with enhanced\nsemantic alignment and visual fidelity. RealNet (Zhang, Xu,\nand Zhou 2024) utilizes a diffusion model trained on normal\nimages and generates anomalies by perturbing the denoising\nprocess. AnomalyAny (Sun et al. 2025) guides Stable Diffusion using text prompts to generate anomaly images. While\nthey are effective, they often incur high computational costs\nand memory usage due to their reliance on diffusion models.\n\n2.2\n\nStyle Transfer\n\nStyle transfer aims to generate a new image that combines\nthe structural content of an input with the texture or style of a\nreference. The seminal work on neural style transfer (Gatys,\nEcker, and Bethge 2016) presented an optimization-based\nmethod that uses feature statistics from a pre-trained CNN\nto separately model content and style. Subsequent methods\nimproved efficiency and generality by introducing featurelevel transformations, such as AdaIN (Huang and Belongie\n2017) and WCT (Li et al. 2017, 2018).\nWith the advent of CLIP (Radford et al. 2021), a new\nline of research has emerged that replaces reference style\nimages with natural language prompts. StyleCLIP (Patashnik et al. 2021) maps text embeddings to latent directions\nin StyleGAN (Karras, Laine, and Aila 2019), enabling textdriven manipulation within the learned image manifold.\nCLIPstyler (Kwon et al. 2022) performs text-conditioned\nstyle transfer by optimizing patch-wise CLIP loss, achieving\nlocalized and semantically meaningful stylization without\nstyle images. Building on CLIPstyler, subsequent research\nhas advanced text-driven and object-centric style editing,\nexploring approaches for fine-grained and localized stylization. Recent studies (Kamra, Mastan, and Gupta 2023;\nGanugula et al. 2023; Singh et al. 2024; Chen et al. 2024) incorporate mechanisms such as foreground–background separation, segmentation masks, and semantic guidance to selectively apply distinct styles to specific regions or objects.\nFollowing this line of research, we apply text-driven localized style transfer to zero-shot anomaly generation. With\nCLIP-based losses, AnoStyler efficiently adds text-guided\nlocalized anomalies while preserving overall content.\n\n\f(1) Shape-Guided Mask Generation\n\n∩\n\n∩\n\n∩\n\n∩\n\n𝐌!\n\n…\n\nTrainable\n\n𝐌#\n\n𝐌\"\n\nComposite Mask 𝐌 $\n\n=\n\nForeground Mask\n𝐌 \"#\n\n…\n\nAnomaly Mask\n𝐌!\n\nSAM\n\nInput\n\n…\n\nPatches 𝐏#\n\nImage\nEncoder\nℰ!\n\nStylization Network\nℱ\nAnomaly Image 𝐈 \"\n\nNormal Image 𝐈 !\n\n(2) Two-Class Prompt Generation\n\n…\n\n[s]:= [c] with\n[d] defect\n\n[d]=“hole”\n\n…\n\nℒ$%&amp;'(\n\nNormal Prompt Set 𝒯 !\n\n[s] := flawless [c]\n\n[c]=“hazelnut”\n\nCategory-Defect Pair\n\nFrozen\n\n(3) Text-Driven Localized Anomaly Generation\n\na photo of the [s].\n\n…\n\nPrompt Template\n\nState descriptor Template\n\na photo of the\nflawless hazelnut.\n\n…\n\na photo of the hazelnut\nwith hole defect.\n\n…\n\nℒ$)%*\n\nText\nEncoder\nℰ\"\n\nAnomaly Prompt Set 𝒯 \"\n\nFigure 2: Overall framework of AnoStyler. (1) Shape-Guided Mask Generation: A union of primitive masks M1 , . . . , Mm\nfrom Meta-Shape Priors is intersected with the foreground mask Mf g to obtain the anomaly mask Ma . (2) Two-Class Prompt\nGeneration: Structured text prompt templates are filled with the category-defect pair ([c], [d]) to form normal and anomaly\nprompt sets T n and T a . (3) Text-Driven Localized Anomaly Generation: Guided by Ma , T n , and T a , the stylization network\nF is trained to stylize the masked regions of the input image In as anomalies, resulting in the synthetic anomaly image Ia .\n\n3\n3.1\n\nMethod\n\nOverview of AnoStyler\n\nAnoStyler frames anomaly generation as a text-guided style\ntransfer process that transforms a normal image by injecting localized anomalies. The inputs to the generation process are a real normal image In ∈ RC×H×W , where C, H,\nand W denote the number of channels, image height, and\nwidth, respectively, as well as its category label [c] and expected defect type [d] in text format. Using the image In\nas the content and the category-defect pair ([c], [d]) as a\nreference style, the generation process outputs a generated\nanomaly image Ia ∈ RC×H×W . The generation process,\nwhich generates one synthetic anomaly image at a time from\none real normal image, consists of three sequential steps, as\nillustrated in Figure 2.\n\n3.2\n\nModel Architecture\n\nThe stylization network F is modeled as a lightweight UNet (Kwon et al. 2022) that takes a normal image In as\ninput and generates a stylized output Ia serving as a synthetic anomaly image. A pre-trained CLIP model (Radford\net al. 2021) is incorporated to guide anomaly generation by\nF. The text encoder ET is a Transformer encoder that embeds text prompts in T n or T a . The image encoder EI is a\nVision Transformer that embeds images In , Ia , or patches\nPj extracted from Ia . These embeddings are used to compute CLIP-based loss functions that enforce semantic consistency between the generated image and the given text\nprompt. During training, only the stylization network F is\ntrainable, while all parameters of the text encoder ET and\nimage encoder EI are frozen.\n\n3.3\n\nShape-Guided Mask Generation\n\nWe argue that a practical anomaly mask generation method\nshould meet two essential criteria. First, it should produce\nvisually plausible masks that generalize across diverse categories and domains without relying on category-specific assumptions. Previous methods often rely on simple geometric\nshapes like rectangles (Li et al. 2021; Schlüter et al. 2022)\nor Perlin noise (Zavrtanik, Kristan, and Skočaj 2021; Zhang,\nXu, and Zhou 2024), which lack the fidelity required to\nmimic plausible anomalies. Second, it should be lightweight\nfor scalable deployment. Previous methods that rely on dedicated heavyweight model like diffusion models (Duan et al.\n2023; Hu et al. 2024) are not scalable and introduce significant computational overhead. To this end, we propose a generalizable category-agnostic and lightweight non-parametric\nprocedure that leverages primitive geometric components.\nMeta-Shape Priors. For the procedural generation of\nanomaly masks, we introduce meta-shape priors, which\ncomprise three primitive shapes designed to capture a distinct class of geometric patterns for localized anomaly regions: Line, Dot, and Freeform. These three shape types\nare carefully chosen to cover a broad spectrum of plausible\nanomaly geometries observed in real-world data, while agnostic to specific categories or domains. Line-shaped masks\nare created by connecting multiple points along a sampled\ndirection with variable thickness. Sinusoidal perturbations\nadd curvature, effectively capturing straight or wavy lineshaped anomalies. Dot-shaped masks are generated by sampling points radially around a center and perturbing their\nradii with noise. They preserve a circular form while producing smooth, spiky, or irregular closed shapes. Freeform\n\n\fmasks are produced by simulating unconstrained random\ntrajectories. Unlike the structured forms above, they generate irregular, topology-free regions resembling diffused or\namorphous anomalies. Detailed procedures for generating\nmasks of these three types are provided in Appendix B.\nAnomaly Mask Generation. To generate an anomaly\nmask for the input image In , we first combine multiple\nanomaly regions derived from meta-shape priors, then retain\nthe parts that overlap with the foreground of the image. The\nassumption is that multiple anomaly regions may co-occur\nwithin a single image and can appear only in the foreground.\nThe number of anomaly regions m is sampled from a categorical distribution with exponentially decaying probabilities. The probability mass function is defined as:\nexp(−αi)\nP (m = i) = Pmmax\n,\nj=1 exp(−αj)\n\ni ∈ {1, 2, . . . , mmax },\n\n(1)\nwhere mmax denotes the maximum number of anomaly regions and α is a decay coefficient that favors fewer anomalies while allowing for more complex compositions to occasionally occur within an image.\nTo generate a primitive mask Mi indicating an anomaly\nregion, we randomly select one of the three meta-shape priors (i.e., Line, Dot, or Freeform) and follow its mask generation procedure. After obtaining m masks, we take their\nunion to allow multiple distinct regions to be represented\nwithin a single mask. The composite mask Md is given by:\nd\n\nM =\n\nm\n[\n\nMi .\n\n(2)\n\ni=1\n\nThe final anomaly mask Ma is obtained by intersecting\nMd with the foreground mask Mf g indicating the foreground region of an image. If the category label [c] for an\nimage given is object-centric, where anomalies typically occur on object surfaces, we use the Segment Anything Model\n(SAM) (Kirillov et al. 2023) with a ViT-B backbone to generate the foreground mask. Specifically, we designate four\ncorner points as positive prompts to guide SAM in extracting\nthe background region, and then apply a negation operation\nto obtain the foreground mask Mf g . If the category label\n[c] is texture-centric, such as fabrics or surfaces without\ndistinct object boundaries, we treat the entire image as foreground by setting Mf g = 1H×W . The final anomaly mask\nMa is then given by:\nMa = Md ∩ Mf g .\n\n3.4\n\n(3)\n\nTwo-Class Prompt Generation\n\nWe propose a generalizable template-based text prompt\ngeneration procedure by adapting three key techniques:\ntwo-class design, prompt templates, and prompt averaging.\nTwo-class design (Jeong et al. 2023) constructs separate\ntext prompts for the normal and anomaly states. Explicitly\nmodeling each state provides clearer guidance on how an\nanomaly image should differ from a normal one. The use of\nstructured prompt templates facilitates intuitive and scalable\nprompt generation by requiring only the specification of the\n\ncategory label and defect type, without requiring domainspecific knowledge or real anomaly images. Prompt averaging (Radford et al. 2021) generates multiple semantically\nequivalent prompts for the given context and averages their\nembeddings to guide anomaly generation. This reduces variability and potential bias introduced by any single prompt,\nresulting in more stable and consistent text conditioning.\nGiven the category-defect pair ([c], [d]) for the input image In , we first generate two-class state descriptors [s] for the normal and anomaly states using predefined state descriptor templates (Jeong et al. 2023). For example, the normal state is described by phrases such as\n\"flawless [c]\", while the anomaly state is described\nby phrases such as \"[c] with [d] defect\". Next,\neach state descriptor [s] is inserted into predefined prompt\ntemplates to form full text prompts such as \"a photo of\nthe [s]\" (Kwon et al. 2022). If the category label [c]\nor the defect type [d] is not provided, the default token\n\"sample\" or \"defect\" can be used, respectively. This\nyields a normal prompt set T n and an anomaly prompt set\nT a . The complete list of templates used is provided in Appendix C. By prompt averaging, the embeddings of T n and\nT a are obtained using the clip encoder ET as:\n1 X\n1 X\nhnT = n\nET (Ti ); haT = a\nET (Ti ).\n|T |\n|T |\nTi ∈T n\nTi ∈T a\n(4)\n\n3.5\n\nText-Driven Localized Anomaly Generation\n\nThe anomaly mask Ma and the prompt sets T n and T a are\nused to guide the stylization network F to transform the\ninput image In by incorporating localized anomalies. We\nintroduce two loss terms specifically designed to promote\nthe spatial localization and semantic alignment of synthetic\nanomalies: the Mask-Weighted Co-Directional Loss Lmwcd\nand the Masked CLIP Loss Lmclip . Following CLIPstyler,\nwe additionally adopt the Content Loss Lc (Gatys, Ecker,\nand Bethge 2016) and the Total Variation Loss Ltv (Rudin,\nOsher, and Fatemi 1992) to ensure the semantic fidelity and\nspatial smoothness of the generated image. The training objective for F is given by:\nL = Lmwcd + λmclip · Lmclip + λc · Lc + λtv · Ltv ,\n\n(5)\n\nwhere λmclip , λc , and λtv are weights that control the\nstrengths of each loss term.\nAfter the stylization network F is trained, the stylized image Ia , which serves as a generated anomaly image, is generated by compositing the network output F(In ) with the\noriginal input image In using the anomaly mask Ma as a\nbinary weight matrix:\nIa = F(In ) ⊙ Ma + In ⊙ (1 − Ma ),\n\n(6)\n\nwhere ⊙ is the element-wise product operator. This ensures\nthat style transfer is applied exclusively within the masked\nregions while preserving the surrounding background.\nMask-Weighted Co-Directional Loss. The concept of directional supervision in CLIP embedding space, originally\n\n\fintroduced in StyleGAN-NADA (Gal et al. 2022) and further explored in CLIPstyler (Kwon et al. 2022), is the basis\nof the loss Lmwcd . The loss is computed as a weighted sum\nof a global directional alignment term Lgdir and a patch-wise\ndirectional alignment term Lpdir , defined as:\nLmwcd = λgdir · Lgdir + λpdir · Lpdir ,\n\n(7)\n\nwhere λgdir and Lpdir are weights assigned to each term.\nWe modify the original loss to place greater emphasis on\nanomaly regions indicated by the anomaly mask Ma . The\nmodified loss terms incorporating the mask Ma and the\nmask-guided anomaly image Ia are detailed as follows.\nThe first term Lgdir measures global directional alignment\nbetween images and text prompts by comparing their respective shifts from the normal to the anomaly state in the CLIP\nembedding space. The directional shifts of the image and\nprompt embeddings are computed as:\n∆hI = haI − hnI = EI (Ia ) − EI (In );\n∆hT = haT − hnT .\n\n(8)\n(9)\n\nThe term Lgdir is then defined as the cosine distance between\n∆hI and ∆hT :\n∆hI · ∆hT\nLgdir = 1 −\n.\n(10)\n∥∆hI ∥ · ∥∆hT ∥\nMinimizing this term encourages the global semantic shift\nfrom the normal image In to the generated image Ia to align\nwith the intended transformation described by the two-class\nprompt sets T n and T a .\nThe second term Lpdir is a patch-wise extension of Lgdir\ndesigned to further refine alignment at a finer scale. It measures patch-wise directional alignment by operating on image patches extracted from Ia , thereby providing localized\nsemantic guidance in contrast to global alignment over the\nwhole image. Here, we extract l patches {Pj }lj=1 from Ia\nvia random cropping. For each patch Pj , we measure the\nlocal directional shift from the input image In as:\n∆hPj = haPj − hnI = EI (τ (Pj )) − EI (In ),\n\n(11)\n\nwhere τ denotes a random perspective transformation applied to induce patch-wise geometric variation. The term\nLpdir is then defined as:\n\u0012\n\u0013\nl\nX\n∆hPj · ∆hT\n1\nrj 1 −\n, (12)\nLpdir = Pl\n∥∆hPj ∥ · ∥∆hT ∥\nj=1 rj j=1\nwhere rj ∈ [0, 1] denotes the ratio of pixels in Pj that are\ncovered by the anomaly mask Ma . With this soft weighting,\neach patch Pj contributes proportionally to its overlap with\nMa , thereby placing greater emphasis on anomaly regions.\nMasked CLIP Loss. The loss Lmclip is designed to further\nenforce semantic alignment between the localized anomalies\nin the generated anomaly image Ia and the target semantics\ndescribed by the anomaly prompt set T a . Specifically, the\nloss is defined as the cosine distance between the masked\nregion of the generated image Ia and the anomaly prompt\nset T a in the CLIP embedding space:\nEI (Ia ⊙ Ma ) · haT\nLmclip = 1 −\n.\n(13)\n∥EI (Ia ⊙ Ma )∥ · ∥haT ∥\n\nMVTec-AD\nMethod\n\nIS\n\nVisA\n\nIC-L\n\nIS\n\nIC-L\n\nFew-Shot Anomaly Generation\nDFMGAN⋆ (Duan et al. 2023)\n1.72 0.20\nAnoDiff⋆ (Hu et al. 2024)\n1.80 0.32\nAnoGen† (Gui et al. 2024)\n1.77 0.27\n\n1.48\n1.50\n1.40\n\n0.28\n0.29\n0.22\n\nZero-Shot Anomaly Generation\nCutPaste (Li et al. 2021)\n1.76 0.22\nDRAEM† (Zavrtanik et al. 2021) 1.76 0.25\n1.44 0.26\nNSA◦ (Schlüter et al. 2022)\nRealNet◦ (Zhang et al. 2024)\n1.64 0.22\nAnomalyAny◦ (Sun et al. 2025)\n2.02 0.33\n\n1.52\n1.50\n1.42\n1.53\n1.41\n\n0.26\n0.25\n0.19\n0.29\n0.19\n\nAnoStyler (ours)\n\n1.55\n\n0.32\n\n†\n\n2.04\n\n0.32\n\nTable 1: Comparison of anomaly generation on MVTecAD and VisA. For each metric, the best and second-best\nscores are shown in bold and underlined. †: Re-implemented\non both datasets; ⋆ and ◦: Results on MVTec-AD taken\nfrom (Hu et al. 2024) and (Sun et al. 2025), respectively,\nwith results on VisA re-implemented for a fair comparison.\nRestricting this loss to the regions specified by the anomaly\nmask Ma ensures that semantic alignment is focused only\non these anomaly regions, without affecting the background\nof the input image.\n\n4\n4.1\n\nExperiments\n\nExperiment Settings\n\nDatasets. We conducted experiments on two representative benchmark datasets for industrial visual anomaly detection: MVTec-AD (Bergmann et al. 2019) and VisA (Zou\net al. 2022). MVTec-AD consists of 5,354 high-resolution\nimages across 10 object and 5 texture categories, each associated with 1 to 7 defect types, which is curated to support the detection of subtle local anomalies in controlled\nsettings. VisA consists of 10,821 images spanning 12 object categories, and it captures more complex scenes with\nmulti-object arrangements and diverse structural variations.\nFor both datasets, each image is paired with a ground-truth\npixel-wise anomaly mask. In the experiments, all images and\nmasks were resized to 512×512. Detailed information about\nthe benchmark datasets is provided in Appendix A.\nImplementation Details. The stylization network F had\na U-Net architecture, consisting of three downsampling\nblocks and three upsampling blocks, as used in Kwon et al.\n(2022). For the image encoder EI and text encoder ET , we\nused the pre-trained CLIP ViT-B/32 model. Detailed hyperparameter configurations of AnoStyler are provided in\nAppendix D. All experiments were conducted on a single\nNVIDIA RTX 2080Ti GPU with 11 GB of memory. All experiments were repeated five times with different random\nseeds, and the average performance is reported.\nBaselines. Our method AnoStyler was compared with a\ndiverse set of zero-shot anomaly generation methods, including CutPaste (Li et al. 2021), DRAEM (Zavrtanik, Kris-\n\n\fNormal Image\n\nDFMGAN\n\nAnoDiff\n\nAnoGen\n\nCutPaste\n\nDRAEM\n\nNSA\n\nRealNet\n\nAnomalyAny\n\nAnoStyler\n\nMVTec AD – Tile\n\nMVTec AD – Screw\n\nMVTec AD – Hazelnut\n\nVisA– Cashew\n\nVisA– Pipe fryum\n\nFigure 3: Comparison of generated anomaly images and their corresponding anomaly masks on MVTec-AD and VisA. AnoStyler generates visually realistic anomalies that align well with the masks.\ntan, and Skočaj 2021), NSA (Schlüter et al. 2022), RealNet (Zhang, Xu, and Zhou 2024), and AnomalyAny (Sun\net al. 2025). For broader comparison, we also considered\nfew-shot methods, including DFMGAN (Duan et al. 2023),\nAnoDiff (Hu et al. 2024), AnoGen (Gui et al. 2024). It\nshould be noted that few-shot methods have an inherent advantage in terms of performance, as they benefit from access\nto a small number of real anomaly images.\n\nproduce unrealistic anomalies. Among generative zero-shot\nmethods, RealNet also suffers from a lack of realism, while\nAnomalyAny generates more realistic anomalies but often\nintroduces artifacts and overly smoothed details in certain\ncategories. Additional qualitative examples for all categories\ngenerated by AnoStyler are provided in Appendix F.\n\n4.2\n\nWe evaluated the methods based on their impact on the performance of the downstream anomaly detection task The\nevaluation protocol followed those used in Zavrtanik, Kristan, and Skočaj (2021) and Hu et al. (2024). For each category, we generated 500 anomaly images and used them with\nreal normal images to train a U-Net model, which takes an\nimage as input and predicts its anomaly mask. Anomaly detection performance was assessed on the test sets from each\nbenchmark dataset. We used Area Under ROC Curve (AUROC), Average Precision (AP), and F1-score at both the image level (I-AUC, I-AP, I-F1) and pixel level (P-AUC, PAP, P-F1) . Additionally, we included Per-Region Overlap\n(PRO) to evaluate region-level localization performance.\nTable 2 presents the results averaged across categories\nwithin each benchmark dataset. The full category-wise results of AnoStyler are provided in Appendix E. AnoStyler\nachieved state-of-the-art anomaly detection performance on\nboth MVTec-AD and VisA under zero-shot settings. Remarkably, despite having no access to real anomaly images during the generation of synthetic anomalies, AnoStyler yielded performance comparable with or even superior to few-shot baselines. This highlights the effectiveness\n\nAnomaly Generation Results\n\nWe first evaluated the effectiveness of AnoStyler and the\nbaseline methods in anomaly generation. Following the evaluation protocol of (Hu et al. 2024), we generated 1,000\nanomaly images per category for each method. The Inception Score (IS) (Salimans et al. 2016) and the Intra-Cluster\npairwise LPIPS distance (IC-L) (Ojha et al. 2021) were used\nto quantitatively evaluate generation quality and diversity.\nTable 1 presents the quantitative performance comparison\nfor anomaly generation, with results averaged across all categories within each benchmark dataset. The full categorywise results of AnoStyler are provided in Appendix E.\nAnoStyler achieved the highest IS and the second-highest\nIC-L on MVTec-AD, and obtained the best scores for both\nmetrics on VisA, indicating superior visual quality and diversity in its images. The qualitative results are presented in\nFigure 3. The images generated by AnoStyler demonstrate\ncompetitive visual realism compared to few-shot methods\nthat have access to real anomaly images, including DFMGAN, AnoDiff, and AnoGen. In contrast, heuristic zero-shot\nmethods, including CutPaste, DRAEM, and NSA, tend to\n\n4.3\n\nAnomaly Detection Results\n\n\fMVTec-AD\nMethod\n\nI-AUC\n\nDFMGAN⋆ (Duan et al. 2023)\nAnoDiff⋆ (Hu et al. 2024)\nAnoGen† (Gui et al. 2024)\n\n87.2\n99.2\n98.7\n\nP-AUC\n\nVisA\n\nI-AP\n\nI-F1\n\nP-F1 PRO\n\nI-AUC\n\nI-AP\n\nI-F1\n\nP-AUC P-AP\n\nP-F1 PRO\n\n94.8\n99.7\n99.6\n\nFew-Shot Anomaly Generation\n94.7\n90.0\n62.7 62.1 76.3\n98.7\n99.1\n81.4 76.3 94.0\n97.7\n96.9\n73.6 66.7 90.7\n\nP-AP\n\n83.7\n86.9\n90.4\n\n85.7\n89.1\n92.4\n\n80.3\n85.4\n87.2\n\n90.6\n93.2\n89.1\n\n31.0\n33.0\n31.6\n\n34.6\n36.8\n33.4\n\n74.9\n79.0\n73.8\n\n86.3\n91.8\n87.3\n92.6\n88.9\n\n86.9\n92.9\n89.8\n93.8\n86.2\n\n87.1\n88.6\n84.2\n89.2\n85.9\n\n88.4\n91.4\n92.6\n92.2\n90.4\n\n32.2\n29.5\n26.1\n33.3\n31.2\n\n39.6\n37.2\n34.2\n41.0\n33.0\n\n77.7\n81.9\n74.2\n83.0\n84.6\n\n93.9\n\n95.3\n\n90.1\n\n93.8\n\n31.4\n\n36.4\n\n84.3\n\n†\n\nCutPaste (Li et al. 2021)\nDRAEM⋆ (Zavrtanik et al. 2021)\nNSA† (Schlüter et al. 2022)\nRealNet† (Zhang et al. 2024)\nAnomalyAny† (Sun et al. 2025)\n\n89.8\n94.6\n93.0\n95.2\n95.2\n\n92.1\n97.0\n95.6\n97.0\n96.9\n\nZero-Shot Anomaly Generation\n89.8\n88.2\n51.9 50.7 76.4\n94.4\n92.2\n54.1 53.1 83.1\n91.6\n92.0\n52.6 52.5 82.2\n95.3\n94.0\n57.7 56.6 85.2\n96.3\n89.0\n62.7 59.9 84.7\n\nAnoStyler (ours)\n\n98.0\n\n99.0\n\n97.0\n\n94.4\n\n62.9\n\n60.7\n\n88.3\n\nTable 2: Comparison of anomaly detection on MVTec-AD and VisA. All scores are shown in percentages. For each metric,\nthe best and second-best scores among zero-shot methods are indicated in bold and underlined. †: Re-implemented on both\ndatasets; ⋆: Results on MVTec-AD taken from (Hu et al. 2024), with results on VisA re-implemented for a fair comparison.\n\n#\n\nLgdir\n\n(a)\n(b)\n(c)\n(d)\n\n✓\n✓\n✓\n\nLpdir\n\n✓\n✓\n\nLmclip\n\nIS\n\nIC-L\n\nI-AUC\n\nP-AUC\n\n✓\n\n1.70\n1.86\n1.96\n2.04\n\n0.25\n0.29\n0.30\n0.32\n\n88.2\n95.2\n96.7\n98.0\n\n85.7\n92.5\n93.2\n94.4\n\nTable 3: Ablation study on the effect of the proposed loss\ncomponents in AnoStyler on the MVTec-AD dataset. The\nresults on the VisA dataset are provided in Appendix E.\nNormal Image\n\n(a)\n\n(b)\n\n(c)\n\n(d)\n\nFigure 4: Qualitative results corresponding to the loss configurations presented in Table 3. The first and second rows\nuse category labels [c] = \"wood\" and \"chewinggum\",\nrespectively, with defect type [d] = \"scratch\".\n\nof AnoStyler for downstream anomaly detection. Additional\nstatistical significance analysis is provided in Appendix G.\n\n4.4\n\nAblation Study\n\nWe conducted an ablation study to analyze the contributions\nof the proposed loss components: modifying Lgdir , modifying Lpdir , and adding Lmclip , relative to the baseline training\nobjective (Kwon et al. 2022). Table 3 presents the quantitative results. Directly applying the baseline objective, denoted as (a), resulted in degraded performance. The proposed modifications to Lgdir and Lpdir , as in (b) and (c), led\nto performance improvements, highlighting their respective\n\ncontributions. The best performance was achieved with (d),\nwhich corresponds to the full AnoStyler training objective\nincorporating all three proposed components, demonstrating\ntheir combined effectiveness. As shown in the qualitative examples in Figure 4, while (a) produces unrealistic anomalies,\n(b), (c), and (d) show gradual improvements in both visual\nrealism and semantic alignment with the text prompt.\n\n4.5\n\nComputational Efficiency\n\nAnoStyler comprises 263M parameters in total, including\n91M for SAM, 0.61M for the stylization network F , 151M\nfor the CLIP encoders ET and EI , and 20M for the feature\nextractor computing Lc , whereas diffusion-based baselines\nsuch as AnoDiff, AnoGen, RealNet, and AnomalyAny each\ncontain over 1B parameters, making AnoStyler much more\ncompact. Among these methods, AnomalyAny is the only\none that generates anomalies without large amounts of real\nimages, serving as the most comparable baseline. Generating one anomaly image requires 9.5 TFLOPs for AnoStyler versus 22.8 TFLOPs for AnomalyAny, demonstrating\nits substantially lower computational cost.\n\n5\n\nConclusion\n\nIn this paper, we proposed AnoStyler, a novel zeroshot anomaly generation method that generates synthetic\nanomaly images through text-guided style transfer from\na single normal image. It produces high-quality, diverse\nanomalies with strong visual realism and semantic alignment to text prompts, without requiring access to large\namounts of real images. In addition, its lightweight architecture enables computationally and memory-efficient anomaly\ngeneration. In experimental results on the MVTec-AD and\nVisA benchmarks, AnoStyler not only outperformed existing zero-shot methods but also achieved performance comparable to few-shot methods in both anomaly generation and\ndownstream anomaly detection. These findings suggest that\nAnoStyler offers a text-driven alternative to recent mainstream methods that demand substantial computational resources, making it well suited for real-world deployment.\n\n\fAcknowledgements\nThis work was supported by the National Research Foundation of Korea (NRF) grant (No. RS-2023-00207903) and\nthe Institute of Information &amp; Communications Technology Planning &amp; Evaluation (IITP) grant (No. RS-202502214591, Development of an Innovative AI Agent for\nWorker-Friendly Autonomous Manufacturing), funded by\nthe Korea government (MSIT; Ministry of Science and ICT).\n\nReferences\nBatzner, K.; Heckler, L.; and König, R. 2024. EfficientAD:\nAccurate Visual Anomaly Detection at Millisecond-Level\nLatencies. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 128–138.\nBergmann, P.; Fauser, M.; Sattlegger, D.; and Steger, C.\n2019. MVTec AD: A Comprehensive Real-World Dataset\nfor Unsupervised Anomaly Detection. In Proceedings of\nthe IEEE/CVF Conference on Computer Vision and Pattern\nRecognition, 9592–9600.\nCao, T. T.; Zhu, J.; and Pang, G. 2023. Anomaly Detection\nUnder Distribution Shift. In Proceedings of the IEEE/CVF\nInternational Conference on Computer Vision, 6511–6523.\nChen, J.; Rong, P.; Sun, J.; Li, C.; Li, X.; and Lv, H. 2024.\nSoulstyler: Using Large Language Model to Guide Image\nStyle Transfer for Target Object. In Proceedings of the IEEE\nInternational Conference on Acoustics, Speech and Signal\nProcessing, 4015–4020.\nCui, Y.; Liu, Z.; and Lian, S. 2023. A Survey on Unsupervised Anomaly Detection Algorithms for Industrial Images.\nIEEE Access, 11: 55297–55315.\nDefard, T.; Setkov, A.; Loesch, A.; and Audigier, R. 2021.\nPaDiM: a Patch Distribution Modeling Framework for\nAnomaly Detection and Localization. In Proceedings of the\nInternational Conference on Pattern Recognition, 475–489.\nDuan, Y.; Hong, Y.; Niu, L.; and Zhang, L. 2023. Few-Shot\nDefect Image Generation via Defect-Aware Feature Manipulation. In Proceedings of the AAAI Conference on Artificial\nIntelligence, 571–578.\nFang, Q.; Su, Q.; Lv, W.; Xu, W.; and Yu, J. 2025.\nBoosting Fine-Grained Visual Anomaly Detection with\nCoarse-Knowledge-Aware Adversarial Learning. In Proceedings of the AAAI Conference on Artificial Intelligence,\n7943–7951.\nGal, R.; Alaluf, Y.; Atzmon, Y.; Bermano, A. H.; Chechik,\nG.; and Cohen-Or, D. 2022. StyleGAN-NADA: CLIPGuided Domain Adaptation of Image Generators. ACM\nTransactions on Graphics, 41(4): 141.\nGanugula, P.; Kumar, Y. S. S. S. S.; Reddy, N. K. S.;\nChellingi, P.; Thakur, A.; Kasera, N.; and Anand, C. S.\n2023. MOSAIC: Multi-Object Segmented Arbitrary Stylization Using CLIP. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, 892–\n903.\nGatys, L. A.; Ecker, A. S.; and Bethge, M. 2016. Image\nStyle Transfer Using Convolutional Neural Networks. In\nProceedings of the IEEE Conference on Computer Vision\nand Pattern Recognition, 2414–2423.\n\nGoodfellow, I. J.; Pouget-Abadie, J.; Mirza, M.; Xu, B.;\nWarde-Farley, D.; Ozair, S.; Courville, A.; and Bengio, Y.\n2014. Generative Adversarial Nets. In Advances in Neural\nInformation Processing Systems, 2672–2680.\nGui, G.; Gao, B.-B.; Liu, J.; Wang, C.; and Wu, Y. 2024.\nFew-Shot Anomaly-Driven Generation for Anomaly Classification and Segmentation. In Proceedings of the European\nConference on Computer Vision, 210–226.\nHo, J.; Jain, A.; and Abbeel, P. 2020. Denoising Diffusion\nProbabilistic Models. In Advances in Neural Information\nProcessing Systems, 6840–6851.\nHu, T.; Zhang, J.; Yi, R.; Du, Y.; Chen, X.; Liu, L.; Wang, Y.;\nand Wang, C. 2024. AnomalyDiffusion: Few-Shot Anomaly\nImage Generation with Diffusion Model. In Proceedings of\nthe AAAI Conference on Artificial Intelligence, 8526–8534.\nHuang, X.; and Belongie, S. 2017. Arbitrary Style Transfer\nin Real-Time with Adaptive Instance Normalization. In Proceedings of the IEEE International Conference on Computer\nVision, 1501–1510.\nHyun, J.; Kim, S.; Jeon, G.; Kim, S. H.; Bae, K.; and Kang,\nB. J. 2024. ReConPatch: Contrastive Patch Representation\nLearning for Industrial Anomaly Detection. In Proceedings of the IEEE/CVF Winter Conference on Applications\nof Computer Vision, 2052–2061.\nJeong, J.; Zou, Y.; Kim, T.; Zhang, D.; Ravichandran, A.;\nand Dabeer, O. 2023. WinCLIP: Zero-/Few-Shot Anomaly\nClassification and Segmentation. In Proceedings of the\nIEEE/CVF Conference on Computer Vision and Pattern\nRecognition, 19606–19616.\nKamra, C. G.; Mastan, I. D.; and Gupta, D. 2023. SEM-CS:\nSemantic CLIPStyler for Text-Based Image Style Transfer.\nIn Proceedings of the IEEE International Conference on Image Processing, 395–399.\nKarras, T.; Laine, S.; and Aila, T. 2019. A Style-Based Generator Architecture for Generative Adversarial Networks. In\nProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 4401–4410.\nKirillov, A.; Mintun, E.; Ravi, N.; Mao, H.; Rolland, C.;\nGustafson, L.; Xiao, T.; Whitehead, S.; Berg, A. C.; Lo, W.Y.; Dollár, P.; and Girshick, R. 2023. Segment Anything.\nIn Proceedings of the IEEE/CVF Conference on Computer\nVision and Pattern Recognition, 4015–4026.\nKwon, H.; Kim, D.; Choi, Y.; Kim, J.; and Ha, J.-W. 2022.\nCLIPstyler: Image Style Transfer with a Single Text Condition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 18062–18071.\nLi, C.-L.; Sohn, K.; Yoon, J.; and Pfister, T. 2021. CutPaste:\nSelf-Supervised Learning for Anomaly Detection and Localization. In Proceedings of the IEEE/CVF Conference on\nComputer Vision and Pattern Recognition, 9664–9674.\nLi, Y.; Fang, C.; Yang, J.; Wang, Z.; Lu, X.; and Yang, M.-H.\n2017. Universal Style Transfer via Feature Transforms. In\nAdvances in Neural Information Processing Systems, 386–\n396.\nLi, Y.; Liu, M.-Y.; Li, X.; Yang, M.-H.; and Kautz, J. 2018.\nA Closed-Form Solution to Photorealistic Image Stylization.\n\n\fIn Proceedings of the European Conference on Computer\nVision, 453–468.\nLi, Z.; Yan, Y.; Wang, X.; Ge, Y.; and Meng, L. 2025. A\nSurvey of Deep Learning for Industrial Visual Anomaly Detection. Artificial Intelligence Review, 58(279).\nLin, D.; Cao, Y.; Zhu, W.; and Li, Y. 2021. Few-Shot Defect Segmentation Leveraging Abundant Normal Training\nSamples Through Normal Background Regularization and\nCrop-and-Paste Operation. In Proceedings of the IEEE International Conference on Multimedia and Expo.\nOjha, U.; Li, Y.; Lu, J.; Efros, A. A.; Lee, Y. J.; Shechtman, E.; and Zhang, R. 2021. Few-Shot Image Generation via Cross-Domain Correspondence. In Proceedings of\nthe IEEE/CVF Conference on Computer Vision and Pattern\nRecognition, 10743–10752.\nPatashnik, O.; Wu, Z.; Shechtman, E.; Cohen-Or, D.; and\nLischinski, D. 2021. StyleCLIP: Text-Driven Manipulation\nof StyleGAN Imagery. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2085–2094.\nRadford, A.; Kim, J. W.; Hallacy, C.; Ramesh, A.; Goh, G.;\nAgarwal, S.; Sastry, G.; Askell, A.; Mishkin, P.; Clark, J.;\nKrueger, G.; and Sutskever, I. 2021. Learning Transferable\nVisual Models from Natural Language Supervision. In Proceedings of the International Conference on Machine Learning, 8748–8763.\nRoth, K.; Pemula, L.; Zepeda, J.; Schölkopf, B.; Brox,\nT.; and Gehler, P. 2022. Towards Total Recall in Industrial Anomaly Detection. In Proceedings of the IEEE/CVF\nConference on Computer Vision and Pattern Recognition,\n14318–14328.\nRudin, L. I.; Osher, S.; and Fatemi, E. 1992. Nonlinear Total Variation Based Noise Removal Algorithms. Physica D:\nNonlinear Phenomena, 60(1–4): 259–268.\nSalimans, T.; Goodfellow, I.; Zaremba, W.; Cheung, V.; Radford, A.; and Chen, X. 2016. Improved Techniques for\nTraining GANs. In Advances in Neural Information Processing Systems, 2234–2242.\nSchlüter, H. M.; Tan, J.; Hou, B.; and Kainz, B. 2022. Natural Synthetic Anomalies for Self-Supervised Anomaly Detection and Localization. In Proceedings of the European\nConference on Computer Vision, 474–489.\nSingh, S.; Jandial, S.; Shahid, S.; and Java, A. 2024. LEAST:\n“Local” text-conditioned image style transfer. In Proceedings of the CVPR Workshop on AI for Content Creation.\nSun, H.; Cao, Y.; Dong, H.; and Fink, O. 2025. Unseen Visual Anomaly Generation. In Proceedings of the IEEE/CVF\nConference on Computer Vision and Pattern Recognition,\n25508–25517.\nWu, H.; Xu, Q.; Li, Z.; Liang, S.; Chen, L.; Zhao, H.; Lin,\nD.; Xu, W.; and Wei, Y. 2025. DFM: Differentiable Feature Matching for Anomaly Detection. In Proceedings of\nthe IEEE/CVF Conference on Computer Vision and Pattern\nRecognition, 15224–15233.\nZavrtanik, V.; Kristan, M.; and Skočaj, D. 2021. DRAEM\n– A Discriminatively Trained Reconstruction Embedding\nfor Surface Anomaly Detection. In Proceedings of the\n\nIEEE/CVF International Conference on Computer Vision,\n8330–8339.\nZhang, G.; Cui, K.; Hung, T.; and Lu, S. 2021. Defect-GAN:\nHigh-Fidelity Defect Synthesis for Automated Defect Inspection. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2524–2534.\nZhang, X.; Xu, M.; and Zhou, X. 2024. RealNet: A Feature Selection Network with Realistic Synthetic Anomaly\nfor Anomaly Detection. In Proceedings of the IEEE/CVF\nConference on Computer Vision and Pattern Recognition,\n16699–16709.\nZou, Y.; Jeong, J.; Pemula, L.; Zhang, D.; and Dabeer, O.\n2022. SPot-the-Difference Self-Supervised Pre-training for\nAnomaly Detection and Segmentation. In Proceedings of\nthe European Conference on Computer Vision, 392–408.\n\n\fA\n\nDetails of Benchmark Datasets\n\nTables 4 and 5 present the complete list of categories, image counts, and defect types used in MVTec-AD and VisA, respectively.\nIn MVTec-AD, each anomalous image is annotated with a single, well-defined defect type. These predefined defect types were\ndirectly used to construct text prompts for guiding AnoStyler’s anomaly generation. In VisA, annotations include multiple,\nfree-form textual descriptions per anomaly image. To maintain consistency, we uniformly assign the label “defect” as the defect\ntype for all anomaly images across all categories.\nType\n\nObject\n\nTexture\n\n# Train\n(Normal)\n\n# Test\n(Normal)\n\n# Test\n(Anomaly)\n\nbottle\ncable\n\n209\n224\n\n20\n58\n\n63\n92\n\ncapsule\nhazelnut\nmetal nut\npill\n\n219\n391\n220\n267\n\n23\n40\n22\n26\n\n109\n70\n93\n141\n\nscrew\n\n320\n\n41\n\n119\n\ntoothbrush\ntransistor\nzipper\n\n60\n213\n240\n\n12\n60\n32\n\n30\n40\n119\n\ncarpet\ngrid\nleather\ntile\nwood\n\n280\n264\n245\n230\n247\n\n28\n21\n32\n33\n19\n\n89\n57\n92\n84\n60\n\nCategory [c]\n\nDefect Types [d]\nbroken large, broken small, contamination\nbent wire,\ncable swap,\ncombined,\ncut inner insulation,\ncut outer insulation, missing cable, missing wire, poke insulation\ncrack, faulty imprint, poke, scratch, squeeze\ncrack, cut, hole, print\nbent, color, flip, scratch\ncolor, combined, contamination, crack, faulty imprint, pill type,\nscratch\nmanipulated front, scratch head, scratch neck, thread side,\nthread top\ndefective\nbent lead, cut lead, damaged case, misplaced\nbroken teeth, combined, fabric border, fabric interior, rough,\nsplit teeth, squeezed teeth\ncolor, cut, hole, metal contamination, thread\nbent, broken, glue, metal contamination, thread\ncolor, cut, fold, glue, poke\ncrack, glue strip, gray stroke, oil, rough\ncolor, combined, hole, liquid, scratch\n\nTable 4: Categories, image counts, and defect types in MVTec-AD.\n\nType\n\nCategory [c]\n\nObject\n\ncandle\ncapsules\ncashew\nchewinggum\nfryum\nmacaroni1\nmacaroni2\npcb1\npcb2\npcb3\npcb4\npipe fryum\n\n# Train\n(Normal)\n\n# Test\n(Normal)\n\n# Test\n(Anomaly)\n\n900\n542\n450\n453\n450\n900\n900\n904\n901\n905\n904\n450\n\n100\n60\n50\n50\n50\n100\n100\n100\n100\n101\n101\n50\n\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n\nDefect Types [d]\ndefect\ndefect\ndefect\ndefect\ndefect\ndefect\ndefect\ndefect\ndefect\ndefect\ndefect\ndefect\n\nTable 5: Categories, image counts, and defect types in VisA.\n\n\fB\n\nMeta-Shape Priors\n\nAlgorithms 1, 2, and 3 describe the mask generation procedures for the Line, Dot, and Freeform types, respectively.\nFigure 5 shows example primitive masks generated by these\nprocedures. On average, generating a single mask takes 0.54\nms (Line), 0.09 ms (Dot), and 115.23 ms (Freeform), based\non 100 independent runs, demonstrating the efficiency of our\nprocedural generation methods.\nAlgorithm 1: Line Mask Generation Procedure\n1: M ← initialize a mask of width W and height H\n2: c = (cw , ch ) ∼ (U(0, W ), U(0, H))\n# center point\n3: θ ∼ U(0, π)\n# radians angle\n4: l ∼ U(60, 200)\n# length\n5: s ∼ U(20, 40)\n# number of points\n6: x ∈ Rs ← linspace(−l/2, l/2, s)\n7: y ∈ Rs ← 0\n8: if Bernoulli(0.5) then\n9:\nϵ ∈ Rs ∼ N(0, 142 )\n# Gaussian noise\n10:\ny ← GaussianBlur(ϵ, (1, 5), 2)\n\nAlgorithm 3: Freeform Mask Generation Procedure\n1: M ← initialize a mask of width W and height H\n2: nstep ∼ U(300, 18000) # number of random walk steps\n3: σ ∼ U(2, 12)\n# std. dev. for GaussianBlur\n4: (x0 , y0 ) ∼ (U(0, W ), U(0, H))\n# initial point\n5: for i = 1 to nstep do\n6:\n(∆xi , ∆yi ) ∼ (U({−1, 0, 1}), U({−1, 0, 1}))\n7:\n(xi , yi ) ← (xi−1 , yi−1 ) + (∆xi , ∆yi )\n8:\nM[yi , xi ] ← 1\n9: end for\n10: M ← GaussianBlur(M, 2 · σ + 1, σ)\n11: if Bernoulli(0.5) then\n12:\nM ← Dilate(M, 3)\n# Dilate(kernel size)\n13:\nM ← Erode(M, 3)\n# Erode(kernel size)\n14: end if\n15: M ← Binarize(M)\n16: M ← LargestComponent(M)\n# keep largest region\n17: return M\n\n1: M ← initialize a mask of width W and height H\n2: c = (cw , ch ) ∼ (U(0, W ), U(0, H))\n# center point\n3: r ∼ U(5, 35)\n# radius\n4: s ∼ U(12, 30)\n# number of points\n5: θ ∈ Rs ∼ U(0, 2π)\n# perimeter angles\n6: ρ ∼ U(0.6, 1.4)\n# oval ratio\n7: β ∼ U(0.05, 0.35)\n# radius jitter scale\n8: u ∼ U(0, 1)\n\n\u001a\n\nU(−βr, βr) if u ≥ 0.66\n, ∀i = 1, . . . , s\nN(0, (βr)2 ) if u &lt; 0.66\n10: xi ← cx + (r + ri ) cos θi · ρ, ∀i = 1, . . . , s\n11: yi ← cy + (r + ri ) sin θi , ∀i = 1, . . . , s\n12: M ← M + Polygon({(xi , yi )}si=1 )\n13: if Bernoulli(0.5) then\n14:\nk ∼ U({3, 5, 7})\n15:\nM ← GaussianBlur(M, k, 0)\n16: end if\n17: M ← Binarize(M)\n18: return M\n9: ri ∼\n\nDot\n\nAlgorithm 2: Dot Mask Generation Procedure\n\nFreeform\n\n# thickness\n\u0015\n\u0014\n\u0015\nx′i\ncos θ − sin θ xi\n14:\n←\n+c\nyi′\nsin θ\ncos θ\ny\n\u0014 ′ \u0015\n\u0014\n\u0015 \u0014i\n\u0015\nxi+1\ncos θ − sin θ xi+1\n15:\n←\n+c\n′\nyi+1\nsin θ\ncos θ\nyi+1\n′\n16:\nM ← M + Line((x′i , yi′ ), (x′i+1 , yi+1\n), ti )\n17: end for\n18: M ← Binarize(M)\n19: return M\n\nLine\n\n# GaussianBlur(input, kernel size, std. dev.)\n11: end if\n12: t ∈ Rs ∼ U(1, 7)\n13: for\u0014i =\n\u0015 1 to\u0014s − 1 do\n\nFigure 5: Example masks generated by the proposed MetaShape Priors. Rows 1–3, 4-6, and 7-9 correspond to Line,\nDot, and Freeform types, respectively.\n\n\fC\n\nTwo-Class Prompt Templates\n\nIn this work, we adopt the three state descriptor templates for each of the normal and anomaly states from WinCLIP (Jeong\net al. 2023), along with the 55 prompt templates from CLIPstyler (Kwon et al. 2022). Therefore, each image is associated with\n165 normal prompts and 165 anomaly prompts, i.e., |T a | = |T n | = 165.\n(a) state descriptor templates - (normal state)\n\n(b) state descriptor templates - (anomaly state)\n\n• s := \"flawless [c]\"\n• s := \"perfect [c]\"\n• s := \"unblemished [c]\"\n\n• s := \"[c] with [d] defect\"\n• s := \"[c] with [d] flaw\"\n• s := \"[c] with [d] damage\"\n\n(c) prompt templates\n• \"a bad photo of a(n)\n[s].\"\n• \"a sculpture of a(n)\n[s].\"\n• \"a photo of the hard to\nsee [s].\"\n• \"a low resolution photo\nof the [s].\"\n• \"a rendering of a(n)\n[s].\"\n• \"graffiti of a(n) [s].\"\n• \"a cropped photo of the\n[s].\"\n• \"a tattoo of a(n) [s].\"\n• \"the embroidered [s].\"\n• \"a photo of a hard to see\n[s].\"\n• \"a bright photo of a(n)\n[s].\"\n• \"a photo of a clean [s].\"\n• \"a photo of a dirty [s].\"\n• \"a dark photo of the\n[s].\"\n• \"a drawing of a(n) [s].\"\n• \"a photo of my [s].\"\n• \"the plastic [s].\"\n• \"a photo of the cool\n[s].\"\n\n• \"a close-up photo of a(n)\n[s].\"\n• \"a black and white photo\nof the [s].\"\n• \"a painting of the [s].\"\n• \"a painting of a(n) [s].\"\n• \"a pixelated photo of the\n[s].\"\n• \"a sculpture of the [s].\"\n• \"a bright photo of the\n[s].\"\n• \"a cropped photo of a(n)\n[s].\"\n• \"a plastic [s].\"\n• \"a photo of the dirty\n[s].\"\n• \"a blurry photo of the\n[s].\"\n• \"a photo of the [s].\"\n• \"a good photo of the\n[s].\"\n• \"a rendering of the [s].\"\n• \"a(n) [s] in a video\ngame.\"\n• \"a photo of one [s].\"\n• \"a doodle of a(n) [s].\"\n• \"a close-up photo of the\n[s].\"\n\n• \"a photo of a(n) [s].\"\n• \"the origami [s].\"\n• \"the [s] in a video\ngame.\"\n• \"a sketch of a(n) [s].\"\n• \"a doodle of the [s].\"\n• \"a origami [s].\"\n• \"a low resolution photo\nof a(n) [s].\"\n• \"the toy [s].\"\n• \"a rendition of the [s].\"\n• \"a photo of the clean\n[s].\"\n• \"a photo of a large [s].\"\n• \"a rendition of a(n)\n[s].\"\n• \"a photo of a nice [s].\"\n• \"a photo of a weird [s].\"\n• \"a blurry photo of a(n)\n[s].\"\n• \"a cartoon [s].\"\n• \"art of a [s].\"\n• \"a sketch of the [s].\"\n• \"a embroidered [s].\"\n\nFigure 6: Full list of two-class prompt templates. The category-defect pair ([c], [d]) is inserted into the corresponding\nplaceholders in the state descriptor templates to generate state descriptors for the normal and anomaly states. Each resulting\nstate descriptor then replaces the placeholder [s] in the prompt templates to construct complete text prompts.\n\n\fD\n\nHyperparameter Settings\n\nFor style-guided mask generation, we set the decay coefficient α = 0.7 and the maximum number of primitive\nmasks mmax = 5. For text-driven localized anomaly generation, the number of patches l was set to 64, with each\npatch sized at 128×128. The distortion scale of the perspective transformation τ was set to 0.5. Since the input size\nto the image encoder EI is 224×224, we resized images or\npatches using bicubic interpolation before feeding them into\nEI . In the training objective, we adopted the following loss\nweights from CLIPstyler: λgdir = 5 × 102 , λpdir = 9 × 103 ,\nλtv = 2 × 10−3 , and λc = 150. We set the loss weight\nλmclip = 103 . The content loss Lc was computed using feature activations from the “conv4 2” and “conv5 2” layers of\nVGG-19, following Gatys, Ecker, and Bethge (2016). The\nstylization network F was trained for 75 iterations using the\nAdam optimizer with a constant learning rate of 5 × 10−4 .\n\nE\n\nDetailed Quantitative Results\nCategory\n\nIS\n\nIC-L\n\nbottle\ncable\ncapsule\ncarpet\ngrid\nhazelnut\nleather\nmetal nut\npill\nscrew\ntile\ntoothbrush\ntransistor\nwood\nzipper\n\n1.55\n1.53\n1.96\n1.28\n2.52\n1.83\n2.94\n2.33\n1.65\n1.39\n2.92\n1.46\n1.57\n2.91\n2.77\n\n0.21\n0.39\n0.20\n0.26\n0.39\n0.32\n0.45\n0.30\n0.24\n0.32\n0.52\n0.17\n0.29\n0.39\n0.29\n\nAverage\n\n2.04\n\n0.32\n\nTable 6: Per-category anomaly generation performance of\nAnoStyler on MVTec-AD.\n\nCategory\n\nI-AUC\n\nI-AP\n\nI-F1\n\nP-AUC\n\nP-AP\n\nP-F1\n\nPRO\n\nbottle\ncable\ncapsule\ncarpet\ngrid\nhazelnut\nleather\nmetal nut\npill\nscrew\ntile\ntoothbrush\ntransistor\nwood\nzipper\n\n98.8±1.0\n90.5±1.0\n98.6±0.7\n98.0±0.6\n100.0±0.0\n99.3±0.0\n100.0±0.0\n94.3±2.5\n98.4±0.2\n96.2±3.3\n100.0±0.0\n100.0±0.0\n95.9±1.5\n99.8±0.0\n100.0±0.0\n\n99.6±0.3\n94.0±1.0\n99.7±0.1\n99.5±0.1\n100.0±0.0\n99.6±0.0\n100.0±0.0\n98.7±0.5\n99.7±0.0\n98.7±1.0\n100.0±0.0\n100.0±0.0\n95.7±1.4\n99.9±0.0\n100.0±0.0\n\n97.8±1.8\n88.1±0.2\n97.4±0.2\n96.8±0.6\n100.0±0.0\n98.1±0.4\n100.0±0.0\n94.3±2.2\n97.5±0.3\n95.0±2.6\n100.0±0.0\n100.0±0.0\n90.7±2.6\n99.2±0.0\n100.0±0.0\n\n93.5±1.2\n89.9±1.4\n94.9±1.1\n97.8±0.8\n97.4±0.0\n98.1±0.1\n99.8±0.1\n93.0±1.6\n99.4±0.0\n96.0±0.9\n99.5±0.0\n97.8±0.6\n64.4±2.1\n96.4±0.2\n98.3±0.4\n\n70.0±3.7\n33.6±6.1\n46.6±4.3\n81.7±1.7\n41.4±4.9\n74.0±0.4\n74.1±1.0\n71.8±5.2\n92.8±0.5\n31.0±2.1\n95.7±0.3\n49.0±2.4\n24.9±5.7\n79.1±2.8\n77.8±2.8\n\n64.9±2.8\n41.7±7.0\n47.0±3.0\n75.7±1.4\n46.4±2.3\n66.9±0.6\n67.6±2.1\n65.5±2.9\n85.6±1.2\n35.6±4.0\n88.7±0.5\n54.6±3.3\n27.1±4.7\n72.1±3.2\n71.8±2.5\n\n84.6±2.7\n75.1±0.0\n92.8±0.1\n92.6±0.9\n94.0±0.0\n96.1±0.1\n98.4±0.4\n80.1±3.0\n95.6±0.1\n88.1±0.8\n97.3±0.1\n88.4±1.1\n56.5±1.1\n92.4±0.7\n92.8±1.1\n\nAverage\n\n98.0±0.3\n\n99.0±0.2\n\n97.0±0.4\n\n94.4±0.5 62.9±1.1 60.7±1.1 88.3±0.1\n\nTable 8: Per-category anomaly detection performance of\nAnoStyler on MVTec-AD (mean±standard deviation over\n5 runs).\n\nCategory\n\nI-AUC\n\nI-AP\n\nI-F1\n\nP-AUC\n\nP-AP\n\nP-F1\n\nPRO\n\ncandle\ncapsules\ncashew\nchewinggum\nfryum\nmacaroni1\nmacaroni2\npcb1\npcb2\npcb3\npcb4\npipe fryum\n\n91.4±2.0\n93.1±2.0\n95.8±0.0\n98.3±0.1\n87.9±2.5\n97.0±0.3\n89.5±2.1\n88.2±3.8\n95.5±1.0\n95.7±1.1\n97.3±0.0\n96.8±1.4\n\n92.8±1.3\n96.2±1.1\n97.4±0.4\n99.3±0.0\n94.2±1.7\n97.6±0.3\n91.5±2.2\n88.4±3.8\n95.5±0.8\n96.3±1.0\n96.0±0.4\n98.4±0.7\n\n85.7±1.8\n90.2±2.5\n94.6±1.8\n96.6±0.3\n87.8±1.7\n92.2±0.5\n83.3±3.4\n82.7±3.4\n90.9±2.2\n89.7±1.4\n93.7±0.2\n93.9±1.6\n\n90.7±0.9\n92.7±2.5\n92.9±0.5\n98.9±0.0\n93.2±2.5\n97.9±0.6\n96.3±1.1\n93.4±0.7\n89.7±1.0\n89.3±2.3\n94.4±0.5\n96.0±1.6\n\n23.1±1.1\n26.4±5.4\n18.7±10.6\n75.3±9.1\n30.6±3.7\n24.1±5.8\n15.3±4.1\n46.4±15.0\n17.1±9.0\n26.3±1.9\n32.3±1.7\n40.1±2.0\n\n32.4±0.4\n34.5±4.8\n23.3±8.6\n67.0±10.1\n34.6±2.5\n31.7±5.5\n25.2±4.5\n49.4±17.0\n22.5±7.0\n34.0±2.0\n37.4±1.5\n45.2±1.1\n\n84.3±0.8\n86.5±3.4\n88.4±10.3\n84.2±2.1\n86.5±6.6\n92.2±1.5\n89.7±0.3\n62.2±3.3\n72.5±2.7\n88.5±0.8\n84.0±0.6\n93.2±1.5\n\nAverage\n\n93.9±1.0 95.3±0.7 90.1±0.9 93.8±0.5 31.4±1.4\n\n36.4±1.5\n\n84.3±0.6\n\nTable 9: Per-category anomaly detection performance of\nAnoStyler on VisA (mean±standard deviation over 5 runs).\nCategory\n\nIS\n\nIC-L\n\ncandle\ncapsules\ncashew\nchewinggum\nfryum\nmacaroni1\nmacaroni2\npcb1\npcb2\npcb3\npcb4\npipe fryum\n\n1.70\n1.45\n1.78\n1.73\n1.33\n1.58\n2.39\n1.28\n1.07\n1.14\n1.05\n2.14\n\n0.20\n0.53\n0.37\n0.38\n0.21\n0.26\n0.41\n0.35\n0.34\n0.23\n0.30\n0.24\n\nAverage\n\n1.55\n\n0.32\n\nTable 7: Per-category anomaly generation performance of\nAnoStyler on VisA.\n\n#\n\nLgdir\n\n(a)\n(b)\n(c)\n(d)\n\n✓\n✓\n✓\n\nLpdir\n\n✓\n✓\n\nLmclip\n\nIS\n\nIC-L\n\nI-AUC P-AUC\n\n✓\n\n1.40\n1.48\n1.51\n1.55\n\n0.24\n0.27\n0.29\n0.32\n\n89.3\n90.2\n91.6\n93.9\n\n85.3\n89.5\n91.7\n93.8\n\nTable 10: Ablation study on the effect of the proposed loss\ncomponents in AnoStyler on the VisA dataset.\n\n\fDetailed Qualitative Results\n\nbottle\n\nF\n\nbroken large\n\nbroken small\n\ncrack\n\nscratch\n\ncontamination\n\ndefect\n\ncable swap\n\nmissing wire\n\nmissing cable\n\nscratch\n\ncombined\n\ndefect\n\ncrack\n\nfaulty imprint\n\npoke\n\nscratch\n\nsqueeze\n\ndefect\n\ncut\n\nhole\n\nmetal contamination\n\ncolor\n\nthread\n\ndefect\n\nbroken\n\nbent\n\nmetal contamination\n\nglue\n\nthread\n\ndefect\n\ncrack\n\nscratch\n\ncut\n\nhole\n\nprint\n\ndefect\n\ncolor\n\npoke\n\npeel\n\ncrack\n\nglue\n\nleather\n\nhazelnut\n\ngrid\n\ncarpet\n\ncapsule\n\ncable\n\ndefect\n\nFigure 7: Generated anomaly images for various defect types in MVTec-AD. Each image is shown with its corresponding\nanomaly mask (bottom-right) (continued).\n\n\fmetal nut\n\nbent\n\ncolor\n\nflip\n\nscratch\n\nrusty\n\ndefect\n\ncolor\n\ncrack\n\nscratch\n\nfaulty imprint\n\ncombined\n\ndefect\n\nscratch head\n\nscratch neck\n\nthread side\n\nrusty\n\nsqueeze\n\ndefect\n\ncrack\n\nglue strip\n\ncombined\n\noil\n\nrough\n\ndefect\n\nbroken\n\nmold\n\ncontamination\n\ncolor\n\nscratch\n\ndefect\n\nbent lead\n\ncontamination\n\nscratch\n\ndamaged case\n\npoke\n\ndefect\n\ncolor\n\nhole\n\nliquid\n\nscratch\n\ncrack\n\ndefect\n\ncombined\n\nfabric border\n\nfabric interior\n\nrough\n\nbroken teeth\n\nzipper\n\nwood\n\ntransistor\n\ntoothbrush\n\ntile\n\nscrew\n\npill\n\ndefect\n\nFigure 7: Generated anomaly images for various defect types in MVTec-AD. Each image is shown with its corresponding\nanomaly mask (bottom-right).\n\n\fcapsules\n\ncandle\n\ncolor\n\ncrack\n\ndefect\n\nscratch\n\nburnt\n\ndefect\n\nscratch\n\nburnt\n\ndefect\n\nbroken\n\ncontamination\n\ndefect\n\nstain\n\nscratch\n\ndefect\n\nstain\n\nscratch\n\ndefect\n\nscratch\n\nsqueeze\n\ndefect\n\nscratch\n\ncontamination\n\ndefect\n\ncrack\n\npoke\n\ndefect\n\nstain\n\nscratch\n\ndefect\n\nstain\n\nscratch\n\ndefect\n\nscratch\n\ncolor\n\npcb3\n\npcb4\n\npipe fryum\n\npcb2\n\npcb1\n\nmacaroni2\n\nfryum\n\nmacaroni1\n\ncashew\n\nchewinggum\n\ndefect\n\nFigure 8: Generated anomaly images for various defect types in VisA. Each image is shown with its corresponding anomaly\nmask (bottom-right).\n\n\fG\n\nStatistical Significance Analysis\n\nWe applied the Friedman test to each metric, and the null hypothesis was rejected in all cases (IS: p = 1.79 × 10−4 , IC-L: p =\n8.64×10−13 , I-AUC: p = 2.61×10−9 , P-AUC: p = 2.48×10−10 ), indicating significant differences among methods. Pairwise\npost-hoc Wilcoxon signed-rank tests with Holm’s correction were then performed at a significance level of 0.05, and the results\nare visualized in Figure 9 as critical difference diagrams. For the generation metrics, AnoStyler achieved the best average\nrank in both IS and IC-L. Specifically, AnoStyler significantly outperformed NSA in IS, and outperformed DFMGAN, NSA,\nDRAEM, CutPaste, and AnoGen in IC-L. While other methods exhibited inconsistent rankings between IS and IC-L, AnoStyler\nconsistently achieved top performance in both metrics, indicating that it generates anomaly images with both high visual\nquality and high diversity. For the detection metrics, AnoStyler ranked first in I-AUC and second in P-AUC. It significantly\noutperformed CutPaste, NSA, and DFMGAN in I-AUC, and outperformed CutPaste and AnomalyAny in P-AUC. Although the\ndifferences with AnoGen and AnoDiff were not statistically significant, AnoStyler achieved comparable performance to these\nfew-shot methods. Overall, these results indicate that AnoStyler outperforms most zero-shot baselines (CutPaste, DRAEM,\nNSA, RealNet, AnomalyAny) and also surpasses a few-shot method (DFMGAN) while remaining competitive with AnoGen\nand AnoDiff.\n\nIS\n\nIC-L\n\nI-AUC\n\nP-AUC\n\nFigure 9: Critical difference diagrams of 9 methods evaluated on MVTec-AD and VisA by comparing their ranks for each\ncategory using the IS, IC-L, I-AUC, and P-AUC metrics.AnoStyler is shown in blue, zero-shot baselines in red, and few-shot\nbaselines in gray.\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"