Journal of Robotics, Networking and Artificial Life, Vol. 5, No. 1 (June 2018) 75–78___________________________________________________________________________________________________________Unsupervised Image Classification Using Multi-Autoencoder and K-means++
Shingo Mabu

Graduate School of Sciences and Technology for Innovation, Yamaguchi University, Tokiwadai2-16-1
Ube, Yamaguchi 755-8611, Japan
Kyoichiro Kobayashi

Department of Information Science and Engineering, Faculty of Engineering, Yamaguchi University, Tokiwadai2-16-1
Ube, Yamaguchi 755-8611, Japan
Masanao Obayashi

Graduate School of Sciences and Technology for Innovation, Yamaguchi University, Tokiwadai2-16-1
Ube, Yamaguchi 755-8611, Japan
Takashi KuremotoGraduate School of Sciences and Technology for Innovation, Yamaguchi University, Tokiwadai2-16-1
Ube, Yamaguchi 755-8611, Japan
E-mail: mabu@yamaguchi-u.ac.jp, m.obayas@yamaguchi-u.ac.jp, wu@yamaguchi-u.ac.jp

Abstract
Supervised learning algorithms such as deep neural networks have been actively applied to various problems. However, inimage classification problem, for example, supervised learning needs a large number of data with correct labels. In fact, thecost of giving correct labels to the training data is large; therefore, this paper proposes an unsupervised image classification
system with Multi-Autoencoder and K-means++ and evaluates its performance using benchmark image datasets.
Keywords: neural network, deep autoencoder, K-means++, clustering

number of training data with correct labels are necessary
for the learning. Since it is a tough task to give correctlabels to many (hundreds ~thousands) images, this paper
proposes an unsupervised image classification(clustering) algorithm that does not use data with correctlabels to reduce the cost of preparing training data.
However, when we do not use correct labels, theclassifier cannot know the explicit information on theclasses. Therefore, sufficient information to distinguishthe differences between the images is necessary foraccurate classification. To obtain sufficient information,
we apply some image processing techniques to increase

1. Introduction
Recently, deep learning1 has been actively applied tovarious problems and shown distinguished performance.
Especially, in image classification problems, since deepneural networks can automatically extract featurescontained in each image2, it becomes easier to apply deepneural networks to image classification comparing to theconventional methods that extract features using
manually created feature extraction method.
However, classification systems using deep learning
are generally based on supervised learning. Thus, a large

Copyright © 2018, the Authors. Published by Atlantis Press.
This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/).
75

Journal of Robotics, Networking and Artificial Life, Vol. 5, No. 1 (June 2018) 75–78___________________________________________________________________________________________________________

the variation of the images. Then, the increased images
are inputted to Multi-autoencoder to extract feature
information. In summary, the proposed method has twofeatures; 1) increasing the variation of original images
using some image processing techniques, and 2)
extracting features using Multi-autoencoder that uses theoriginal and generated images. Autoencoder-based dataclustering has been already proposed3. However, the aimof the conventional method is to enhance Singleautoencoder, while the aim of the proposed method is toevaluate the effectiveness of Multi-autoencoder.
The rest of this paper is organized as follows. In
section 2, the proposed unsupervised image classification
algorithm is explained. In section 3, a benchmark image
dataset (caltech101) and experimental settings areexplained, then experimental results are shown. Section
4 is devoted to conclusions.

Start
Make variations of images
by image processing
Feature extraction by MultiAutoencoder
Image clustering by
K-means++
StopFig. 1. Flowchart of the proposed method

2. Unsupervised image classification algorithm
The flow of the proposed method is shown in Fig. 1. First,
some image processing techniques (gray-scaletransformation and edge detection by Sobel filter4) areapplied to the original images to generate variations.
Second, several independent autoencoders (Multiautoencoder) are prepared (the number of autoencoders
is three corresponding to the number of datasets, i.e., theoriginal dataset and two generated datasets). Then,
feature values are obtained by the Multi-autoencoder.
Finally, the image clustering is carried out by K-means++algorithm.

Fig. 2. Feature extraction using image processing and Multiautoencoder

