WOW !! MUCH LOVE ! SO WORLD PEACE !
Fond bitcoin pour l'amélioration du site: 1memzGeKS7CB3ECNkzSn2qHwxU6NZoJ8o
  Dogecoin (tips/pourboires): DCLoo9Dd4qECqpMLurdgGnaoqbftj16Nvp


Home | Publier un mémoire | Une page au hasard

 > 

Image to image translation with generative adversiale networks (translation of satelite image to Google maps image )


par Abel Azize Souna and Ilyes Chaki
Université Hassiba ben Bouali de Chlef  - Licence informatique 2022
  

précédent sommaire

Bitcoin is a swarm of cyber hornets serving the goddess of wisdom, feeding on the fire of truth, exponentially growing ever smarter, faster, and stronger behind a wall of encrypted energy

4.5 Discriminator Implementation

Listing 4.4: encoder_block

1 def define_discriminator(image_shape):

2 init = RandomNormal(stddev=0.02)

3 in_src_image = Input(shape=image_shape)

4 in_target_image = Input(shape=image_shape)

5 merged = Concatenate()([in_src_image, in_target_image])

6 d = Conv2D(64, (4,4), strides=(2,2), padding='same', kernel_initializer=init)(

merged)

7 d = LeakyReLU(alpha=0.2)(d)

8 d = Conv2D(128, (4,4), strides=(2,2), padding='same', kernel_initializer=init)(d)

9 d = BatchNormalization()(d)

10 d = LeakyReLU(alpha=0.2)(d)

11 d = Conv2D(256, (4,4), strides=(2,2), padding='same', kernel_initializer=init)(d)

12 d = BatchNormalization()(d)

13 d = LeakyReLU(alpha=0.2)(d)

14 d = Conv2D(512, (4,4), strides=(2,2), padding='same', kernel_initializer=init)(d)

31

4.6 Pix2Pix Implementation

15 d = BatchNormalization()(d)

16 d = LeakyReLU(alpha=0.2)(d)

17 d = Conv2D(512, (4,4), padding='same', kernel_initializer=init)(d)

18 d = BatchNormalization()(d)

19 d = LeakyReLU(alpha=0.2)(d)

20 d = Conv2D(1, (4,4), padding='same', kernel_initializer=init)(d)

21 patch_out = Activation('sigmoid')(d)

22 model = Model([in_src_image, in_target_image], patch_out)

23 opt = Adam(lr=0.0002, beta_1=0.5)

24 model.compile(loss='binary_crossentropy', optimizer=opt, loss_weights=[0.5])

25 return model

4.6 Pix2Pix Implementation

Listing 4.5: decoder_block

1 def define_gan(g_model, d_model, image_shape):

2 d_model.trainable = False

3 in_src = Input(shape=image_shape)

4 gen_out = g_model(in_src)

5 dis_out = d_model([in_src, gen_out])

6 model = Model(in_src, [dis_out, gen_out])

7 opt = Adam(lr=0.0002, beta_1=0.5)

8 model.compile(loss=['binary_crossentropy', 'mae'], optimizer=opt, loss_weights

=[1,100])

9 return model

4.7 Model Training

Listing 4.6: decoder_block

1 def train(d_model, g_model, gan_model, dataset, n_epochs=10000, n_batch=1):

2 n_patch = d_model.output_shape[1]

3 trainA, trainB = dataset

4 for i in range(n_epochs):

5 [X_realA, X_realB], y_real = generate_real_samples(dataset, n_batch, n_patch)

6 X_fakeB, y_fake = generate_fake_samples(g_model, X_realA, n_patch)

7 d_loss1 = d_model.train_on_batch([X_realA, X_realB], y_real)

8 d_loss2 = d_model.train_on_batch([X_realA, X_fakeB], y_fake)

9 g_loss, _, _ = gan_model.train_on_batch(X_realA, [y_real, X_realB])

10

11 # summarize model performance

12 if (i+1) 'f, 1000 == 0:

