diff --git a/DSD/images/2022150712.pdf b/DSD/images/2022150712.pdf new file mode 100644 index 0000000..0a94191 Binary files /dev/null and b/DSD/images/2022150712.pdf differ diff --git a/DSD/images/NN_schematic_presentation_DSD_Page 1.pdf b/DSD/images/NN_schematic_presentation_DSD_Page 1.pdf new file mode 100644 index 0000000..6ee5fb4 Binary files /dev/null and b/DSD/images/NN_schematic_presentation_DSD_Page 1.pdf differ diff --git a/DSD/images/NN_schematic_presentation_DSD_Page 2.pdf b/DSD/images/NN_schematic_presentation_DSD_Page 2.pdf new file mode 100644 index 0000000..a988151 Binary files /dev/null and b/DSD/images/NN_schematic_presentation_DSD_Page 2.pdf differ diff --git a/DSD/images/NN_schematic_presentation_DSD_Page 3.pdf b/DSD/images/NN_schematic_presentation_DSD_Page 3.pdf new file mode 100644 index 0000000..5b0a28e Binary files /dev/null and b/DSD/images/NN_schematic_presentation_DSD_Page 3.pdf differ diff --git a/DSD/images/NN_schematic_presentation_DSD_Page 4.pdf b/DSD/images/NN_schematic_presentation_DSD_Page 4.pdf new file mode 100644 index 0000000..d40cf7f Binary files /dev/null and b/DSD/images/NN_schematic_presentation_DSD_Page 4.pdf differ diff --git a/DSD/images/NN_schematic_presentation_DSD_Page 5.pdf b/DSD/images/NN_schematic_presentation_DSD_Page 5.pdf new file mode 100644 index 0000000..0677ea4 Binary files /dev/null and b/DSD/images/NN_schematic_presentation_DSD_Page 5.pdf differ diff --git a/DSD/images/NN_schematic_presentation_DSD_Page 6.pdf b/DSD/images/NN_schematic_presentation_DSD_Page 6.pdf new file mode 100644 index 0000000..3213826 Binary files /dev/null and b/DSD/images/NN_schematic_presentation_DSD_Page 6.pdf differ diff --git a/DSD/images/NN_schematic_presentation_DSD_Page 7.pdf b/DSD/images/NN_schematic_presentation_DSD_Page 7.pdf new file mode 100644 index 0000000..b1c67bc Binary files /dev/null and b/DSD/images/NN_schematic_presentation_DSD_Page 7.pdf differ diff --git a/DSD/images/NN_schematic_presentation_DSD_Page 8.pdf b/DSD/images/NN_schematic_presentation_DSD_Page 8.pdf new file mode 100644 index 0000000..9c76011 Binary files /dev/null and b/DSD/images/NN_schematic_presentation_DSD_Page 8.pdf differ diff --git a/DSD/images/detection_real_DELL-1_1NNmin.pdf b/DSD/images/detection_real_DELL-1_1NNmin.pdf new file mode 100644 index 0000000..d9fe0b8 Binary files /dev/null and b/DSD/images/detection_real_DELL-1_1NNmin.pdf differ diff --git a/DSD/images/detection_real_DELL-1_1NNmin.png b/DSD/images/detection_real_DELL-1_1NNmin.png new file mode 100644 index 0000000..b42b859 Binary files /dev/null and b/DSD/images/detection_real_DELL-1_1NNmin.png differ diff --git a/DSD/images/detection_real_DELL-1_1_1NNmin.png b/DSD/images/detection_real_DELL-1_1_1NNmin.png new file mode 100644 index 0000000..d6b1f40 Binary files /dev/null and b/DSD/images/detection_real_DELL-1_1_1NNmin.png differ diff --git a/DSD/images/detection_real_DELL-1_2_1NNmin.png b/DSD/images/detection_real_DELL-1_2_1NNmin.png new file mode 100644 index 0000000..a73fa27 Binary files /dev/null and b/DSD/images/detection_real_DELL-1_2_1NNmin.png differ diff --git a/DSD/images/detection_real___empty_0.5_1NNmin.png b/DSD/images/detection_real___empty_0.5_1NNmin.png new file mode 100644 index 0000000..c5fd938 Binary files /dev/null and b/DSD/images/detection_real___empty_0.5_1NNmin.png differ diff --git a/DSD/images/detection_real___empty_0.75_1NNmin.png b/DSD/images/detection_real___empty_0.75_1NNmin.png new file mode 100644 index 0000000..4857b7f Binary files /dev/null and b/DSD/images/detection_real___empty_0.75_1NNmin.png differ diff --git a/DSD/images/detection_real___empty_1NNcenter.pdf b/DSD/images/detection_real___empty_1NNcenter.pdf new file mode 100644 index 0000000..52b186a Binary files /dev/null and b/DSD/images/detection_real___empty_1NNcenter.pdf differ diff --git a/DSD/images/detection_real___empty_1NNmin.pdf b/DSD/images/detection_real___empty_1NNmin.pdf new file mode 100644 index 0000000..68cd507 Binary files /dev/null and b/DSD/images/detection_real___empty_1NNmin.pdf differ diff --git a/DSD/images/detection_real___empty_1_1NNmin.png b/DSD/images/detection_real___empty_1_1NNmin.png new file mode 100644 index 0000000..e69a416 Binary files /dev/null and b/DSD/images/detection_real___empty_1_1NNmin.png differ diff --git a/DSD/images/detection_real_asus_1_1NNmin.pdf b/DSD/images/detection_real_asus_1_1NNmin.pdf new file mode 100644 index 0000000..0b6ebce Binary files /dev/null and b/DSD/images/detection_real_asus_1_1NNmin.pdf differ diff --git a/DSD/images/detection_real_asus_1_1NNmin.png b/DSD/images/detection_real_asus_1_1NNmin.png new file mode 100644 index 0000000..3ce773c Binary files /dev/null and b/DSD/images/detection_real_asus_1_1NNmin.png differ diff --git a/DSD/images/presentation_Page 1_presentation.pdf b/DSD/images/presentation_Page 1_presentation.pdf new file mode 100644 index 0000000..3acadc6 Binary files /dev/null and b/DSD/images/presentation_Page 1_presentation.pdf differ diff --git a/DSD/presentation_formalization.tex b/DSD/presentation_formalization.tex new file mode 100644 index 0000000..cb1ef6e --- /dev/null +++ b/DSD/presentation_formalization.tex @@ -0,0 +1,189 @@ +\documentclass[aspectratio=169,10pt]{beamer} +\usetheme[progressbar=head,numbering=fraction,sectionpage=none]{metropolis} + +\usepackage{graphicx} +\usepackage{ulem} +\usepackage{xcolor} +\usepackage[scale=2]{ccicons} +\usepackage{pgfplots} +\usepackage{booktabs} +\usepgfplotslibrary{dateplot} +\usepackage{hyperref} +\usepackage{multirow} +\usepackage{array} +\usepackage{xspace} + +\title{Device State Detector (DSD): Formalization} +\subtitle{Trust me I've read a book.} +\date{} +\author{Arthur Grisel-Davy} +\institute{University of Waterloo, Canada} + + +\begin{document} + +\maketitle + +\begin{frame}{Context} +\begin{center} +\textit{For any power trace $t$ captured on from a machine $M$, detect the state $C_i$ of the machine for every sample $t[n]$.}\\ +\vspace{1cm} +\textit{Assign a class $C_i$, to every sample of a power trace $t[n]$ from a machine $M$ corresponding to a state of the machine, from a set of pre-established states.} +\end{center} +\vfill +$\Longrightarrow$ Supervised, multi-class, mono-label, classification problem. +\end{frame} + +\begin{frame}{Definitions} +\begin{itemize} +\item $t$: a power trace of fixed sampling rate and length $N$. $t[n] \forall n\in[1,N]$ are the samples value of $t$. +\item $p_i$: The proto examples of the states. Power traces corresponding to the $P$ states to detect. Each proto is of length $N_i$, not necessarily equals. +\end{itemize} +\end{frame} + +\begin{frame}{Normalized distance} +\begin{align}\label{eq:distance_original} + &nd: a\times b \in T^2 \rightarrow \mathbb{R} \nonumber\\ + &nd(a,b) = \dfrac{Eucd(a,b)}{N_b} +\end{align} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Center} +\begin{itemize} +\item Place sample at center of window. +\item Compute normalized distances to each proto. +\item Assign to closest proto. +\end{itemize} +\end{frame} + +\begin{frame}{1-Nearest Neighbor} +\includegraphics[width=\textwidth]{images/detection_real___empty_1NNcenter.pdf} +\end{frame} + +\begin{frame}{Performance metric} +\begin{itemize} + \item Accuracy: $Acc = \dfrac{1}{N}\sum_{n\in N}1_{(l[n] = true[n])}$ + \item State occurrence: Count state occurrence independently of correct position or size. +\end{itemize} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Dynamic position} +\begin{figure} +\centering +\includegraphics[width=0.9\textwidth]{images/presentation_Page 1_presentation.pdf} +\end{figure} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Dynamic position} +\includegraphics[width=\textwidth]{images/detection_real___empty_1NNmin.pdf} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Dynamic position} +\includegraphics[width=\textwidth]{images/detection_real_asus_1_1NNmin.png} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Dynamic position} +\includegraphics[width=\textwidth]{images/detection_real_DELL-1_1NNmin.png} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Dynamic Distance} +\begin{align}\label{eq:distance_original} + &dynd: t[n]\times p_i \in (t, protos)\nonumber\\ + &dynd(a,b) = \min_{k\in [n-N_i,n+N_i])}(nd(t[n-k:n-k+N_i],p_i)) +\end{align} +\end{frame} + +\begin{frame}{Limitations of the method} +\begin{itemize} + \item Significant miss-classification between close classes. + \item Impossibility to detect outlier/out-of-scope patterns. + \item Rely too much on protos \textit{tiling} assumption. +\end{itemize} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage} +\includegraphics[width=\textwidth]{images/NN_schematic_presentation_DSD_Page 1.pdf} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage} +\includegraphics[width=\textwidth]{images/NN_schematic_presentation_DSD_Page 2.pdf} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage} +\includegraphics[width=\textwidth]{images/NN_schematic_presentation_DSD_Page 3.pdf} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage} +\includegraphics[width=\textwidth]{images/NN_schematic_presentation_DSD_Page 4.pdf} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage} +\includegraphics[width=\textwidth]{images/NN_schematic_presentation_DSD_Page 5.pdf} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage} +\includegraphics[width=\textwidth]{images/NN_schematic_presentation_DSD_Page 6.pdf} +\end{frame} + +\begin{frame}{Variable Length Normalized Distance} +\begin{align}\label{eq:distance_original} + &vlnd: t[n]\times p_i \in (t, protos)\nonumber\\ + &vlnd(a,b) = \min_{k\in [n-N_i,n+N_i])}(nd(t[n-k:n-k+N_i],p_i)) +\end{align} +\end{frame} + +\begin{frame}{Checkpoint} +Three distance measures: +\begin{itemize} +\item Normalized Distance, to compare distances to protos: +\begin{equation}nd(a,b) = \dfrac{Eucd(a,b)}{N_b}\end{equation} +\item Dynamic Distance, to compare sample arc to protos: \begin{equation}dynd(a,b) = \min_{k\in [n-N_i,n+N_i])}(nd(t[n-k:n-k+N_i],p_i))\end{equation} +\item Variable Length Normalized Distance, to get protos inter-distances: \begin{equation}vlnd(a,b) = \min_{k\in [n-N_i,n+N_i])}(nd(t[n-k:n-k+N_i],p_i))\end{equation} +\end{itemize} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage} +\includegraphics[width=\textwidth]{images/NN_schematic_presentation_DSD_Page 7.pdf} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage} +\includegraphics[width=\textwidth]{images/NN_schematic_presentation_DSD_Page 8.pdf} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage $\alpha=1$} +\includegraphics[width=\textwidth]{images/detection_real___empty_1_1NNmin} +\end{frame} +\begin{frame}{1-Nearest Neighbor - Shrinkage $\alpha=0.75$} +\includegraphics[width=\textwidth]{images/detection_real___empty_0.75_1NNmin} +\end{frame} +\begin{frame}{1-Nearest Neighbor - Shrinkage $\alpha=0.5$} +\includegraphics[width=\textwidth]{images/detection_real___empty_0.5_1NNmin} +\end{frame} + +\begin{frame}{1-Nearest Neighbor - Shrinkage $\alpha=2$} +\includegraphics[width=\textwidth]{images/detection_real_DELL-1_2_1NNmin.png} +\end{frame} +\begin{frame}{1-Nearest Neighbor - Shrinkage $\alpha=1$} +\includegraphics[width=\textwidth]{images/detection_real_DELL-1_1_1NNmin.png} +\end{frame} + +\begin{frame}{Conclusion} + \begin{itemize} + \item DSD is an implementation of 1-NN with custom distances and shrinkage. + \item Can easily be adapted to multiple protos per class. + \item Data requirements and constraints minimal. + \item Detects $P+1$ classes. + \item One hyperparameter $\alpha$ to controle miss/un -classification tradeoff. + \end{itemize} +\end{frame} + +\begin{frame}{Future Work} +\begin{itemize} + \item Capture and label more data. + \item Evaluate possibility of uneven shrinkage. + \item Detect attacks, publish paper, save the world, accept Nobel prize. +\end{itemize} + +\end{frame} + +\end{document} \ No newline at end of file