2.1. Feature extraction using Image processingand Multi-autoencoder
The image dataset used in this paper is caltech1015 thatis a set of color natural images (32 32 pixel) such as
watch, motorbike, airplane, grand piano, etc. We apply
gray-scale transformation and Sobel filter independently
to the original dataset, and two new datasets aregenerated (Fig. 2). Then, the original and generated
images are encoded by Multi-autoencoder. Fig. 3 shows
9-layered autoencoder used for the feature extraction.
The original or generated images inputted to theautoencoder are encoded by second–fifth layers, decodedby sixth–ninth layers and finally reconstructed images
can be obtained. The autoencoder is trained so that themean squared error between the input and output values
is minimized. After finishing the training, the feature
values of the input image are obtained by the fourth layer.

Fig. 3. Structure of autoencoder

Here, let the original image data number be d, the feature
values of data d extracted by the autoencoder for the color, those for the gray-scale image be
image be, and those for the Sobel filter image be. Then, a feature vector combining,,,,,,or,isdefined bywhich is used in the next K-means++clustering6.

76

Journal of Robotics, Networking and Artificial Life, Vol. 5, No. 1 (June 2018) 75–78___________________________________________________________________________________________________________2.2. Clustering by K-means++
Table 1. Parameters of Multi-autoencoder

K-means7 is a clustering algorithm that makes groups(clusters) of data where each data belongs to one of thegroups whose centroid is the nearest. K-means++ is anextension of K-means that improves the initialization ofcluster centroids. The centroid initialization method of Kmeans++ is summarized as follows.
1. Randomly select one data d out of N data as a cluster
centroid. Here, let m be 1.
2. Repeat the following until m=K (K is the total
number of clusters).
i.
Calculatewhich is the Euclidian
distance between data
and the nearestcentroid.
ii.
Select one data
1,2, … ,withprobability ϕ
as a new centroid.
ϕiii.

←3072 or 4096, 2048, 1024,512, 256 or 171

Activation function
Pre-training epochFine-tuning epoch
Learning algorithm

Sigmoid
300
200
Adam

for the original images without feature extraction, 3)
clustering for the Histogram of oriented gradients (HOG)features8 of the original images. The parameters of Multiautoencoder are shown in Table 1. The number of layers
is nine, and the number of input nodes is determinedaccording to the sizes of input images. The size of theoriginal color images is 3072 ( 32 pixel 32 pixel
3 channels) and that of gray-scale images and Sobel
filter images is 4096 (64 pixel 64 pixel 1 channel).
Since gray-scale and Sobel filter images have onechannel, the size is enlarged to increase the number ofpixel information. The number of nodes in the 5th layer is
256 or 171 depending on the combination of,,. When two kinds offeature values are combined to make, 256 nodes
are used and obtainwith 512 ( 2 256) values.
When all the three kinds of feature values are combined,
171 nodes are used to obtainwith 513 ( 3 171)values. This is for making the dimensional size of feature
vectors be almost the same between the different settings.
Multi-autoencoder is learned by stochastic gradientdescent method with Adam (adaptive momentestimation)9 which is an online estimation method ofappropriate learning rate.
Table 2 shows the clustering performance of theproposed method and some conventional methods
averaged over 10 independent trials. The proposed∑1

By applying K-means++ to all the feature vectors
similar images are put into the same cluster.

# of nodes(1st layer–5th layer),

3. Experiment
The image data set is caltech101 which contains picturesof objects belonging to 101 classes. In this paper, imagesof 10 classes are selected and used for the experiment.
The 10 classes are airplanes, bonsai, faces_easy,
hawksbill, ketch, leopards, motorbikes, watch,
grand_piano, chandelier, and each class contains 90
images (totally 900 images). The clustering performanceof the proposed method is evaluated by F-measurecomparing to the conventional methods. The
conventional methods include 1) clustering for thefeatures extracted by single-autoencoder, 2) clustering
Table 2. Clustering performance
MethodImage set

Proposed methodwith Multi-autoencoder

Color+Sobel
Color+Gray
Gray+Sobel
Color+Gray+Sobel
Color
GraySobel
Color
HOG feature

Conventional methodwith Single-autoencoder
Conventional method
without autoencoder

77

Precision [%]Recall [%]F-measure [%]

73.6
66.6
69.6
68.2
69.4
62.9
68.5
60.8
69.8

