Image Preparation for Convolutional Neural Networks with TensorFlow's Keras API

deeplizard

Image Preparation for Convolutional Neural Networks with TensorFlow's Keras API by deeplizard

The video covers the steps necessary to prepare and organize image data for training a convolutional neural network (CNN) using TensorFlow's Keras API. The presenter works with a dataset of 25,000 cat and dog images, using a subset for efficiency and splitting the data into training, validation, and test subsets. They organize the data into respective directories and verify the images before formatting them into a Keras generator for processing in the neural network. The presenter also discusses the pre-processing function and the importance of distorting color data. The video concludes with a preview of the next step, building and training the first CNN.

00:00:00

In this section of the video, the presenter discusses the necessary preparation and processing steps for training a convolutional neural network to classify images as cats or dogs. They work with a dataset from the Kaggle Cats vs. Dogs competition and organize the data programmatically on disk, starting with manual steps to extract and rearrange the data. Once the data is organized, they split it into three directories for training, validation, and testing using a script that creates nested directories for dogs and cats within the train and validation directories and a separate test directory. They also import various packages to use throughout the course, including TensorFlow and Keras.

00:05:00

In this section, the presenter explains how they obtained and organized the data needed for their convolutional neural network (CNN) using TensorFlow's Keras API. They used a data set of 25,000 cat and dog images, but only used a small subset for efficiency purposes. They split this data randomly into training, validation, and test subsets with 500 cat and dog images for training, 100 cat and dog images for validation, and 50 cat and dog images for testing. The images were organized in respective directories and verified. Finally, the images were formatted into a Keras generator format to prepare for processing in the neural network. The presenter also discussed the pre-processing function used for the images before passing them to the sequential model.

00:10:00

In this section, the video presenter discusses the image preparation process for convolutional neural networks with TensorFlow's Keras API. They explain how images are processed in the same format as the popular vgg 16 model and how to specify the size of the images in your dataset. The presenter also mentions the classes for the potential labels of the dataset, setting the batch size, and verifying that images belonging to the correct classes are found on disk. They introduce the "plot images" function to display a single batch of images and their corresponding labels from the train batches. The pre-processing function applied to the images can distort color data, and the presenter promises to discuss the technical details and reasons for using it in a future video.

00:15:00

In this section, the presenter explains the image data obtained from Kaggle, which are skewed due to the lack of normalization, leading to the skewing of RGB data. However, the labels of the data are still identifiable through one-hot encoding, which represents whether the image is of a cat or a dog using a vector of 1s and 0s. The presenter notes that sometimes the corresponding labels for the test set may not be available, in which case the test data must be processed differently. The next step will involve building and training the first CNN, and the presenter also informs viewers about their vlog channel and other resources available on the website.

More from
deeplizard

No videos found.

Related Videos

No related videos found.

Trending
AI Music

No music found.