Builds a convolutional neural network (CNN) using TensorFlow and Keras to classify images from the CIFAR-10 dataset into 10 categories. The model processes and normalizes the data, utilizes convolutional layers for feature extraction, and achieves high accuracy through training and evaluation.
Data Loading and Preprocessing:
-
Loading CIFAR-10 dataset using TensorFlow.
-
Reshaping and normalizing image data.
-
One-hot encoding of labels.
Exploratory Data Analysis (EDA):
- Visualizing sample images from the dataset.
Model Architecture:
-
Building a CNN with multiple Conv2D, MaxPool2D, and Dropout layers.
-
Adding fully connected (Dense) layers for classification.
Model Compilation and Training:
-
Compiling the model using Adam optimizer and categorical cross-entropy loss.
-
Training the model over 20 epochs.
Model Evaluation:
-
Evaluating the model's performance on test data.
-
Calculating accuracy and loss.
Predictions:
-
Making predictions on a batch of test images.
-
Decoding predictions into corresponding class labels.
Visualization of Predictions:
- Displaying test images alongside their predicted labels and ground truth.