0% found this document useful (0 votes)
16 views4 pages

Histogram-Based Image Pre-Processing For Machine Learning

This paper presents a novel approach for image pre-processing in machine learning by incorporating histogram-based methods alongside traditional z-score normalization. The proposed methods, including Histogram Equalization, Adaptive Gamma Correction with Weighting Distribution, and Contrast-ACcumulated Histogram Equalization, were evaluated using Support Vector Machine and Random Forest classifiers for face-based authentication. Results indicate that while z-score normalization is beneficial for SVM classifiers, it does not enhance performance for Random Forest, where image enhancement methods significantly improve accuracy.

Uploaded by

Nikhil Tengli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

Histogram-Based Image Pre-Processing For Machine Learning

This paper presents a novel approach for image pre-processing in machine learning by incorporating histogram-based methods alongside traditional z-score normalization. The proposed methods, including Histogram Equalization, Adaptive Gamma Correction with Weighting Distribution, and Contrast-ACcumulated Histogram Equalization, were evaluated using Support Vector Machine and Random Forest classifiers for face-based authentication. Results indicate that while z-score normalization is beneficial for SVM classifiers, it does not enhance performance for Random Forest, where image enhancement methods significantly improve accuracy.

Uploaded by

Nikhil Tengli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2018 IEEE 7th Global Conference on Consumer Electronics (GCCE 2018)

Histogram-Based Image Pre-processing for Machine


Learning
Ayumi Sada Yuma Kinoshita Sayaka Shiota Hitoshi Kiya
Tokyo Metropolitan University Tokyo Metropolitan University Tokyo Metropolitan University Tokyo Metropolitan University
Tokyo, Japan Tokyo, Japan Tokyo, Japan Tokyo, Japan
[email protected] [email protected] [email protected] [email protected]

