1 of 17

Workshop DATAI-IESE

May 6th, 2024

Diego Borro

Computer Science PhD

Vision and Robotics research line at CEIT

Research Professor at TECNUN

dborro@ceit.es

AI techniques for image processing

2 of 17

Index

  1. Context
  2. Types of problems and techniques in image processing
  3. Techniques for unveiling the black box: XAI and model calibration
  4. Projects examples and conclusions

3 of 17

3

Context

Deep Learning

Convolutional Neural Networks

Fully Connected Neural Networks

  • Basically, focus on DL (Deep Learning)
    • FC: Fully Connected Neural Networks
    • CNN: Convolutional Neural Networks

4 of 17

4

Image processing techniques

  • What we can do:
    • Deep knowledge of SoA architectures (CNN, ViT, FCN, GAN, NeRF,…)
    • Transfer learning
    • Last layers design
    • Tuning of hyperparameters and/or architectures modification

  • For which type of problems:
    • Image classification
    • Objects detection
    • Image segmentation

Problem

Image information

Complexity

Labeling

Classification

Low

Easy

Easy

Detection

Medium

Medium

Medium

Segmentation

High

Hard

Hard

Types of problems and techniques in image processing

5 of 17

5

Classification problems

  • A ConvNet is able to successfully capture the Spatial and Temporal dependencies in an image through the application of relevant filters
    • Feature extractor: it’s the backbone. It can be used in any image processing problem
    • Classifier: it is a fully connected network (FC) designed by the developer
      • Several neuron deep layers
      • Last layer = number of categories
  • Goal: given an image, classify the whole image among a set of categories

Types of problems and techniques in image processing

6 of 17

6

Classification problems

Initial dataset (ImageNet,…)

CNN pretrained

Weights optimization

Labeled data

Application dataset

CNN trained with own data

Weights optimization

Labeled data

Test dataset

Inference

Confussion matrix

Metrics computation

Initial model weights

Final model weights

Final layers design

Transfer learning

Network modification

Hyperparameters tuning

Types of problems and techniques in image processing

7 of 17

7

Detection problems

  • Architectures much more complex (several CNNs + RPN + classifier and regressors)
    • Regressors: to compute the 4 bounding box coordinates
    • Classifier: to classify each bounding box
  • Goal: given an image, detect and classify different objects

Types of problems and techniques in image processing

8 of 17

8

Segmentation problems

  • The Fully Convolutional Networks (FCNs) are a variant of the standard CNNs. They don’t have FC layers!!
  • They are used for segmenting any type of object or detect interest regions in images
    • Convolution path (feature extractor): it’s the backbone. It can be used in any image processing problem
    • Deconvolution path (image generator): the result is as many masks as there are categories
  • Goal: given an image, segment into masks (assign each pixel into a category)

Types of problems and techniques in image processing

9 of 17

9

Black box and Explainable AI (XAI)

  • Deep learning models = black box models
    • They are far more complex to interpret than most machine learning models (opaque nature and non-linear complexity)
    • “Perfect” matching input-output but no direct evidence how
  • XAI for a better understanding AI

Techniques for unveiling the black box: XAI and model calibration

10 of 17

10

Techniques for unveiling the black box: XAI and model calibration

eXplainable AI

  • Explainable Artificial Intelligence (XAI) is a concept that explains decisions made by machine learning models and provides justification in a way interpretable by humans [1]
  • XAI are tools to visualize and understand how a complex model is making decisions, which can help "explain" these decisions in more intuitive terms

[1] S. Ali, et al., “Explainable artificial intelligence (xai): What we know and what is left to attain trustworthy artificial intelligence,” Information Fusion, p. 101805, 2023.

[2] Ribeiro, MT., et al., “Why Should I Trust You?": Explaining the Predictions of Any Classifier”, ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016.

[3] SM Lundberg, SI Lee. “A unified approach to interpreting model predictions”, Advances in neural information processing systems, 2017.

In a FNN (fully-connected neural network), neurons learn representation and patterns that is difficult to extract and present in a human-readable form

  • LIME (Local Interpretable Model-Agnostic Explanations) [2]
  • SHAP (SHapley Additive exPlanations) [3]

