An Artificial Neural Network (ANN) is a computational model inspired by the biological neural structures of the human brain. It consists of interconnected nodes called neurons arranged in layers that work together to process data and learn patterns.
A standard neural network has three types of layers:
| Layer | Role |
|---|---|
| Input Layer | Receives raw data (features) |
| Hidden Layer(s) | Processes data using weights, biases, and activation functions |
| Output Layer | Produces the final prediction or classification |
A network with multiple hidden layers is called a deep neural network.
The output of a single neuron is computed as:
Deep Learning is a subset of machine learning that uses artificial neural networks with multiple hidden layers (deep architectures). These deep architectures allow the model to automatically learn hierarchical representations and complex patterns from large amounts of data — without manual feature engineering.
The word deep refers to the depth of the network — the number of hidden layers. A shallow network has one hidden layer; a deep network has many.
Data flows from the input layer through hidden layers to the output layer, producing a prediction.
The loss function measures the difference between the predicted output and the actual (correct) output. The goal of training is to minimise this loss.
Backpropagation is the algorithm used to train neural networks. It works by:
During a successful training session, the error (loss) decreases as weights are optimised over multiple iterations (epochs).
Deep Learning excels at tasks involving large, complex datasets:
| Application Area | Example |
|---|---|
| Computer Vision | Facial recognition, image classification, object detection |
| Natural Language Processing (NLP) | Chatbots, machine translation, sentiment analysis |
| Speech Recognition | Voice assistants (Siri, Google Assistant) |
| Medical Diagnosis | Detecting tumours in X-rays and MRI scans |
| Autonomous Vehicles | Real-time object and lane detection |
| Recommendation Systems | Netflix, YouTube content suggestions |
To evaluate how well a machine learning or deep learning model performs, we use the following key metrics:
Best used when classes are balanced.
Answers: Of all the items I predicted as positive, how many actually were?
Answers: Of all the actual positives, how many did I correctly find?
The harmonic mean of precision and recall. Useful when the dataset is imbalanced (unequal class sizes).
The value of the loss function during training. A decreasing loss over epochs indicates the model is learning.
Example: A spam-detection model flags 90 out of 100 actual spam emails correctly but also flags 20 legitimate emails. Its recall is 90% but its precision is lower. The F1-score balances both.
| Concept | Key Point |
|---|---|
| ANN | Computational model inspired by the brain |
| Deep Learning | ANN with multiple hidden layers |
| Weights & Biases | Control signal strength and shift activation |
| Activation Function | Adds non-linearity |
| Backpropagation | Algorithm to minimise loss by updating weights |
| Accuracy | Overall correctness |
| Precision | Correctness of positive predictions |
| Recall | Coverage of actual positives |
| F1-Score | Balance of precision and recall |