A label names the answer a model is meant to predict. In image classification, “label” and “class” can mean the same thing. A label is not always binary: an image classifier may choose among 1,000 classes. In a binary task, the target is restricted to two classes, such as handwritten 1 versus 0. section 2.1 section 1.2
Keep the target separate from the inputs. For wine data, chemical measurements form the input tensor, while the quality score is held in a target tensor. Treating that score as a label makes the task classification rather than regression; labels can be stored as integer indices. section 4.3.3
A binary label for each pixel
In a medical-image segmentation task, each pixel receives a true or false label: true marks a nodule candidate, and false marks uninteresting healthy tissue. Together, those labels form a mask of areas of interest. section 15.2
# In[6]: img, label = cifar10[99] img, label, class_names[label] # Out[6]: (<PIL.Image.Image image mode=RGB size=32x32>, 1, 'automobile')
A PyTorch dataset returns an image and its integer label; looking up that index gives the class name “automobile.” section 7.1.2



















