What is an inverse problem
Contents
1. What is an inverse problem¶
Mathematical models and data play a big role in modern science and engineering. The field of inverse problems bridges these two and studies if and how one can infer model parameters from relevant observations. A prominent example is the famous black hole image, shown in Fig. 1.1, that was constructed by merging data from various telescopes [Akiyama et al., 2019].

Fig. 1.1 Depiction of a black hole as reconstructed from data recorded by the Event Horizon Telescope.¶
A prominent subfield of inverse problems is that of imaging, with applications in chemistry, biology, geosciences, and medicine. Various methods for imaging have been developed over the previous four decades and have been partly made available for practical use. What sets many of these imaging modalities aside from conventional photography is that the raw data is not interpretable as an image directly. Instead, significant processing using mathematical models is required to obtain a useable image. Next, we give a few examples.
1.1. Applications¶
1.1.1. Image processing¶
Images are of great importance in many applications, ranging from microscopy, medicine, to astronomy. In all these applications, the recorded images are distorted or corrupted versions of the ideal image. The inverse problem consists of reconstructing the idealized image from the measured one.
We can think of a (digital) image as a two dimensional array of pixels where each element could, for example, represent the grey value of the corresponding pixel. A color image could be represented by a tensor containing the RGB intensities for each pixel. Alternatively, we can think of an idealized image as a (vector-valued) function on a bounded domain (say, the unit square).
A mathematical model for the observed image should model the process by which the image was obtained. This often involves convolving the image with a filter and adding noise. For example, for a digital image with pixel values
Representing the image as a function
where
The resulting inverse problem is to undo the convolution. In some cases,
# import libaries
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['figure.dpi'] = 300
from scipy.signal import convolve2d as conv2
from skimage import color, data, restoration
from skimage.restoration import inpaint
# load test image and convert to gray-scale
astro = color.rgb2gray(data.astronaut())
## image deblurring
# define blurring kernel (pointspread function)
psf = np.ones((5, 5)) / 25
# convolve image with kernel
astro_blur = conv2(astro, psf, 'same')
astro_blur += (np.random.poisson(lam=25, size=astro.shape) - 10) / 255.
# Restore Image using Richardson-Lucy algorithm
astro_restored = restoration.richardson_lucy(astro_blur, psf, iterations=10)
# plot results
fig, ax = plt.subplots(nrows=1, ncols=3, figsize=(8, 5))
plt.gray()
for a in (ax[0], ax[1], ax[2]):
a.axis('off')
ax[0].imshow(astro, vmin=0, vmax=1)
ax[0].set_title('Original image')
ax[1].imshow(astro_blur,vmin=0, vmax=1)
ax[1].set_title('Blurred image')
ax[2].imshow(astro_restored, vmin=0, vmax=1)
ax[2].set_title('Restored image')
plt.figtext(0,0.25,"An example of image deblurring. Do you think we would ever be able to fully recover the original image?",{"fontsize":12})
plt.show()

# import libaries
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['figure.dpi'] = 300
from scipy.signal import convolve2d as conv2
from skimage import color, data, restoration
from skimage.restoration import inpaint
# load test image and convert to gray-scale
astro = color.rgb2gray(data.astronaut())
## image inpainting
# Create mask with three defect regions: left, middle, right respectively
mask = np.zeros((200,200))
mask[20:60, 0:20] = 1
mask[160:180, 70:155] = 1
mask[30:60, 170:195] = 1
# remove parts of the image
astro_defect = astro[0:200, 0:200].copy()
astro_defect[np.where(mask)] = 0
# inpaint
astro_inpainted = inpaint.inpaint_biharmonic(astro_defect, mask, multichannel=False)
# plot results
fig, ax = plt.subplots(nrows=1, ncols=3, figsize=(8, 5))
plt.gray()
for a in (ax[0], ax[1], ax[2]):
a.axis('off')
ax[0].imshow(astro[0:200, 0:200], vmin=0, vmax=1)
ax[0].set_title('Original image')
ax[1].imshow(astro_defect,vmin=0, vmax=1)
ax[1].set_title('Damaged image')
ax[2].imshow(astro_inpainted, vmin=0, vmax=1)
ax[2].set_title('Restored image')
plt.figtext(0,0.25,"An example of image inpainting. Do you think we would ever be able to fully recover the original image?",{"fontsize":12})
plt.show()

