2024-04-23

## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.0     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

PROBLEM DESCRIPTION

  • Delving into the urgent task of swiftly detecting firearms in public spaces such as schools and hospitals, with an emphasis on grasping the intricate details and challenges to ensure precise and timely detection for bolstering safety measures.
  • Understanding the complexities involved in rapidly identifying firearms within public environments like schools and hospitals, highlighting the need for accurate and timely detection to enhance safety and security protocols effectively.

Logo

RECAP OF ORIGINAL DATA ANALYTICS PLAN

  • Data Collection: Utilize Flickr API for diverse image collection.
  • Data Preprocessing: Resize and normalize pixel values.
  • Custom CNN Architecture: Design custom CNN using Keras/TensorFlow.
    • Includes convolutional layers for feature extraction.
    • Dense layers for pattern learning and prediction.
    • Final layer with softmax activation.
  • Model Evaluation: Assess performance metrics like accuracy.

Logo

KEY PEER COMMENTS: PROPOSAL PRESENTATION FEEDBACK

  • Realism in Training Data - Practical Considerations and Real-world Scenarios
  • Scalability and Automation.
  • Validation and Testing: Prioritize rigorous validation and testing of models.

Logo

DATA SUMMARY AND EXPLORATION RESULTS

RAW DATA OVERVIEW

## Loading required package: EBImage
## 
## Attaching package: 'EBImage'
## The following object is masked from 'package:purrr':
## 
##     transpose
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter
## Warning in (function (..., no.readonly = FALSE) : "main" is not a graphical
## parameter
## Warning in par(user): "main" is not a graphical parameter

## Formal class 'Image' [package "EBImage"] with 2 slots
##   ..@ .Data    : num [1:500, 1:333, 1:3] 0.996 0.996 0.996 0.996 0.996 ...
##   ..@ colormode: int 2
##   ..$ dim: int [1:3] 500 333 3
## NULL
## [1] 500 333   3
## Model: "sequential_1"
## ________________________________________________________________________________
##  Layer (type)                       Output Shape                    Param #     
## ================================================================================
##  dense_5 (Dense)                    (None, 256)                     602368      
##  dense_4 (Dense)                    (None, 128)                     32896       
##  dense_3 (Dense)                    (None, 2)                       258         
## ================================================================================
## Total params: 635522 (2.42 MB)
## Trainable params: 635522 (2.42 MB)
## Non-trainable params: 0 (0.00 Byte)
## ________________________________________________________________________________

EXAMPLE

FINAL AI/ML PROCEDURES AND RESULTS OVERVIEW

## 4/4 - 0s - loss: 0.3573 - accuracy: 0.8113 - 232ms/epoch - 58ms/step
##      loss  accuracy 
## 0.3573050 0.8113208
## 4/4 - 0s - 102ms/epoch - 26ms/step
##   [1] 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 0 1 1 0 1 1 1 1 1 0 1 1 1
##  [38] 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
##  [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0
##          Actual
## Predicted  0  1
##         0 42 16
##         1  4 44
## 1/1 - 0s - loss: 0.6039 - accuracy: 0.5385 - 26ms/epoch - 26ms/step
##      loss  accuracy 
## 0.6039302 0.5384616

KEY FINDINGS AND TAKEAWAYS DISCUSSION

  • Public Safety Enhancement: Leveraging advanced technology, including deep learning algorithms and image processing techniques, this project aims to enhance public safety, particularly in firearm-vulnerable environments like schools and public spaces.
  • Data-driven Approach: Emphasizing data-driven decision-making, the project utilizes large-scale image datasets for model training and evaluation in security applications.
  • Real-world Impact: Focused on real-world application, the project aims to translate technological advancements into tangible benefits, promoting safer and more secure communities.