• No results found

Generating Synthetic Schematics with Generative Adversarial Networks

N/A
N/A
Protected

Academic year: 2022

Share "Generating Synthetic Schematics with Generative Adversarial Networks"

Copied!
46
0
0

Loading.... (view fulltext now)

Full text

(1)

Independent project (degree project), 15 credits, for the degree of Degree of Bachelor of Science(180 credits) with a major in Computer Science

Spring Semester 2020

Faculty of Natural Sciences

Generating Synthetic Schematics with Generative Adversarial Networks

John Stephen Daley Jr

(2)

Author

John Stephen Daley Jr

Title

Generating Synthetic Schematics with Generative Adversarial Networks

Supervisor Marijana Teljega

Calle Nilsson, JayWay by Devoteam

Examiner Dawit Mengistu

Abstract

This study investigates synthetic schematic generation using conditional generative adversarial networks, specifically the Pix2Pix algorithm was implemented for the experimental phase of the study.

With the increase in deep neural network’s capabilities and availability, there is a demand for verbose datasets. This in combination with increased privacy concerns, has led to synthetic data generation utilization. Analysis of synthetic images was completed using a survey. Blueprint images were generated and were successful in passing as genuine images with an accuracy of 40%. This study confirms the ability of generative neural networks ability to produce synthetic blueprint images.

Keywords

Synthetic Data, Generative Adversarial Network, Machine Learning, Convolutional Neural Network, Python, Tensorflow, Blueprints, Pix2Pix

(3)

Contents

1. Introduction 5

1.1 Background 5

1.2 Problem and Motivation 5

1.3 Research questions 6

1.4 Aim and Purpose 6

1.5 Limitations 7

1.5.1 Datasets 7

1.5.2 Survey 7

2. Method 8

3. Literature review 9

3.1 Literature search 9

3.2 Machine Learning 9

3.3 Gans 10

3.4 Pix2Pix 12

3.5 Related work 14

4. Implementation 20

4.1 Data pre-processing 20

4.1.2 Pix2Pix 20

4.2. Google Colabratory 22

4.3 Training 22

4.4 Testing 22

4.5 Survey 23

5 Results & Analysis 24

5.1 Theoretical 24

5.2 Empirical 25

6 Discussion 28

6.1 Ethical Issues and Sustainability 28

6.1.1 Synthetic data 28

6.1.2 Machine learning 29

7 Conclusion 30

7.1 Future work 30

8 References 32

Appendix 37

1. Process.py Code Snippets 37

(4)

3. Pix2Pix datasets samples from the original paper. 38

4. Pix2Pix maps dataset: 39

5. Training Options 40

6. Testing options 41

7. ArchiGAN model 2 and 3 outputs 42

8. Generator loss information and graph 43

9. Plot.py Code snippet 45

10. Answer key to the survey 46

11. Link to the github Pix2Pix repository 46

(5)

1. Introduction

This study intends to synthesize data, in the form of blueprint images, using Generative Adversarial Networks(GANs). The network that will be used is Pix2Pix from Philip Isola[1]. This network was chosen because it has previously generated synthetic images[1].

1.1 Background

Machine learning has seen an increase in scientific research, not only inside of mathematics and computer science domains but also in other fields such as architecture and medical research[2]. As machine learning use increases so does the need for specialized datasets, resulting in creative solutions to obtaining the data required for training. This is achieved by synthesizing data to compensate datasets that are insufficient in size or quality. The amount of data required to produce viable results varies greatly, depending on the type of machine learning being performed[2][3].

Creating a dataset can be aided by following the FAIR principle, which is an abbreviation for Findability, Accessibility, Interoperability, and Reusability[4]. The medical research field utilizes GANs to generate medical images, such as retinal images[5] and PET scans[6].

1.2 Problem and Motivation

With the ever increasing power of data driven machine learning algorithms, a new problem has become evident, that there is a lack of public datasets. This has led to an increase in synthetic data sets, which this research attempts to create, specifically for schematics.

The research is motivated by the lack of data available for performing deep learning, such

as Positron Emission Tomography analysis in a clinical setting[6]. Because of the lack of

public data sets there is a restriction on what areas can be researched, therefore this

research explores methods for removing said restriction for future researchers. A second

(6)

motivation is to analyze the capabilities of Generative Adversarial Networks to produce synthetic data, in respect to schematics. Lastly this research builds on previous Generative Adversarial Networks(GANs) that are used to generate “natural” images for synthetic data and data augmentation[7].

1.3 Research questions

The study is based off the following research questions:

Research Question 1: Can a Generative adversarial network be used to generate schematic data sets?

The lack of data-sets available to the public is causing researchers to find creative solutions to train deep neural networks[8][5][6]. GANs have been used to create completely new natural images, but there are still many areas they have not been utilized. One of those areas is generating synthetic schematics, such as a blueprint.

Research Question 2: Do schematics created by Generative Adversarial Networks perform better than real data-sets at training machine learning models?

Once a synthetic schematic is generated, it must be validated and tested. Researchers in the medical field make life critical decisions based on machine learning models[9], therefore these models must have a high level of accuracy. Due to the sensitivity of data sent into machine learning models, testing must be conducted between synthetic data and the genuine data. Testing can not only consist of training machine learning but also using common standards for data validation.

