# Classification of Architectural Heritage Images Using Deep Learning Techniques
## 2 Materials and Methods
### Dataset Created for These Tests  
Many images to train neural networks discussed above are needed, although it is shown that, using fine-tuning, it is possible to use smaller datasets [38]. In any case, it is most appropriate to use datasets of images that are freely available in order to reproduce the experiments and validate the results obtained. Although there are many generic image banks, with many tagged images, it is not easy to find specific datasets of architectural heritage images ready to be used. We have created a set of more than 10,000 images classified in 10 types of architectural elements of heritage buildings, mostly churches and religious temples. All images used are licensed Creative Commons, and have been obtained mainly from Flickr and Wikimedia Commons [39].  
The generated dataset has been published in two versions: one contains images of different sizes and the other contains images rescaled to 128 \(\times\) 128 pixels. For the rescaling of images, each image was adjusted so that the smaller of its dimensions was 128 pixels and the central region was trimmed to 128 \(\times\) 128 pixels (also datasets of smaller sizes have been generated: 32 \(\times\) 32 and 64 \(\times\) 64 pixels to evaluate the accuracy achieved in these cases and study variations in required training times). In total, we have compiled more than 10,000 images (specifically 10,235), 80% of the total (8188) were used for the training phase and the remaining 20% (2047) for the validation phase. The validation set has been created by randomly selecting 20% of the images from each class.  
In addition, 1404 images have been compiled which form an independent set of tests. In this way, a final test of the model under consideration can be performed.  
Table 1 shows some example images of each of the ten categories considered (in brackets the number of images used in the training and validation of each category).  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Category** & **Examples** \\ \hline Altar (829 images) & \\ \hline Apse (514 images) & \\ \hline Bell tower (1059 images) & \\ \hline Column (1919 images) & \\ \hline Dome (inner) (616 images) & \\ \hline Dome (outer) (1177 images) & \\ \hline Flying buttress (407 images) & \\ \hline Gargoyle (and Chimera) (1571 images) & \\ \hline Stained glass (1033 images) & \\ \hline Vault (1110 images) & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Dataset samples of Cultural Heritage images used.  
The dataset created has been called _Architectural Heritage Elements Dataset_ (AHE_Dataset), and has been made publicly available in DataHub [36] (Data management platform from Open Knowledge International, based on the CKAN data management system): [[https://datahub.io/dataset/architectural-heritage-elements-image-dataset](https://datahub.io/dataset/architectural-heritage-elements-image-dataset)]([https://datahub.io/dataset/architectural-heritage-elements-image-dataset](https://datahub.io/dataset/architectural-heritage-elements-image-dataset)).  
For the selection of the dataset categories, we have consulted the cataloguing of the Getty Art & Architecture Thesaurus (AAT) [40]. The use of this well-known and controlled vocabulary allows consistency in the classification of current and future elements, as well as a more efficient retrieval of information in a standardized way.  
As a supplementary reference, in the results section, we have included some comparative tests with other methods using an existing dataset of almost 5000 images classified into 25 architectural styles (obtained from Wikimedia Commons) [32].