Book Image

Artificial Vision and Language Processing for Robotics

By : Álvaro Morena Alberola, Gonzalo Molina Gallego, Unai Garay Maestre
Book Image

Artificial Vision and Language Processing for Robotics

By: Álvaro Morena Alberola, Gonzalo Molina Gallego, Unai Garay Maestre

Overview of this book

Artificial Vision and Language Processing for Robotics begins by discussing the theory behind robots. You'll compare different methods used to work with robots and explore computer vision, its algorithms, and limits. You'll then learn how to control the robot with natural language processing commands. You'll study Word2Vec and GloVe embedding techniques, non-numeric data, recurrent neural network (RNNs), and their advanced models. You'll create a simple Word2Vec model with Keras, as well as build a convolutional neural network (CNN) and improve it with data augmentation and transfer learning. You'll study the ROS and build a conversational agent to manage your robot. You'll also integrate your agent with the ROS and convert an image to text and text to speech. You'll learn to build an object recognition system using a video. By the end of this book, you'll have the skills you need to build a functional application that can integrate with a ROS to extract useful information about your environment.
Table of Contents (12 chapters)
Artificial Vision and Language Processing for Robotics
Preface

Building Your First CNN


Note

For this chapter, we are going to still use Keras on top of TensorFlow as the backend, as mentioned in Chapter 2, Introduction to Computer Vision of this book. Also, we will still use Google Colab to train our network.

Keras is a very good library for implementing convolutional layers, as it abstracts the user so that layers do not have to be implemented by hand.

In Chapter 2, Introduction to Computer Vision, we imported the Dense, Dropout, and BatchNormalization layers by using the keras.layers package, and to declare convolutional layers of two dimensions, we are going to use the same package:

from keras.layers import Conv2D

The Conv2D module is just like the other modules: you have to declare a sequential model, which was explained in Chapter 2, Introduction to Computer Vision of this book, and we also add Conv2D:

model = Sequential()
model.add(Conv2D(32, kernel_size=(3, 3), padding='same', strides=(2,2), input_shape=input_shape))

For the first layer, the input shape...