Professional Documents
Culture Documents
What are the activation levels of the cells and which has the highest activation levels?
We implement the formula in the python file:
Ai = Ii − w(Ii−1 + Ii+1 ) f or i = 2, ..N − 1
The formula calculates the activation level, by multiplying the sum of the neighbouring cells with a given constant
weight(w) which is has the value w = 0.1. We then subtract this product from the input value (Ii ). When the input
has been calculated, we get the following output:
A = [0., 0.8, 0.8, 0.8, 0.9, −0.1, 0., 0., 0., 0.]
The cell with the highest activation level is the cell at index 4 in the array above. The calculation for the activation
level of this cell was calculated by: Ai = 1 − 0.1 · (1 + 0) = 0.9 here we see that the cell is less inhibited by the cell
Ii+1 and thereby giving a higher activation level. This is also what we know as lateral inhibition, we can think of this
as the cells having side connections which as we saw inhibit the activation of the cells, so that the the signal they
send to the brain is exaggerated in areas where there is a drop in input stimulation. As we see this exaggeration also
takes place in the cell at index 5, but opposite. This can be thought of as the eye making the intensity bigger and
lower on each side, and thereby increasing the contrast. All of this simulates the analysis the cells in the optic nerve
does before the information reaches the brain.
1
Again it cam be observed that exaggeration close to the edges between different light intensities takes place. For this
input it is very clear that that the activation’s have ”peaks”and ”valleys”all depending on the neighbouring cells
input values.
Question 3 - Convolution
In this question we have to use convolutions to calculate the activation levels of the cells from question 1 and 2. We
use the kernel: [−w, 1, −w] and use the sci-py package to do the actual convolution, the function used is: conv2d,
which as input takes the image as matrix and then the kernel. If we look at the original way of calculating the
activation levels, it is clear that it is the sum of neighbouring cells multiplied by a weight.
After redoing Question 1 and 2 we get the following results: (Note that i removed first and last values in the arrays)
Question 1:
Input: [1, 1, 1, 1, 1, 0, 0, 0, 0, 0]
Activation levels: [0.8, 0.8, 0.8, 0.9, −0.1, 0., 0., 0.]
Question 2:
Input: [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5]
Activation levels: [0., 0., −0.1, 0.9, 0.8, 0.7, 1.7, 1.6, 1.5, 2.5, 2.4, 2.3, 3.33.2, 3.1, 4.1, 4.]
So it is clear that we get the same output, when solving the calculation problem as a convolution. This is very use
full when we have to calculate activation’s for inputs with 2 dimensions.
2
Question 4 - Mona Lisa
In this question we will make the kernel 2 dimensional which in terms makes it a matrix. When doing convolutions
in 2 dimensions, we use the formula:
XX
fout (x, y) = w ∗ fin (x, y) = w(u, v)fin (x + u, y + v)
v u
Where w is our weight, which we define as w = 0.1, u and v denote the indexes in our kernel, and x,y is the index
in our image. Note that in practice this is implemented in the scipy function: “conv2d”.
Figur 2: Image of Mona Lisa with different N- Values defining the kernel scales.
So we do get the best results for values of N > 15, as the edge enhancement is quite faint at lower values. Even
though the image does start to blur out, the actual edge enhancement becomes even more visible for larger kernel
scales as seen for N = 25. If we still want to keep a descent quality in the image, we should not go higher than
N = 15 because the image starts to blur out after these values. The reason the kernel of scale N = 1 does not work
very well, is most likely because the edges in a real image are not as sharp as we saw in question 1 or 2, but have a
“softer” transition between light intensities.
3
Equiping the cells with a threshold function
We equip the cells with a threshold function we define as: xi > µx +2·σx ,where xi is the individual cells activation,µx
denotes the mean of the activation levels and σx is the standard deviation. When defining the threshold this way,
we get a suitable value of which the edges are defined, and 95% of the activation levels will be lower than this value.
Also by doing it this way we make sure that the activation level is determined relative to the activation values in
the image. I did try using 1 · σ instead, but ended up with to many cells being deemed active, for any clear edge
detection to take place. I also tried with 3 · σ, which only gives us 0.27% of the activation values, and then we only
see the really sharp edges, because they are the ones with that high activation levels.
As we see in figure 3, the value of N needs to be from around 15-20, before the line detection become somewhat
consistent. We do also see in figure 3 that when N is 25 it does start to miss some precision and loose out on some
of the finer edges.That said, the threshold function does catch some prominent edges at values of N = 5 already.
The big edge it detects at N = 5 is the before mentioned contrast between the background and the hair. But as can
be seen it is only the cells right on the edge between the hair and background which trigger the threshold function.
In summary from my own qualitative assessment the kernel scales with the results in terms of edge detection is the
scale N = 15. The kernel of this scale manages to both detect both prominent and not so prominent edges., thous
displaying which of the cells have been inhibited less than their neighbouring cells.
Figur 3: Image of Mona Lisa with different N-Values and with the threshold function implemented.
4
Question 5 - Hermann Grid
The Herman Grid illusion, is the illusion of “dots” being present in the space between 4 of the cubes in the grid. This
illusion takes place because of lateral inhibition and and to be more precise because the cells have higher activation
levels in the space between two boxes than in the intersections between 4 white lines. The reason for this is, that
the cells in between 2 boxes, receive less inhibition from their neighbouring cells as some of them are of a lower light
intensity. The Herman grid does however only occur in our peripheral sight, as this is the “place” our sight detects
differences in light intensities. This is the exact reason we do not see the illusion if we focus our view on one exact
intersection between the white lines. When inspected up close, we can also see that for the kernel scale of N = 3
gray lines also form in the middle of the white stripes. This is the same concept, and proves why we need our kernel
to be big enough, to enable it to look at both the right and left edge simultaneously. As can be seen in figure 4, our
kernel experience the illusion the most for an N values of around 3-6, as the grey dots start blur out when using
higher dimensions for our kernel. So to sum up, we need a kernel big enough to “see” multiple edges but not so big
that it starts to blur the image.