Intelligent Projects Using Python

Book Description

Implement machine learning and deep learning methodologies to build smart, cognitive AI projects using Python

Key Features

  • A go-to guide to help you master AI algorithms and concepts
  • 8 real-world projects tackling different challenges in healthcare, e-commerce, and surveillance
  • Use TensorFlow, Keras, and other Python libraries to implement smart AI applications

Book Description

This book will be a perfect companion if you want to build insightful projects from leading AI domains using Python.

The book covers detailed implementation of projects from all the core disciplines of AI. We start by covering the basics of how to create smart systems using machine learning and deep learning techniques. You will assimilate various neural network architectures such as CNN, RNN, LSTM, to solve critical new world challenges. You will learn to train a model to detect diabetic retinopathy conditions in the human eye and create an intelligent system for performing a video-to-text translation. You will use the transfer learning technique in the healthcare domain and implement style transfer using GANs. Later you will learn to build AI-based recommendation systems, a mobile app for sentiment analysis and a powerful chatbot for carrying customer services. You will implement AI techniques in the cybersecurity domain to generate Captchas. Later you will train and build autonomous vehicles to self-drive using reinforcement learning. You will be using libraries from the Python ecosystem such as TensorFlow, Keras and more to bring the core aspects of machine learning, deep learning, and AI.

By the end of this book, you will be skilled to build your own smart models for tackling any kind of AI problems without any hassle.

What you will learn

  • Build an intelligent machine translation system using seq-2-seq neural translation machines
  • Create AI applications using GAN and deploy smart mobile apps using TensorFlow
  • Translate videos into text using CNN and RNN
  • Implement smart AI Chatbots, and integrate and extend them in several domains
  • Create smart reinforcement, learning-based applications using Q-Learning
  • Break and generate CAPTCHA using Deep Learning and Adversarial Learning

Who this book is for

This book is intended for data scientists, machine learning professionals, and deep learning practitioners who are ready to extend their knowledge and potential in AI. If you want to build real-life smart systems to play a crucial role in every complex domain, then this book is what you need. Knowledge of Python programming and a familiarity with basic machine learning and deep learning concepts are expected to help you get the most out of the book

Publisher Resources

