The README to the Image Classifying Project
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
This Git Repo containes an Image Classifying Project which can classify images from 10 different classes with an accuracy of over 98.8%.
This project includes a classifier built on RESNET50 and a classifier, built from scratch, which classifies images with an accuracy of over 76%
The retrained ResNet50 features data augmentation techniques, and condenses the layers at the end to the number of classes it is trained for. The training first is in bigger steps and then for fine tuning the learning rate is 1/10 of the original learning rate. It then also begins tuning the top 100 layers of the ResNet50.
The custom Neural network uses a series of data augmentation techniques, pooling layers, 2 Convolution Layers and condenses the model at the end to the number of classes. It also features multiple Dropouts between the layers to prevent overfitting.
Here, list all libraries, packages and other dependencies that need to be installed to run your project. Include library versions and how they should be installed if a special requirement is needed.
For example, this is how you would list them:
- Numpy 1.21.4
conda install -c conda-forge numpy
- Tensorflow 2.6.0
conda install -c conda-forge tensorflow
- Matplotlib 3.5.0
conda install -c conda-forge matplotlib
- Clone the repo
git clone https://github.com/Fundamentals-of-Machine-Learning-F21/final-project---code-report-uf-europe
Included in the Notebook are 2 functions, which create image classifier models:
-
build_retrained_model
With following parameters used:
batch_size = 32 img_height = 224 img_width = 224 data_dir = 'KerasPrep' validation_split = 0.2 random_rotation = 0.35 random_zoom = 0.35 dropout = 0.24 epochs=10 base_learning_rate = 0.0001
-
build_custom_model
With following parameters used:
batch_size = 32 img_height = 300 img_width = 300 data_dir = 'KerasPrep' validation_split = 0.2 random_rotation = 0.35 random_zoom = 0.35 dropout = 0.3 dropout2 = 0.31 start_neurons = 128 number_of_layers = 2 batch_normalization = False epochs=230
Also included in the notebook are cells, which are an example for how to use the model for precidicting the class.
img_array = tf.keras.utils.img_to_array(img)
img_array = tf.expand_dims(img_array, 0) # Create a batch
predictions = model.predict(img_array)
score = tf.nn.softmax(predictions[0])
print(
"This image most likely belongs to {} with a {:.2f} percent confidence."
.format(class_labels[np.argmax(score)], 100 * np.max(score))
)
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Michael Baumgärtner - @space_mib - [email protected]
Github Link: https://github.com/Granluke
Ignacio Gómez - [email protected]
Hugo Chapado - [email protected]
Gonzalo Prats - [email protected]
You can acknowledge any individual, group, institution or service.