← All articles

segmentationthermal imagingautonomous drivingmultispectral imaging

Using heat images to sharpen street-scene segmentation at night

After dark, a normal camera sees very little, but a thermal camera still picks out warm things such as people. We built a small network that reads both a colour image and a thermal image of a street and labels every pixel with an object type. We then cleaned up the result using the thermal image to decide where object edges lie. On the night images, this gave higher scores than the competing models we compared (Tables I and II).

The problem

Night surveillance is a major use of thermal imaging, because ordinary cameras perform poorly in the dark. Our task was semantic segmentation, which means giving each pixel of a street scene a label such as person, car or bike. The simplest way to use two kinds of image is to stack them into one four-channel input. But the three colour channels depend on each other, while a thermal channel records properties such as surface quality and temperature, and may not correspond to the colour image pixel by pixel. So we gave each its own encoder.

How it works

The network has two encoders, one for the colour image and one for the thermal image. Both are based on the compact SegFast design, which uses cheap depth-wise separable convolutions inside Spark modules. A single decoder then enlarges the features, and at each size it joins the features from both encoders. The last layer gives a label for each pixel.

Architecture diagram: an RGB encoder on top and a thermal encoder at the bottom both send copied features into a central decoder, which ends in a classifier.
Two separate encoders look at the colour and thermal images. The decoder in the middle merges their features at several sizes.Source: Fig. 3 of the paper.

The outlines from a network like this can still be ragged. A conditional random field, or CRF, is a post-processing step that tidies them. It links neighbouring pixels: nearby pixels with similar intensity are encouraged to share a label. Normally the intensity is taken from the input picture, here the colour image. Our change was to compute that similarity from the thermal image instead, because the thermal spectrum depends on the heat properties of an object rather than on colour and lighting. The network's own pixel predictions stay as they are and serve as the starting guess.

What we found

We used a street-scene data set of 1,563 images, 820 taken by day and 743 at night, split roughly 2:1:1 into training, validation and test sets. We compared against SegNet, MFNet and RTFNet, applying both kinds of CRF to all four networks. We report average pixel-level accuracy and mean intersection over union (IoU), which scores how well each predicted region overlaps the true one.

On the night images our network with the thermal CRF reached an average accuracy of 0.8185 and a mean IoU of 0.6438. With the colour CRF it got 0.7340 and 0.5784, and with no CRF 0.6119 and 0.5681. RTFNet with the thermal CRF scored 0.7687 and 0.6293. On the full day-and-night set, our network scored 0.7398 and 0.6333 with the thermal CRF (Tables I and II).

Grid of two day and two night street scenes showing the colour image, thermal image, true labels, and predictions from SegNet, RTFNet, MFNet and the proposed network with RGB or thermal CRF.
In the night scenes, the thermal image shows people clearly even when the colour image is nearly black. The last row is the proposed network with thermal-based refinement.Source: Fig. 6 of the paper.
At night, our network with a thermal-based CRF reached an average accuracy of 0.8185 and a mean IoU of 0.6438, exceeding the competing models (Tables I and II).

The network is also small. It has 2.05 million parameters and 23.71 GFlops, against 29.45 million and 189.85 for SegNet, and 254.51 million and 337.46 for RTFNet. MFNet is smaller still, at 0.74 million parameters and 8.45 GFlops.

Bar chart of parameters in millions and GFlops for the proposed network, SegNet, RTFNet and MFNet.
The proposed network is much smaller than SegNet and RTFNet, but slightly larger than MFNet.Source: Fig. 5 of the paper.

Results in more detail

The comparison networks were SegNet, MFNet and RTFNet. SegNet was given a four-channel input, the three colour channels plus the thermal one. MFNet and RTFNet were two earlier works that had already been run on this data set, and we re-ran them with their official code. We then applied the conditional random field to all four networks, once with the colour image (called CRF RGB in the tables) and once with the thermal image (CRF TH). The first table gives the average accuracy for each combination, by day and by night. A higher value is better, and the Mean row averages the four networks.