69.1
62.4
67.7
65.4
64.9
61.8
65.6
57.6
62.771.3
64.4
68.6
66.7
67.1
62.6
67.0
59.1
66.0

Journal of Robotics, Networking and Artificial Life, Vol. 5, No. 1 (June 2018) 75–78___________________________________________________________________________________________________________Table 3. Results of t-test
Methods
Color+Sobel vs. Color
Color+Sobel vs. Sobel

p-value
1.23 107.62 10

Color+Sobel: Proposed method with color and Sobel filter images
Color: Conventional method (Single-autoencoder) with color images
Sobel: Conventional method (Single-autoencoder) with Sobel filter
imagesFig. 4. Example of the generated cluster

extract features by Multi-autoencoders. From theexperimental results, it was clarified that the proposed
method showed better clustering accuracy than theconventional methods with significant differences. In thefuture, we will make an application of the proposed
method, for example, medical image analysis where thenumber of data with correct labels is limited.

method with color and Sobel filter images shows the best
F-measure of 71.3%. The proposed method with gray andSobel filter images shows the second best F-measure of68.6%. From these results, we can see that the Sobel filter
images can give additional useful information for theclustering. The proposed method with all the three kindsof images does not show the best result because too much(redundant) information would even cause bad effect on
the learning efficiency. Among the three settings ofSingle-autoencoder, the method with color images shows
the best F-measure; thus, we can say that the color
original image contains the useful information comparing
to gray and Sobel filter images. However, the differenceof F-measure between color and Sobel filter is small; thus,
we can see the Sobel filter still contains usefulinformation. As for the method without autoencoder,
HOG feature shows better F-measure than the method
using raw color images.
Table 3 shows the results of t-test for F-measure
between the proposed method with color and Sobel filter
images and the conventional methods with color or Sobel
filter images. We selected the methods for the t-test thatshow better F-measure among all the settings of theproposed method or conventional methods. From Table
3, we can see that there are significant differences
between the proposed method and conventional methods.
Fig. 4 shows an example of the generated cluster.
This cluster mainly contains grand_piano images;
however, some other classes of images whose featuresare very similar are also contained. The squares in Fig. 4
show the images that are not grand_piano. The proposed
method is based completely on unsupervised learning,
thus it is difficult to realize perfect clustering due to thelack of class information. Nevertheless, the proposed
method can generally grasp the essential features forselecting similar images.

References
1. Y. LeCun, Y. Bengio and G. Hinton, Deep learning,Nature. 521 (2015) 436–444.
2. P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio and P. A.
Manzagol, Stacked Denoising Autoencoders: Learning
Useful Representations in a Deep Network with a Local
Denoising Criterion, Journal of Machine Learning
Research, 11 (2010) 3371–3408.
3. C. Song, F. Liu, Y. Huang, L. Wang and T. Tan, Autoencoder Based Data Clustering, CIARP2013, Part I, LNCS
8258 (2013) pp. 117–124.
4. N. Kanopoulos, N. Vasanthavada and R. L. Baker, Designof an image edge detection filter using the Sobel operator.
IEEE Journal of solid-state circuits, 23(2) (1988) 358-367.
5. L. Fei-Fei, R. Fergus and P. Perona, One-shot learning ofobject categories. IEEE transactions on pattern analysis
and machine intelligence, 28(4) (2006) 594–611.
6. D. Arthur and Dergei Vassilvitskii, k-means++: The
Advantages of Careful Seeding, Proc. of the 18th annual
ACM-SIAM symposium on Discrete algorithm (2007), pp.
1027–1035
7. J. MacQueen, Some methods for classification andanalysis of multivariate observations, Proc. of the Fifth
Berkeley Symposium on Mathematical Statistics andProbability, Volume 1: Statistics, (1967), pp. 281–297.
8. N. Dalal and B. Triggs, Histograms of oriented gradientsfor human detection, In IEEE Computer Society
Conference on Computer Vision and Pattern Recognition,2005, 1 (2005) pp. 886–893.
9. D. Kingma and J. Ba, Adam: A method for stochastic
optimization, arXiv preprint arXiv:1412.6980 (2014)

4. Conclusions
This paper proposed an unsupervised image
classification algorithm using Multi-autoencoder and Kmeans++, which can increase the useful information byapplying some image processing and automatically78