/FeatureReductionGenetic

Feature reduction using genetic algorithm

Primary LanguagePython

Feature Reduction using Genetic Algorithm

This project uses the genetic algotithm (GA) optimization technique for selecting the best subset of features for classifying the Fruits360 dataset. This project is documented in a tutorial titled "Feature Reduction using Genetic Algorithm" available in my LinkedIn profile here: https://www.linkedin.com/pulse/feature-reduction-using-genetic-algorithm-ahmed-gad.

It is worth mentioning that this project it is an extension to a previously published 2 projects. Both of them are documented in a tutorial in my LinkedIn profile.

The first tutorial is titled "Artificial Neural Network Implementation using NumPy and Classification of the Fruits360 Image Dataset". It starts by extracting a feature vector of length 360 from 4 classes of the Fruits360 dataset. Then, it builds an artificial neural network (ANN) using NumPy from scratch in order to classify the dataset. It is available here https://www.linkedin.com/pulse/artificial-neural-network-implementation-using-numpy-fruits360-gad. Its GitHub project is available here: https://github.com/ahmedfgad/NumPyANN.

The second tutorial is titled "Artificial Neural Networks Optimization using Genetic Algorithm". It builds and uses the GA for optimizing the ANN parameters in order to increase the classification accuracy. It is available here https://www.linkedin.com/pulse/artificial-neural-networks-optimization-using-genetic-ahmed-gad. Its GitHub project is also available here: https://github.com/ahmedfgad/NeuralGenetic.

This project discusses how to use the genetic algorithm (GA) for reducing the feature vector extracted from the Fruits360 dataset of length 360. This tutorial starts by discussing the steps to be followed. After that, the steps are implemented in Python.

This project modifies my previous project that implements the GA which is available in my GitHub account here: https://github.com/ahmedfgad/GeneticAlgorithmPython. For more information about how GA is implemented, you can read my tutotial titled "Genetic Algorithm Implementation in Python" which is available in my LinkedIn profile here: https://www.linkedin.com/pulse/genetic-algorithm-implementation-python-ahmed-gad.

Project Structure

The GA implementation is organized in 2 Python files which are:

  1. Example_GeneticAlgorithm.py
  2. GA.py

The first file is the main file that initializes all parameters of the GA and goes through a the generations in which the subsets of featrures are returned by evolving the solutions. There are 2 supplementary files which are:

  1. dataset_features.pkl
  2. outputs.pkl

The first file holds the extracted features for the used samples which are to be reduced. The second file holds their class labels. You can find more details about how the project works in the tutorial that documents it.

More Information about GA

For more information about GA and its implementation, you can read my 2018 book cited as "Ahmed Fawzy Gad 'Practical Computer Vision Applications Using Deep Learning with CNNs'. Dec. 2018, Apress, 978-1-4842-4167-7". The book is available at Springer at this link: https://springer.com/us/book/9781484241660." You can also read my tutorials listed below:

For Contacting the Author