Applied Machine Learning with TensorFlow
Build end-to-end TensorFlow projects: tf.data pipelines and preprocessing layers, CNNs and transfer learning for images, TF-IDF and LSTM models for text, and models saved, exported and served.
Intermediate · Machine Learning · about 17 hours · 5 modules · certificate on completion
Taught by Élèna Petrovà, Rajèsh Krishnàn, AI Learning Companions.
About this course
Knowing how a neural network learns is one thing; getting real data into one, choosing the right architecture and shipping the result is another. This course is about the second. You'll build TensorFlow projects end to end on tabular data, images and text: input pipelines with tf.data, preprocessing layers that travel inside the model, and the Keras functional API for models with several inputs. For images you'll build convolutional networks from scratch, then reuse MobileNetV2's ImageNet features through transfer learning and fine-tuning, and meet the ideas behind object detection and segmentation, from IoU to non-maximum suppression.
For text you'll tokenise reviews, weigh up stop words, and compare bag-of-words and TF-IDF classifiers with embeddings and recurrent networks (SimpleRNN, GRU and LSTM), then save, export and serve the model so that it takes raw text. Every lab runs on a laptop CPU with small, generated datasets and fixed seeds. The capstone brings it together: a multimodal pipeline that reads a product review's text with an LSTM and its photo with a fine-tuned CNN, and combines them to predict the review's sentiment.
What you'll learn
- Manage and preprocess tabular, image and text data with tf.data pipelines and Keras preprocessing layers
- Construct and train convolutional neural networks for image classification, with data augmentation
- Apply transfer learning and fine-tuning to pre-trained models such as MobileNetV2
- Develop TF-IDF, embedding and recurrent (LSTM and GRU) models for text analysis and sentiment prediction
- Evaluate models with suitable metrics and validation strategies, then save, export and serve them
Skills you'll gain
TensorFlow, Keras functional API, tf.data pipelines, Convolutional neural networks, Transfer learning, Text classification, Word embeddings, LSTMs and GRUs, Model export and serving
Tools
Python 3, TensorFlow, Keras, pandas, scikit-learn, Pillow, Docker (optional, for TensorFlow Serving)
Before you start
Introduction to Neural Networks and TensorFlow, or equivalent: tensors, Dense layers, and compiling and fitting Keras models. Python with pandas, plus train/test splits and metrics (Machine Learning Foundations with Python). Install Python 3.10 or later, then pip install tensorflow pandas scikit-learn pillow (TensorFlow 2.16 or later). Module 3 downloads MobileNetV2's weights, about 9 MB, once.
Modules
TensorFlow Foundations
Get to know the TensorFlow ecosystem and the tools every project uses: tensors for real data, graphs for speed and export, tf.data input pipelines, Keras preprocessing layers with the functional API, and losses and metrics that fit the task.
- The TensorFlow ecosystem, tensors and graphs (12 min)
- Input pipelines with tf.data (12 min)
- Preprocessing layers and the functional API (14 min)
- Losses and metrics that fit the task (12 min)
- Hands-on lab: Predict churn with tf.data and preprocessing layers
Computer Vision Basics
See how convolutional networks process images: filters that detect edges and textures, padding and stride, pooling and activations, then build and train a CNN from an image folder, with data augmentation.
- Images as tensors and the convolution operation (12 min)
- Pooling, activations and a CNN architecture (12 min)
- Image datasets and data augmentation (12 min)
- Hands-on lab: Build a CNN for an image folder
Advanced Computer Vision
Reuse what large pre-trained networks have learned: transfer learning with a frozen base, fine-tuning its top layers, and the ideas behind object detection and image segmentation, from bounding boxes and IoU to classifying every pixel.
- Transfer learning with pre-trained models (14 min)
- Fine-tuning (12 min)
- Object detection and image segmentation (14 min)
- Hands-on lab: Transfer learning, fine-tuning and detection basics
NLP Fundamentals
Turn text into numbers a model can use: standardise and tokenise it, decide what to do with stop words, and represent documents as bags of words and TF-IDF vectors for fast, strong text classifiers.
- Standardising and tokenising text (12 min)
- Stop words, stemming and lemmatisation (10 min)
- Bag-of-words, n-grams and TF-IDF (14 min)
- Hands-on lab: Classify product reviews with bag-of-words and TF-IDF
Embeddings and RNNs
Represent words as learned dense vectors, process sequences with recurrent layers (SimpleRNN, GRU and LSTM), see how encoder-decoder models handle tasks like translation, and finish by saving, exporting and serving a text model.
- Word embeddings (12 min)
- Recurrent networks: SimpleRNN, LSTM and GRU (14 min)
- Sequence-to-sequence models and attention (10 min)
- Saving, exporting and serving models (12 min)
- Hands-on lab: Sentiment with recurrent networks, saved and exported
Project: Multimodal sentiment analysis pipeline
Online shops collect reviews that pair a few words with a photo of the product as it arrived. Build a TensorFlow pipeline that predicts each review's sentiment from both. make_multimodal.py generates the dataset: 900 reviews, each a short text and a 96 x 96 photo, labelled positive or negative. In about a third of the reviews the text doesn't reveal the sentiment, in about a third the photo shows only the closed parcel, and a few labels are wrong; two columns record which reviews are which, for analysis only. multimodal_starter.py loads the data into tf.data pipelines with a text input and a photo input, split into training, validation and test sets. Train an LSTM or GRU text model, fine-tune a pre-trained CNN such as MobileNetV2 on the photos (head first, then the top layers at a low learning rate), and combine the two, either by averaging their probabilities or with one functional model that concatenates both branches before its output. Compare all three on the validation data, then evaluate your chosen model on the test set once. Save and export it so that it takes raw text and pixels. The course's reference solution reached test accuracies of 0.83 for text alone, 0.75 for photos alone and 0.87 fused.
Part of
The products this course names are trademarks of their owners, who haven't made or endorsed it.