liveBook · Manning

Pixel

As explained in Bayesian Optimization in Action

A pixel is an individual spatial element representing visual information at a location in an image.

A pixel is an individual spatial element representing visual information at a location in an image. Pixel values encode signal intensity and form the image’s structured data. section 13.2.2 section 13.1

In the MNIST representation:

  • Each image is a 28-by-28 matrix, containing 784 pixel positions. section 13.2.2 section 13.1
  • Each pixel is represented by an integer from 0 to 255 rather than an arbitrary fractional value. section 13.1
  • Flattening the matrix places the pixel values in a PyTorch tensor that can be processed by machine-learning models. section 13.2.2

Pixels and image similarity

An RBF kernel can compare handwritten digits by measuring differences between corresponding pixel values. This may assign high covariance to images with similar strokes even when their labels differ, while assigning low covariance to visually different images sharing a label. Pixel-level similarity therefore does not necessarily capture higher-level visual patterns. section 13.2.3

>>> train_x[0, :]
tensor([ 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   3,  18,
        18,  18, 126, 136, 175,  26, 166, 255, 247, 127,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,  30,  36,  94, 154, 170, 253,
       253, 253, 253, 253, 225, 172, 253, 242, 195,  64,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,  49, 238, 253, 253, 253, 253, 253,
       253, 253, 253, 251,  93,  82,  82,  56,  39,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,  18, 219, 253, 253, 253, 253, 253,
       198, 182, 247, 241,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,  80, 156, 107, 253, 253, 205,
        11,   0,  43, 154,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   0,   0,   0,   0,  14,   1, 154, 253,  90,
[output truncated]

Inspecting the tensor exposes individual pixel values directly, including the many low-signal entries surrounding handwritten strokes. section 13.2.2

How Bayesian Optimization in Action covers it

How deep it goes
Defines pixel structure, value ranges, tensor storage, and kernel-comparison limitations without developing image-processing internals.
Examples
Uses MNIST handwritten digits, 28-by-28 tensors, heat-map visualization, and RBF covariance comparisons.
What it assumes
Assumes basic images and tensors while introducing structured-data constraints through pixel values.
What you can do after
Evaluate how pixel-level similarity represents images and where it can mislead predictive models.
How it connects
Connects pixels to images, PyTorch tensors, MNIST, structured data, Gaussian processes, and RBF kernels.

Also explained in

Compare how 10 books explain pixel →

Related concepts

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