1.4 Aim and Purpose

The aim of this research is to explore synthetic data creation with Generative Adversarial

Networks, specifically for blueprints. It also intends to investigate the impact of

synthetic data on training results for convolution neural networks. A Dataset were

created using the maps dataset provided by UCBerkeley[10] as a foundation. Research

(7)

was conducted using Pix2Pix[1] neural network to create synthetic data. Pix2Pix network was trained on maps2blueprint.

1.5 Limitations

The domains researched as part of this study contain a depth of information that exceeds the scope of this paper. As a result of this, the research will provide high level overviews of mathematical concepts, while providing resources for further study in the reference and appendix sections. This research also focuses on using generative adversarial networks for data generation, there are additional algorithms that can be utilized but they will not be covered in this research.

1.5.1 Datasets

The datasets were limited by the nature of the algorithms selected for the experimental section of the research. Pix2Pix requires the image pairs to have the same underlying structure[1]. A researcher assembled a data set, maps2blueprint, is used for training of Pix2Pix, but references Berkeley's maps image set[10].

1.5.2 Survey

The survey was conducted online due to Covid-19. Because of the sample size of the

survey and number of images shown, this survey requires more through testing for

validation.

(8)

2. Method

This research study was performed using theoretical and experimental methodologies. A literature study was conducted to explore the theoretical aspects, while the experimental area consisted of Pix2Pix deep neural network. Pix2Pix was implemented using Google’s Colabratory and the code from Philip Isola’s github repository[1]. A survey was conducted to aid in analysis of the results produced by the experiment. Due to the novel nature of Generative Adversarial Networks, specifically pertaining to synthetic data creation, this literature study contains references articles from Towards Data Science[11], algorithm and developer Documentation, scientific peer-reviewed papers.

Keyword research was done using ACM, IEEE, Google Scholar, and the Kristianstads Universitie’s database search function.

The literature study explores the background of machine learning, generative adversarial

networks, synthetic data creation and related work. Another intention of the literary

study is to collect information pertaining to which frameworks and tools should be used

during the experimental phase.

(9)

3. Literature review

The literature review is as follows:

First section, denoted as 3.1, is a literature search and was completed using Kristianstad University’s online database and Google scholar. Following the literature search is a summary of the search results, where applicable to the research. It proceeds from the foundations of generating synthetic data, machine learning, in section 3.2. After which, sections 3.3 and 3.4 include information pertaining to generative adversarial networks and Pix2Pix. The related work section, labeled as 3.6, contains synopsis of relevant studies in data synthesis.

3.1 Literature search

A literature search was performed using Kristianstad University libraries database, with the key words: “synthetic” “data” “deep” “learning”, which produced 23,619 resources.

This first search was focused on obtaining general search results to gain an overview of the domain. A second search was conducted by updating the search parameters with the keywords “generative adversarial networks” in place of “deep learning”. This search produced 882 results, which were then filtered by artificial intelligence yielding 199 results. Within these results were several examples related to the research, using conditional generative adversarial networks to synthesize images. This last search provided a new subset of keywords to search: “image to image transfer generative adversarial networks” which yielded. This search was completed using Google scholar and produced 25,400 results. Afterwards the search was reduced in size by filtering results based on use of Pix2Pix algorithm and adding quotations around “image to image” and “generative adversarial networks” keywords, which provided the 1410 resources. The literature search yielded 45 resources that were applicable to the study.

3.2 Machine Learning

Aurthur Samuel presented work in 1959 that presented two machine learning

methodologies, which could outperform a human opponent in 7-8 hours[12]. Machine

(10)

learning is a discipline within the domain of artificial intelligence and includes sub divisions, such as natural language processing and computer vision. A machine learning algorithm learns to map relationships between one or more input values from a dataset.

Once trained, the model can be utilized depending on the nature of the results of the training. Figure 1 Shows the nested nature of machine learning.

Figure 1: Machine learning relationship to Artificial Intelligence.

3.3 Gans

First introduced in 2014[13], Generative Adversarial Networks contain two separate ML

algorithms, referenced as discriminator and generator. The generator takes in noise and

attempts to produce a synthetic output that is capable of classification as ”real” by the

discriminator. If the discriminator does not consider the image to be real, the generator

will update internal metrics, afterwhich a new image is produced and tested again. This

internal update is known as backpropagation. Backpropagation is a method for updating

training weights continuously, the generator in this case. This is often seen as

competition between these two neural networks. A simplified overview can be seen in

Figure 2 and Figure 3, shown below[14][15]. In this figure the models are each

represented and shows the process of convergence of the discriminator and generator, by

mean and variance.

(11)

Figure 2: Displays the convergence of the discriminator and generator models in a simplified example.

Figure 3: Shows an overview of generative adversarial networks.

(12)

In the paper Generative Adversarial Nets[13], Ian J. Goodfellow and colleagues described the theoretical nature of GANs. A brief summary is found above, with the following equations reinforcing the concepts presented there. The formula for adversarial nets from the aforementioned paper[13] is displayed below. In this formula D, the discriminator, and G, the generator, play a game to minmax the value of V(G, D).

In their equation they define a noise input for the generator, represented here as . Two multilevel perceptrons are defined to represent the generator and discriminator in the following manner and .

