1 Introduction

Since the 21st century, artificial intelligence has entered a new era of integration. Machine learning, as the core technology of artificial intelligence, is also the focus of architects' attention. Most of research which apply machine learning into generative design focus on using generative adversarial network (GAN) to generate internal layout for given boundary conditions. Studies in these fields indicate that the training of GAN through labelling samples has a strong ability to learn interrelationship of spatial elements as well as logical relationship between spatial elements and boundary. However, the research on spatial layout of traditional Chinese private gardens which have more diverse spatial elements and more complex composition relations is still very limited at present.

Among traditional Chinese gardens which plays an important part of the precious historical and cultural heritage of all mankind, private gardens in southern Yangtze epitomise the artistic achievements of gardens. Many Chinese landscape designers tried to learn from its typical artistic spatial layout to create unique experiences. Therefore, starting from machine learning method, this paper set the research object as private gardens in southern Yangtze and explores the ideas and methods of generating layout inheriting its characteristics for given specific land use conditions.

2 Background

Private gardens in southern Yangtze are built by professionals with artistic accomplishment in ancient China. Most of them are ingenious designed as built on site to meet the spiritual need of the host according to local conditions. It is the myriads of changes of elements in combination that create private gardens’ complex spatial arrangement. Therefore, they have rarely been formally measured and generalized.

Among the previous studies, most scholars tend to use descriptive language to analyze private gardens in southern Yangtze in basis of their observation and feelings, such as Chen [1956] in “Classical gardens of Suzhou” typically represented the integration of literature, history and philosophy with Chinese gardens in poetic way. Peng [1986] in “analysis of classical gardens” systematically analyzed the techniques and skills of traditional gardening art to interpret traditional garden space. These treatises extracted the artistic essence of traditional Chinese private gardens and laid an important foundation for further study of researchers. However, traditional study of private gardens which barely involve designing a new private garden, can hardly produce specific and effective help for generating new private garden space.

For such difficult-to-define problems, machine learning is able to conduct statistics on empirical data and make generation through probability density estimation. Recently, relevant studies have applied GAN to layout generation and proved its effectiveness [1, 3, 5]. In their research, the color block labeling method to process samples effectively improves the quality of the layout generation.

Specific labeling methods in machine learning coincide with the salient learning points in human learning. From this point of view, the improvement of labeling methods might be one of the breakthroughs for machine learning to learn more complex problems in layout field. Therefore, based on pix2pix model and data expansion for the small sample set of experimental objects, this paper starts with the sample labeling method and gradually improves it according to the experimental results, so as to realize the intelligent generation of plan layout with the characteristics of private gardens in southern Yangtze. In this way, this research hopes to deconstruct private gardens from the perspective of statistics, and on the other hand, we aim to enhance comprehension of traditional Chinese private gardens through the design process and verification.

3 Research Method

The main process of exploration on machine learning layout generation of Chinese private garden in southern Yangtze is as follows:

  1. 1)

    Database establishment. Select private gardens in southern Yangtze which meet the standard and collect their relevant information.

  2. 2)

    Sample processing and labeling. Redraw and label samples on the basis of the knowledge of architecture.

  3. 3)

    Training and testing. Input one-to-one corresponding sample sets to train and test the machine learning model.

  4. 4)

    Evaluation and modification. Evaluating the results and put forward further adjustment of labeling method so as to improve the final generation.

3.1 Network Architecture

The Pix2Pix model [4] this paper used is a classic model that applies GAN to supervised image-to-image translation. The input of generator is the private garden site boundary. Then the private garden layout plan output by generator and the real one we collected are input to discriminator respectively. Finally, the discriminator evaluates the probability that the input comes from the real sample. Through the iteration, generator constantly generates the plan that is close to the real sample to fool discriminator. The model converges through the continuous game between discriminator and generator. At last, the generator is able to generate a layout with traditional private garden space characteristics for any given site plan.

3.2 Dataset

3.2.1 Collection

Considering the sample size and the effect of machine learning, we selected cases of private gardens according to the following rules:

  1. 1.

    Private gardens which are listed as cultural relics protection units in south of the Yangtze River.

  2. 2.

    The relative information, such as the name of the private garden, the building history, and the main buildings for viewing, can be searched.

  3. 3.

    The main elements of private garden can be clearly identified.

In this research, we collected a total of 35 samples (Fig. 1) of private gardens located in the Yangtze River delta area through the Internet and related books. Among them 5 samples were used for testing the model.

Fig. 1.
figure 1

