The main types of machine learning are supervised learning, unsupervised learning, and reinforcement learning. Other important approaches include semi-supervised learning and self-supervised learning. They differ mainly in how a model learns from data: using labelled examples, discovering patterns without labels, learning from a combination of labelled and unlabelled data, or improving through rewards and penalties.
Machine learning is an important branch of artificial intelligence (AI) that enables computers to identify patterns in data and make predictions or decisions without requiring a programmer to define every individual rule. It is used in applications such as recommendation systems, fraud detection, speech recognition, predictive maintenance, and autonomous vehicles.
Understanding the different types of machine learning is essential for selecting the right approach when developing an AI application. Each learning approach uses data differently and solves a different category of problems.
For embedded developers, machine learning is particularly useful when electronic devices need to recognize sensor patterns, detect abnormal operating conditions, classify physical movements, or make predictions without continuously depending on cloud connectivity.
Machine learning (ML) is a branch of artificial intelligence in which a program improves at a task by finding patterns in data, instead of following rules a programmer wrote for every situation.
Take the job of detecting a faulty motor from its vibration signal. With traditional programming, you would hand-write threshold rules such as “if the amplitude at this frequency crosses X, raise an alarm.” Those rules fall apart the moment the motor, the load or the mounting changes. With machine learning, you feed an algorithm hundreds of vibration recordings and let it work out which patterns separate healthy from faulty.
Tom Mitchell’s well-known definition (Machine Learning, 1997) makes this precise: a program learns from experience E on a task T, measured by a performance measure P, if its performance on T improves as E grows.
Key points to remember:
Almost every ML project follows the same workflow:
On an embedded device, step 5 is where things get interesting. The model has to fit into kilobytes of memory and run on a few milliwatts, which is why the type of learning and the size of the model matter so much. If you want the bigger picture first, start with our guide to AI and machine learning concepts.
Before examining the different learning approaches, it is important to understand a few basic terms.
A dataset is a collection of information used to train and evaluate a machine learning model.
For example, a motor monitoring dataset may contain vibration measurements, temperature readings, electrical current, and motor operating conditions.
Features are the individual input variables used by a model to identify patterns.
Examples include:
A label is the expected result associated with a training example in supervised learning.
For example, a vibration measurement may have a label such as “Normal” or “Fault”.
Labels are not required in every type of machine learning.
A model is the mathematical representation learned from training data. It receives new input data and produces a prediction or output.
Training is the process through which an algorithm adjusts model parameters to learn relationships from the available data.
Inference is the process of using an already-trained model to produce predictions from new input data.
In a typical embedded AI project, training happens on a computer or cloud platform, while inference may run directly on a microcontroller.
Machine learning generally follows a sequence of data-processing and model-development stages.
Basic working principle:
For example, consider a predictive maintenance system for an industrial motor. Sensors continuously measure vibration and temperature. A trained model processes these measurements to identify operating patterns and predict whether the motor is operating normally or showing signs of an abnormal condition.
An important engineering distinction is that training and inference are different operations. A microcontroller may have sufficient resources to run a compact trained model even when it does not have the memory or processing capacity required to train that model.
Machine learning approaches are commonly classified according to the learning signal provided to the model.
The three foundational categories are supervised learning, unsupervised learning, and reinforcement learning. Semi-supervised and self-supervised learning are also important approaches used in modern applications.
The following classification provides a simple overview:
These approaches are not all mutually exclusive. Self-supervised learning, for example, can be viewed as an approach that creates training targets from unlabelled data. The exact classification can vary between introductory ML resources and technical contexts.
Supervised learning is a type of machine learning in which a model is trained using labelled data. Each training example contains input features and the corresponding expected output.
The model learns the relationship between the input and output. After training, it uses that relationship to predict results for new data.
Example:
Suppose an industrial monitoring system collects motor vibration measurements. Engineers examine the measurements and label each sample as either “Normal” or “Fault”.
The supervised learning algorithm uses these labelled examples to learn the differences between operating conditions.
Main tasks in supervised learning:
Classification
Classification predicts a category or class.
Examples:
Regression
Regression predicts a numerical value.
Examples:
Common supervised learning algorithms:
Advantages:
Limitations:
Practical engineering insight:
For a motor fault detection project, collecting thousands of measurements is not enough. The dataset must represent different loads, speeds, environmental conditions, and actual fault conditions. Otherwise, the model may perform well during testing but fail when installed on a different motor.
Unsupervised learning is a type of machine learning that identifies patterns and relationships in data without requiring predefined labels.
Instead of learning from known answers, the algorithm examines the input data and discovers similarities, groups, or underlying structures.
Example:
An industrial facility collects vibration data from multiple machines without manually identifying every operating condition.
An unsupervised learning algorithm can group similar vibration patterns into clusters. Engineers can then examine these groups to understand different machine behaviours.
Common unsupervised learning techniques:
Clustering
Clustering groups similar data points according to their characteristics.
Common algorithms include:
Dimensionality Reduction
Dimensionality reduction reduces the number of variables while retaining useful information.
A common technique is Principal Component Analysis (PCA).
Anomaly Detection
Anomaly detection identifies observations that differ significantly from the normal patterns in a dataset. Depending on the algorithm and training setup, anomaly detection can be unsupervised or semi-supervised.
Applications:
Advantages:
Limitations:
Practical engineering insight:
Before applying clustering to sensor measurements, check whether the features use comparable scales. For example, temperature and vibration measurements may have very different numerical ranges. Poor scaling can cause some features to dominate distance-based algorithms such as K-Means.
Reinforcement learning is a type of machine learning in which an agent learns how to make decisions by interacting with an environment and receiving rewards or penalties.
Unlike supervised learning, the model is not given the correct output for every situation. It learns a strategy through repeated interactions.
Main components of reinforcement learning:
Working example:
Consider a robot designed to move through a warehouse.
Over many interactions, the agent attempts to develop a policy that maximises its cumulative reward.
Common reinforcement learning algorithms:
Applications:
Advantages:
Limitations:
Practical engineering insight:
For robotics and industrial control applications, reinforcement learning should generally be developed and tested in a suitable simulation before being considered for physical deployment. Safety interlocks and conventional control protections must remain independent of the learning agent where required.
Semi-supervised learning combines a small amount of labelled data with a larger amount of unlabelled data.
This approach is useful when collecting data is relatively easy but manually labelling every sample is expensive or time-consuming.
Example:
Consider an industrial company collecting 50,000 vibration samples from production equipment. Only 1,000 samples have been reviewed and labelled by maintenance experts.
A semi-supervised learning approach can use both the labelled and unlabelled samples during training.
Common techniques include:
Applications:
Advantages:
Limitations:
Practical engineering insight:
In industrial projects, expert-reviewed labels should be treated as the reference dataset. Automatically generated pseudo-labels must be checked carefully because an incorrect label can reinforce a model’s existing mistakes.
Self-supervised learning is an approach in which a model generates its own training targets from the available data instead of depending on manually assigned labels for every example.
The model learns useful representations by solving a task created from the original data.
Example:
A language model receives a sentence with selected words hidden. Its task is to predict the missing words using the surrounding context.
Similarly, an image model may learn by comparing different transformed views of the same image.
The model learns patterns and relationships from the data without requiring a human to label every training example.
Common techniques include:
Applications:
Advantages:
Limitations:
Practical engineering insight:
Self-supervised pretraining can help models learn general patterns from large sensor datasets. However, a model intended for a specific embedded product still needs evaluation using data that represents its actual operating environment.
Generative AI is often included in introductory discussions of machine learning categories. However, it is more accurate to describe generative AI as a model capability or task family rather than a separate learning paradigm equivalent to supervised or reinforcement learning.
Generative AI produces new content, such as text, images, audio, video, or code, based on patterns learned from training data.
Examples include:
Generative models may use self-supervised pretraining, followed by supervised fine-tuning or reinforcement-based optimisation.
Another important distinction: Deep learning is a subfield of machine learning that uses multi-layer neural networks. It is not a separate learning paradigm alongside supervised and unsupervised learning.
Machine learning offers several benefits across software, electronics, and industrial systems.
Machine learning can identify relationships in large datasets when fixed programming rules are difficult to define.
It can automate tasks such as image classification, fault detection, speech recognition, and demand forecasting.
Models can identify abnormal trends in sensor measurements and help maintenance teams investigate possible equipment problems.
Machine learning algorithms can process large amounts of information and identify patterns that may not be immediately visible.
Compact models can run on suitable embedded processors, allowing applications to perform inference locally.
Despite its benefits, machine learning also has practical limitations.
A machine learning model should therefore be evaluated not only by its accuracy but also by its reliability under actual operating conditions.
Machine learning is used across several industries. The specific learning approach depends on the problem, available data, and required output.
Machine learning supports driver assistance, object recognition, predictive maintenance, and analysis of vehicle sensor data.
For example, a classification model can process camera information to identify objects such as vehicles, pedestrians, and road signs.
Machine learning supports medical image analysis, patient risk prediction, and clinical decision-support applications.
For example, image classification models can assist trained professionals in analysing medical images. These systems require appropriate validation and must not be treated as a replacement for qualified medical judgement.
Factories use machine learning for equipment monitoring, quality inspection, and production optimisation.
A vibration-based anomaly detection system can identify operating conditions that differ from previously observed normal patterns.
Smartphones, smart speakers, and other consumer devices use machine learning for speech recognition, image processing, recommendation systems, and predictive features.
Robotic systems use machine learning for object recognition, movement planning, navigation, and decision-making.
IoT devices collect data from sensors and use machine learning to identify trends, detect unusual behaviour, or predict operating conditions.
Machine learning can support voice recognition, energy consumption prediction, occupancy detection, and automated device control.
Machine learning can support predictive maintenance, sensor-data analysis, image processing, and operational decision support. Safety-critical aerospace applications require rigorous verification and certification processes.
A practical machine learning project requires more than selecting an algorithm. The following workflow helps developers move from an initial problem statement to a tested application.
Step 1: Define the Problem
Identify the required output. Decide whether the system needs to classify an input, predict a numerical value, identify unusual patterns, or select an action.
Step 2: Collect Data
Gather relevant data using sensors, test equipment, databases, or other sources.
For an embedded project, record sensor sampling rates, units, operating conditions, and device identifiers.
Step 3: Prepare the Dataset
Remove invalid readings, handle missing values, and prepare useful features.
Step 4: Select the Learning Approach
Choose supervised learning when reliable labelled examples are available. Consider unsupervised or semi-supervised methods when labels are limited or unavailable.
Step 5: Train the Model
Train the selected algorithm using the training dataset.
Step 6: Evaluate the Model
Use separate validation and test datasets. Select suitable metrics such as precision, recall, F1-score, confusion matrix, or regression error.
Step 7: Optimise the Model
Reduce memory usage and inference time where necessary. Consider quantisation or a smaller architecture when targeting a constrained device.
Step 8: Deploy and Monitor
Integrate the model into the target application and test it using real operating conditions.
The following example demonstrates supervised learning using a Random Forest classifier. The model uses industrial motor measurements to classify operating conditions as normal or faulty.
The example assumes a CSV dataset named motor_sensor_features.csv with the following columns:
The status column contains the expected labels, such as Normal and Fault.
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
# Load the motor sensor dataset
data = pd.read_csv("motor_sensor_features.csv")
# Select input features
feature_columns = [
"vibration_rms",
"temperature_c",
"motor_current_a"
]
X = data[feature_columns]
# Expected output labels
y = data["status"]
# Divide data into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(
X,
y,
test_size=0.20,
random_state=42,
stratify=y
)
# Create the classification model
model = RandomForestClassifier(
n_estimators=100,
random_state=42
)
# Train the model
model.fit(X_train, y_train)
# Evaluate the model
predictions = model.predict(X_test)
print(classification_report(y_test, predictions))
# Predict the condition of a new motor sample
new_sample = pd.DataFrame([{
"vibration_rms": 0.35,
"temperature_c": 48.0,
"motor_current_a": 2.4
}])
result = model.predict(new_sample)
print("Predicted motor condition:", result[0])This is an illustrative training example. The numerical input values are sample values, not validated fault thresholds for an actual motor.
Pandas is used to load and process the dataset. Scikit-learn provides the machine learning algorithm, dataset splitting function, and evaluation tools.
The vibration, temperature, and motor current columns are selected as input variables.
The dataset is split into training and testing subsets. The model learns from the training data and is evaluated using the separate test data.
model.fit() trains the Random Forest classifier using the input features and their corresponding labels.
classification_report() provides precision, recall, F1-score, and other classification metrics.
The trained model predicts the operating condition of a new motor sample.
Engineering note: This example runs on a computer using Python and Scikit-learn. Deploying a model on an STM32 or another microcontroller requires a compatible implementation, memory planning, and hardware-specific testing.
| Learning Type | Training Data | Learning Method | Typical Applications |
| Supervised Learning | Labelled data | Learns from known input-output pairs | Classification, prediction, fault identification |
| Unsupervised Learning | Unlabelled data | Discovers patterns and groups | Clustering, anomaly analysis |
| Reinforcement Learning | Rewards and penalties | Learns through interaction | Robotics, sequential decision-making |
| Semi-Supervised Learning | Labelled and unlabelled data | Uses both data types | Image and sensor classification |
| Self-Supervised Learning | Unlabelled data with generated targets | Creates learning targets from the data | Language, speech, and image representation learning |
| Parameter | Supervised | Unsupervised | Reinforcement |
| Labels required | Yes | No | No predefined label for every action |
| Feedback | Expected output | Discovered data structure | Reward or penalty |
| Main objective | Predict an output | Discover patterns | Learn an action strategy |
| Example | Motor fault classification | Sensor-data clustering | Robot navigation |
| Common challenge | Label quality | Interpreting patterns | Reward design and training cost |
Selecting a machine learning algorithm is only one part of successful development. Engineers must also manage data quality, model evaluation, and deployment requirements.
Collect examples from different operating conditions. A dataset containing only normal operating measurements cannot teach a supervised fault classifier to recognise fault categories reliably.
Use separate datasets to train, tune, and evaluate the model. Avoid repeatedly adjusting the model based on the final test set.
Do not allow information from the test dataset to influence training or preprocessing.
For sensor applications, avoid placing highly similar overlapping windows from the same recording into both training and test datasets when that could produce misleading evaluation results.
Accuracy alone may not be sufficient, especially when fault examples are rare. Precision, recall, F1-score, and confusion matrices provide additional information.
For embedded deployment, estimate the available Flash, RAM, processor performance, inference latency, and power consumption before selecting a model architecture.
A model that performs well on a computer may behave differently when deployed on a microcontroller because of numerical precision, sensor differences, data conversion, and resource limitations.
Real-world sensor data can change with temperature, ageing, load, and installation conditions. Monitor the deployed model and collect new data when necessary.
Why it happens: Developers collect only a small number of examples or record data under limited operating conditions.
Impact: The model may fail when it encounters different inputs during actual operation.
Professional approach: Collect representative examples across different conditions and evaluate the model using independent data.
Why it happens: Developers select an algorithm before understanding the required output and the available data.
Impact: The model may solve a different problem from the one the application actually requires.
Professional approach: Define whether the application needs classification, regression, clustering, or decision-making before selecting the approach.
Why it happens: Raw sensor readings are passed directly into a model without checking their units, scales, noise, or invalid values.
Impact: The model may learn misleading patterns.
Professional approach: Establish a consistent preprocessing pipeline and apply the same transformations during training and inference.
Why it happens: Developers assume that good training accuracy indicates good model performance.
Impact: An overfitted model may perform poorly on new data.
Professional approach: Evaluate the model using independent validation and test datasets.
Why it happens: Developers train large models on computers without considering the target microcontroller.
Impact: The deployed model may exceed RAM or Flash capacity or fail to meet real-time requirements.
Professional approach: Profile memory usage and inference latency early. Select and optimise the model according to the target hardware.
Debugging should cover the complete data and inference pipeline, not only the model training algorithm.
For STM32-based applications, developers can use STM32 development tools, debugging interfaces, and hardware profiling methods to investigate firmware behaviour around model execution.
Embedded applications require models that satisfy memory, processing, latency, and energy requirements.
Model Quantization
Quantization reduces the numerical precision used to represent model parameters and, where supported, operations. Integer quantization can reduce storage and improve inference efficiency on compatible hardware.
Model Pruning
Pruning removes selected model parameters or connections to produce a smaller or more computationally efficient representation. Actual deployment benefits depend on the model structure and runtime support.
Model Architecture Selection
A smaller model may be more suitable than a complex neural network when the application uses only a limited number of sensor features.
Feature Selection
Using relevant input features can reduce unnecessary computation and simplify the model.
Hardware Acceleration
Where supported, use optimized libraries and hardware acceleration to improve inference performance. Examples include CMSIS-NN for suitable Arm Cortex-M applications and other platform-specific optimized kernels.
Memory Management
Estimate model storage and working memory before implementation. For TensorFlow Lite for Microcontrollers, developers must plan the tensor arena and supported operations carefully.
The best optimization strategy is to measure the final application on the actual target board rather than assuming that a smaller model will always be faster.
Machine learning knowledge is useful for students and professionals interested in artificial intelligence, data science, embedded systems, robotics, and IoT development.
A strong foundation includes:
For embedded developers, combining machine learning knowledge with C, C++, ARM Cortex-M, STM32, ESP32, and IoT development can open opportunities in Edge AI and TinyML projects.
Students can begin with a simple sensor-based classification project and gradually move towards model deployment on embedded hardware.
TinyML enables machine learning inference on low-power microcontrollers. It is useful for applications that need local intelligence without relying on continuous internet connectivity.
Edge AI processes data closer to where it is generated. This can reduce communication overhead and latency while supporting local data processing.
AI-assisted development tools are increasingly being used to support data analysis, code generation, debugging, and model development. Engineers still need to verify generated code, model performance, and hardware compatibility.
Research and engineering work continues to focus on efficient model architectures, quantization, optimisation, and deployment on devices with limited resources.
For embedded engineers, these developments make hardware-aware machine learning an important area of technical study.
Understanding the different types of machine learning helps developers select the appropriate learning approach for a particular problem. Supervised learning is suitable for labelled prediction tasks, unsupervised learning discovers patterns in unlabelled data, and reinforcement learning develops decision-making strategies through rewards and penalties. Semi-supervised and self-supervised approaches provide additional ways to learn from data when manual labelling is limited.
For embedded engineers, machine learning becomes especially valuable when combined with sensor interfacing, microcontroller programming, and hardware optimisation. Understanding both model development and embedded deployment provides a strong foundation for working with TinyML, Edge AI, IoT, and intelligent electronic systems.b
The main types of machine learning are supervised learning, unsupervised learning, and reinforcement learning. Semi-supervised and self-supervised learning are also widely used approaches. Each type uses a different learning method depending on whether the training data contains labels, automatically generated targets, or feedback through rewards and penalties.
Machine learning is a technology that allows computers to learn patterns from data and make predictions without requiring programmers to manually define every possible rule. For example, a machine learning system can examine previous motor sensor readings and identify patterns associated with normal or abnormal operating conditions.
Supervised learning trains a model using labelled examples containing the expected output. Unsupervised learning works with unlabelled data and attempts to identify patterns or groups. Supervised learning is commonly used for prediction and classification, while unsupervised learning is useful for clustering and exploratory data analysis.
Applications of machine learning include fraud detection, medical image analysis, recommendation systems, autonomous driving research, speech recognition, predictive maintenance, robotics, and industrial automation. In embedded systems, machine learning can process sensor data to identify physical movements, recognise audio patterns, and detect unusual equipment behaviour.
Indian Institute of Embedded Systems – IIES