Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Java for Data Science

You're reading from   Mastering Java for Data Science Analytics and more for production-ready applications

Arrow left icon
Product type Paperback
Published in Apr 2017
Publisher Packt
ISBN-13 9781782174271
Length 364 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alexey Grigorev Alexey Grigorev
Author Profile Icon Alexey Grigorev
Alexey Grigorev
Arrow right icon
View More author details
Toc

Deep learning for cats versus dogs


While MNIST is a very good dataset for educational purpose, it is quite small. Let's take a look at a different image recognition problem: given a picture, we want to predict if there is a cat on the image or a dog.

For this, we will use the dataset with dogs and cats pictures from a competition run on kaggle, and the dataset can be downloaded from https://www.kaggle.com/c/dogs-vs-cats.

Let's start by first reading the data.

Reading the data

For the dogs versus cats competition, there are two datasets; training, with 25,000 images of dogs and cats, 50% each, and testing. For the purposes of this chapter, we only need to download the training dataset. Once you have downloaded it, unpack it somewhere.

The filenames look like the following:

dog.9993.jpg dog.9994.jpg dog.9995.jpg

cat.10000.jpg cat.10001.jpg cat.10002.jpg

The label (dog or cat) is encoded into the filename.

As you know, the first thing we always do is to split the data into training and validation sets...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image