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
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
This is a custom Convolutional Neural Network (CNN) model trained on the CIFAR-10 dataset. The model classifies images into 10 categories: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, and truck. It was trained using the PyTorch framework.
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
\## Model Overview
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
\- Type: Convolutional Neural Network (CNN)
|
| 16 |
+
|
| 17 |
+
\- Architecture:
|
| 18 |
+
|
| 19 |
+
- 2 convolutional layers
|
| 20 |
+
|
| 21 |
+
- 2 max-pooling layers
|
| 22 |
+
|
| 23 |
+
- 2 fully connected layers
|
| 24 |
+
|
| 25 |
+
- ReLU activation functions
|
| 26 |
+
|
| 27 |
+
\- Dataset: CIFAR-10 (10 classes)
|
| 28 |
+
|
| 29 |
+
\- Test Accuracy: 69.90%
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
\## How the Model Works
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
The model uses two convolutional layers followed by max-pooling and fully connected layers to classify images. The model was trained for 5 epochs on the CIFAR-10 dataset.
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
\## How to Use the Model
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
To use this model for image classification, you can use the following code snippet:
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
|
| 51 |
+
from transformers import pipeline
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
\# Load the trained model
|
| 56 |
+
|
| 57 |
+
classifier = pipeline('image-classification', model='Udayan012/tiny-cnn-classifier')
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
\# Provide an image to classify
|
| 62 |
+
|
| 63 |
+
image = 'path\_to\_your\_image.jpg'
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
\# Get the classification result
|
| 68 |
+
|
| 69 |
+
result = classifier(image)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
\# Print the result
|
| 74 |
+
|
| 75 |
+
print(result)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
Steps to classify your own images:
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
Install necessary libraries:
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
pip install transformers torch torchvision
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
Use the pipeline() function to load the model and classify images.
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
Training Information
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
Dataset: CIFAR-10
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
Optimizer: Adam
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
Loss Function: Cross-Entropy Loss
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
Training Epochs: 5
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
Batch Size: 32
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
Learning Rate: 0.001
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
Model Limitations
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
The model is trained on the CIFAR-10 dataset and performs well on images similar to the CIFAR-10 test set.
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
The model may not generalize well to high-resolution images or images with complex backgrounds.
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
It performs best on 32x32 pixel images with simple backgrounds, similar to those in the CIFAR-10 dataset.
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
License
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
This model is released under the Apache 2.0 License. You can freely use, modify, and distribute this model.
|
| 146 |
+
|