Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,66 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# π§ Multi-Cancer Image Classification
|
| 6 |
+
|
| 7 |
+
This project aims to classify different types of cancer images using a **deep learning Convolutional Neural Network (CNN)**. The model is built with **TensorFlow/Keras**.
|
| 8 |
+
|
| 9 |
+
## π Project Structure
|
| 10 |
+
|
| 11 |
+
* Data preprocessing is done with `ImageDataGenerator` (normalization and train/validation split).
|
| 12 |
+
* The CNN model is created with **Conv2D**, **MaxPooling2D**, and **Dense** layers.
|
| 13 |
+
* After training, the model is saved as `.h5`.
|
| 14 |
+
* The function `gercek_deger()` allows testing predictions on a single image.
|
| 15 |
+
|
| 16 |
+
## βοΈ Dependencies
|
| 17 |
+
|
| 18 |
+
* **TensorFlow / Keras**
|
| 19 |
+
* **NumPy**
|
| 20 |
+
* **Matplotlib**
|
| 21 |
+
|
| 22 |
+
## π Model Architecture
|
| 23 |
+
|
| 24 |
+
1. **Conv2D + MaxPooling2D** β Feature extraction from images
|
| 25 |
+
2. **Conv2D + MaxPooling2D**
|
| 26 |
+
3. **Conv2D + MaxPooling2D**
|
| 27 |
+
4. **Flatten** β Convert data into a vector
|
| 28 |
+
5. **Dense (512, ReLU)** β Fully connected layer
|
| 29 |
+
6. **Dense (Softmax)** β Output layer with class probabilities
|
| 30 |
+
|
| 31 |
+
## ποΈ Training
|
| 32 |
+
|
| 33 |
+
* Input image size: **150x150**
|
| 34 |
+
* Batch size: **32**
|
| 35 |
+
* Optimizer: **Adam**
|
| 36 |
+
* Loss: **Categorical Crossentropy**
|
| 37 |
+
* Metrics: **Accuracy**
|
| 38 |
+
* Epochs: **10**
|
| 39 |
+
|
| 40 |
+
## π Usage
|
| 41 |
+
|
| 42 |
+
### Train the model
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
model.fit(train_generator, validation_data=validation_generator, epochs=10)
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
### Save the model
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
model.save("image_classifier.h5")
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
### Predict on a new image
|
| 55 |
+
|
| 56 |
+
```python
|
| 57 |
+
gercek_deger("test_image.jpg", model, train_generator.class_indices)
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
|