These generated data objects can then be used as synthetic data. A deeper explanation can be found in the appendix section.

3.4 Pix2Pix

Pix2Pix is a specific implementation of a generative adversarial network, in which one image style can be transferred to another image [1]. Pix2Pix employs a Conditional GAN[16], which is a GAN that allows input conditions such as labels in the case of the facade’s model example, provided by the original paper. This allows for constraints to be placed on the output, such as using style transference to color a black and white photo.

The model does not alter the underlying state of the photo, only the style in which it is

rendered. A traditional GAN is unsupervised, taking only noise as an input[13], while

Pix2Pix is supervised in an aspect, because of the input image taken by the generator. An

example of this can be seen in Figure 4, which were examples in Phillip Isola and

colleagues original work[1].

(13)

Figure 4: Examples of the capabilities of Pix2Pix[1].

Pix2Pix takes a paired image set as input for its training and testing datasets. This is referred to as AtoB or BtoA, which implies the direction to train the network, A being the image on the left and B to the right. For the following text AtoB is applied. The generator will receive imageA and output a synthetic image. This synthetic image will then be concatenated to the real target image, which act as inputs for the discriminator model. The discriminator is tasked with authentication of the pair of images, outputting real or fake. In the case of fake detection the generator model is updated based on the output of the discriminator, through back propagation. Both the generator and the discriminator follow the form of convolution-BatchNorm-Relu[17].

The discriminator utilizes a Markovian discriminator, known also as PatchGAN.

PatchGAN divides the images, both real and fake, into N x N squares. It then compares

each patch individually and attempts to classify it as real or fake. This methodology is

implemented to combat the blurry results of known L2 loss[17], while also improving

speed. Figure 5 shows examples of this method[1].

(14)

Figure 5: Illustrates the improvement in color and detail on the increased number of patches used by the discriminator model.

Pix2Pix’s generator applies a “U-net” shape to avoid the bottleneck of encoder-decoder networks. This U-net shape allows for skip-connections [18] between the layers of the network[1]. In Figure 6 illustrates the skip connections in the U-net architecture [1].

Figure 6: Shows a traditional encoder-decoder compared to the U-net framework[18][1].

By harnessing these methodologies, Pix2Pix allows for style transference of generalized images.

3.5 Related work

ArchiGAN was created by Stanislas Chaillou in 2019[19]. ArchiGAN fabricates apartment layouts using Chained Pix2Pix neural networks, also referred to as generation stack. The study was conducted at the Harvard graduate school for design and explored a unique solution to designing apartment buildings. The research built on Nathan Peters and Andrew Witts work, was to create an interactive design application for

”non-architects”[20]. Building from the ground up, the study first collected a dataset that

(15)

contained Geographic Information System data from the Boston area. The first GAN was trained on these parcels to generate land footprints, that represented possible configurations that would fit inside the parcel. The output of the first model can be viewed in Figure 7. In the results, land parcels are used as input data, and the model constructs a synthetic representation of a building layout over the parcel.

Figure 7: Shows the results of the first model. Ground truth refers to the existing building parcel of land[19].

The next neural network takes an input of a synthetic building layout, generated in the first model, along with the location of the door and main windows. Model II is tasked with generating the apartment layout, primarily windows and walls. This model is trained on more than 800 apartment plans, that have been preprocessed and annotated.

Outputs originating from this model contain color representations of which partitions

correspond to which rooms. The final model takes the output from model II and allocates

furniture in the appropriate partition. This is acheived by inputting image pairs, such as

the label2facade examples shown in the original Pix2Pix research[1], but in this case the

colored partitions act as labels for correct furniture selection and placement. In Figure 8,

an example of the organization of the inputs and outputs of the three stacked models.

(16)

Figure 8: Example inputs and outputs from ArchiGAN[19]. In the figure the order can be followed from noise input in the left image to the synthetic apartment design in the rightmost image.

ArchiGAN research also included a user interface, built on these trained models, to help the non-architects use this conditional generative adversarial network stack.

In Synthesis of Positron Emission Tomography (PET) Images via Multi-channel

Generative Adversarial Networks(M-GANs)[6], the authors found that a tumor detection

network trained on synthetic PET images was only 2.74% below the same detection

network when trained on genuine PET images, when comparing recall. PET scans are

often used as assistive tools for detection of certain types of cancer[6]. The

Multi-Channel GAN used for data synthesis takes two input images, the first contains a

computerized tomography scan(CT), whilst the second input includes a labeled image. In

Figure 9 an overview of the network used can be found.

(17)

Figure 9: Shows an overview of the adversarial network used to synthesize PET scans.

The inputs on the left, highlight the unmatched image pair.

Using this technique, the researchers were able to improve the quality of synthetic data pertaining to medical PET scan images. The M-GAN also decoupled the requirement for the labeled image and the CT scan. Generated synthetic data was then used to train a fully convolutional neural network to detect tumors. A sample of the images synthesized can be found below in Figure 10, which originates from the research.

Figure 10: Examples of the tested GAN’s outputs, (a) label, (b) CT image, (c) real PET image, (d, e) synthetic PET images produced with only using (a) or (b), (f) our synthetic PET images with both (a) and (b) as the input[19].

