Skip to content

Commit

Permalink
feat: add 1X zoom training
Browse files Browse the repository at this point in the history
  • Loading branch information
siemdejong committed Jan 31, 2023
1 parent 3b243b0 commit d1e0df2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
Binary file not shown.
5 changes: 3 additions & 2 deletions skinstression/sections/methods.tex
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,11 @@ \subsubsection{Hyperparameter optimization}

\subsubsection{Training}
Using the best configuration for hyperparameter optimization, a model is trained further for a total of 10000 epochs.
The learning rate scheduler was cosine annealing with warm restarts to allow for model ensembling later during inference (\cref{subsec:model_ensembling}).
The learning rate scheduler was cosine annealing with warm restarts to allow for model ensembling later during inference (\cref{subsec:model_ensembling}), if deemed useful.
The learning rate was warmed up linearly for the first 20 epochs.
To see the influence of image quality, the model is trained using an ordered set of images.
The images are ordered with maximum entropy first and the model is trained on all images and the top 5, 10, 15, and 20 images.
The images are ordered with maximum entropy first and the model is trained on all images and the top 10, 20 and 30 images of every stack.
Moreover, to see the effect of using the original zoom level with the greatest detail at hand, the best 20 images of every stack were centercropped to $500\times500$ and further randomly cropped randomly to $258\times258$.

\subsubsection{Dataset}\label{subsec:skin_dataset}
The thigh dataset is randomly distributed into a training (\qty{64}{\percent}), validation (\qty{16}{\percent}), and test (\qty{20}{\percent}).
Expand Down
30 changes: 17 additions & 13 deletions skinstression/sections/results.tex
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ \subsection{Training}
\end{margintable}

Three trainings were performed.
For every training, the 10, 20, and 30 images with highest entropy were selected to exclude any noisy images.
For every training, the 10, 20, and 30 images of every stack with highest entropy were selected to exclude any noisy images.
Also, using the 20 best images of every stack, the model is trained without scaling of the original image.
The loss curves are shown in \cref{fig:skinstression-training}.
The lowest validation losses are shown in \cref{tab:skin_train_102030}.
Overall, the model trained with 20 images shows the lowest total loss.
Expand All @@ -385,33 +386,36 @@ \subsection{Training}
To verify performance of training, the stress-strain curves of a random training batch are plotted with the raw data in \cref{fig:skinstression-train-logistic-curves}.


\begin{figure}
\begin{figure*}
\centering
\includegraphics[]{skinstression/images/training/Training_10_images.pdf} \\
\includegraphics[]{skinstression/images/training/Training_20_images.pdf} \\
\includegraphics[]{skinstression/images/training/Training_30_images.pdf}
\caption[Training with 10 images]{
Training using 10, 20, and 30 images respectively.
\includegraphics[width=0.48\linewidth]{skinstression/images/training/Training_10_images.pdf}
\includegraphics[width=0.48\linewidth]{skinstression/images/training/Training_20_images.pdf} \\
\includegraphics[width=0.48\linewidth]{skinstression/images/training/Training_30_images.pdf}
\includegraphics[width=0.48\linewidth]{skinstression/images/training/Training_at_1X_zoom.pdf}
\caption[Training losses]{
Training losses when using 10, 20, and 30 images as well as a training using 20 images, but with unscaled images.
The training loss (black) is followed by the validation loss (light green).
The learning rate (orange) restarts explain sudden increase in loss.
}
\label{fig:skinstression-training}
\end{figure}
\end{figure*}

\begin{margintable}
\centering
\caption[Lowest validation loss per $N_\mathrm{best}$ images]{
Lowest validation loss per $N_\mathrm{best}$ images.
The training using 20 images has the lowest validation loss.
* denotes training without rescaling.
}
\label{tab:skin_train_102030}
\begin{tabular}{c c}
\begin{tabular}{S[table-align-text-post=false] S}
\toprule
\# Images & Validation loss \\
{\# Images} & {Validation loss} \\
\midrule
10 & 0.0097 \\
\textbf{20} & \textbf{0.0035} \\
30 & 0.0040 \\
10 & 0.0097 \\
\bfseries 20 & \bfseries 0.0035 \\
20* & 0.27 \\
30 & 0.0040 \\
\bottomrule
\end{tabular}
\end{margintable}
Expand Down

0 comments on commit d1e0df2

Please sign in to comment.