yolac commited on
Commit
d682b9a
·
verified ·
1 Parent(s): 3c46937

Delete ReadMe

Browse files
Files changed (1) hide show
  1. ReadMe +0 -116
ReadMe DELETED
@@ -1,116 +0,0 @@
1
- ---
2
- license: cc-by-4.0
3
- language:
4
- - en
5
- metrics:
6
- - accuracy
7
- - f1
8
- pipeline_tag: image-classification
9
- ---
10
-
11
- # Model Card for Bacterial Morphology Classification
12
-
13
- This model classifies bacterial images into three morphological categories: cocci, bacilli, and spirilla.
14
-
15
- ## Model Details
16
-
17
- ### Model Description
18
-
19
- It leverages the MobileNetV2 architecture as a base for feature extraction, followed by custom dense layers for classification. The model was fine-tuned on a dataset of bacterial images with images preprocessed to ensure compatibility.
20
-
21
- - **Developed by:** Yola Charara, University of Michigan-Flint, M.S Data Science-Student
22
- - **Model type:** Image classification (multi-class)
23
- - **Language(s) (NLP):** English
24
- - **License:** CC BY 4.0
25
- - **Finetuned from model:** MobileNetV2 (pre-trained on ImageNet)
26
-
27
- ## Uses
28
-
29
- ### Direct Use
30
-
31
- This model is suitable for classifying bacterial morphology into three categories based on visual features in microscopy images. It is intended for educational and research purposes.
32
-
33
- ### Out-of-Scope Use
34
-
35
- The model is not intended for clinical diagnosis or medical decision-making. Misuse includes applying it to unrelated image classification tasks or using it with non-bacterial images.
36
-
37
- ## Bias, Risks, and Limitations
38
-
39
- The model was trained and validated on a specific dataset of bacterial images, which may not represent all possible imaging conditions or bacterial morphologies. It may perform poorly on data outside its training distribution, such as images from different microscopes, lighting conditions, or bacterial species not represented in the dataset.
40
-
41
- ### Recommendations
42
-
43
- Users should test the model on other datasets to ensure generalizability and account for variations in bacterial imaging conditions. Misclassification risks should be acknowledged, especially in critical applications.
44
-
45
- ## How to Get Started with the Model
46
-
47
- Here is a sample code snippet to use the model:
48
-
49
- import tensorflow as tf
50
- from tensorflow.keras.utils import load_img, img_to_array
51
- import numpy as np
52
-
53
- # Load and preprocess an image
54
- img_path = 'path_to_image.jpg'
55
- img = load_img(img_path, target_size=(224, 224))
56
- img_array = img_to_array(img) / 255.0
57
- img_array = np.expand_dims(img_array, axis=0)
58
-
59
- # Predict with the model
60
- prediction = model.predict(img_array)
61
- predicted_class = prediction.argmax()
62
- print(f"Predicted class: {predicted_class}")
63
-
64
- ## Training Details
65
-
66
- ### Training Data
67
-
68
- The model was trained on the [BacterialMorphologyClassification Dataset] (https://huggingface.co/datasets/yolac/BacterialMorphologyClassification). The model was trained on a dataset of bacterial images with 360 training samples across three classes: cocci, bacilli, and spirilla. Images were preprocessed by resizing to 224x224 and normalized to pixel values between 0 and 1.
69
-
70
- ### Training Procedure
71
-
72
- Base Model: MobileNetV2 (frozen weights)
73
- Optimizer: Adam (learning rate: 0.0001)
74
- Loss Function: Categorical Crossentropy
75
- Metrics: Accuracy
76
- Regularization: Dropout layer with 50% dropout rate
77
- Early Stopping: Monitored validation loss with a patience of 3 epochs
78
-
79
- #### Preprocessing
80
-
81
- All images were resized to 224x224 and normalized by dividing pixel values by 255. Image augmentation was not applied during this training.
82
-
83
- #### Training Hyperparameters
84
-
85
- Epochs: Up to 50 (early stopping applied)
86
- Batch size: 32
87
- Dropout: 0.5 on dense layers
88
-
89
- ## Evaluation
90
-
91
- ### Testing Data, Factors & Metrics
92
-
93
- #### Testing Data
94
-
95
- The test dataset included unseen images with filenames provided in a separate file. Images were resized and normalized in the same way as training and validation data.
96
-
97
- #### Metrics
98
-
99
- Accuracy: 0.85
100
- F1 Score: 0.85
101
-
102
- ### Results
103
-
104
- The model achieved 0.85 accuracy and F1 score on the Codalab test set.
105
-
106
- #### Summary
107
-
108
- This bacterial morphology classification model effectively categorizes images into three classes: cocci, bacilli, and spirilla. Leveraging the MobileNetV2 architecture, the model achieves high performance with an accuracy and F1 score of 0.85 on the Codalab test set. It is efficient for educational and research purposes, though not suitable for diagnostic applications without further validation.
109
-
110
- ### Model Architecture and Objective
111
-
112
- The model uses the MobileNetV2 architecture with the top layers replaced for the classification task. The objective is to minimize categorical crossentropy loss for three classes.
113
-
114
- ## Model Card Contact
115
-
116
- email: yolac@umich.edu