13 print('>'f,d, d1['f,.3f] d2['f,.3f] g['f,.3f]' 'f, (i+1, d_loss1, d_loss2, g_loss))

32

4.8 Model Evaluation

14 summarize_performance(i, g_model, dataset)

4.8 Model Evaluation

for the evaluation we used the human perspective for it's both efficient and easy ,this method was proposed and used by Ian Goodfellow et al in the original paper Improved techniques for training gans [24] , there are other methods for the evaluation of the network performance ,one being the inception score that uses the inception network to classify the generated images.

4.9 Conclusion

Throughout this project we used the Pix2pix network to implement a translation from satellite images to map images , the first chapter was a introduction to artificial intelligence and machine learning then about deep learning ,then in the second chapter we advanced towards generative modeling and we talked about why it is such a useful architecture, in the same chapter we talked about GAN's and their superior performance in generative modeling ,in the third chapter we spoke on the pix2pix architecture in particular since it`'s the used architecture, in the last chapter we went through the implementation of the code. Since it's introduction by Ian Goodfellow ,generative adversarial networks held great promises ,this is totally understandable for the reason that it represent the creativity form of intelligence and a milestone in the quest of creating general intelligence. The model would generate better results given more training time and data ,so this project can be seen as a prototype and there is a room for improvement. The pix2pix model is also hard to implement cause of it's dataset obligations,the need for a couple of images from the original and the target domain can be realised to a certain degree in the satellite/ map application but is extremely hard for other style transfers,this can be improved using Cycle GAN . I would like this project to be viewed as an example of what GAN's can do ,and for it to serve as an inspiration for people wanting to take on this domain.

Bibliography

[1] Jason Brownlee. Generative adversarial networks with python: deep learning generative models for image synthesis and image translation. Machine Learning Mastery, 2019.

[2] data science central. artificial neural network. [Online; accessed January 9,2022 ]. 2019. uRL: https://www.datasciencecentral.com/the-artificial-neural-networks-handbook-part-1/.

[3] dataaspirant.com. reccurant neural network. [Online; accessed January 12,2022 ]. 2021. uRL: https : / / dataaspirant . com / how - recurrent - neural - network - rnn - works/.

[4] datascientest.com. tensorfiow. [Online; accessed march 14,2022 ]. 2020. uRL: https: // datascientest.com/tensorflow.

[5] e-techno-tutos.com. tkinter. [Online; accessed march 7,2022 ]. 2021. uRL: https:// www.e-techno-tutos.com/2020/12/28/raspberry-tkinter-pour-python/.

[6] David Foster. Generative deep learning: teaching machines to paint, write, compose, and play. O'Reilly Media, 2019.

[7] freecontent.manning.com. computer vison pipeline. [Online; accessed January 12,2022 ]. 2021. uRL: https://freecontent.manning.com/computer-vision-pipeline-part-1-the-big-picture/.

[8] Sunila Gollapudi. ?Deep Learning for Computer Vision? inapril 2019: pages 51-69. iSBN: 978-1-4842-4260-5. Doi: 10.1007/978-1-4842-4261-2_3.

[9] Phillip Isola andothers. ?Image-to-image translation with conditional adversarial networks? inProceedings of the IEEE conference on computer vision and pattern recognition: 2017, pages 1125-1134.

[10] JavaTpoint. What Is Machine Learning: Definition, Types, Applications And Examples. https : / / www . potentiaco . com/ what - is - machine - learning - definition - types-applications-and-examples/. 2021 (accessed march, 8, 2022).

[11] keras.io. keras. [Online; accessed march 14,2022 ]. 2019. uRL: https://keras.io/.

[12] Jakub Langr and Vladimir Bok. GANs in Action (Audiobook). Manning Publications, 2019.

34

BIBLIOGRAPHY

[13] machine learning mastery. A Gentle Introduction to Batch Normalization for Deep Neural Networks. https://machinelearningmastery.com/batch-normalization-for-training-of-deep-neural-networks/. 2019 (accessed January 16, 2022).

[14] medium.com. feed forward neural network. [Online; accessed January 10,2022 ]. 2021. URL: https://medium.com/mlearning-ai/training-feed-forward-neural-network-ffnn-on-gpu-beginners-guide-2d04254deca9.

[15] perso.esiee.fr. convolution. [Online; accessed January 12,2022 ]. 2021. URL: https: // perso.esiee.fr/~perretb/I5FM/TAI/convolution/index.html.

[16] Tutorials point. Artificial Intelligence - Robotics. https://www.tutorialspoint. com/artificial_intelligence/artificial_intelligence_robotics.htm#. 2022 (accessed June, 1, 2022).

[17] Alec Radford, Luke Metz and Soumith Chintala. ?Unsupervised representation learning with deep convolutional generative adversarial networks? inarXiv preprint arXiv:1511.06434: (2015).

[18] researchgate.net. artificial neuron. [Online; accessed January 8,2022 ]. 2019. URL: https: / / www . researchgate . net / figure / The - structure - of - the - artificial - neuron_fig2_328733599.

[19] researchgate.net. modular neural network. [Online; accessed January 11,2022 ]. 2021. URL: https : / / www . researchgate . net / figure / Modular - neural - network - structure_fig4_341628332.

[20] researchgate.net. radial basis neural network. [Online; accessed January 10,2022 ]. 2021. URL: https://www.researchgate.net/figure/Architecture- of- the- RBF-neural-network-RBF-radial-basis-function_fig2_333469185.

[21] researchgate.net. The general autoencoder architecture. [Online; accessed January 14,2022 ].2021.URL: https://www.researchgate.net/figure/The-general-autoencoder-architecture_fig2_328760180.

[22] researchgate.net. variational distribution. [Online; accessed January 14,2022 ]. 2020. URL: https://www.researchgate.net/figure/Variational-Bayes-approximate-posteriors - for - the - regression - model - parameters - and - four _ fig2 _ 227369415.

[23] Stuart J Russell. Artificial intelligence a modern approach. Pearson Education, Inc., 2010.

[24] Tim Salimans andothers. ?Improved techniques for training gans? inAdvances in neural information processing systems: 29 (2016).

[25] whichfaceisreal.com. fake faces using style gan. [Online; accessed february 14,2022 ]. 2019. URL: https://www.whichfaceisreal.com/methods.html.

[26] Wikipedia, the free encyclopedia. neuron. [Online; accessed January 7,2022 ]. 2021. URL: https://ar.wikipedia.org/wiki/%D9%85%D9%84%D9%81:Neuron.svg.

35

BIBLIOGRAPHY

[27] Wikipedia, the free encyclopedia. python. [Online; accessed march 14,2022 ]. 2019. URL: https://fr.m.wikipedia.org/wiki/Fichier:Python.svg.

précédent sommaire






Bitcoin is a swarm of cyber hornets serving the goddess of wisdom, feeding on the fire of truth, exponentially growing ever smarter, faster, and stronger behind a wall of encrypted energy








"Et il n'est rien de plus beau que l'instant qui précède le voyage, l'instant ou l'horizon de demain vient nous rendre visite et nous dire ses promesses"   Milan Kundera