Skip to content

Commit 240b698

Browse files
committed
Add LaTeX report
1 parent 9053785 commit 240b698

3 files changed

Lines changed: 218 additions & 0 deletions

File tree

report/.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# LaTeX auxiliary files
2+
*.aux
3+
*.log
4+
*.out
5+
*.synctex.gz
6+
7+
# Bibliography files (generated from .bib)
8+
*.bbl
9+
*.blg
10+
11+
# LaTeXmk files
12+
*.fdb_latexmk
13+
*.fls
14+
15+
# PDF output (generated from .tex)
16+
*.pdf
17+

report/main.tex

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
\documentclass{article}
2+
\usepackage[utf8]{inputenc}
3+
\usepackage{geometry}
4+
\geometry{
5+
a4paper,
6+
total={170mm,257mm},
7+
left=20mm,
8+
top=20mm,
9+
}
10+
\usepackage{graphicx}
11+
\usepackage{titling}
12+
\usepackage{amssymb}
13+
\usepackage{natbib}
14+
15+
\title{Testing the Effectiveness, Efficiency, and Stability\\of Search-Based Hyperparameter Optimizers }
16+
\author{
17+
Fernando Berti Cruz Nogueira (abert036@uottawa.ca),
18+
Kelvin Mock (kmock073@uOttawa.ca)
19+
}
20+
\date{October 2025}
21+
22+
\usepackage{fancyhdr}
23+
\setlength{\headheight}{12.5pt}
24+
\addtolength{\topmargin}{-0.5pt}
25+
\fancypagestyle{plain}{% the preset of fancyhdr
26+
\fancyhf{} % clear all header and footer fields
27+
\fancyfoot[L]{\thedate}
28+
\fancyhead[L]{CSI 5186 - AI-enabled Software Verification and Testing, Final Report (Fall 2025)}
29+
}
30+
\makeatletter
31+
\def\@maketitle{%
32+
\newpage
33+
\null
34+
\vskip 1em%
35+
\begin{center}%
36+
\let \footnote \thanks
37+
{\LARGE \@title \par}%
38+
\vskip 1em%
39+
%{\large \@date}%
40+
\end{center}%
41+
\par
42+
\vskip 1em}
43+
\makeatother
44+
45+
\usepackage{float}
46+
\usepackage{amsmath}
47+
\usepackage{xcolor}
48+
\usepackage{array}
49+
\usepackage{booktabs}
50+
\usepackage{multirow}
51+
\usepackage{tabularx}
52+
\usepackage[colorlinks=true,citecolor=blue,linkcolor=blue]{hyperref}
53+
\begin{document}
54+
\maketitle
55+
56+
\noindent\begin{tabular}{@{}ll}
57+
Students & \theauthor\\
58+
Lecturer & Dr. Shiva Nejati (snejati@uottawa.ca)
59+
\end{tabular}
60+
61+
\begin{abstract}
62+
Hyperparameter optimization is a critical but computationally expensive task for developing effective machine learning models. This report presents an empirical study comparing a Randomized Search (RS) baseline against two representative metaheuristics: a Genetic Algorithm (GA) and Particle Swarm Optimization (PSO). This selection is made to contrast two primary search strategies: global exploration (GA) and local exploitation (PSO). We evaluate the ability of these algorithms to optimize the hyperparameters of three distinct machine learning models (Decision Tree, k-Nearest Neighbors, and a Convolutional Neural Network) on the grayscale CIFAR-10 dataset~\cite{krizhevsky2009learning}. To ensure a fair and balanced assessment we define a composite fitness function. We evaluate the optimizers across three quality attributes: effectiveness (solution quality), efficiency (computational cost), and stability (consistency across runs). The empirical results will be validated using statistical tests to provide statistically grounded conclusions.
63+
\end{abstract}
64+
65+
\section{Introduction}
66+
67+
The performance of machine learning models often depends on their hyperparameters—high-level configuration variables like learning rate or batch size that control the training process. Finding the optimal set of these configurations, or Hyperparameter Optimization (HPO), is a significant and resource-intensive bottleneck in model development.
68+
69+
HPO can be framed as a software verification problem. In this context, the model is the software under test and a "defect" being a suboptimal hyperparameter configuration that causes the model to fail its performance specifications, such as by exhibiting high loss, poor generalization or unstable training. HPO thus functions as a automated test drivers, searching the configuration space to find a set of hyperparameters that verifies the model's performance against a pre-defined quality specification.
70+
71+
\subsection{Evaluation Criteria}
72+
73+
We evaluate the optimizers across three quality attributes, as defined in the project proposal:
74+
75+
\begin{itemize}
76+
\item \textbf{Effectiveness}: The quality of the final solution found (i.e., the best fitness score achieved).
77+
\item \textbf{Efficiency}: The computational cost required to find a solution, measured in both fitness evaluations and wall-clock time.
78+
\item \textbf{Stability (Consistency)}: The consistency and reliability of the algorithm's performance across multiple independent runs.
79+
\end{itemize}
80+
81+
\subsection{Research Questions}
82+
83+
This report seeks to answer the following research questions from the project proposal:
84+
85+
\begin{itemize}
86+
\item \textbf{RQ1}: How do representative metaheuristic algorithms compare against a randomized search baseline in terms of effectiveness and efficiency when performing HPO prior to training?
87+
\item \textbf{RQ2}: What is the difference in performance stability between the selected metaheuristic algorithms and traditional solutions like the randomized search baseline?
88+
\end{itemize}
89+
90+
\section{Problem Formulation}
91+
92+
\subsection{Objective Function}
93+
94+
HPO is a black-box optimization problem. The objective function $f(\theta)$, which represents the model's performance for a given hyperparameter configuration $\theta$, presents many challenges: it is computationally expensive to evaluate, it is non-differentiable, and the search space $\Theta$ is often complex and of mixed-types (continuous, discrete, and categorical). These properties make HPO suitable for search-based metaheuristic techniques.
95+
96+
\subsection{Algorithm Selection}
97+
98+
\subsubsection{Baseline: Randomized Search}
99+
100+
RS is the standard scientific baseline for HPO. \citet{bergstra2012random} demonstrated empirically that RS is more efficient than Grid Search for HPO, as it does not waste evaluations on unimportant parameters. Therefore, any intelligent algorithm must demonstrate superiority over RS to be considered effective.
101+
102+
\subsubsection{Genetic Algorithm}
103+
104+
TODO
105+
106+
\subsubsection{Particle Swarm Optimization}
107+
108+
PSO models a swarm where individuals are strongly influenced by the single best-found solution. This behaviour leads to rapid convergence, often finding a "good-enough" solution quickly. This same strength can also be a weakness, as it may converge prematurely to a suboptimal solution. The swarm can rapidly cluster around the first local optimum it finds, losing diversity and becoming "stuck" before the true global optimum is found.
109+
110+
\section{Experiment}
111+
112+
\subsection{Models and Dataset}
113+
114+
\subsubsection{Dataset}
115+
116+
We use a grayscale version of CIFAR-10~\cite{krizhevsky2009learning}. RGB images ($32 \times 32$ pixels) are converted to grayscale using $Y = 0.2125R + 0.7154G + 0.0721B$ and normalized to $[0, 1]$.
117+
118+
\subsubsection{Data Split}
119+
120+
\begin{itemize}
121+
\item Training Set: 40,000 images.
122+
\item Validation Set: 10,000 images (used only for HPO fitness evaluation).
123+
\item Test Set: 10,000 images (held out for final model evaluation after HPO is complete).
124+
\end{itemize}
125+
126+
\subsubsection{Models}
127+
128+
\begin{itemize}
129+
\item Decision Tree (DT)
130+
\item K-Nearest Neighbors (KNN)
131+
\item Convolutional Neural Network (CNN)
132+
\end{itemize}
133+
134+
\clearpage
135+
\subsection{Hyperparameter Search Space}
136+
137+
Table \ref{tab:hparam_space} defines the hyperparameter search space used by all three models.
138+
139+
\begin{table}[htbp]
140+
\centering
141+
\caption{Hyperparameter Search Space Definition}
142+
\label{tab:hparam_space}
143+
\small
144+
\begin{tabularx}{\textwidth}{llllX}
145+
\toprule
146+
\textbf{Model} & \textbf{Hyperparameter} & \textbf{Type} & \textbf{Range} & \textbf{Justification \& Citation} \\
147+
\midrule
148+
\multirow{4}{*}{DT} & criterion & Categorical & \texttt{['gini', 'entropy']} & Standard impurity measures for split quality. \\
149+
\cmidrule{2-5}
150+
& max\_depth & Integer & \texttt{[3, 20]} & Controls tree depth to balance bias/variance. \\
151+
\cmidrule{2-5}
152+
& min\_samples\_split & Integer & \texttt{[2, 20]} & Regularization: min samples required to split a node. \\
153+
\cmidrule{2-5}
154+
& min\_samples\_leaf & Integer & \texttt{[1, 10]} & Regularization: min samples required for a leaf node. \\
155+
\midrule
156+
\multirow{3}{*}{KNN} & n\_neighbors & Integer & \texttt{[3, 15]} & Number of neighbors; odd range to prevent ties. \\
157+
\cmidrule{2-5}
158+
& weights & Categorical & \texttt{['uniform', 'distance']} & Weighting function for neighbors ('distance' gives more weight to closer points). \\
159+
\cmidrule{2-5}
160+
& metric & Categorical & \texttt{['minkowski', 'manhattan']} & Distance metric (e.g., L2/Euclidean vs. L1/Manhattan). \\
161+
\midrule
162+
\multirow{6}{*}{CNN} & learning\_rate & Float (Log) & \texttt{[1e-5, 1e-2]} & Most critical HP; controls optimizer step size. \\
163+
\cmidrule{2-5}
164+
& batch\_size & Categorical & \texttt{[16, 32, 64, 128]} & Trade-off between gradient stability and memory/speed. \\
165+
\cmidrule{2-5}
166+
& optimizer & Categorical & \texttt{['AdamW', 'SGD']} & Compares modern adaptive (AdamW) vs. classical (SGD) optimizers. \\
167+
\cmidrule{2-5}
168+
& kernel\_size & Integer & \texttt{[3, 5]} & Size of the convolutional filter's receptive field. \\
169+
\cmidrule{2-5}
170+
& stride & Integer & \texttt{[1, 3]} & Step size of convolution; reduces spatial dimension. \\
171+
\cmidrule{2-5}
172+
& weight\_decay & Float & \texttt{[0.0, 0.01]} & L2 egularization parameter to prevent overfitting. \\
173+
\bottomrule
174+
\end{tabularx}
175+
\end{table}
176+
177+
% BEFORE END
178+
\clearpage
179+
\bibliographystyle{plainnat}
180+
\bibliography{refs}
181+
182+
183+
\clearpage % Ensures the next content starts on a new page
184+
185+
\end{document}

report/refs.bib

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@article{bergstra2012random,
2+
title = {Random Search for Hyper-Parameter Optimization},
3+
author = {Bergstra, James and Bengio, Yoshua},
4+
journal = {Journal of Machine Learning Research},
5+
volume = {13},
6+
pages = {281--305},
7+
year = {2012}
8+
}
9+
10+
@techreport{krizhevsky2009learning,
11+
title = {Learning Multiple Layers of Features from Tiny Images},
12+
author = {Krizhevsky, Alex},
13+
institution = {University of Toronto},
14+
year = {2009},
15+
type = {Technical Report}
16+
}

0 commit comments

Comments
 (0)