U-Net
Sometimes we need to know which pixels belong to an object, not just whether the object is present. U-Net learns from images paired with labelled masks and carries spatial detail forward to help reconstruct those boundaries.
15 sections · 15 questions · 4 coding challenges
The arrow keys move between sections too.
How Do We Identify an Object Without Losing Its Boundary?
BOTIE
Ronneberger, Fischer and Brox introduced U-Net in 2015 for biomedical image segmentation. The original work addressed learning from relatively few annotated images, using data augmentation. It used labelled training data: example images were paired with annotations showing the regions the network should identify.
The contracting path collects broader context as spatial resolution decreases. The expanding path builds a detailed output again. Connections from earlier high-resolution stages supply location information that the compressed representation alone may lack. The network can therefore combine what a region appears to contain with where its boundaries lie. Those connections support localisation; the labelled examples still teach the desired segmentation.
Knowing What Is There Does Not Tell Us Where
An image classifier can say that a picture contains a shape. Sometimes we need a different answer: which pixels belong to that shape? The output must then be a picture-sized set of decisions.
U-Net learns this segmentation task from labeled images paired with target masks. The mask supplies the desired answer at each pixel.
Show the answer the task requires
The input is an image. Its training target is a mask marking foreground and background at corresponding locations. A single category name would not provide these pixel-level answers.
Input image
Target mask
Context and spatial detail meet on the way back up
The detailed architecture shows which feature maps are joined and how their shapes match. The output is evaluated against labeled masks.
The lesson also compares the trained model with a threshold baseline and tests image types and sizes absent from training.
Explore the full example
Compare the predicted mask with the target pixel by pixel. Pay particular attention to boundaries and thin shapes when the skip connections are removed.
…
Part 1. An Answer for Every Pixel
1. The same pictures, a different question
Every picture here is one of the sixteen by sixteen pictures from the convolutional networks page, a cross, a square outline, a filled disc or a diagonal bar drawn at a random place and size, brightness and background, with a little noise on every pixel. That page asked which of the four kinds each picture held.
This one asks, for every one of its 256 pixels, whether the pixel belongs to the shape. The answer is a picture of its own, one yes or no per pixel, and every picture in the collection is drawn with that answer attached, which is called its mask. The box at the top of the page shows the first held-out picture of each kind with its mask.
| the held-out half | count |
|---|---|
| pictures | 240 |
| pixels, 256 to a picture | 61,440 |
| share of pixels that are shape | 0.111 |
| pixels right if every pixel is called ground | 0.889 |
The last line is the trap in scoring this task by the share of pixels right. Only about one pixel in nine belongs to a shape, so a network that never calls anything a shape gets 0.889 of pixels right while finding nothing at all, and two networks that differ in whether they find the shape can differ by a few hundredths on that score. So the page reports the share of pixels right and always sets beside it a second score that a network answering nothing cannot win, which section 3 defines.
Keep in mind
2. What a classifier keeps and what it throws away
The obvious start is the network that already names these pictures, which gets 0.971 of the held-out kinds right. Its first four layers keep the arrangement of the picture, since a convolution answers at every position and a pooling halves the maps without shuffling them. Then the flattening lays the last maps out as a row of 128 numbers, the dense layers mix all of them into sixteen and then four, and from that point on no number stands for any place in the picture.
| layer of the classifier | answers | still arranged as a picture |
|---|---|---|
| convolution | 4 × 16 × 16 | yes |
| max pooling | 4 × 8 × 8 | yes |
| convolution | 8 × 8 × 8 | yes |
| max pooling | 8 × 4 × 4 | yes |
| flattening | 128 | no |
| dense | 16 | no |
| dense | 4 | no |
To see how little the kind alone says about where, I took the kind the classifier calls each held-out picture, averaged the masks of every training picture of that kind, and called a pixel shape wherever that average was above one half. The same was done with each picture’s true kind, to be sure the classifier’s few mistakes were not the problem.
| answering from the kind alone | pixels right | overlap with the true shape |
|---|---|---|
| the kind the classifier calls | 0.898 | 0.081 |
| the picture’s true kind | 0.898 | 0.080 |
Overlap is defined in section 3; one is a perfect mask and zero is a mask that shares no pixel with the truth.
Knowing the kind exactly is worth an overlap of 0.080, since a cross can be drawn anywhere and the average of crosses drawn everywhere is a faint blur in the middle. What the classifier learned to throw away, the position, is the whole of what this task asks for.
Keep in mind
3. Scoring a mask, and the pixels at its edge
The second score counts only pixels that matter. Take the pixels a network calls shape and the pixels that truly are, count the pixels in both, and divide by the pixels in either. A network that calls nothing scores zero, a network that calls everything scores the shape’s share of the picture, and only an exact mask scores one. It is usually called the intersection over union, and this page calls it the overlap and averages it over pictures, so a thin square outline counts as much as a large disc.
overlap = pixels called shape and truly shape ÷ pixels called shape or truly shapeThe held-out cross, answered by the U without its skip connections
The cross contains twenty-eight shape pixels. The network without skip connections predicts twenty-three shape pixels, nineteen of them correctly. Intersection over union compares those nineteen shared pixels with every pixel in either set.
union = actual shape + predicted shape − intersection
= 28 + 23 − 19 = 32
IoU = 19 / 32 ≈ 0.594
correct pixels = 256 − 9 missed shape − 4 false shape = 243
pixel accuracy = 243 / 256 ≈ 0.949The high pixel accuracy includes the many background pixels. IoU makes the missed and extra shape pixels more visible.
The third score is the claim this whole architecture is built on. A pixel is on the edge if the pixel above, below, left or right of it has the other label, which counts both the shape’s outermost pixels and the ground’s innermost, and the frame of the picture does not count as a change. Of the 61,440 held-out pixels, 12,433 are on an edge and 49,007 are not, and on the cross above 52 are on an edge, of which the network got 39 right.
Keep in mind
Part 2. The Shape of the U
4. The way down is the classifier’s first half
The left side of the U is the start of the classifier, kept as it was. A convolution with four filters reads the picture and answers four maps the size of the picture, a pooling halves them, a convolution with eight filters reads those and a second pooling halves again, leaving eight maps of four by four. The two convolutions hold 40 and 296 parameters, the same 336 as on the convolutional networks page, since the count depends on the filters and not on what comes after them.
parameters = filters × (channels read × 3 × 3 + 1)What is different is what happens to the two convolutions’ answers. In the classifier each is read by the pooling above it and then forgotten. Here each is also kept, the four full-size maps and the eight half-size maps, because the way back up is going to need them.
Keep in mind
5. The middle, where the picture is smallest
At the bottom of the U one more convolution, eight filters of three by three, reads the eight maps of four by four and answers eight more of the same size. Each of its sixteen positions stands for a block of four by four pixels of the picture, and by the geometry the convolutional networks page worked out, a number here can depend on a patch eighteen pixels wide, wider than the picture itself.
So the middle is the one place where every number can take in a whole shape, and it is also the place with the least idea where, to finer than four pixels, anything is.
Keep in mind
6. The way back up, by repeating each value
To answer at every pixel the maps have to grow back to sixteen by sixteen, and the cheapest way is to copy each value over a two by two block, which doubles both sides. It has nothing to learn. On the way back, each value was copied to four places, so it reaches the loss by four routes and its slope is the total of the four slopes that arrive there.
up[2i + a, 2j + b] = x[i, j] for a and b each 0 or 1slope at x[i, j] = sum over a, b of slope at up[2i + a, 2j + b]A two by two map grown to four by four
A map holding p and q in its top row and r and s below becomes a four by four map whose top left block is four copies of p, top right four copies of q, and so on. If the blame arriving at the top left block is 0.1, 0.2, 0.3 and 0.4, then p is owed their sum, 1.0, since moving p by a small amount moves all four copies by that amount together.
The paper used a learned upsampling instead, a two by two convolution run backwards that can learn how to spread each value. Repetition is used here because it has no weights to get wrong, and whatever detail it cannot put back has to come from somewhere else, which is the point of the next section.
Keep in mind
7. The skip connections, laid alongside
At each depth on the way up, the decoder takes the maps that came up from below and the maps the encoder kept at the same size, and lays them side by side as one block with more channels. At half size eight repeated maps and the encoder’s eight make a block of sixteen, and at full size eight and four make twelve.
The convolution that follows reads every channel through its three by three windows, so at every position it sees both what the middle concluded and what the encoder saw there at full resolution, and its weights decide how to combine them.
…
The layers on this page are a chain, each reading only what the one before it answered, so the two joins are made outside the layers, by laying one block beside another between two of them, and the backward pass is walked by hand around them.
| layer | with the skips | without them |
|---|---|---|
| way down, two convolutions | 336 | 336 |
| the middle | 584 | 584 |
| half-size decoder convolution | 8 × (16 × 9 + 1) = 1,160 | 8 × (8 × 9 + 1) = 584 |
| full-size decoder convolution | 4 × (12 × 9 + 1) = 436 | 4 × (8 × 9 + 1) = 292 |
| one score per pixel | 5 | 5 |
| all parameters | 2,521 | 1,801 |
The joins cost 720 parameters, all of them in the two decoder convolutions, which read more channels. The U with them holds 2,521 parameters, close to the classifier’s 2,468, and the U without them 1,801, so the comparison in Part 4 is not between networks of equal size. It could not be, since the channels a skip adds are what the decoder spends weights on.
Keep in mind
8. How far an answer pixel can see, by each route
An answer pixel now has three routes back to the picture, and they see very different amounts of it. Through the middle it reaches the widest patch, at the coarsest spacing. Across the full-size skip it reaches only a few pixels around itself, at the finest. The half-size skip is in between. The rule for each step is the one from the convolutional networks page, where a window adds its width less one, times the spacing of what it reads, and a repetition halves the spacing without widening anything.
| route, and field after each step | what the step did |
|---|---|
| through the middle 3, 4, 8, 10 | the way down, as in the classifier. Spacing 1, 2, 2, then 4 after the second pooling. |
| 18 | the middle’s three by three window over numbers four pixels apart adds 8. |
| 22, then 24 | each decoder convolution, after a repetition, adds its window over numbers two and then one pixel apart. |
| across at half size 8, then 12, 14 | the encoder’s second convolution sees 8; the two decoder convolutions add 4 and 2. |
| across at full size 3, then 5 | the encoder’s first convolution sees 3, and the full-size decoder convolution adds 2. The last layer is one by one and adds nothing. |
Keep in mind
9. One score per pixel, and what it costs to be wrong
The last layer is a convolution with one filter of one by one, which gives each pixel a score from the four numbers the layer below answered there. The score is squashed into a probability of shape, and a pixel is called shape when that probability is above one half. Training makes small the negative logarithm of the probability each pixel gave its true answer, added over every pixel and divided by the number of pictures.
p = 1 ÷ (1 + e^(−score))loss = − (1 ÷ pictures) × sum over every pixel of [ y log p + (1 − y) log (1 − p) ]Row 5, column 10 of the held-out cross, an edge pixel of the shape
| seed 0 | score | probability of shape | that pixel’s loss |
|---|---|---|---|
| with the skip connections | 7.0074 | 0.99910 | 0.00090 |
| without them | 0.0832 | 0.5208 | 0.6524 |
This pixel belongs to the shape. Cross-entropy therefore uses the negative logarithm of the probability assigned to shape.
pixel loss = −ln(0.5208) ≈ 0.6524The network without skips predicts shape with only slightly more than fifty percent probability. The network with skips is much more confident on this pixel.
Because the loss adds up 256 pixels for every picture, the slope on a shared kernel weight is a sum over 256 positions, and the step size has to be much smaller than the classifier’s. Both arrangements here are trained with a step of 0.003 against the classifier’s 0.1, for 20 passes over the same 240 training pictures in shuffled batches of 16.
Keep in mind
Check yourself
Questions on Parts 1 and 2
Question 1 of 5
A network that never calls any pixel shape still gets 0.889 of pixels right.
Part 3. Carrying the Blame Back Through a Join
10. The forward walk
The forward pass is the chain of layers with two extra moves. After each encoder convolution its answer is kept, and just before each decoder convolution the kept answer is laid alongside what came up from below, the repeated maps first and the encoder’s after them. The order matters, because the way back has to split the blame in the same order.
| step | what is read, and what is kept |
|---|---|
| e1 = convolve(picture) | 4 × 16 × 16, kept for the full-size join. |
| e2 = convolve(pool(e1)) | 8 × 8 × 8, kept for the half-size join. |
| m = convolve(pool(e2)) | 8 × 4 × 4, the middle. |
| d2 = convolve([repeat(m), e2]) | reads 16 × 8 × 8, the first 8 channels from below and the last 8 across. |
| d1 = convolve([repeat(d2), e1]) | reads 12 × 16 × 16, 8 channels from below and 4 across. |
| score = one by one(d1) | 1 × 16 × 16, flattened to 256 scores for the loss. |
Keep in mind
11. The backward walk, split and then added
Walking back, each layer works out its own correction from the blame that arrives at its answer and hands down the blame for what it read. At a decoder convolution that blame covers the whole joined block, so it is split by channel in the order the block was built. The part for the repeated maps goes on down through the repetition to the layers below. The part for the encoder’s maps is held until the walk reaches that encoder convolution from above, and there the two are added.
blame at e2 = blame down through the pooling + blame across the skip›Why the two parts are added
The encoder’s answer e2 changes the loss by two routes, one through the pooling and the middle and one straight across into the decoder convolution. A small change in one number of e2 moves the loss by its effect along the first route plus its effect along the second, and the slope of a sum is the sum of the slopes. It is the same reason the repetition in section 6 adds the four blames arriving at the four copies of one value, since in both cases one number was used more than once.
Keep in mind
12. Checked against a finite difference
A backward pass written by hand can be checked without trusting any of it. Nudge one weight up by a millionth, measure the loss, nudge it down by the same amount, measure again, and the difference divided by two millionths is the slope. I did that for twelve weights of every convolution in the untrained U with skips at seed 0, on the first held-out picture of each kind, and for twelve pixels of those pictures.
| convolution | largest slope | largest disagreement | if the skip’s share is not added |
|---|---|---|---|
| way down, first | 9.505 | 2.1 × 10⁻⁸ | 6.838 |
| way down, second | 4.941 | 1.4 × 10⁻⁸ | 4.054 |
| the middle | 0.650 | 1.6 × 10⁻⁸ | 1.6 × 10⁻⁸ |
| half-size decoder | 4.517 | 2.0 × 10⁻⁸ | 2.0 × 10⁻⁸ |
| full-size decoder | 2.718 | 1.7 × 10⁻⁸ | 1.7 × 10⁻⁸ |
| one score per pixel | 15.782 | 1.2 × 10⁻⁸ | 1.2 × 10⁻⁸ |
| the picture’s pixels | 0.320 | 1.3 × 10⁻⁸ |
Four pictures, a nudge of one millionth each way. The last column runs the same walk with the addition of section 11 left out.
The walk agrees with the finite difference to within about two hundred-millionths everywhere, which is what the rounding in a nudge of a millionth allows. The last column is the mistake a hand-written join invites. Leaving out the addition does not touch the middle or the decoder, which are above the joins, and it puts the two encoder convolutions wrong by 6.838 and 4.054 on slopes no larger than 9.505.
Keep in mind
13. How much of the blame crosses the skip
The two parts added at each encoder convolution can be measured separately. I took the length of each block of blame, the square root of the sum of its squares, on the same four pictures, before training and after it.
| length of the blame | across the skip | down through the pooling | their sum |
|---|---|---|---|
| first convolution, before training | 1.861 | 6.551 | 6.921 |
| first convolution, after training | 0.573 | 0.587 | 0.830 |
| second convolution, before training | 5.333 | 5.769 | 7.873 |
| second convolution, after training | 0.311 | 0.520 | 0.599 |
The sum is shorter than the two lengths added because the two blocks point partly against each other.
Before training the first convolution hears mostly from the middle, 6.551 against 1.861 across the skip. After twenty passes the two routes carry about the same, 0.573 and 0.587, so the full-size skip has become half of what shapes the first filters. That is the second thing a skip connection does, beside carrying detail forward. It gives the layers nearest the picture a short route from the loss that passes through two convolutions, where the route through the middle passes through five.
Keep in mind
Part 4. With and Without the Skip Connections
14. The same U trained twice
To measure what the joins buy, the U is trained with them and without them from the same seed, which draws the same starting weights for the way down and the middle, so the only difference is whether the decoder can read the encoder’s maps. After every pass I scored both on the 240 held-out pictures.
…
At seed 0 the U with skips reaches an overlap of 0.909 after four passes and 0.987 after ten, and finishes at 0.992 with a loss of 0.0023 per pixel. The U without them does not get past 0.64 at any pass, and its curve jumps. At seed 2 it was at 0.556 after pass 10 and at exactly zero after pass 11, calling no pixel of any held-out picture shape, and at seed 1 it fell from 0.556 after pass 18 to 0.040 after pass 19.
Keep in mind
15. Three starts each
A network this small ends somewhere different for each draw of its starting weights, so both arrangements were trained from three seeds, and the widgets draw seed 0 unless a button says otherwise.
| held-out, after pass 20 | seed 0 | seed 1 | seed 2 |
|---|---|---|---|
| overlap, with the skips | 0.992 | 0.995 | 0.995 |
| overlap, without them | 0.623 | 0.163 | 0.559 |
| pixels right, with the skips | 0.9992 | 0.9994 | 0.9994 |
| pixels right, without them | 0.949 | 0.906 | 0.935 |
With the skips the three seeds agree within 0.004 in overlap. Without them they spread from 0.163 to 0.623, and the worst of them gets 0.906 of pixels right, which is only 0.016 above the 0.889 that calling everything ground gets. Every seed of the U with skips beats every seed of the U without them by more than the spread of either.
Keep in mind
16. Where the errors are
The claim for skip connections is that they put the edges back, so I counted the wrong pixels separately on the edges and away from them.
| held-out | edge pixels right | other pixels right |
|---|---|---|
| with the skips, seed 0, 1, 2 | 0.996, 0.997, 0.997 | 1.000, 1.000, 0.9999 |
| without them, seed 0, 1, 2 | 0.758, 0.618, 0.705 | 0.998, 0.979, 0.993 |
12,433 held-out pixels are on an edge and 49,007 are not.
Seed 0, pixel by pixel
The U without skips gets 3,130 held-out pixels wrong, and 3,007 of them are on an edge. It misses 1,760 shape pixels and invents 1,370, close to as many of one as the other, so its shapes come out about the right size and are off by a pixel or so along most of their outline. The U with skips gets 48 pixels wrong, 47 of them on an edge, and 45 of the 48 are shape pixels it missed.
Away from the edges both do nearly as well as each other, and the whole difference sits in the band a pixel wide on either side of each shape’s outline. That is what section 5 predicts, since the middle can place a shape to within about four pixels and no closer, and the full-size skip is what carries the one-pixel detail across.
Keep in mind
17. The thin shapes suffer most
Split by kind, the U without skips does worst on the square outline, which is one pixel thick and so is all edge, and best on the filled disc, which has an inside.
| overlap, seed 0 | cross | square outline | filled disc | diagonal bar |
|---|---|---|---|---|
| with the skips | 0.998 | 0.996 | 0.996 | 0.977 |
| without them | 0.650 | 0.415 | 0.769 | 0.658 |
In the box at the top of the page, choose the square outline and switch the skips off. The probability map draws a soft ring roughly where the square is, too thick and with rounded corners, since a one-pixel line cannot be drawn from blocks of four. With the skips it is the square. The diagonal bar is the U with skips’ weakest kind at 0.977, since a stair of two-pixel steps puts every one of its pixels on an edge.
Keep in mind
Check yourself
Questions on Parts 3 and 4
Question 1 of 5
A backward pass that forgets the skip’s share of the blame fails loudly, so the mistake shows up without a check.
Part 5. A Threshold Does Better Here
18. The obvious alternative, measured
Every picture in this collection is a dim background with a brighter shape drawn on it, so the obvious way to find the shape is to call every pixel brighter than some level shape. I tried two versions. The first uses one level for every picture, the one of 41 levels from 0.20 to 0.60 that got most training pixels right, which was 0.41.
The second chooses a level for each picture from that picture alone, by Otsu’s rule of 1979, which tries every cut between two brightnesses and keeps the one that splits the picture into two groups whose means are furthest apart for their sizes.
…
| held-out | overlap | edge pixels right | pixels wrong |
|---|---|---|---|
| one level for every picture, 0.41 | 0.983 | 0.995 | 105 |
| a level for each picture | 0.9999 | 1.000 | 1 |
| the U with skips, seed 0 | 0.992 | 0.996 | 48 |
| the U without skips, seed 0 | 0.623 | 0.758 | 3,130 |
The U with skips beats one fixed level, by about 0.01 in overlap and on the edges too, and a fixed level has no way to follow a picture whose background happens to be bright. It loses to a level chosen per picture, which gets one pixel wrong in 61,440. The U has 2,521 parameters, took twenty passes over 240 pictures and their masks to train, and is beaten by a rule with no parameters that has never seen a mask.
Keep in mind
19. Why, and what that says about the task
The threshold wins because the pictures were drawn so that it would. A shape pixel is its picture’s background plus a lift of at least 0.4, and the noise on each pixel has a spread of 0.05, so within one picture the shape and the ground are two groups of brightness with a gap between them, and splitting the gap is the whole task.
What the U-Net was invented for is the case where that is not true, where a membrane in an electron microscope picture is no brighter than the inside of the cell beside it and the only way to tell them apart is the shape of the surroundings. That case is not in this collection, and building it would need pictures drawn some other way.
So what this collection can show about a U-Net is the architecture itself, the gap between having the skips and not, and where that gap sits. It cannot show the architecture earning its place, since on this task a rule with no parameters already gets 61,439 of the 61,440 held-out pixels right.
Keep in mind
Part 6. A Kind and a Size It Never Saw
20. Rings
The classifier on the convolutional networks page had no way to answer a ring, since it could only share each picture among the four kinds it knew, and it called most rings a square outline. A U-Net is asked only which pixels are shape, so a kind it never saw is a question it can still answer. I drew the same sixty rings that page used and scored both arrangements on them.
| overlap on 60 rings | seed 0 | seed 1 | seed 2 |
|---|---|---|---|
| with the skips | 0.991 | 0.970 | 0.995 |
| without them | 0.487 | 0.048 | 0.451 |
With the skips the rings come out almost as well as the kinds it trained on. Its errors are ring pixels called ground, 20, 70 and 11 of the 2,257 at the three seeds, and it calls at most 2 of the 2,046 pixels inside the rings’ holes shape, so it did not fill a ring in as if it were a disc.
Without the skips, at seed 0, it called 245 of those hole pixels shape and missed 908 ring pixels, which in the box at the top of the page looks like a smudge where a ring should be. The rings are the last four pictures there.
Keep in mind
21. A picture twice the size
The classifier reads sixteen by sixteen and no other size, because its dense layer has one weight per number of the flattened row. The U has no dense layer. Every layer in it reads its input window by window, so the same trained weights can read a bigger picture, and I laid four held-out pictures out two by two as one picture of 32 by 32 and handed it to the U with skips at seed 0 without retraining anything.
…
It gets all 1,024 pixels right, and its call at every pixel is the same as when the four pictures were read apart, including the pixels next to the seams, where a window now reads the neighbouring picture instead of the zeros it saw at the frame during training. On a picture with nothing drawn on it, an even brightness of 0.15, it calls no pixel shape, and the largest probability of shape it gives any pixel is 0.0044, where the classifier called the same blank picture a diagonal bar.
Keep in mind
Part 7. Where the Method Stops Being Defined
22. Sides that do not halve evenly
A join lays two blocks of maps side by side, which means nothing unless they are the same height and width. The repeated maps come from halving the picture and doubling it back, and a side that does not halve evenly loses a row on the way down that repetition cannot restore, so the two blocks meeting at the join are of different sizes.
| side | halved | halved again | doubled back | half-size join | full-size join |
|---|---|---|---|---|---|
| 16 | 8 | 4 | 8, then 16 | 8 beside 8 | 16 beside 16 |
| 18 | 9 | 4 | 8, then 16 | 8 beside 9, undefined | 16 beside 18, undefined |
| 20 | 10 | 5 | 10, then 20 | 10 beside 10 | 20 beside 20 |
| 30 | 15 | 7 | 14, then 28 | 14 beside 15, undefined | 28 beside 30, undefined |
| 32 | 16 | 8 | 16, then 32 | 16 beside 16 | 32 beside 32 |
With two poolings the joins are defined exactly when the side is divisible by four, and with d poolings when it is divisible by two to the power d.
There are three ways out, and each costs something. Pad the picture up to the next side that halves evenly, which invents pixels at the border that the network then has to answer for. Crop the larger block down to the smaller, which is what the paper did throughout, since its unpadded convolutions shrank every map anyway, and which throws away the encoder’s outermost rows.
Or resize the picture, which changes every shape in it. Without the joins the question does not arise at the joins, but it moves to the answer, which for a side of 30 comes out 28 wide and cannot be compared with a mask of 30.
Keep in mind
23. The cases where the method has no answer
Each of these is a fact about answering every pixel with a shrinking and growing network, and each is a decision any implementation of it faces.
| the case | what the method says |
|---|---|
| a picture with no shape in it | if the network also calls nothing, the overlap is zero pixels over zero pixels and is undefined. Counting it as one, leaving the picture out, or pooling the counts over all pictures before dividing are the three choices, and each gives a different average. The blank picture of section 21 is this case, and the U called nothing. |
| a picture with no shape, and a call of some | the overlap is zero whatever the size of the mistake, so one wrongly called pixel and a wrongly called half picture score the same. |
| a probability of exactly one half | the pixel is neither called shape nor ground by the rule until a side is chosen for the tie. It moves the scores only when it happens, which in floating point is rare. |
| a side not divisible by two to the power of the depth | the joins pair blocks of different sizes, which is undefined. Section 22 has the widths and the three ways out. |
| a shape touching the frame | a window at the frame reads the padding’s zeros, which are not pixels, so the network learned the frame as a dark border. A picture with a bright shape running off its edge asks it about a situation it was never shown. Every shape in this collection is drawn at least one pixel in from the frame. |
| two shapes touching | a mask says which pixels are shape and not which shape, so two touching shapes are one region in the answer. The paper met this with touching cells and weighted the loss heavily on the thin gaps between them, which is a change to the loss and not to the architecture. |
| blame split in another order than the join | if the forward pass lays the encoder’s maps first and the backward pass takes the first channels as the repeated ones, every slope in the encoder is computed for the wrong maps. Nothing about the arithmetic refuses it, and only a check like section 12 finds it. |
| detail finer than the smallest map, with no skip | repetition copies each value over a block, so without a skip the answer can place an edge only on the block grid, four pixels here. Nothing after the middle can put back what the poolings discarded unless something carries it around them. |
Keep in mind
Check yourself
Questions on Parts 5 to 7
Question 1 of 5
Why does a level chosen for each picture do so well on this collection?
Try it with Botie
Build with Botie
Write and run Python