Part of selected private garden samples

3.2.2 Augmentation

The sample size is too small for the training model. Thus, the data set need to be augmented. Since the learning point is the layout relation of private garden space element, as the same way researchers did it before [6], the remaining 30 samples were flipped in four directions to get a total of 120 samples for the experiment.

3.3 Processing and Labelling Based on Analysis

Traditional Chinese private gardens are composed of four major elements, namely mountains, water, plants and buildings, creating a poetic and pictorial space as the context to express the subjective and objective needs of owners in ancient China.

In previous studies [2, 7], scholars summed up several key points on the layout relationship of the four major elements. Such as “subordination and priority” means that in the complex private garden spatial system, a part of space will be designed as the main scenic area of the whole garden; “The contrast of space” represents the main scenic spots of private gardens is usually highlighted by first repressing then developing. The “twists and turns” is the most prominent feature of private gardens in southern Yangtze, which makes private garden become more profound and winding by connection of buildings and the use of curved corridors. How to accurately extract and highlight these design features of samples to achieve better learning results is the focus of this research.

3.3.1 Sample Processing

In order to enable the machine to learn the typical layout relationship directly, this paper redrew (Fig. 2.b) the private garden plan samples with different clarity in basis of the knowledge of architecture to extract the key information about their spatial layout. The principle of redrawing is as following:

  1. 1.

    Replicate the main part. The dimensions, shapes and relative positions of the main private garden elements, such as mountains, water, buildings and main roads, are as same as the original plan.

  2. 2.

    Simplify. Based on historical information and analysis of scholars, keep the vital private garden elements, retain the shape outline and position that are key to layout design. All detail and interference information such as lawns and street lights that has less effect on layout design was removed.

3.3.2 Sample Labelling

To label the samples, firstly we filled the main elements of the private garden with different colours. Then the limiting factors such as the private garden boundary and the main entrance were marked. After that, we marked out the whole private garden area as the central and the site part to distinguish the central area from other parts of the private garden.

The final samples (Fig. 2.c) with the real site boundary was paired as one-to-one corresponding samples and finally input to the machine for training.

Fig. 2.
figure 2

Processing and labeling based on analysis of private garden layout

4 Training and Analysis

4.1 First Training

In the first training, each input and output image pair from the dataset was labeled with color blocks representing certain functional areas (Fig. 3).

Fig. 3.
figure 3

Labeling rules for first training. An image pair example from dataset

A total of 30 samples were labeled as dataset and 7 of them were flipped horizontally for testing. The generated images were almost the same as relative samples in dataset, a phenomenon of over-fitting, because testing samples were too similar to training samples. So, we labeled 5 new samples for retesting (Fig. 4). Machine learned that the central landscape area (labeled yellow) was distributed around the water and walking flow (labeled red) was distributed around the central landscape area. But architectures (labeled black) were not in block and their distribution was irregular, also the images were fuzzy.

Fig. 4.
figure 4

Testing results of first training (real_A and real_B are input image pair, fake_B is generated image)

4.2 Second Training

4.2.1 Improvement

Because the training of fearless generation to artificial intelligence can be taken as the architectural education to specific computer programs, the changes of our training thoughts referred to the patterns of education.

  1. 1.

    Enlarge training dataset

    We quadrupled the size of dataset samples by flipping horizontally, vertically and horizontally plus vertically.

  2. 2.

    Simplify learning tasks

    We simplified the learning tasks by removing non-core areas and keeping only core areas. We removed architectures outside the private garden and large areas of landscape space outside the main area.

  3. 3.

    Improve labeling rules, define learning key points

    We determined the core patterns of private garden layout, and clearly defined learning key points, including: main entrance of core region, walking flow, main landscape architecture, open space, the formal and logical relationship between boundaries.

Based on the core requirement of traditional private gardens for hosting and creating natural view in limited urban space, we drew the following rules:

  1. 1.

    Maximum depth of view for main landscape architecture.

  2. 2.

    The main walking flow provides many viewing perspectives which can be called “varying sceneries with changing view-points”.

In addition, there are mathematical and logical relations between the area of the mountain, water and main landscape architecture as well as graphical and logical relations between the shape of mountain, water and the boundary. And the pix2pix model was able to self-learning according to statistical principles.

We highlighted training key points in labeling. The labeling of mountains and main landscape architecture were added. Meanwhile, we connected the architecture in private garden central area with main walking pathway, hoping that the machine can learn the layout of buildings within the central area. The labeling of special landscape space (labeled purple) was added, which is an important space formed by winding corridors and the boundary walls in many cases. So, we distinguished those inter-spaces with other landscape space.