1.1.2. X-ray tomography¶
A CT-scanner is a common tool for medical diagnosis, providing detailed images of the anatomy of a patient. An example is shown in Fig. 1.2. In other applications, such as materials science, similar techniques are being used to obtain three-dimensional reconstructions of the inner structure of objects.

Fig. 1.2 Modern CT scanner (left). Slice of high resolution CT scan of a patient’s lung (right). Source for both: Wikimedia Commons¶
In this case
with
An example of an image and its corresponding sinogram are shown in figure Fig. 1.3. It is clear that the sinogram itself is not directly suited for interpretation and we have to solve the inverse problem to get a useful image.

Fig. 1.3 Two-dimensional slice through a walnut and the corresponding sinogram.¶
1.1.3. Magnetic resonance imaging¶
Magnetic resonance imaging (MRI) is another imaging modality for clinical diagnosis. As opposed to CT, MRI does not rely on ionizing radiation and is hence considered much safer. A disadvantage of MRI is that the time needed for a scan is much longer than for CT.
Here,
The measurements
Note that when a fully sampled spectrum is available, we can easily retrieve
The challenge here lies in retrieving
1.1.4. Seismic inversion¶
In seismic inversion, the goal is to infer physical properties of the subsurface from seismic measurements. Here,

Fig. 1.4 A typical seismic acquisition setup.¶

Fig. 1.5 A typical seismic image depicting various earth layers.¶
The simplest example is when the underlying physics can be described by a simple scalar wave equation:
where
The inverse problem consists of retrieving either
Inverse source problem: The measurements
are linear in terms of , leading to a linear inverse problem to retrieve . In earth-quake localization, the source is for example parametrized as in which case the goal is to retrieve .Inverse medium problem: Here the goal is to retrieve
, sometimes parametrized as Here, the measurements generally depend non-linearly on . However, when the relation between and may be linearized.
1.2. Anatomy of an inverse problems¶
We can abstractly formulate most (if not all) inverse problems as finding a solution,
Here,
For the purposes of this course, we will assume that
An important notion in inverse problems is ill-posedness. We call a problem ill-posed if it is not well-posed:
Definition: Well-posedness according to Hadamard
The equation
Existence. There exists at least one
for whichUniqueness. There is exactly one
for whichStability. The solution depends continuously on the data, i.e., there is a constant
such that where and .
If the problem is not well-posed, we call it ill-posed.
It may seem strange that equation (1.1) may not have a solution. After all, are the measurements not the result of the forward operator applied to some ground-truth
where
1.3. Motivating examples¶
1.3.1. Rootfinding¶
Given a continuous function
We can thus derive the error bound
with
We conclude that the problem of finding a root of
1.3.2. Matrix inversion¶
Matrix inversion is a prime example of a linear inverse problem. These can be written in the form of (1.1) with
Under these conditions
where
1.3.3. Differentiation¶
Here, we are given a continuously differentiable function
We immediately find that the solution is given by
It is not hard to show in this case that the forward error
1.4. Solving an inverse problem¶
1.4.1. Direct methods¶
In some special cases we can derive an explicit expression for (an approximation) of the solution of
Example: Inverting a rank-deficient matrix.
Consider the matrix
Obviously this matrix is singular, so there is no way to define the inverse in the usual sense. However, modifying the matrix slightly
allows us to compute the inverse. Indeed, given

Fig. 1.6 Original and regularized equations. We see that the regularized equations have a unique solution, but this solution is slightly biased towards the origin.¶
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['figure.dpi'] = 300
from myst_nb import glue
u1 = np.linspace(0,5,100)
u2 = np.linspace(0,5,100)
fig,ax = plt.subplots(1,1)
alpha = 1e-1
ax.plot(u1,3-u1,'k',label=r'$Ku=f$')
ax.plot(u1,3-(1+alpha)*u1,'r--',label=r'$\widetilde{K}u=f$')
ax.plot(u1,(6-2*u1)/(2+alpha),'r--')
ax.set_xlabel(r'$u_1$')
ax.set_ylabel(r'$u_2$')
ax.set_xlim([0.5,1.5])
ax.set_ylim([1.5,2.5])
ax.set_aspect(1)
ax.legend()
plt.show()
glue("matrix_inversion", fig, display=False)

