This repository contains a convolutional neural network (CNN) model implemented using TensorFlow and Keras for classifying images of coins. The model is designed to classify images into one of seven classes, corresponding to different coin denominations: 1, 5, 10, 20, 50, 100, and 200.
The model architecture consists of two main parts: a CNN and a multi-layer perceptron (MLP). Here's an overview of the architecture:
- CNN Network: The CNN part of the model comprises several convolutional and pooling layers to extract features from input images.
- Convolutional Layer 1: 16 filters, 3x3 kernel size, ReLU activation, padding='same'
- Max Pooling Layer 1: 2x2 pool size
- Convolutional Layer 2: 32 filters, 3x3 kernel size, ReLU activation, padding='same'
- Max Pooling Layer 2: 2x2 pool size
- Convolutional Layer 3: 64 filters, 3x3 kernel size, ReLU activation, padding='same'
- Max Pooling Layer 3: 2x2 pool size
- Convolutional Layer 4: 128 filters, 3x3 kernel size, ReLU activation, padding='same'
- Max Pooling Layer 4: 2x2 pool size
- Convolutional Layer 5: 256 filters, 3x3 kernel size, ReLU activation, padding='same'
- Transition: Global average pooling layer to transition between CNN and MLP.
- MLP Network: The MLP part of the model consists of fully connected layers.
- Dense Layer: 256 neurons, ReLU activation
- Output Layer: 7 neurons for predicting 7 classes, softmax activation
You can use this model to classify images of coins into their respective denominations. Simply load the model and pass the image data to it for prediction.
# Example usage
from tensorflow.keras.models import load_model
import numpy as np
# Load the model
model = load_model('path_to_model')
# Example image data (replace with your own)
image_data = np.random.random((1, 256, 256, 3))
# Make predictions
predictions = model.predict(image_data)