"<!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>Reimagining Anomalies: What if Anomalies Were Normal?\nPhilipp Liznerski1 * , Saurabh Varshneya1 * , Ece Calikus2 , Puyu Wang1 , Alexander Bartscher1 ,\nSebastian Josef Vollmer1,3 , Sophie Fellenz1 , Marius Kloft1\n1\n\narXiv:2402.14469v2 [cs.CV] 12 Jan 2026\n\nRPTU University Kaiserslautern-Landau, Germany\n2\nUppsala University, Sweden\n3\nGerman Research Center for Artificial Intelligence (DFKI), Germany\n\nAbstract\nNormal\n\nDeep learning-based methods have achieved a breakthrough\nin image anomaly detection, but their complexity introduces\na considerable challenge to understanding why an instance\nis predicted to be anomalous. We introduce a novel explanation method that generates multiple alternative modifications\nfor each anomaly, capturing diverse concepts of anomalousness. Each modification is trained to be perceived as normal\nby the anomaly detector. The method provides a semantic explanation of the mechanism that triggered the detector, allowing users to explore “what-if scenarios.” Qualitative and\nquantitative analyses across various image datasets demonstrate that applying this method to state-of-the-art detectors\nprovides high-quality semantic explanations.\n\nCode — https://github.com/liznerski/counterfactual-xad\nAAAI — https://aaai.org/aaai-publications\n\n1\n\nIntroduction\n\nAnomaly detection identifies patterns that deviate from normal behavior, the so-called anomalies. These anomalies can\ncorrespond to crucial actionable information in various domains such as medicine, manufacturing, and environmental\nmonitoring (Chandola, Banerjee, and Kumar 2009).\nRecently, deep learning has shown tremendous success\nin anomaly detection (AD), reducing error rates to approximately 1% in numerous image benchmarks (Reiss et al.\n2021; Ruff et al. 2021). However, detectors based on deep\nlearning lack the out-of-the-box interpretability of their traditional counterparts, making it difficult to understand the\nreasoning behind their predictions (Liznerski et al. 2021).\nTheir lack of transparency is particularly concerning in sectors where safety is crucial and in situations where building\ntrust is essential (Samek et al. 2020). Understanding modern\nanomaly detectors is a major challenge in contemporary AD\nand a necessary step before using AD in decision-making\nsystems (Ruff et al. 2021).\nAlthough feature-attribution techniques such as anomaly\nheatmaps (Roth et al. 2022) have been explored, they do not\n* These authors contributed equally.\nCopyright © 2026, Association for the Advancement of Artificial\nIntelligence (www.aaai.org). All rights reserved.\n\nTrain\nAD\n\nAnomalous\n\nConventional\nExplanation\n\nTest\nCounterfactuals (ours)\n\nIf it were normal...\n\nWhy?\n\nAnomaly!\n\nFigure 1: The figure illustrates the benefit of counterfactual explanation of anomaly detectors over traditional methods, using a dataset of handwritten digits in various colors. The normal data (top left) consist of pink digits and instances of the digit one in any color. An example anomaly—\na green seven—is shown on the right. Conventional explanation methods localize the anomaly in the image and highlight it on a heatmap (bottom left). In contrast, the proposed\nmethod transforms the anomaly into multiple counterfactuals, addressing the crucial question: “How must the anomaly\nbe altered to appear normal to the detector?\"\n\nexplain the underlying semantics relevant to the decisionmaking of the detectors. In domains beyond AD, counterfactual explanation (CE) has emerged as a popular alternative. CE generates synthetic samples that change the model’s\nprediction with minimal alterations to the original sample\n(Ghandeharioun et al. 2021).\nIn this paper, we propose the use of CE to explain image anomaly detectors. While prevalent approaches identify anomalous regions within images, the presented technique generates a set of counterfactual examples for each\nanomaly, capturing diverse disentangled aspects (see Figure 1). Our goal is to explain why a detector flags an instance\nas anomalous. The framework provides semantic CEs that\nreveal when detectors rely on spurious or biased cues (Appendix A), e.g., labeling portraits as anomalous due to skin\n\n\ftone or background context. These insights support accountable and lawful deployment of AD systems.\n\n2\n\nRelated Work\n\nIn the past decade, research has increased on improving the\ninterpretability of neural networks. This increase is driven by\nthe growing use of ML in decision-making systems, where\ntransparency of predictions is crucial and even legally mandated in many countries (Neuwirth 2022).\nExplanation of image AD. Research in explainable image AD has primarily focused on feature attribution methods, pinpointing image areas that influence predictions. Feature attribution methods trace an importance score from the\nmodel output back to the pixels (Selvaraju et al. 2017; Zhang\net al. 2018a) or alter parts of the image and measure the impact on the model output (Fong and Vedaldi 2017; Dhurandhar et al. 2018). Some of these approaches have been applied\nto AD (Liznerski et al. 2021; Li et al. 2021). Several methods generate explanations using generative models or autoencoders, where the pixel-wise reconstruction error yields\nan anomaly heatmap (Bergmann et al. 2019; Dehaene et al.\n2020). Others use fully convolutional architectures (Liznerski et al. 2021) or transfer learning (Defard et al. 2021; Roth\net al. 2022). All these methods identify regions within an\nimage that influence the detector’s prediction; however, they\ndo not explain the detectors at a higher semantic level (Adebayo et al. 2018; Varshneya et al. 2024).\nCounterfactual explanation of neural networks on images. CE methods (Guidotti 2022) identify the necessary\nchanges in the input to alter the model prediction in a specific way. Such explanations can provide profound insights\nthat enhance comprehension of model behavior and align\nmore closely with human cognitive processes (Pearl 2009).\nExisting CE algorithms are designed primarily for supervised learning on tabular data (Wachter, Mittelstadt, and\nRussell 2017; Mothilal, Sharma, and Tan 2020; Guidotti\n2022). A few studies have also explored the application of\nCE to image classification (Goyal et al. 2019; Ghandeharioun et al. 2021; Abid, Yuksekgonul, and Zou 2022; Singla\net al. 2023). DISSECT (Ghandeharioun et al. 2021) is notable for its ability to generate multiple CEs with disentangled high-level concepts. Recent work started exploring CE\nfor supervised image AD. Studies by Sanchez et al. (2022);\nWolleb et al. (2022); Siddiqui et al. (2024); Ahamed, Xu,\nand Rahmim (2024); Fontanella et al. (2024) utilize diffusion models guided by text prompts or learnable conditions\nto generate normal counterparts of abnormal medical images. These approaches rely on supervised learning, framing\nthe AD problem as a classification task. They fine-tune pretrained diffusion models or use classifier-guidance, utilizing\nboth normal and ground-truth anomalies. Although these approaches are promising for explaining model decisions with\ncounterfactuals, they are applicable only to supervised settings, making them unsuitable for unsupervised AD models.\nCounterfactual Explanations of AD. Virtually all CE\nmethods for AD have been applied to tabular data (Angiulli\net al. 2023; Datta, Chen, and Ramakrishnan 2022; Han et al.\n\n2023) and time series (Sulem et al. 2022; Cheng et al. 2022).\nThese methods use knowledge graphs or structural causal\nmodels to generate CEs for categorical features (Datta,\nChen, and Ramakrishnan 2022; Han et al. 2023) or take\nadvantage of temporal aspects (Sulem et al. 2022; Cheng\net al. 2022). Some of these methods have been applied to\nfairness (Han et al. 2023) and algorithmic recourse (Datta,\nChen, and Ramakrishnan 2022). None of these methods is\napplicable to image data. Very recently, Ji et al. (2024) introduced AR-Pro, a CE approach to explain anomalies in images. However, this method performs defect repair by modifying localized faulty regions with mask supervision, merely\ntransforming defective regions into their normal versions.\nOur framework instead explains semantic anomalies without\nlocalization, identifying conceptual attributes (background,\ncolor, bias) that drive a detector’s decision. As shown in Appendix B, it also handles defect-type anomalies as a special case: on industrial data similar to AR-Pro it produces\nrepair-like CEs but generalizes to multi-concept and semantic anomalies.\n\n3\n\nCounterfactual Explanation of Image AD\n\nWe formally present a novel framework for generating CEs\nof image AD. We first define the general setup and then explain how to use GANs and diffusion models to produce\nCEs. To the best of our knowledge, this approach is the first\nto explain semantic image AD using CE.\n\n3.1\n\nWhat if the Anomaly were Normal?\n\nOur aim is to provide explanations for a given anomaly detector ϕ : RD → [0, 1] that maps an image x ∈ RD to an\nanomaly score α ∈ [0, 1]. We define a CE for the detector\nϕ and perceived anomaly x∗ ∈ RD (i.e., ϕ(x∗ ) ≫ 0) as a\nmodified sample x̄∗ with ϕ(x̄∗ ) ≈ 0 and ∥x̄∗ − x∗ ∥1 ≤ ϵ\nfor an ϵ ≥ 0. In other words, a CE must be normal according to ϕ, while being minimally changed w.r.t. the original\nanomaly x∗ . Thus, CEs address the question: “What if the\nanomaly x were normal?”, explaining the behavior of the\nanomaly detector at a high semantic level.\nTo produce such CEs for deep AD, we need to train a\ngenerator G : RD → RD to yield G(x∗ ) = x̄∗ . However,\nnormal images can differ from anomalies in multiple ways,\nand thus multiple CEs may be required to adequately explain\nan anomaly. We want the generator to consider multiple categorical concepts k ∈ {1, . . . , K}. Thus, the generator is\nnow of the form G : RD × {1, . . . , K} → RD and is supposed to produce G(x∗ , k) = x̄∗k with ∥x̄∗k − x̄∗k′ ∥1 ≥ ϵ′ for\nany k ̸= k ′ .\nThe same data {(x0 , y0 ), . . . , (xn , yn )} used to train ϕ\ncan also train G. Note that in AD, training labels yi are typically unknown, and most samples are assumed normal.\n\n3.2\n\nDeep Generative Models for CE of Image AD\n\nIn practice, it has been found beneficial to train the generator to produce sequences of CEs with increasing impact on\na classifier’s output (Ghandeharioun et al. 2021). The proposed approach is based on this idea. We modify the generator G : RD × [0, 1] × {1, . . . , K} → RD to consider a target\n\n\fThe losses LD (D) and LG (G) can be any discriminative\nand generative GAN losses, respectively. We specifically experimented with spectral normalization (Miyato et al. 2018)\nand the hinge loss (Miyato and Koyama 2018):\nLG (G) = − min(0, −1 + D(x̄α,k )),\nLD (D) = min(0, −1 + D(x)) + min(0, −1 − D(x̄α,k )).\nThe reconstruction loss makes G recreate x for every concept k, when conditioned on x and its “true” score ϕ(x):\nLrec (G) = ∥x − G(x, ϕ(x), k)∥1 .\nThis ensures that G remains unchanged when the sample\nalready has the targeted anomaly score, overall encouraging\nminimal changes.\nSimilarly, the “cycle consistency loss” (Zhu et al. 2017)\n(a) Training\n\n(b) Test\n\nFigure 2: Schematic overview of the proposed CE framework for explaining a black box image AD model ϕ. (a)\nshows the training losses and their impact on the different\nmodels. (b) shows the inference, where the target anomaly\nscore is zero. Gray nodes (i.e., the trained AD model ϕ and\ngenerator G∗ ) represent models that are not optimized.\nscore α, aiming for the trained G to produce a sample with\nan anomaly score of approximately α.\nGANs for CE of image AD. Here, we first introduce a\nGAN-based (Goodfellow et al. 2020) model for producing\nCEs of image AD. In particular, we train G as a conceptdisentangled GAN. We define a discriminator D : RD → R\nand a concept classifier R : RD × RD → [0, 1]K . D is\ntrained to distinguish between generated x̄α,k = G(x, α, k)\nand true samples from the dataset, encouraging realistic outcomes. R classifies the concept k for a sample x̄α,k , encouraging the generated samples to be concept-disentangled on\na semantic level. Further losses encourage the generator to\nincur minimal changes on the original sample x and to yield\ntarget anomaly scores α (i.e., ϕ(x̄α,k ) ≈ α). The proposed\nobjective summarizes to\n\u0002\nmin max Ex∼PX Eα,k λgan (LD (D) + LG (G)) − Lϕ (G)\nG,R D\n\u0003\nλϕ + λrec (Lrec (G) + Lcyc (G)) + λr Lcon (G, R) ,\n(1)\nwhere pX denotes the training data distribution, and\nλgan , λϕ , λrec , and λr are some constant factors. Figure 2\nshows a schematic overview of the framework.\nIn the following, we will explain the various losses, starting with Lϕ (G), which encourages for x̄α,k an anomaly\nscore of α. Lϕ (G) can be any loss that measures the divergence of target anomaly scores α and true anomaly scores\nϕ(x̄α,k ); for example, the L2 distance or the KL-divergence.\nWe assume the detector ϕ to be bounded (w.l.o.g, 0 ≤\nϕ(x) ≤ 1). In our experiments, we found that a continuous\nbinary cross entropy loss produces the best results:\n\u0001\n\u0001\n\u0001\nLϕ (G) = α log ϕ(x̄α,k ) + 1 − α log 1 − ϕ(x̄α,k ) .\n\nLcyc (G) = ∥x − x̃α,k ∥1 ,\nwhere x̃α,k = G(x̄α,k , ϕ(x), k), encourages G to recreate\nthe sample x when targeting its true anomaly score ϕ(x)\nand being conditioned on any generated sample x̄α,k based\non x. It encourages minimal changes because the generator\nneeds to be able to revert any change of x.\nThe concept loss drives G to produce disentangled CEs:\n\u0001\u0001\n\u0001\u0001\nLcon (G, R) = C k, R x, x̄α,k + C k, R x̄α,k , x̃α,k ,\nwhere C denotes the cross entropy loss.\nIn summary, the losses encourage the generated samples x̄α,k to be semantically distinguishable for different concepts k while having an anomaly score of α according to ϕ and undergoing minimal changes with respect to the original x. This results in a disentangled set\nof K counterfactual explanations for an anomaly x∗ with\n{G(x∗ , 0, 1), . . . , G(x∗ , 0, K)}. The generator can produce\npseudo anomalies G(x, α, K) when ϕ(x) ≈ 0 and α ≫ 0,\nwhich help G in learning how to turn anomalies into normal\nsamples, when included in Lϕ .\nDiffusion Models for CE of Image AD. This section proposes an approach for producing CEs of high-resolution\nanomaly detectors using state-of-the-art diffusion models.\nIn particular, we incorporate DiffEdit (Couairon et al.\n2023). DiffEdit modifies the LAION-5B pre-trained textconditional latent diffusion model known as Stable Diffusion (Rombach et al. 2022) to semantically edit images.\nLet AE : RD → R∆ and AΩ : R∆ → RD denote\nthe encoder and decoder of the autoencoder used in Stable Diffusion. From a high-level perspective, the DiffEdit\nmodel can be defined as ψ : R∆×T → R∆ where\nT denotes the output dimension of the word embedding\nmodel. For an image x ∈ RD , we retrieve a semantically modified version x̂ controlled by the text prompt t\nvia x̂ = AΩ (ψ(AE (x), t)). For more details, we refer\nto the paper by Couairon et al. (2023). We incorporate\nDiffEdit into the proposed framework by training the generator on its latent output. That is, we redefine the generator G(x, α, k) = AΩ (G′ (ψ(AE (x), t), α, k)) with G′ :\nR∆ × [0, 1] × {1, . . . , K} → R∆ . The text prompt t is set to\nthe normal class label (e.g., “cat” for cats being normal). We\ntrain the generator G (i.e., the parameters of G′ ) as before.\n\n\f4\n\nTheoretical Analysis\n\nThe objective of the proposed method is intertwined\nwith several interacting losses. Here, we provide a theoretical analysis on the performance of the optimization\nproblem. Let V (D, G) = λgan Ex∼pX Eα,k [LD (D)] and\nU (D, (G, R)) = Ex∼pX Eα,k [λgan LG (G) − λϕ Lϕ (G) +\nλrec (Lrec (G)+Lcyc (G))+λr Lcon (G, R)]. V trains D, and\nU trains G and R.\nDefinition 4.1. We say (D∗ , (G∗ , R∗ )) is a Nash equilibrium of the system if V (D, G∗ ) ≤ V (D∗ , G∗ ) for any D and\nU (D∗ , (G∗ , R∗ )) ≤ U (D∗ , (G, R)) for any G, R.\nTheorem 4.2. Assume G and R have enough capacity. Let\n(D∗ , (G∗ , R∗ )) be a Nash equilibrium of the system. (I) If\nλϕ = λrec = λcon = 0, then Eα,k [pG∗ (α,k) ] = pX and\nV (D∗ , G∗ ) = −2λgan . (II) If λϕ = 0 and ϕ is nearly\nflat, then Eα,k [pG∗ (α,k) ] ≈ pX and V(D∗ , G∗ ) ≈ −2λgan .\nIf we assume ϕ is flat, then Eα,k [pG∗ (α,k) ] = pX and\nV (D∗ , G∗ ) = −2λgan .\nPart (I) of Theorem 4.2 shows that when training only\nwith the modified GAN-based objectives LD and LG , the\ngenerator indeed converges to the training data distribution\npX , similar to the original objective in Goodfellow et al.\n(2020). Part (II) shows that when including the losses that\nencourage minimal changes, we still obtain the distribution\npX with flatness assumptions on the detector ϕ. It follows\nthat Lϕ is the main antagonist that causes divergence from\nthe training data distribution to produce reasonable CEs.\nProof of Theorem 4.2. Appendix C provides the full proofs.\nHere, we show very brief sketches. The main idea for proving part (I) of the theorem is to divide the min-max problem into a min part and a max part and then analyze them\nseparately. The maximizer D∗ of this problem has the explicit form D∗ (x) = 1 if Eα,k [pG∗ α,k ](x) ≤ pX (x)\nand D∗ (x) = 0 otherwise. Plugging this into V (D∗ , G∗ ),\nwe get V (D∗ , G∗ ) ≥ −2λgan . According to the property of the Nash equilibrium, we know Ex,α,k [LG (G∗ )] ≤\nEx,α,k [LG (G)] holds for any G. Specifically considering G\nas the “ideal\" generator with a density function pG(α,k) =\npX , we can establish V (D∗ , G∗ ) ≤ −2λgan . For part (II),\nthe analysis of V and D∗ are the same as for the max problem. For the\nR min problem, from the flatness of ϕ, we can\nshow that pX (x)D∗ (x) − Eα,k [pG∗ (α,k) ](x)D∗ (x)dx ≤\nϵ. Here, ϵ &gt; 0 is proportional to the flatness of ϕ. If ϕ is\nalmost flat, ϵ ≈ 0 and then V (D∗ , G∗ ) ≈ −2λgan . Hence,\nEα,k [pG∗ (α,k) ] ≈ pX . If ϕ is flat, then ϵ = 0. It implies\nV (D∗ , G∗ ) = −2λgan and Eα,k [pG∗ (α,k) ] = pX .\nTheorem 4.3. Assume G and R have enough capacity,\nλϕ &gt; 0, and Prob(ϕ(x) = 0 ∪ ϕ(x) = 1) &gt; 0, x ∼ pX . Let\n(D∗ , (G∗ , R∗ )) be a Nash equilibrium of the system. Then\npG∗ (α,k) ̸= pX for any α, k and V (D∗ , G∗ ) ̸= −2λgan .\nTheorem 4.3 shows that Lϕ indeed causes a divergence\nfrom the training data distribution, implying that the generator learns to map samples to anomalous data regimes when\nα &gt; 0. Empirically, our experiments show that with α = 0,\nthe generator consistently creates normal samples.\n\nProof of Theorem 4.3. We prove the theorem by contradiction. For a Nash equilibrium (D∗ , (G∗ , R∗ )), it holds\nU (D∗ , (G∗ , R∗ )) ≤ U (D∗ , (G, R)) for any G, R. We show\nthat if (D∗ , (G∗ , R∗ )) is a Nash equilibrium with pG∗ (α,k) =\npX and V (D∗ , G∗ ) = −2λgan , then there exists a generator G′ such that U (D∗ , (G′ , R∗ )) &lt; U (D∗ , (G∗ , R∗ )).\nThis violates U (D∗ , (G∗ , R∗ )) ≤ U (D∗ , (G′ , R∗ )). Hence,\npG∗ (α,k) ̸= pX and V (D∗ , G∗ ) ̸= −2λgan . We choose G′\nas satisfying ϕ(G′ (x, α, k)) = α and being Lipschitz continuous w.r.t. the first and second argument. By noting that\nEx,α,k Lϕ (G∗ ) = −∞ when Prob(ϕ(x) = 0 ∪ ϕ(x) = 1) &gt;\n0 and U (D∗ , (G′ , R∗ )) is uniformly bounded, we conclude\nU (D∗ , (G′ , R∗ )) &lt; U (D∗ , (G∗ , R∗ )).\n\n5\n\nExperiments\n\nWe empirically assess the capabilities of CEs for deep AD,\nproviding qualitative and quantitative evidence of the superiority of the proposed CEs over traditional methods.\nDeep Anomaly Detection Methods. We specifically\nstudy three state-of-the-art semantic image AD methods.\nDSVDD (Ruff et al. 2018) trains a neural network to enclose\nthe (mostly normal) unlabeled training data by a minimal\nvolume hypersphere with the distance to the sphere’s center\nbecoming the anomaly score. Hendrycks, Mazeika, and Dietterich (2019) showed that Outlier Exposure (OE)—using\na large unstructured collection of natural images as example\nanomalies during training—consistently outperforms previous AD methods, while still being unsupervised. A neural\nnetwork learns to differentiate normal data from OE samples with a Binary Cross Entropy (BCE) loss. Liznerski et al.\n(2022) introduced HSC as a modification of the DSVDD\nloss to enable it to take advantage of OE. Since the CE generator requires bounded anomaly scores, we slightly adjust\nsome of the objectives without impacting the performance.\nA more detailed description can be found in Appendix J.\nDatasets. We evaluate on MNIST (Deng 2012), ColoredMNIST, CIFAR-10 (Krizhevsky, Hinton et al. 2009), and\nGTSDB (Houben et al. 2013). Furthermore, we introduce\nImageNet-Neighbors (INN), a subset of ImageNet-1k (Russakovsky et al. 2015) designed for AD tasks. INN comprises\nmultiple AD setups; in each setup, one ImageNet-1k class\nis considered normal, and the ten most semantically similar classes, based on the Wu-Palmer similarity metric (Wu\nand Palmer 1994), are defined as ground-truth test anomalies. We follow previous work for using disjoint OE data for\nthe OE-based AD methods. Details are in Appendix K.\nExperimental Setup. Following previous work on semantic image AD (Ruff et al. 2018; Golan and El-Yaniv 2018;\nHendrycks et al. 2019; Tack et al. 2020; Ruff et al. 2021;\nLiznerski et al. 2022), we convert the multi-class classification datasets into AD benchmarks. This is achieved by\ndefining a subset of the classes to be normal and using the\nremaining classes as ground-truth anomalies during testing.\nWhen only one class is considered normal, this approach is\nknown as one vs. rest. We also explore a variation in which\nmultiple classes are normal. This emulates a multifaceted\n\n\fAnom\n\nAnom\n\nCE 1\n\nCE 1\n\n(b) HSC (OE)\n\n(c) DSVDD\n\nFigure 3: Examples of CEs for Colored-MNIST, with cyan\ndigits and the digit one serving as the normal class. The first\nrow shows anomalous images and the next two rows their\ncorresponding CEs using two concepts. The CEs of BCE\nand HSC appear normal and realistic for each concept.\nMNIST. In Figure 4, a seven is considered normal. The\nCEs of BCE and HSC are meaningful: the anomalies are\n\nAnom\n\nAnom\nCE 1\n\nCE 1\n\nCE 0\n\nCE 0\n\nAnom\nCE 0\n\nAnom\n\nCIFAR-10. Especially for BCE, the CEs in Figure 5 represent intuitive normal samples (ships) that retain the anomalous object’s color to incur minimal changes on the anomaly.\nAs there is only one single normal class, the CEs primarily\ndisentangle the concepts by changing the background. Ships\nare typically depicted floating on water, which may vary\nin color. The CEs reveal that HSC and DSVDD predominantly focus on the background to detect anomalies, as all\nCEs are perceived as normal (see Section 5.2), although the\nCEs’ foregrounds are often similar to the original anomaly.\nThis aligns with prior findings on background exploitation\nin CIFAR-10 (Ding and Pang 2024).\n\nCE 0\nCE 1\n\nCE 1\n\n(a) BCE (OE)\n\nCE 0\n\nCE 0\n\nAnom\nCE 0\nCE 1\n\n(a) BCE (OE)\n\n(c) DSVDD\n\nFigure 4: CEs for MNIST with seven as the normal class.\nThe first row shows anomalies, the other two rows CEs using\ntwo different concepts. CEs of BCE and HSC are variations\nof seven and thus represent intuitive counterfactuals.\n\nCE 1\n\nColored-MNIST. Figure 3 shows CEs when the normal\nclass is formed from instances of the digit one and digits colored cyan. We observe that the CEs generated to explain the BCE detector align well with our expectation. The\nproposed method transforms the anomalies into ones without changing the color, or their color is changed to cyan\nwithout changing the digit. Both modifications are minimal alterations of the anomaly, transforming its appearance\nto normality in two distinct ways. The CEs of HSC also\ncorrespond to normal samples. However, in one case, both\nthe color and the digit is changed, resulting in unnecessary\nchanges. We found that this behavior represents a local optimum of the proposed objective, highlighting the inherent\ndifficulty of the unsupervised generation of CEs. The CEs\ncreated to explain the DSVDD detector perform least effectively. They appear normal for one concept but often fail for\nthe other. This behavior may be attributed to DSVDD’s limited ability to detect anomalies. See Appendix D for details.\n\n(b) HSC (OE)\n\nAnom\n\nCEs Explain why Images are Predicted Anomalous\n\n(a) BCE (OE)\n\nCE 0\n\nWe present qualitative examples of CEs, demonstrating the\nbenefit of using CE for semantic image AD over traditional\nexplanation methods. We refer to Appendix P for more examples using further normal scenarios with similar findings.\n\nCE 1\n\nQualitative Results\n\nAnom\n\n5.1\n\ntransformed into plausible variations of seven. Since the normal class consists of a single, monochromatic digit, the generator primarily learns to manipulate the presence or absence of the horizontal bar characteristic of a seven to distinguish between concepts. Therefore, the CEs indicate that\nthe detectors do not heavily rely on the horizontal bar to rate\nanomalousness properly.\n\nCE 0\n\nnormal class that includes different notions of normality. Finally, we consider the INN setup where we have particular\nground-truth anomalies per normal class. For INN, we generate CEs with diffusion models, while for all other datasets\nwe use the pure GAN-based model.\nOverall, we consider over 80 different AD setups. Details\nof the specific AD setups are provided in Appendix O. Our\nquantitative analysis reports results averaged over all scenarios and multiple seeds per dataset. Detailed quantitative\nresults for each scenario are in Appendix O and further qualitative results in Appendix P. Hyperparameters and architectures are explained in detail in Appendix M, and there is a\nsmall hyperparameter sensitivity analysis in Appendix I.\n\n(b) HSC (OE)\n\n(c) DSVDD\n\nFigure 5: Example CEs for CIFAR-10 when ships are normal. The rows show anomalies and CEs for two concepts,\nrespectively. The CEs of BCE display normal ships, varying\nthe background for successful disentanglement while keeping the object’s color to avoid unnecessary changes.\nGTSDB. Figure 6 shows the proposed CEs when speed\nsigns are taken as a normal class. The CEs of BCE and HSC\nshow well-disentangled normal traffic signs, obtained from\nanomalous ones. For instance, the CE of BCE changes the\n“80km/h restriction ends” sign into a “80km/h limit” sign—\na minimal intervention to make the sample appear normal.\nNote that all triangular anomalies become circles. The CEs\nshow that the shape is an important feature for the detector\nto rate anomalousness.\n\n\fCE 1\n\n(a) Counterfactuals\n\nCE 1\n\nCE 1\n\nCE 0\n\nCE 0\n\nAnom\n\nAnom\n\nImageNet-Neighbors. Figure 7 shows CEs for the INN\ndataset when zebras are normal. The ground-truth anomalies are “similar” animals, ranging from horses and boars to\narmadillos. The CEs depict zebras while keeping the general pose and background of the anomalous animal. For disentanglement, the CEs vary the color scheme, which apparently the detectors perceive as normal. The CEs for the second concept for HSC are dark and, while still showing zebras, perturb the image with green and orange patterns. Interestingly, our experiments show that HSC assigns lower\nanomaly scores to the CEs for this second concept.\n\n(a) BCE (OE)\n\nAnom\n\nFigure 6: CEs for GTSDB with speed signs being normal.\nThe first row shows anomalies, the other rows present disentangled CEs, which appear as different normal speed signs.\n\nFCDD\n\n(c) DSVDD\n\nAnom\n\nAnom\nCE 0\n\n(b) HSC (OE)\n\nCEs Explain why Images are Predicted Anomalous—\neven when Feature Attribution Fails. We demonstrate the\nadvantage of the proposed CEs over conventional explanations that attribute features. Figure 9 shows (a) CEs generated with our method and (b) heatmaps for the corresponding anomalies generated with FCDD (Liznerski et al. 2021).\nFCDD’s heatmaps explain only spatial aspects of the AD: It\nhighlights the horizontal bar in digit seven, the circle in digit\nnine, and all of digit eight. These spatial aspects are also\nexplained by the CEs created for the first concept, where\nanomalies are turned into the digit one. However, FCDD’s\nheatmaps fail to identify the color as anomalous, whereas\nour CEs capture this aspect with their second concept, where\nthe anomalies are colored red, making them look normal.\nThis shows that CEs can provide more holistic explanations.\n\nCE 0\n\nAnom\nCE 0\nCE 1\n\nCE 1\n\nAnom\nCE 0\nCE 1\n\n(a) BCE (OE)\n\nand correct, they do not provide valuable insight, as here the\nbehavior of an anomaly detector is less opaque and requires\nno counterfactual explanation. We include further reasoning\nfor this and more results in Appendix B.\n\n(b) HSC (OE)\n\nFigure 7: Examples of CEs for INN, where zebras are considered normal. The first row shows anomalous images, the\nother two rows present CEs using two different concepts.\n\nCE 0\n\nAnom\n\nMVTec-AD. Our experiments focus on semantic imageAD (Ruff et al. 2021) rather than low-level AD where\nanomalies are defects instead of out-of-class. Figure 8\nshows CEs for such a scenario with the MVTec-AD dataset\n(Bergmann et al. 2019). While the CEs are of good quality\n\nFigure 8: CEs of the BCE detector for MVTec-AD and\nImageNet-21k as OE. The top row shows anomalies as defects. The bottom row shows corresponding CEs, resembling normal, healthy images.\n\n(b) FCDD’s Heatmaps\n\nFigure 9: The first row shows anomalies from ColoredMNIST, with red digits and the digit one forming the normal class. The other rows show (a) corresponding CEs and\n(b) anomaly heatmaps from FCDD. The CEs explain the detector that perceives anomalies turned red or into one as normal, while heatmaps just highlight the difference to one.\n\n5.2\n\nQuantitative Results\n\nThis section presents a quantitative analysis of the CEs,\nassessing their normality, realism, and disentanglement in\nterms of metrics based on AuROC, FID, and accuracy. The\nmetrics are described in detail in Appendix L.\nThe CEs Appear as Normal. An important attribute for\nany CE in AD is that it must be perceived as normal by\nthe anomaly detector. To evaluate this quality criterion, we\ncompare the anomaly scores of the normal test samples with\nthose of the generated CEs in terms of AuROC. Ideally, the\nAuROC should approach 50%, indicating that CEs and normal samples are indistinguishable. As shown in Table 1, the\nAuROC is indeed very close to 50% on CIFAR-10, GTSDB,\nand Colored-MNIST (here abbreviated as C-MNIST), underlining that the detector perceives the CEs as normal. Only\non MNIST and INN, some of the CEs appear anomalous.\nThis might be due to the enforced disentanglement that produces diverse samples despite a limited variety of possible\nnormal variations.\n\n\fC-MNIST\nMultiple\nMNIST\nnormal\nCIFAR-10\nclasses\nGTDSB\n\n55.6 ± 1.5\n78.1 ± 4.1\n49.0 ± 8.5\n50.2 ± 8.0\n\n55.8 ± 4.7 61.5 ± 4.3\n82.1 ± 3.8 73.4 ± 6.5\n44.4 ± 6.7 50.7 ± 3.3\n48.6 ± 14.4 53.1 ± 4.8\n\nTable 1: AuROC of normal test data vs. CEs. The CEs appear entirely normal for values ≤ 50%.\nThe CEs are Realistic. To assess the realism, we compute\nthe FID (Heusel et al. 2017) between the CEs and normal\ntest samples, and then normalize it by dividing by the FID\nbetween normal and anomalous test samples. The normalized FIDN is 100% if the CEs are as realistic as the anomalies. We found that a FIDN of 50 to 100% is a reasonable\ntarget for expressive CEs. If the CEs became too similar to\nthe normal data distribution, they would not be valid counterfactuals, as they would not retain non-anomalous features\nfrom the anomalies. Table 2 displays the normalized FIDN\nscores. The CEs for BCE and HSC are mostly as realistic as\nthe anomalies. On MNIST, INN, and Colored-MNIST, the\nCEs are even more realistic.\nDatasets\nSingle\nnormal\nclass\n\nMethods\nBCE OE\n\nHSC OE\n\nDSVDD\n\nMNIST\n43 ± 8.1\n68 ± 14.6 100 ± 8.8\nCIFAR-10 116 ± 20.8 300 ± 90.0 116 ± 12.0\nINN\n85.0 ± 28.6 85.4 ± 24.6\n×\n\nC-MNIST 56 ± 12.4 95 ± 30.5 83 ± 8.7\nMultiple\nMNIST\n78 ± 26.0 96 ± 25.0 100 ± 10.7\nnormal\nCIFAR-10 103 ± 27.9 254 ± 69.7 110 ± 10.0\nclasses\nGTDSB\n110 ± 101 95 ± 73.5 131 ± 118\nTable 2: FIDN for the CEs. Most of the CEs are as realistic\nas the anomalies, which are also realistic since they follow\nthe general data distribution (e.g., are digits for MNIST).\nThe CEs Capture Multiple Disentangled Concepts. In\nAppendix E, we report the accuracy of the concept classifier. The classifier almost always achieves an accuracy of\nmore than 90%. Exceptions are for DSVDD and MNIST,\nHSC and MNIST, and BCE and CIFAR-10, where it scores\nroughly 80%. This provides evidence that, for each anomaly,\nour method generates concept-disentangled CEs.\nThe CEs Are Minimal Modifications. To assess the minimality of the modifications present in the CEs, we report the\nLPIPS (Zhang et al. 2018b) and MSE between test anomalies and their corresponding CEs in Appendix F. The results indicate that the modifications are reasonably limited,\nas both metrics attain comparatively low values.\n\nAnom\n\nMNIST\n72.0 ± 4.0 80.8 ± 5.3 75.2 ± 9.2\nCIFAR-10 47.5 ± 10.0 49.9 ± 4.4 54.6 ± 3.4\nINN\n69.1 ± 18.1 67.9 ± 13.2\n×\n\nThe hypothesis of a “classification bias,” suggesting supervised classifiers underperform when trained with limited and\nbiased anomaly subsets (Ruff et al. 2020), remains insufficiently investigated. To test this hypothesis, we train a supervised classifier on Colored-MNIST to distinguish between\na normal set (red digits and the digit one) and a subset of\nthe ground-truth anomalies (all blue anomalies). This simulates a realistic scenario in which one has no access to all\nvariations of the ground-truth anomalies. The classifier bias\nbecomes apparent as the AuROC of normal test vs. groundtruth anomalies decreases from 98% for BCE with OE (unsupervised) to 75% for supervised BCE. Our CEs illuminate\nthis phenomenon in Figure 10. The CEs of the AD method\nin (a) indicate that anomalies should be transformed into red\nor digit one to appear normal. For the supervised classifier in\n(b), only for the blue anomalous zero, which is seen during\ntraining, the CEs show normal versions of the anomaly. For\nunseen anomalies, such as the yellow eight, the CEs do not\nshow intuitive normal images. This suggests that the classifier is biased towards blue anomalies and fails to generalize\nto colors not present in the training data. The experiment\nunderlines the need for specialized AD methods (e.g., using\nOE or semi-supervision) because they are less prone to bias.\n\nCE 0\n\nDSVDD\n\nCE 1\n\nHSC OE\n\nAnom\n\nBCE OE\n\nThe CEs Reveal a Classifier Bias in Deep AD\n\nCE 0\n\nSingle\nnormal\nclass\n\n5.3\n\nMethods\n\nCE 1\n\nDatasets\n\n(a) BCE with OE\n\n(b) BCE with blue\n\nFigure 10: The first row shows anomalies for C-MNIST with\nred digits and the digit one as the normal class. The other\nrows show CEs of BCE trained with OE in (a) and a classifier trained with only blue anomalies in (b). The generator’s inability to generate normal-looking CEs for non-blue\nanomalies suggests that the classifier (b) is biased.\n\n6\n\nConclusion\n\nThis paper introduced a novel method that can interpret image anomaly detectors at a semantic level. This is achieved\nby modifying anomalies until they are perceived as normal\nby the detector, creating instances known as counterfactuals. We found that counterfactuals can provide a deeper,\nmore nuanced understanding of image anomaly detectors,\nfar beyond the traditional feature-attribution level. Extensive experiments across various image benchmarks and deep\nanomaly detectors demonstrated the efficacy of the proposed\napproach, particularly also where conventional techniques\nfail. This research marks a paradigm shift and a significant departure from the more superficial interpretation of\nanomaly detectors using feature attribution. This may be a\nsubstantial milestone in the pursuit of more transparent and\naccountable AD systems.\n\n\fAcknowledgments\nMK and SF acknowledge support by the BMFTR\naward 01IS24071A, by the DFG through FOR 5359\n(ID 459419731), TRR 375 (ID 511263698), SPP 2298\n(Id 441826958), and SPP 2331 (441958259, 553345933,\n466468799), and by the Carl-Zeiss Foundation through the\ninitiatives AI-Care and Process Engineering 4.0. The work\nof PW is partially supported by the Alexander von Humboldt Foundation. SV acknowledges support by the BMFTR\naward 01IW23005.\n\nReferences\nAbid, A.; Yuksekgonul, M.; and Zou, J. 2022. Meaningfully debugging model mistakes using conceptual counterfactual explanations. In International Conference on Machine Learning, 66–88. PMLR.\nAdebayo, J.; Gilmer, J.; Muelly, M.; Goodfellow, I.; Hardt,\nM.; and Kim, B. 2018. Sanity checks for saliency maps.\nIn Advances in Neural Information Processing Systems, volume 31.\nAhamed, S.; Xu, Y.; and Rahmim, A. 2024. IgCONDAPET: Implicitly-guided counterfactual diffusion for detecting anomalies in PET images.\narXiv preprint\narXiv:2405.00239.\nAngiulli, F.; Fassetti, F.; Nisticó, S.; and Palopoli, L. 2023.\nCounterfactuals explanations for outliers via subspaces density contrastive loss. In International Conference on Discovery Science, 159–173. Springer.\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.\nBirhane, A.; and Prabhu, V. U. 2021. Large image datasets:\nA pyrrhic win for computer vision? In 2021 IEEE Winter\nConference on Applications of Computer Vision (WACV),\n1536–1546. IEEE.\nChandola, V.; Banerjee, A.; and Kumar, V. 2009. Anomaly\ndetection: A survey. ACM Computing Surveys, 41(3): 1–58.\nCheng, H.; Xu, D.; Yuan, S.; and Wu, X. 2022. Fine-grained\nAnomaly detection in sequential data via counterfactual explanations. arXiv preprint arXiv:2210.04145.\nCohen, G.; Afshar, S.; Tapson, J.; and Van Schaik, A. 2017.\nEMNIST: Extending MNIST to handwritten letters. In International Joint Conference on Neural Networks, 2921–2926.\nCouairon, G.; Verbeek, J.; Schwenk, H.; and Cord, M. 2023.\nDiffEdit: Diffusion-based semantic image editing with mask\nguidance. In International Conference on Learning Representations.\nDatta, D.; Chen, F.; and Ramakrishnan, N. 2022. Framing algorithmic recourse for anomaly detection. In ACM\nSIGKDD Conference on Knowledge Discovery and Data\nMining, 283–293.\nDe Vries, H.; Strub, F.; Mary, J.; Larochelle, H.; Pietquin,\nO.; and Courville, A. C. 2017. Modulating early visual processing by language. Advances in Neural Information Processing Systems, 30.\n\nDefard, T.; Setkov, A.; Loesch, A.; and Audigier, R.\n2021. PaDiM: a patch distribution modeling framework for\nanomaly detection and localization. In International Conference on Pattern Recognition, 475–489. Springer.\nDehaene, D.; Frigo, O.; Combrexelle, S.; and Eline, P. 2020.\nIterative energy-based projection on a normal data manifold\nfor anomaly localization. In International Conference on\nLearning Representations.\nDeng, L. 2012. The MNIST database of handwritten digit\nimages for machine learning research. IEEE Signal Processing Magazine, 29(6): 141–142.\nDhurandhar, A.; Chen, P.-Y.; Luss, R.; Tu, C.-C.; Ting, P.;\nShanmugam, K.; and Das, P. 2018. Explanations based on\nthe missing: Towards contrastive explanations with pertinent\nnegatives. In Advances in Neural Information Processing\nSystems.\nDing, C.; and Pang, G. 2024. Improving Open-World Classification with Disentangled Foreground and Background\nFeatures. In ACM Multimedia 2024.\nFong, R. C.; and Vedaldi, A. 2017. Interpretable explanations of black boxes by meaningful perturbation. In IEEE\nInternational Conference on Computer Vision, 3429–3437.\nFontanella, A.; Mair, G.; Wardlaw, J.; Trucco, E.; and\nStorkey, A. 2024. Diffusion models for counterfactual generation and anomaly detection in brain images. IEEE Transactions on Medical Imaging.\nGhandeharioun, A.; Kim, B.; Li, C.-L.; Jou, B.; Eoff, B.;\nand Picard, R. W. 2021. DISSECT: disentangled simultaneous explanations via concept traversals. In International\nConference on Learning Representations.\nGolan, I.; and El-Yaniv, R. 2018. Deep anomaly detection\nusing geometric transformations. In Advances in Neural Information Processing Systems, 9758–9769.\nGoodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.;\nWarde-Farley, D.; Ozair, S.; Courville, A.; and Bengio, Y.\n2020. Generative adversarial networks. Communications of\nthe ACM, 63(11): 139–144.\nGörnitz, N.; Kloft, M.; Rieck, K.; and Brefeld, U. 2014. Toward supervised anomaly detection. J. Artif. Intell. Res., 46:\n235–262.\nGoyal, Y.; Wu, Z.; Ernst, J.; Batra, D.; Parikh, D.; and Lee, S.\n2019. Counterfactual visual explanations. In International\nConference on Machine Learning, 2376–2384. PMLR.\nGuidotti, R. 2022. Counterfactual explanations and how to\nfind them: literature review and benchmarking. Data Mining\nand Knowledge Discovery, 1–55.\nHan, X.; Zhang, L.; Wu, Y.; and Yuan, S. 2023. Achieving\ncounterfactual fairness for anomaly detection. In PacificAsia Conference on Knowledge Discovery and Data Mining,\n55–66. Springer.\nHanley, J. A.; and McNeil, B. J. 1982. The meaning and use\nof the area under a receiver operating characteristic (ROC)\ncurve. Radiology, 143(1): 29–36.\nHendrycks, D.; Mazeika, M.; and Dietterich, T. G. 2019.\nDeep anomaly detection with outlier exposure. In International Conference on Learning Representations.\n\n\fHendrycks, D.; Mazeika, M.; Kadavath, S.; and Song, D.\n2019. Using self-supervised learning can improve model\nrobustness and uncertainty. In Advances in Neural Information Processing Systems, 15637–15648.\nHeusel, M.; Ramsauer, H.; Unterthiner, T.; Nessler, B.; and\nHochreiter, S. 2017. GANs trained by a two time-scale update rule converge to a local nash equilibrium. In Advances\nin Neural Information Processing Systems.\nHouben, S.; Stallkamp, J.; Salmen, J.; Schlipsing, M.; and\nIgel, C. 2013. Detection of traffic aigns in real-world images: The German Traffic Sign Detection Benchmark. In\nInternational Joint Conference on Neural Networks.\nJi, X.; Xue, A.; Wong, E.; Sokolsky, O.; and Lee, I. 2024.\nAR-Pro: counterfactual explanations for anomaly repair\nwith formal properties. In Annual Conference on Neural\nInformation Processing Systems.\nKrizhevsky, A.; Hinton, G.; et al. 2009. Learning multiple\nlayers of features from tiny images. Technical report.\nLi, C.-L.; Sohn, K.; Yoon, J.; and Pfister, T. 2021. CutPaste:\nSelf-supervised learning for anomaly detection and localization. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, 9664–9674.\nLiznerski, P.; Ruff, L.; Vandermeulen, R. A.; Franks, B. J.;\nKloft, M.; and Müller, K.-R. 2021. Explainable deep oneclass classification. In International Conference on Learning Representations.\nLiznerski, P.; Ruff, L.; Vandermeulen, R. A.; Franks, B. J.;\nMüller, K.-R.; and Kloft, M. 2022. Exposing outlier exposure: What can be learned from few, one, and zero outlier\nimages. Transactions on Machine Learning Research.\nMiyato, T.; Kataoka, T.; Koyama, M.; and Yoshida, Y. 2018.\nSpectral normalization for generative adversarial networks.\nIn International Conference on Learning Representations.\nMiyato, T.; and Koyama, M. 2018. cGANs with projection discriminator. In International Conference on Learning\nRepresentations.\nMothilal, R. K.; Sharma, A.; and Tan, C. 2020. Explaining\nmachine learning classifiers through diverse counterfactual\nexplanations. In Conference on Fairness, Accountability,\nand Transparency, 607–617.\nMustafa, W.; Liznerski, P.; Ledent, A.; Wagner, D.; Wang,\nP.; and Kloft, M. 2024. Non-vacuous Generalization Bounds\nfor Adversarial Risk in Stochastic Neural Networks. In International Conference on Artificial Intelligence and Statistics, 4528–4536. PMLR.\nNeuwirth, R. J. 2022. The EU artificial intelligence act:\nregulating subliminal AI systems. Taylor &amp; Francis.\nPearl, J. 2009. Causality. Cambridge university press.\nReiss, T.; Cohen, N.; Bergman, L.; and Hoshen, Y. 2021.\nPANDA: Adapting pretrained features for anomaly detection and segmentation. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2806–2814.\nRombach, R.; Blattmann, A.; Lorenz, D.; Esser, P.; and Ommer, B. 2022. High-resolution image synthesis with latent\ndiffusion models. In IEEE/CVF Conference on Computer\nVision and Pattern Recognition, 10684–10695.\n\nRoth, K.; Pemula, L.; Zepeda, J.; Schölkopf, B.; Brox, T.;\nand Gehler, P. 2022. Towards total recall in industrial\nanomaly detection. In IEEE/CVF Conference on Computer\nVision and Pattern Recognition, 14318–14328.\nRuff, L.; Kauffmann, J. R.; Vandermeulen, R. A.; Montavon,\nG.; Samek, W.; Kloft, M.; Dietterich, T. G.; and Müller, K.R. 2021. A unifying review of deep and shallow anomaly\ndetection. Proceedings of the IEEE, 109(5): 756–795.\nRuff, L.; Vandermeulen, R. A.; Görnitz, N.; Binder, A.;\nMüller, E.; Müller, K.-R.; and Kloft, M. 2020. Deep semisupervised anomaly detection. In International Conference\non Learning Representations.\nRuff, L.; Vandermeulen, R. A.; Görnitz, N.; Deecke, L.; Siddiqui, S. A.; Binder, A.; Müller, E.; and Kloft, M. 2018.\nDeep one-class classification. In International Conference\non Machine Learning, volume 80, 4390–4399.\nRussakovsky, O.; Deng, J.; Su, H.; Krause, J.; Satheesh, S.;\nMa, S.; Huang, Z.; Karpathy, A.; Khosla, A.; Bernstein, M.;\nBerg, A. C.; and Fei-Fei, L. 2015. ImageNet large scale\nvisual recognition challenge. International Journal of Computer Vision, 115(3): 211–252.\nSamek, W.; Montavon, G.; Lapuschkin, S.; Anders, C. J.;\nand Müller, K.-R. 2020. Toward interpretable machine\nlearning: Transparent deep neural networks and beyond.\narXiv preprint arXiv:2003.07631.\nSanchez, P.; Kascenas, A.; Liu, X.; O’Neil, A. Q.; and Tsaftaris, S. A. 2022. What is healthy? Generative counterfactual diffusion for lesion localization. In MICCAI Workshop\non Deep Generative Models, 34–44. Springer.\nSelvaraju, R. R.; Cogswell, M.; Das, A.; Vedantam, R.;\nParikh, D.; and Batra, D. 2017. Grad-CAM: Visual explanations from deep networks via gradient-based localization. In\nIEEE International Conference on Computer Vision, 618–\n626.\nSiddiqui, A. A.; Tirunagari, S.; Zia, T.; and Windridge, D.\n2024. VALD-MD: Visual attribution via latent diffusion for\nmedical diagnostics. arXiv preprint arXiv:2401.01414.\nSingla, S.; Eslami, M.; Pollack, B.; Wallace, S.; and\nBatmanghelich, K. 2023.\nExplaining the black-box\nsmoothly—a counterfactual approach. Medical Image Analysis, 84: 102721.\nSulem, D.; Donini, M.; Zafar, M. B.; Aubet, F.-X.; Gasthaus,\nJ.; Januschowski, T.; Das, S.; Kenthapadi, K.; and Archambeau, C. 2022. Diverse counterfactual explanations\nfor anomaly detection in time series. arXiv preprint\narXiv:2203.11103.\nSzegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.;\nAnguelov, D.; Erhan, D.; Vanhoucke, V.; and Rabinovich, A.\n2015. Going deeper with convolutions. In Proceedings of the\nIEEE Conference on Computer Vision and Pattern Recognition, 1–9.\nTack, J.; Mo, S.; Jeong, J.; and Shin, J. 2020. CSI: Novelty\ndetection via contrastive learning on distributionally shifted\ninstances. In Advances in Neural Information Processing\nSystems, volume 33, 11839–11852.\nTax, D. M.; and Duin, R. P. 2004. Support vector data description. Machine learning, 54(1): 45–66.\n\n\fVarshneya, S.; Ledent, A.; Liznerski, P.; Balinskyy, A.;\nMehta, P.; Mustafa, W.; and Kloft, M. 2024. Interpretable\nTensor Fusion. Proceedings of International Joint Conference on Artificial Intelligence (IJCAI).\nWachter, S.; Mittelstadt, B.; and Russell, C. 2017. Counterfactual explanations without opening the black box: Automated decisions and the GDPR. Harv. JL &amp; Tech., 31: 841.\nWolleb, J.; Bieder, F.; Sandkühler, R.; and Cattin, P. C. 2022.\nDiffusion models for medical anomaly detection. In International Conference on Medical image computing and\ncomputer-assisted intervention, 35–45. Springer.\nWu, Z.; and Palmer, M. 1994. Verb semantics and lexical\nselection. In Annual Meeting of the Association for Computational Linguistics, 133–138.\nZagoruyko, S.; and Komodakis, N. 2016. Wide residual networks. In British Machine Vision Conference.\nZhang, J.; Bargal, S. A.; Lin, Z.; Brandt, J.; Shen, X.; and\nSclaroff, S. 2018a. Top-down neural attention by excitation\nbackprop. In International Journal of Computer Vision, volume 126, 1084–1102. Springer.\nZhang, R.; Isola, P.; Efros, A. A.; Shechtman, E.; and Wang,\nO. 2018b. The unreasonable effectiveness of deep features\nas a perceptual metric. In IEEE conference on computer\nvision and pattern recognition, 586–595.\nZhu, J.-Y.; Park, T.; Isola, P.; and Efros, A. A. 2017. Unpaired image-to-image translation using cycle-consistent adversarial networks. In IEEE International Conference on\nComputer Vision, 2223–2232.\n\n\fA\n\nBroader Impact\n\nAs an explanation technique, our method naturally aids in making deep AD more transparent. It may reveal biases in the\nmodel (see Section 5.3) and improve trustworthiness. For example, it may reveal a social bias when a portrait of a person is\nlabeled anomalous due to race or gender. In this scenario, our method might generate CEs where merely the skin color has been\nchanged. Applying our method can prevent a harmful deployment of such an AD model.\n\nB\n\nCounterfactual Explanations of Defects\n\nCE 0\n\nAnom\n\nIn the main paper, we did not include full experiments on datasets such as MVTec-AD, where anomalies are subtle modifications\nof normal samples (e.g., cracked hazelnuts for healthy hazelnuts being normal) rather than being out of class. Such datasets are\nnot interesting in the context of high-level explanations. Contrary to usual assumptions in AD, where anomalies are everything,\nwhich is not normal, in MVTec-AD there is a very precise definition of anomalousness and only one specific way to turn\nanomalies normal (i.e., by removing the defect). CEs would not help in understanding the model. Hence, we focus on the\nwell-established and important semantic image-AD setting.\nTo visualize why CEs are not a useful tool for explaining low-level AD, we trained our proposed method from scratch with\na single concept on several classes of MVTec-AD. Figure 11 shows some generated CEs for the classes bottle, grid, hazelnut,\nmetal nut, screw, tile, and wood. Mostly, the CEs are high-quality: realistic and normal. However, they do not help us to\nunderstand the behavior of the model. They simply show the sample with the defect removed, which is a trivial explanation of\nthe anomaly but does not explain the anomaly detector.\n\nFigure 11: CEs for MVTec-AD and an anomaly detector trained with BCE and ImageNet-21k as OE. For each class, a different\ndetector and CE generator was trained. The first row shows anomalies, the other corresponding CEs.\n\nC\n\nProof of the Theorems in the main paper\n\nProblem C.1. (Counterfactual explanation of image AD)\n\u0002\nmin max Ex∼pX Eα,k λgan (LD (D) + LG (G)) − λϕ Lϕ (G)\nG,R\n\nD\n\n\u0003\n+λrec (Lrec (G) + Lcyc (G)) + λr Lcon (G, R) ,\nwith\n\u0001\n\u0001\nLD (D) = min 0, −1 + D(x) + min 0, −1 − D(G(x, α, k)) ,\nLG (G) = − min(0, −1 + D(G(x, α, k))),\nLϕ (G) = α log(ϕ(G(x, α, k)) + (1 − α) log(1 − ϕ(G(x, α, k))),\nLrec (G) = ∥x − G(x, ϕ(x), k)∥1 ,\nLcyc (G) = ∥x − G(x̄α,k , ϕ(x), k)∥1 with x̄α,k = G(x, α, k),\n\u0001\n\u0001\nLcon (G, R) = C k, R(x, x̄α,k ) + C k, R(x̄α,k , G(x̄α,k , ϕ(x), k)) .\nWithout loss of generality, we assume α is discrete. Denote\n\u0002\n\u0003\nV (D, G) = Ex∼pX Eα,k λgan LD (D) ,\nand\nU (D, (G, R)) = Ex∼pX Eα,k\n\n\u0002\n\nλgan LG (G) − λϕ Lϕ (G)\n\n\u0003\n+λrec (Lrec (G) + Lcyc (G)) + λcon Lcon (G, R) .\nWe use V (D, G) to train D and use U (D, (G, R)) to train (G, R).\nDefinition C.2. (D∗ , (G∗ , R∗ )) is a Nash equilibrium of System (C.1) if\nV (D, G∗ ) ≤ V (D∗ , G∗ ) for any D,\nU (D∗ , (G∗ , R∗ )) ≤ U (D∗ , (G, R)) for any G, R.\n\n\fLet pG(α,k) denote a density function of G(x, α, k) conditional on k ∈ [K] and α ∈ [0, 1] with x ∼ pX . Let G̃ be the ideal\nvanilla generator if for any α, k, it holds pG̃α,k = pX and x = G̃(x, ϕ(x), k). We say G̃(x, ·, k) is βd -Lipschitz w.r.t the second\nargument if for any x\n\n∥G̃(x, ϕ1 , k) − G̃(x, ϕ2 , k)∥1 ≤ βd |ϕ1 − ϕ2 |.\n\nWe say ϕ(·) is nearly flat if |ϕ(x1 ) − ϕ(x2 )| ≤ βϕ ∥x1 − x2 ∥1 with βϕ being almost zero and say ϕ(·) is flat if βϕ = 0.\n\nLemma C.3. For any fixed generator G, V (D, G) reaches its maximum in 1 if Eα,k [pG(α,k) ](x) ≤ pX (x) and otherwise in 0.\nIf (D∗ , (G∗ , R∗ )) is a Nash equilibrium of System (C.1), then it holds −λgan ≥ V (D∗ , G∗ ) ≥ −2λgan . In addition,\n\n∗\n\n\u0010\n\n∗\n\nZ\n\n\b\nI Eα,k [pG∗ (α,k) ](x) ≤ pX (x) Eα,k [pG∗ (α,k) ](x)\n\u0011\n\b\n+ I Eα,k [pG∗ (α,k) ](x) &gt; pX (x) pX (x)dx ,\n\n(2)\n\nZ\n\u0010\n\u0001\u0011\nV (D∗ , G∗ ) = −λgan 2 +\nEα,k [pG∗ (α,k) ](x)D∗ (x) − pX (x)D∗ (x)dx .\n\n(3)\n\nV (D , G ) = −λgan 1 +\n\nand\n\nProof. For any fixed G, from the definition of V (D, G), we know\n\nV (D, G)\n\u0010Z\n\u0001\n= λgan\npX (x) min 0, −1 + D(x) dx+\nK\n\n1\n\n1 XX\nK|α|\nα=0\n\nZ\n\n\u0001 \u0011\npX (z) min 0, −1 − D(G(z, α, k)) dz\n\nk=1\n\n= λgan\n\n\u0010Z\n\n\u0001\npX (x) min 0, −1 + D(x) +\n\n(4)\n\nK\n1\n\u0001 \u0011\n1 XX\npG(α,k) (x) min 0, −1 − D(x) dx .\nK|α|\nα=0\nk=1\n\n\u0002\n\u0001\u0003\n\u0002\n\u0001\u0003\nFor a function F (y) = a min 0, −1 + y + b min 0, −1 − y where a, b ≥ 0, the maximizer of F on [0, +∞] exists and\nis reached in y ∗ = 1 if b ≤ a, and is reached in y ∗ = 0 else (the maximizer may not be unique).\nSetting a =\nPK P1\n1\n\npX (x) and b\n\n=\n\n1\nK|α|\n\nPK P1\nk=1\n\nα=0 pG(α,k) (x),\n\nV (D, G) reaches its maximum in 1 if\n\nk=1\nα=0 pG(α,k) (x) ≤ pX (x) (i.e., Eα,k [pG(α,k) ](x) ≤ pX (x) ) and otherwise in 0. This completes the proof of\nK|α|\nthe first part of the lemma.\n\n\fRecall (D∗ , (G∗ , R∗ )) is a Nash equilibrium. Plugging the value of D∗ back into V (·, G∗ ), we get\nV (D∗ , G∗ )\n\u0012Z\n\u0002\n\u0001\u0003\nλgan\n=\nK|α| · pX (x) min 0, −1 + D∗ (x)\nK|α|\n+\n\nK X\n1\nX\n\n\u0002\n\u0001\u0003\npG∗ (α,k) (x) min 0, −1 − D∗ (x) dx\n\n\u0013\n\nk=1 α=0\n\nλgan\n=−\nK|α|\n\n\u0012Z\n\nK X\n1\nX\n\b\n∗\n2I Eα,k [pG (α,k) ](x) ≤ pX (x)\npG∗ (α,k) (x)\nk=1 α=0\n\n\b\n+ I Eα,k [pG∗ (α,k) ](x) &gt; pX (x)\n\nK|α| · pX (x) +\n\nK X\n1\nX\n\n\u0001\npG∗ (α,k) (x) dx\n\n\u0013\n\nk=1 α=0\n\n\u0012\n\nZ\n\nK\n\n1\n\n1 XX\npG∗ (α,k) (x)\nK|α|\nk=1 α=0\n\u0013\n\b\n+ I Eα,k [pG∗ (α,k) ](x) &gt; pX (x) pX (x)dx\nZ\n\u0010\n\b\n= −λgan 1 + I Eα,k [pG∗ (α,k) ](x) ≤ pX (x) Eα,k [pG∗ (α,k) ](x)\n\u0011\n\b\n+ I Eα,k [pG∗ (α,k) ](x) &gt; pX (x) pX (x)dx ,\n\n= −λgan 1 +\n\n\b\nI Eα,k [pG∗ (α,k) ](x) ≤ pX (x)\n\nwhich implies −λgan ≥ V (D∗ , G∗ ) ≥ −2λgan .\nSince we already showed V (D, G) reaches its maximum in 1 or 0, it follows D∗ (x) ≤ 1. Combining this observation with\n(4), we get\nZ\nK\n1\n\u0011\nλgan X X \u0010\n∗\n∗\nV (D , G ) = −\npX (x)(1 − D∗ (x)) + pG∗ (α,k) (x)(1 + D∗ (x))dx\nK|α|\nk=1 α=0\nZ\n\u0010\n\u0001\u0011\n= −λgan 2 +\nEα,k [pG∗ (α,k) ](x)D∗ (x) − pX (x)D∗ (x)dx .\nThis completes the proof of the lemma.\nProof of Theorem 4.2\nProof of Theorem 4.2. Note that we assume G, R is given enough capacity. Let G̃ be the “ideal\" generator such that pX =\npG̃(α,k) , x = G̃(x, ϕ(x), k). Let R∗ be the ideal concept classifier that can predict the correct concept, then Lcon (G, R∗ ) = 0\nfor any G.\nCase 1. Let λϕ = λrec = λcon = 0; i.e., we only consider the problem\n\u0002\n\u0001\u0003\nmin max Ex∼pX Eα,k λgan LD (D) + LG (G) .\nG,R\n\nD\n\nThen, we are going to show Eα,k [pG∗ (α,k) ] = pX and V (D∗ , G∗ ) = −2λgan . From the Nash equilibrium, we have\n\u0002\n\u0003\n\u0002\n\u0003\nEx∼pX Eα,k LG (G∗ ) ≤ Ex∼pX Eα,k LG (G̃) . Note we shown that any maximizer D∗ (x) ≤ 1, it follows\nZ\n1 X\npX (x)D∗ (G̃(x, α, k)) − pX (x)D∗ (G∗ (x, α, k))dx ≤ 0.\nK|α|\nk,α\n\nNote pG̃(α,k) = pX . By using integral transform, we have\nZ\n1 X\npX (x)D∗ (x) − pG∗ (α,k) D∗ (x)dx\nK|α|\nk,α\nZ\n= pX (x)D∗ (x) − Eα,k [pG∗ (α,k) ](x)D∗ (x)dx ≤ 0.\n\n\fPlugging the above results back into (3) in Lemma C.3 yields\nV (D∗ , G∗ ) ≤ −2λgan .\nSince (2) implies V (D∗ , G∗ ) ≥ −2λgan , then it holds V (D∗ , G∗ ) = −2λgan . Further, pX = Eα,k [pG∗ (α,k) ].\nCase 2. If λϕ = 0, then the optimization problem (C.1) becomes\n\u0002\n\u0001\nmin max Ex∼pX Eα,k λgan LD (D) + LG (G) + λrec (Lrec (G) + Lcyc (G))+\nG,R D\n\u0003\nλcon Lcon (G, R) .\nFrom U (D∗ , G∗ , R∗ ) ≤ U (D∗ , G̃, R∗ ), D∗ (x) ≤ 1 and Lcon (G, R∗ ) = 0 for any G, we know\nZ\n\u0001\n1 X\npX (x)λgan D∗ (G̃(x, α, k)) − D∗ (G∗ (x, α, k) dx\nK|α|\nk,α\nZ\n1 X\npX (x) λrec ∥x − G̃(x, ϕ(x), k)∥1 − ∥x − G∗ (x, ϕ(x), k)∥1\n≤\nK|α|\nk,α\n\u0001\u0001\n+ ∥x − G̃(G̃(x, α, k), ϕ(x), k)∥1 − ∥x − G∗ (G∗ (x, α, k), ϕ(x), k)∥1 dx\nZ\n1 X\npX (x)λrec ∥x − G̃(G̃(x, α, k), ϕ(x), k)∥1 dx.\n≤\nK|α|\nk,α\n\nSince we assume the ideal generator G̃ is βd -Lipschitz w.r.t the second argument with βd &lt; ∞ and ϕ is βϕ -Lipschitz, it follows\n\u0001\nx − G̃ G̃(x, α, k), ϕ(x), k 1\n\u0001\n\u0001\n= G̃ G̃(x, α, k), ϕ(G̃(x, α, k)), k − G̃ G̃(x, α, k), ϕ(x), k 1\n≤ βd ϕ(G̃(x, α, k)) − ϕ(x) ≤ βd βϕ G̃(x, α, k) − x 1\n= βd βϕ G̃(x, α, k) − G̃(x, ϕ(x), k) 1 ≤ βd2 βϕ ϕ(x) − α ≤ βd2 βϕ .\nCombining the above two observations together, we get\nZ\n\u0001\n1 X\npX (x)λgan D∗ (G̃(x, α, k)) − D∗ (G∗ (x, α, k) dx ≤ λrec βd2 βϕ .\nK|α|\nk,α\n\nNote pG̃α,k = pX . By using integral transform, we have\nZ\nλgan X\npX (x)D∗ (x) − pG∗ (α,k) (x)D∗ (x)dx ≤ λrec βd2 βϕ .\nK|α|\nk,α\n\nThat is\nZ\n\npX (x)D∗ (x) − Eα,k [pG∗ (α,k) ](x)D∗ (x)dx ≤\n\nλrec 2\nβ βϕ := ϵ.\nλgan d\n\nPlugging this observation with (3) in Lemma C.3, we know\nZ\n∗\n∗\nV (D , G ) = −λgan (2 + Eα,k [pG∗ (α,k) ](x)D∗ (x) − pX (x)D∗ (x)dx)\n≤ −λgan (2 − ϵ).\nCombining this observation with (2) in Lemma C.3, we know V (D∗ , G∗ ) ∈ [−2λgan , −λgan (2 − ϵ)] and\nZ\n\b\n1 − ϵ ≤ min pX (x), Eα,k [pG∗ (α,k) ](x) dx ≤ 1.\nIf ϕ is nearly flat with βϕ ≈ 0 such that ϵ ≈ 0, then it holds\nV (D∗ , G∗ ) ≈ −2λgan ,\nand further\nEα,k [pG∗ (α,k) ] ≈ pX .\nIf βϕ = 0, then\nV (D∗ , G∗ ) = −2λgan and Eα,k [pG∗ (α,k) ] = pX .\nThe proof is completed.\n\n\fProof of Theorem 4.3\nProof of Theorem 4.3. For a Nash equilibrium (D∗ , (G∗ , R∗ )), we are going to show that Eα,k [pG∗ (α,k) ] = pX and\nV (D∗ , G∗ ) = −2λgan cause a contradiction. Then pG∗ (α,k) ̸= pX and V (D∗ , G∗ ) ̸= −2λgan for a Nash equilibrium.\nLet R∗ be the ideal classifier with Lcon (G, R∗ ) = 0 for any G. Let G′ be the generator satisfying ϕ(G′ (x, α, k)) =\nα, ∥G′ (x, α1 , k) − G′ (x, α2 , k)∥1 ≤ β1 |α1 − α2 | and ∥G′ (x, α, k) − G′ (x′ , α, k)∥1 ≤ β2 ∥x − x′ ∥1 . We will show\nU (D∗ , (G∗ , R∗ )) &gt; U (D∗ , (G′ , R∗ )) which violates the definition of a Nash equilibrium.\nFrom Lemma C.3, we know |D∗ (x)| ≤ 1. Therefore,\nZ\n\u0002\n\u0003\n\u0001\n′\n∗\nEx∼pX Eα,k LG (G ) − LG (G ) =\npX (x) − pG′ (α,k) (x) D∗ (x)dx ∈ [−1, 1].\nFrom the property of G′ , it follows\n\u0002\n\u0003\nEx∼pX Eα,k Lcyc (G′ ) − Lcyc (G∗ )\nZ\n\u0001\n= pX (x) ∥x − G′ (x, ϕ(x), k)∥1 − ∥x − G∗ (x, ϕ(x), k)∥1 ≤ 0.\nSince ϕ(G′ (x, α, k)) = α, it follows f (α) = α log(ϕ(G′ (x, α, k))) + (1 − α) log(1 − ϕ(G′ (x, α, k))) = 0 for α = 0 and\nα = 1 for any k. Hence, there exists a constant 0 ≤ C &lt; ∞ such that\n\u0002\n\u0003\nEx∼pX Eα,k Lϕ (G′ ) ≥ −C.\nNote pG∗ (α,k) = pX . We know\n\u0002\n\u0003\nEx∼pX Eα,k Lϕ (G∗ )\nZ\n\u0001\n1 X\npX (x) α log(ϕ(G∗ (x, α, k))) + (1 − α) log(1 − ϕ(G∗ (x, α, k))) dx\n=\nK|α|\nk,α\nZ\n\u0001\n1 X\npX (x) α log(ϕ(x)) + (1 − α) log(1 − ϕ(x)) dx.\n=\nK|α|\nk,α\n\u0002\n\u0003\n\u0001\nThere exists a constant M &lt; ∞ such Ex∼pX Eα,k Lϕ (G∗ ) ≥ −M only if Prob ϕ(x) = 1 ∪ ϕ(x) = 0 = 0 for every α. That\nis, with zero probability, ϕ(x) = 0 or ϕ(x) = 1. However, it violates the assumption of ϕ. Hence, Lϕ (G∗ ) = −∞.\nCombining the above two observations together, we know\n\u0002\n\u0003\nEx∼pX Eα,k Lϕ (G∗ ) − Lϕ (G′ ) = −∞.\nTherefore,\n\u0002\n\u0003\nEx∼pX Eα,k LG (G′ ) − LG (G∗ ) + Lcyc (G′ ) − Lcyc (G∗ ) + Lϕ (G∗ ) − Lϕ (G′ )\n= −∞,\nwhich implies\n\nU (D∗ , (G′ , R∗ )) &lt; U (D∗ , (G∗ , R∗ )).\nThis causes a contradiction from the fact that U (D∗ , (G∗ , R∗ )) ≤ U (D∗ , (G, R∗ )) for any G since (D∗ , (G∗ , R∗ )) is a Nash\nequilibrium of the system. Hence, pG∗ (α,k) ̸= pX and V (D∗ , G∗ ) ̸= −2λgan is implied by (2). This completes the proof.\n\nD\n\nLimitations\n\nIn the main paper, we demonstrated the efficacy of the proposed method to generate counterfactual explanations (CEs) for deep\nanomaly detection (AD). Here, we discuss a few limitations. One challenge is that the ideal number of categorical concepts is\nproblem-specific and cannot be automatically learned, though future work may solve this by comparing the models for different\nnumbers of concepts. Additionally, the quality of the CEs may be affected when the AD model performs poorly. For example,\nDSVDD without OE (Ruff et al. 2018) tends to perform weakly on some image datasets, leading to less intuitive CEs that\nmay collapse into mere reconstructions of the anomaly. This occurs when DSVDD struggles to detect anomalies, resulting\nin already low anomaly scores of anomalies and thus no clear incentive for the generator to transform the anomaly. Another\nchallenge is that the generator may over-correct, making unnecessary changes and falling into a local optimum of the proposed\nobjective. Balancing objectives in an unsupervised setting is challenging, especially given the limited diversity and quantity\nof normal samples. A potential improvement when using diffusion models is to explore prompt engineering or learning in\nan unsupervised manner, which could enhance the explainability of the CEs and address some of these challenges. Another\ndirection for improvement would be leveraging advancements from the related field of adversarial examples (Mustafa et al.\n2024).\n\n\fE\n\nThe CEs Capture Disentangled Concepts\n\nRecall that the concept classifier predicts the concept of each CE (see Section 3). We present the accuracy of this concept\nclassifier for the generated CEs in Table 3. Our models demonstrate a consistent ability to disentangle concepts effectively.\nNotably, disentanglement is effective even when just one class is considered normal. On CIFAR-10 the generator exploits the\nbackground, on INN the color scheme, and on MNIST it generates disentangled variants of digits. We hypothesize that this\nstrong disentanglement is the reason for the CEs appearing less normal for MNIST.\nTable 3: Concept classifier accuracy for the CEs.\nDatasets\n\nMethods\nBCE OE\n\nHSC OE\n\nDSVDD\n\nSingle MNIST\n94.3 ± 3.9 90.8 ± 4.8 77.5 ± 14.1\nnormal CIFAR-10 93.0 ± 4.3 98.8 ± 3.2 97.1 ± 2.9\nclass\nINN\n97.0 ± 5.4 98.9 ± 1.1\n×\nC-MNIST 99.4 ± 1.3 98.9 ± 2.0 98.0 ± 3.0\nMultiple\nMNIST\n93.8 ± 5.1 85.7 ± 9.6 81.6 ± 11.3\nnormal\nCIFAR-10 86.2 ± 7.5 98.9 ± 2.4 92.2 ± 4.2\nclasses\nGTDSB\n98.8 ± 0.8 94.0 ± 8.4 93.4 ± 4.5\n\nF\n\nThe CE Framework Performs Minimal Edits\n\nThe main paper presented several qualitative examples of CEs, demonstrating that the modifications relative to the original\nanomalies are both meaningful and minimal. To quantitatively assess the minimality of these changes, we report the average\nMSE between test anomalies and their corresponding CEs in Table 4, as well as the average LPIPS (Zhang et al. 2018b) in\nTable 5. The results indicate that the modifications are reasonably limited, as both metrics attain comparatively low values.\nIn particular, the LPIPS scores—ranging between 0 and 1—typically fall between 0.15 and 0.5, which we consider to be a\nreasonable range for perceptually minimal changes.\nTable 4: Mean squared error (MSE) between test anomalies and their CEs. Results are averaged over 4 random seeds and up to\n20 normal definitions (see Appendix O).\n\nMethod\nBCE OE\nHSC OE\nDSVDD\n\nSingle normal classes\nMNIST\nCIFAR-10\n0.06 ± 0.019\n0.05 ± 0.016\n0.03 ± 0.018\n\n0.02 ± 0.001\n0.03 ± 0.006\n0.02 ± 0.003\n\nC-MNIST\n0.06 ± 0.008\n0.07 ± 0.006\n0.05 ± 0.007\n\nMultiple normal classes\nMNIST\nCIFAR-10\n0.03 ± 0.007\n0.02 ± 0.006\n0.02 ± 0.008\n\n0.01 ± 0.002\n0.03 ± 0.004\n0.01 ± 0.001\n\nGTSDB\n0.08 ± 0.011\n0.07 ± 0.011\n0.06 ± 0.017\n\nTable 5: Learned Perceptual Image Patch Similarity (LPIPS) (Zhang et al. 2018b) between test anomalies and their CEs. Results\nare averaged over 4 random seeds and up to 20 normal definitions (see Appendix O).\n\nMethod\nBCE OE\nHSC OE\nDSVDD\n\nSingle normal classes\nMNIST\nCIFAR-10\n0.16 ± 0.041\n0.15 ± 0.037\n0.07 ± 0.035\n\nG\n\n0.43 ± 0.021\n0.60 ± 0.048\n0.42 ± 0.021\n\nC-MNIST\n0.26 ± 0.029\n0.26 ± 0.023\n0.18 ± 0.025\n\nMultiple normal classes\nMNIST\nCIFAR-10\n0.10 ± 0.015\n0.08 ± 0.012\n0.05 ± 0.021\n\n0.37 ± 0.023\n0.57 ± 0.023\n0.30 ± 0.020\n\nGTSDB\n0.52 ± 0.065\n0.53 ± 0.057\n0.51 ± 0.057\n\nThe Detection Performance of the Detectors\n\nTable 6 shows the AuROC of anomaly scores for normal test data vs. ground-truth test anomalies. We consider the BCE, HSC,\nand DSVDD detector from the main paper. The values match the reported scores from the literature.\n\n\fTable 6: The detection performance of the considered detectors in terms of AuROC of anomaly scores for normal vs. anomalous\ntest data.\nDatasets\nSingle\nnormal\nclass\n\nMethods\nBCE OE\n\nHSC OE\n\nDSVDD\n\nMNIST\n97.7 ± 1.5 97.6 ± 1.6 78.8 ± 8.6\nCIFAR-10 96.0 ± 2.5 95.9 ± 2.5 55.4 ± 4.7\nINN\n93.6 ± 5.7 92.6 ± 6.7\n×\n\nC-MNIST\nMultiple\nMNIST\nnormal\nCIFAR-10\nclasses\nGTDSB\n\nH\n\n97.1 ± 1.0\n93.5 ± 2.8\n93.8 ± 2.7\n94.3 ± 4.7\n\n95.7 ± 2.3\n92.9 ± 3.3\n94.0 ± 2.7\n93.0 ± 5.6\n\n76.9 ± 6.5\n75.4 ± 7.1\n52.6 ± 3.6\n58.2 ± 6.7\n\nConcept Figures\n\nIn the main paper, we show a schematic overview of the proposed framework in Section 3. Here, we provide a modification of\nthis figure when using diffusion models as a backbone in Figure 12. Figure 12a shows the training framework, which includes\nthe encoder AE and decoder AΩ from stable diffusion (Rombach et al. 2022). We apply DiffEdit (Couairon et al. 2023) to the\nimage in the latent space and feed the output z to the generator, which is trained to generate disentangled explanations as before.\nThe output of the generator is then passed to AΩ . The generator thus operates on the latent space of DiffEdit, while all other\nmodules still operate on the full-resolution image space. The objectives to train the framework are described in Section 3.2.\nFigure 12b shows the inference framework that utilizes the encoder and decoder from stable diffusion and our trained generator\nto produce CEs.\n\nReal/Fake\n\nDiﬀEdit\nDiﬀEdit\n\nR\n\n(a)\n\n(b)\n\nFigure 12: Schematic overview of the proposed disentangled CE framework when using a pre-trained diffusion model. Gray\nnodes correspond to models that are not further optimized.\n\nI\n\nHyperparameter Sensitivity Analysis\n\nThe proposed counterfactual training objective consists of six interacting losses, which are weighted by factors λgan , λϕ , λrec ,\nand λr (see Problem C.1). These factors are hyperparameters that must be set prior to training. For the experiments in the\nmain paper, we selected reasonable values that worked across most settings (see Appendix M). Here, we perform a small\n\n\fhyperparameter sensitivity analysis, varying each λ between 60% and 140% of the value used in the experiments while keeping\nthe other λ parameters fixed. The resulting evaluation metrics are reported in Figure 13.\n1.0\n\n1.8\n1.6\n\n0.9\n\n1.6\n\n1.4\n\n0.8\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n0.7\n0.6\n\n1.4\n\n1.2\n\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n1.0\n0.8\n\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n1.0\n0.8\n\n0.6\n\n0.5\n\n1.2\n\n0.6\n\n0.4\n0.6\n\n0.7\n\n0.8\n\n0.9\n\n1.0\n\n1.1\n\n1.2\n\n1.3\n\n1.4\n\n0.6\n\n0.7\n\n0.8\n\n(a) λϕ for BCE\n\n0.9\n\n1.0\n\n1.1\n\n1.2\n\n1.3\n\n1.4\n\n0.6\n\n0.7\n\n0.8\n\n(b) λϕ for DSVDD\n\n1.0\n0.9\n0.8\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n0.7\n0.6\n\n1.0\n\n1.1\n\n1.2\n\n1.3\n\n1.4\n\n(c) λϕ for HSC\n\n1.8\n\n1.8\n\n1.6\n\n1.6\n\n1.4\n\n1.4\n\n1.2\n\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n1.0\n0.8\n\n1.2\n\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n1.0\n0.8\n\n0.6\n\n0.5\n\n0.9\n\n0.6\n\n0.4\n12\n\n14\n\n16\n\n18\n\n20\n\n22\n\n24\n\n26\n\n28\n\n12\n\n14\n\n16\n\n18\n\nrec\n\n20\n\n22\n\n24\n\n26\n\n28\n\n12\n\n14\n\n16\n\n18\n\nrec\n\n(d) λrec for BCE\n1.8\n\n0.9\n\n1.6\n\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n0.7\n0.6\n\n26\n\n28\n\n1.6\n1.4\n\n1.2\n\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n1.0\n0.8\n\n1.2\n\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n1.0\n0.8\n0.6\n\n0.6\n\n0.5\n\n24\n\n(f) λrec for HSC\n\n1.4\n\n0.8\n\n22\n\nrec\n\n(e) λrec for DSVDD\n\n1.0\n\n20\n\n0.4\n6\n\n7\n\n8\n\n9\n\n10\nr\n\n11\n\n12\n\n13\n\n14\n\n6\n\n7\n\n8\n\n(g) λr for BCE\n\n9\n\n10\nr\n\n11\n\n12\n\n13\n\n14\n\n6\n\n0.9\n0.8\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n0.7\n0.6\n\n1.8\n\n1.8\n\n1.6\n\n1.6\n\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n1.0\n0.8\n\n4.5\n\n5.0\n\n5.5\n\n6.0\n\n6.5\n\n7.0\n\n3.0\n\ngan\n\n11\n\n12\n\n13\n\n14\n\n1.2\n\nCF AuROC\nFIDN\nConcept Acc\nLPIPS\n\n1.0\n0.8\n\n3.5\n\n4.0\n\n4.5\n\n5.0\n\n5.5\n\n6.0\n\n6.5\n\n7.0\n\n0.4\n\ngan\n\n(j) λgan for BCE\n\nr\n\n0.6\n\n0.4\n4.0\n\n10\n\n1.4\n\n1.2\n\n0.6\n\n0.5\n\n9\n\n(i) λr for HSC\n\n1.4\n\n3.5\n\n8\n\n(h) λr for DSVDD\n\n1.0\n\n3.0\n\n7\n\n(k) λgan for DSVDD\n\n3.0\n\n3.5\n\n4.0\n\n4.5\n\n5.0\n\n5.5\n\n6.0\n\n6.5\n\n7.0\n\ngan\n\n(l) λgan for HSC\n\nFigure 13: The plots show the impact of the lambda hyperparameters that weigh the interacting loss functions of our counterfactual framework. In each plot, we vary a λ between 60% and 140% of the value used in the experiments in the main paper (see\nAppendix M), while keeping the other λ parameters fixed. The reported metrics are averaged over four seeds for the specific\nsetting of speed signs being normal in GTSDB. The blue line reports the CF AuROC, the orange one the FIDN , the green the\nconcept accuracy, and the red one the LPIPS metric.\n\nJ\n\nDeep Anomaly Detection Methods\n\nThis paper studies the application of the proposed method to three state-of-the-art anomaly detectors. Here, we provide a\ndetailed description of those methods.\nDSVDD One of the first deep approaches to AD is Deep Support Vector Data Description (DSVDD) (Ruff et al. 2018).\nSimilar to many AD methods, DSVDD is unsupervised, employing an unlabeled corpus of (mostly normal) data for training\n(Ruff et al. 2018). DSVDD trains a neural network ϕθ : RD → Rd with parameters θ to map the training data x1 , . . . , xn ∈ RD\n\n\fPn\ninto a semantic space Rd , where it can be enclosed by a minimal volume hypersphere: minθ i=1 ||ϕ(xi ) − c||2 . In contrast\nto shallow SVDD (Tax and Duin 2004), the hypersphere center c ∈ Rd is first randomly initialized and then kept fixed while\ntraining. DSVDD trains the network to make normal data cluster tightly in the semantic space. Anomalies will have a larger\ndistance from the center. The distance is used as the anomaly score. Since the CE generator requires bounded anomaly scores,\nPn\n||ϕ(xi )−c||2\nwe slightly adjust the DSVDD objective to: minθ i=1 1+||ϕ(x\n2.\ni )−c||\nOutlier Exposure AD has traditionally been approached as an unsupervised learning problem due to insufficient training data\nto represent the diverse anomaly class, which encompasses everything different from the normal data. However, Hendrycks,\nMazeika, and Dietterich (2019) showed that Outlier Exposure (OE)—using a large unstructured collection of natural images\nas example anomalies during training—consistently outperforms previous AD methods across various image-AD benchmarks,\nwhile still being unsupervised. The unlabeled auxiliary data are called OE samples. It has been found that training a Binary\nCross Entropy (BCE) loss to differentiate normal data from OE samples is competitive for most image-AD tasks. To the best of\nour knowledge, OE with BCE still holds the state of the art in semantic image anomaly detection benchmarks (Liznerski et al.\n2022). Since we use the same data for training G as was used for training the detector ϕ, we include the OE samples for training\nthe generator G. The generator G is thus trained on a more diverse training set, including additional presumably anomalous OE\nsamples.\nHypersphere Classification Although OE performs well in many benchmarks, there are still scenarios where OE samples do\nnot adequately represent anomalies, especially when the normal data are not natural images (Liznerski et al. 2022). To address\nthis problem, the community has developed semi-supervised AD methods (Görnitz et al. 2014; Ruff et al. 2020). One of the\nmost competitive semi-supervised AD techniques is HyperSphere Classification (HSC) (Liznerski et al. 2022). The authors\nfind that combining it with OE makes the AD more robust to the selection of OE data. The HSC loss is a semi-supervised\nmodification of the DSVDD loss:\nn\n\n1X\nyi · h (ϕ(xi )) − (1−yi ) log (1− exp (−h (ϕ(xi )))),\nn i=1\n2\n\nwhere h is the Pseudo-Huber loss h(z) = (∥z∥ + 1)1/2 − 1. We employ HSC’s original objective but modify the anomaly\nscore from h (ϕ(xi )) to 1−exp(−h (ϕ(xi ))), again obtaining bounded anomaly scores for training the proposed counterfactual\ngenerator.\n\nK\n\nDatasets\n\nIn our experiments, we consider the following datasets:\n• MNIST (Deng 2012) is a dataset of grayscale handwritten digits with a class for each digit. Following Liznerski et al.\n(2021), we use EMNIST (Cohen et al. 2017) as OE.\n• Colored-MNIST, where each sample in MNIST is replicated in seven colors (red, yellow, green, cyan, blue, pink, and gray).\nWe use a colored version of EMNIST as OE.\n• CIFAR-10 (Krizhevsky, Hinton et al. 2009) is a dataset of natural images with ten classes. Previous work used 80 Mio. Tiny\nImages as OE (Hendrycks et al. 2019). Since this dataset has been withdrawn due to offensive data (Birhane and Prabhu\n2021), we instead use the disjunct CIFAR-100 dataset as OE, which yields approximately the same performance (reported\nin Table 12).\n• GTSDB (Houben et al. 2013) is a dataset of German traffic signs. We use CIFAR-100 as OE.\n• We introduce ImageNet-Neighbors (INN), a subset of ImageNet-1k (Russakovsky et al. 2015) designed for AD tasks. INN\ncomprises multiple AD setups; in each setup, one ImageNet-1k class is considered normal, and the ten most semantically\nsimilar classes, based on the Wu-Palmer similarity metric (Wu and Palmer 1994), are defined as ground-truth test anomalies.\nFor outlier exposure (OE), we use the disjoint ImageNet-21k dataset.\n\nL\n\nMetrics\n\nIn this section, we provide details of the metrics used for the quantitative analysis in Section 5.2.\nNormality of counterfactuals To assess the normality of the generated CEs, we computed the AuROC of normal test samples against CEs generated for all ground-truth anomalies from the test set. The Area Under the ROC curve (AuROC) is a\nwidely recognized metric in the AD literature for comparing anomaly scores of normal and anomalous samples (Hanley and\nMcNeil 1982). An AuROC of 1 indicates perfect separation between anomalies and normal samples, 0.5 corresponds to random guessing, and a score below 0.5 suggests that anomalies appear more normal than the actual normal samples. To assess\nthe normality of our CEs, we computed the AuROC with the anomalies being CEs. Then, an AuROC of significantly more than\n\n\f0.5 indicates that the CEs retain some degree of anomalousness according to the chosen detector. An AuROC of 0.5 indicates\nthat CEs appear completely normal, and for below 0.5 the CEs are even more normal than the normal test samples. This may\nhappen when the anomaly detector does not generalize perfectly and hence perceives some normal test samples as somewhat\nanomalous.\nRealism of counterfactuals To assess the realism of generated samples, the standard approach involves computing the\nFréchet inception distance (FID) introduced by Heusel et al. (2017) for GANs. The FID is the Wasserstein distance between\nthe feature distributions of a generated dataset and a ground-truth dataset. The larger the distance, the less the generated dataset\nresembles the ground truth. The features are extracted using an InceptionNet v3 model (Szegedy et al. 2015) trained on ImageNet. In this paper, we used the normal test set as ground truth and a collection of CEs for all test anomalies as the generated\ndataset. For a more intuitive scoring, we also computed a second FID with the test anomalies as the generated dataset. Then,\nwe normalize the FID for CEs by dividing through the FID for test anomalies. The normalized FID is 100% if the CEs are as\nrealistic as the test anomalies, below 100% if they are more realistic, and 0% if they exactly match the normal test set. It is\nimportant to note that, although anomalies are naturally anomalous, they are still realistic in the sense that they come from the\nsame classification dataset and thus follow the general distribution of, e.g., handwritten digits. A normalized FID of 100% is\ntherefore sufficient for a counterfactual to be expressive. A normalized FID of close to 0% would actually be spurious, as the\ngenerator then seems to entirely reproduce normal samples that do not retain non-anomalous features from the anomaly.\n\nM\n\nHyperparameters\n\nIn this section, we provide an exhaustive enumeration of all the hyperparameters that we used for training our AD and CE\nmodule. All hyperparameters were adopted from existing research (Ruff et al. 2018; Ghandeharioun et al. 2021; Liznerski et al.\n2022). We start by describing the CE module, which is the same for all datasets and AD objectives. Then we separately describe\nthe AD module and other hyperparameters for MNIST, Colored-MNIST, CIFAR-10, and GTSDB.\n\nM.1\n\nThe CE Module\n\nGenerator The generator is a wide ResNet (Zagoruyko and Komodakis 2016) structured as an encoder-decoder network. The\nencoder consists of a sequential arrangement of a batch normalization layer, a convolutional layer with 64 kernels, and three\nresidual blocks. Each residual block comprises two sets, each containing a conditional batch normalization layer (De Vries\net al. 2017), followed by an activation function (ReLU), and a convolutional layer. The convolutional layers in these sets have\n256, 512, and 1024 kernels, respectively, for the first, second, and third block. The initial two residual blocks employ average\npooling in each set to reduce the spatial dimension of the feature maps by one-half of the input, while the third residual block is\nimplemented without average pooling to maintain the spatial dimension. Conversely, the decoder follows a similar sequential\narrangement, featuring three residual blocks, followed by a batch normalization layer, a final convolutional layer mapping to the\nimage space, and an activation function (ReLU). Again, each residual block comprises two sets, each containing a conditional\nbatch normalization layer, followed by RelU activation, and a convolutional layer. The convolutional layers in these sets have\n1024, 512, and 256 kernels, respectively, for the first, second, and third block. The first residual block in the decoder retains the\nspatial dimension, while the subsequent two residual blocks employ an interpolation layer in each set to upsample the spatial\ndimension by a multiplicative factor of 2 using nearest-neighbor interpolation. We apply spectral normalization to all layers of\nthe decoder, following (Miyato et al. 2018). The last layer of the decoder uses a tanh activation. The conditional information,\ni.e., the discretized target anomaly score α and the target concept k are transformed into a single categorical condition and\nprocessed through the categorical conditional batch normalization layers.\nDiscriminator The discriminator contains four residual blocks arranged sequentially, followed by a final linear layer mapping\nto a scalar. The first block is implemented with two convolutional layers with 64 kernels, where the first layer is followed by a\nReLU activation and the second layer is followed by an average pooling with a kernel size of 2. The next two residual blocks\nconsist of two convolutional layers, where each one is preceded by a ReLU activation and followed by an average pooling layer\nin the end to halve the spatial dimension. The fourth residual block also contains two convolutional layers preceded by a ReLU,\nbut does not use any downsampling. The number of kernels in the convolutional layers from the second to fourth block is 128,\n256, and 512, respectively. We apply spectral normalization to all layers.\nConcept Classifier The concept classifier is composed of two sequentially arranged residual blocks, succeeded by a linear\nlayer with two outputs for the classification of two concepts. In the first residual block, three convolutional layers are employed\nwith 64 kernels each. The initial convolutional layer is succeeded by a ReLU activation, and the last two convolutional layers are\nfollowed by average pooling layers, which reduce the spatial dimension by a factor of two. The second residual block consists\nof two convolutional layers with 128 kernels, each followed by a ReLU activation, followed by an average pooling with a kernel\nsize of two. We take the sum over the remaining spatial dimension to prepare the output for the final linear layer. Again, we\napply spectral normalization to all layers.\nTraining We train the GAN-based generator to generate CEs with two disentangled concepts and a discretized target anomaly\nscore α ∈ 0, 0.5, 1. The CE module is trained for 350 (2000 for GTSDB) epochs with a batch size of 64 normal and, if used, 64\n\n\fOE samples. The initial learning rate is set to 2e−4 , with reductions by a multiplicative factor of 0.1 occurring after 300 and 325\nepochs. For GTSDB, we instead use an initial learning rate of 1e−4 and reduce it after 1750 and 1900 epochs. We employ the\nAdam optimizer, with the generator and discriminator optimized every 1 and 5 batches, respectively. The CE objective involves\na combination of different losses which are weighted using λ hyperparameters. Specifically, we set λgan = 1, λrec = 100,\nλϕ = 1, and λr = 10. For GTSDB, we instead set λgan = 5, λrec = 20, λϕ = 1, and λr = 10.\nFor INN, we use a different set of hyperparameters. We employ the diffusion model-based CE method as described in the\nmain paper. We set λgan = 10, λrec = 1, λϕ = 1, and λr = 0.5. Also, we set α = 0 for training, as we train the generator\nwith only OE samples to reduce the training time, while the discriminator is trained with normal and generated samples. Due\nto the immense VRAM requirements of the diffusion model, we train with a batch size of 1 and use the running statistics of all\nBatchNorm layers during training. The initial learning rate is set to 1e−4 . It is reduced by a factor of 0.5 at 100, 120, 130, 140,\nand 145 epochs. The model is trained for 150 epochs in total.\n\nM.2\n\nAD on MNIST\n\nFor MNIST and all the following datasets, we trained anomaly detectors with a binary cross entropy (BCE) and hypersphere\nclassification (HSC) loss, both with Outlier Exposure (OE) (Hendrycks, Mazeika, and Dietterich 2019), as well as DSVDD\n(Ruff et al. 2018) without OE.\nWe use a LeNet-style neural network comprising layers arranged sequentially without residual connections. The network\ncontains four convolutional layers and two fully-connected layers. Each convolutional layer is followed by batch normalization,\na leaky ReLU activation, and max-pooling. The first fully connected layer is followed by batch normalization and a leaky ReLU\nactivation, while the last layer is only a linear transformation. The number of kernels in the convolutional layers is, from first to\nlast, 4, 8, 16, and 32. The kernel size is increased from the default of 3 to 5 for all of these. The two fully connected layers have\n64 and 32 units, respectively. For DSVDD we remove bias from the network, following (Ruff et al. 2018), and for BCE we add\nanother linear layer with sigmoid activation.\nWe used Adam for optimization and balanced every batch to contain 128 normal and 128 OE samples during training. We\ntrained the AD model for 80 epochs starting with a learning rate of 1e−4 , which we reduced to 1e−5 after 60 epochs.\n\nM.3\n\nAD on Colored-MNIST\n\nBased on the MNIST dataset, we create Colored-MNIST where for each sample in MNIST six copies in different colors (red,\nyellow, green, cyan, blue, pink) are created. We use a colored version of EMNIST as OE. The network for Colored-MNIST is a\nslight variation of the AD network used on MNIST. We remove the last convolutional layer and change the number of kernels\nfor the convolutional layers to 16, 32, and 64, respectively.\nWe use Adam for optimization, balance every batch to contain 128 normal and 128 OE samples during training, and train the\nAD model for 120 epochs, starting with a learning rate of 5e−5 , reduced to 5e−6 after 100 epochs.\n\nM.4\n\nAD on CIFAR-10 and GTSDB\n\nFor CIFAR-10, previous work used 80 Mio. Tiny Images as OE (Hendrycks et al. 2019). However, since 80 Mio. Tiny Images\nhas officially been withdrawn due to offensive data, we instead use the disjunct CIFAR-100 dataset as OE. We found that\nthis does not cause a significant drop of performance. Again, we use a slight variation of the AD network used on MNIST.\nWe remove the last convolutional layer and change the number of kernels for the convolutional layers to 32, 64, and 128,\nrespectively. The fully connected layers have 512 and 256 units instead.\nWe use Adam for optimization and balance every batch to contain 128 normal and 128 OE samples during training. We train\nthe AD model for 200 epochs starting with a learning rate of 1e−3 , which we reduce by a factor of 0.1 after 100 and 150 epochs.\nWe use the same setup for GTSDB.\n\nM.5\n\nAD on ImageNet-Neighbors\n\nFor ImageNet-Neighbors (INN), we use the disjoint ImageNet-21k as OE and the same WideResNet architecture as in\n(Hendrycks et al. 2019; Liznerski et al. 2022). We use Adam for optimization and balance every batch to contain 64 normal and 64 OE samples during training. We train the AD model for 150 epochs starting with a learning rate of 1e−3 , which we\nreduce by a factor of 0.1 after 100 and 125 epochs.\n\nN\n\nComputing Resources\n\nMost experiments with MNIST, Colored-MNIST, CIFAR-10, and GTSDB were carried out on a NVIDIA DGX-1 server\nequipped with eight V100 GPUs with 32 GB memory each. We here define an experiment as the training and evaluation\nof an anomaly detector and corresponding counterfactual generator for a single random seed and normal class setting. We used\nonly one GPU per experiment and ran the experiments in parallel.\nExecution times varied by dataset: Experiments on Colored-MNIST took approximately 1.5 days each; Each MNIST and\nCIFAR-10 experiment took around 8 hours; and GTSDB experiments required roughly 3 hours. Experiments involving the\n\n\fINN-based method were primarily executed on a NVIDIA DGX A100 server with eight A100 GPUs with 40 GB memory each.\nIn this case, a single INN experiment typically required around ten days to complete.\nInference time for the GAN component is negligible—for example, generating counterfactuals for the entire CIFAR-10 test\nset takes approximately 40 seconds. For the INN dataset, the diffusion-based method generates a set of counterfactuals for a\nsingle test image in about ten seconds.\nAll the durations are approximate and may vary depending on the specific configuration. We did not attempt to run the code\nwithout GPU acceleration, as all experiments were designed with GPU support in mind. Each experiment required less than 32\nGB of main memory and used up to 8 CPU cores. For the full research project, many experiments were repeated multiple times\nduring the method development and prototyping phases. Some datasets, such as ImageNet-1k, require substantial storage space\n(e.g., 300 GB for ImageNet-1k). Additionally, experiment logs can become quite large, often reaching several gigabytes per\nexperiment, especially when the training involves more epochs. This is due to the logging of downscaled intermediate results\nat regular intervals throughout training.\n\nO\n\nFull Quantitative Results per Normal Class\n\nIn the main paper, we presented several objective evaluation techniques to validate the proposed CEs’ performance on MNIST,\nColored-MNIST (C-MNIST), CIFAR-10, GTSDB, and ImageNet-Neighbors (INN) across different definitions of normality.\nFollowing previous work on semantic image-AD (Ruff et al. 2018; Golan and El-Yaniv 2018; Hendrycks, Mazeika, and Dietterich 2019; Hendrycks et al. 2019; Ruff et al. 2020; Tack et al. 2020; Ruff et al. 2021; Liznerski et al. 2021, 2022), we\nturned classification datasets into AD benchmarks by defining a subset of the classes to be normal and using the remainder\nas ground-truth anomalies for testing. If only one class is normal, this approach is termed one vs. rest AD. Apart from investigating one vs. rest, we also explored a variation with multiple classes being normal. For our experiments, we considered\nall classes of MNIST and CIFAR-10 as single normal classes and, to keep the computational load at a reasonable level, a\nsubset of 20 normal class combinations. The class combinations were chosen from {(i, (i + 1) mod 10) |i ∈ {0, . . . , 9}} ∪\n{(i, (i + 2) mod 10) |i ∈ {0, . . . , 9}}. For Colored-MNIST, we considered all combinations of color and the digit one as normal. For GTSDB, we considered the following combination of street signs as normal: all four combinations of speed limit signs,\nthe “give way” and stop sign, and the “danger” and “construction” warning sign. Additionally, we considered four larger sets\nof normal classes: all “restriction ends” signs, all speed limit signs, all blue signs, and all warning signs. In total, we consider\nten different scenarios of normal definitions for GTSDB.\nWe introduced ImageNet-Neighbors (INN), which is a subset of ImageNet-1K. As before, we define an AD setup by considering one of the classes normal. However, instead of using the entire remainder as ground-truth test anomalies, we choose\nonly the ten most similar classes, based on the Wu-Palmer similarity metric (Wu and Palmer 1994), as test anomalies. This\nAD setup becomes harder as compared to the usual one vs. rest AD setup (Hendrycks, Mazeika, and Dietterich 2019), as the\nanomalies are more similar to the normal class and thus harder to detect, especially in an unsupervised manner. In this paper,\nwe consider five different AD setups for INN. (1) An airliner is normal with airship, wreck, warplane, balloon, monocycle,\nfireboat, schooner, space shuttle, pirate ship, and gondola as test anomalies. (2) An ambulance is normal with limousine, taxi,\nwaggon, racing car, minivan, jeep, sports car, golf cart, Model T, and convertible as test anomalies. (3) A black widow (spider)\nis normal with centipede, trilobite, wolf spider, garden spider, barn spider, harvestman, scorpion, black and gold garden spider,\ntarantula, and tick as test anomalies. (4) A lion is normal with cougar, cheetah, jaguar, tiger cat, leopard, snow leopard, lynx,\ntiger, tabby cat, and Siamese cat as test anomalies. (5) A zebra is normal with sorrel, llama, warthog, boar, hamster, armadillo,\nhog, beaver, Arabian camel, and hippo as test anomalies.\nFor each scenario on each dataset, a new AD model and counterfactual generator was trained for four random seeds. We\nreported quantitative results averaged over all normal definitions in the main paper. Here, we report results averaged over four\nrandom seeds separately for each normal definition. We consider the following metrics:\n• The AD AuROC (Appendix G) is the AuROC of normal vs. anomalous test samples, thereby measuring the AD performance\nof the AD model. 50% is random, 100% indicates optimal separation.\n• The CF AuROC (Section 5.2) is the AuROC of normal test samples vs. counterfactuals. The counterfactuals appear entirely\nnormal for an AuROC ≤ 50%.\n• The Sub. AuROC is the AuROC of normal vs. anomalous test samples when the AD is trained with counterfactuals in place\nof the normal training set.\n• The F IDN (Section 5.2) denotes the normalized FID scores. 0% indicates that the counterfactuals follow the same feature distribution as normal samples, 100% as anomalies, which are also realistic, and above 100% indicates less realistic\ncounterfactuals.\n• The Concept Acc (Appendix E) is the accuracy of the concept classifier. A 100% accuracy indicates optimal disentanglement\nof the concepts.\n• The “Score distance”, which is the L1 distance between the average anomaly score of normal and anomalous test samples.\n\n\fTables 7, 8, and 9 show results for MNIST and single normal classes for BCE, HSC, and DSVDD, respectively. In Tables 12,\n13, and 14, we instead report results for CIFAR-10 and single normal classes for BCE, HSC, and DSVDD, respectively. Tables\n15, 16, and 17 show results for Colored-MNIST (here abbreviated as C-MNIST) for BCE, HSC, and DSVDD, respectively.\nTables 18, 19, and 20 show results for GTSDB and combined normal classes for BCE, HSC, and DSVDD, respectively. Tables\n21, 22, and 23 show results for MNIST and combined normal classes for BCE, HSC, and DSVDD, respectively. Tables 24, 25,\nand 26 show results for CIFAR-10 and combined normal classes for BCE, HSC, and DSVDD, respectively. Tables 10 and 11\nshow results for ImageNet-Neighbors and single normal classes for BCE and HSC, respectively.\n\nTable 7: AD and explanation performance averaged over 4 random seeds on MNIST for BCE (OE). Each row shows results for\na different normal definition.\nAD\nScore distance\n\nNormal\n\nAuROC\n\nzero\none\ntwo\nthree\nfour\nfive\nsix\nseven\neight\nnine\n\n0.99 ± 0.0010\n1.00 ± 0.0005\n0.97 ± 0.0083\n0.99 ± 0.0018\n0.97 ± 0.0090\n0.97 ± 0.0058\n1.00 ± 0.0010\n0.96 ± 0.0107\n0.95 ± 0.0102\n0.96 ± 0.0092\n\nmean\n\n0.98 ± 0.0154\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\n0.78 ± 0.0079\n0.87 ± 0.0155\n0.69 ± 0.0379\n0.67 ± 0.0286\n0.75 ± 0.0359\n0.65 ± 0.0398\n0.90 ± 0.0106\n0.71 ± 0.0275\n0.54 ± 0.0337\n0.60 ± 0.0329\n\n0.76 ± 0.0684\n0.66 ± 0.0977\n0.75 ± 0.0253\n0.77 ± 0.0242\n0.70 ± 0.0787\n0.66 ± 0.0076\n0.71 ± 0.0527\n0.70 ± 0.0519\n0.72 ± 0.0817\n0.77 ± 0.0147\n\n0.93 ± 0.0104\n0.97 ± 0.0107\n0.85 ± 0.0183\n0.94 ± 0.0073\n0.88 ± 0.0457\n0.84 ± 0.0184\n0.98 ± 0.0066\n0.92 ± 0.0133\n0.87 ± 0.0054\n0.94 ± 0.0080\n\n0.42 ± 0.0366\n0.47 ± 0.4474\n0.56 ± 0.0431\n0.33 ± 0.0392\n0.48 ± 0.0954\n0.44 ± 0.0405\n0.33 ± 0.0348\n0.50 ± 0.0464\n0.31 ± 0.0271\n0.47 ± 0.0593\n\n0.97 ± 0.0360\n0.99 ± 0.0082\n0.87 ± 0.0505\n0.89 ± 0.0834\n0.91 ± 0.0563\n0.98 ± 0.0252\n0.96 ± 0.0359\n0.96 ± 0.0281\n0.94 ± 0.0794\n0.97 ± 0.0189\n\n0.72 ± 0.1067\n\n0.72 ± 0.0400\n\n0.91 ± 0.0456\n\n0.43 ± 0.0808\n\n0.94 ± 0.0385\n\nTable 8: AD and explanation performance averaged over 4 random seeds on MNIST for HSC (OE). Each row shows results for\na different normal definition.\nAD\nScore distance\n\nNormal\n\nAuROC\n\nzero\none\ntwo\nthree\nfour\nfive\nsix\nseven\neight\nnine\n\n0.99 ± 0.0011\n1.00 ± 0.0011\n0.98 ± 0.0013\n0.98 ± 0.0056\n0.96 ± 0.0038\n0.96 ± 0.0054\n1.00 ± 0.0010\n0.97 ± 0.0052\n0.95 ± 0.0069\n0.97 ± 0.0043\n\nmean\n\n0.98 ± 0.0157\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\n0.81 ± 0.0306\n0.89 ± 0.0231\n0.72 ± 0.0338\n0.67 ± 0.0166\n0.73 ± 0.0269\n0.62 ± 0.0334\n0.88 ± 0.0211\n0.71 ± 0.0066\n0.52 ± 0.0334\n0.59 ± 0.0192\n\n0.84 ± 0.0772\n0.88 ± 0.0783\n0.77 ± 0.0332\n0.82 ± 0.0717\n0.80 ± 0.0658\n0.83 ± 0.0603\n0.77 ± 0.0607\n0.70 ± 0.0319\n0.89 ± 0.0278\n0.80 ± 0.0227\n\n0.91 ± 0.0101\n0.95 ± 0.0089\n0.77 ± 0.0438\n0.85 ± 0.0209\n0.84 ± 0.0394\n0.70 ± 0.1316\n0.98 ± 0.0076\n0.92 ± 0.0112\n0.73 ± 0.0590\n0.92 ± 0.0031\n\n0.58 ± 0.1412\n0.60 ± 0.3820\n0.80 ± 0.3295\n0.48 ± 0.2057\n0.83 ± 0.2911\n0.77 ± 0.1088\n0.84 ± 0.3493\n0.52 ± 0.0301\n0.88 ± 0.3052\n0.53 ± 0.0739\n\n0.98 ± 0.0106\n0.90 ± 0.0868\n0.92 ± 0.0575\n0.83 ± 0.1941\n0.81 ± 0.1526\n0.92 ± 0.1010\n0.95 ± 0.0547\n0.91 ± 0.0675\n0.94 ± 0.0739\n0.91 ± 0.0512\n\n0.72 ± 0.1156\n\n0.81 ± 0.0526\n\n0.86 ± 0.0919\n\n0.68 ± 0.1464\n\n0.91 ± 0.0478\n\n\fTable 9: AD and explanation performance averaged over 4 random seeds on MNIST for DSVDD. Each row shows results for\na different normal definition.\nAD\nScore distance\n\nNormal\n\nAuROC\n\nzero\none\ntwo\nthree\nfour\nfive\nsix\nseven\neight\nnine\n\n0.82 ± 0.0685\n1.00 ± 0.0020\n0.72 ± 0.1254\n0.72 ± 0.0274\n0.72 ± 0.0517\n0.73 ± 0.0316\n0.83 ± 0.0964\n0.84 ± 0.0450\n0.70 ± 0.0359\n0.81 ± 0.0331\n\nmean\n\n0.79 ± 0.0865\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\n0.01 ± 0.0038\n0.05 ± 0.0086\n0.01 ± 0.0057\n0.00 ± 0.0036\n0.01 ± 0.0040\n0.01 ± 0.0050\n0.01 ± 0.0126\n0.01 ± 0.0135\n0.00 ± 0.0007\n0.01 ± 0.0056\n\n0.76 ± 0.0870\n0.99 ± 0.0054\n0.69 ± 0.1664\n0.70 ± 0.0545\n0.65 ± 0.0669\n0.71 ± 0.0562\n0.80 ± 0.1238\n0.80 ± 0.0533\n0.69 ± 0.0440\n0.74 ± 0.0568\n\n0.41 ± 0.0680\n0.76 ± 0.1219\n0.34 ± 0.0203\n0.42 ± 0.0527\n0.46 ± 0.0180\n0.44 ± 0.0632\n0.44 ± 0.0466\n0.46 ± 0.0858\n0.46 ± 0.0792\n0.44 ± 0.0599\n\n1.16 ± 0.5100\n1.02 ± 0.0600\n0.89 ± 0.0117\n0.90 ± 0.0234\n0.88 ± 0.1156\n0.97 ± 0.0869\n1.08 ± 0.0339\n1.04 ± 0.0408\n0.99 ± 0.0775\n1.09 ± 0.0822\n\n0.96 ± 0.0467\n0.84 ± 0.1254\n0.49 ± 0.1150\n0.59 ± 0.1276\n0.80 ± 0.1840\n0.87 ± 0.1221\n0.84 ± 0.1877\n0.88 ± 0.0291\n0.82 ± 0.0962\n0.65 ± 0.3127\n\n0.01 ± 0.0119\n\n0.75 ± 0.0916\n\n0.46 ± 0.1050\n\n1.00 ± 0.0876\n\n0.78 ± 0.1410\n\nTable 10: AD and explanation performance averaged over 2 random seeds on ImageNet-Neighbors for BCE (OE). Each row\nshows results for a different normal definition.\nAD\nAuROC\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\nairliner\nambulance\nblack widow\nlion\nzebra\n\n96.63 ± 0.22\n98.23 ± 0.03\n90.31 ± 0.41\n84.00 ± 0.07\n98.97 ± 0.02\n\n76.32 ± 0.82\n83.91 ± 2.48\n68.64 ± 4.25\n34.38 ± 1.10\n82.16 ± 0.65\n\n65.01 ± 4.57\n63.52 ± 4.41\n56.22 ± 5.19\n61.97 ± 0.11\n49.16 ± 8.66\n\n95.75 ± 9.65\n105.45 ± 4.33\n100.86 ± 20.66\n94.49 ± 7.87\n28.29 ± 0.43\n\n99.70 ± 0.20\n99.85 ± 0.15\n86.20 ± 11.40\n100.00 ± 0.00\n99.00 ± 0.70\n\nmean\n\n93.63 ± 5.70\n\n69.08 ± 18.15\n\n59.18 ± 5.83\n\n84.97 ± 28.61\n\n96.95 ± 5.39\n\nNormal\n\nTable 11: AD and explanation performance averaged over 2 random seeds on ImageNet-Neighbors for HSC (OE). Each row\nshows results for a different normal definition.\nAD\nAuROC\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\nairliner\nambulance\nblack widow\nlion\nzebra\n\n96.70 ± 0.04\n97.82 ± 0.01\n88.20 ± 0.20\n81.35 ± 0.74\n98.78 ± 0.02\n\n83.04 ± 0.32\n83.42 ± 0.67\n59.68 ± 0.52\n49.83 ± 7.35\n63.84 ± 3.86\n\n37.43 ± 0.32\n51.84 ± 17.77\n55.09 ± 1.12\n49.20 ± 5.02\n71.63 ± 1.02\n\n80.26 ± 2.12\n104.30 ± 2.86\n120.69 ± 10.51\n70.58 ± 11.86\n51.17 ± 6.16\n\n97.30 ± 2.10\n99.95 ± 0.05\n99.60 ± 0.40\n97.85 ± 1.85\n99.70 ± 0.31\n\nmean\n\n92.57 ± 6.76\n\n67.96 ± 13.27\n\n53.04 ± 11.04\n\n85.40 ± 24.58\n\n98.88 ± 1.09\n\nNormal\n\n\fTable 12: AD and explanation performance averaged over 4 random seeds on CIFAR-10 for BCE OE. Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\nairplane\nautomobile\nbird\ncat\ndeer\ndog\nfrog\nhorse\nship\ntruck\n\n0.96 ± 0.0009\n0.99 ± 0.0005\n0.93 ± 0.0030\n0.91 ± 0.0035\n0.96 ± 0.0020\n0.94 ± 0.0013\n0.98 ± 0.0011\n0.98 ± 0.0006\n0.98 ± 0.0002\n0.97 ± 0.0018\n\n0.78 ± 0.0083\n0.87 ± 0.0026\n0.65 ± 0.0020\n0.55 ± 0.0127\n0.74 ± 0.0043\n0.64 ± 0.0051\n0.79 ± 0.0067\n0.82 ± 0.0060\n0.85 ± 0.0032\n0.78 ± 0.0080\n\n0.47 ± 0.0372\n0.62 ± 0.0540\n0.42 ± 0.0378\n0.30 ± 0.0054\n0.40 ± 0.0209\n0.36 ± 0.0061\n0.50 ± 0.0247\n0.59 ± 0.0303\n0.55 ± 0.0098\n0.54 ± 0.0602\n\n0.65 ± 0.0322\n0.62 ± 0.0347\n0.53 ± 0.0138\n0.53 ± 0.0159\n0.53 ± 0.0103\n0.57 ± 0.0134\n0.54 ± 0.0127\n0.64 ± 0.0213\n0.72 ± 0.0300\n0.56 ± 0.0242\n\n1.48 ± 0.1439\n1.08 ± 0.0582\n1.42 ± 0.0777\n1.37 ± 0.0773\n1.09 ± 0.1095\n1.23 ± 0.0777\n0.80 ± 0.0652\n1.21 ± 0.1013\n0.93 ± 0.0810\n1.03 ± 0.1231\n\n0.93 ± 0.0659\n0.92 ± 0.0757\n0.99 ± 0.0069\n0.91 ± 0.1449\n0.99 ± 0.0151\n0.93 ± 0.1008\n0.88 ± 0.1341\n0.99 ± 0.0107\n0.89 ± 0.0760\n0.88 ± 0.2031\n\nmean\n\n0.96 ± 0.0252\n\n0.75 ± 0.0964\n\n0.47 ± 0.1000\n\n0.59 ± 0.0610\n\n1.16 ± 0.2078\n\n0.93 ± 0.0429\n\nTable 13: AD and explanation performance averaged over 4 random seeds on CIFAR-10 for HSC OE. Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\nairplane\nautomobile\nbird\ncat\ndeer\ndog\nfrog\nhorse\nship\ntruck\n\n0.96 ± 0.0012\n0.99 ± 0.0005\n0.93 ± 0.0015\n0.90 ± 0.0020\n0.96 ± 0.0007\n0.95 ± 0.0012\n0.98 ± 0.0004\n0.98 ± 0.0008\n0.98 ± 0.0003\n0.97 ± 0.0011\n\n0.75 ± 0.0056\n0.85 ± 0.0030\n0.62 ± 0.0018\n0.53 ± 0.0072\n0.71 ± 0.0040\n0.65 ± 0.0047\n0.77 ± 0.0043\n0.79 ± 0.0040\n0.83 ± 0.0027\n0.77 ± 0.0055\n\n0.51 ± 0.0754\n0.58 ± 0.0152\n0.46 ± 0.0293\n0.43 ± 0.0255\n0.51 ± 0.0121\n0.46 ± 0.0317\n0.52 ± 0.0062\n0.54 ± 0.0466\n0.48 ± 0.0257\n0.51 ± 0.0257\n\n0.52 ± 0.0111\n0.59 ± 0.0129\n0.52 ± 0.0149\n0.52 ± 0.0088\n0.57 ± 0.0230\n0.53 ± 0.0257\n0.57 ± 0.0569\n0.54 ± 0.0281\n0.56 ± 0.0316\n0.57 ± 0.0623\n\n2.95 ± 0.1509\n1.71 ± 0.1914\n4.81 ± 0.2365\n3.98 ± 0.4753\n3.45 ± 0.3143\n3.09 ± 0.2897\n2.92 ± 0.4138\n3.13 ± 0.0463\n1.86 ± 0.5187\n2.19 ± 0.1318\n\n0.89 ± 0.0873\n0.99 ± 0.0054\n1.00 ± 0.0007\n1.00 ± 0.0009\n1.00 ± 0.0000\n1.00 ± 0.0023\n1.00 ± 0.0009\n1.00 ± 0.0001\n1.00 ± 0.0032\n1.00 ± 0.0010\n\nmean\n\n0.96 ± 0.0254\n\n0.73 ± 0.0939\n\n0.50 ± 0.0438\n\n0.55 ± 0.0259\n\n3.01 ± 0.8998\n\n0.99 ± 0.0325\n\nTable 14: AD and explanation performance averaged over 4 random seeds on CIFAR-10 for DSVDD. Each row shows results\nfor a different normal definition.\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\nairplane\nautomobile\nbird\ncat\ndeer\ndog\nfrog\nhorse\nship\ntruck\n\n0.48 ± 0.0952\n0.51 ± 0.0339\n0.54 ± 0.0375\n0.52 ± 0.0216\n0.65 ± 0.0312\n0.53 ± 0.0259\n0.60 ± 0.0692\n0.56 ± 0.0253\n0.57 ± 0.0543\n0.58 ± 0.0673\n\n-0.00 ± 0.0022\n0.00 ± 0.0003\n0.00 ± 0.0005\n0.00 ± 0.0008\n0.01 ± 0.0030\n0.00 ± 0.0030\n0.01 ± 0.0027\n0.00 ± 0.0025\n0.00 ± 0.0010\n0.00 ± 0.0008\n\n0.54 ± 0.0733\n0.52 ± 0.0606\n0.52 ± 0.0601\n0.51 ± 0.0513\n0.62 ± 0.0996\n0.51 ± 0.0296\n0.54 ± 0.0371\n0.53 ± 0.0281\n0.58 ± 0.0350\n0.58 ± 0.0470\n\n0.45 ± 0.0265\n0.49 ± 0.0198\n0.51 ± 0.0133\n0.50 ± 0.0260\n0.53 ± 0.0611\n0.50 ± 0.0195\n0.57 ± 0.0747\n0.51 ± 0.0143\n0.53 ± 0.0561\n0.48 ± 0.0224\n\n1.28 ± 0.0382\n1.15 ± 0.0266\n1.23 ± 0.0548\n1.38 ± 0.1380\n1.12 ± 0.0467\n1.21 ± 0.0830\n0.99 ± 0.0550\n1.21 ± 0.0094\n0.97 ± 0.0611\n1.10 ± 0.0258\n\n0.98 ± 0.0114\n0.99 ± 0.0076\n0.91 ± 0.1548\n0.98 ± 0.0221\n1.00 ± 0.0028\n0.96 ± 0.0523\n0.99 ± 0.0074\n1.00 ± 0.0037\n0.93 ± 0.0758\n0.97 ± 0.0417\n\nmean\n\n0.55 ± 0.0473\n\n0.00 ± 0.0022\n\n0.55 ± 0.0336\n\n0.51 ± 0.0315\n\n1.16 ± 0.1195\n\n0.97 ± 0.0287\n\nNormal\n\n\fTable 15: AD and explanation performance averaged over 4 random seeds on C-MNIST for BCE (OE). Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\ngray+one\nyellow+one\ncyan+one\ngreen+one\nblue+one\npink+one\nred+one\n\n0.96 ± 0.0037\n0.97 ± 0.0027\n0.96 ± 0.0138\n0.99 ± 0.0044\n0.98 ± 0.0034\n0.97 ± 0.0021\n0.98 ± 0.0031\n\n0.17 ± 0.0127\n0.24 ± 0.0129\n0.19 ± 0.0373\n0.49 ± 0.0546\n0.48 ± 0.0110\n0.25 ± 0.0193\n0.42 ± 0.0364\n\n0.55 ± 0.1105\n0.56 ± 0.0252\n0.54 ± 0.0410\n0.58 ± 0.0457\n0.55 ± 0.0075\n0.57 ± 0.0279\n0.54 ± 0.1100\n\n0.75 ± 0.0429\n0.74 ± 0.0082\n0.83 ± 0.0180\n0.80 ± 0.0676\n0.81 ± 0.0640\n0.88 ± 0.0127\n0.83 ± 0.0938\n\n0.75 ± 0.3352\n0.60 ± 0.1572\n0.38 ± 0.0340\n0.60 ± 0.2606\n0.52 ± 0.1925\n0.43 ± 0.0647\n0.69 ± 0.4817\n\n0.96 ± 0.0327\n1.00 ± 0.0001\n1.00 ± 0.0007\n1.00 ± 0.0001\n1.00 ± 0.0002\n1.00 ± 0.0003\n1.00 ± 0.0015\n\nmean\n\n0.97 ± 0.0101\n\n0.32 ± 0.1265\n\n0.56 ± 0.0154\n\n0.81 ± 0.0451\n\n0.57 ± 0.1240\n\n0.99 ± 0.0132\n\nTable 16: AD and explanation performance averaged over 4 random seeds on C-MNIST for HSC (OE). Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\ngray+one\nyellow+one\ncyan+one\ngreen+one\nblue+one\npink+one\nred+one\n\n0.92 ± 0.0075\n0.94 ± 0.0251\n0.97 ± 0.0196\n0.98 ± 0.0139\n0.99 ± 0.0028\n0.94 ± 0.0139\n0.98 ± 0.0031\n\n0.27 ± 0.0410\n0.43 ± 0.0509\n0.39 ± 0.0630\n0.52 ± 0.0258\n0.65 ± 0.0159\n0.38 ± 0.0323\n0.60 ± 0.0127\n\n0.51 ± 0.0486\n0.54 ± 0.0615\n0.56 ± 0.0296\n0.56 ± 0.0323\n0.66 ± 0.0896\n0.52 ± 0.0751\n0.57 ± 0.0244\n\n0.76 ± 0.0457\n0.82 ± 0.0081\n0.88 ± 0.0462\n0.89 ± 0.0102\n0.75 ± 0.1384\n0.83 ± 0.0339\n0.78 ± 0.0674\n\n0.86 ± 0.1567\n0.82 ± 0.2713\n0.63 ± 0.2201\n0.94 ± 0.2280\n1.66 ± 1.1219\n0.83 ± 0.0292\n0.93 ± 0.3331\n\n0.99 ± 0.0136\n1.00 ± 0.0020\n1.00 ± 0.0000\n1.00 ± 0.0005\n0.94 ± 0.0834\n1.00 ± 0.0015\n1.00 ± 0.0055\n\nmean\n\n0.96 ± 0.0231\n\n0.46 ± 0.1226\n\n0.56 ± 0.0472\n\n0.82 ± 0.0482\n\n0.95 ± 0.3047\n\n0.99 ± 0.0198\n\nTable 17: AD and explanation performance averaged over 4 random seeds on C-MNIST for DSVDD. Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\ngray+one\nyellow+one\ncyan+one\ngreen+one\nblue+one\npink+one\nred+one\n\n0.73 ± 0.0350\n0.86 ± 0.0262\n0.83 ± 0.0866\n0.64 ± 0.1336\n0.78 ± 0.1502\n0.75 ± 0.1343\n0.79 ± 0.0424\n\n0.00 ± 0.0001\n0.00 ± 0.0010\n0.00 ± 0.0005\n0.00 ± 0.0003\n0.00 ± 0.0001\n0.00 ± 0.0001\n0.00 ± 0.0004\n\n0.56 ± 0.0449\n0.60 ± 0.0595\n0.61 ± 0.0781\n0.57 ± 0.0250\n0.68 ± 0.2173\n0.67 ± 0.1040\n0.62 ± 0.0917\n\n0.71 ± 0.0755\n0.65 ± 0.0639\n0.63 ± 0.0589\n0.60 ± 0.0755\n0.42 ± 0.1223\n0.61 ± 0.0999\n0.57 ± 0.1607\n\n0.85 ± 0.2079\n0.82 ± 0.2240\n0.79 ± 0.0524\n0.69 ± 0.0350\n1.01 ± 0.1866\n0.85 ± 0.0998\n0.81 ± 0.1763\n\n0.91 ± 0.0834\n1.00 ± 0.0044\n0.99 ± 0.0057\n1.00 ± 0.0019\n1.00 ± 0.0016\n0.97 ± 0.0214\n0.99 ± 0.0149\n\nmean\n\n0.77 ± 0.0650\n\n0.00 ± 0.0003\n\n0.61 ± 0.0430\n\n0.60 ± 0.0841\n\n0.83 ± 0.0875\n\n0.98 ± 0.0297\n\n\fTable 18: AD and explanation performance averaged over 4 random seeds on GTSDB for BCE OE. Each row shows results for\na different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\nspeed limit 30 + 50\n0.92 ± 0.0037\nspeed limit 50 + 70\n0.88 ± 0.0151\nspeed limit 70 + 100\n0.88 ± 0.0053\nspeed limit 100 + 120\n0.89 ± 0.0200\ngive way + stop\n0.99 ± 0.0021\ndanger + construction warning 0.93 ± 0.0078\nall restriction ends signs\n1.00 ± 0.0029\nall speed limit signs\n0.99 ± 0.0016\nall blue signs\n1.00 ± 0.0023\nall warning signs\n0.96 ± 0.0089\n\n0.65 ± 0.0103\n0.59 ± 0.0188\n0.57 ± 0.0048\n0.55 ± 0.0409\n0.89 ± 0.0131\n0.73 ± 0.0072\n0.90 ± 0.0167\n0.79 ± 0.0226\n0.93 ± 0.0131\n0.89 ± 0.0132\n\n0.51 ± 0.0563 0.88 ± 0.0158 0.77 ± 0.3590\n0.49 ± 0.0576 0.86 ± 0.0066 0.69 ± 0.3249\n0.55 ± 0.0708 0.89 ± 0.0136 0.42 ± 0.1348\n0.49 ± 0.1331 0.87 ± 0.0297 0.51 ± 0.0854\n0.66 ± 0.0758 0.81 ± 0.1369 2.29 ± 0.4255\n0.43 ± 0.0799 0.91 ± 0.0155 3.60 ± 0.5202\n0.56 ± 0.1341 1.00 ± 0.0033 0.24 ± 0.1129\n0.54 ± 0.0172 0.96 ± 0.0085 0.41 ± 0.0870\n0.40 ± 0.0381 0.90 ± 0.0258 0.64 ± 0.1553\n0.38 ± 0.0343 0.95 ± 0.0035 1.51 ± 0.5426\n\n1.00 ± 0.0018\n0.99 ± 0.0080\n0.99 ± 0.0130\n0.99 ± 0.0115\n0.99 ± 0.0184\n1.00 ± 0.0040\n0.97 ± 0.0183\n0.99 ± 0.0134\n0.98 ± 0.0109\n0.99 ± 0.0076\n\n0.94 ± 0.0474\n\n0.75 ± 0.1437\n\n0.50 ± 0.0803\n\n0.99 ± 0.0085\n\nmean\n\n0.90 ± 0.0526\n\n1.11 ± 1.0182\n\nTable 19: AD and explanation performance averaged over 4 random seeds on GTSDB for HSC OE. Each row shows results for\na different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n0.96 ± 0.0420\n1.00 ± 0.0000\n0.91 ± 0.0807\n0.95 ± 0.0613\n0.70 ± 0.0922\n0.97 ± 0.0210\n0.94 ± 0.0221\n0.97 ± 0.0469\n1.00 ± 0.0023\n1.00 ± 0.0036\n\nspeed limit 30 + 50\nspeed limit 50 + 70\nspeed limit 70 + 100\nspeed limit 100 + 120\ngive way + stop\ndanger + construction warning\nall restriction ends signs\nall speed limit signs\nall blue signs\nall warning signs\n\n0.88 ± 0.0014\n0.89 ± 0.0111\n0.86 ± 0.0164\n0.85 ± 0.0112\n0.98 ± 0.0056\n0.91 ± 0.0099\n1.00 ± 0.0000\n0.96 ± 0.0174\n1.00 ± 0.0011\n0.97 ± 0.0042\n\n0.63 ± 0.0126\n0.57 ± 0.0170\n0.56 ± 0.0146\n0.50 ± 0.0132\n0.81 ± 0.0415\n0.68 ± 0.0121\n0.93 ± 0.0127\n0.79 ± 0.0075\n0.94 ± 0.0165\n0.86 ± 0.0182\n\n0.31 ± 0.1032\n0.49 ± 0.1537\n0.60 ± 0.1389\n0.66 ± 0.0952\n0.70 ± 0.1508\n0.32 ± 0.0889\n0.60 ± 0.0791\n0.51 ± 0.0419\n0.34 ± 0.0640\n0.33 ± 0.0692\n\n0.88 ± 0.0113\n0.85 ± 0.0135\n0.85 ± 0.0379\n0.86 ± 0.0172\n0.83 ± 0.0929\n0.90 ± 0.0137\n1.00 ± 0.0039\n0.95 ± 0.0175\n0.91 ± 0.0224\n0.96 ± 0.0061\n\n0.79 ± 0.2196\n1.45 ± 0.6565\n0.69 ± 0.4033\n0.59 ± 0.2818\n1.00 ± 0.1991\n2.82 ± 0.2851\n0.21 ± 0.0519\n0.29 ± 0.0730\n0.38 ± 0.0667\n1.31 ± 0.2118\n\nmean\n\n0.93 ± 0.0563\n\n0.73 ± 0.1517\n\n0.49 ± 0.1439\n\n0.90 ± 0.0508\n\n0.95 ± 0.7345 0.94 ± 0.0840\n\nTable 20: AD and explanation performance averaged over 4 random seeds on GTSDB for DSVDD. Each row shows results for\na different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n0.95 ± 0.0439\n0.87 ± 0.1167\n0.92 ± 0.0376\n0.95 ± 0.0302\n0.98 ± 0.0138\n0.90 ± 0.1063\n0.94 ± 0.0273\n0.98 ± 0.0182\n0.86 ± 0.0565\n1.00 ± 0.0034\n\nspeed limit 30 + 50\nspeed limit 50 + 70\nspeed limit 70 + 100\nspeed limit 100 + 120\ngive way + stop\ndanger + construction warning\nall restriction ends signs\nall speed limit signs\nall blue signs\nall warning signs\n\n0.53 ± 0.0718\n0.55 ± 0.0487\n0.56 ± 0.0433\n0.61 ± 0.0497\n0.49 ± 0.0673\n0.61 ± 0.0429\n0.70 ± 0.0860\n0.69 ± 0.0473\n0.51 ± 0.1008\n0.56 ± 0.0242\n\n0.06 ± 0.0214\n0.07 ± 0.0640\n0.02 ± 0.0108\n0.04 ± 0.0171\n0.00 ± 0.0150\n0.02 ± 0.0049\n0.06 ± 0.0450\n0.05 ± 0.0095\n0.02 ± 0.0161\n0.01 ± 0.0087\n\n0.56 ± 0.0583\n0.60 ± 0.1042\n0.53 ± 0.1288\n0.53 ± 0.0625\n0.46 ± 0.0981\n0.59 ± 0.0402\n0.53 ± 0.1242\n0.57 ± 0.0533\n0.49 ± 0.0985\n0.46 ± 0.0616\n\n0.57 ± 0.0240\n0.57 ± 0.0485\n0.63 ± 0.0291\n0.64 ± 0.0488\n0.49 ± 0.0725\n0.47 ± 0.0348\n0.69 ± 0.0862\n0.64 ± 0.0145\n0.64 ± 0.0117\n0.51 ± 0.0484\n\n1.07 ± 0.4804\n3.59 ± 3.8551\n0.34 ± 0.0187\n0.28 ± 0.0315\n1.88 ± 0.5662\n3.04 ± 0.3589\n0.26 ± 0.1251\n0.51 ± 0.1984\n0.20 ± 0.0484\n1.93 ± 0.5590\n\nmean\n\n0.58 ± 0.0668\n\n0.04 ± 0.0233\n\n0.53 ± 0.0478\n\n0.58 ± 0.0699\n\n1.31 ± 1.1807 0.93 ± 0.0453\n\n\fTable 21: AD and explanation performance averaged over 4 random seeds on MNIST for BCE (OE). Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\nzero+one\nzero+two\none+two\none+three\ntwo+three\ntwo+four\nthree+four\nthree+five\nfour+five\nfour+six\nfive+six\nfive+seven\nsix+seven\nsix+eight\nseven+eight\nseven+nine\neight+nine\neight+zero\nnine+zero\nnine+one\n\n0.97 ± 0.0062\n0.95 ± 0.0129\n0.94 ± 0.0188\n0.95 ± 0.0097\n0.97 ± 0.0095\n0.89 ± 0.0196\n0.91 ± 0.0070\n0.95 ± 0.0058\n0.90 ± 0.0259\n0.95 ± 0.0052\n0.97 ± 0.0063\n0.88 ± 0.0228\n0.94 ± 0.0143\n0.95 ± 0.0145\n0.87 ± 0.0208\n0.95 ± 0.0209\n0.93 ± 0.0189\n0.93 ± 0.0100\n0.95 ± 0.0047\n0.93 ± 0.0157\n\n0.51 ± 0.0596\n0.44 ± 0.0694\n0.46 ± 0.0688\n0.45 ± 0.0222\n0.56 ± 0.0667\n0.35 ± 0.0551\n0.33 ± 0.0250\n0.48 ± 0.0487\n0.30 ± 0.0148\n0.57 ± 0.0364\n0.60 ± 0.0319\n0.40 ± 0.0453\n0.44 ± 0.0618\n0.45 ± 0.0398\n0.33 ± 0.0300\n0.58 ± 0.0374\n0.42 ± 0.0492\n0.39 ± 0.0219\n0.49 ± 0.0184\n0.39 ± 0.0365\n\n0.79 ± 0.0864\n0.82 ± 0.0696\n0.74 ± 0.0251\n0.70 ± 0.0433\n0.76 ± 0.0720\n0.75 ± 0.0415\n0.81 ± 0.0290\n0.74 ± 0.0213\n0.83 ± 0.0474\n0.77 ± 0.0333\n0.82 ± 0.0672\n0.76 ± 0.0546\n0.85 ± 0.0437\n0.81 ± 0.0474\n0.73 ± 0.0562\n0.77 ± 0.0628\n0.80 ± 0.0483\n0.77 ± 0.0908\n0.85 ± 0.0398\n0.73 ± 0.0944\n\n0.45 ± 0.0944\n0.59 ± 0.0292\n0.40 ± 0.0411\n0.56 ± 0.0241\n0.79 ± 0.0188\n0.42 ± 0.0421\n0.58 ± 0.0415\n0.67 ± 0.0515\n0.40 ± 0.0485\n0.63 ± 0.0650\n0.63 ± 0.0514\n0.59 ± 0.0416\n0.66 ± 0.0622\n0.63 ± 0.0608\n0.70 ± 0.0264\n0.88 ± 0.0201\n0.83 ± 0.0144\n0.69 ± 0.0240\n0.77 ± 0.0424\n0.57 ± 0.0461\n\n1.00 ± 0.0674\n0.77 ± 0.0372\n1.25 ± 0.0237\n1.18 ± 0.0250\n0.51 ± 0.0498\n0.83 ± 0.0824\n0.85 ± 0.0359\n0.43 ± 0.0501\n0.92 ± 0.0715\n0.67 ± 0.1253\n0.55 ± 0.0666\n1.02 ± 0.0697\n0.92 ± 0.1281\n0.38 ± 0.0205\n0.90 ± 0.0669\n0.94 ± 0.1804\n0.48 ± 0.0423\n0.46 ± 0.0200\n0.54 ± 0.0610\n1.09 ± 0.0559\n\n0.98 ± 0.0154\n0.95 ± 0.0520\n0.99 ± 0.0101\n0.97 ± 0.0192\n0.99 ± 0.0131\n1.00 ± 0.0017\n0.93 ± 0.0687\n0.95 ± 0.0360\n0.82 ± 0.1926\n0.98 ± 0.0277\n0.91 ± 0.0797\n0.94 ± 0.0361\n0.82 ± 0.1436\n0.96 ± 0.0539\n0.91 ± 0.0795\n0.86 ± 0.1010\n0.93 ± 0.1050\n0.98 ± 0.0177\n0.92 ± 0.0678\n0.97 ± 0.0191\n\nmean\n\n0.93 ± 0.0283\n\n0.45 ± 0.0868\n\n0.78 ± 0.0412\n\n0.62 ± 0.1325\n\n0.78 ± 0.2596\n\n0.94 ± 0.0512\n\nTable 22: AD and explanation performance averaged over 4 random seeds on MNIST for HSC (OE). Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\nzero+one\nzero+two\none+two\none+three\ntwo+three\ntwo+four\nthree+four\nthree+five\nfour+five\nfour+six\nfive+six\nfive+seven\nsix+seven\nsix+eight\nseven+eight\nseven+nine\neight+nine\neight+zero\nnine+zero\nnine+one\n\n0.98 ± 0.0056\n0.95 ± 0.0120\n0.96 ± 0.0061\n0.95 ± 0.0081\n0.95 ± 0.0116\n0.86 ± 0.0132\n0.87 ± 0.0190\n0.93 ± 0.0294\n0.87 ± 0.0160\n0.95 ± 0.0128\n0.95 ± 0.0058\n0.89 ± 0.0022\n0.92 ± 0.0166\n0.94 ± 0.0031\n0.90 ± 0.0090\n0.96 ± 0.0034\n0.93 ± 0.0049\n0.93 ± 0.0075\n0.94 ± 0.0052\n0.95 ± 0.0119\n\n0.53 ± 0.0871\n0.52 ± 0.0508\n0.48 ± 0.0493\n0.51 ± 0.0142\n0.58 ± 0.0371\n0.33 ± 0.0276\n0.34 ± 0.0472\n0.50 ± 0.0450\n0.33 ± 0.0228\n0.55 ± 0.0598\n0.57 ± 0.0471\n0.40 ± 0.0223\n0.43 ± 0.0602\n0.44 ± 0.0373\n0.42 ± 0.0328\n0.63 ± 0.0163\n0.44 ± 0.0268\n0.44 ± 0.0215\n0.48 ± 0.0601\n0.44 ± 0.0212\n\n0.88 ± 0.0450\n0.87 ± 0.0267\n0.83 ± 0.0163\n0.84 ± 0.0519\n0.74 ± 0.0500\n0.77 ± 0.0338\n0.73 ± 0.0515\n0.80 ± 0.0902\n0.86 ± 0.0449\n0.82 ± 0.0360\n0.83 ± 0.0505\n0.83 ± 0.0281\n0.81 ± 0.0535\n0.81 ± 0.0184\n0.78 ± 0.0331\n0.85 ± 0.0637\n0.83 ± 0.0483\n0.83 ± 0.0602\n0.85 ± 0.0379\n0.83 ± 0.0464\n\n0.46 ± 0.0714\n0.39 ± 0.0644\n0.46 ± 0.1134\n0.55 ± 0.0545\n0.59 ± 0.0706\n0.39 ± 0.0131\n0.55 ± 0.0355\n0.54 ± 0.0523\n0.42 ± 0.0571\n0.50 ± 0.1191\n0.54 ± 0.0711\n0.58 ± 0.0241\n0.54 ± 0.0695\n0.51 ± 0.0417\n0.66 ± 0.0287\n0.81 ± 0.0430\n0.69 ± 0.0317\n0.55 ± 0.0547\n0.61 ± 0.0466\n0.60 ± 0.0340\n\n1.13 ± 0.0433\n0.96 ± 0.0884\n1.23 ± 0.0469\n1.24 ± 0.0717\n0.73 ± 0.1404\n0.92 ± 0.0227\n0.87 ± 0.0564\n0.54 ± 0.0908\n1.35 ± 0.4027\n0.82 ± 0.0307\n1.03 ± 0.3435\n1.33 ± 0.2102\n1.02 ± 0.3005\n0.51 ± 0.1461\n1.14 ± 0.0710\n1.17 ± 0.2448\n0.67 ± 0.1301\n0.80 ± 0.4024\n0.65 ± 0.0405\n1.13 ± 0.0206\n\n0.92 ± 0.1256\n0.94 ± 0.0697\n0.95 ± 0.0382\n0.85 ± 0.2038\n0.87 ± 0.1477\n0.98 ± 0.0168\n0.87 ± 0.1123\n0.85 ± 0.1274\n0.58 ± 0.0420\n0.97 ± 0.0223\n0.83 ± 0.0677\n0.80 ± 0.1326\n0.87 ± 0.0852\n0.88 ± 0.0918\n0.91 ± 0.0864\n0.65 ± 0.2011\n0.87 ± 0.1908\n0.85 ± 0.1161\n0.77 ± 0.1480\n0.92 ± 0.0678\n\nmean\n\n0.93 ± 0.0332\n\n0.47 ± 0.0809\n\n0.82 ± 0.0378\n\n0.55 ± 0.0987\n\n0.96 ± 0.2502\n\n0.86 ± 0.0963\n\n\fTable 23: AD and explanation performance averaged over 4 random seeds on MNIST for DSVDD. Each row shows results for\na different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n\nzero+one\nzero+two\none+two\none+three\ntwo+three\ntwo+four\nthree+four\nthree+five\nfour+five\nfour+six\nfive+six\nfive+seven\nsix+seven\nsix+eight\nseven+eight\nseven+nine\neight+nine\neight+zero\nnine+zero\nnine+one\n\n0.93 ± 0.0323\n0.71 ± 0.1290\n0.73 ± 0.0542\n0.77 ± 0.0422\n0.69 ± 0.0508\n0.85 ± 0.0253\n0.77 ± 0.0716\n0.66 ± 0.0275\n0.71 ± 0.1077\n0.81 ± 0.0719\n0.72 ± 0.0814\n0.72 ± 0.0564\n0.84 ± 0.0609\n0.78 ± 0.0681\n0.70 ± 0.0095\n0.74 ± 0.0744\n0.69 ± 0.0688\n0.66 ± 0.0560\n0.72 ± 0.0834\n0.84 ± 0.0555\n\n0.00 ± 0.0018\n0.00 ± 0.0015\n0.00 ± 0.0003\n0.00 ± 0.0002\n0.00 ± 0.0015\n0.00 ± 0.0009\n0.00 ± 0.0015\n0.00 ± 0.0003\n0.00 ± 0.0026\n0.01 ± 0.0037\n0.00 ± 0.0028\n0.00 ± 0.0009\n0.00 ± 0.0015\n0.00 ± 0.0013\n0.00 ± 0.0002\n0.00 ± 0.0020\n0.00 ± 0.0006\n0.00 ± 0.0009\n0.00 ± 0.0016\n0.00 ± 0.0010\n\n0.90 ± 0.0393\n0.70 ± 0.1319\n0.73 ± 0.0648\n0.78 ± 0.0470\n0.67 ± 0.0495\n0.80 ± 0.0380\n0.73 ± 0.0736\n0.66 ± 0.0346\n0.70 ± 0.0907\n0.80 ± 0.0915\n0.70 ± 0.0749\n0.69 ± 0.0281\n0.79 ± 0.0271\n0.75 ± 0.0787\n0.70 ± 0.0046\n0.75 ± 0.0758\n0.68 ± 0.0712\n0.65 ± 0.0630\n0.67 ± 0.1228\n0.85 ± 0.0489\n\n0.57 ± 0.0150\n0.36 ± 0.0439\n0.38 ± 0.0584\n0.43 ± 0.1285\n0.38 ± 0.1011\n0.39 ± 0.0484\n0.46 ± 0.0377\n0.43 ± 0.0459\n0.41 ± 0.0192\n0.37 ± 0.0288\n0.41 ± 0.0568\n0.44 ± 0.0658\n0.41 ± 0.0469\n0.44 ± 0.0241\n0.39 ± 0.0721\n0.38 ± 0.0345\n0.42 ± 0.0329\n0.37 ± 0.0299\n0.46 ± 0.0408\n0.42 ± 0.1575\n\n1.05 ± 0.1323\n0.99 ± 0.0301\n1.16 ± 0.0277\n1.13 ± 0.0103\n0.86 ± 0.0373\n0.75 ± 0.1440\n0.92 ± 0.0610\n0.86 ± 0.0218\n0.98 ± 0.0285\n1.03 ± 0.0127\n0.93 ± 0.0151\n0.96 ± 0.0983\n1.13 ± 0.0494\n0.93 ± 0.1650\n1.12 ± 0.0105\n1.10 ± 0.0419\n0.95 ± 0.1594\n1.05 ± 0.0253\n0.99 ± 0.1008\n1.13 ± 0.0173\n\n0.97 ± 0.0254\n0.54 ± 0.2298\n0.92 ± 0.0666\n0.87 ± 0.1073\n0.81 ± 0.2033\n0.85 ± 0.2204\n0.72 ± 0.2467\n0.76 ± 0.1619\n0.71 ± 0.0798\n0.86 ± 0.1675\n0.73 ± 0.1704\n0.85 ± 0.1442\n0.94 ± 0.0260\n0.79 ± 0.1834\n0.95 ± 0.0364\n0.72 ± 0.1768\n0.97 ± 0.0480\n0.82 ± 0.1814\n0.65 ± 0.3174\n0.91 ± 0.0509\n\nmean\n\n0.75 ± 0.0712\n\n0.00 ± 0.0013\n\n0.73 ± 0.0649\n\n0.42 ± 0.0450\n\n1.00 ± 0.1074\n\n0.82 ± 0.1132\n\nTable 24: AD and explanation performance averaged over 4 random seeds on CIFAR-10 for BCE OE. Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n0.75 ± 0.1067\n0.88 ± 0.1167\n0.73 ± 0.2012\n0.87 ± 0.0738\n0.81 ± 0.1128\n0.97 ± 0.0038\n0.89 ± 0.1547\n0.81 ± 0.1551\n0.93 ± 0.0495\n0.82 ± 0.1905\n0.94 ± 0.0597\n0.89 ± 0.1399\n0.81 ± 0.1722\n0.88 ± 0.0802\n0.97 ± 0.0323\n0.87 ± 0.1812\n0.93 ± 0.1109\n0.97 ± 0.0441\n0.73 ± 0.1478\n0.80 ± 0.1978\n\nairplane+automobile\nairplane+bird\nautomobile+bird\nautomobile+cat\nbird+cat\nbird+deer\ncat+deer\ncat+dog\ndeer+dog\ndeer+frog\ndog+frog\ndog+horse\nfrog+horse\nfrog+ship\nhorse+ship\nhorse+truck\nship+truck\nship+airplane\ntruck+airplane\ntruck+automobile\n\n0.96 ± 0.0024\n0.92 ± 0.0017\n0.93 ± 0.0023\n0.90 ± 0.0038\n0.87 ± 0.0022\n0.92 ± 0.0004\n0.90 ± 0.0025\n0.91 ± 0.0023\n0.92 ± 0.0006\n0.94 ± 0.0014\n0.93 ± 0.0010\n0.95 ± 0.0022\n0.96 ± 0.0007\n0.95 ± 0.0010\n0.97 ± 0.0010\n0.96 ± 0.0008\n0.96 ± 0.0011\n0.97 ± 0.0008\n0.95 ± 0.0008\n0.98 ± 0.0010\n\n0.79 ± 0.0066\n0.68 ± 0.0043\n0.70 ± 0.0029\n0.61 ± 0.0005\n0.53 ± 0.0019\n0.64 ± 0.0046\n0.58 ± 0.0077\n0.59 ± 0.0108\n0.64 ± 0.0040\n0.70 ± 0.0042\n0.67 ± 0.0053\n0.71 ± 0.0056\n0.76 ± 0.0080\n0.76 ± 0.0046\n0.80 ± 0.0047\n0.77 ± 0.0046\n0.77 ± 0.0059\n0.80 ± 0.0044\n0.75 ± 0.0027\n0.85 ± 0.0041\n\n0.59 ± 0.0300\n0.45 ± 0.0226\n0.57 ± 0.0340\n0.46 ± 0.0113\n0.35 ± 0.0207\n0.39 ± 0.0233\n0.39 ± 0.0301\n0.30 ± 0.0103\n0.42 ± 0.0333\n0.49 ± 0.0381\n0.46 ± 0.0181\n0.50 ± 0.0085\n0.55 ± 0.0314\n0.53 ± 0.0225\n0.58 ± 0.0259\n0.56 ± 0.0293\n0.54 ± 0.0200\n0.52 ± 0.0392\n0.55 ± 0.0137\n0.62 ± 0.0429\n\n0.66 ± 0.0187\n0.61 ± 0.0087\n0.59 ± 0.0264\n0.54 ± 0.0060\n0.54 ± 0.0140\n0.53 ± 0.0069\n0.53 ± 0.0148\n0.58 ± 0.0099\n0.55 ± 0.0137\n0.52 ± 0.0124\n0.56 ± 0.0121\n0.58 ± 0.0106\n0.56 ± 0.0170\n0.62 ± 0.0188\n0.61 ± 0.0420\n0.60 ± 0.0195\n0.62 ± 0.0171\n0.71 ± 0.0113\n0.61 ± 0.0370\n0.60 ± 0.0240\n\n1.04 ± 0.0824\n1.34 ± 0.2551\n1.79 ± 0.0164\n1.73 ± 0.0686\n1.19 ± 0.1377\n0.92 ± 0.0889\n0.94 ± 0.0475\n0.91 ± 0.0472\n0.88 ± 0.0511\n0.76 ± 0.0422\n0.93 ± 0.0769\n1.01 ± 0.0391\n1.03 ± 0.0501\n1.06 ± 0.2823\n0.95 ± 0.1126\n1.08 ± 0.0864\n0.78 ± 0.0594\n0.77 ± 0.1048\n0.93 ± 0.0557\n0.75 ± 0.0793\n\nmean\n\n0.94 ± 0.0266\n\n0.71 ± 0.0839\n\n0.49 ± 0.0847\n\n0.59 ± 0.0460\n\n1.04 ± 0.2794 0.86 ± 0.0745\n\n\fTable 25: AD and explanation performance averaged over 4 random seeds on CIFAR-10 for HSC OE. Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n0.99 ± 0.0164\n1.00 ± 0.0002\n1.00 ± 0.0001\n1.00 ± 0.0011\n1.00 ± 0.0002\n1.00 ± 0.0012\n1.00 ± 0.0000\n1.00 ± 0.0003\n0.96 ± 0.0734\n1.00 ± 0.0002\n1.00 ± 0.0001\n1.00 ± 0.0001\n1.00 ± 0.0001\n1.00 ± 0.0001\n1.00 ± 0.0005\n1.00 ± 0.0011\n0.99 ± 0.0075\n0.98 ± 0.0247\n0.97 ± 0.0579\n0.90 ± 0.1301\n\nairplane+automobile\nairplane+bird\nautomobile+bird\nautomobile+cat\nbird+cat\nbird+deer\ncat+deer\ncat+dog\ndeer+dog\ndeer+frog\ndog+frog\ndog+horse\nfrog+horse\nfrog+ship\nhorse+ship\nhorse+truck\nship+truck\nship+airplane\ntruck+airplane\ntruck+automobile\n\n0.96 ± 0.0005\n0.93 ± 0.0012\n0.92 ± 0.0029\n0.91 ± 0.0011\n0.87 ± 0.0019\n0.92 ± 0.0026\n0.90 ± 0.0017\n0.93 ± 0.0018\n0.92 ± 0.0017\n0.95 ± 0.0011\n0.93 ± 0.0014\n0.96 ± 0.0003\n0.96 ± 0.0015\n0.96 ± 0.0009\n0.96 ± 0.0007\n0.95 ± 0.0016\n0.96 ± 0.0005\n0.97 ± 0.0013\n0.95 ± 0.0020\n0.99 ± 0.0004\n\n0.75 ± 0.0017\n0.67 ± 0.0024\n0.66 ± 0.0065\n0.62 ± 0.0054\n0.47 ± 0.0046\n0.63 ± 0.0097\n0.54 ± 0.0053\n0.59 ± 0.0085\n0.60 ± 0.0095\n0.68 ± 0.0010\n0.63 ± 0.0045\n0.70 ± 0.0064\n0.73 ± 0.0027\n0.75 ± 0.0084\n0.77 ± 0.0036\n0.73 ± 0.0074\n0.76 ± 0.0051\n0.80 ± 0.0037\n0.72 ± 0.0041\n0.85 ± 0.0067\n\n0.51 ± 0.0900\n0.44 ± 0.0439\n0.45 ± 0.0424\n0.53 ± 0.0285\n0.32 ± 0.0328\n0.38 ± 0.0144\n0.35 ± 0.0228\n0.39 ± 0.0252\n0.38 ± 0.0401\n0.42 ± 0.0065\n0.43 ± 0.0110\n0.44 ± 0.0062\n0.48 ± 0.0143\n0.48 ± 0.0313\n0.40 ± 0.0675\n0.50 ± 0.0339\n0.41 ± 0.0426\n0.53 ± 0.0811\n0.46 ± 0.0542\n0.60 ± 0.0790\n\n0.54 ± 0.0163\n0.52 ± 0.0059\n0.51 ± 0.0065\n0.50 ± 0.0023\n0.53 ± 0.0401\n0.54 ± 0.0248\n0.52 ± 0.0166\n0.52 ± 0.0042\n0.52 ± 0.0107\n0.56 ± 0.0535\n0.51 ± 0.0036\n0.52 ± 0.0190\n0.52 ± 0.0176\n0.56 ± 0.0346\n0.53 ± 0.0124\n0.53 ± 0.0520\n0.57 ± 0.0625\n0.55 ± 0.0359\n0.53 ± 0.0176\n0.53 ± 0.0340\n\n2.14 ± 0.0882\n2.21 ± 0.1630\n4.12 ± 1.1471\n3.10 ± 0.3450\n3.34 ± 1.0615\n3.49 ± 0.1061\n2.58 ± 0.1145\n1.97 ± 0.0935\n2.44 ± 0.5742\n2.27 ± 0.0879\n2.53 ± 0.1879\n3.22 ± 0.1861\n2.75 ± 0.3541\n3.29 ± 0.6680\n1.87 ± 0.0485\n2.93 ± 0.8821\n1.73 ± 0.0526\n1.65 ± 0.2366\n1.85 ± 0.1448\n1.49 ± 0.1063\n\nmean\n\n0.94 ± 0.0270\n\n0.68 ± 0.0883\n\n0.44 ± 0.0666\n\n0.53 ± 0.0175\n\n2.55 ± 0.6970 0.99 ± 0.0244\n\nTable 26: AD and explanation performance averaged over 4 random seeds on CIFAR-10 for DSVDD. Each row shows results\nfor a different normal definition.\n\nNormal\n\nAuROC\n\nAD\nScore distance\n\nCF AuROC\n\nExplanation\nSub. AuROC\nFIDN\n\nConcept Acc\n0.84 ± 0.1424\n0.93 ± 0.0503\n0.93 ± 0.0859\n0.90 ± 0.0745\n0.98 ± 0.0223\n0.97 ± 0.0183\n0.95 ± 0.0201\n0.91 ± 0.0690\n0.89 ± 0.1620\n0.93 ± 0.0919\n0.87 ± 0.0848\n0.92 ± 0.0427\n0.99 ± 0.0030\n0.97 ± 0.0261\n0.96 ± 0.0209\n0.88 ± 0.1041\n0.96 ± 0.0365\n0.87 ± 0.1070\n0.94 ± 0.0497\n0.86 ± 0.1105\n\nairplane+automobile\nairplane+bird\nautomobile+bird\nautomobile+cat\nbird+cat\nbird+deer\ncat+deer\ncat+dog\ndeer+dog\ndeer+frog\ndog+frog\ndog+horse\nfrog+horse\nfrog+ship\nhorse+ship\nhorse+truck\nship+truck\nship+airplane\ntruck+airplane\ntruck+automobile\n\n0.50 ± 0.0357\n0.49 ± 0.0111\n0.49 ± 0.0145\n0.50 ± 0.0148\n0.53 ± 0.0162\n0.56 ± 0.0278\n0.56 ± 0.0418\n0.52 ± 0.0105\n0.55 ± 0.0213\n0.57 ± 0.1151\n0.60 ± 0.0431\n0.53 ± 0.0102\n0.60 ± 0.0398\n0.52 ± 0.0144\n0.49 ± 0.0374\n0.50 ± 0.0346\n0.47 ± 0.0265\n0.50 ± 0.0246\n0.48 ± 0.0545\n0.51 ± 0.0279\n\n0.00 ± 0.0002\n0.00 ± 0.0005\n0.00 ± 0.0002\n0.00 ± 0.0007\n0.00 ± 0.0003\n0.00 ± 0.0003\n0.00 ± 0.0008\n0.00 ± 0.0011\n0.00 ± 0.0030\n0.01 ± 0.0046\n0.00 ± 0.0034\n0.00 ± 0.0006\n0.01 ± 0.0048\n0.00 ± 0.0004\n0.00 ± 0.0002\n0.00 ± 0.0006\n0.00 ± 0.0003\n0.00 ± 0.0002\n0.00 ± 0.0004\n0.00 ± 0.0009\n\n0.48 ± 0.0517\n0.46 ± 0.0219\n0.49 ± 0.0081\n0.48 ± 0.0153\n0.51 ± 0.0344\n0.54 ± 0.0345\n0.54 ± 0.0486\n0.49 ± 0.0332\n0.51 ± 0.0377\n0.53 ± 0.1167\n0.60 ± 0.0514\n0.49 ± 0.0408\n0.56 ± 0.0160\n0.50 ± 0.0326\n0.48 ± 0.0409\n0.51 ± 0.0287\n0.49 ± 0.0195\n0.48 ± 0.0400\n0.48 ± 0.0460\n0.52 ± 0.0356\n\n0.46 ± 0.0260\n0.49 ± 0.0448\n0.49 ± 0.0184\n0.47 ± 0.0251\n0.50 ± 0.0033\n0.51 ± 0.0122\n0.53 ± 0.0228\n0.49 ± 0.0148\n0.53 ± 0.0211\n0.59 ± 0.0516\n0.53 ± 0.0323\n0.49 ± 0.0178\n0.57 ± 0.0228\n0.53 ± 0.0188\n0.48 ± 0.0077\n0.46 ± 0.0147\n0.46 ± 0.0201\n0.42 ± 0.0326\n0.46 ± 0.0205\n0.45 ± 0.0143\n\n1.20 ± 0.0111\n1.27 ± 0.0950\n1.23 ± 0.0524\n1.22 ± 0.0567\n1.08 ± 0.0223\n0.97 ± 0.0304\n1.02 ± 0.0201\n1.06 ± 0.0168\n1.10 ± 0.0348\n0.87 ± 0.0342\n0.95 ± 0.0188\n1.17 ± 0.0254\n1.07 ± 0.0079\n1.08 ± 0.0331\n1.17 ± 0.0563\n1.21 ± 0.0579\n1.05 ± 0.0330\n1.10 ± 0.0722\n1.15 ± 0.0309\n1.06 ± 0.0331\n\nmean\n\n0.53 ± 0.0356\n\n0.00 ± 0.0023\n\n0.51 ± 0.0332\n\n0.50 ± 0.0414\n\n1.10 ± 0.0998 0.92 ± 0.0424\n\n\fP\n\nRandom Collection of CEs\n\nWe demonstrated the effectiveness of the proposed CEs by showing a small fraction of the generated CEs. Here, we show\na larger collection of CEs for all normal definitions. For each normal definition, we randomly selected two samples to serve\nas examples. Figures 14, 15, and 16 show CEs for Colored-MNIST (Col-MNIST) and an AD trained with BCE, HSC, and\nDSVDD, respectively.\ngray+one\n\nyellow+one\n\nyellow+one\n\ncyan+one\n\ncyan+one\n\ngreen+one\n\ngreen+one\n\nblue+one\n\nblue+one\n\npink+one\n\npink+one\n\nred+one\n\nred+one\n\nCE 1\n\nCE 0\n\nAnom\n\ngray+one\n\nFigure 14: CEs for Col-MNIST and an anomaly detector trained with BCE (OE). For each normal definition, a different detector\nand CE generator was trained. In each subfigure, the first row shows anomalies, the other two corresponding counterfactuals\nfor two different concepts. Each column is labeled with the corresponding combined normal class at the top.\ngray+one\n\nyellow+one\n\nyellow+one\n\ncyan+one\n\ncyan+one\n\ngreen+one\n\ngreen+one\n\nblue+one\n\nblue+one\n\npink+one\n\npink+one\n\nred+one\n\nred+one\n\nCE 1\n\nCE 0\n\nAnom\n\ngray+one\n\nFigure 15: CEs for Col-MNIST and an anomaly detector trained with HSC (OE). For each normal definition, a different detector\nand CE generator was trained. In each subfigure, the first row shows anomalies, the other two corresponding counterfactuals\nfor two different concepts. Each column is labeled with the corresponding combined normal class at the top.\ngray+one\n\nyellow+one\n\nyellow+one\n\ncyan+one\n\ncyan+one\n\ngreen+one\n\ngreen+one\n\nblue+one\n\nblue+one\n\npink+one\n\npink+one\n\nred+one\n\nred+one\n\nCE 1\n\nCE 0\n\nAnom\n\ngray+one\n\nFigure 16: CEs for Col-MNIST and an anomaly detector trained with DSVDD. For each normal definition, a different detector\nand counterfactual generator was trained. In each subfigure, the first row shows anomalies, the other two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined normal class at the top.\n\n\fFigures 17, 18, and 19 show CEs for MNIST, single classes being normal, and an AD trained with BCE, HSC, and DSVDD,\nrespectively.\nzero\n\none\n\none\n\ntwo\n\ntwo\n\nthree\n\nthree\n\nfour\n\nfour\n\nfive\n\nfive\n\nsix\n\nsix\n\nseven\n\nseven\n\neight\n\neight\n\nnine\n\nnine\n\nCE 1\n\nCE 0\n\nAnom\n\nzero\n\nFigure 17: CEs for MNIST, diverse single normal classes, and an anomaly detector trained with BCE (OE). For each normal\ndefinition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies, the\nother two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding single\nnormal class at the top.\n\nzero\n\none\n\none\n\ntwo\n\ntwo\n\nthree\n\nthree\n\nfour\n\nfour\n\nfive\n\nfive\n\nsix\n\nsix\n\nseven\n\nseven\n\neight\n\neight\n\nnine\n\nnine\n\nCE 1\n\nCE 0\n\nAnom\n\nzero\n\nFigure 18: CEs for MNIST, diverse single normal classes, and an anomaly detector trained with HSC (OE). For each normal\ndefinition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies, the\nother two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding single\nnormal class at the top.\n\nzero+one\n\none\n\none\n\ntwo\n\ntwo\n\nthree\n\nthree\n\nfour\n\nfour\n\nfive\n\nfive\n\nsix\n\nsix\n\nseven\n\nseven\n\neight\n\neight\n\nnine\n\nnine\n\nCE 1\n\nCE 0\n\nAnom\n\nzero+one\n\nFigure 19: CEs for MNIST, diverse single normal classes, and an anomaly detector trained with DSVDD. For each normal\ndefinition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies, the\nother two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding single\nnormal class at the top.\n\n\fFigures 20, 21, and 22 show CEs for CIFAR-10, single classes being normal, and an AD trained with BCE, HSC, and\nDSVDD, respectively.\nplane\n\ncar\n\ncar\n\nbird\n\nbird\n\ncat\n\ncat\n\ndeer\n\ndeer\n\ndog\n\ndog\n\nfrog\n\nfrog\n\nhorse\n\nhorse\n\nship\n\nship\n\ntruck\n\ntruck\n\nCE 1\n\nCE 0\n\nAnom\n\nplane\n\nFigure 20: CEs for CIFAR-10, diverse single normal classes, and an anomaly detector trained with BCE (OE). For each normal\ndefinition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies, the\nother two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding single\nnormal class at the top.\n\nplane\n\ncar\n\ncar\n\nbird\n\nbird\n\ncat\n\ncat\n\ndeer\n\ndeer\n\ndog\n\ndog\n\nfrog\n\nfrog\n\nhorse\n\nhorse\n\nship\n\nship\n\ntruck\n\ntruck\n\nCE 1\n\nCE 0\n\nAnom\n\nplane\n\nFigure 21: CEs for CIFAR-10, diverse single normal classes, and an anomaly detector trained with HSC (OE). For each normal\ndefinition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies, the\nother two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding single\nnormal class at the top.\n\nplane\n\ncar\n\ncar\n\nbird\n\nbird\n\ncat\n\ncat\n\ndeer\n\ndeer\n\ndog\n\ndog\n\nfrog\n\nfrog\n\nhorse\n\nhorse\n\nship\n\nship\n\ntruck\n\ntruck\n\nCE 1\n\nCE 0\n\nAnom\n\nplane\n\nFigure 22: CEs for CIFAR-10, diverse single normal classes, and an anomaly detector trained with DSVDD. For each normal\ndefinition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies, the\nother two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding single\nnormal class at the top.\n\n\fFigures 23, 24, and 25 show CEs for MNIST, class combinations being normal, and an AD trained with BCE, HSC, and\nDSVDD, respectively. Figures 26, 27, and 28 show CEs for CIFAR-10, class combinations being normal, and an AD trained\nwith BCE, HSC, and DSVDD, respectively.\nzero+one\n\nzero+two\n\nzero+two\n\none+two\n\none+two\n\none+three\n\none+three\n\ntwo+three\n\ntwo+three\n\ntwo+four\n\ntwo+four\n\nthree+four\n\nthree+four\n\nthree+five\n\nthree+five\n\nfour+five\n\nfour+five\n\nfour+six\n\nfour+six\n\nfive+six\n\nfive+six\n\nfive+seven\n\nfive+seven\n\nsix+seven\n\nsix+seven\n\nsix+eight\n\nsix+eight\n\nseven+eight seven+eight seven+nine seven+nine\n\neight+nine\n\neight+nine\n\neight+zero\n\neight+zero\n\nnine+zero\n\nnine+zero\n\nnine+one\n\nnine+one\n\nCE 1\n\nCE 0\n\nAnom\n\nCE 1\n\nCE 0\n\nAnom\n\nzero+one\n\nFigure 23: CEs for MNIST, diverse combined normal classes, and an anomaly detector trained with BCE (OE). For each normal\ndefinition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies, the\nother two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined\nnormal class at the top.\n\nzero+one\n\nzero+two\n\nzero+two\n\none+two\n\none+two\n\none+three\n\none+three\n\ntwo+three\n\ntwo+three\n\ntwo+four\n\ntwo+four\n\nthree+four\n\nthree+four\n\nthree+five\n\nthree+five\n\nfour+five\n\nfour+five\n\nfour+six\n\nfour+six\n\nfive+six\n\nfive+six\n\nfive+seven\n\nfive+seven\n\nsix+seven\n\nsix+seven\n\nsix+eight\n\nsix+eight\n\nseven+eight seven+eight seven+nine seven+nine\n\neight+nine\n\neight+nine\n\neight+zero\n\neight+zero\n\nnine+zero\n\nnine+zero\n\nnine+one\n\nnine+one\n\nCE 1\n\nCE 0\n\nAnom\n\nCE 1\n\nCE 0\n\nAnom\n\nzero+one\n\nFigure 24: CEs for MNIST, diverse combined normal classes, and an anomaly detector trained with HSC (OE). For each normal\ndefinition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies, the\nother two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined\nnormal class at the top.\n\n\fzero+one\n\nzero+two\n\nzero+two\n\none+two\n\none+two\n\none+three\n\none+three\n\ntwo+three\n\ntwo+three\n\ntwo+four\n\ntwo+four\n\nthree+four\n\nthree+four\n\nthree+five\n\nthree+five\n\nfour+five\n\nfour+five\n\nfour+six\n\nfour+six\n\nfive+six\n\nfive+six\n\nfive+seven\n\nfive+seven\n\nsix+seven\n\nsix+seven\n\nsix+eight\n\nsix+eight\n\nseven+eight seven+eight seven+nine seven+nine\n\neight+nine\n\neight+nine\n\neight+zero\n\neight+zero\n\nnine+zero\n\nnine+zero\n\nnine+one\n\nnine+one\n\nCE 1\n\nCE 0\n\nAnom\n\nCE 1\n\nCE 0\n\nAnom\n\nzero+one\n\nFigure 25: CEs for MNIST, diverse combined normal classes, and an anomaly detector trained with DSVDD. For each normal\ndefinition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies, the\nother two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined\nnormal class at the top.\n\nplane+car\n\nplane+bird\n\nplane+bird\n\ncar+bird\n\ncar+bird\n\ncar+cat\n\ncar+cat\n\nbird+cat\n\nbird+cat\n\nbird+deer\n\nbird+deer\n\ncat+deer\n\ncat+deer\n\ncat+dog\n\ncat+dog\n\ndeer+dog\n\ndeer+dog\n\ndeer+frog\n\ndeer+frog\n\ndog+frog\n\ndog+frog\n\ndog+horse\n\ndog+horse\n\nfrog+horse\n\nfrog+horse\n\nfrog+ship\n\nfrog+ship\n\nhorse+ship\n\nhorse+ship horse+truck horse+truck\n\nship+truck\n\nship+truck\n\nship+plane\n\nship+plane truck+plane truck+plane\n\ntruck+car\n\ntruck+car\n\nCE 1\n\nCE 0\n\nAnom\n\nCE 1\n\nCE 0\n\nAnom\n\nplane+car\n\nFigure 26: CEs for CIFAR-10, diverse combined normal classes, and an anomaly detector trained with BCE (OE). For each\nnormal definition, a different detector and generator was trained. In each subfigure, the first row shows anomalies, the other\ntwo corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined normal\nclass at the top.\n\n\fplane+car\n\nplane+bird\n\nplane+bird\n\ncar+bird\n\ncar+bird\n\ncar+cat\n\ncar+cat\n\nbird+cat\n\nbird+cat\n\nbird+deer\n\nbird+deer\n\ncat+deer\n\ncat+deer\n\ncat+dog\n\ncat+dog\n\ndeer+dog\n\ndeer+dog\n\ndeer+frog\n\ndeer+frog\n\ndog+frog\n\ndog+frog\n\ndog+horse\n\ndog+horse\n\nfrog+horse\n\nfrog+horse\n\nfrog+ship\n\nfrog+ship\n\nhorse+ship\n\nhorse+ship horse+truck horse+truck\n\nship+truck\n\nship+truck\n\nship+plane\n\nship+plane truck+plane truck+plane\n\ntruck+car\n\ntruck+car\n\nCE 1\n\nCE 0\n\nAnom\n\nCE 1\n\nCE 0\n\nAnom\n\nplane+car\n\nFigure 27: CEs for CIFAR-10, diverse combined normal classes, and an anomaly detector trained with HSC (OE). For each\nnormal definition, a different detector and generator was trained. In each subfigure, the first row shows anomalies, the other\ntwo corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined normal\nclass at the top.\n\nplane+car\n\nplane+bird\n\nplane+bird\n\ncar+bird\n\ncar+bird\n\ncar+cat\n\ncar+cat\n\nbird+cat\n\nbird+cat\n\nbird+deer\n\nbird+deer\n\ncat+deer\n\ncat+deer\n\ncat+dog\n\ncat+dog\n\ndeer+dog\n\ndeer+dog\n\ndeer+frog\n\ndeer+frog\n\ndog+frog\n\ndog+frog\n\ndog+horse\n\ndog+horse\n\nfrog+horse\n\nfrog+horse\n\nfrog+ship\n\nfrog+ship\n\nhorse+ship\n\nhorse+ship horse+truck horse+truck\n\nship+truck\n\nship+truck\n\nship+plane\n\nship+plane truck+plane truck+plane\n\ntruck+car\n\ntruck+car\n\nCE 1\n\nCE 0\n\nAnom\n\nCE 1\n\nCE 0\n\nAnom\n\nplane+car\n\nFigure 28: CEs for CIFAR-10, diverse combined normal classes, and an anomaly detector trained with DSVDD. For each\nnormal definition, a different detector and generator was trained. In each subfigure, the first row shows anomalies, the other\ntwo corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined normal\nclass at the top.\n\n\fFigures 29 and 30 show the CEs for ImageNet-Neighbors, with single classes being normal, and an AD trained with BCE\nand HSC, respectively.\nairliner\n\nairliner\n\nambulance\n\nambulance\n\nambulance\n\nblack widow\n\nblack widow\n\nblack widow\n\nlion\n\nlion\n\nlion\n\nzebra\n\nzebra\n\nzebra\n\nCE 1\n\nCE 0\n\nAnom\n\nairliner\n\nFigure 29: CEs for ImageNet-Neighbors, single normal classes, and an anomaly detector trained with BCE (OE). For each\nnormal definition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies,\nthe other two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding normal\nclass at the top.\n\nairliner\n\nairliner\n\nambulance\n\nambulance\n\nambulance\n\nblack widow\n\nblack widow\n\nblack widow\n\nlion\n\nlion\n\nlion\n\nzebra\n\nzebra\n\nzebra\n\nCE 1\n\nCE 0\n\nAnom\n\nairliner\n\nFigure 30: CEs for ImageNet-Neighbors, single normal classes, and an anomaly detector trained with HSC (OE). For each\nnormal definition, a different detector and counterfactual generator was trained. In each subfigure, the first row shows anomalies,\nthe other two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding normal\nclass at the top.\n\n\fFigures 31, 32, and 33 show CEs for GTSDB, class combinations being normal, and an AD trained with BCE, HSC, and\nDSVDD, respectively.\nspeed limit 30 + 50\n\nspeed limit 50 + 70\n\nspeed limit 50 + 70\n\nspeed limit 70 + 100 speed limit 70 + 100 speed limit 100 + 120 speed limit 100 + 120\n\ngive way + stop\n\ngive way + stop\n\ndanger +\ndanger +\nall\nall\nconstruction warning construction warning restriction ends signs restriction ends signs all speed limit signs\n\nall speed limit signs\n\nall blue signs\n\nall blue signs\n\nall warning signs\n\nall warning signs\n\nCF 1\n\nCF 0\n\nAnom\n\nspeed limit 30 + 50\n\nFigure 31: CEs for GTSDB and an anomaly detector trained with BCE OE. For each normal definition, a different detector and\ncounterfactual generator was trained. In each subfigure, the first row shows anomalies, the other two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined normal class at the top.\n\nspeed limit 30 + 50\n\nspeed limit 50 + 70\n\nspeed limit 50 + 70\n\nspeed limit 70 + 100 speed limit 70 + 100 speed limit 100 + 120 speed limit 100 + 120\n\ngive way + stop\n\ngive way + stop\n\ndanger +\ndanger +\nall\nall\nconstruction warning construction warning restriction ends signs restriction ends signs all speed limit signs\n\nall speed limit signs\n\nall blue signs\n\nall blue signs\n\nall warning signs\n\nall warning signs\n\nCF 1\n\nCF 0\n\nAnom\n\nspeed limit 30 + 50\n\nFigure 32: CEs for GTSDB and an anomaly detector trained with HSC OE. For each normal definition, a different detector and\ncounterfactual generator was trained. In each subfigure, the first row shows anomalies, the other two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined normal class at the top.\n\nspeed limit 30 + 50\n\nspeed limit 50 + 70\n\nspeed limit 50 + 70\n\nspeed limit 70 + 100 speed limit 70 + 100 speed limit 100 + 120 speed limit 100 + 120\n\ngive way + stop\n\ngive way + stop\n\ndanger +\ndanger +\nall\nall\nconstruction warning construction warning restriction ends signs restriction ends signs all speed limit signs\n\nall speed limit signs\n\nall blue signs\n\nall blue signs\n\nall warning signs\n\nall warning signs\n\nCF 1\n\nCF 0\n\nAnom\n\nspeed limit 30 + 50\n\nFigure 33: CEs for GTSDB and an anomaly detector trained with DSVDD. For each normal definition, a different detector and\ncounterfactual generator was trained. In each subfigure, the first row shows anomalies, the other two corresponding counterfactuals for two different concepts. Each column is labeled with the corresponding combined normal class at the top.\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"