Reader small image

You're reading from  Neural Network Projects with Python

Product typeBook
Published inFeb 2019
Reading LevelBeginner
PublisherPackt
ISBN-139781789138900
Edition1st Edition
Languages
Right arrow
Author (1)
James Loy
James Loy
author image
James Loy

James Loy has more than five years, expert experience in data science in the finance and healthcare industries. He has worked with the largest bank in Singapore to drive innovation and improve customer loyalty through predictive analytics. He has also experience in the healthcare sector, where he applied data analytics to improve decision-making in hospitals. He has a master's degree in computer science from Georgia Tech, with a specialization in machine learning. His research interest includes deep learning and applied machine learning, as well as developing computer-vision-based AI agents for automation in industry. He writes on Towards Data Science, a popular machine learning website with more than 3 million views per month.
Read more about James Loy

Right arrow

Managing image data for Keras

One common problem encountered in neural network projects for image classification is that most computers do not have sufficient RAM to load the entire set of data into memory. Even for relatively modern and powerful computers, it would be far too slow to load the entire set of images into memory and to train a CNN from there.

To alleviate this problem, Keras provides a useful flow_from_directory method that takes as an input the path to the images, and generates batches of data as output. The batches of data are loaded into memory, as required before model training. This way, we can train a deep neural network on a huge number of images without worrying about memory issues. Furthermore, the flow_from_directory method allows us to perform image preprocessing steps such as resizing and other image augmentation techniques by simply passing an argument...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Neural Network Projects with Python
Published in: Feb 2019Publisher: PacktISBN-13: 9781789138900

Author (1)

author image
James Loy

James Loy has more than five years, expert experience in data science in the finance and healthcare industries. He has worked with the largest bank in Singapore to drive innovation and improve customer loyalty through predictive analytics. He has also experience in the healthcare sector, where he applied data analytics to improve decision-making in hospitals. He has a master's degree in computer science from Georgia Tech, with a specialization in machine learning. His research interest includes deep learning and applied machine learning, as well as developing computer-vision-based AI agents for automation in industry. He writes on Towards Data Science, a popular machine learning website with more than 3 million views per month.
Read more about James Loy