\[ \begin{align}\begin{aligned}\newcommand\blank{~\underline{\hspace{1.2cm}}~}\\% Bold symbols (vectors)
\newcommand\bs[1]{\mathbf{#1}}\\% Differential
\newcommand\dd[2][]{\mathrm{d}^{#1}{#2}} % use as \dd, \dd{x}, or \dd[2]{x}\\% Poor man's siunitx
\newcommand\unit[1]{\mathrm{#1}}
\newcommand\num[1]{#1}
\newcommand\qty[2]{#1~\unit{#2}}\\\newcommand\per{/}
\newcommand\squared{{}^2}
\newcommand\cubed{{}^3}
%
% Scale
\newcommand\milli{\unit{m}}
\newcommand\centi{\unit{c}}
\newcommand\kilo{\unit{k}}
\newcommand\mega{\unit{M}}
%
% Percent
\newcommand\percent{\unit{{\kern-4mu}\%}}
%
% Angle
\newcommand\radian{\unit{rad}}
\newcommand\degree{\unit{{\kern-4mu}^\circ}}
%
% Time
\newcommand\second{\unit{s}}
\newcommand\s{\second}
\newcommand\minute{\unit{min}}
\newcommand\hour{\unit{h}}
%
% Distance
\newcommand\meter{\unit{m}}
\newcommand\m{\meter}
\newcommand\inch{\unit{in}}
\newcommand\foot{\unit{ft}}
%
% Force
\newcommand\newton{\unit{N}}
\newcommand\kip{\unit{kip}} % kilopound in "freedom" units - edit made by Sri
%
% Mass
\newcommand\gram{\unit{g}}
\newcommand\g{\gram}
\newcommand\kilogram{\unit{kg}}
\newcommand\kg{\kilogram}
\newcommand\grain{\unit{grain}}
\newcommand\ounce{\unit{oz}}
\newcommand\pound{\unit{lbs}}
%
% Temperature
\newcommand\kelvin{\unit{K}}
\newcommand\K{\kelvin}
\newcommand\celsius{\unit{{\kern-4mu}^\circ C}}
\newcommand\C{\celsius}
\newcommand\fahrenheit{\unit{{\kern-4mu}^\circ F}}
\newcommand\F{\fahrenheit}
%
% Area
\newcommand\sqft{\unit{sq\,\foot}} % square foot
%
% Volume
\newcommand\liter{\unit{L}}
\newcommand\gallon{\unit{gal}}
%
% Frequency
\newcommand\hertz{\unit{Hz}}
\newcommand\rpm{\unit{rpm}}
%
% Voltage
\newcommand\volt{\unit{V}}
\newcommand\V{\volt}
\newcommand\millivolt{\milli\volt}
\newcommand\mV{\milli\volt}
\newcommand\kilovolt{\kilo\volt}
\newcommand\kV{\kilo\volt}
%
% Current
\newcommand\ampere{\unit{A}}
\newcommand\A{\ampere}
\newcommand\milliampereA{\milli\ampere}
\newcommand\mA{\milli\ampere}
\newcommand\kiloampereA{\kilo\ampere}
\newcommand\kA{\kilo\ampere}
%
% Resistance
\newcommand\ohm{\Omega}
\newcommand\milliohm{\milli\ohm}
\newcommand\kiloohm{\kilo\ohm} % correct SI spelling
\newcommand\kilohm{\kilo\ohm} % "American" spelling used in siunitx
\newcommand\megaohm{\mega\ohm} % correct SI spelling
\newcommand\megohm{\mega\ohm} % "American" spelling used in siunitx
%
% Capacitance
\newcommand\farad{\unit{F}}
\newcommand\F{\farad}
\newcommand\microfarad{\micro\farad}
\newcommand\muF{\micro\farad}
%
% Inductance
\newcommand\henry{\unit{H}}
\newcommand\H{\henry}
\newcommand\millihenry{\milli\henry}
\newcommand\mH{\milli\henry}
%
% Power
\newcommand\watt{\unit{W}}
\newcommand\W{\watt}
\newcommand\milliwatt{\milli\watt}
\newcommand\mW{\milli\watt}
\newcommand\kilowatt{\kilo\watt}
\newcommand\kW{\kilo\watt}
%
% Energy
\newcommand\joule{\unit{J}}
\newcommand\J{\joule}
%
% Composite units
%
% Torque
\newcommand\ozin{\unit{\ounce}\,\unit{in}}
\newcommand\newtonmeter{\unit{\newton\,\meter}}
%
% Pressure
\newcommand\psf{\unit{psf}} % pounds per square foot
\newcommand\pcf{\unit{pcf}} % pounds per cubic foot
\newcommand\pascal{\unit{Pa}}
\newcommand\Pa{\pascal}
\newcommand\ksi{\unit{ksi}} % kilopound per square inch
\newcommand\bar{\unit{bar}}
\end{aligned}\end{align} \]
Apr 28, 2026 | 440 words | 4 min read
5.1.1. Materials
Project Description
In this project, you will explore image classification on a simplified subset of the publicly available German Traffic Sign Recognition Benchmark (GTSRB) dataset. We will use image preprocessing, feature extraction, and simple machine learning techniques to achieve this. Image preprocessing is the process of preparing image data —such as training, validation, and testing datasets—so that meaningful features can be reliably extracted. This includes steps like resizing, grayscale conversion, and noise removal to make the images consistent in format and quality. Feature extraction follows preprocessing and involves extracting meaningful information from the images—such as shape descriptors (using the Sobel filter) and color-based features (after converting RGB to HSV).
Examples of color-based features are hue mean and hue standard deviation. While shape descriptors could be detecting circles or lines using the Hough Transform applied to the edges obtained from the aforementioned Sobel filter.
These extracted features are then used as input to machine learning models. You will create three machine learning models from scratch - K-Nearest Neighbors, Decision Tree, and Logistic Regression - to classify the images based on the extracted features. You will perform hyperparameter tuning and evaluate the performance of these models.
Your work will be evaluated through in-class demonstrations for Checkpoint 1 Task 1, while the remaining tasks will be assessed via the autograder on Gradescope. Additionally, the teaching team will conduct team visits to evaluate your understanding of the code you have written. Details of the requirements for each checkpoint are outlined below.
Team Size Adjustment for Model Choices
Teams of 4 or more Members: Implement all three machine learning models.
Teams of 3 Members: Implement K-Nearest Neighbors and one other model (either Decision Tree or Logistic Regression).
Teams of 2 Members: Implement only the Decision Tree Model.
Important Notes
For this project, you are only permitted to use the Python standard library
and the third party modules numpy, pandas, matplotlib,
PIL and OpenCV. You are also not allowed to use any external
libraries for machine learning as you must implement the models from scratch.
The image filenames use the following convention.
The characters _col or _gry in the filename indicates whether the image is colored
or grayscale.
The characters _raw or _clean in the filename indicates whether the image is
unprocessed (raw) or has been resized and padded to 100x100 pixels (clean).
To ensure your code is organized and easy to understand, structure your program using
functions. Modular code allows for better collaboration within your team, making it
easier to discuss ideas, debug issues, and integrate different parts of the project
seamlessly. Working together, you can design and implement user-defined functions that
perform specific tasks, accept necessary inputs, and return desired outputs. Avoid
dividing the tasks to work individually; instead, engage in collective problem-solving
to enhance your learning experience.