1.4.2. Variational methods¶
Variational methods are a popular and quite generally applicable technique for solving inverse problems. The idea is to replace the original equation
where further a-priori information on the class of images
Example: Solving a quadratic equation.
We illustrate this principle by a simple example. We search for a small solution of the following quadratic equation
with the given data
With our a-priori information of a small solution we obviously choose the solution
For

Fig. 1.7 Original quadratic equation and functional to be minimized. We see that minimizing the functional picks out one of the two solutions.¶
import numpy as np
import matplotlib.pyplot as plt
from myst_nb import glue
u = np.linspace(0,5,100)
fig,ax = plt.subplots(1,1)
alpha = [1e-2, 1e-1, 1]
ax.plot(u,u**2 - 1.1*u + 0.1,'k')
ax.plot(0.1,0,'ko')
ax.plot(1,0,'ko')
for k in range(len(alpha)):
ax.plot(u,(u**2 - 1.1*u + 0.1)**2 + alpha[k]*(u**2),'--',label=r'$\alpha=$'+str(alpha[k]))
ax.set_xlabel(r'$u$')
ax.set_xlim([0,1.5])
ax.set_ylim([-0.25,.25])
ax.set_aspect(3)
ax.legend()
plt.show()
glue("quadratic", fig, display=False)

1.5. Excercises¶
1.5.1. Matrix inversion I¶
We want to solve a system of linear equations
Is the problem ill-posed? Why? You can compute eigenvalues and vectors numerically, as shown in the example below.
import numpy as np
K = np.array([[1,2],[2,1]])
f = np.array([1,1])
l, V = np.linalg.eig(K)
print("The eigenvalues are:", l)
print("The eigenvectors are:",V[:,0], V[:,1])
The eigenvalues are: [ 3. -1.]
The eigenvectors are: [0.70710678 0.70710678] [-0.70710678 0.70710678]
Answer
This matrix is invertible, so we only need to check the condition number which we find to be
. This is not so large as to cause problems numerically.This matrix is near singular (the columns are nearly linearly dependent). However, it still invertible. The condition number is
. While this would not lead to problems when computing solutions numerically, it may amplify realistic measurement errors. We would call this problem ill-posed.This equation does not have a solution.
This equation does have a unique solution
. It is not immediately clear how to analyse stability in general. We could, for example, look at the first two equations (the last one is the same as the first one) and compute the condition number of the corresponding matrix. This yields , so the system is not ill-posed. Another way to look at it, perhaps, is that adding a small perturbation may make the system inconsistent. As such, we could call the inverse problem ill-posed. We will learn how to deal with this situation in general in the next chapter.Here, the solutions are of the form
for any . Hence, the system is definitely ill-posed.Again, an inconsistent system with no solution.
1.5.2. Matrix inversion II¶
Given a symmetric, positive definite matrix
where
To study the well-posedness of the equation we want to bound the backward error
Show that
Show that the relative error is bounded by
Answer
We have
with denoting the operator norm of , defined as . The supremum is attained at which leads to .Similarly, we find
.
1.5.3. Differentiation I¶
We are given a continuously differentiable function
It is readily verified that we can find a (unique) solution by differentiation:
Show that the forward error
is bounded in the norm, in particular .Show that the backward error
can be arbitrarily large, even if : .Is the inverse problem ill-posed?
Answer
Since
we immediately get the desired result.By linearity we have
and we immediately find the desired result.This shows that the problem is ill-conditioned; a small forward error does not guarantee a small backward error, implying that the inverse map is not continuous.
1.6. Assignments¶
1.6.1. Differentiation II¶
The analysis in the previous exercise depends crucially on the type of noise we allow. If we assume that
denotes the
Assuming that
, show that when .Can you come up with a type of noise that obeys the assumed bound? Is it reasonable to make such assumptions on the noise?