Single Image Dehazing Using A Multilayer Perceptron
Single Image Dehazing Using A Multilayer Perceptron
Single Image Dehazing Using A Multilayer Perceptron
multilayer perceptron
Sebastián Salazar-Colores
Ivan Cruz-Aceves
Juan-Manuel Ramos-Arreguin
Abstract. This paper presents an algorithm to improve images with hazing effects. Usually, the dehazing meth-
ods based on the dark channel prior make use of two different stages to compute the transmission map of
the input image. The stages are the transmission map estimation and a transmission map refinement.
However, the main disadvantage of these strategies is the trade-off between accurate restoration and computa-
tional time. The proposed method uses a multilayer perceptron to compute the transmission map directly from
the minimum channel and a contrast stretching technique to improve the dynamic range of the restored image.
The multilayer perceptron is trained in terms of mean squared error using a training set of 80 images. To evaluate
the restoration quality, the metrics of peak signal-to-noise ratio (PSNR) and the structural similarity (SSIM) index
are used. The experimental results have proven that the proposed method achieves superior performance in
terms of restoration quality (PSNR = 18.77, SSIM index = 0.8454) compared with nine state-of-the-art dehazing
methods. In addition, based on the average computational time achieved by the proposed method (0.52 s using
a test set of 46 images), it can be highly suitable for real-time applications. © 2018 SPIE and IS&T [DOI: 10.1117/1.JEI
.27.4.043022]
Keywords: artificial neural network; dark channel prior; defogging; image enhancement; multilayer perceptron; single image dehazing.
Paper 180180 received Mar. 5, 2018; accepted for publication Jul. 3, 2018; published online Jul. 25, 2018.
solve different problems in image processing, such as human 2.2 Dark Channel Prior
face recognition,22 skin segmentation,23 and denoising.24 In The DCP proposed by He et al.14 is based on empirical obser-
addition, different deep learning strategies have been vations about the statistical features in the intensity of dark
recently introduced such as Gaussian progress regression25 channel for haze-free images.
and convolutional neural networks (CNN),26–28 where the The dark channel I dark ðx; yÞ for a digital image Iðx; yÞ is
dehazing task is performed in terms of an supervised learning defined as follows:
problem, which is roughly processed using RGB images
directly as input data and the transmission maps as target I dark ðx; yÞ ¼ min ½ min I C ðzÞ;
EQ-TARGET;temp:intralink-;e004;326;683 (4)
C∈R;G;B z∈Ωðx;yÞ
variables.
In this work, a method for single image dehazing using an where Ωðx; yÞ is a patch of m × m (usually m ¼ 15)14 cen-
MLP to estimate the transmission map rather than RGB tered on ðx; yÞ, I C is the color channel of I: R, G or B, and z
images as input data are proposed. In the training step of represents the index for a pixel in the domain of Ωðx; yÞ.
the MLP 144,000 samples were used, they were obtained The transmission ^tðx; yÞ is estimated as
from a subset of 80 real-world images. In order to define dark
the optimal architecture, several MLP topologies were tested, I ðx; yÞ
^tðx; yÞ ¼ 1 − ω ;
EQ-TARGET;temp:intralink-;e005;326;604 (5)
and the best topology was selected based on the mean A
squared error (MSE). To evaluate the performance of the pro-
where ω is a value that defines the desired level of restora-
posed method, an analysis was carried out using the peak
tion, being 1 the highest possible value.
signal-to-noise ratio (PSNR) and the similarity structural
The atmospheric light A is defined as
index measure (SSIM).29 The tests were performed in
both real-world and synthetic images. X
3
where σðxÞ is
It is important to point out that in Eq. (3), additionally to ex
the input image Iðx; yÞ, the transmission map tðx; yÞ and σðxÞ ¼ : (9)
1 þ ex
EQ-TARGET;temp:intralink-;e009;326;119
Fig. 1 Result of the DCP. (a) Input image Iðx ; y Þ, (b) dark channel map with Ω ¼ 15, (c) estimation
of Jðx ; y Þ using Ω ¼ 15, (d) dark channel map with Ω ¼ 35, and (e) estimation of Jðx ; y Þ using
Ω ¼ 35.
graph-cuts.36 The main disadvantage of these strategies is the t 0 ðx; yÞ ¼ MLP½tmin ðx; yÞ
EQ-TARGET;temp:intralink-;e013;326;752 (13)
trade-off between accurate restoration and computational
time. The main idea behind the proposed method is the strategy
The proposed method is based on the transmission map to estimate the transmission map and the introduction of an
tmin defined as additional step for improving the contrast image. In order to
improve the contrast of the recovered image, the luminance
was modified by introducing the spacecolor L a b and a
tmin ðx; yÞ ¼ 1 − ωI min ðx; yÞ;
EQ-TARGET;temp:intralink-;e011;63;697 (11) contrast stretching38 strategy. In Fig. 2, the procedure carried
out by the proposed method is introduced.
where the minimum channel I min ðx; yÞ is defined as
follows:37 3.2 Synthetic Ground-Truth Generation
Since the MLP is a supervised technique, a ground-truth
is required to perform the training step. In the present
I c ðx; yÞ work, the ground-truth data are computed using the soft mat-
I min ðx; yÞ ¼ min : (12)
Ac ting algorithm proposed by Levin et al.,39 which has proven
EQ-TARGET;temp:intralink-;e012;63;644
c∈ðR;G;BÞ
to be suitable for the dehazing problem,14 nevertheless, its
computational processing time and memory requirements
are both high.
The minimum channel tmin is equivalent to the dark chan-
The image soft matting procedure can be expressed as
nel when the patch size is Ω ¼ 1. follows:
tmin ðx; yÞ has an excellent spatial resolution; however, its
depth resolution computed is low because it omits the infor- I ¼ Fα þ Bð1 − αÞ;
EQ-TARGET;temp:intralink-;e014;326;528 (14)
mation about of neighboring pixels. From the computed
transmission map tmin ðx; yÞ, the application of an ANN where B and F are the background and foreground color
MLP to estimate a transmission map t 0 ðx; yÞ is introduced information, respectively, and α is the opacity of foreground.
as follows: In the work of He et al.,14 it was proved the equivalence
between the α map and the transmission map t̄ðx; yÞ.
Then, the optimal t̄ðx; yÞ can be computed by solving the
sparse linear system expressed as
ðL þ λUÞt̄ ¼ λ^t;
EQ-TARGET;temp:intralink-;e015;326;431 (15)
in positions ðx; yÞ where the length for each sample is l × l. 3.4 Application of MLP
The input vector was obtained from tmin ðx; yÞ and the target As it is shown in Fig. 4, to compute the transmission map
vector from t̄ðx; yÞ. The setup to perform the training stage is t 0 ðx; yÞ using the trained MLP, an input vector is generated
shown in Fig. 3. from square-windows of tmin ðx; yÞ. Each two-dimensional
Fig. 5 Examples of the processing the proposed method: (a) input images Iðx ; y Þ, (b) initial transmission
tmin ðx; y Þ, (c) final transmission t 0 ðx ; y Þ, and (d) recovered images Jðx ; yÞ.
Fig. 6 Relation between MLP architecture and performance using the training set of images.
Fig. 7 Relation between δ sliding windows used in the application of the MLP in the image, (a) SSIM
index and (b) time processing.
Fig. 8 Transmissions and results generated using different δ sliding windows: (a) δ ¼ 1, (b) δ ¼ 2,
(c) δ ¼ 4, (d) δ ¼ 8, (e) δ ¼ 12, and (f) δ ¼ 16.
Fig. 9 Comparison of the recovered results for real-world images using the ten methods: (a) input
images, (b) Tarel and Hautiere,12 (c) He et al.,14 (d) Pang et al.,15 (e) Gibson et al.,17 (f) Zhu et al.,18
(g) Berman et al.,19 (h) Ren et al.,26 (i) Cai et al.,27 (j) Li et al.,28 and (k) proposed.
Fig. 10 Comparison of the recovered results for synthetic images by the ten methods: (a) images
with haze simulated, (b) original images, (c) Tarel and Hautiere,12 (d) He et al.,14 (e) Pang et al.,15
(f) Gibson et al.,17 (g) Zhu et al.,18 (h) Berman et al.,19 (i) Ren et al.,26 (j) Cai et al.,27 (k) Li et al.,28
and (l) proposed.
Aloe 17.91 14.20 14.22 15.46 18.42 16.05 17.99 18.14 16.60 16.08
Baby1 19.96 13.98 14.23 22.81 23.09 17.64 23.09 22.01 25.98 17.69
Books 16.03 12.71 13.37 15.43 22.36 13.31 20.07 21.03 19.07 23.03
Bowling1 19.34 11.60 11.71 12.88 23.29 14.06 20.62 27.20 25.69 13.00
Dolls1 13.24 14.93 14.98 15.22 15.94 15.70 17.06 14.37 15.20 15.23
Moebius1 18.97 15.04 15.28 19.86 24.44 19.18 20.64 24.28 21.22 23.49
Monopoly 17.41 10.48 10.76 13.39 21.52 16.43 18.93 19.99 19.30 19.26
Reindeer 14.77 18.32 18.21 19.39 16.20 18.60 16.82 14.11 18.11 16.82
Bikes1 8.29 18.49 18.31 15.47 12.59 26.08 14.36 14.38 14.22 21.77
Church 11.76 12.51 12.69 14.00 13.77 15.96 15.01 15.24 11.03 17.04
Cones 19.38 20.16 19.45 19.03 19.98 19.77 17.60 19.46 21.43 17.50
Couch 16.12 18.44 18.60 17.41 18.89 18.47 19.24 17.89 17.02 19.00
Flower2 16.88 17.59 17.99 18.62 21.01 11.92 13.27 20.15 14.55 22.24
Mansion 16.45 19.80 19.75 16.98 18.09 17.42 17.86 17.93 15.44 22.35
Roofs2 11.58 22.86 22.73 17.51 15.42 21.00 13.95 13.70 15.98 20.77
Trees2 10.69 17.84 17.70 16.60 13.38 20.79 14.29 12.24 15.15 15.12
Average 15.55 16.19 16.25 16.88 18.65 17.65 17.55 18.26 17.87 18.77
values, and β has random values between 0.5 and 1.5 as it 4.2 Performance Analysis
was proposed by Ren et al.26 Furthermore, the computational The proposed method was compared with nine state-of-art
experiments were performed using the Matlab software, dehazing methods: Tarel and Hautiere,12 He et al. method,14
version R2016a on a computer with 3.10 GHz Intel Core Pang et al. method,15 Gibson et al.,17 Zhu et al.,18 Berman
i5-2400 and 12 GB RAM memory. et al., Ren et al.,26 Cai et al.,27 and Li et al.28 The parameters
used in each method are the proposed by every author.
tested over the training set varying the δ value in the range
Tarel et al. Gibson et al.
Pang et al. Cai et al.
½1; ::; 16. Three aspects were considered to choose the δ value:
Ren et al. Li et al.
Berman et al. Proposed
Aloe 0.9028 0.7855 0.7976 0.8381 0.9549 0.8250 0.9473 0.9458 0.9220 0.8180
Baby1 0.9032 0.7763 0.7961 0.9403 0.9706 0.8563 0.9596 0.9655 0.9729 0.8317
Books 0.8403 0.7378 0.7715 0.8237 0.9561 0.7705 0.9254 0.9439 0.9357 0.9219
Bowling1 0.9255 0.6760 0.6902 0.7305 0.9764 0.7786 0.9496 0.9844 0.9814 0.7698
Dolls1 0.7354 0.7912 0.7737 0.8317 0.8119 0.8343 0.8413 0.7958 0.8136 0.8268
Moebius1 0.8665 0.7933 0.7940 0.9080 0.9593 0.8731 0.9322 0.9629 0.9259 0.9159
Monopoly 0.8929 0.7197 0.7308 0.8486 0.9763 0.9137 0.9562 0.9647 0.9605 0.9407
Reindeer 0.6842 0.7966 0.7805 0.8033 0.7409 0.7779 0.7632 0.7102 0.7814 0.7753
Bikes1 0.4939 0.7785 0.7560 0.6436 0.5143 0.8479 0.5963 0.5469 0.5009 0.7953
Church 0.7627 0.7692 0.7682 0.8532 0.8218 0.8832 0.8544 0.8198 0.6108 0.8889
Cones 0.8530 0.9090 0.8904 0.9186 0.9274 0.9162 0.8186 0.9247 0.8995 0.8776
Couch 0.7950 0.8450 0.8356 0.8183 0.8293 0.8620 0.8658 0.8217 0.8169 0.8245
Flower2 0.8023 0.8431 0.8591 0.8640 0.9630 0.6652 0.5919 0.9105 0.7814 0.9086
Mansion 0.8434 0.8958 0.8917 0.8424 0.8769 0.8697 0.8730 0.8362 0.6907 0.9140
Roofs2 0.6552 0.8445 0.8424 0.7806 0.6619 0.8602 0.6296 0.6156 0.6601 0.8335
Trees2 0.5462 0.6833 0.6710 0.6758 0.5800 0.7387 0.6122 0.5492 0.5877 0.6833
Average 0.7814 0.7903 0.7906 0.8201 0.8451 0.8295 0.8198 0.8311 0.8026 0.8454
For the proposed method (the source code and dehazing 6. Y. Y. Schechner, S. G. Narasimhan, and S. K. Nayar, “Instant dehazing
of images using polarization,” in Proc. of IEEE Computer Society Conf.
results of the proposed method42), the parameters are: δ ¼ 8, on Computer Vision and Pattern Recognition (CVPR), Kauai, Vol. 16,
window size s ¼ 16, and w ¼ 0.7. pp. 325–332 (2001).
7. S. Fang et al., “Image dehazing using polarization effects of objects and
To perform a visual analysis, in Fig. 9, the dehazing airlight,” Opt. Express 22, 19523–19537 (2014).
results of the proposed and comparative methods over a sub- 8. T. Fang, Z. Cao, and R. Yan, “A unified dehazing approach for infrared
set of real-world images of the test set are presented. In this images,” Proc. SPIE 8917, 89170V (2013).
9. J. Kopf et al., “Deep photo: model-based photograph enhancement and
subset, a higher contrast along with more natural intensities viewing,” ACM Trans. Graphics 27(5), 116 (2008).
is obtained by the proposed method. In addition, Fig. 10 10. C. Chengtao, Z. Qiuyu, and L. Yanhua, “A survey of image dehazing
shows the results using synthetic images. approaches,” in Control and Decision Conf. (CCDC), Qingdao, China,
Vol. 1, pp. 3964–3969 (2015).
To evaluate the restoration level, Tables 1 and 2 present 11. V. Sahu and M. Singh, “A survey paper on single image dehazing,” Int.
the PSNR and SSIM index values, respectively. The pro- J. Recent Innov. Trends Comput. Commun. 3(2), 85–88 (2007).
posed method achieves the highest average value of PSNR, 12. J.-P. Tarel and N. Hautiere, “Fast visibility restoration from a single
color or gray level image,” in IEEE Int. Conf. on Computer Vision
and the highest average in terms of the SSIM index. Finally, (ICCV), Kyoto, Japan, Vol. 1, pp. 2201–2208 (2009).
Fig. 11 shows the time processing comparison, where the 13. R. Fattal, “Single image dehazing,” ACM Trans. Graphics 27, 72 (2008).
14. K. He, J. Sun, and X. Tang, “Single image haze removal using dark chan-
proposed method obtains the best performance. nel prior,” IEEE Trans. Pattern Anal. Mach. Intell. 33(12), 2341–2353
(2010).
5 Conclusion 15. J. Pang, A. Oscar, and G. Zheng, “Improved single image dehazing
using guided filter,” in Proc. of the APSIPA Annual Summit and
In this paper, a single image dehazing method was proposed. Conf. (APSIPA ASC), Xi’an, China, Vol. 1, pp. 1–4 (2011).
This method uses an artificial neuronal network MLP to 16. K. Nishino, L. Kratz, and S. Lombardi, “Bayesian defogging,” Int. J.
Comput. Vision 98(3), 263–278 (2012).
estimate the transmission map of a haze image. To obtain 17. K. B. Gibson, D. T. Võ, and T. Q. Nguyen, “An investigation of dehaz-
the optimal MLP configuration, a training set of 80 real- ing effects on image and video coding,” IEEE Trans. Image Process.
world images was used. In the training experiments, a num- 21(2), 662–673 (2012).
18. Q. Zhu, J. Mai, and L. Shao, “A fast single image haze removal algo-
ber of hidden layers containing different number of neurons rithm using color attenuation prior,” IEEE Trans. Image Process. 24,
were tested, where the best performance in terms of the MSE 3522–3533 (2015).
was achieved using a 256- to 1024- MLP configuration with 19. D. Berman, T. Treibitz, and S. Avidan, “Non-local image dehazing,” in
IEEE Conf. on Computer Vision and Pattern Recognition (CVPR)
an MSE = 0.000151. In order to evaluate the restoration qual- (2016).
ity of the proposed method, the SSIM index and the PSNR 20. M. Gardner and S. Dorling, “Artificial neural networks (the multilayer
were used. The experimental results have proven that the perceptron): a review of applications in the atmospheric sciences,”
Atmos. Environ. 32(14–15), 2627–2636 (1998).
proposed method achieves a superior performance than 21. D. Kriesel, A brief introduction to neural networks, Retrieved August
seven state-of-art methods in terms of restoration quality, Vol. 1(1), p. 244, http://www.dkriesel.com (2005).
22. D. Bhattacharjee et al., “Human face recognition using fuzzy multilayer
obtaining a PSNR value of 18.77 and SSIM index of 0.8454 perceptron,” Soft Comput. 14(6), 559–570 (2010).
over a test set of synthetic images. In addition, a comparative 23. S. L. Phung, A. Bouzerdoum, and D. Chai, “Skin segmentation using
analysis using the test set of 40 images between the proposed color pixel classification: Analysis and comparison,” IEEE Trans.
Pattern Anal. Mach. Intell. 27(1), 148–154 (2005).
and comparative methods reveals that the lowest computa- 24. H. C. Burger, C. J. Schuler, and S. Harmeling, “Image denoising:
tional time was obtained by the proposed method (0.52 s). can plain neural networks compete with BM3D?” in Proc. of the
Given the suitable results in terms of restoration quality IEEE Computer Society Conf. on Computer Vision and Pattern
Recognition, pp. 2392–2399 (2012).
and execution time of the proposed method with respect 25. X. Fan et al., “Two-layer Gaussian process regression with example
to the seven state-of-art dehazing methods, it can be highly selection for image dehazing,” IEEE Trans. Circuits Syst. Video
appropriate to be used in real-time systems. Technol. 27(12), 2505–2517 (2017).
26. W. Ren et al., “Single image dehazing via multi-scale convolutional
neural networks,” in Proc. of 14th European Conf. on Computer
Disclosures Vision–ECCV, Amsterdam, The Netherlands, Part II, B. Leibe et al.,
Eds., pp. 154–169, Springer International Publishing, Cham (2016).
The authors declare there is no conflict of interest. 27. B. Cai et al., “DehazeNet: an end-to-end system for single image haze
removal,” IEEE Trans. Image Process. 25(11), 5187–5198 (2016).
Acknowledgments 28. B. Li et al., “AOD-Net: all-in-one dehazing network,” in Proc. of the
IEEE Int. Conf. on Computer Vision, pp. 4780–4788 (2017).
Sebastián Salazar-Colores (CVU 477758) would like to 29. R. Dosselmann and X. Yang, “A comprehensive assessment of the struc-
thank CONACYT (Consejo Nacional de Ciencia y tural similarity index,” Signal, Image and Video Process. 5(1), 81–91
(2011).
Tecnología) for the financial support of his PhD studies 30. E. J. McCartney and F. F. Hall, “Optics of the atmosphere: scattering by
under Scholarship 285651. In addition, the authors thank molecules and particles,” Phys. Today 30(5), 76–77 (1977).
CONACYT for the project Cátedras-CONACYT No. 31. L. Fausett, “Fundamentals of neural networks,” in Int. Geoscience and
Remote Sensing Symp. (IGARSS), Vol. 1(1), pp. 1–5 (2014).
3150-3097. 32. K. Tang, J. Yang, and J. Wang, “Investigating haze-relevant features in a
learning framework for image dehazing,” in IEEE Conf. on Computer
References Vision and Pattern Recognition (CVPR), Columbus, Ohio, Vol. 1,
pp. 2995–3002 (2014).
1. Y. Cheng, W. Niu, and Z. Zhai, “Video dehazing for surveillance 33. C.-H. Yeh et al., “Haze effect removal from image via haze density esti-
unmanned aerial vehicle,” in Proc. of AIAA/IEEE Digital Avionics mation in optical model,” Opt. Express 21, 27127–27141 (2013).
Systems Conf. (2016). 34. Q. Zhu et al., “Mean shift-based single image dehazing with re-refined
2. A. L. Baruwa, A. N. Evans, and R. Wyatt, “The development of transmission map,” in IEEE Int. Conf. on Systems, Man and Cybernetics
a remote sensing system with real-time automated horizon tracking (SMC), San Diego, California Vol. 1, pp. 4058–4064 (2014).
for distance estimation at sea,” Proc. SPIE 8892,889217 (2013). 35. K. B. Gibson and T. Q. Nguyen, “Fast single image fog removal using
3. J. Long et al., “Single remote sensing image dehazing,” IEEE Geosci. the adaptive Wiener filter,” in IEEE Int. Conf. on Image Processing,
Remote Sens. Lett. 11(1), 59–63 (2014). Melbourne, Canada, Vol. 1, pp. 714–718, IEEE (2013).
4. S. Kim, S. Park, and K. Choi, “A system architecture for real time traffic 36. M. Zhu and B. He, “Dehazing via graph cut,” Opt. Eng. 56, 113105 (2017).
monitoring in foggy video,” in Korea-Japan Joint Workshop on 37. S. Jeong and S. Lee, “The single image dehazing based on efficient trans-
Frontiers of Computer Vision (FCV), Mokpo, South Korea, Vol. 1, mission estimation,” in IEEE Int. Conf. on Consumer Electronics,
pp. 1–4, (2015). pp. 376–377 (2013).
5. X. Yan et al., “Effects of foggy conditions on drivers’ speed control 38. C. C. Yang, “Image enhancement by modified contrast-stretching
behaviors at different risk levels,” Saf. Sci. 68, 275–287 (2014). manipulation,” Opt. Laser Technol. 38(3), 196–201 (2006).
39. A. Levin, D. Lischinski, and Y. Weiss, “A closed-form solution to Ivan Cruz-Aceves received his PhD in electrical engineering from the
natural image matting,” IEEE Trans. Pattern Anal. Mach. Intell. 30(2), Universidad de Guanajuato in 2014. He has been working at the
228–242 (2008). Mexican National Council on Science and Technology assigned to
40. R. Fattal, “Dehazing using color-lines,” ACM Trans. Graphics 34(1), the Center for Research in Mathematics in Guanajuato, Mexico,
1–14 (2014).
41. H. Hirschmuller and D. Scharstein, “Evaluation of cost functions for stereo since 2014. His research areas are biomedical signal and image
matching,” in Conf. on Computer Vision and Pattern Recognition, pp. 1–8 analysis, computational intelligence, and evolutionary computation.
(2007).
42. I. Cruz-Aceves, “Single image dehazing using a multilayer perceptron,” Juan-Manuel Ramos-Arreguin received his MS degree in electrical
2018 http://personal.cimat.mx:8181/~ivan.cruz/dehazing.html. engineering option instrumentation and digital systems from the
University of Guanajuato and his PhD in mechatronics science
Sebastián Salazar-Colores received his BS degree in computer sci- from the Centro de Ingeniera y Desarrollo Industrial (Engineering
ence from the Universidad Autónoma Benito Juárez de Oaxaca and and Industrial Development Center). Since 2009 he has been part
his MS degree in electrical engineering at Universidad de Guanajuato. of the Engineering Department at the UAQ where he works as
HE is a PhD candidate in computer science at the Universidad a researcher and lecturer. His research interest includes mecha-
Autónoma de Querétaro. His research interests are image processing tronics and embedded systems.
and computer vision.