Automation in Construction 69 (2016) 1–10
Contents lists available at ScienceDirect
Automation in Construction journal homepage: www.elsevier.com/locate/autcon
Automatic architectural style detection using one-class support vector machines and graph kernels Tiemen Strobbe a, * , Francis wyffels b , Ruben Verstraeten a , Ronald De Meyer a , Jan Van Campenhout b a b
Department of Architecture and Urban Planning, Ghent University, J. Plateaustraat 22, B-9000 Ghent, Belgium Department of Electronics and Information Systems, Ghent University, Sint-Pietersnieuwstraat 41, B-9000 Ghent, Belgium
A R T I C L E
I N F O
Article history: Received 28 July 2015 Received in revised form 4 May 2016 Accepted 22 May 2016 Available online xxxx Keywords: Architectural design Machine learning Support vector machines
A B S T R A C T In this paper, we address the problem of automatic detection of architectural designs belonging to a particular architectural style or corpus. A solution to this problem could be useful in a number of situations: the systematic and automatic (historical) analysis of large design corpora, to leverage computer-aided design tools that assist designers in predicting performance measures that are difficult or time-consuming to calculate, or as a complementary method to generative design models, both in the formulation and evaluation of these models. In particular, we propose the use of one-class support vector machines (SVMs) with graph kernels to learn architectural style from a single dataset of designs that belong to this particular style. As a result, the trained classifier can successfully detect new unobserved designs as similar or different from the learned style. Also, two experiments demonstrate the ability to learn an architectural style that can be sufficiently generalized to new designs. © 2016 Elsevier B.V. All rights reserved.
1. Introduction This paper addresses the problem of automatic detection of architectural designs belonging to a particular architectural style or corpus. Given a particular architectural style and a new design, does this design belong to the style, does it exhibit only some patterns or influences of the style, or should it be considered as completely different? An answer to this question could prove useful in a number of situations. First, it could be used for systematic and automatic analysis of a large corpus of designs, for example for historical research purposes. With a method for automatic detection available, it could be possible to detect morphological influences in the built corpus of multiple architectural designers — a task that is typically performed in a manual and subjective manner, to date. On the other hand, a method for automatic detection could also leverage computeraided design tools that assist designers in predicting performance measures that are difficult or time-consuming to calculate (such as computational fluid dynamics calculations). In particular, such methods could then be used to predict performance measures based on similar precedents that share the same patterns or underlying design principles. Finally, a method for automatic detection could
* Corresponding author. Tel.: +32 9 264 38801. E-mail address:
[email protected] (T. Strobbe).
http://dx.doi.org/10.1016/j.autcon.2016.05.024 0926-5805/© 2016 Elsevier B.V. All rights reserved.
be used as complementary to generative parametric and grammarbased methods [1] — to select a consistent corpus from which it easier to extract rules (grammar formulation), and to assess the output of a generative design process and determine, in a quantitative way, whether the generative rules extracted are working (grammar evaluation). In order to investigate this research question, we apply a technique from Machine Learning, which is a scientific domain that deals with algorithms that can learn from data. In the field of architectural design and engineering, techniques from Machine Learning have been applied in previous research efforts to classify or predict data that is difficult or too time-consuming to calculate, for example predicting the impact of daylight on energy consumption [2] or the impact of wind pressure on tall buildings [3]. In this paper, we apply one-class support vector machines (SVMs) [4,5] for automatically detecting architectural style and classifying new designs either as similar of different to this style. One-class SVMs are learning models with associated algorithms that recognize patterns from a set of coherent training examples. They are commonly used for similarity detection, which involves deciding whether a new example is similar to the training examples (it is an ‘inlier’ or in the same architectural style), or should be considered as different (it is an ‘outlier’ or outside a particular style). In contrast to conventional classification algorithms, one-class SVMs do not need training examples of all classes. This is a suitable solution for our problem since we are only interested in one style and thus, we do not want to collect a general set of
2
T. Strobbe, et al. / Automation in Construction 69 (2016) 1–10
other styles which would be too time consuming or even impossible due to the variety of other architectural styles. One of the main challenges of the proposed method of using one-class SVMs for automatic style detection and design classification is to find an appropriate feature representation of designs. In general, little research has been carried out in the field of architectural style identification and detection, with some exceptions available [6]. For example, the approach of Romer and Plumer [7] involves the use of SVMs to detect architectural style based on a few coarse design features (building footprint and height), and the approach of Mathias et al. [6] proposes a method for architectural style identification based on single street-side images. In the context of automatic style detection, another example is the work of Hanna [8] on automated representation of style by feature space archetypes. In this paper, designs are represented using a representation method commonly used by architectural designers — the two-dimensional floor plan. In this regard, the method proposed in this paper is more useful, because floor plans describe a richer number of design features compared to previous approaches found in the literature. In particular, we investigate a graphical representation of floor plans that describes both morphological (geometrical), topological, and functional features of designs. With the training examples represented as floor plan graphs, the one-class SVM can be combined with graph kernels [9] to efficiently detect an architectural style from these training examples, after which new designs can be classified as being part of this style or not. The use of SVMs combined with graph kernels is popular in a wide variety of biological and other applications [10] but, to the extent of our knowledge, has not been applied in the field of architectural design before. The methodology presented in this paper involves the following steps — (1) converting architectural designs to a graphical feature representation, (2) training and optimizing a one-class SVM, and (3) using the trained SVM on unseen designs to classify them in a specific architectural style. The contribution of this paper is twofold — it proposes and evaluates a graphical feature representation of designs that can describe morphological, topological, and functional features, and it applies a particular Machine Learning technique, called oneclass SVM, for the automatic detection of architectural designs. The remainder of this paper is structured as follows. First, we discuss the graphical feature representation of designs and two-dimensional floor plans, in particular. A method to represent floor plans as labeled graphs is proposed and applied to a specific dataset — the corpus of Malagueira houses designed by the architect Álvaro Siza Viera. The second section describes some of the concepts of one-class SVMs and graph kernels. Third, we optimize the one-class SVM for the given dataset, using four-fold cross-validation, while holding out part of the available data as a test set to avoid overfitting. In the fourth section, we evaluate the performance of the trained model on the test set, and discuss several experiments. Finally, conclusions and future work are given. 2. Topological and functional design features of two-dimensional floor plans In this paper, we address the problem of design style detection to a specific representation of designs — two-dimensional floor plans. First, we explain how graphs offer a suitable framework to represent floor plans, because they reflect morphological, topological and functional features of designs. Second, we give more details on the specific dataset that is used in this research, which is the corpus of Malagueira houses designed by the architect Álvaro Siza Viera. 2.1. Representing architectural floor plans as graphs The design of architectural floor plans involves different kinds of data, including the generation of sketches, CAD drawings,
three-dimensional models and written reports. These documents are all generated using different media and conventions, and as a result, they rely on different information representations. In order to apply Machine Learning techniques, such as one-class SVMs, the set of examples must be described using a unique representation that reflects the design features that we attempt to learn. In the case of architectural floor plans, the function of individual spaces and topological relationships between these spaces are two important design features. The representation of geometric design features (such as size and proportion) is typically secondary to functional and topological design features. Especially in early design phases, designers tend to develop several spatial configurations without having specific geometric realizations in mind. One possible representation that reflects geometrical, topological and functional features of designs are graphs. Graphs offer a natural framework to model objects and relationships between these objects. The use of graphs to represent spatial floor plans is not uncommon in the architectural design domain: Steadman [11] already described a graph-theoretic representation of architectural arrangements. Axial graphs, as defined in space syntax theory [12], represent functional spaces by graph nodes, and the relationships between them by edges. Each graph node is associated with a specific label that represents the function of this graph node or space. Geometrical features can also be added as attributes of the nodes or edges, including coordinate geometry, angular constraints, etc. By using graphs to represent architectural floor plans, the task of classifying designs of floor plans can now be considered as classifying a set of labeled graphs. This can be done using one-class SVMs combined with graph kernels, which are discussed further in this paper.
2.2. Constructing the dataset of Malagueira houses In this paper, we demonstrate the feasibility of the proposed detection method on a specific case study — the Malagueira houses designed by the architect Álvaro Siza Viera. The work of Duarte [13] describes the corpus of houses that were developed in the Malagueira plan. The corpus consists of several houses, each of which is adapted to a given site and user constraints. However, the corpus also clearly shows some stylistic coherence, in which we can easily detect patterns or rules that were used by the architect Siza. For example, in an earlier research effort, Duarte [14] has attempted to manually capture or encode this style in the form of a shape grammar that contains an elaborated set of 162 rules. Using such a grammar, it is possible to classify a new design in the same Malagueira style, by determining whether or not this new design is in the ‘language’ of the shape grammar. The construction of such a shape grammar enables one to describe a particular style, and even generate new designs in the same style, but this construction of the grammar happens in an entirely manual manner. The method proposed in this paper is an automatic method for style detection, and can be used to describe a particular style only. Because the collected floor plans from the Malagueira plan are simple two-dimensional images, several modifications are needed to obtain a representation that is suitable for the SVM learning process. First, the drawings are translated to labeled graphs by representing the functional spaces in the floor plans as nodes and connecting the appropriate nodes with edges. The conversion from images to graphs is done in an automatic manner using the method proposed in the work of Heras et al. [15]. This method for automatically recognizing floor plans and converting them into graphs uses a pattern recognition method that is inspired by the way designers draw and interpret floor plans. A review of other methods for deriving building models from (scanned) floor plan images is given in the work of Gimenez et al. [16]. After this automatic conversion has been completed, several smaller rooms are merged into larger functional
T. Strobbe, et al. / Automation in Construction 69 (2016) 1–10
spaces, including living space, sleeping space, dining space, transition or laundry space and yard. The grouping of rooms in functional zones is also proposed in the work of Duarte [14]. Second, geometrical information is omitted in the graph representation, because the focus in this paper is on detecting similar spatial compositions, rather than detecting similar geometrical shapes. Nevertheless, using specialized kernels that take into account geometrical attributes of the labeled graphs, geometrical information could also be included in the training process. Third, additional entrance nodes ‘en’ and adjacent building nodes ‘ab’ are added to the graph representation to include information about the location of the entrance and the adjacency of other neighboring buildings or houses, respectively. As a result, the context of the house is also taken into account during the training process. Fig. 1 shows the visual representation (left) and the corresponding graph representation (right) of one of the floor plans in the corpus. The resulting dataset has been generated using the automatic method outlined in this section. In total, the Malagueira dataset contains 128 labeled graphs with an average of 7 nodes and 1.56 edges per node. Additionally, an equally large ‘outlier’ dataset of 128 random floor plans has been generated. This dataset of floor plans has been generated in a procedural way by randomly creating functional zones and adding topological relations between them, in such a way that the number of nodes and edges per node are similar to those of the Malagueira dataset. Afterwards, this outlier dataset, containing 128 randomly generated floor plans, has been validated to ensure that no randomly generated floor plan is part of the Malagueira corpus. This random dataset serves only to evaluate the accuracy of the trained SVM in correctly classifying outliers. 3. One-class SVM with graph kernels In this section, we first explain why we have chosen one-class SVMs for the given problem and explain some of the principles behind this approach. Second, we describe the concept of graph kernels and propose a specific random walk graph kernel to detect similarities between floor plans. 3.1. One-class support vector machines A one-class SVM [4,5] is a detection technique that was introduced for problems that involve the estimation of a function which is positive on a specific subset of a dataset (the inliers) and negative on the complement (the outliers). According to Hayton et al. [17] it is inspired by the philosophy of Vapnik [18] that one should address a learning problem directly, rather than solving a more general problem along the way. In contrast to standard classification techniques, a one-class SVM is trained with examples of the target class. This makes one-class SVMs particularly useful when examples of the other classes are hard or even impossible to obtain. More specifically, one-class SVMs construct a frontier that separates the inliers from the outliers in a certain given feature space, and that delimits a subarea of this feature space. If new examples lie within this frontier, they are considered to be similar to the training examples. Otherwise, these examples are classified as outliers. This is visually demonstrated in Fig. 2, in which the frontier is shown as an ellipse that geometrically separates the inliers from the outliers in a twodimensional feature space. Additionally, since the training set can be relatively small (e.g., it contains only positive examples), the computational cost can be reduced. A typical application of one-class SVMs is anomaly detection, for example to detect atypical genes [19] or network intrusion detection [20]. In our case we attempt to learn an architectural style from a single set of coherent designs. Since it is too time consuming and even impossible to collect a sufficiently rich design set of all other (complementary) styles, we prefer to use one-class SVMs over more common multi-class SVMs.
3
In many cases, the examples to discriminate cannot be linearly separated in the given feature space. In the example given in Fig. 2, the inliers cannot be separated from the outliers using a linear hyperplane in the given feature space. Therefore, the initial finite-dimensional feature space Rp is mapped into a (much) higher-dimensional feature Rn (where n > p) using a function V. This makes the separation presumably easier in that space. Fig. 3 shows the mapping of the previous two-dimensional feature space to a three-dimensional space, in which the examples become linearly separable with a hyperplane. This hyperplane corresponds to the non-linear hypersurface in the initial lower-dimensional feature space, for example an ellipse in Fig. 2. As a result, one-class SVMs can also perform classification on examples that are non-linearly separable. For many classification problems, it is not possible to fully separate the inliers from the outliers by a hard boundary. Therefore, a ‘soft margin’ is defined in order to allow some classification errors without affecting the final results. In the case of one-class SVMs, Schölkopf et al. [4,5] introduced a user-specified parameter m (0 ≤ m ≤ 1) which is the lower and upper bound on the number of examples that are support vectors, i.e. input vectors that just touch the boundary of the margin, and that lie on the wrong side of the hyperplane, respectively [21]. In layman terms, a number of classification errors of the training examples can be deliberately allowed during the training process in order to reduce the amount of outliers that are falsely classified as inliers (false positives). Consequently, the amount of false negatives (i.e. inliers that are classified as outliers) will increase. Hence, the value of the m parameter must be chosen carefully in order to find a good trade-off between the amount of false positives and false negatives. In other words, the m regularization parameter is used to avoid ‘overfitting’ of the model, which means that the trained model would perform very well on classifying the training examples, but fails to correctly classify unseen data. An overfitted model would specialize on particular training examples, but would be less able to generalize to unseen examples. 3.2. Graph kernels The explicit mapping of finite-dimensional feature spaces into high-dimensional feature spaces is computationally expensive. In order to overcome this, kernel functions are used that implicitly map the original feature space to a higher-dimensional feature space. By doing so, it is possible to separate the inliers from outliers based on some measure of similarity that is introduced by the kernel function. In other words, a kernel function k(x, x ) can be considered as a similarity measure between x and x . The benefit of using kernel functions is that an explicit mapping V of the initial feature space to a higher-dimensional feature can be omitted, because the similarity measure may be computed easily in terms of the initial feature space. This is known as the kernel trick which is a powerful feature of SVMs in classifying non-linearly separable data. In the context of this paper, the available dataset is represented as a collection of labeled graphs, which can in turn be represented as adjacency matrices (as shown further). These adjacency matrices are the input features of the one-class SVM. The challenge is to find a computationally efficient kernel function that captures both the topological and functional information implicitly present in the graphs. Graph kernels, as initiated by Kondor and Lafferty [22], are able to do this. A recent overview of graph kernels is given in the work of Vishwanathan et al. [9]. The use of graph kernels to study relationships between graphs has already been applied in several domains, including shape classification [23], bio-informatics [24,25], and social networks [26]. A common approach is the use of random walk graph kernels [27]. In order to calculate the similarity between two graphs, a random walk graph kernel performs random walks of different length on
4
T. Strobbe, et al. / Automation in Construction 69 (2016) 1–10
Fig. 1. A visual representation (left) and graph representation (right) of one floor plan design in the Malagueira corpus. Some details of the original floor plan are removed.
both graphs, and counts the number of matching walks. The number of matching walks gives an indication of the similarity between the two given graphs. Random walks of different length are performed in order to take into account both local similarities (short random walks) and more complex similarities (long random walks). In order to calculate the random walk graph kernel, the following steps are needed; First, the graphs are represented using an adjacency matrix. Given two undirected graphs G and G of respectively m and n nodes, the adjacency matrices A ∈ Nm×m and A ∈ Nn×n are symmetric matrices in which the diagonal entries are zero and the non-diagonal entries Aij are the number of edges from node i to node j. For example, the adjacency matrix A of the following undirected graph is
and only if an edge exist in the direct product graph, and the corresponding nodes in G and G have the same label. In this case, we use the filtered adjacency matrix of the graphs l A to calculate A × :
A× =
d
l
A ⊗ l A .
l=1
The third step consists of calculating the random walk graph kernel k × (G, G ) directly from the direct product graph, according to the following equation (for the complete derivation, we refer to [9]): k× (G, G ) =
i,j
(I − kA× )−1 ,
in which, I ∈ Nmn×mn is an identity matrix, and k is a decay parameter that ensures the convergence of the equation. The value of the decay
The second step consists of calculating the direct product graph of the two given graphs. The adjacency matrix A × ∈ Nmn×mn of the direct product graph G × is calculated as the Kronecker product of A and A : ⎡
A11 A A12 A · · · A1m A
⎢ . .. .. . . ⎢ . . . . . A× = A ⊗ A = ⎢ ⎢ ⎣ Am1 A A12 A · · · Amm A
⎤ ⎥ ⎥ ⎥. ⎥ ⎦
The corresponding graph G × is a graph over pairs of nodes from graphs G and G , in which two nodes in G × are neighbors if and only if the corresponding nodes in G and G are both neighbors. As a result, performing a random walk on the direct product graph G × is equivalent to performing a simultaneous random walk on both graphs G and G [9]. In our case, the graph nodes in G and G are associated with labels from a finite set {1, 2, . . . , d}, which is constructed beforehand. These labels correspond to all the possible functional spaces of the architectural designs that can be assigned to the graph nodes. Therefore, the adjacency matrix A × should have a non-zero entry if
Fig. 2. Example sketch demonstrating how a frontier separates the inliers from the outliers in a two-dimensional feature space, and delimits a subarea of this feature space. The learned frontier does not necessarily classify all training examples correctly, because of the regularization parameter m.
T. Strobbe, et al. / Automation in Construction 69 (2016) 1–10
5
Fig. 3. Example sketch demonstrating how the previous two-dimensional feature space is mapped to a three-dimensional feature space, in which the examples become linearly separable with a hyperplane.
parameter k has to be chosen carefully in order to obtain a good performance of the graph kernel. In practice, a very low value for k is often chosen, but this makes the contribution of long random walks negligible. As a result, the impact of local similarities between graphs (or short random walks) would be larger than the impact of complex similarities between graphs (or long random walks). The kernel k × (G, G ) can be calculated efficiently in O(n3 ) time using several optimizations discussed in the paper of Vishwanathan et al. [9]. 4. Hyperparameter optimization In the section above, we indicated the importance of the parameter m and the decay parameter k in obtaining a good performance of the trained one-class SVM. In this section, we optimize the values of these hyperparameters, and evaluate the performance results of one-class SVMs for the given dataset. In order to optimize the values of these hyperparameters, we hold out a subset of the training examples as the test set, and apply four-fold cross-validation to avoid the need of an additional validation set. 4.1. The test and validation set Training one-class SVMs on a set of examples and testing the performance on the same set of examples can lead to false conclusions. For specific hyper-parameter values, the trained model would be able to perfectly classify the training examples, but would fail to classify yet-unseen data. It is important that our classifier should be able to classify unseen designs correctly. In order to optimize the hyper-parameters correctly, a subset of the available examples is withdrawn from the training procedure and used as a test set to evaluate the performance of the trained model. In this experiment, we randomly hold out 28 of 128 valid examples for future performance evaluation. Also, an additional 28 outliers are withheld from the outlier dataset (described in Section 2.2) to evaluate outlier accuracy. As a result, the test set contains 56 examples, half of which are Malagueira houses and the other half are outliers.
Moreover, overfitting can occur during the optimization of the regularization parameter m and the decay parameter k (see below). If examples from the test set are used to evaluate the performance of the parameters, the trained model would be optimized to classify the test examples instead of new unobserved examples. In order to overcome this problem, another part of the remaining dataset should be held out as a so-called validation set. In this case, training is performed on the training set, after which evaluation is done on the validation set, and final evaluation can be done on the test set. However, partitioning the dataset of 128 valid examples into three sets would seriously reduce the size of the training set. For this reason, we apply a well-known technique called ‘k-fold cross-validation’, by which a validation set is no longer needed [28]. In general, this technique involves splitting the training examples into k smaller sets. For each of the folds, the model is trained using (k − 1) of the smaller sets, and validated on the remaining part of the examples. In this experiment, four-fold cross-validation is used (Fig. 4) — the model is consequently trained and validated four times on 75 and 25 examples of the training set, respectively. Also, the model is validated on a set of 25 outlier examples to prevent the model in classifying all examples as being inliers. Also, an additional set of 25 randomly generated outliers is added to validate the outlier detection performance. Adding randomly generated outliers prevents the trained model to classify all examples as being inliers. In order to evaluate the performance of the trained model, the average accuracy of the four folds is calculated. Accuracy is a wellknown performance measure in Machine Learning that indicates the rate of correctly classified examples. For one-class SVMs, we distinguish between validation accuracy, outlier accuracy and total accuracy. The validation accuracy indicates the rate of validation examples that are correctly classified as similar to the training examples (true-positive). The outlier accuracy indicates the rate of outlier examples that are correctly classified as different from the training examples (true-negative). The total accuracy is defined as the average of the validation and outlier accuracy, and gives a good indication of the performance of the trained model. In the following
6
T. Strobbe, et al. / Automation in Construction 69 (2016) 1–10
Fig. 4. Four-fold cross-validation: the model is consequently trained and validated four times. The examples from the test set are not used during the optimization process. An additional outlier dataset is used, not for training, but to validate outlier detection performance.
section, we optimize the values of the hyperparameters m and k using a method called grid-search to obtain the best total accuracy. 4.2. Optimizing the hyperparameter values through grid-search As mentioned above, appropriately choosing the values for the regularization parameter m and the decay parameter k is essential to obtain a good performance of the trained model. These parameters are often referred to as hyperparameters, because they are not optimized during the learning procedure of one-class SVMs, but have to be optimized beforehand. In order to do this, a two-dimensional parameter space is defined that consists of the two hyperparameters m and k. For each value in this parameter space, a one-class SVM is trained using the specified hyperparameters — which is an optimization technique known as grid-search. The validation accuracy
is measured on the validation set (using four-fold cross-validation) and the outlier accuracy is measured on the set of random outliers. In particular, we define a logarithmic x-scale, ranging from 10 −5 to 1, that specifies several values for m. Also, a logarithmic y-scale specifies several values for k, ranging from 10 −5 to 1. Fig. 5 shows the validation (left) and outlier (right) accuracy for all the values in the given two-dimensional parameter space. Depending on the given problem situation, an appropriate value for m and k can be chosen from this parameter space. In some cases, it is desirable to choose hyperparameter values that result in a higher validation accuracy at the expense of a lower outlier accuracy, or vice versa. It is thus possible to define how strict the model will classify examples as inliers. However, in most cases, an optimal trade-off between validation and outlier accuracy needs to be achieved. The total accuracy shown in Fig. 6 is the average of the validation and
Fig. 5. Validation accuracy (left) and outlier accuracy (right) for all the values in the parameter space. A very high validation accuracy results in a lower outlier accuracy, and vice versa.
T. Strobbe, et al. / Automation in Construction 69 (2016) 1–10
7
results of our proposed approach, we present several experiments in this section. 5.1. Malagueira test set
Fig. 6. Two-dimensional parameter space that indicates the total accuracy for all the hyperparameter values. The best total accuracy (0.845) is achieved for the combination of m and k indicated with ‘× .
outlier accuracy. Resulting from this grid-search, an optimal accuracy of 84.5% is found for the hyperparameter values indicated with the black ‘× in Fig. 6.
5. Experiments and discussion Using the trained model described above, it is possible to classify new floor plans either as similar or different from the training examples. In our case, the training examples are taken from the corpus of houses developed in the Malagueira plan. As a result, the trained model should be able to detect some underlying architectural style or patterns in these examples and determine whether or not a new floor plan is consistent with these patterns or style. In order to validate the
In order to evaluate the generalization performance of the trained SVM model, it is applied to the test set that was withdrawn from the training procedure. As a result, 49 out of 56 houses are correctly recognized either as Malagueira designs or outliers, corresponding to a total accuracy of 87.5%. These findings are in the same line of the total accuracy found on the validation sets during the optimization (84.5%) — thereby demonstrating that the trained model is able to generalize well to new unobserved examples. Fig. 7 shows two examples from the Malagueira test set. While a visual representation is shown here, the given examples are classified based on topological and functional similarity, and not on geometrical similarity. The left floor plan is not recognized as an inlier, while the floor plan on the right is correctly classified as such. One of the reasons that the left floor plan is not recognized as a Malagueira design may be that this specific spatial composition is less frequent in the training examples. Indeed, houses in the Malagueira corpus typically have a sleeping space on the ground level, which is not the case in this example. Choosing a slightly lower value for the regularization parameter m will result in a higher accuracy for the test set, at the expense of a lower accuracy for outliers. Similarly, Fig. 8 shows two randomly generated floor plans from the outlier test set, so they are not part of the existing Malagueira corpus. Again, a visual representation is shown here, but several other geometrical realizations can be given for the same graph. First, the left floor plan is classified as an inlier, while it is not in the Malagueira corpus. On the one hand, the left floor plan shows several patterns that are atypical for Malagueira houses, such as the relationship between the sleeping zone and the service zone. On the other hand, it also shows several similar patterns, such as the relationship between the kitchen and transition space. Moreover, following the analysis of Duarte [13], the left floor plan could be considered within a broad interpretation of the Malagueira corpus. Second, the floor
Fig. 7. Two floor plans from the test set that is withdrawn from the training procedure. The left one is not recognized as an inlier, while the right one is correctly classified as an inlier.
8
T. Strobbe, et al. / Automation in Construction 69 (2016) 1–10
Fig. 8. Two randomly generated floor plans. While the left floor plan is not in the Malagueira corpus, it can be considered within a broad interpretation of it. The right floor plan is correctly classified as an outlier.
plan on the right is correctly classified as different from the houses in the Malagueira corpus. Indeed, this floor plan shows a linear spatial composition that is both infeasible and atypical for the corpus. The examples given in Fig. 7 and Fig. 8 indicate that trained oneclass SVM is able to generalize well to new unobserved floor plans, and is able to distinguish between floor plans that are either very similar or different from the training examples. However, some floor plans are more difficult to classify, because they have some patterns in common, while other patterns are different. A possible solution to overcome this limitation is the use of a scoring parameter, in this case the distance of the examples from the separating frontier. In the case of SVMs, Platt scaling [29] is often used to transform the outputs of
the SVM into a probability distribution. Unlike other kinds of supervised models, SVMs do not directly provide such probabilities, but they are calculated using cross-validation. This probability indicates a certain confidence level that a given floor plan is either an inlier or an outlier. The higher or lower this scoring parameter, the more likely a given floor plan is an inlier or an outlier, respectively. Fig. 9 shows the range and distribution of the scoring parameter (the distance to the separating frontier) for three subsets. The first subset consists of 25 floor plans taken from the test set (inliers), the second subset consists of 25 floor plans that can be considered in the broad interpretation of the corpus, and the third subset consists of 25 randomly generated floor plans that are completely
Fig. 9. Range and distribution of the scoring parameter using Platt scaling for three different subsets: (1) inliers, (2) broad interpretation, and (3) outliers. The chosen scoring parameter gives a good indication of how similar new examples are to the training examples.
T. Strobbe, et al. / Automation in Construction 69 (2016) 1–10
different (outliers). The average scoring parameter of the first subset is positive, indicating that the examples are most likely inliers. On the contrary, the average scoring parameter of the third subset is negative, which means that the examples in this subset are most likely outliers. When the scoring parameter is close to zero, which is the case for the second subset, the examples are close to the separating frontier, and are more difficult to classify. As a result, the scoring parameter using Platt scaling gives a good indication of how similar new examples are to the training examples. 5.2. Automatic style analysis of designs In the introduction of this paper, we indicated how the proposed method for automatic detection of architectural designs belonging to a particular architectural style or corpus could be useful for different purposes. One of the possible purposes of the proposed method, discussed in this section, is to systematically and automatically analyze a large corpus of new designs (for example, in the context of historical research). In particular, the SVM model that was trained on the Malagueira corpus is used to detect stylistic influences in a new dataset of architectural floor plans. By doing so, it is possible to investigate how much influences of the learned architectural style can be found in the new designs. In particular, the CVC database [15] is used, which contains a collection of 122 scanned floor plan documents. The floor plans are (automatically) converted to a graphical feature representation, after which they are classified using the trained Malagueira SVM model. The method for converting (scanned) floor plan documents to graphs is described in the work of Heras et al. [15]. None of these floor plans is classified as a Malagueira inlier, but the scoring parameter (Platt scaling) indicates how some floor plans more closely resemble the learned Malagueira style — thus sharing similar design patterns with the Malagueira corpus — than others. The average scoring parameter of this dataset is −0.0685, the minimum scoring parameter is −0.1055, and the maximum scoring parameter is −0.0267. In this way, it is possible to analyze stylistic influences in designs in a quantitative way — a task that is typically performed in a manual and subjective manner, to date. In a similar way, the proposed method could be used for systematic and automatic analysis of other design corpora, and to trace stylistic influences throughout different architectural designs.
6. Conclusion In this paper, we investigated whether or not it is possible to learn an architectural style from a set of examples, and classify new designs as similar or different from these examples. We proposed the use of one-class support vector machines with graph kernels, and demonstrated the feasibility on the case study of Malagueira houses. After the optimization of the hyperparameters, a best total accuracy of 84.5% was achieved. With an accuracy of 87.5% on a test set, we illustrated that our model is able to generalize to designs that have not yet been observed during training. Finally, we used a scoring parameter to calculate the confidence level that a given floor plan is either an inlier or an outlier. The viability of the proposed method was demonstrated for a test set of Malagueira housing designs, but also an additional dataset of 122 scanned floor plans was used to demonstrate how the proposed method could be used for systematic and automatic analysis of architectural designs and style — a task that is typically performed in a manual and subjective manner, to date. As indicated in the introduction of this article, the proposed method can also be used to leverage computer-aided design tools that assist designers in predicting performance measures, or as a complementary method to generative parametric and grammar-based methods. These applications of the
9
main method, as set out in the current paper, are part of our ongoing research efforts. The approach we propose in this paper is a first step toward learning architectural style from spatial designs in an automatic and quantifiable manner. Several research questions need further investigation to extend the proposed approach. How can other typical design representations (3D-models, sketches, etc.) be converted to graph representations for our algorithm? How can other design features (such as morphological or geometric aspects) be taken into account in the training procedure? These research questions are part of our ongoing research.
Acknowledgments Theresearchis funded by the Agency for Innovation by Science and Technology, Flanders (IWT).
References [1] G. Stiny, J. Gips, Shape grammars and the generative specification of painting and sculpture., IFIP Congress (2), 2, 1971, pp. 1460–1465. [2] R.W. da Fonseca, E. Leite Didone, F.O. Ruttkay Pereira, Using artificial neural networks to predict the impact of daylighting on building final electric energy requirements, Energy Build. 61 (2013) 31–38. [3] S. Wilkinson, S. Hanna, Approximating computational fluid dynamics for generative tall building design, Int. J. Archit. Comput. 12 (2) (2014) 155–178. [4] B. Schölkopf, R.C. Williamson, A.J. Smola, J. Shawe-Taylor, J.C. Platt, Support vector method for novelty detection, NIPS, 12, Citeseer. 1999, pp. 582–588. [5] B. Schölkopf, J.C. Platt, J. Shawe-Taylor, A.J. Smola, R.C. Williamson, Estimating the support of a high-dimensional distribution, Neural Comput. 13 (7) (2001) 1443–1471. [6] M. Mathias, A. Martinovic, J. Weissenberg, S. Haegler, L. Van Gool, Automatic architectural style recognition, ISPRS — International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, 3816, 2012, pp. 171–176. [7] C. Romer, L. Plumer, Identifying architectural style in 3D city models with support vector machines., Photogrammetrie - Fernerkundung - Geoinformation 14 (2010) 371–384. [8] S. Hanna, Automated representation of style by feature space archetypes: distinguishing spatial styles from generative rules., Int. J. Archit. Comput. 5 (2007) 2–23. [9] S.V.N. Vishwanathan, N.N. Schraudolph, R. Kondor, K.M. Borgwardt, Graph kernels, J. Mach. Learn. Res. 11 (2010) 1201–1242. [10] W.S. Noble, What is a support vector machine? Nat. Biotechnol. 24 (12) (2006) 1565–1567. [11] P. Steadman, Graph-theoretic representation of architectural arrangement, The Architecture of Form Cambridge University Press. 1976, pp. 94–115. [12] B. Hillier, J. Hanson, The Social Logic of Space, Cambridge University Press. 1984. [13] J.P. Duarte, Customizing Mass Housing: A Discursive Grammar for Siza’s Malagueira Houses (Ph.D. Thesis), Massachusetts Institute of Technology, 2001. [14] J.P. Duarte, A discursive grammar for customizing mass housing: the case of Siza’s houses at Malagueira, Autom. Constr. 14 (2005) 265–275. [15] L. Heras, S. Ahmed, M. Liwicki, E. Valveny, G. Sanchez, Statistical segmentation and structural recognition for floor plan interpretation, Int. J. Doc. Anal. Recognit. 17 (2014) 221–237. [16] L. Gimenez, J.-L. Hippolyte, S. Robert, F. Suard, K. Zreik, Review: reconstruction of 3D building information models from 2D scanned plans, J. Build. Eng. 2 (2015) 24–35. [17] P. Hayton, B. Schölkopf, L. Tarassenko, P. Anuzis, Support vector novelty detection applied to jet engine vibration spectra, in: T.K. Leen, T.G. Dietterich, V. Tresp (Eds.), Advances in Neural Information Processing Systems 13, MIT Press. 2000, pp. 946–952. [18] V. Vapnik, The Nature of Statistical Learning Theory, Springer-Verlag, New York, 1995. [19] S. Metzler, O. Kalinina, Detection of atypical genes in virus families using a one-class SVM, BMC Genomics 15 (1) (2014) 913. [20] K.-L. Li, H.-K. Huang, S.-F. Tian, W. Xu, Improving one-class SVM for anomaly detection, Machine Learning and Cybernetics, 2003 International Conference on, 5, IEEE. 2003, pp. 3077–3081. http://dx.doi.org/10.1109/ICMLC.2003. 1260106. [21] P.-H. Chen, C.-J. Lin, B. Schölkopf, A tutorial on m-support vector machines, Appl. Stoch. Model. Bus. Ind. 21 (2) (2005) 111–136. [22] R.I. Kondor, J. Lafferty, Diffusion kernels on graphs and other discrete input spaces, International Conference on Machine Learning, Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2002, pp. 315–322.
10
T. Strobbe, et al. / Automation in Construction 69 (2016) 1–10
[23] F.-X. Dupé, L. Brun, Tree covering within a graph kernel framework for shape classification, in: P. Foggia, C. Sansone, M. Vento (Eds.), Image Analysis and Processing—ICIAP 2009, Springer, Berlin, Heidelberg, 2009, pp. 278–287. http://dx.doi.org/10.1007/978-3-642-04146-4_31. [24] P. Mahé, N. Ueda, T. Akutsu, J.-L. Perret, J.-P. Vert, Graph kernels for molecular structure–activity relationship analysis with support vector machines, J. Chem. Inf. Model. 45 (4) (2005) 939–951. [25] L. Ralaivola, S.J. Swamidass, H. Saigo, P. Baldi, Graph kernels for chemical informatics, Neural Netw. 18 (8) (2005) 1093–1110. [26] R. Kumar, J. Novak, A. Tomkins, Structure and evolution of online social networks, Link Mining: Models, Algorithms, and Applications Springer. 2010, pp. 337–357. http://dx.doi.org/10.1145/1150402.1150476.
[27] H. Kashima, K. Tsuda, A. Inokuchi, Marginalized kernels between labeled graphs, Proceedings of the Twentieth International Conference on Machine Learning, AAAI Press. 2003, pp. 321–328. [28] M. Stone, Cross-validatory choice and assessment of statistical predictions, J. Royal Stat. Soc. 36 (1974) 111–147. [29] J. Platt, Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods, Adv. Large Margin Classif. 10 (1999) 61–74.