This project contains:
- A dataset consisting of images of Kirmizi and Siirt Pistachios
- A logistic regression based neural network
PYstachio is a machine learning classification model designed to distinguish pistachio species to aid our farmers in classifying their crops. The model uses a logistic regression based neural network to clasify two pistachio species based on their shape, color, and morphological features.
Fetches the feature extracted data from an arff file and puts it into a Pandas dataframe.
Prepares the dataset for use in the neural network. First we separate the features from the class (the result), we then hot encode our targets, split the data into a test and a train set and lastly we scale the data using StandardScaler function from scikitlearn.
Here we describe the model we want to use, in our case a logistic regression based neural network. We define parameters here such as the amount of hidden layers and their amount of nodes, our activation function, our initial learning rate and etc.
This block cross-validates our data through Stratified K-fold cross-validation with our K being 5. It prints our model's accuracy, recall, precision and f1 scores.
This block uses the test data in order to get our model's predictions on new data it has not seen yet. It also prints recall, precision and f1 scores.
Better formatted and more detailed version of test results.
A confusion matrix of the model's predicted class and their actual class.
Classification Report:
Confusion Matrix:
-
OZKAN IA., KOKLU M. and SARACOGLU R. (2021). Classification of Pistachio Species Using Improved K-NN Classifier. Progress in Nutrition, Vol. 23, N. 2, pp. DOI:10.23751/pn.v23i2.9686. (Open Access) https://www.mattioli1885journals.com/index.php/progressinnutrition/article/view/9686/9178
-
SINGH D, TASPINAR YS, KURSUN R, CINAR I, KOKLU M, OZKAN IA, LEE H-N., (2022). Classification and Analysis of Pistachio Species with Pre-Trained Deep Learning Models, Electronics, 11 (7), 981. https://doi.org/10.3390/electronics11070981. (Open Access)