The researchers concluded that the images produced by the M-GAN shared the highest

correlations with the real PET scan images.

(18)

The Office of National Statistics, Data Science Campus [8] found that tablature data integrity can be preserved while also removing personally identifiable metrics from the dataset. They compared the results of 4 methodologies for generating and synthesizing data including AutoEncoder, WGAN, GAN and Smote. Pearson's correlation is used to attain quality metrics from the synthesized data. The AutoEncoder achieved the highest level of data proximity to the original dataset. Figure 11 displays a high-level overview of an autoencoder, image credit to Data Science Campus, a division of the Office National Statistics[8][21].

Figure 11: Displays a high level overview of an autoencoder.

Another key point to their research is that sampling the genuine data is not required to

train the Generative Adversarial Network, therefore reducing the chance for privacy

breaches. This allows for data sets to be open sourced for research, while maintaining

the integrity of the individuals in said data set. Their project conducted data synthesis on

30,000 records and 15 variables using Generative Adversarial Networks and needs

further testing on larger datasets. Figure 12 highlights the results of the experimental

phase of the research.

(19)

Figure 12: Displays the results of the research, where µ_abs pertains to the relationship between genuine and synthetic data. Values closer to zero indicate a higher correlation between both datasets.

Although Autoencoders and synthetic minority oversampling(SMOTE)[8], produced

synthetic datasets that were closest to the original dataset, both of these techniques

require sampling from the original dataset. This sampling can result in artifacts of the

original dataset existing in the synthetic data, allowing for potential identifiable metrics

to be obtained from the generated data.

(20)

4. Implementation

In the following section sets forth the steps followed by the research to complete the implementation phase.

● Data pre-processing - Constructing the datasets needed for training and correctly sizing said images.

● Google Colabratory - Using prebuilt Pix2Pix Google Colabratory Notebook, written in Python, to utilize cloud resources.

● Train the model - Taking the first two steps into account, the model is trained via the train.py script, contained in the notebook.

● Test the model - Takes a checkpoint from the train model and runs the model on a testing dataset.

● Conduct survey to assist in result analysis.

During implementation researchers used the following tools: GitHub repositories from api developers and scientific articles to develop and implement a generative adversarial network for producing synthetic schematic data. The model tested was Pix2Pix[1].

4.1 Data pre-processing

The following section contains the data pre-processing steps taken in this research.

4.1.2 Pix2Pix

Images were processed using process.py file[1], which included the functionality needed

to prepare the dataset for training, along with online resources and command line

functionality in Ubuntu 18.04. Code and command line inputs utilized for data

pre-processing can be found in the appendix. Pix2Pix requires training images to be

formatted as in Figure 13[22].

(21)

Figure 13: A to B visualization example image.

Pix2Pix’s dataset was constructed by the researcher based on the maps[10] image set, more examples can be found in the appendix. This dataset was chosen due to its inclusion in Pix2Pix’s documentation[1]. The maps image set contains 1065 paired images, displaying a satellite image and its corresponding Google map view, in the training set. Sample image of origin dataset displayed in Figure 14. The researcher selected 800 images from the training set for conversion. The dataset size was chosen based on the findings that a dataset as small as 400 effectively trained Pix2Pix[1]. The maps set was split 80% training and 20% testing, thus arriving at the 800 image set size for training. The Original maps paired images were first converted to blueprint styled images. Blueprinted images were then split into single images, to allow for a new dataset to be completed based on the specifications required by the Pix2Pix algorithm.

Processed single images, in blueprint form, were then combined with their respective original map image to create a training dataset of 800 map to blueprint images. An example of a finalized training image pair shown in Figure 15. Refer to appendix for overview of the image processing from origin to training set.

Figure 14: Example of Original Map dataset image.

(22)

Figure 15: Finalized image pair for training.

4.2. Google Colabratory

Google Colabratory implementations of the model were used due to cost and ease of use[23]. Google Colabratory allows researchers to harness the compute power of server grade graphical processing unit’s, which include Nvidia K80, T4, P4, and P100. Graphic cards of this caliber allow for dramatically increased training speed over a cpu[24].

Pix2Pix Colabratory notebook implementation originated from Jun-Yan Zhu’s github[1][25], implemented using Pytorch.

4.3 Training

Pix2Pix is then trained on the maps2blueprint dataset, using the above mentioned Google Colabratory implementation. All training was done on Google Colabratory Notebooks. The training was conducted with the default settings provided by the notebook, these can be viewed in the appendix under Training Specifications. The training was run for 95 epochs, after which the model was saved. Output images are saved every epoch. These images are labeled real_A, fake_A, and real_B. A HTML file is used to render the outputs in a viewable form[1]. After the completion of the training, testing was performed.

4.4 Testing

Testing was conducted with the test.py script, provided by Pix2Pix’s notebook[25].

Testing options can be viewed in the appendix. The test.py script will load the current

(23)

checkpoint, defined by the training model, and use these metrics to synthesize the input dataset. Testing was completed on 200 images, pre-processed in the same style as the training dataset. 200 images was chosen due to the training set being 800 images applying the Pareto Principle, also referred to as the 80/20 rule, to partitioning training and test sizes. Outputs are saved as in training. Figure 16 displays an example output from the testing phase.

