Ultralytics YOLO27: Join the waitlist.
License YOLO
Back to Ultralytics Glossary

Unsupervised Learning

Unsupervised learning finds structure in unlabeled data, such as groups, compact features, and outliers, with methods like k-means, PCA, and autoencoders.

Unsupervised learning is the branch of machine learning that finds structure in data without labels. The model receives only inputs, such as images, sensor readings, or customer records, and learns how they are organized: which examples resemble each other, which features vary together, and which points look unlike the rest. Supervised learning needs a correct answer for every training example, and most collected data never gets one, so unsupervised methods are often the first look at a new dataset and the source of the groupings, compact features, and anomaly scores that later models build on.

Main Families of Methods#

Clustering groups similar examples. K-means clustering assigns each point to the nearest of k centroids, DBSCAN grows clusters from dense regions and labels isolated points as noise, and Gaussian mixture models fit overlapping probability distributions with the expectation-maximization algorithm.

Dimensionality reduction compresses many features into a few that keep most of the information. Principal component analysis (PCA) finds the directions of greatest variance, and t-SNE and UMAP place high-dimensional points on a 2D map for data visualization. Autoencoders learn the same kind of compression with a neural network that must reconstruct its own input.

Density estimation models how likely each input is, which makes anomaly detection possible from normal data alone: a model trained only on intact parts or ordinary transactions flags whatever it finds improbable. Association rule mining, such as the Apriori algorithm, finds items that occur together in shopping baskets or event logs.

Learning and Evaluating Without Labels#

Without targets, each method optimizes a criterion defined on the inputs themselves: k-means minimizes the distance from points to their cluster centers, PCA and autoencoders minimize reconstruction error, and mixture models maximize the likelihood of the data. Accuracy cannot be measured directly, so results are judged with internal scores such as the silhouette coefficient, by how useful the output is downstream, or against labels held back for evaluation only.

This scikit-learn example clusters 1,797 handwritten digit images by their pixel values and then compares the clusters with the digit labels the algorithm never saw:

from sklearn.cluster import KMeans
from sklearn.datasets import load_digits
from sklearn.metrics import adjusted_rand_score

# Load 1,797 handwritten digit images as 64 pixel values each, then set the labels aside
X, y = load_digits(return_X_y=True)

# Group the images into 10 clusters using the pixels alone
kmeans = KMeans(n_clusters=10, n_init=10, random_state=0)
clusters = kmeans.fit_predict(X)

# Compare the clusters with the digit labels the model never saw
print(f"Adjusted Rand index: {adjusted_rand_score(y, clusters):.2f}")

The adjusted Rand index is 1.0 for a perfect match and about 0 for chance agreement, and here it is 0.67. Zeros, fours, and sixes each land almost entirely in their own cluster, while one cluster mixes 100 ones with 100 eights.

Unsupervised, Semi-Supervised, and Self-Supervised Learning#

Semi-supervised learning combines a small labeled set with a large unlabeled one, usually by training on the labels and then learning from the model's own confident predictions. Self-supervised learning is usually counted as unsupervised learning and is how most large deep learning models learn from unlabeled data: it creates prediction targets from the data, such as the next word in a sentence or the hidden patches of an image in masked autoencoders. Large language models are pretrained this way on unlabeled text, and Meta's DINOv2 learned general-purpose image features from 142 million images without labels. Reinforcement learning is a separate setting, where the signal is a reward for actions rather than structure in a fixed dataset.

Applications#

Computer vision teams use unsupervised methods to explore datasets before labeling or training: clustering image embeddings reveals near-duplicates, outliers, and over-represented scenes that would skew a model. The Clustering panel on Ultralytics Platform does this for a whole dataset: it embeds every image, lays the images out on a 2D map, and with Color by set to Clusters marks each island of visually similar images, largest first, and lists points outside any island as Scattered. A burst of near-identical video frames or a few stray outliers stand out there before a YOLO26 model trains on the data.

Industrial inspection relies on the anomaly-detection side. Defects are rare and varied, so many defect detection systems learn the appearance of good parts only and flag any image region that deviates from it. Banks apply the same idea to transactions in fraud detection, and retailers cluster purchase histories into customer segments for marketing and recommendation systems. In single-cell genomics, researchers cluster the gene-expression profiles of thousands of individual cells and plot them with UMAP to discover cell types without knowing them in advance.

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Turn drone and aerial imagery into real-time insights for agriculture, aquaculture, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Apply computer vision in aerospace with Ultralytics YOLO for aircraft inspection, runway FOD detection, airport ground operations, and composite defect detection.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning