Bari, Italy, 3-7 April 2023

Explainable AI from first principles

Lectures by
prof. Bart M. ter Haar Romeny

Explainable AI has been approached from many viewpoints, but remains still largely a mystery. In these lectures I will present a geometrical explanation for deep learning, with emphasis on convolutional neural nets, and much inspiration of modern brain research, in particular visual perception.

The tutorial consists of three parts:

- We start with a principled view on deep neural nets, the neuro-mathematics of self-organization and optimal representations.
We discuss an elegant ‘first principles’ model for the first stages of supervised deep learning. The operators are differential operators, performing a Taylor expansion/description of the local structure. This will give us a solid geometric basis for the first layers in both CNN and vision. We derive convolution from first principles, construct a visually guided self-driving car and explain classification networks in detail.

- The second part gives a briefing on modern visual neuroscience: brain imaging techniques, the connectome and function of the many cells and circuits in the retina and visual cortex, and the brain pathways for face recognition. We will exploit brain’s strategies to conserve energy.

- The third part focuses on explaining the mathematics behind a range of applications in medical image analysis, such as diabetes detection from retinal images, skin tumour detection, tuberculosis detection, and medical image super-resolution. 

Incremental context calculations

Layers of the visual system

Examples from:
Geert Litjens, Bram van Ginneken et al., A survey on deep learning in medical image analysis, Medical Image Analysis, Volume 42, 2017,
Pages 60-88.

Geert Litjens and Bram van Ginneken have been my students.
Cited 9324 times (Google Scholar).

I will present the lectures as a highly interactive tutorial, almost completely presented with life coding examples in Mathematica (Wolfram Inc.). The course notes are all computational essays. Attendees will discover that this is an ideal environment to study the internal details of deep learning, and combine it with both deep understanding of - and play interactively with - the underlying mathematics.

And yes, we will do mathematics, and physics, and all will be explained visually and intuitively. The approach is focused on geometric deep learning, and deriving solid insights by exploiting first principles.

The final hour will be devoted to modern insights in visual perception, the retinal connectome, and what seems to happen in the many layers of the visual system in the cortex.

Part of this course material is scheduled into a forthcoming book by the tutor (Fall 2023).

All the Mathematica notebooks will be made available to the attendees, so all that is explained during the lectures can be studied at ease later on by doing it. See the downloads section below.


It is highly recommended to acquire Mathematica 13 desktop version
and have it working during the Summer School classes:

Lecture 01 - 6 Apr 2023 - 13:00-13:45

Network construction and surgery
Explainable AI (XAI) introduction - PPT
Introduction to Convolutional Neural Networks
Network surgery
Transfer learning
Learning to program in Mathematica in 15 minutes
How does gradient descent really work?

Lecture 02 - 6 Apr 2023 - 13:45-14:30

Applications and visualizations
Some application examples (few lines program)
- News aggregator and topic classification
- COVID data analysis
- A camera-driven self driving car
- Auto-encoder
Data visualization (feature space plots) in 2D and 3D
The Wolfram Neural Network Repository
Real-time inner layer visualization (with the webcam)
Inner layer visualization for all deeper layers
Google's DeepDream algorithm explained


Recommended reading: 

On neural networks and deep learning:
·        B.M. ter Haar Romeny, Introduction to Artificial Intelligence in Medicine
This is a chapter in Springer-Nature's Reference work on "Artificial Intelligence in Medicine" (1858 pages)
-        E. Bernard: Introduction to Machine Learning (written in Mathematica, all free code included)
Book (Amazon / Kindle) and online read / free code:

On the visual system:
·        David Hubel, Eye, Brain & Vision, Scientific American Press.
Free download:
·        R. Masland: The Neuronal Organization of the retina
Free download:  
·        Eric Kandel: Principles of Neuroscience 5th ed., chapters 25 – 28
Free download:  

On Mathematica (= the Wolfram Language):
·        Stephen Wolfram: An elementary introduction to the Wolfram Language
Free download:
·        The Wolfram Language: Fast introduction for programmers