Figure 16: Displays an example output of the model during validation.

4.5 Survey

This research’s approach to quantify the results was to create a survey. The survey was

created using Google forms[26] containing 15 questions which consisted of image pairs,

one genuine image and one image selected from the synthetic images generated by the

Pix2Pix algorithm. The survey instructions were to select the image the participant

believed to be real and was completed by 31 participants online.

(24)

5 Results & Analysis

This section contains the results of the theoretical and experimental research.

5.1 Theoretical

The Literary study produced the following results.

Research Question 1: Can a generative adversarial network be used to generate schematic data sets?

Generative adversarial networks have been shown to synthesize natural images efficiently, achieving realistic results when generating artificial human faces[27] and medical imagery such as Positron Emissions Tomography[6]. In the case of medical imagery, synthetic data was generated to compensate for limited dataset size.

AI +Architecture, Towards a New Approach[19] presented a novel approach to harnessing the functionality of Pix2Pix, when combined with neural network chaining, to create architectural designs of apartments. The study allowed for researchers to input external conditions throughout the training process, resulting in fabricated apartment layouts. Results from this study can be found in the appendix.

Research Question 2: Do schematics created by Generative Adversarial Networks perform better than real data-sets at training machine learning models?

The research found that in some cases augmenting, or even total data replacement,

resulted in an increase in quality of training results[7][28]. Due to the sensitive nature of

medical images, researchers are restricted when conducting research. This methodology

is referred to as Inception[1]. Improvements in the quality of training metrics have been

seen in fields such as medical image classification[5][6][28], architectural drawing

generation[29] and even generating entirely new worlds[30].

(25)

5.2 Empirical

Analysis of synthetic data generation is a challenging task[1] and traditional methods, such as per-pixel mean squared error[31], haven't proven effective.

Loss is not considered a viable metric for generative adversarial networks, when discussing the image quality. Loss is a reliable metric in association with convolutional neural networks(CNNs) learning[32]. Because this generative adversarial network[1]

implements CNNs, loss was graphed to visualize the learning of the generator network.

This graph can be found in the appendix.

One test is how believable the image is to a human. The approach this study takes is based on the research done in Pix2Pix’s original paper[1], which referenced Richard Zhang and associates work[33]. In Figure 17 shows the output of synthetic images generated during the first epoch’s training, while Figure 18 shows the output after 95 epochs. These outputs are displayed in a html format for ease of viewing, found in the Pix2Pix github repository [1]. When comparing these outputs visually, the research concluded that the algorithm has improved but further analysis is required and described in the future work section.

Figure 17: Output of the first epoch visualized. The left image, real_A is the input image

for the generator, while fake_B is the output image of the generator. The right image,

real_B, is the targeted output image.

(26)

Figure 18: Output of the ninety-fifth epoch visualized. The left image, real_A is the input image for the generator, while fake_B is the output image of the generator. The right image, real_B, is the targeted output image.

The analysis of the survey showed that the images generated by training the Pix2Pix algorithm proved effective at passing as real images when compared by the participants in the survey. Figure 19 shows the results of question 1, where the correct response was option 2.

Figure 19: Displays the results of Question 1 in the survey, with 22.6% selecting the fake

image.

(27)

Results from the survey were 40% on average, which is above the range of related research, such as 27.8% in the original Pix2Pix paper[1] and 32% in the results Colorful Image Colorization[33]. Figure 20 shows results to all questions, sorted by image type, the answer key can be found in the appendix section.

Figure 20: Displays total results of the study per question.

Inception, known as the technique of generating synthetic data and then testing it against

a model trained on genuine information[1], is a technique used in previous research in

synthetic data generation. This study was unable to conduct this form of analysis but

more information can be viewed under the future work section.

(28)

6 Discussion

The findings of the study showed the capabilities of two neural networks at synthesizing blueprint images. Although the blueprints created are of map images, the research shows the basis for converting other image types to blueprint images. Images must be tested against genuine blueprint images to assess the impact of synthetic images on training results, for example object detection[6]. Although the research wasn't able to test the synthetic data, outside of the survey, the accuracy to the target image in the testing phase indicates plasability. The survey averaged 40% of the time users were unable to distinguish between a synthetic image and a genuine image, limitations described previously.

This study helps to confirm results from related work on data synthesis, such as an increase of both sensitivity and specificity by 7.1% and 4%, respectively when classifying liver lesions[7]. The results also help to reinforce the findings of the literature study, that blueprints can be generated by Generative Adversarial Networks.

6.1 Ethical Issues and Sustainability

This study focuses on a subsection of generating synthetic data, synthetic blueprint image creation. The nature of synthesized data allows for discussion of the societal concerns around both synthetic data and machine learning.

6.1.1 Synthetic data

Synthetic data has increasingly become a subject of the world stage, primarily for the

abuse of synthetic images, such as deep fakes, used for identity theft. Synthetic

schematics, in the case of image to blueprint transference, could allow for potential

intellectual property theft or unauthorized production. Deep fakes project personal traits

of a unique individual onto another visual or audio mediums. Attention around the use of

deep faked digital media, specifically around the loss of trust in digital form and abuse

of falsified media, is growing as access to these algorithms becomes more common. This

growing level of distrust in digital media combined with misinformation has affected

