Book Image

Python Artificial Intelligence Projects for Beginners

By : Dr. Joshua Eckroth
Book Image

Python Artificial Intelligence Projects for Beginners

By: Dr. Joshua Eckroth

Overview of this book

Artificial Intelligence (AI) is the newest technology that’s being employed among varied businesses, industries, and sectors. Python Artificial Intelligence Projects for Beginners demonstrates AI projects in Python, covering modern techniques that make up the world of Artificial Intelligence. This book begins with helping you to build your first prediction model using the popular Python library, scikit-learn. You will understand how to build a classifier using an effective machine learning technique, random forest, and decision trees. With exciting projects on predicting bird species, analyzing student performance data, song genre identification, and spam detection, you will learn the fundamentals and various algorithms and techniques that foster the development of these smart applications. In the concluding chapters, you will also understand deep learning and neural network mechanisms through these projects with the help of the Keras library. By the end of this book, you will be confident in building your own AI projects with Python and be ready to take on more advanced projects as you progress
Table of Contents (11 chapters)

Identifying handwritten mathematical symbols with CNNs


This sections deals with building a CNN to identify handwritten mathematical symbols. We're going to use the HASYv2 dataset. This contains 168,000 images from 369 different classes where each represents a different symbol. This dataset is a more complex analog compared to the popular MNIST dataset, which contains handwritten numbers.

The following diagram depicts the kind of images that are available in this dataset:

 

And here, we can see a graph showing how many symbols have different numbers of images:

It is observed that many symbols have few images and there are a few that have lots of images. The code to import any image is as follows:

 

We begin by importing the Image class from the IPython library. This allows us to show images inside Jupyter Notebook. Here's one image from the dataset:

This is an image of the alphabet A. Each image is 30 x 30 pixels. This image is in the RGB format even though it doesn't really need to be RGB. The...