Skip to content

Contents ​


Visual Preprocessing Report ​

The preprocessing of data is split into textual and visual preprocessing, with the visual preprocessing focusing on resizing the images to a smaller size for faster processing, normalizing their pixel values for later use by machine learning algorithms and storing them in unidimensional vectors.

Resizing, Normalization and Flattening ​

  • Uniform Sizing: All images in both the training and test sets were resized to a smaller fixed dimension of 224x224 pixels for less resource-consuming further processing.

  • Flattening: Each image was converted from a 3D array (height, width, channels) into a 1D vector since a flat feature vector is what most classical machine learning models will expect.

  • Pixel Value Normalization: Pixel values, originally in the range [0, 255], were scaled to [0, 1] by dividing by 255. This normalization improves model convergence and stability.

  • Saving as Numpy Arrays: The resulting 1D normalized vectors were saved as .npy files for efficient loading and processing in subsequent modeling steps.

Grayscale Conversion ​

Images were converted to grayscale before flattening and normalization.

This reduces the number of channels from 3 (RGB) to 1, potentially simplifying the feature space and reducing computational requirements.

While reducing dimensionality, grayscaling may discard useful color information for certain tasks.