(29)

political decisions, such as the presidential election and BREXIT[34]. Because of the misuse of deep fakes, the researcher must be cautious of creating models that could be used in a harmful manner.

6.1.2 Machine learning

Generating synthetic data involves modern machine learning techniques such as

convolutional neural networks[1], when generating synthetic image data. Therefore

machine learning biases and ethical concerns are applicable to this study. Machine

learning models, involving facial recognition as an example, have been susceptible to

biases. Bias in machine learning has produced results that have been considered harmful,

such as ethnic biases and gender biases[29][35]. A common way biases can be learned is

if the input data contains inherent biases from the researcher. When generating synthetic

data for model training use, researchers must be vigilant to avoid inheriting unwanted

training weights from the sampled dataset.

(30)

7 Conclusion

This study demonstrated that Generative Adversarial Networks can be utilized to synthesize blueprints. With machine learning use growing in both the academic and business domains, high quality data becomes a necessity. The theoretical results provided by the literature study, combined with the synthetic blueprint images created during the experiment, indicate that synthetic image generation could be an effective method for improving training results, in future machine learning algorithms[6]. A survey was conducted to support synthetic blueprint image analysis and shows positive preliminary results. The results are considered preliminary because of the online nature of the survey. A list of future work can be found in the next section.

7.1 Future work

The future work for this study could include some of the following improvements.

● Larger data set to improve accuracy of the Pix2Pix neural networks.

● ArchiGan[19] could be utilized to allow for chaining of the generative adversarial networks. This would increase the control the researcher possesses during the training process.

● Diversifying datasets could allow for more robust input values.

● Research other machine learning techniques used for data generation such as AutoEncoders.

● Increased computer resources, to allow for the number of epochs to be raised without greatly increasing time required to train to increase quality of synthetic data.

● Depth perception could be added to allow from single images to be converted blueprints with size approximations. With further research, blueprints containing depth information could be utilized in augmented and virtual reality simulations.

An example of such research could be to generate an augmented reality car from

a synthetic blueprint, to aid in the design or reparation process[36].

(31)

● A convolutional neural network(CNN) could be trained to detect objects in

blueprint images. This would allow for an in-depth comparison of training

results, depending on the origination of the dataset. Datasets could be divided

into three categories: genuine, synthetic and augmented. This is known as

inception analysis[1]. Because the Pix2Pix neural network is built using

Convolutional neural networks, it outputs synthetic images. Those images can be

used to train a separate convolutional neural network, for example object

detection. This new CNN model would then be tested vs a CNN model trained on

authenticate and augmented datasets, afterwhich a analysis of the results would

be conducted.

(32)

8 References

[1] Isola P, Zhu J-Y, Zhou T, Efros AA. Image-to-Image Translation with Conditional Adversarial Networks [Internet]. arXiv.org. 2018 [cited 2020 04 30]. Available from:

https://arxiv.org/abs/1611.07004v3

[2] Kohli MD, Summers RM, Geis JR. Medical Image Data and Datasets in the Era of Machine Learning-Whitepaper from the 2016 C-MIMI Meeting Dataset Session [Internet]. Journal of digital imaging. Springer International Publishing; 2017 [cited 2020 05 12]. Available from :

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5537092/?tool=pmcentrez

[3] Linjordet T, Balog K. Impact of Training Dataset Size on Neural Answer Selection Models [Internet]. arXiv.org. 2019 [cited 2020 05 06]. Available from:

https://arxiv.org/abs/1901.10496

[4] Wilkinson MD, Dumontier M, Aalbersberg IJJ, Appleton G, Axton M, Baak A, et al.

The FAIR Guiding Principles for scientific data management and stewardship [Internet].

Nature News. Nature Publishing Group; 2016 [cited 2020 05 12]. Available from:

https://www.nature.com/articles/sdata201618

[5] Zhao H, Li H, Maurer-Stroh S, Cheng L. Synthesizing retinal and neuronal images with generative adversarial nets [Internet]. Medical Image Analysis. Elsevier; 2018 [cited 2020 02 25]. Available from:

https://www.sciencedirect.com/science/article/pii/S1361841518304596?via=ihub [6] Kim J, Kumar A, Feng D, Fulham M. Synthesis of Positron Emission Tomography (PET) Images via Multi-channel Generative Adversarial Networks (GANs) [Internet].

SpringerLink. Springer, Cham; 2017 [cited 2020 02 26]. Available from:

https://link.springer.com/chapter/10.1007/978-3-319-67564-0_5

(33)

[7] M. Frid-Adar, E. Klang, M. Amitai, J. Goldberger and H. Greenspan, "Synthetic data augmentation using GAN for improved liver lesion classification," 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018), Washington, DC, 2018, pp. 289-293.

[8] Kaloskampis I, Pugh D, Joshi C, Nolan L. Synthetic data for public good [Internet].

Data Science Campus. 2019 [cited 2020 02 22]. Available from:

https://datasciencecampus.ons.gov.uk/projects/synthetic-data-for-public-good/

[9] Shafaf N, Malek H. Applications of Machine Learning Approaches in Emergency Medicine; a Review Article [Internet]. Archives of academic emergency medicine.

