This project uses Tensorflow + Keras machine learning inside a PostgreSQL database using PL/Python functions and procedures, specifically the plpython3u extension.
The key feature of the project is to run the neural network training, while the entire dataset for training and testing is located inside the PostgreSQL database tables. All the resulting models are also saved in a separate database table as a json file.
The project presents three different uses for neural networks: a MNIST dataset of handwritten digits, a Cats Vs Dogs dataset for classifying cats and dogs, and a wheat disease recognition neural network from digital images with noise based on Haralick texture features.
To create digital images, the original image was divided into 6 color components: R, G, B, RB, RG, GB and 4 Haralic parameters were counted for each. Obtained matrices of 6x4 dimension act as digital images of original images.
Haralick's features reflect the texture of the image by counting the Gray Level Co-occurence Matrix (GLCM). Digital images based on such parameters help to extend the dataset, have compact data, and use simpler neural network configurations.
The neural network is created, trained, and saved to the database using the functions from mldb_api.sql. The neural network consists of several convolutional and max-pooling layers and is completed with a flatten sweep and several dense layers with dropout, at the end 8 wheat disease classes are allocated.
MNIST dataset of handwritten images of digits was taken as an object of neural network training and tested on the created samples.
The Cats-vs-Dogs dataset was taken as the training object of the neural network and tested on the created samples.