|
62 | 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 | 63 | \end{abstract} |
64 | 64 |
|
65 | | -\section{Introduction} |
| 65 | +\input{sections/1_introduction} |
| 66 | +\input{sections/2_problem_formulation} |
| 67 | +\input{sections/3_experiment} |
| 68 | +\input{sections/4_results} |
66 | 69 |
|
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 | 70 |
|
177 | 71 | % BEFORE END |
178 | 72 | \clearpage |
179 | 73 | \bibliographystyle{plainnat} |
180 | 74 | \bibliography{refs} |
181 | 75 |
|
182 | 76 |
|
183 | | -\clearpage % Ensures the next content starts on a new page |
184 | | - |
185 | 77 | \end{document} |
0 commit comments