0
0
Computer Visionml~12 mins

Color transforms (brightness, contrast, hue) in Computer Vision - Model Pipeline Trace

Choose your learning style9 modes available
Model Pipeline - Color transforms (brightness, contrast, hue)

This pipeline shows how an image's colors are changed step-by-step by adjusting brightness, contrast, and hue. These changes help a model learn better by seeing different versions of the same image.

Data Flow - 4 Stages
1Input Image
1 image x 224 height x 224 width x 3 color channelsOriginal image loaded with RGB colors1 image x 224 x 224 x 3
A photo of a red apple with green leaves
2Brightness Adjustment
1 image x 224 x 224 x 3Add a small value to each pixel to make image lighter or darker1 image x 224 x 224 x 3
Apple image becomes slightly brighter, colors look lighter
3Contrast Adjustment
1 image x 224 x 224 x 3Stretch or shrink pixel values around middle gray to increase or decrease contrast1 image x 224 x 224 x 3
Apple image colors become more vivid or more faded
4Hue Adjustment
1 image x 224 x 224 x 3Shift colors around the color wheel to change overall tint1 image x 224 x 224 x 3
Apple image colors shift slightly from red to orange or purple
Training Trace - Epoch by Epoch

Loss
1.0 |***************
0.8 |************   
0.6 |********      
0.4 |******        
0.2 |***           
0.0 +-------------
      1 2 3 4 5 Epochs
EpochLoss ↓Accuracy ↑Observation
10.850.55Model starts learning with high loss and moderate accuracy
20.650.70Loss decreases as model adjusts to color variations
30.500.78Model improves recognizing images despite color changes
40.400.85Better generalization with color transform augmentations
50.350.88Training converges with stable loss and high accuracy
Prediction Trace - 5 Layers
Layer 1: Input Image
Layer 2: Brightness Adjustment
Layer 3: Contrast Adjustment
Layer 4: Hue Adjustment
Layer 5: Final Output Image
Model Quiz - 3 Questions
Test your understanding
What happens to pixel values during brightness adjustment?
AA fixed value is added to all pixels
BPixels are multiplied by a factor
CColors are shifted around the color wheel
DPixels are replaced with random noise
Key Insight
Applying brightness, contrast, and hue changes creates new image versions that help the model learn to recognize objects under different lighting and color conditions. This improves the model's ability to generalize to real-world images.