Download Example Code

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Intelligent Projects Using Python
  3. About Packt
    1. Why subscribe?
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Code in action
      4. Conventions used
    4. Get in touch
      1. Reviews
  6. Foundations of Artificial Intelligence Based Systems
    1. Neural networks
    2. Neural activation units
      1. Linear activation units
      2. Sigmoid activation units
      3. The hyperbolic tangent activation function
      4. Rectified linear unit (ReLU)
      5. The softmax activation unit
    3. The backpropagation method of training neural networks
    4. Convolutional neural networks
    5. Recurrent neural networks (RNNs)
      1. Long short-term memory (LSTM) cells
    6. Generative adversarial networks
    7. Reinforcement learning
      1. Q-learning 
      2. Deep Q-learning 
    8. Transfer learning
    9. Restricted Boltzmann machines
    10. Autoencoders 
    11. Summary
  7. Transfer Learning
    1. Technical requirements
    2. Introduction to transfer learning
    3. Transfer learning and detecting diabetic retinopathy
    4. The diabetic retinopathy dataset 
    5. Formulating the loss function
    6. Taking class imbalances into account
    7. Preprocessing the images 
    8. Additional data generation using affine transformation
      1. Rotation 
      2. Translation
      3. Scaling 
      4. Reflection
      5. Additional image generation through affine transformation
    9. Network architecture 
      1. The VGG16 transfer learning network
      2. The InceptionV3 transfer learning network
      3. The ResNet50 transfer learning network
    10. The optimizer and initial learning rate
    11. Cross-validation
    12. Model checkpoints based on validation log loss 
    13. Python implementation of the training process
      1. Dynamic mini batch creation during training 
    14. Results from the categorical classification
    15. Inference at testing time 
    16. Performing regression instead of categorical classification 
    17. Using the keras sequential utils as generator 
    18. Summary
  8. Neural Machine Translation
    1. Technical requirements
    2. Rule-based machine translation
      1. The analysis phase 
      2. Lexical transfer phase 
      3. Generation phase 
    3. Statistical machine-learning systems
      1. Language model 
        1. Perplexity for language models
      2. Translation model
    4. Neural machine translation
      1. The encoder–decoder model
      2. Inference using the encoder–decoder model
    5. Implementing a sequence-to-sequence neural translation machine
      1. Processing the input data
      2. Defining a model for neural machine translation
      3. Loss function for the neural translation machine
      4. Training the model
      5. Building the inference model
      6. Word vector embeddings
      7. Embeddings layer
      8. Implementing the embeddings-based NMT
    6. Summary
  9. Style Transfer in Fashion Industry using GANs
    1. Technical requirements
    2. DiscoGAN
    3. CycleGAN
    4. Learning to generate natural handbags from sketched outlines
    5. Preprocess the Images
    6. The generators of the DiscoGAN
    7. The discriminators of the DiscoGAN
    8. Building the network and defining the cost functions
    9. Building the training process
    10. Important parameter values for GAN training
    11. Invoking the training
    12. Monitoring the generator and the discriminator loss 
    13. Sample images generated by DiscoGAN
    14. Summary
  10. Video Captioning Application
    1. Technical requirements
    2. CNNs and LSTMs in video captioning
    3. A sequence-to-sequence video-captioning system
    4. Data for the video-captioning system
    5. Processing video images to create CNN features
    6. Processing the labelled captions of the video
    7. Building the train and test dataset
    8. Building the model
      1. Definition of the model variables
      2. Encoding stage
      3. Decoding stage
      4. Building the loss for each mini-batch
    9. Creating a word vocabulary for the captions
    10. Training the model
    11. Training results
    12. Inference with unseen test videos
      1. Inference function
      2. Results from evaluation
    13. Summary
  11. The Intelligent Recommender System
    1. Technical requirements
    2. What is a recommender system?
    3. Latent factorization-based recommendation system
    4. Deep learning for latent factor collaborative filtering
      1. The deep learning-based latent factor model
    5. SVD++
      1. Training model with SVD++ on the Movie Lens 100k dataset
    6. Restricted Boltzmann machines for recommendation
    7. Contrastive divergence
    8. Collaborative filtering using RBMs
    9. Collaborative filtering implementation using RBM
      1. Processing the input
      2. Building the RBM network for collaborative filtering
      3. Training the RBM
    10. Inference using the trained RBM
    11. Summary
  12. Mobile App for Movie Review Sentiment Analysis
    1. Technical requirements
    2. Building an Android mobile app using TensorFlow mobile
    3. Movie review rating in an Android app
    4. Preprocessing the movie review text
    5. Building the model
    6. Training the model
      1. The batch generator
    7. Freezing the model to a protobuf format 
    8. Creating a word-to-token dictionary for inference
    9. App interface page design
    10. The core logic of the Android app
    11. Testing the mobile app
    12. Summary
  13. Conversational AI Chatbots for Customer Service
    1. Technical requirements
    2. Chatbot architecture
    3. A sequence-to-sequence model using an LSTM
    4. Building a sequence-to-sequence model 
    5. Customer support on Twitter 
      1. Creating data for training the chatbot
      2. Tokenizing the text into word indices
      3. Replacing anonymized screen names
      4. Defining the model
      5. Loss function for training the model
      6. Training the model
      7. Generating output responses from the model
      8. Putting it all together
      9. Invoking the training
      10. Results of inference on some input tweets
    6. Summary
  14. Autonomous Self-Driving Car Through Reinforcement Learning
    1. Technical requirements
    2. Markov decision process
    3. Learning the Q value function
    4. Deep Q learning
    5. Formulating the cost function
    6. Double deep Q learning
    7. Implementing an autonomous self-driving car
    8. Discretizing actions for deep Q learning
    9. Implementing the Double Deep Q network
    10. Designing the agent
    11. The environment for the self-driving car
    12. Putting it all together
      1. Helper functions
    13. Results from the training
    14. Summary
  15. CAPTCHA from a Deep-Learning Perspective
    1. Technical requirements
    2. Breaking CAPTCHAs with deep learning 
      1. Generating basic CAPTCHAs
      2. Generating data for training a CAPTCHA breaker
      3. Captcha breaker CNN architecture
      4. Pre-processing the CAPTCHA images
      5. Converting the CAPTCHA characters to classes
      6. Data generator
      7. Training the CAPTCHA breaker
      8. Accuracy on the test data set
    3. CAPTCHA generation through adversarial learning
      1. Optimizing the GAN loss
      2. Generator network
      3. Discriminator network
      4. Training the GAN
      5. Noise distribution
      6. Data preprocessing
      7. Invoking the training 
      8. The quality of CAPTCHAs during training 
      9. Using the trained generator to create CAPTCHAs for use
    4. Summary
  16. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product Information

  • Title: Intelligent Projects Using Python
  • Author(s): Santanu Pattanayak
  • Release date: January 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781788996921