Abstract—This paper proposes to use some image processing As for image processing, numerous image enhancement
methods as a data normalization method for machine learning. methods have been studied to improve the quality of im-
Conventionally, z-score normalization is widely used for pre- ages [14]–[19]. Histogram Equalization (HE) [20] is one
processing of data. In the proposed approach, in addition
to z-score normalization, a number of histogram-based image of the most famous contrast enhancement method and var-
processing methods such as histogram equalization are applied ious extended versions of HE have been proposed such
to training data and test data as a pre-processing method for as Adaptive Gamma Correction with Weighting Distribu-
machine learning. We evaluate the effectiveness of the proposed tion (AGCWD) [21] and Contrast-ACcumulated Histogram
approach by using a support vector machine algorithm and a Equalization (CACHE) [22]. AGCWD aims to prevent over-
random forest one. In experiments, the proposed scheme is ap-
plied to a face-based authentication algorithm with SVM/random enhancement and under-enhancement caused by HE, by using
forest classifiers to confirm the effectiveness. For SVM classifiers, an adaptive gamma correction and a modified probability
both z-score normalization and image enhancement work well as distribution. CACHE adaptively controls the contrast gain
a pre-processing method for improving the accuracy. In contrast, according to the potential visual importance of intensities and
for random forest classifiers, a number of image enhancement pixels. Histogram Matching (HM) [23], [24] transforms an
methods work well, although z-score normalization is unuseful
for improving the accuracy. image histogram into any reference histogram. Because these
Index Terms—Pre-processing, Contrast Enhancement, Support image enhancement methods have been studied to improve
Vector Machines, Machine Learning, Random Forest the visuality of image, they have not been considered as pre-
processing methods for machine learning.
I. I NTRODUCTION Because of such a situation, this paper proposes to use
some image processing methods as a data normalization
Machine learning and deep learning have been spreading method for machine learning. In this paper, in addition to z-
in many fields such as face recognition, medical diagnosis, score normalization, histogram matching and various image
character recognition, and machine translation [1]–[5]. A lot of enhancement algorithms including histogram equalization are
researchers have been seeking for efficient algorithms to obtain applied to learning data and test one as one of pre-processing
a high performance. In this paper, we focus on two machine methods.
learning algorithms: SVM [6], [7] and random forest [8], [9]. In this paper, we focus on two algorithms: SVM and
Support Vector Machine (SVM) is well known as a supervised random forest. The proposed framework, which consists of z-
machine learning method for binary classification. It has score normalization and contrast enhancement methods, was
high capability by using margin maximization and nonlinear evaluated by using a face-based authentication algorithm with
classification based on a kernel function [10]. Random forest SVM/random forest, in terms of True Positive Rate and True
is an ensemble learning method using decision trees. It is Negative Rate. When we used SVM classifiers, both TPR
carried out by combining a plurality of decision trees and and TNR were improved in all cases of using z-score nor-
majority decision of prediction results of each decision tree. malization and contrast enhancement than using only z-score
However, the performance of learning algorithms is known normalization. In contrast, for random forest classifiers, z-
to be influenced by pre-processing of data such as data score normalization was not useful for improving the accuracy,
normalization [11], [12]. and a number of image enhancement methods were useful even
Data normalization which transforms data according to a in such a case.
certain rule, is widely used as pre-processing [13]. Data nor-
malization enables us not only to improve the accuracy but also II. S CENARIO
to speed up the learning. Conventionally, z-score normalization Figure1 shows the outline of the proposed approach. Ma-
has been widely used as one of data normalization methods for chine learning consists of two stages: training stage and test
most of machine learning applications. Nevertheless, studies (query) stage, where pre-processing is performed in both
on pre-processing for machine learning are very few, compared stages. Conventionally, z-score normalization has been widely
to studies on learning algorithms. used as a pre-processing method, and its effectiveness has

Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on June 19,2025 at 10:22:09 UTC from IEEE Xplore. Restrictions apply.
978-1-5386-6309-7/18/$31.00 ©2018 IEEE 272
B. AGCWD
HE often produces unrealistic effects in photographs, due
to too strong emphasis. In order to solve this issue, AGCWD
(a) Training flow (Adaptive Gamma Correction with Weighting Distribution),
which is one of contrast enhancement methods, has been
proposed. In AGCWD, the transformation T is given by
T (k) = K · (k/K)µ , (3)
where µ is obtained by
(b) Test flow
µ = 1 − cdfω (k). (4)
Fig. 1: Machine learning example with pre-processing
Here, a weighted CDF cdfω (k) is obtained by the following
formula
been evaluated in most of leaning algorithms[1]. In z-score ∑K
pdf (k)
normalization, input data X is transformed into output data
cdfω (k) = ∑K ′
, (5)
k=0 k′ =0 pdfω (k )
that have average µz = 0 and standard deviation σz = 1,
computed by where, pdf is the probability distribution function (PDF) of
xi − µ luminance and pdfω is calculated as
zi = , (1) ( )η
σ pdf (k) − pdfmin
pdfω (k) = pdfmax · . (6)
where xi and zi are an element of input data X = {xi } and an pdfmax − pdfmin
element of output data Z = {zi }, and µ and σ are the average In this case, pdfmax , pdfmin indicate the maximum value
vale and the standard deviation of input data respectively. and the minimum value of pdf respectively. According to the
In this paper, we propose to add a new pre-processing literature [21], the parameter η = 0.8 was set. We try to use
method as pre-processing 1 in Fig.1. The aim of z-score nor- this algorithm for machine leaning.
malization is to normalize data, while some image processing
methods such as histogram equalization allow us not only to C. CACHE
normalize data, but also to produce higher quality data than CACHE (Contrast-ACcumulated Histogram Equalization)
the original one as shown in Fig.2. Compared to the use of method, which is an extended method of HE, can adjust the
low quality data, it is expected that the use of high quality data contrast of images according to the potential visual importance
improves the performance of machine learning algorithms. of input images. In this method, the potential visual importance
of each pixel is computed by using its dark-pass filtered
III. P ROPOSED M ETHOD gradients. The dark-pass filtered gradients ψ(h) is computed
by ( )
As described in Scenario, in this paper, some image pro- ∑ Il (h) − Il (h′ )
cessing methods are applied to machine learning algorithms ψl (h) = − min ,0 , (7)

K
as a pre-processing method. Here, image processing methods h ∈N (h)

