add some implementation stuff

This commit is contained in:
lukas-heilgenbrunner 2024-04-10 23:31:41 +02:00
parent f1b651d237
commit 18e7a89af3
3 changed files with 52 additions and 24 deletions

View File

@ -1,12 +1,21 @@
\section{Implementation}\label{sec:implementation}
The model is defined as $g(\pmb{x};\pmb{w})$ where $\pmb{w}$ are the model weights and $\pmb{x}$ the input samples.
The model is defined as $g(\pmb{x};\pmb{w})$ where $\pmb{w}$ are the model weights and $\mathcal{X}$ the input samples.
We define two hyperparameters, the batch size $\mathcal{B}$ and the sample size $\mathcal{S}$ where $\mathcal{B} < \mathcal{S}$.
In every active learning loop iteration we sample $\mathcal{S}$ random samples from our total unlabeled sample set $\mathcal{X}_S \subset\mathcal{X}_U \subset \mathcal{X}$
In every active learning loop iteration we sample $\mathcal{S}$ random samples~\eqref{eq:batchdef} from our total unlabeled sample set $\mathcal{X}_U \subset \mathcal{X}$.
\begin{equation}\label{eq:equation2}
z = g(\mathcal{X}_S;\pmb{w})
\begin{equation}
\label{eq:batchdef}
\pmb{x} \coloneqq (\pmb{x}_0,\dots,\pmb{x}_\mathcal{S}) \sim \mathcal{X}_U
\end{equation}
The model with the weights of the current loop iteration predicts pseudo predictions.
\begin{equation}\label{eq:equation2}
z = g(\pmb{x};\pmb{w})
\end{equation}
Those predictions might have any numerical value and have to be squeezed into a proper distribution which sums up to 1.
The Softmax function has exactly this effect: $\sum^\mathcal{S}_{i=1}\sigma(z)_i=1$
\begin{align}
S(z) = | 0.5 - \sigma(\mathbf{z})_0| \; \textit{or} \; \arg\max_j \sigma(\mathbf{z})

View File

@ -7,6 +7,8 @@
\subsubsection{Pytorch}
\subsubsection{NVTec}
\subsubsection{Imagenet}
\subsubsection{Anomalib}
% todo maybe remove?
\subsection{Methods}\label{subsec:methods}
@ -16,8 +18,13 @@
\subsubsection{CNN}
\subsubsection{Softmax}
The Softmax function converts $n$ numbers of a vector into a probability distribution.
The Softmax function converts $n$ numbers in a vector into a probability distribution.
Its a generalization of the Sigmoid function and often used as an Activation Layer in neural networks.
\begin{equation}\label{eq:softmax}
\sigma(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}} \; for j\coloneqq\{1,\dots,K\}
\end{equation}
\sigma(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}} \; for j\coloneqq\{1,\dots,K\}
\end{equation}
The softmax function has high similarities with the Bolzmann distribution. \cite{Boltzmann}
\subsubsection{Cross Entropy Loss}
% todo maybe remove this
\subsubsection{Adam}

View File

@ -2,38 +2,50 @@
%! Date = 4/9/24
@InProceedings{Xu_2022_CVPR,
author = {Xu, Yinghao and Wei, Fangyun and Sun, Xiao and Yang, Ceyuan and Shen, Yujun and Dai, Bo and Zhou, Bolei and Lin, Stephen},
title = {Cross-Model Pseudo-Labeling for Semi-Supervised Action Recognition},
author = {Xu, Yinghao and Wei, Fangyun and Sun, Xiao and Yang, Ceyuan and Shen, Yujun and Dai, Bo and Zhou, Bolei and Lin, Stephen},
title = {Cross-Model Pseudo-Labeling for Semi-Supervised Action Recognition},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022},
pages = {2959-2968}
month = {June},
year = {2022},
pages = {2959-2968}
}
@online{fixmatch,
author = "Kihyuk Sohn, David Berthelot, Chun-Liang Li",
title = "FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence",
url = "https://arxiv.org/abs/2001.07685",
url = "https://arxiv.org/abs/2001.07685",
addendum = "(accessed: 20.03.2023)",
keywords = "FixMatch, semi-supervised"
}
@InProceedings{activelearning,
author="Faria, Bruno
author = "Faria, Bruno
and Perdig{\~a}o, Dylan
and Br{\'a}s, Joana
and Macedo, Luis",
editor="Marreiros, Goreti
editor = "Marreiros, Goreti
and Martins, Bruno
and Paiva, Ana
and Ribeiro, Bernardete
and Sardinha, Alberto",
title="The Joint Role of Batch Size and Query Strategy in Active Learning-Based Prediction - A Case Study in the Heart Attack Domain",
booktitle="Progress in Artificial Intelligence",
year="2022",
publisher="Springer International Publishing",
address="Cham",
pages="464--475",
abstract="This paper proposes an Active Learning algorithm that could detect heart attacks based on different body measures, which requires much less data than the passive learning counterpart while maintaining similar accuracy. To that end, different parameters were tested, namely the batch size and the query strategy used. The initial tests on batch size consisted of varying its value until 50. From these experiments, the conclusion was that the best results were obtained with lower values, which led to the second set of experiments, varying the batch size between 1 and 5 to understand in which value the accuracy was higher. Four query strategies were tested: random sampling, least confident sampling, margin sampling and entropy sampling. The results of each approach were similar, reducing by 57{\%} to 60{\%} the amount of data required to obtain the same results of the passive learning approach.",
isbn="978-3-031-16474-3"
}
title = "The Joint Role of Batch Size and Query Strategy in Active Learning-Based Prediction - A Case Study in the Heart Attack Domain",
booktitle = "Progress in Artificial Intelligence",
year = "2022",
publisher = "Springer International Publishing",
address = "Cham",
pages = "464--475",
abstract = "This paper proposes an Active Learning algorithm that could detect heart attacks based on different body measures, which requires much less data than the passive learning counterpart while maintaining similar accuracy. To that end, different parameters were tested, namely the batch size and the query strategy used. The initial tests on batch size consisted of varying its value until 50. From these experiments, the conclusion was that the best results were obtained with lower values, which led to the second set of experiments, varying the batch size between 1 and 5 to understand in which value the accuracy was higher. Four query strategies were tested: random sampling, least confident sampling, margin sampling and entropy sampling. The results of each approach were similar, reducing by 57{\%} to 60{\%} the amount of data required to obtain the same results of the passive learning approach.",
isbn = "978-3-031-16474-3"
}
@inbook{Boltzmann,
place = {Cambridge},
series = {Cambridge Library Collection - Physical  Sciences},
title = {Studien über das Gleichgewicht der lebendigen Kraft zwischen bewegten materiellen Punkten},
booktitle = {Wissenschaftliche Abhandlungen},
publisher = {Cambridge University Press},
author = {Boltzmann, Ludwig},
editor = {Hasenöhrl, FriedrichEditor},
year = {2012},
pages = {4996},
collection = {Cambridge Library Collection - Physical  Sciences}, key = {value},}