Neatherblok commited on
Commit
dabd9b1
·
verified ·
1 Parent(s): 98dfaad

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-ResNet
6
-
7
- ## Overview
8
- **Snowy-ResNet** is a convolutional neural network (CNN) designed for snow detection on pavements, aiming to enhance pedestrian safety during winter. This model is 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-ResNet builds on the ResNet-50 architecture, leveraging transfer learning to achieve accurate snow classification. It was developed to help reduce winter-related injuries, particularly among vulnerable groups like the elderly and visually impaired individuals.
11
-
12
- ---
13
-
14
- ## Features
15
- - **Pretrained Architecture**: Built on ResNet-50, pretrained on ImageNet.
16
- - **Transfer Learning**: Fine-tuned for snow classification using a custom dataset of pavement images.
17
- - **Ensemble Approach**: Combined with VGG-19 in the original research to achieve optimal accuracy and F1 scores.
18
- - **Custom Dataset**: Trained and validated on a dataset of 98 smartphone-captured images with a balanced distribution of snowy and snow-free pavements.
19
- - **Lightweight and Efficient**: Designed for computational efficiency to support real-time applications.
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%
44
- - F1 Score: 71.8%
45
-
46
- ---
47
-
48
- ## Usage
49
- To use Snowy-ResNet 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.resnet50(pretrained=True)
60
- # Modify the classification layer for binary output (snow vs no-snow)
61
- model.fc = torch.nn.Linear(model.fc.in_features, 2)
62
- model.load_state_dict(torch.load('Best_Model_ResNet50.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-ResNet and VGG-19 achieves an F1 Score of 71.8% and an accuracy of 72.7% on unseen test data.
82
- - Identifies snow with a focus on reducing false negatives, critical for 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 handle light reflection variations better.
96
- - **Real-Time Applications**: Adapt Snowy-ResNet for mobile deployment to provide real-time alerts for pedestrians.
97
-
98
- ---
99
-
100
- ## Citation
101
- If you use Snowy-ResNet 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-ResNet 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**: ricardodedeijn@gmail.com
112
-
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - Neatherblok/Snowy_Sidewalk_Detection
5
+ base_model:
6
+ - microsoft/resnet-50
7
+ pipeline_tag: image-classification
8
+ tags:
9
+ - SnowDetection
10
+ - Snow
11
+ - Sidewalk
12
+ ---
13
+
14
+ # Snowy-ResNet
15
+
16
+ ## Overview
17
+ **Snowy-ResNet** is a convolutional neural network (CNN) designed for snow detection on pavements, aiming to enhance pedestrian safety during winter. This model is 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 the Conference Site](https://aisel.aisnet.org/mwais2024/15/) or [arXiv](https://arxiv.org/abs/2407.00818)).
18
+
19
+ Snowy-ResNet builds on the ResNet-50 architecture, leveraging transfer learning to achieve accurate snow classification. It was developed to help reduce winter-related injuries, particularly among vulnerable groups like the elderly and visually impaired individuals.
20
+
21
+ ---
22
+
23
+ ## Features
24
+ - **Pretrained Architecture**: Built on ResNet-50, pretrained on ImageNet.
25
+ - **Transfer Learning**: Fine-tuned for snow classification using a custom dataset of pavement images.
26
+ - **Ensemble Approach**: Combined with VGG-19 in the original research to achieve optimal accuracy and F1 scores.
27
+ - **Custom Dataset**: Trained and validated on a dataset of 98 smartphone-captured images with a balanced distribution of snowy and snow-free pavements.
28
+ - **Lightweight and Efficient**: Designed for computational efficiency to support real-time applications.
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%
53
+ - F1 Score: 71.8%
54
+
55
+ ---
56
+
57
+ ## Usage
58
+ To use Snowy-ResNet 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.resnet50(pretrained=True)
69
+ # Modify the classification layer for binary output (snow vs no-snow)
70
+ model.fc = torch.nn.Linear(model.fc.in_features, 2)
71
+ model.load_state_dict(torch.load('Best_Model_ResNet50.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-ResNet and VGG-19 achieves an F1 Score of 71.8% and an accuracy of 72.7% on unseen test data.
91
+ - Identifies snow with a focus on reducing false negatives, critical for 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 handle light reflection variations better.
105
+ - **Real-Time Applications**: Adapt Snowy-ResNet for mobile deployment to provide real-time alerts for pedestrians.
106
+
107
+ ---
108
+
109
+ ## Citation
110
+ If you use Snowy-ResNet 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-ResNet 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**: ricardodedeijn@gmail.com