They try to understand the importance of features by seeing how predictions change when input features are perturbed, removed of changed (Bias detection!!)

11 of 17

11

eXplainable AI

  • Explainable Artificial Intelligence (XAI) is a concept that explains decisions made by machine learning models and provides justification in a way interpretable by humans
  • XAI are tools to visualize and understand how a complex model is making decisions, which can help "explain" these decisions in more intuitive terms

[4] M. Aouayeb, et. al. “Learning Vision Transformer with Squeeze and Excitation for Facial Expression Recognition”, ArXiv, 2021.

CNN are focused on image processing problems so, those patterns are images!!

Deeper representation in a CNN capture high-level abstracts or visual concepts

Convolutional layers naturally retain the spatial information of the input data

Shapes and patterns are detecting at successive layers

[4]

Techniques for unveiling the black box: XAI and model calibration

12 of 17

12

Some XAI techniques for CNNs

Name

Focus

Eq

Layer visualization

Last convolutional layer

Saliency maps [5]

Impact in the output respected to input changes (pixels)

Grad-CAM [6]

Impact in the output respected to FM changes (high-level features)

Attention maps [7]

Image areas where the model pays attention

Guided Backpropagation [8]

Impact in the output respected to positive input changes

Integrated Gradients [9]

Impact in the output respected to changes in N inputs (pixels)

[5] K. Simonyan, A. Vedaldi, and A. Zisserman, “Deep inside convolutional networks: Visualising image classification models and saliency maps,” arXiv preprint arXiv:1312.6034, 2013.

[6] R. R. Selvaraju, A. Das, R. Vedantam, M. Cogswell, D. Parikh, and D. Batra, “Grad-cam: Why did you say that?” Nov. 2016.

[7] Alexey Dosovitskiy y col. “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. En: CoRR abs/2010.11929 (2020). arXiv: 2010.11929. url: https://arxiv.org/ abs/2010.11929.

[8] J.T. Springenberg, A. Dosovitskiy, T. Brox, and M. Riedmiller, “Striving for simplicity: the all convolutional net”, Proceedings of the International Conference on Learning Representations (ICLR 2015).

[9] M. Sundararajan, A. Taly, and Q. Yan, “Axiomatic Attribution for Deep Networks”, Proceedings of the 34th International Conference on Machine Learning (ICML’17), Vol. 70, pp. 3319-3328. August 2017.

 

 

 

Techniques for unveiling the black box: XAI and model calibration

13 of 17

13

Which technique is better?

  • Different explanations often present different aspects of the model’s behavior
  • Lack of objectivity and quantification
  • Working in a methodology

Techniques for unveiling the black box: XAI and model calibration

Test dataset

Representation

CNN

Black-box model

XAI Explanations

Test ground truth masks

Convert to masks

IoU

Metrics evaluation

IoU

IoU

IoU

IoU

IoU

Comparison and test dataset results

14 of 17

14

Model calibration

  • A model is defined as calibrated when the confidence of occurrence of the class corresponds to the accuracy for that confidence [10]
  • With a miscalibrated model, high confidences could have lower accuracies or on the contrary, which would be untrusted and critical in a variety of applications
  • Techniques to solve it and calibrate models

[10] Guo, Chuan, Pleiss, Geoff, Sun, Yu,Weinberger, Kilian Q, (2017). On calibration of modern neural networks. International Conference on Machine Learning 1321-1330.

Techniques for unveiling the black box: XAI and model calibration

15 of 17

15

Projects examples

Projects examples and conclusions

16 of 17

16

Conclusions

Projects examples and conclusions

  • We work in any application where images are part of the inputs:
    • Image classification
    • Objects detection
    • Image segmentation

  • We can work with SoA architectures or design our own

  • We can give a better understanding AI:
    • XAI techniques
    • Objectifying the XAI
    • Calibrating AI models

17 of 17

Workshop DATAI-IESE

May 6th, 2024

Diego Borro

Computer Science PhD

Vision and Robotics research line at CEIT

Research Professor at TECNUN

dborro@ceit.es

AI techniques for image processing