0% found this document useful (0 votes)
2 views

Image Data Preprocessing

Image data preprocessing is essential for preparing raw images for neural networks by ensuring consistency in size and quality. Key steps include splitting data into training, validation, and test sets, converting images to tensors, resizing, normalizing pixel values, and batching for efficient processing. These practices enhance model efficiency, improve performance, and help prevent overfitting, ultimately leading to better predictions.

Uploaded by

Cristian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Image Data Preprocessing

Image data preprocessing is essential for preparing raw images for neural networks by ensuring consistency in size and quality. Key steps include splitting data into training, validation, and test sets, converting images to tensors, resizing, normalizing pixel values, and batching for efficient processing. These practices enhance model efficiency, improve performance, and help prevent overfitting, ultimately leading to better predictions.

Uploaded by

Cristian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

IMAGE DATA

PREPROCESSING
BY: GROUP 4
KEY TOPICS:
1. Splitting Data into Training,
Validation, and Test Sets

2. Converting Images to
Tensors and Loading Data
WHAT IS
IMAGE DATA
PREPROCESSING?
What is Image Data
Preprocessing?
Image data preprocessing prepares
raw images so neural networks can
learn from them accurately, by
making sizes and quality consistent.
IMPORTANCE OF IMAGE DATA
PREPROCESSING
ENHANCES MODEL IMPROVES MODEL
EFFICIENCY PERFORMANCE
Preprocessing simplifies image Standardized data helps the
data, reducing the amount of model learn patterns more
computation required, which effectively by removing
makes training faster. inconsistencies and noise.

PREVENTS
OVERFITTING
By using techniques like data
augmentation, preprocessing
increases the dataset’s diversity,
helping the model generalize
better.
KEY STEPS FOR
PREPROCESSING
IMAGE DATA
SPLITTING DATA:
TRAINING,
VALIDATION AND
TEST SETS
SPLITTING DATA: TRAINING,
VALIDATION AND TEST SETS
Splitting the dataset into
training, validation, and test sets
is crucial for assessing a model’s
performance effectively.
What is Training, Validation
and Test Set?

Training Set:
Used to train the model.
Validation Set:
Used to adjust settings and check the model’s
performance during training.
Test Set:
Used only after training to measure how well the
model performs on new data.
EXAMPLE:
If you have 1,000 images, you might split
them as follows:
Training Set: 70% (700 images)
Validation Set: 15% (150 images)
Test Set: 15% (150 images)
Why is it Important?

Splitting data helps prevent


overfitting, ensuring the
model learns patterns rather
than memorizing specific
images.
CONVERTING IMAGES
TO TENSORS AND
LOADING DATA
CONVERTING IMAGES TO
TENSORS AND LOADING DATA

CONVERTING IMAGES TO TENSORS


FORMATS DATA FOR MODELS, WHILE
LOADING ORGANIZES IT INTO BATCHES
FOR TRAINING.
Example of Converting Image to Tensors:
If you have a 1024x1024 pixel RGB image,
converting it to a tensor might produce a
tensor of shape [3, 1024, 1024], where 3 is
the number of color channels (RGB) and
1024x1024 is the image's dimensions.
NOTE: CONVERTING AN IMAGE TO A
TENSOR TRANSFORMS THE PIXEL VALUES
INTO NUMBERS, MAKING IT EASIER FOR
NEURAL NETWORKS TO PROCESS. THE
IMAGE'S DIMENSIONS AND COLORS
REMAIN, BUT THE DATA IS NOW IN A
FORMAT THAT MACHINES CAN WORK WITH.
Example of Loading Data:
If you have an image file, loading data
would involve reading these files into
memory using a library like PIL (Python
Imaging Library) or OpenCV.
Why is it Important?
Loading data reads images, and
converting them to tensors prepares
them for the model to process.
RESIZING
IMAGES
RESIZING IMAGES

RESIZE ALL IMAGES TO A


CONSISTENT SIZE SO THE
MODEL CAN PROCESS
THEM EFFICIENTLY.
EXAMPLE:
An image of 1024x1024 pixels is
resized to 224x224 pixels to
standardize the input.
Why is it Important?
Resizing helps the model handle
images more easily and ensures
that the images are all the same
size for processing.
NORMALIZING
PIXEL VALUES
NORMALIZING PIXEL
VALUES
PIXEL VALUES ARE SCALED TO A
RANGE BETWEEN 0 AND 1 BY
DIVIDING BY 255. THIS ENSURES
ALL VALUES ARE WITHIN A
SIMILAR SCALE.
EXAMPLE:
A pixel value of 246 (the Blue
Channel in RGB) is normalized
to 0.96 (246/255).
NOTE: NORMALIZATION SCALES THE
PIXEL VALUES OF AN IMAGE WITHOUT
CHANGING ITS SIZE OR DIMENSIONS, THIS
CHANGE IN PIXEL VALUES IS NOT
VISUALLY NOTICEABLE IN THE IMAGE.
Why is it Important?
Normalization prevents some pixel
values from dominating the learning
process, making the training more
stable and efficient.
DATA LOADING
WITH BATCHING
DATA LOADING WITH
BATCHING
IMAGES ARE GROUPED INTO
BATCHES, ALLOWING THE MODEL TO
PROCESS SEVERAL IMAGES AT
ONCE.
EXAMPLE:

A batch might contain 32


images that are processed
together before the model
updates.
Why is it Important?
Batching improves memory
efficiency, speeds up training, and
stabilizes the model’s learning by
averaging updates across the
batch.
ADDITIONAL STEPS:
1. Data Augmentation: Adds variety by rotating,
flipping, zooming, etc.
Importance: Prevents overfitting and improves model
generalization.
2. Image Denoising and Smoothing: Reduces noise
with filters like Gaussian blur.
Importance: Helps the model focus on key features,
reducing distractions.
3. Histogram Equalization: Enhances contrast by
adjusting pixel intensity distribution.
Importance: Makes features clearer, improving
feature detection.
ADDITIONAL STEPS:

4. Color Space Conversion: Changes color format


(RGB to grayscale).
Importance: Simplifies data when color isn’t essential,
reducing model complexity.

5. Image Cropping and Centering: Focuses on the


main subject by cropping or centering.
Importance: Directs model’s attention to important
parts of the image.
Conclusion
These preprocessing steps help
ensure that images are properly
formatted for training neural
networks, leading to better model
performance, faster training, and
more accurate predictions.
THAT’S ALL
THANK YOU!

You might also like