Spaces:
Running
Running
Upload 207 files
Browse files- README.md +0 -13
- safety_classifier_model.ipynb +5 -35
README.md
CHANGED
@@ -1,16 +1,3 @@
|
|
1 |
-
---
|
2 |
-
title: Towards a Safer Construction Environment
|
3 |
-
emoji: 🏆
|
4 |
-
colorFrom: yellow
|
5 |
-
colorTo: green
|
6 |
-
sdk: docker
|
7 |
-
sdk_version: '20.10'
|
8 |
-
app_file: safety_classifier.py
|
9 |
-
pinned: true
|
10 |
-
license: mit
|
11 |
-
short_description: workplace safety compliance in construction sites
|
12 |
-
---
|
13 |
-
|
14 |
# Towards a Safer Construction Environment: Evaluating a Simple CNN for Safety Classification
|
15 |
### By: Darius Vincent C. Ardales
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Towards a Safer Construction Environment: Evaluating a Simple CNN for Safety Classification
|
2 |
### By: Darius Vincent C. Ardales
|
3 |
|
safety_classifier_model.ipynb
CHANGED
@@ -4029,26 +4029,7 @@
|
|
4029 |
" - Weights in the second and third input channels (e.g., **Filter 3, Input Channel 1**) show varying intensities compared to the first channel. This demonstrates the model's adaptation to RGB data and its ability to differentiate between channels.\n",
|
4030 |
"\n",
|
4031 |
"5. **Potential Over-Sensitivity**:\n",
|
4032 |
-
" - Some filters, such as **Filter 10, Input Channel 2**, have highly negative values like `-0.1833`, `-0.1962`, and `-0.1772`. These might indicate over-sensitivity to certain patterns and could potentially lead to instability during inference
|
4033 |
-
"\n",
|
4034 |
-
"### Insights for Improvement\n",
|
4035 |
-
"1. **Regularization Techniques**:\n",
|
4036 |
-
" - Given the strong negative weights in certain filters, adding weight regularization (e.g., L2 regularization) might help balance learning and avoid over-sensitivity to specific features.\n",
|
4037 |
-
"\n",
|
4038 |
-
"2. **Weight Initialization**:\n",
|
4039 |
-
" - The variability among filters suggests the model is learning, but re-evaluating initialization strategies (e.g., Xavier or He initialization) could ensure better convergence.\n",
|
4040 |
-
"\n",
|
4041 |
-
"3. **Feature Visualization**:\n",
|
4042 |
-
" - Filters with extreme weight values (e.g., Filter 11, Input Channel 2) should be visualized to confirm they are detecting meaningful patterns and not just noise.\n",
|
4043 |
-
"\n",
|
4044 |
-
"### Supporting Evidence\n",
|
4045 |
-
"- **Range of Weights**:\n",
|
4046 |
-
" - Filter 1, Input Channel 0: `-0.1391` to `0.1372`\n",
|
4047 |
-
" - Filter 10, Input Channel 2: `-0.1962` to `0.1198`\n",
|
4048 |
-
"- **Symmetry**:\n",
|
4049 |
-
" - Filter 4, Input Channel 0: Weights are symmetric around zero, e.g., `[-0.1101, -0.0526, -0.0251, 0.0648]`.\n",
|
4050 |
-
"\n",
|
4051 |
-
"These observations demonstrate the diversity of learned spatial features in the first convolutional layer, reflecting the model's capability to extract meaningful patterns."
|
4052 |
]
|
4053 |
},
|
4054 |
{
|
@@ -4133,23 +4114,12 @@
|
|
4133 |
"## Insights from Convolutional Layer 2 Weights (Filters 0 and 1)\n",
|
4134 |
"\n",
|
4135 |
"### Key Observations\n",
|
4136 |
-
"1. **Wide Range of Values Across Channels**:\n",
|
4137 |
-
" - Filter 0, Input Channel 2: Values range from `-0.0608` to `0.0448`, indicating sensitivity to both positive and negative features in this channel.\n",
|
4138 |
-
" - Filter 1, Input Channel 6: Strong negative values dominate, such as `-0.0621` and `-0.0640`, suggesting a focus on detecting dark or low-intensity regions.\n",
|
4139 |
-
"\n",
|
4140 |
-
"2. **Specialization in Feature Extraction**:\n",
|
4141 |
-
" - Filter 0, Input Channel 3: Symmetrical weight distribution (e.g., `-0.0511`, `0.0120`, `0.0161`) may contribute to detecting uniform patterns or textures.\n",
|
4142 |
-
" - Filter 1, Input Channel 0: Strong variations (`-0.0610` to `0.0423`) imply the ability to capture edges and gradients effectively.\n",
|
4143 |
-
"\n",
|
4144 |
-
"3. **Potential Over-Sensitivity**:\n",
|
4145 |
-
" - Filter 1, Input Channel 11: Extreme negative values like `-0.0605` and `-0.0639` might indicate an over-sensitivity to specific patterns, which could require further regularization.\n",
|
4146 |
"\n",
|
4147 |
-
"
|
4148 |
-
"-
|
4149 |
-
"- **Filter 1, Input Channel 0**: Values range from `-0.0610` to `0.0423`.\n",
|
4150 |
-
"- **Filter 1, Input Channel 11**: Extreme values like `-0.0605`, `-0.0639`.\n",
|
4151 |
"\n",
|
4152 |
-
"
|
|
|
4153 |
]
|
4154 |
},
|
4155 |
{
|
|
|
4029 |
" - Weights in the second and third input channels (e.g., **Filter 3, Input Channel 1**) show varying intensities compared to the first channel. This demonstrates the model's adaptation to RGB data and its ability to differentiate between channels.\n",
|
4030 |
"\n",
|
4031 |
"5. **Potential Over-Sensitivity**:\n",
|
4032 |
+
" - Some filters, such as **Filter 10, Input Channel 2**, have highly negative values like `-0.1833`, `-0.1962`, and `-0.1772`. These might indicate over-sensitivity to certain patterns and could potentially lead to instability during inference."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4033 |
]
|
4034 |
},
|
4035 |
{
|
|
|
4114 |
"## Insights from Convolutional Layer 2 Weights (Filters 0 and 1)\n",
|
4115 |
"\n",
|
4116 |
"### Key Observations\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4117 |
"\n",
|
4118 |
+
"1. **Intensity-Based Filters**:\n",
|
4119 |
+
" - Filter 0, Input Channel 8 and Filter 1, Input Channel 6 exhibit predominantly negative weights, indicating an emphasis on detecting dark or low-intensity regions. Such focus may assist in identifying shadowed or less illuminated patterns in construction site images\n",
|
|
|
|
|
4120 |
"\n",
|
4121 |
+
"2. **Filter Collaboration in Edge Detection**:\n",
|
4122 |
+
" - Filter 0, Input Channel 3 (-0.0511, 0.0138, 0.0161) and Filter 1, Input Channel 3 (-0.0329, 0.0102, 0.0183) both display symmetry in weights, focusing on uniform patterns and edge structures. These filters likely work in tandem to detect edges at various scales or orientations."
|
4123 |
]
|
4124 |
},
|
4125 |
{
|