Shahid Beheshti University of Medical Sciences; 2019 [cited 2020 05 04]. Available from: ​ https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6732202/

[10] UC Berkeley Pix2Pix Datasets [Internet]. Index of /Pix2Pix. [cited 2020 05 02].

Available from: http://efrosgans.eecs.berkeley.edu/Pix2Pix/

[11] About Towards Data Science [Internet]. Towards Data Science. [cited 2020 05 02].

Available from: https://towardsdatascience.com/about

[12] A. L. Samuel. "Some Studies in Machine Learning Using the Game of Checkers" in IBM Journal of Research and Development, vol. 3, no. 3. 1959 Julyp.210-229.

[13] Goodfellow IJ, Pouget-Abadie J, Mirza M, Xu B, Warde-Farley D, Ozair S, et al.

Generative Adversarial Nets [Internet]. arxiv.org. 2014 [cited 2020 05 04]. Available from: https://arxiv.org/pdf/1406.2661.pdf

[14] Rocca J. Understanding Generative Adversarial Networks (GANs) [Internet].

Medium. Towards Data Science; 2019 [cited 2020 05 06]. Available from:

https://towardsdatascience.com/understanding-generative-adversarial-networks-gans-cd6 e4651a29

[15] Brownlee J. A Gentle Introduction to Generative Adversarial Networks (GANs) [Internet]. Machine Learning Mastery. 2019 [cited 2020 05 06]. Available from:

https://machinelearningmastery.com/what-are-generative-adversarial-networks-gans/

[16] Mirza M, Osindero S. Conditional Generative Adversarial Nets [Internet].

arXiv.org. 2014 [cited 2020 05 10]. Available from: ​ https://arxiv.org/abs/1411.1784

(34)

[17] Hinton GE, Salakhutdinov RR. Reducing the Dimensionality of Data with Neural Networks . Science [Internet]. 2006Jun1 [cited 2020 05 09]; Available from:

https://www.cs.toronto.edu/~hinton/science.pdf

[18] Ronneberger O, Fischer P, Brox T. U-Net: Convolutional Networks for Biomedical Image Segmentation [Internet]. arXiv.org. 2015 [cited 2020 05 10]. Available from:

https://arxiv.org/abs/1505.04597

[19] Chaillou S. AI Architecture: Towards a New Approach [Internet]. Harvard University. 2019 [cited 2020 05 02]. Available from:

https://www.academia.edu/39599650/AI_Architecture_Towards_a_New_Approach [20] Peters N, Witt A, Enabling Alternative Architectures : Collaborative Frameworks for Participatory Design[master’s thesis]. Cambridge Massachusetts, United States:

Harvard University Graduate School of Design; 2018

[21] What we do [Internet]. Office for National Statistics. [cited 2020 05 13]. Available from: ​ https://www.ons.gov.uk/aboutus/whatwedo

[22] Isola P. Image-to-Image Translation with Conditional Adversarial Networks [Internet]. Image-to-Image Translation with Conditional Adversarial Networks. 2017 [cited 2020 05 06]. Available from: https://phillipi.github.io/Pix2Pix/

[23] Colaboratory [Internet]. Google. Google; [cited 2020 05 05]. Available from:

https://research.Google.com/colaboratory/faq.html

[24] Wang YE, Wei G-Y, Brooks D. Benchmarking TPU GPU, and CPU Platforms for Deep Learning [Internet]. arXiv.org. 2019 [cited 2020 05 04]. Available from:

https://arxiv.org/abs/1907.10701

[25] Zhu J-Y. Google Colaboratory [Internet]. Google. Google; [cited 2020 05 05].

Available from:

https://colab.research.Google.com/github/junyanz/pytorch-CycleGAN-and-Pix2Pix/blob /master/Pix2Pix.ipynb

[26] Google Forms: Free Online Surveys for Personal Use. Google; [cited 2020 05 10].

Available from: https://www.Google.com/forms/about/

(35)

[27] Karras T, Laine S, Aila T. A Style-Based Generator Architecture for Generative Adversarial Networks [Internet]. arXiv.org. 2019 [cited 2020 04 30]. Available from:

https://arxiv.org/abs/1812.04948

[28] Emami H, Dong M, Nejad -Davarani SP, Glide-Hurst CK. Generating synthetic CTs from magnetic resonance images using generative adversarial networks [Internet].

American Association of Physicists in Medicine (AAPM). John Wiley & Sons, Ltd;

2018 [cited 2020 05 10].

Available from: https://aapm.onlinelibrary.wiley.com/doi/abs/10.1002/mp.13047

[29] Corbett-Davies S, Goel S. The Measure and Mismeasure of Fairness: A Critical Review of Fair Machine Learning [Internet]. arXiv.org. 2018 [cited 2020 05 10].

Available from: https://arxiv.org/abs/1808.00023

[30] Fussell L, Moews B. Forging new worlds: high-resolution synthetic galaxies with chained generative adversarial networks [Internet]. OUP Academic. Oxford University Press; 2019 [cited 2020 05 10]. Available from:

https://academic.oup.com/mnras/article-abstract/485/3/3203/5368366?redirectedFrom=f ulltext

[31] Wang Z, Bovik AC. Mean Squared Error: Love it or Leave it. IEEE Signal Processing Magazine [Internet]. 2009Jan [cited 2020 05 10];:98–117. Available from:

