Book Image

Hands-On Python Deep Learning for the Web

By : Anubhav Singh, Sayak Paul
Book Image

Hands-On Python Deep Learning for the Web

By: Anubhav Singh, Sayak Paul

Overview of this book

When used effectively, deep learning techniques can help you develop intelligent web apps. In this book, you'll cover the latest tools and technological practices that are being used to implement deep learning in web development using Python. Starting with the fundamentals of machine learning, you'll focus on DL and the basics of neural networks, including common variants such as convolutional neural networks (CNNs). You'll learn how to integrate them into websites with the frontends of different standard web tech stacks. The book then helps you gain practical experience of developing a deep learning-enabled web app using Python libraries such as Django and Flask by creating RESTful APIs for custom models. Later, you'll explore how to set up a cloud environment for deep learning-based web deployments on Google Cloud and Amazon Web Services (AWS). Next, you'll learn how to use Microsoft's intelligent Emotion API, which can detect a person's emotions through a picture of their face. You'll also get to grips with deploying real-world websites, in addition to learning how to secure websites using reCAPTCHA and Cloudflare. Finally, you'll use NLP to integrate a voice UX through Dialogflow on your web pages. By the end of this book, you'll have learned how to deploy intelligent web apps and websites with the help of effective tools and practices.
Table of Contents (19 chapters)
1
Artificial Intelligence on the Web
3
Using Deep Learning for Web Development
7
Getting Started with Different Deep Learning APIs for Web Development
12
Deep Learning in Production (Intelligent Web Apps)
Appendix: Success Stories and Emerging Areas in Deep Learning on the Web

What this book covers

Chapter 1, Demystifying Artificial Intelligence and Fundamentals of Machine Learning, briefly introduces machine learning, deep learning, and other forms of artificial intelligence methodologies related to web development. This chapter quickly goes over fundamental topics of the machine learning pipeline, such as exploratory data analysis, data preprocessing, feature engineering, training and testing, models of evaluation, and more. Toward the end, a comparison between the interactivity and user experience offered by websites before AI became popular and how they are in the modern day is presented. We also study the usage of AI on the web by some of the biggest firms and how AI has revolutionized their products.

Chapter 2, Getting Started with Deep Learning Using Python, introduces basic concepts and terminologies related to deep learning and how to use deep learning to build a simple web app with different deep learning libraries in Python.

Chapter 3, Creating Your First Deep Learning Web Application, discusses several important concepts regarding the structure of web applications specifically for leveraging deep learning. It then proceeds to discuss the approaches to understanding a dataset. The chapter also shows how to implement and improve a simple neural network and how it can be wrapped into an API for the development of a simple web application. We then proceed to showcase how the API can be implemented using different standard web tech stacks.

Chapter 4, Getting Started with TensorFlow.js, introduces the most popular JavaScript library for deep learning—TensorFlow.js (Tf.js). It gives a brief overview of what TensorFlow.js is and the things it is capable of doing in a browser. Furthermore, this chapter shows how you can use pre-trained models using TensorFlow.js and build a simple web application with it.

Chapter 5, Deep Learning through APIs, introduces the concept of APIs and their importance in software development. Further, the chapter proceeds to show examples of different deep learning APIs. Toward the very end, the chapter presents an approach to choosing deep learning API providers to suit particular use cases. The deep learning APIs covered are the Vision API, the Text API, and others.

Chapter 6, Deep Learning on Google Cloud Platform Using Python, introduces the offerings by Google Cloud Platform for web developers to integrate into their websites. The focus is on Dialogflow, which can be used to make chatbots and conversational AIs; the Cloud Inference API, which can be used to build a good recommendation system; and also the Translation API, which is used to provide users in different locales with website content in their languages. The chapter discusses their applications at length and also demonstrates a basic how-to for using them with Python.

Chapter 7, DL on AWS Using Python: Object Detection and Home Automation, introduces Amazon Web Services and talks briefly about the various offerings, including the Alexa API and the Rekognition API. The Alexa API can be used to build home automation web apps and other interactive interfaces, while the Rekognition API can be used to detect people and objects in photos and videos.

Chapter 8, Deep Learning on Microsoft Azure Using Python, introduces Microsoft Azure Cloud Services, focusing on the Cognitive Toolkit, which is Microsoft's alternative to TensorFlow's Emotion API, which can be used to determine the emotion of a person from a photograph of their face, and the Text-to-Speech API, which can be used to generate natural-sounding voice from text.

Chapter 9, A General Production Framework for Deep Learning-Enabled Websites, introduces the general framework to be set up for the efficient deployment of deep learning on the web in a production environment. Strategies for reducing computing resources, converting raw datasets to datasets for training deep learning models, and how to make models available for usage on the web in a minimally resource-intensive way are covered.

Chapter 10Securing Web Apps with Deep Learning, discusses several tricks and techniques for securing websites with deep learning with Python. We present reCaptcha and Cloudflare and discuss how they are used to enhance the security of websites. We also show how to implement security mechanisms to detect malicious users on websites using deep learning on the Python backend.

Chapter 11DIY – A Web DL Production Environment, discusses the methods by which we update models in production and how we can choose the right method according to requirements. We begin with a brief overview and then demonstrate some famous tools for creating deep learning data flows. Finally, we implement a demo of online learning, or incremental learning, to establish a method of model update in production.

Chapter 12, Creating an E2E Web App Using DL APIs and Customer Support Chatbot, introduces natural language processing and discusses how to create a chatbot for resolving general customer support queries using Dialogflow and integrate it into a Django and Flask website. We explore ways of implementing bot personalities and how to make such system resources effective. We also introduce a method for implementing a text-to-speech and speech-to-text-based user interface with Python.

AppendixSuccess Stories and Emerging Areas in Deep Learning on the Web, illustrates some of the most famous websites whose products are based heavily upon leveraging the power of deep learning. This chapter also discusses some key research areas in web development that could be enhanced using deep learning. This will help you to delve even deeper into the fusion of web technologies and deep learning and will motivate you to come up with your own intelligent web applications.