4.2.2 Labeling and Results

(See Fig. 5.)

Fig. 5.
figure 5

Labeling rules for second training. An image pair example from dataset

We relabeled 30 image pairs and a dataset of 120 was generated after augmentation, then we labeled 5 samples for testing. There were great improvements in results (Fig. 6). The overall generation was clearer. 5 output images all generated some unreasonable landscape elements because the unclear law in the dataset.

Fig. 6.
figure 6

Partial testing results of second training

  1. 1.

    Corridors and private garden boundary

    The labeled special landscape space (purple tagged) was not generated. Besides, the main landscape architecture was all north-south instead of east-west direction. It was noticed that most samples in dataset had no inter-space labeling and few main landscape architectures were east-west direction. After learning massive samples, the machine was more inclined that the private garden layout had no inter-space and the main hall facing north-south.

  2. 2.

    Mountain and landscape architecture

    Layout inside the central landscape area (labeled yellow) was not ideal We analyzed that the distribution pattern of mountain in dataset samples was not clear, and the architectures were too small in scale. Machine may identify them as random black pixel points, leading to pixel chaos in generated images.

  3. 3.

    Walking flow/pathway

    We analyzed that the pathway distributed randomly, machine may identify those labeling as random red pixel points, leading to broken red lines.

    The main problem was that the dataset was small, but the differences between samples in dataset were noticeable, an insufficient in consistency.

    So far, the labeling was based on real samples. Although we simplified the law and adjusted the labeling, diversity in dataset was still noticeable and the particularity of each sample may have a great impact on the result. Thus, we began to widen the gap between real private garden cases and the samples labeled for machine to learn, and hoped to improve learning results in this way. Real private garden cases represented real life problems, while samples for machine to learn represented word problems given to students in the process of education combined with real life problems. Word problems can be modified to strengthen the learning performance, and there is no need to insist on consistency in reality. So, we began to artificially modify the samples in dataset for consistency.

4.3 Third Training

4.3.1 Improvement

To solve the above problems, we relabeled the samples with following rules:

  1. 1.

    Unify the inter-space (special landscape space) as triangles.

  2. 2.

    Unify the size and shape of mountains according to the size of private garden land area. Unify the layout of landscape architecture, water, mountain.

  3. 3.

    Adjust the main landscape architectures to south-north direction.

4.3.2 Labeling and Results

(See Fig. 7).

Fig. 7.
figure 7

Labeling rules for third training. An image pair example from dataset

In this test, we selected 5 site boundaries, then labeled them several times and generated output images through the model (Fig. 8). The testing results were in line with our expectations. They all learned the special landscape space between the veranda and the wall, and the layout relationship between the main landscape architecture and the mountain and water was reasonable.

Fig. 8.
figure 8

Partial testing results of third training

4.4 Result Analysis

The layout of generated images was reasonable from quantitative analysis, with the expected distribution of landscape architecture, mountain and water. Most of them followed the dataset samples, and some of them were properly adjusted through machine learning.

The main spatial elements in the generated images were relatively complete, while some lack of the main landscape architecture. The machine learned the logical relationship in area proportion of key elements (architecture, mountain, water), it also learned the length proportion of special landscape space (inter-space). Besides, the machine retained the large depth of view for landscape architecture.

5 Discussion

This study implemented a model that can generate private garden layout by inputting site plan with certain conditions based on the Pix2Pix model. Through the analysis of experimental results and adjustment of labelling method, vital rules of traditional private gardens in element layout were constantly summarized. In the future, the generated layout can be constructed in three dimensions so as to evaluate the density rhythm of private garden space reflected in the section which helps further improve the labelling rules and learning effect. Meanwhile, more effective data expansion strategy needs to be adopted to deal with the small sample problem of private gardens and reduce the specificity of generations.

Although this study exclusively focuses on the spatial pattern of the main area of private gardens in southern Yangtze, and the generated results still remain at the outset of expressing the layout relationship due to the large difference in the scale of learning cases. It Reveals the huge potential of machine learning and provides a new thought for designers to study the complex layout generative design problems of private gardens in southern Yangtze which used to be designed mainly by experience and difficult to be summarized by clear rules. More importantly, in the process of constantly revising sample labelling method, we are also encouraged to discover and verify the private garden elements and layout rules that convey the interest intention pursued by ancient literati.