IEEE Signal Processing Magazine

[32] ​Janocha K, Czarnecki WM. On Loss Functions for Deep Neural Networks in Classification [Internet]. arXiv.org. 2017 [cited 2020 05 05]. Available from:

https://arxiv.org/abs/1702.05659

[33] Zhang R, Isola P, Efros AA. Colorful Image Colorization [Internet]. arXiv.org.

2016 [cited 2020 05 10]. Available from: ​ https://arxiv.org/abs/1603.08511

[34] Korshunov P, Marcel S. DeepFakes: A New Threat to Face Recognition?

Assessment and Detection [Internet]. arXiv.org. 2018 [cited 2020 02 02]. Available

from: https://arxiv.org/abs/1812.08685

(36)

[35] Suresh H, Guttag JV. A Framework for Understanding Unintended Consequences of Machine Learning [Internet]. arXiv.org. 2020 [cited 2020 05 10]. Available from:

https://arxiv.org/abs/1901.10002

[36] Jetter J, Eimecke J, Rese A. Augmented reality tools for industrial applications:

What are potential key performance indicators and who benefits? [Internet]. Computers in Human Behavior. Pergamon; 2018 [cited 2020 05 10]. Available from:

https://www.sciencedirect.com/science/article/pii/S074756321830222X?via=ihub [37] Visdom [Internet]. Facebook Research. [cited 2020 05 10]. Available from:

https://www.cs.toronto.edu/~hinton/science.pdfhttps://research.fb.com/downloads/visdo m/

[38] Visualization with Python¶ [Internet]. Matplotlib. [cited 2020 05 10]. Available from: https://matplotlib.org/

(37)

Appendix

1. Process.py Code Snippets

Resize function

Combine function

(38)

2. Command line snippet for splitting images

ls -1 *.jpg | sed 's,.*,& &,' | xargs -n 2 convert -crop 50%x100% +repage

3. Pix2Pix datasets samples from the original paper.

(39)

4. Pix2Pix maps dataset:

The original maps data set can be found at the following repository:

http://efrosgans.eecs.berkeley.edu/Pix2Pix/datasets/

Maps dataset processing overview for us in Pix2Pix algorithm:

4.1 Origin

4.2 Converted to blueprint

4.3 Split images

4.4 Combined, finalized image.

(40)

5. Training Options

(41)

6. Testing options

(42)

7. ArchiGAN model 2 and 3 outputs

This image displays the output of the second archiGAN model

This image displaces the output of the third archiGAN model

(43)

8. Generator loss information and graph

The following loss graph helps to visualize the learning of the generative networking in the Pix2Pix algorithm used for this research. Loss, in the case of CNN’s and Pix2Pix, refers to the learning of the ” mapping from input image to output image”[1]. The CNN works to minimize this loss function and it is often equated with the accuracy of the results. Loss can be misleading though when discussing data generation using generative adversarial networks. This is because the loss function represents the mapping between the two images, but does not properly represent the desired loss metric, more information on this can be found in the original Pix2Pix paper[1].

Loss can be viewed in Figure 22 graphed against the epoch count in ascending order.

The X axis, which is epoch count, has been scaled by the following formula:

axisX = epoch + (iterations/800)

The reason for this is to allow for better visualization of the loss graph. This formula is

adapted from code provided in the Pix2Pix Colabratory notebook. Because the notebook

was set up to utilize Visdom[37], which is Facebook’s Visualization tool, the researchers

elected to process and graph the training details programmatically with python and

matplotlib[38]. This python file can be found in the appendix.

(44)

Figure 22: Shows the change in loss over epoch count.

(45)

9. Plot.py Code snippet

(46)

10. Answer key to the survey

Is considered correct if the participant chooses the genuine image, the are as follows:

11. Link to the github Pix2Pix repository

Pix2Pix: The source code for Pix2Pix implementation can be found at Jun-Yan Zhu’s

GitHub repository: ​ https://github.com/junyanz/pytorch-CycleGAN-and-Pix2Pix

References

Related documents

Even though the size of the pre-built vocabulary of the summary-generation model is far less than the size in the sentence-generation model using the similar structure in paper

data augmentation, generative adversarial networks, GAN, image classification, transfer learning, image generator, generating training data, machine learning... Effekten

The value sweep pruning algorithm was implemented once and different functions were given for defining the forbidden regions associated to the 3 previous arc- constraints. 6

Detta resultat ger även stöd för den första formulerade hypotesen, att ökad klassisk socioekonomisk modernisering, genom industrialisering, urbanisering, utbildningsnivå

Vidare belyses hur personal inom hos- picevård beskriver hur det är att i arbetet möta människors lidande under lång tid, samt hur det är att vårda patienter med

For instance, we can run multiple meshes (standard rendering) and volumes (volume raycasting) where we store the fragment data in our A-buffer instead of rendering them directly

Tidsbristen kan vara en viktig faktor, både avseende handledarens möjlighet att tillgodogöra sig information inför handledning, samt att kunna ge studenten det utrymme denne

Att effektiviteten i enkätdesignen inte har kunnat undersökas, eller att alla rekommendationer från [20] inte implementerats eller tagits hänsyn till, är förstås