Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Ivan Fuentes
UIN 425002273
jivfur@tamu.edu
April 2019
1 Introduction
Neural Networks appeared in the scene in 1943 with Warren McCulloch and Walter Pitts proposing a network
to simulate how to brain works, however, due to the computational power that this model required, they, the
neural networks, stayed in the cooler for a time. Currently, after over passing the computational problem
with modern supercomputers, Neural Networks appeared again stronger than ever. An artificial neural
network is a model inspired by the biological model of the brain; the synaptic dogma [1], is the dogma
of how we think the brain works, this is, the neurons, brain cells, connect to other neurons through their
dendrites and share electrical pulses to share “information” or knowledge, and that is how the brain learns.
An artificial
P neural, or perceptron, is a mathematical function, which takes a linear combination of inputs,
X = xi Wi , to obtain a predicted output, F (X). The perceptron has shown to be powerful enough for
some tasks, besides, as a colony of ants is capable of doing more than a single ant, a set of perceptrons can
achieve more than a single one. A drawback that I personally find in Neural Networks is the topology design,
What I meant for it is, tuning the hyperparameters of them, like number of layers, number of neuron in each
layer, number of epochs for training, batch size, momentum, among others. So far it looks like that neural
network experts’ task is to release network topologies for applications, like AlexNet that is used in ImageNet
Large Scale Visual Recognition Challenge (ILSVRC), or AlphaGo, a topology designed by Google researches
to play Go [3]. The Synaptics of the brain changes all the time, making the brain to adapt to new challenges
or to evolve with the environment. What if we can use evolution to find a neural network that best solves a
problem. In this project, I trained a Genetic Algorithm to evolve a chromosome of hyperparameters [4, 5]to
create neural networks for specific data sets.
2 Data Sets
I will use databases available in keras 2.2.4, like IMDB Movie reviews sentiment classification, Reuters
newswire topics classification, MNIST database of handwritten digits, Fashion-MNIST database of fashion
articles, Boston housing price regression dataset, CIFAR10 small image classification
Another Data set besides the one provided by keras will be: Parkinson’s Disease Classification Data Set.
The data used in this study were gathered from 188 patients with PD (107 men and 81 women) with ages
ranging from 33 to 87. The task is a classification task. [2]
3 Model
In this project I used a steady stated Genetic Algorithm. In a steady state GA, the concept of generations
is not clear defined, because instead of creating a whole new population in each time, the new offspring
replaces the worst individuals (the worst performance) in the population, in that sense, the population
remains constant during the whole evolutionary process.
1
Figure 1: Chromosome Definition
The rule in machine learning is, the model is as good as the fitness function. The validation accuracy
is used as fitness function. I tried to use the accuracy as a fitness function but I decided that validation
accuracy might provide more of the sense of the test, which the validation set is a unseen set for the model.
The chromosome includes any combination of the following neural network hyperparameters: Activation
Function, Epochs, Hidden Layers, Neurons, Learning Rate, Batch Size, Momentum, Dropout. The user can
select any combination of the hyperparamenters to evolve, allowing to set any default value in any of them.
The size of the population is also defined by the user as long as the mutation probability which must be
small. In figure 1 there is a example of how the population and chromosome are defined.
The selection process is done using the roulette algorithm. The roulette crossover, as the name suggests,
there is a roulette with all the individuals to be selected, however the probability of being selected is related
to its individual fitness, in this way the best individuals have higher chance to send their genes into the next
generations while the bad ones, have a small chance to reproduce, but if the odds are in their favor, the bad
ones could be selected too for crossover.
The crossover operator is a sexual reproduction, this is, it is necessary to have two individuals to create
two new ones. In this version, there are a random number of crossover points between the second and one
previous of the last genes.
The mutation operator is done by gene,i.e., each gene individually is checked to mutate or not. The
probability of mutation is set by the user and it has to be small in order to keep all the earned by evolution.
In this version of the project, the neural network topologies to evolve belongs to a Feed Forward model.
In Keras is defined as a sequential model with Dense Layers.
4 Instruction on how to test the trained DNN and how to use the
GUI
4.1 Install Dependencies
To use this project, you need to hace installed the following python 2.7 libraries:
• numpy
• Keras
• Tkinter
• Pandas
• TensorFlow
• GraphViz
• pydot
2
4.2 Graphical User Interface
4.2.1 Main
The first window to interact with in the software is shown in figure 2. It includes Four buttons with the task
to perform. The first button is to evolve the neural network, the second button is to test using a whole data
set, and the third button is to test with at most 10 elements, while the last one is to visualize a model
3
After filling all the values in the GUI, the button Run will be available to click. When the user is ready
to start the evolution process the system ask the project name, which is used to create a folder where the
user wants to save all the neural network population.
The system uses four types of files. The file .h5 is used to save the weights of the model. A json file
is used to save the topology recognized by keras. The .mod file is a defined for the system, which includes
information about how to test the model with the information required which is used in the testing routine.
The last file is the .gen file, this file save the individuals id and fitness per generation.
After the evolution does its job, the button Fitness Curve is enable. This functionality allows to see how
the fitness function behavior during the whole evolutionary process, i.e., the learning or adaptation curve.
This curve shows the population fitness through generations.
A learning curve is shown after clicking on the Fitness Curve Button, next to the Curve the best model
with its fitness is shown, allowing to open the two testing windows.
4
Figure 4: Fitness Curve
5 Future Work
The future of this project is related to the GUI and the adding more functions. For the GUI I plan to
add a menu to organize the different functions to make easier for the user. In relation to the functions, I
5
Figure 6: Frame for testing a small Data set
plan to add an automatic normalization process, to save the project with the parameters and to provide the
possibility to pause and restart it when needed. Although the system does not crash at this moment, I need
to create a way to catch all errors and show them to the user.
6 Supplementary Information
The project’s code is available in https://github.tamu.edu/jivfur/NeuroEvolution, and the dataset from
parkinson is available at https://archive.ics.uci.edu/ml/datasets/Parkinson%27s+Disease+Classification
A video demo from this GUI execution can be located at : https://youtu.be/ugJy1zUokKY
6
References
[1] Gul Muhammad Khan, Julian F. Miller, and David M. Halliday. Breaking the synaptic dogma: Evolving
a neuro-inspired developmental network. In Xiaodong Li, Michael Kirley, Mengjie Zhang, David Green,
Vic Ciesielski, Hussein Abbass, Zbigniew Michalewicz, Tim Hendtlass, Kalyanmoy Deb, Kay Chen Tan,
Jürgen Branke, and Yuhui Shi, editors, Simulated Evolution and Learning, pages 11–20, Berlin, Heidel-
berg, 2008. Springer Berlin Heidelberg.
[2] Serbes G. Gunduz A. Tunc H.C. Nizam H. Sakar B.E. Tutuncu M. Aydin T. Isenkul M.E. Sakar, C.O.
and H. Apaydin. A comparative analysis of speech signal processing algorithms for parkinson’s disease
classification and the use of the tunable q-factor wavelet transform. applied soft computing. https:
//archive.ics.uci.edu/ml/datasets/Parkinson%27s+Disease+Classification, 2018.
[3] Mohit Sewak, Md Rezaul Karim, and Pradeep Pujari. Practical Convolutional Neural Networks: Imple-
ment advanced deep learning models using Python. Packt Publishing Ltd, 2018.
[4] Kenneth O Stanley, Jeff Clune, Joel Lehman, and Risto Miikkulainen. Designing neural networks through
neuroevolution.
[5] Honglei Zhang, Serkan Kiranyaz, and Moncef Gabbouj. Finding better topologies for deep convolutional
neural networks by evolution. arXiv preprint arXiv:1809.03242, 2018.