Average accuracy of each network without a CRF, with the colour CRF and with the thermal CRF, on day and night images
ModelDay: no CRFDay: CRF RGBDay: CRF THNight: no CRFNight: CRF RGBNight: CRF TH
MFNet0.48870.68860.64220.63880.73030.7536
RTFNet0.49330.53630.54520.71490.77750.7687
SegNet0.39520.49590.49770.50550.53510.5130
Proposed0.43200.53610.54490.61190.73400.8185
Mean0.45230.56420.55750.61780.69420.7135
The columns for the day-and-night total of Table I are left out; the proposed network's total values are given in the text. Source: Table I of the paper.

In accuracy, every network scores higher with either CRF than with none, by day and by night. For our network at night, accuracy goes from 0.6119 with no CRF to 0.7340 with the colour CRF and 0.8185 with the thermal CRF. The network-by-network picture at night is mixed. MFNet does best with the thermal CRF (0.7536), while RTFNet (0.7775 against 0.7687) and SegNet (0.5351 against 0.5130) do slightly better with the colour one (Table I).

The second table gives mean intersection over union (IoU), which scores how well each predicted region overlaps the true region. Here 1 would be a perfect overlap.

Mean intersection over union of each network without a CRF, with the colour CRF and with the thermal CRF, on day and night images
ModelDay: no CRFDay: CRF RGBDay: CRF THNight: no CRFNight: CRF RGBNight: CRF TH
MFNet0.56820.62590.50120.56900.58880.5637
RTFNet0.55630.57710.58920.64090.64200.6293
SegNet0.30260.32200.32220.39240.42060.4225
Proposed0.52590.46010.45100.56810.57840.6438
Mean0.48830.49630.46590.54260.55750.5648
The columns for the day-and-night total of Table II are left out. Higher is better. Source: Table II of the paper.

At night our network has the highest value in the table, 0.6438 with the thermal CRF, and the Mean row rises from 0.5426 without a CRF to 0.5575 and then 0.5648 (Table II). On the whole data set our network gets 0.5168 accuracy without a CRF, 0.6408 with the colour CRF and 0.7398 with the thermal CRF. Its mean IoU there is 0.5553, 0.5930 and 0.6333 (Table I and Table II).

In the day images the picture is different. MFNet has the highest accuracy with the colour CRF (0.6886), and for our network the day-time IoU is highest with no CRF at all (0.5259 against 0.4601 and 0.4510). SegNet has the lowest IoU in every column (Table II).

Discussion

We conclude that the proposed network performs better than many other state-of-the-art models, especially at night. Using the thermal image to define the pairwise potentials gave the best results on the night set and on the whole data set. On average, the thermal-based CRF is better than the colour-based one on both of those sets, while the colour-based CRF has the edge on the day set. The same trend appears with mean IoU.

We explain the pattern like this. In the daytime, sunlight and shadows make the thermal intensity maps very noisy compared with what the visible spectrum encodes. At night the tables turn: the visible spectrum fails to separate boundaries, but the thermodynamic properties of objects help to tell the types of object apart.

The results also show the limits of the method. The benefit depends on the time of day. It varies by network too: for RTFNet and SegNet individually the colour CRF scored slightly higher at night. Our network is much smaller than SegNet and RTFNet, but slightly larger than MFNet. The data set has 1,563 street images, of which 820 were taken by day and 743 at night, and we kept the split used by the original data set.

For future work we suggest more efficient ways of extracting features from several spectra, because that should produce better predictions for the CRF to start from.

Sources

The figures and tables listed here are taken from the paper cited at the top of this page; the numbers quoted in the text come from it too.

  • Figures: Fig. 3, Fig. 6, Fig. 5
  • Tables: Table I: average pixel-level accuracy of each network, with no CRF, a colour CRF and a thermal CRF, by day, night and overall; Table II: mean intersection over union for the same networks and settings

Cite the paper

A Dutta, B Mandal, Swarnendu Ghosh, N Das (2020). Using thermal intensities to build conditional random fields for object segmentation at night. 4th International Conference on Computational Intelligence and Networks (CINE 2020).

BibTeX
@inproceedings{dutta2020thermal,
  author    = {Dutta, A and Mandal, B and Ghosh, Swarnendu and Das, N},
  title     = {Using thermal intensities to build conditional random fields for object segmentation at night},
  booktitle = {4th International Conference on Computational Intelligence and Networks (CINE 2020)},
  year      = {2020},
  doi       = {10.1109/cine48825.2020.234402}
}