liveBook · Manning

Contrastive learning

As explained in Outlier Detection in Python

A representation-learning technique that brings embeddings of similar items closer together and separates embeddings of dissimilar items.

Contrastive learning trains a neural network to place embeddings of similar items close together and embeddings of dissimilar items farther apart. For images, altered views such as crops or rotations represent the same object; tabular data lacks equally reliable transformations, making suitable pretext tasks harder to design. section 16.5.4

For tabular outlier detection, internal contrastive learning creates feature subsets from each row. Subsets from one row should receive similar embeddings, while embeddings from different rows should remain distinct; unusual records can therefore be identified through the learned representation and resulting scores. section 16.5.5

Applying ICL with DeepOD

DeepOD provides an ICL estimator with a compact workflow: instantiate ICL, fit it to X, and obtain outlier scores with decision_function(X).

How Outlier Detection in Python covers it

How deep it goes
Defines the embedding objective and sketches ICL, but defers detailed implementation and training mechanics.
Examples
Uses altered images, tabular feature subsets, and KDD Cup records scored through DeepOD.
What you can do after
Apply it via DeepOD’s ICL estimator to fit tabular data and compute outlier scores.
How it connects
Connects self-supervised learning, embeddings, neural networks, feature transformations, and outlier detection.

Also explained in

Compare how 2 books explain contrastive learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Outlier Detection in Python. The section links point to the parts of the book it draws on.