Neatherblok commited on
Commit
f6e04d5
·
verified ·
1 Parent(s): 26d9a8d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +120 -112
README.md CHANGED
@@ -1,112 +1,120 @@
1
- ---
2
- license: apache-2.0
3
- ---
4
-
5
- # Snowy-VGG
6
-
7
- ## Overview
8
- **Snowy-VGG** is a convolutional neural network (CNN) built on the VGG-19 architecture, designed to classify snowy and snow-free pavements. This model aims to enhance pedestrian safety during winter and forms part of the research published in the paper "Image Classification for Snow Detection to Improve Pedestrian Safety," presented at the Midwest Association for Information Systems (MWAIS) Conference in May 2024 ([Read the paper](https://aisel.aisnet.org/mwais2024/15/)).
9
-
10
- Snowy-VGG leverages transfer learning to fine-tune the VGG-19 model for snow classification, addressing the challenges of limited datasets and light reflection properties.
11
-
12
- ---
13
-
14
- ## Features
15
- - **Pretrained Architecture**: Built on VGG-19, pretrained on ImageNet.
16
- - **Transfer Learning**: Fine-tuned for snow classification using a custom dataset.
17
- - **Ensemble Capability**: Combines with ResNet-50 in the research to improve accuracy and F1 scores.
18
- - **Custom Dataset**: Trained and validated on a dataset of 98 images of pavements captured via smartphone.
19
- - **Optimized for Accuracy**: Designed to handle challenging classification scenarios with limited data.
20
-
21
- ---
22
-
23
- ## Dataset
24
- The dataset used for training consists of:
25
- - **98 Images**: Captured in Minnesota, USA, using a Google Pixel 6a smartphone.
26
- - **Resolution**: 3024 x 3024 pixels, resized to 128 x 128 for training.
27
- - **Labels**: Balanced categories of snow and no-snow images.
28
- - **Test Set**: Includes 22 unseen images from distinct locations to evaluate generalization.
29
-
30
- The dataset is also available at [Neatherblok/Snowy_Sidewalk_Detection](https://huggingface.co/datasets/Neatherblok/Snowy_Sidewalk_Detection).
31
-
32
- ---
33
-
34
- ## Implementation
35
- - **Framework**: PyTorch
36
- - **Training**:
37
- - Optimizer: Adam
38
- - Learning Rate: 0.0001
39
- - Batch Size: 4
40
- - Epochs: 15-25 (best results at epoch 15)
41
- - Normalization: Based on ImageNet mean ([0.485, 0.456, 0.406]) and standard deviation ([0.229, 0.224, 0.225]).
42
- - **Evaluation Metrics**:
43
- - Accuracy: 72.7% (ensemble)
44
- - F1 Score: 71.8% (ensemble)
45
-
46
- ---
47
-
48
- ## Usage
49
- To use Snowy-VGG for snow detection, follow these steps:
50
-
51
- 1. **Installation**:
52
- - Install PyTorch and dependencies: `pip install torch torchvision`
53
-
54
- 2. **Load the Model**:
55
- ```python
56
- import torch
57
- from torchvision import models
58
-
59
- model = models.vgg19(pretrained=True)
60
- # Modify the classification layer for binary output (snow vs no-snow)
61
- model.classifier[-1] = torch.nn.Linear(model.classifier[-1].in_features, 2)
62
- model.load_state_dict(torch.load('Best_Model_VGG19.pt'))
63
- model.eval()
64
- ```
65
-
66
- 3. **Inference**:
67
- - Preprocess the input image to 128x128 pixels.
68
- - Normalize using ImageNet statistics.
69
- - Pass the image through the model for predictions:
70
- ```python
71
- with torch.no_grad():
72
- output = model(image_tensor)
73
- prediction = torch.argmax(output, dim=1)
74
- print("Snow detected" if prediction.item() == 1 else "No snow detected")
75
- ```
76
-
77
- ---
78
-
79
- ## Results
80
- - **Performance**:
81
- - Ensemble of Snowy-VGG and ResNet-50 achieves an F1 Score of 71.8% and an accuracy of 72.7% on unseen test data.
82
- - Focuses on reducing false negatives to enhance pedestrian safety.
83
-
84
- ---
85
-
86
- ## Limitations
87
- - Limited Dataset: Only 98 images for training, which may affect generalization.
88
- - Light Reflection Sensitivity: Difficulty in detecting subtle changes in light wave reflections on snow.
89
- - False Negatives: High-risk misclassification when snow is not detected.
90
-
91
- ---
92
-
93
- ## Future Directions
94
- - **Dataset Expansion**: Include more diverse images from different locations, lighting conditions, and camera types.
95
- - **Model Enhancements**: Incorporate custom layers to better handle light reflection variations.
96
- - **Real-Time Applications**: Adapt Snowy-VGG for mobile deployment to provide real-time alerts for pedestrians.
97
-
98
- ---
99
-
100
- ## Citation
101
- If you use Snowy-VGG in your work, please cite the following paper:
102
-
103
- > Ricardo de Deijn and Rajeev Bukralia, "Image Classification for Snow Detection to Improve Pedestrian Safety," Midwest Association for Information Systems (MWAIS) 2024. [Link to Paper](https://aisel.aisnet.org/mwais2024/15/)
104
-
105
- ---
106
-
107
- ## Acknowledgments
108
- Snowy-VGG was developed as part of a collaborative effort at Minnesota State University, Mankato, with guidance from Dr. Rajeev Bukralia.
109
-
110
- For questions or inquiries, please contact:
111
- - **Ricardo de Deijn**: [email protected]
112
-
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - Neatherblok/Snowy_Sidewalk_Detection
5
+ base_model:
6
+ - keras-io/VGG19
7
+ pipeline_tag: image-classification
8
+ tags:
9
+ - SnowDetection
10
+ - Snow
11
+ - Sidewalk
12
+ ---
13
+
14
+ # Snowy-VGG
15
+
16
+ ## Overview
17
+ **Snowy-VGG** is a convolutional neural network (CNN) built on the VGG-19 architecture, designed to classify snowy and snow-free pavements. This model aims to enhance pedestrian safety during winter and forms part of the research published in the paper "Image Classification for Snow Detection to Improve Pedestrian Safety," presented at the Midwest Association for Information Systems (MWAIS) Conference in May 2024 ([Read the paper on Conference site](https://aisel.aisnet.org/mwais2024/15/) or [Arxiv](https://arxiv.org/abs/2407.00818)).
18
+
19
+ Snowy-VGG leverages transfer learning to fine-tune the VGG-19 model for snow classification, addressing the challenges of limited datasets and light reflection properties.
20
+
21
+ ---
22
+
23
+ ## Features
24
+ - **Pretrained Architecture**: Built on VGG-19, pretrained on ImageNet.
25
+ - **Transfer Learning**: Fine-tuned for snow classification using a custom dataset.
26
+ - **Ensemble Capability**: Combines with ResNet-50 in the research to improve accuracy and F1 scores.
27
+ - **Custom Dataset**: Trained and validated on a dataset of 98 images of pavements captured via smartphone.
28
+ - **Optimized for Accuracy**: Designed to handle challenging classification scenarios with limited data.
29
+
30
+ ---
31
+
32
+ ## Dataset
33
+ The dataset used for training consists of:
34
+ - **98 Images**: Captured in Minnesota, USA, using a Google Pixel 6a smartphone.
35
+ - **Resolution**: 3024 x 3024 pixels, resized to 128 x 128 for training.
36
+ - **Labels**: Balanced categories of snow and no-snow images.
37
+ - **Test Set**: Includes 22 unseen images from distinct locations to evaluate generalization.
38
+
39
+ The dataset is also available at [Neatherblok/Snowy_Sidewalk_Detection](https://huggingface.co/datasets/Neatherblok/Snowy_Sidewalk_Detection).
40
+
41
+ ---
42
+
43
+ ## Implementation
44
+ - **Framework**: PyTorch
45
+ - **Training**:
46
+ - Optimizer: Adam
47
+ - Learning Rate: 0.0001
48
+ - Batch Size: 4
49
+ - Epochs: 15-25 (best results at epoch 15)
50
+ - Normalization: Based on ImageNet mean ([0.485, 0.456, 0.406]) and standard deviation ([0.229, 0.224, 0.225]).
51
+ - **Evaluation Metrics**:
52
+ - Accuracy: 72.7% (ensemble)
53
+ - F1 Score: 71.8% (ensemble)
54
+
55
+ ---
56
+
57
+ ## Usage
58
+ To use Snowy-VGG for snow detection, follow these steps:
59
+
60
+ 1. **Installation**:
61
+ - Install PyTorch and dependencies: `pip install torch torchvision`
62
+
63
+ 2. **Load the Model**:
64
+ ```python
65
+ import torch
66
+ from torchvision import models
67
+
68
+ model = models.vgg19(pretrained=True)
69
+ # Modify the classification layer for binary output (snow vs no-snow)
70
+ model.classifier[-1] = torch.nn.Linear(model.classifier[-1].in_features, 2)
71
+ model.load_state_dict(torch.load('Best_Model_VGG19.pt'))
72
+ model.eval()
73
+ ```
74
+
75
+ 3. **Inference**:
76
+ - Preprocess the input image to 128x128 pixels.
77
+ - Normalize using ImageNet statistics.
78
+ - Pass the image through the model for predictions:
79
+ ```python
80
+ with torch.no_grad():
81
+ output = model(image_tensor)
82
+ prediction = torch.argmax(output, dim=1)
83
+ print("Snow detected" if prediction.item() == 1 else "No snow detected")
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Results
89
+ - **Performance**:
90
+ - Ensemble of Snowy-VGG and ResNet-50 achieves an F1 Score of 71.8% and an accuracy of 72.7% on unseen test data.
91
+ - Focuses on reducing false negatives to enhance pedestrian safety.
92
+
93
+ ---
94
+
95
+ ## Limitations
96
+ - Limited Dataset: Only 98 images for training, which may affect generalization.
97
+ - Light Reflection Sensitivity: Difficulty in detecting subtle changes in light wave reflections on snow.
98
+ - False Negatives: High-risk misclassification when snow is not detected.
99
+
100
+ ---
101
+
102
+ ## Future Directions
103
+ - **Dataset Expansion**: Include more diverse images from different locations, lighting conditions, and camera types.
104
+ - **Model Enhancements**: Incorporate custom layers to better handle light reflection variations.
105
+ - **Real-Time Applications**: Adapt Snowy-VGG for mobile deployment to provide real-time alerts for pedestrians.
106
+
107
+ ---
108
+
109
+ ## Citation
110
+ If you use Snowy-VGG in your work, please cite the following paper:
111
+
112
+ > Ricardo de Deijn and Rajeev Bukralia, "Image Classification for Snow Detection to Improve Pedestrian Safety," Midwest Association for Information Systems (MWAIS) 2024. [Link to Paper](https://aisel.aisnet.org/mwais2024/15/)
113
+
114
+ ---
115
+
116
+ ## Acknowledgments
117
+ Snowy-VGG was developed as part of a collaborative effort at Minnesota State University, Mankato, with guidance from Dr. Rajeev Bukralia.
118
+
119
+ For questions or inquiries, please contact:
120
+ - **Ricardo de Deijn**: [email protected]