used as a pre-processing method are summarized. where h = (x, y) denotes the coodinates of a pixel, N (h)
is a set of neighboring coodinates of h, Il is obtained by
A. Histogram Equalization downsampling the input image I(h) by a factor 2l . By using
Histogram equalization (HE) is a method in image process- Eq.(7), the potential visual importance Φ is computed as
ing of contrast adjustment using the image histogram. Through (L )1/L

this adjustment, the intensity can be better distributed on the Φ(h) = max(U (ψl (h)), ε , (8)
histogram. For a grayscale image, the transformation T of the l=1
luminance value using HE is given by
where U (·) denotes an upsampling operator, a modified PDF
T (k) = K · cdf (k), (2) is obtained by using Φ, as follows:
∑ ∑
Φ(h)δ(I(h), k)
where k is a luminance intensity, K is the maximum lumi- pdfc (k) =
x
∑y ∑ , (9)
nance intensity of the input image (typically 255), and cdf (·) x y Φ(h)

is the cumulative distribution function (CDF) of luminance. where δ(I(h), k) is the Kronecker delta. The value of pdfc (k)
The method can lead to better views of structure in input is changed only when the luminance I(h) equals to k. There-
images, and moreover, can work to justify the variation among fore, the final transformation T is given by
input images, even when each input image has a different
distribution on the histograms. In this paper, HE is carried ∑
k
T (k) = K · pdfc (k ′ ). (10)
out by using a function in MATLAB.
k′ =0

Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on June 19,2025 at 10:22:09 UTC from IEEE Xplore. Restrictions apply.
273
D. Histogram Matching TABLE I: Experiment Result (SVM)
Histogram Matching (HM) is the transformation of an image Pre-processing 1 Pre-processing 2 TPR(%) TNR(%)
so that its histogram matches a reference histogram. Thus, skip skip 93.26 99.82
HE skip 98.36 99.96
choosing a reference image, other images are transformed so AGCWD skip 94.08 99.84
that their histograms match the histogram of the reference CACHE skip 37.66 98.32
image. Note that we may directly choose a reference histogram HM (Gaussian) skip 98.68 99.96
skip z-score normalization 96.22 99.90
such as Gaussian distribution, although a reference image can HE z-score normalization 98.68 99.96
be chosen. A lot of machine learning models assume that input AGCWD z-score normalization 98.52 99.96
data follow Gaussian distribution. CACHE z-score normalization 98.19 99.95
HM (Gaussian) z-score normalization 98.52 99.96
IV. E XPERIMENT
In this experiment, we focused on a SVM algorithm and TABLE II: Experiment Result (random forest)
random forest as one of machine learning algorithms. To Pre-processing 1 Pre-processing 2 TPR(%) TNR(%)
confirm the effectiveness, the above image processing methods skip skip 96.71 99.91
were applied to a face recognition algorithm with SVM / HE skip 96.38 99.90
AGCWD skip 97.37 99.93
random forest classifiers, where SVM was carried out as a CACHE skip 97.70 99.94
dual problem. We evaluated the proposed method in terms of HM (Gaussian) skip 95.07 99.87
True Positive Rate (TPR) and True Negative Rate (TNR) in skip z-score normalization 96.71 99.91
HE z-score normalization 96.22 99.90
this paper. AGCWD z-score normalization 97.37 99.93
CACHE z-score normalization 97.70 99.94
A. Data Set HM (Gaussian) z-score normalization 94.90 99.86
We used Extended Yale Face Database B [8] that consists of
2432 frontal facial images with 192×168-pixels of 38 people
(see Fig.2). 64 images for each person were divided into 48 SVM classifiers. Moreover, the use of pre-processing 1 led to
training ones and 16 test ones for each person. a higher performance, even when z-score normalization was
carried out as pre-processing 2. The best scores were obtained
B. Assessment
when two pre-processing methods performed.
In the experiment, TPR and TNR were used to evaluate the
performance. TPR and TNR are calculated by
D. Experiment 2 (Random forest)
TP
TPR = × 100[%], (11)
TP + FN Random forest is an ensemble learning method for classi-
TN fication, regression and other tasks. A multitude of decision
TNR = × 100[%], (12) trees is used as weak learners in random forest.
TN + FP
Random forest is an ensemble of decision trees. The deci-
where TP, TN, FN and FN represent the number of true pos-
sion tree is invariance when the magnitude relation of each
itive, true negative, false positive, and false negative matches,
feature is not changed. z-score normalization does not change
respectively.
the magnitude relation of each feature quantity, so random
C. Experiment 1 (SVM) forest would not be influenced by z-score normalization. In this
We show the result of face recognition using SVM as a section, we show the result of face recognition using random
classifier. forest as a classifier.
1) experiment condition: In the experiment, a one-versus- 1) experiment condition: The output of the decision tree
the-rest classifier was trained for each class, that is, 38 SVM was a class, and the identification used its majority vote. The
classifiers were trained in total. In addition, we utilized a linear number of trees was 100, and the number of division was 10.
kernel function for SVMs. As a feature vector, we used a We used ‘bootstrap aggregation’ on the ensemble of decision
vector obtained by concatenating the columns of an image. trees used for classification.
Here, all images were resized from original 192 × 168 pixels 2) Result and Discussion: From Table 2, it is confirmed
to 32 × 32 pixels. that the TPR and TNR values were not effected by z-score
2) Result and Discussion: Table 1 shows results under normalization. This is due to the fact that z-score normalization
various pre-processing conditions, where the condition of Pre- does not change the magnitude relation of each feature quan-
processing 1 (skip) and Pre-processing 2 (z-score normaliza- tity as mentioned before. Moreover, the use of AGCWD and
tion) corresponds to the conventional one, and HM (Gaussian) CACHE in pre-processing 1 led to a higher performance than
indicates that HM was carried out with Gaussian distribution the other case regardless of z-score normalization. Therefore,
as a reference histogram. From Table 1, it is first confirmed some contrast enhancement work well in pre-processing. Both
that two processings: pre-processing 1 and pre-processing 2 of the best TPR and TNR scores were obtained when CACHE
are absolutely effective for improving the performance of the was applied in pre-processing 1.

Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on June 19,2025 at 10:22:09 UTC from IEEE Xplore. Restrictions apply.
274
to apply the proposed approach to various machine learning
algorithms including deep learning as a future work.
R EFERENCES
[1] S. Gong, S. J. McKenna, and A. Psarrou, “From images to face
recognition,” Image Processing, Imperial College Press, 1999.
[2] I. Kononenko, “Machine learning for medical diagnosis: history, state
(a) person 1 of the art and perspective,” Artificial Intelligence in medicine, vol. 23,
no. 1, pp. 89–109, 2001.
[3] N. M. Nasrabadi, “Pattern recognition and machine learning,” Journal
of electronic imaging, vol. 16, no. 4, p. 049901, 2007.
[4] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image
recognition,” in Proceedings of the IEEE conference on computer vision
and pattern recognition, 2016, pp. 770–778.
[5] S. M. Weiss and C. A. Kulikowski, Computer systems that learn: clas-
sification and prediction methods from statistics, neural nets, machine
(b) person 1 with HE (c) person 1 with AGCWD learning, and expert systems. Morgan Kaufmann Publishers Inc., 1991.
[6] M. A. Hearst, S. T. Dumais, E. Osuna, J. Platt, and B. Scholkopf, “Sup-
port vector machines,” IEEE Intelligent Systems and their applications,
vol. 13, no. 4, pp. 18–28, 1998.
[7] S. R. Gunn et al., “Support vector machines for classification and
regression,” ISIS technical report, vol. 14, no. 1, pp. 5–16, 1998.
[8] L. Breiman, “Random forests,” Machine learning, vol. 45, no. 1, pp.
5–32, 2001.
[9] M. Pal, “Random forest classifier for remote sensing classification,”
(d) person 1 with CACHE (e) person 1 with HM International Journal of Remote Sensing, vol. 26, no. 1, pp. 217–222,
2005.
Fig. 2: Examples of pre-processing [10] T. Maekawa, Y. Kinoshita, S. Shiota, and H. Kiya, “Privacy-preserving
svm processing by using random unitary transformation,” vol. 41, no. 28,
pp. 13–18, 2017.
[11] S. Kotsiantis, D. Kanellopoulos, and P. Pintelas, “Data preprocessing for
supervised leaning,” International Journal of Computer Science, vol. 1,
no. 2, pp. 111–117, 2006.
[12] I. H. Witten, E. Frank, M. A. Hall, and C. J. Pal, Data Mining: Practical
machine learning tools and techniques. Morgan Kaufmann, 2016.
[13] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep
network training by reducing internal covariate shift,” arXiv preprint
(a) person 1 (b) person 2 arXiv:1502.03167, 2015.
[14] Y.-T. Kim, “Contrast enhancement using brightness preserving bi-
histogram equalization,” IEEE transactions on Consumer Electronics,
vol. 43, no. 1, pp. 1–8, 1997.
[15] S.-D. Chen and A. R. Ramli, “Contrast enhancement using recursive
mean-separate histogram equalization for scalable brightness preserva-
tion,” IEEE Transactions on consumer Electronics, vol. 49, no. 4, pp.
1301–1309, 2003.
[16] M. D. Abràmoff, P. J. Magalhães, and S. J. Ram, “Image processing with
(c) person 3 (d) person 4 imagej,” Biophotonics international, vol. 11, no. 7, pp. 36–42, 2004.
[17] C. CHIENCHENG, K. Yuma, S. Sayaka, and K. Hitoshi, “An image
Fig. 3: Examples of Extended Yale Face Database B contrast enhancement scheme with noise aware shadow-up function,” in
Proc. IEEE International Conference on Consumer Electronics. IEEE,
2018, pp. 185–186.
[18] Y. Kinoshita, T. Yoshida, S. Shiota, and H. Kiya, “Pseudo multi-exposure
V. C ONCLUSION fusion using a single image,” in Asia-Pacific Signal and Information
Processing Association Annual Summit and Conference (APSIPA ASC),
This paper has proposed to use some image processing 2017. IEEE, 2017, pp. 263–269.
methods as a pre-processing method for machine learning al- [19] Y. Kinoshita, S. Shiota, and H. Kiya, “A pseudo multi-exposure fusion
gorithms. In the experiments, a number of image enhancement method using single image,” IEICE Trans. Fundamentals, vol. 101,
no. 11, 2018.
methods were applied to a face recognition algorithm with [20] S.-L. Lee and C.-C. Tseng, “Color image enhancement using histogram
SVM classifiers and random forest ones to demonstrate the equalization method without changing hue and saturation,” in Consumer
effectiveness of the proposed approach. For SVM classifiers, Electronics-Taiwan (ICCE-TW), 2017 IEEE International Conference
on, 2017, pp. 305–306.
it was better to apply both z-score normalization and contrast [21] Y.-S. Chiu, F.-C. Cheng, and S.-C. Huang, “Efficient contrast en-
enhancement as pre-processing. On the other hand, for random hancement using adaptive gamma correction and cumulative intensity
forest classifiers, AGCWD and CACHE worked well, but z- distribution,” in Systems, Man, and Cybernetics (SMC), 2011 IEEE
International Conference on, 2011, pp. 2946–2950.
score normalization did not improve the accuracy. [22] X. Wu, X. Liu, K. Hiramatsu, and K. Kashino, “Contrast-accumulated
Conventionally, z-score normalization is one of the most histogram equalization for image enhancement,” IEEE, pp. 3190–3194,
frequently used pre-processing for machine learning. However, 2017.
[23] A. N. Avanaki, “Exact global histogram specification optimized for
the usefulness depends on machine learning algorithms. Even structural similarity,” Optical review, vol. 16, no. 6, pp. 613–621, 2009.
in such a case, some image enhancement methods such as [24] F. Balado, “Optimum exact histogram specification,” IEEE International
AGCWD and CACHE can improve the accuracy. We plan Conference on Acoustics, Speech and Signal Processing (ICASSP), 2018.

Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on June 19,2025 at 10:22:09 UTC from IEEE Xplore. Restrictions apply.
275

You might also like