DEEP LEARNING

Deep Learning Explained: Neural Networks, CNNs and LSTMs, and When You Need Them

How a neural network learns, which architecture fits images, signals and text, and the honest test of whether deep learning is worth it on your data.

By EDWartens engineering team 20 February 2026 Updated 5 October 2026 8 min
Deep Learning Explained: Neural Networks, CNNs and LSTMs, and When You Need Them

Deep learning trains neural networks with many layers to learn their own features from raw data such as images, waveforms and text. It is the right tool when the input is too rich for hand-built features, and usually the wrong one for a small table of readings. You can learn it free with TensorFlow and Keras on edwartens.com.

“Neural Network Simply Explained | Deep Learning Tutorial 4 (Tensorflow2.0, Keras & Python)” by codebasics, 11 min. Played from the creator's own YouTube channel; the video belongs to them.

This lesson by codebasics is part of the first module of the free Deep Learning with TensorFlow and Keras course. That module asks you to say when deep learning beats a random forest and when it does not, to name TensorFlow, Keras, tensors and the GPU runtime, and to check the GPU in Colab. This companion explains the ideas behind the video and where each architecture fits.

How a neural network learns

A neuron takes several inputs, multiplies each by a weight, adds a bias and passes the sum through an activation function. ReLU, which passes positive values and zeroes negative ones, is the common choice in hidden layers. Stack neurons into layers and layers into a network, and you have a function with thousands or millions of adjustable weights.

Training adjusts those weights:

  1. Forward pass. Feed a batch of examples through and get predictions.
  2. Loss. Measure how wrong they are. Mean squared error for numbers, cross-entropy for classes.
  3. Backpropagation. Use the chain rule to work out how much each weight contributed to the error.
  4. Gradient descent. Nudge every weight a small step in the direction that reduces the loss. The step size is the learning rate.
  5. Repeat over many batches and epochs, watching the loss on data the network has not trained on.

The pairing of output and loss matters and trips beginners up: a sigmoid output with binary cross-entropy for yes-or-no, softmax with categorical cross-entropy for several classes, a linear output with mean squared error for a number.

The architectures, and what each is for

Which network for which data
Which network for which data

Convolutional networks (CNNs) slide small learned filters across an image, so the same edge or scratch detector works anywhere in the frame. They are the workhorse of visual inspection, as the computer vision training guide explains. 1-D CNNs do the same along a signal, which suits fixed windows of vibration or current.

Recurrent networks, in practice LSTMs and GRUs, carry a memory from one time step to the next, so they can use what happened earlier in a sequence.

Autoencoders learn to compress and rebuild their input. Train one on healthy data only, and a high rebuild error means "this does not look normal", a useful anomaly score when failures are too rare to label.

Transformers use attention to weigh every part of a sequence against every other part. They power today's large language models; the generative AI guide covers them from the user's side.

When a random forest is enough

On a table of a few dozen engineered features, such as RMS, kurtosis, temperature rise and load, a random forest or gradient boosting model is often as accurate as a neural network, trains in seconds and is far easier to explain. Deep learning earns its place when the raw input is large and structured: pixels, long waveforms, text.

Is deep learning worth it on this problem?
Is deep learning worth it on this problem?

Run the forest first. If the deep model cannot beat it on the same held-out test set, ship the forest.

Training well: the habits that matter

  • Watch both curves. Training loss falling while validation loss rises means overfitting.
  • Early stopping ends training when validation loss stops improving and restores the best weights.
  • Dropout randomly switches off neurons during training so the network cannot lean on any one of them.
  • Class weights or resampling when defects or faults are rare.
  • Data augmentation for images: flips, small rotations and brightness changes, but only those that could really happen on your line.
  • Transfer learning: start from a network pretrained on a large image set and retrain the last layers on your few hundred pictures. This is how most small industrial vision projects become possible.

Report per-class recall rather than a single accuracy figure, and use a method such as Grad-CAM to show which part of an image drove a prediction. If the network is looking at the background, the lighting or a label on the fixture, you have found a problem before it reaches the line.

A first exercise that teaches the judgement

Before any image work, run one comparison in Colab. Take a table of engineered features from a sensor dataset and train two models on the same split: a random forest and a small dense network with two hidden layers, early stopping and dropout. Report the same metric for both on the same test set. Most of the time the forest is at least as good and far quicker.

Then change the input. Give a small convolutional network raw images, or give a 1-D CNN raw signal windows instead of hand-built features, and repeat the comparison. This is where deep learning starts to pay. Doing both halves yourself teaches the judgement the checklist above asks for, and it gives you a short write-up an interviewer will want to discuss.

From notebook to machine

A trained model is only useful where it runs. TensorFlow Lite, now developed by Google as LiteRT, converts a Keras model for small devices, and quantisation shrinks it further at some cost in accuracy. Always measure the speed on the device you will actually use, because a model that is accurate but too slow for the line rate has to be redesigned. Edge AI in industrial automation covers when running models on the plant floor makes sense.

Free deep learning training: the route

  1. [Machine Learning with Python](/free/machine-learning-with-python) first, for train and test discipline, metrics and leakage. The machine learning beginner's guide explains those ideas.
  2. [Deep Learning with TensorFlow and Keras](/free/deep-learning-with-tensorflow), intermediate, built on the Keras API: Keras models, tf.data pipelines, CNNs and transfer learning, 1-D CNNs, LSTMs and autoencoders on sensor windows, Grad-CAM and TensorFlow Lite. The project classifies surface defects end to end.
  3. Then apply it: [Machine Vision and Quality Inspection](/free/machine-vision-quality-inspection) for cameras and YOLO detectors, or [Predictive Maintenance with Machine Learning](/free/predictive-maintenance-with-machine-learning) for signals.

Wondering about frameworks? TensorFlow vs PyTorch for engineers compares the two. The Applied AI engineer path groups machine learning, vision, deep learning and RAG.

Start the free course

Create a free account and open Deep Learning with TensorFlow and Keras. The first practice task switches Colab to a GPU runtime, prints the TensorFlow version and multiplies a small tensor, so you know the setup works before any theory. The course ends with one 15-question final assessment, a 60% pass mark and three attempts, then a 24-hour wait and a fresh paper.

Learning is free in full. The optional EDWartens Certificate of Completion for this intermediate course is a small one-off fee, and checkout shows your price. Anyone can check it at edwartens.com/verification. It is not a Google or TensorFlow certification and is not an accredited qualification.

Take the free course

Questions

What is the difference between machine learning and deep learning?

Deep learning is the part of machine learning that uses neural networks with many layers. Classic machine learning usually relies on features you design; deep learning learns its own features from raw inputs such as pixels or waveforms.

Do I need a GPU to learn deep learning?

Not your own. Google says Colab gives free access to GPUs, though heavily restricted on the free tier, and small models on signal windows train on a CPU. The EDWartens course runs in Colab.

Should I learn TensorFlow or PyTorch?

Either teaches the same ideas. The EDWartens course uses TensorFlow and Keras; the TensorFlow vs PyTorch post on this blog compares them for engineers.

What should I learn before deep learning?

Python, Pandas and classic machine learning: train and test splits, metrics and leakage. Without those habits a deep model is easy to fool yourself with.

What does the deep learning certificate cost?

The course is free. The optional EDWartens certificate for this intermediate course is a small one-off fee, and checkout shows your price.

Sources

Written by the EDWartens engineering team for general education. Product names are trademarks of their owners; mentioning them does not imply endorsement. Prices and terms of other providers were checked on the date shown and can change.