Open access peer-reviewed chapter

Ridesharing Passengers and Driver Safety Using Emotion Recognition and Weapons Detection Systems

Written By

Gary Leander and Ibidun Christiana Obagbuwa

Submitted: 10 October 2024 Reviewed: 02 December 2024 Published: 16 April 2025

DOI: 10.5772/intechopen.1008540

Chapter metrics overview

151 Chapter Downloads

View Full Metrics

Abstract

In this chapter, two Streamlit web apps are created to spot danger, that is, signs of distress from the passenger’s facial expressions using emotion recognition and detection of weapons brought into the vehicle using object detection. The system receives live footage where the emotions of passengers are detected and recognized, as well as detection of any handguns from the objects brought into the vehicle. Face detection was implemented using OpenCV. Three models, DeepFace, MobileNetV2, and Sequential Convolutional Neural Network (CNN), were compared to find a suitable model for facial emotion recognition. Sequential CNN achieved the highest accuracy of 61% of the three models. Handgun detection was implemented using YOLOv4, and an accuracy of 80% was achieved. An alarm is triggered upon detecting the fear expression or a handgun. This should help gather evidence and contribute to preventing unsafe ride-share trips in two ways. Firstly, since people will know they are being recorded, they will be less likely to commit such acts. Moreover, if such situations occur, the system can detect them.

Keywords

  • face recognition
  • emotion recognition
  • object detection
  • driver and passenger safety
  • weapon detection system

1. Introduction

With the proliferation of ridesharing platforms, such as Uber, Lyft, and Bolt, millions of people now rely on these services as their primary mode of transportation. While ridesharing provides unparalleled convenience, issues related to passenger and driver safety persist. Reports of violence and altercations within ridesharing vehicles have highlighted the need for enhanced safety mechanisms. This study proposes an integrated solution leveraging AI for emotion recognition and weapons detection within ridesharing vehicles, aiming to improve the safety of both passengers and drivers.

Emotion recognition technology leverages AI algorithms to analyze facial expressions, vocal tones, and other behavioural signals, interpreting emotions such as anger, fear, joy, and sadness. CNNs (convolutional neural networks) and RNNs (recurrent neural networks) are widely used for real-time emotion analysis, particularly in applications like customer service, mental health monitoring, and law enforcement.

Weapons detection systems use machine learning models to recognize weapons in images or video feeds, identifying firearms, knives, and other objects through techniques like YOLO (you only look once) and Faster R-CNN (region-based convolutional neural network). Although weapons detection has been implemented in high-security areas like airports and public buildings, it is less commonly seen in ridesharing contexts. However, combining weapons detection with emotion recognition could provide additional layers of security, especially in high-risk situations.

1.1 Review of related studies

This chapter implements image processing techniques to improve both driver and passenger safety of ride-share trips. Image processing for driver safety is a long-standing research domain and has seen outstanding results on lab-controlled data and real-life scenarios; this is the case presented by Xiao et al. [1]. Driver safety has been implemented using image processing by executing a drowsy driver detection, which detects when a driver might be drowsy and plays a song or alerts an alarm to wake the driver up, preventing accidents and promoting road safety. Other studies by Xiao et al. and Sukhavasi et al. [1, 2] have introduced emotion recognition to analyze the mood and mental state of the driver, have seen considerable results, and have allowed them to put measures in place to address drivers who are too tired or not emotionally ready to drive. However, extending these techniques to ensure passenger safety remains an underexplored domain; therefore, seeing the technology results and success, this study aims to introduce image processing for the driver and the passenger.

It is no secret that ride-share/pooling companies have encountered a surge in harassment complaints and instances of gender-based violence against passengers, as reported by Mlamla and Bonyhady [3, 4]. Not so long ago, in March 2022, Mlamla 2022 reports, a petition signed by over 90,000 people circulated requesting “Bolt to vet its drivers more efficiently” [3]. In November 2021, an article in The Sydney Morning Herald by Bonyhady 2021 reported over 6 months, Uber received over 500 sexual misconduct and assault complaints from passengers and drivers [4]. It is a concern that sadly happens across the globe, and more solutions (besides panic buttons) are needed.

Currently, Uber has launched the following safety measures, “Share My Trip,” “in-app Emergency Button,” “24/7 customer support,” “safety centre,” and checking “Driver Profile” before stepping into the car and taking the trip. These are all excellent features, but they come with some difficulties and may be challenging to use in a distressed situation. According to Mohan [5], 48 of 50 rides taken by the Indian Express did not have the panic button, or it simply did not work. In distressed situations, it can also be difficult for the passenger to press the emergency button, seeing that it is in the app, and the passenger could be threatened or held at gunpoint, leaving them helpless and unable to use the emergency button, same applies to the in-app safety centre and 24/7 customer support. Additionally, drivers are exposed to the risk of theft or attacks, as some drivers accept cash trips. With the public aware of this, theft is a great concern, and more measures should be put in place to combat this because drivers accumulate money throughout the day from cash trips.

Chaudhry et al. pointed out that the progress and growth of ridesharing companies could depend on the customer’s safety and security [6]. Security problems with ridesharing rides are not just in one town or country; these problems grow with the service’s popularity. To improve the security of these trips, Chaudhry et al. suggested the following solutions, “Dash Cam and Watchdog Network,” “Distress Alarm,” “Passenger Insurance,” and other “Miscellaneous” [6]. The suggested solution involves a dashcam that records the trip and makes the live footage accessible to a watchdog network and the passengers’ social media profiles to have more eyes on the trip. The distress alarm has recently been implemented in the form of panic buttons.

Facial Emotion Recognition (FER) consists of three steps: face detection, facial expression detection, and classifying the expression to an emotional state. Vemou and Horvath, state that FER takes static images and videos as inputs to analyze facial expressions [7]. Without a doubt, I am not the first to use FER, as FER is a growing technology used in various fields. FER has been used in healthcare, employment, education, and retail, analyzing customer behavior, to name a few.

Mehendale, presented a novel approach for FER, using “two-level” CNN, where the first level removes the background from the picture/video, and the second focuses on extracting the facial feature vectors [8]. However, as highlighted by Lim and Teo 2020, FER is not limited to image processing; eye-tracking can be used for the same purposes [9].

Weapon detection is a task that can be performed using various techniques and approaches [10]. Developing an automatic detection system that can detect potentially dangerous situations ensures effective prevention and the security of civilians; one way of detecting a potentially dangerous situation is by detecting weapons such as handguns [10]. Ruiz-Santaquiteria et al. implemented a novel approach for handgun detection [11]. They combined two different models with different purposes, the one meant to differentiate recognizable body poses and the other for hand image region classifications. The results of the models are then fed to an optional CNN-based model for filtering false positives [11]. The study utilized OpenPose for the body pose estimation, generated a numerical feature matrix with two-dimensional key points, normalized the key points, tested different models, and used the Darknet-53 extractor from YOLOv3 [11]. The dataset was a combination of datasets and images obtained from various sources. The freely available datasets include the Guns Movies and COCO datasets to balance out the overall dataset, with images excluding handguns [11]. Other data was collected from YouTube and video game watchdogs to mimic CCTV images. The following metrics were used for model evaluation and comparison: Precision, A.P. score, and Recall. In the end, they successfully improved the results of handgun detection by introducing body poses.

Weapon detection was used by Wang et al. for security and to fight terrorism [12]. The study utilized the YOLOv4 model, which improves on the drawbacks of the previous versions. These drawbacks include poor positioning accuracy and the inability to pick up small, dense objects [12]. They then further improved the YOLOv4 to detect smaller objects better. Improvement was achieved by implementing an SCSP-ResNet with an improved Spatial Attention Mechanism and a receptive field enhancement module with a GoogleNet architecture [12]. The dataset comprises synthetic and actual data generated by Unity Game Engine, including a real-world attack simulation and a freely available dataset [12]. Experiments saw the comparison of the improved YOLOv4 model with the original model, the other YOLO algorithms, and other CNN models. Evaluation metrics used were detection precision, true positives and false positives, recall, accuracy, and F1 score [12].

Datasets from the reviewed studies were created or obtained through online security footage. Videos and images went through preprocessing, in which all background and noise were removed, and the appropriate features were extracted. This is then used to train the model to identify the different levels of danger, and the model will then be able to classify and detect any threats or possible dangers.

If one successfully implements FER in ridesharing vehicles, an excellent place to start is to implement an open-source and lightweight model, as these models are cost-effective and require less powerful hardware, as such hardware would not necessarily be found in a ridesharing vehicle or any vehicle. Sampaio et al. cover several such models/libraries and their performance on a sample of the FER2013 dataset used in this study [13]. The models covered are DeepFace, EmoPy, Py-FEAT, and residual mask network (RMN). According to Sampaio et al. DeepFace is a lightweight Python library that provides diverse models tailored for facial recognition and attribute analysis [13]. Among those it offers is a pre-trained CNN trained on the FER-2013 dataset, achieving a 57% accuracy [13]. EmoPy is another open-source Python library providing various pre-trained neural network architectures for FER projects [14]. Py-FEAT, an open-source Python package, offers tools for face detection and extracting facial expressions, muscle movements, and landmarks from videos and images [13]. RMN is the last Python library covered and offers a pre-trained residual mask network (RMN) for the prediction of emotions [13]. The metrics in focus are “Accuracy” (A), “Precision” (P), “Recall” (R), “Cohen’s Kappa” (K), and “F1-score” (F). From the results in the article, it is seen that DeepFace outperformed across all metrics; therefore, the DeepFace results are used to compare with the results of this study.

Over the years, YOLO models have become quite popular and essential in the real-time detection of objects, with a rollout of a new model to deal with the limitations of predeceasing versions happening every now and so often. At the time of writing, the latest version of the model was YOLOv8; considering that, Terven and Cordova-Esparza, performed a comprehensive review study of the various YOLO models [14]. The study highlights the changes made to the model, such as new network backbones, a better technique to augment data, and different optimization techniques. The study also points out that from YOLOv4, there were slight improvements in model accuracy without affecting the real-time performance of the models but with an increase in computational costs. Therefore, YOLOv4 is used in this work.

In a research study to develop and optimize a weapon detection system, Ahmed et al. sought to improve real-time weapon detection and explored large-scale deployment [15]. The study highlights key areas of large-scale deployment and challenges that arise from cloud deployment hardware limitations and uses that information not only to improve the accuracy and performance of existing weapon detection models and improve the number of frames per second for real-time deployment but also to compare the performance of the models on different computing devices. The methodology emphasizes the importance of datasets and how they affect algorithms. The dataset used for training and testing consisted of 8327 labeled images split into training and testing datasets. To improve the mAP model, the datasets were broken into two categories, pistol and non-pistol, which helped reduce false negatives and false positives. The model used was YOLOv4 and TensorRT to optimize the model into YOLOv4-Scaled for network optimization in edge-computing with comparison results favoring the YOLOv4-Scaled model. In future works, Ahmed et al. mention using body poses to improve the system [15]. This article has aided my research project by giving me insight into developing systems for large-scale deployment optimization techniques and a successful systematic approach to developing a weapon detection system using YOLO.

1.2 State-of-the-art review

This review discusses the state-of-the-art technologies in emotion recognition and weapons detection systems, examining their applications in enhancing safety for ridesharing passengers and drivers.

1.2.1 Emotion recognition technologies

Emotion recognition refers to the technological capability to identify human emotions through various means, including facial expressions, voice intonation, and physiological signals. In ridesharing, monitoring driver emotions can significantly impact driving safety.

1.2.1.1 Technological advances

Facial expression analysis: Machine learning algorithms, particularly convolutional neural networks (CNNs), are increasingly used to analyze facial expressions captured via in-vehicle cameras. Cai et al. reported that these systems can detect emotions such as anger or frustration, which are known to correlate with risky driving behaviours [16].

Behavioural analysis: Recent studies have proposed using vehicle dynamics—such as heavy braking or sharp turns, as indicators of driver emotional states. This non-intrusive approach leverages existing vehicle sensors to infer emotional states without compromising privacy [17].

1.2.1.2 Impact on safety

Proactive interventions: Emotion recognition technologies can provide real-time feedback to drivers when negative emotions are detected. For instance, alerts could prompt drivers to take breaks or engage in calming activities as indicated by Li et al. and Liu and Wang [18, 19].

Passenger safety assurance: Passengers may feel safer knowing that their driver’s emotional state is being monitored, potentially reducing anxiety during rides [16, 20].

1.2.2 Weapons detection systems

The integration of weapons detection systems in ridesharing vehicles is crucial for enhancing security. These systems employ advanced technologies to identify firearms and other weapons before they can pose a threat.

1.2.2.1 Detection technologies

Computer vision systems: Technologies like ZeroEyes utilize existing surveillance camera networks to detect brandished firearms through AI-driven image analysis. This system alerts security personnel within seconds of detection, facilitating rapid response [21].

Millimetre wave technology: This technology detects concealed weapons by analyzing the density of objects without requiring individuals to stop or empty their pockets. It has been successfully piloted in various public transit environments [22].

1.2.2.2 Implementation in ridesharing

Real-time monitoring: By integrating weapons detection systems into ridesharing vehicles, companies can ensure immediate alerts if a weapon is detected, allowing for swift action from law enforcement [23].

Enhancing passenger security: The presence of weapons detection technology may deter individuals from carrying weapons into ridesharing vehicles, thereby enhancing overall safety [24].

1.2.3 Challenges and considerations

Emotion recognition and weapons detection raise ethical issues around privacy and consent, particularly in personal or semi-private spaces like vehicles. Balancing safety with ethical considerations is crucial. Privacy-preserving models, which anonymize data post-analysis or ensure minimal data retention, are being researched as solutions to these concerns.

Privacy concerns: Continuous monitoring raises ethical questions regarding passenger privacy. Clear policies must be established to protect user data while ensuring safety [12, 18].

Technological limitations: Current emotion recognition systems may struggle with accuracy under varying conditions such as poor lighting or occlusions [16, 25].

1.2.4 Ongoing research is necessary to enhance these technologies

Gaining public trust in surveillance technologies is critical. Transparent communication about the purpose and benefits of these systems can help alleviate concerns [16, 20].

The integration of emotion recognition and weapons detection systems within ridesharing services presents a promising strategy for enhancing safety for both drivers and passengers. By leveraging advanced technologies, ridesharing companies can create a more secure environment that addresses immediate risks while fostering trust among users. Future research should focus on improving system accuracy, addressing privacy concerns, and ensuring user acceptance to fully realize the potential benefits of these innovations.

From the literature, we now understand the related work and tools available to achieve our proposed work. Notable limitations and gaps are seen in [6] with the proposed dashcams and watchdog networks solution. The solution requires the live footage to be made accessible through social media platforms and observed by strangers (watchdog network); this limitation is that passengers might not feel comfortable being “watched” by strangers. Their trip was made public, and my proposed work takes care of this by removing the need to have people monitoring the trip and substituting it with a system that does both fear recognition and handgun detection. The work done by Ruiz-Santaquiteria et al. only utilizes individual images [11].

The escalating incidents of harassment, gender-based violence, and driver vulnerability in cash-based transactions require an innovative approach to safety measures within ride-share services. The traditional safety features have limitations in critical situations, emphasizing the urgency for a more robust and responsive system to ensure the safety and well-being of ride-share users. This chapter aims to contribute to passenger and driver safety of ride-share users by developing an image processing system that uses machine learning techniques for emotion recognition and weapon detection. The chapter contributes to ridesharing safety by expanding image processing techniques beyond driver monitoring implemented in related literature and including passengers. This study implements an image processing system via two Streamlit web apps, incorporating facial emotion recognition (FER) and handgun detection.

2. Methodology

The processing the emotion recognition and weapons detection system’s information and data involves a sequence of computational steps that transform raw inputs, such as facial images or object data, into actionable outputs, such as detected emotions or weapon alerts. Below, the methods are broken down into their most basic elements, highlighting the core principles and technologies.

Basic workflow of the system

  1. Data collection: Captures raw video and audio inputs.

  2. Preprocessing: Prepares the data by isolating faces or objects and enhancing quality.

  3. Feature extraction: Identifies key patterns like facial landmarks or object textures.

  4. Model analysis: Classifies extracted features into emotions or objects using trained AI models.

  5. Decision system: Triggers alerts based on the classification results.

  6. Output delivery: Provides real-time feedback via a user interface and alert systems.

2.1 Data acquisition

Input sources: Cameras capture real-time video streams of the vehicle’s interior.

Data types: Image Data - Captures facial expressions and objects.

2.2 Preprocessing

Preprocessing prepares raw data for analysis by improving its quality and suitability for recognition algorithms.

Image preprocessing: Convert video frames to grayscale. Resize images to match model input dimensions (e.g. 48 × 48 pixels for FER2013-based models). Normalize pixel values (e.g. scale from 0 to 255 to 0–1) to improve computational efficiency.

Face detection: Apply algorithms like Haar Cascades or deep learning-based methods (e.g. Multi-task Cascaded Convolutional Networks (MTCNN)) to isolate faces from the video frames for further emotion analysis.

Object detection preparation: Use bounding box algorithms to focus on potential regions containing objects for weapon detection.

2.3 Feature extraction

Feature extraction identifies and highlights relevant patterns in the data, which are then fed into machine learning models.

Facial features for emotion recognition: Extract landmarks (e.g. eye, nose, and mouth positions) to aid in identifying facial expressions. Input pixel values into CNN layers to identify high-level features corresponding to emotions.

Object features for weapon detection: Input object region data into YOLOv4 or similar models to identify characteristic shapes and textures of weapons.

2.4 Model processing

This stage involves using trained machine learning models to process the extracted features and generate outputs.

Emotion recognition: CNNs: Convolutional Neural Networks process image data through layers of filters, pooling, and fully connected layers to classify emotions (e.g. angry, fear, and happy).

Weapon detection: YOLOv4 - Processes regions of interest to detect objects in the frame, assigning probabilities to classify them as weapons or non-weapons.

2.5 Decision making

After processing, the system interprets the model’s outputs to make safety-related decisions.

Emotion analysis: High-confidence detection of negative emotions (e.g. fear and anger) triggers an alert system.

Weapon detection: Positive identification of a weapon triggers a higher-priority alert, which may involve emergency escalation.

2.6 Alert system

The processed results are communicated to relevant stakeholders via a user interface.

Visualization: The Streamlit GUI displays real-time results, such as the detected emotion (“Fear”) or object (“Handgun”).

Notifications: If a safety risk is detected (e.g. a weapon or heightened emotion), the system sends alerts to the driver and passenger (in-app notifications), and the ridesharing company’s support or emergency team.

This chapter presents a two-part danger detection collaborative safety tool: a GUI web app that ride-share companies like Uber and Bolt can use during trips. The two detection methods employed are emotion detection and handgun detection. These two detection methods are integrated using a Streamlit GUI. An alarm is triggered upon detecting the respective threats, and an image is saved. This section explains the integrated threat identification and response approach. Figure 1 is a flowchart outlining the important stages of the overall project.

Figure 1.

Overview of research design/methodology.

Figure 1 presents an overview of the research design and methodology for integrating emotion recognition and weapons detection systems in a ridesharing safety framework. The design includes two main detection pathways—one focused on weapons (e.g. handguns) and the other on emotional states (e.g. fear). These options are outlined as follows:

Object detection and face detection: Both pathways begin with object detection and face detection processes. Object detection identifies items within the vehicle environment, while face detection isolates face for emotional analysis.

Handgun recognition (YOLOv4): For weapon detection, YOLOv4 (you only look once version 4) is used to recognize handguns specifically. This model is selected for its real-time detection capabilities, allowing the system to alert operators immediately if a weapon is identified.

Emotion recognition (fear) using sequential CNN: For emotion detection, a sequential convolutional neural network (CNN) is employed to recognize specific emotional cues, particularly fear. This model processes facial expressions to identify emotional states that could indicate distress or potential conflict.

Streamlit GUI and alert system: Both detection pathways feed into a Streamlit GUI, which serves as a user interface, displaying real-time outputs from the detection systems. If either a weapon or an emotional cue like fear is detected, an alert system is triggered to notify the ridesharing support team, enabling prompt intervention.

This dual-path approach allows the system to detect both physical threats and high-risk emotional states, enhancing ridesharing safety through a layered, proactive monitoring solution (Figure 1).

2.7 Dataset collection

For this chapter, both datasets are open data found on the Kaggle platform. For training and testing the Emotion Recognition model, the FER2013 dataset introduced by Dumitru et al. was utilized [26]. In contrast, the “Handgun Detection” dataset provided by the University of Granada [10] was used for the Handgun detection model. Exploration and preprocessing were conducted on the dataset.

2.7.1 FER2013 dataset

The FER2013 dataset (Facial Expression Recognition 2013) is a widely used benchmark for emotion recognition tasks, particularly in applications involving computer vision and machine learning. It was originally introduced for the ICML (International Conference on Machine Learning) 2013 competition and has since become a standard dataset for training and evaluating models designed to recognize human emotions through facial expressions.

The FER2013 Dataset consists of 32,568, 48 × 48 grayscale images of faces displaying seven different emotions, that is, anger, disgust, fear, happiness, neutrality, sadness, and surprise which is described in the Figure 1 as Option 2 (Emotion). From the 32,568 images, the dataset is further split into 28,709 Train images and 3859 Test images.

FER2013 is extensively used for training convolutional neural networks (CNNs) in facial expression recognition tasks. The dataset is particularly valuable for deep learning models like CNNs due to its size and diversity of facial expressions. Many modern emotion recognition systems, including those for customer service, healthcare, and security applications, use FER2013 to develop real-time recognition capabilities.

For ridesharing safety applications, FER2013 can be instrumental in training models to detect emotions like “Fear” or “Angry,” which are associated with potential risks. By recognizing these emotions in real time, systems can alert operators or support teams to de-escalate situations before conflicts arise. Its range of emotions makes FER2013 particularly useful for recognizing distress or aggression in confined environments, enhancing safety monitoring in scenarios like ridesharing or public transportation.

By exploring the dataset folders, it was noticed that both the train and test sets were imbalanced, as seen in Figure 2. Using imbalanced datasets to train models is not good practice as it introduces a bias towards the dominant class in the dataset.

Figure 2.

Number of images for each emotion in the train and test sets.

This study implemented data augmentation to balance the datasets and reduce some folders. In addition to balancing out the datasets, sampling was also introduced. Sampling uses a fraction of the total dataset as opposed to the entire dataset due to the high computation costs of using the whole dataset. The final balanced datasets comprised 28,000 training images and 4655 testing images, using an 85/15 train-test split. Each training emotion has 4000 images, while each test emotion hosts 665 images.

The balanced datasets were then normalized by dividing each pixel value by the max pixel value, 255. Normalization is a crucial preprocessing step as it ensures all inputs follow a standard distribution, ensuring the gradient calculations computed in the model network remain consistent, helping the model train better and faster. The final preprocessing step was resizing the images to match the required input size for each model.

2.7.2 Handgun detection dataset

The Handgun Detection Dataset comprises 2986, 416 × 416 images [10]. The images are wide-ranging, all containing different handguns/pistols, images taken at various angles, handguns in hand, cartoon images, and staged studio-quality pictures of guns. The dataset also had its labels, but this study did not use the labels (gun position in the image) provided and opted to create new labels for each separate image instead of having it all stored in one file.

This study made use of LabelImg to create new labels. LabelImg is a user-friendly tool designed to annotate object bounding boxes in images. It supports the YOLO text format. It is a lightweight, open-source software developed by Tzutalin in 2015 that utilizes graphs to label imagesLabelling individual images is quite time-consuming; therefore, this study randomly selected and labelled a sample of 265 images. The minimum number of images needed for object detection, according to Lee 2021, ranges between 150 and 500 [27].

With the model needing labeled image annotations, traditional data augmentation techniques would prove to be troublesome; therefore, to increase the dataset, several duplications of images and the respective annotations were made. Ultimately, the dataset consisted of 925 images and 925 annotations. A 70/30 train-test split was then employed, resulting in 650 training images and 275 testing images.

Since the object detection was not a multiclass classification, with handgun being the only class being identified, there was no need to balance out the dataset.

2.8 Modeling

To achieve robust facial emotion recognition, this study trained/used and compared three distinct models: the pre-trained model offered by the lightweight DeepFace python library, a sequential CNN, and MobileNetv2 using transfer learning. The selection of DeepFace was due to it outperforming its lightweight counterparts, as seen in [13], as well as it being a lightweight open-source library for facial recognition comprising several state-of-the-art AI models specialized in facial recognition, such as VGG-Face, Facenet, OpenFace, DeepFace, Dlib, and ArcFace. Notable lightweight absentees are the Sequential and MobileNetv2 models; hence, they were the other models trained and tested in this study. Additionally, utilizing the YOLOv4 model is a cornerstone for object detection. Its cutting-edge architecture and capabilities are ideal for detecting objects, including handguns.

2.8.1 Facial emotion recognition

Figure 3 gives a brief overview of the critical stages in the facial emotion recognition model in the form of a flow chart. The key stages are further discussed below.

Figure 3.

Overview of facial emotion recognition.

Figure 3 provides a concise overview of the facial emotion recognition process, which involves the following sequential steps:

  1. Image acquisition: This is the initial step where images are captured using cameras installed in the ridesharing vehicle or other monitoring systems. These images serve as the raw data for processing. Live image footage of different facial emotions was acquired in this study via the laptop webcam.

  2. Face detection: The system isolates faces from the captured images using algorithms like Haar Cascades, Multi-task Cascaded Convolutional Networks (MTCNN), or other deep learning-based methods. This step focuses only on the regions of interest (the faces) while ignoring other parts of the image.

  3. Face recognition: After detecting a face, the system analyzes it to identify specific emotional features. Convolutional Neural Networks (CNNs) or similar machine learning models are typically employed here to classify the emotion (e.g. anger, fear, and happiness) based on the detected facial features.

  4. Safe and alert: Depending on the recognized emotion, the system decides. The image or video frame containing the detected handgun is stored in a secure database for record-keeping and potential evidence. Also, an immediate alert is triggered to notify relevant stakeholders, such as the ridesharing company’s security team or law enforcement, ensuring timely intervention.

Before any facial emotions are detected and inferences are made, facial detection is done on the acquired image to ensure a face. This study used the OpenCV Haar-cascade classifier for face detection by downloading and loading it into the haarcascade_frontalface_default.xml file. Haar Cascades is an object detection algorithm for finding faces in pictures or real-time video analysis. The algorithm uses edge and line detection and works by using “positive images” with faces and “negative images “that do not have faces. According to Behera 2020, the algorithm trains these positive and negative images to identify if images have a face in them [28]. After the face is detected, a bounding box is drawn around the face.

2.8.1.1 DeepFace

Since DeepFace is a pre-trained model, all that was done to utilize it was to import the DeepFace library from the deepface package. DeepFace has an inbuilt function called “analyze” which offers information on the detected face from the acquired image, such as the different possible emotions as well as the dominant emotion, age, gender, and various possible races as well as the dominant race, an example of this can be seen in Figure 4. This study focuses only on the predicted dominant emotion, which is then printed in the bounding box created during the face detection step.

Figure 4.

Example of DeepFace analysis function.

Figure 4 illustrates the functionality of the DeepFace framework for analyzing facial data to recognize emotions. DeepFace is an advanced facial analysis tool that utilizes deep learning to process and interpret facial features.

Face detection: The system first identifies and isolates faces from the input image or video stream. This step ensures that only relevant facial regions are analyzed.

Feature extraction: Using a deep learning model, DeepFace extracts key facial features such as the eyes, nose, mouth, and other distinguishing elements. These features are converted into numerical representations (embeddings) for processing.

Emotion recognition: The extracted features are processed to classify the individual’s emotional state. DeepFace typically recognizes a range of emotions, such as happiness, sadness, anger, surprise, and fear, using pre-trained neural networks.

Output generation: The results of the analysis are displayed, indicating the detected emotion(s) with corresponding confidence levels. These outputs can be visualized through a graphical user interface or logged for further analysis.

2.8.1.2 MobileNetV2

MobileNetV2 is a lightweight convolutional neural network model built for image classification. It aims to excel in performance when deployed on mobile and edge-computing devices; hence, it was selected. It adopts an inverted residual structure, employing residual connections within bottleneck layers. According to Sandler et al. the intermediate expansion layer utilizes lightweight depth-wise convolutions to filter features, providing non-linearity [29]. The model is downloaded from tensorflow keras.

Keras has a pre-trained MobileNetV2 model; therefore, transfer learning was implemented in this study. Transfer learning refers to leveraging knowledge/features gained from one task and applying it to a different but related task [30]. MobileNetV2 is said to be trained “on more than a million images from the ImageNet database” [31]. Due to the limitation on the computation resources, MobileNetV2 only allowed 1400 images to be trained. Therefore, the dataset was reduced to 1400 train images (200 per emotion) and 350 test images (50 per emotion).

MobileNetV2 takes the input of image size 224 × 224, 3. Therefore, the images were resized to fit this required input size.

Several new layers were added to the pre-existing model; two dense layers with 128 and 64 units perform a linear operation on the input from the previous layers, using ReLU activation functions, which introduce non-linearity. Dropout layers with a dropout rate of 0.2 after each dense layer to prevent overfitting. A final dense layer with seven units since it is a classification task with seven classes (seven emotions) using a softmax activation function to output probabilities for each class. Softmax was chosen as it is suitable for a multiclass problem.

Figure 5a and b shows the training of the MobileNetV2 model. The model achieved high training accuracy, but as seen by the validation accuracy line, overfitting occurred despite the dropout layers as the validation accuracy continuously decreased (Figure 5a). Figure 5b illustrates the training and validation performance of the MobileNetV2 model during the training process. This comparison highlights how well the model generalizes to unseen data after being trained on a specific dataset.

Figure 5.

Training accuracy versus test accuracy of MobileNetV2 model. (a) Model accuracy (training accuracy vs. validation accuracy). (b) Model loss (training loss vs. validation loss).

2.8.1.3 Sequential CNN

The model takes an input of size 48 × 48 with three channels, which is already the size of our dataset; however, images were resized to the desired input to prevent any unnoticed incorrect input size.

The architecture employed to build the Sequential model:

  • Conv2D layer: Constructs a convolutional layer with a given number of filters (32, 64, or 128), kernel size (3, 3), ReLU activation function, ‘same’ padding to preserve spatial dimensions, and an input shape for the first layer. The filters increase from 32 to 64 to 128, gradually capturing more complex features.

  • BatchNormalization layer: Normalizes the previous layer’s activations, allowing faster convergence during training and minimizing overfitting.

  • MaxPooling2D layer: Down samples the spatial dimensions by taking the maximum value inside a defined window (2 × 2).

  • Dropout layer: The dropout layer prevents overfitting by setting a certain percentage of the input to 0, preventing the model from memorizing the data and enabling learning patterns. In this case, 25% of the input is set to 0.

  • Flatten layer: Flattens the previous layers’ output into a 1D array, making it ready to input the dense layers.

  • Dense layer: Fully linked layers that use ReLU activation to learn high-level information and make predictions. The final dense layer includes the ‘softmax’ activation function typically used for multiclass classification.

Figure 6ad shows the training of the sequential CNN model. We trained the model twice, 30 epochs each; however, the model was first trained for 18 and 16 epochs on the second attempt due to early stopping implementation. We were able to increase the accuracy from 59–61%. The model trained relatively well; there are still signs of overfitting; however, the validation accuracy curve seemed to follow an increasing trend despite the validation loss not decreasing.

Figure 6.

Training accuracy versus test accuracy of sequential CNN model for epochs 18 and 16, respectively. (a) Model accuracy (training accuracy vs. validation accuracy) Epoch 18. (b) Model loss (training loss vs. validation loss) Epoch 18. (c) Model accuracy (training accuracy vs. validation accuracy) Epoch 16. (d) Model loss (training loss vs. validation loss) Epoch 16.

2.8.2 Handgun recognition

Figure 7 gives a brief overview of the key stages in the facial emotion recognition model in the form of a flow chart. The key stages are further discussed below.

Figure 7.

Key stages of handgun detection.

Figure 7 outlines a streamlined process for handgun detection and alert generation, composed of three core steps, shown below. This workflow demonstrates a robust mechanism for enhancing safety in real-time environments by integrating AI-based object detection with actionable alert systems. The simplicity of the process allows for quick deployment and reliable operation in high-risk scenarios.

  1. Image acquisition: This step involves capturing real-time video or image data using cameras installed in the monitoring environment, such as ridesharing vehicles or surveillance areas. The acquired images serve as the raw input for further analysis, ensuring continuous monitoring to detect potential threats. Live image footage of different handguns in hand was acquired in this study via the laptop webcam.

  2. Object detection (handgun): Advanced object detection algorithms, such as YOLOv4, process the captured images to identify handguns. This involves isolating regions of interest within the image, extracting relevant features, and classifying them as either “handgun” or “non-handgun” objects. The system uses deep learning models trained on large datasets of weapon images to achieve high accuracy and real-time performance. According to Korlakunta, YOLOv4 is the fourth iteration of the YOLO algorithm, which introduced a single-stage, end-to-end approach to object detection [32]. Unlike standard two-stage detectors, YOLOv4 processes the entire image in a single pass, making it highly efficient. It delivers cutting-edge precision by combining advanced techniques such as a strong backbone network, a feature pyramid network, and numerous detecting heads [32]. The YOLOv4 used Darknet, an open-source neural network framework, to perform object detection in this study. The Darknet repo is available on the AlexeyAB GitHub account [33]. In addition to the Darknet, YOLOv4 uses a configured file and pre-trained weights, available on the DominykasJurkus GitHub account [34]. My thanks and acknowledgement go out to these users. The pre-trained weights serve as a starting point for training.

  3. Save and alert: When a handgun is detected, the system performs two actions: The image or video frame containing the detected handgun is stored in a secure database for record-keeping and potential evidence. Also, an immediate alert is triggered to notify relevant stakeholders, such as the ridesharing company’s security team or law enforcement, ensuring timely intervention.

2.8.2.1 Graphical user interface

This study used Streamlit. Mhadhbi states for GUI, “Streamlit is a free and open-source framework to rapidly build and share beautiful machine learning and data science web apps [35]. It is a Python-based library specifically designed for machine learning engineers.” In this study, two web apps were created, 1 for Handgun detection and another for Emotion detection. Figures 8 and 9 display the home pages of the respective web apps. Within the GUI, the saved weights and models generated from the notebooks used for model training are loaded and integrated.

Figure 8.

Object detection via Streamlit.

Figure 9.

Emotion detection via Streamlit.

3. Results and discussion

To measure and compare the models’ performances, the selected metrics are Accuracy, Precision, Recall, and F1-score.

3.1 Facial emotion recognition

The observed results of the model are displayed in Table 1:

ModelAccuracyPrecisionRecallF1-score
DeepFace0.5540.5550.5220.535
MobileNetV20.1740.0480.1740.073
Sequential CNN0.6140.6420.6150.624

Table 1.

Model comparison.

Given the small dataset, it was expected that the MobileNetV2 would not perform well on the testing set despite performing well on the trained dataset. The best all-around performance on the selected metrics was the sequential CNN.

3.2 Handgun recognition using YOLOv4

The following statistics and metrics were taken at a confidence threshold of 0.25. It took a total time of 5 seconds to perform all the detections.

3.3 Comparative analysis

  • DeepFace versus MobileNetV2:

    • Across all selected metrics, DeepFace significantly outperforms MobileNetV2.

    • This significant difference indicates that DeepFace is more adept at recognizing emotions in the dataset than MobileNetV2.

  • Sequential CNN versus DeepFace:

    • Our sequential CNN outperforms DeepFace across all metrics.

    • This highlights that it not only classifies instances more accurately overall, but sequential CNN demonstrates a higher accuracy in identifying true positives among its positive predictions.

    • It is also worth noting that DeepFace is trained on the larger, imbalanced dataset, whereas sequential CNN is trained on a balanced sample dataset.

  • Sequential CNN versus MobileNetV2:

    • Sequential CNN displays a notably better performance across all metrics compared to MobileNetV2.

    • This significant difference in performance demonstrates Sequential CNN’s suitability and effectiveness for emotion recognition on the FER2013 dataset compared to MobileNetV2.

  • Classifications

    • With an accuracy of 61%, there will be some misclassifications, as seen in Figures 10 and 11; however, most of these misclassifications also occurred within the other emotions and not just the fear emotion and, therefore, should not hinder the overall performance of the app to significant effect.

Figure 10.

Emotion classifications of sequential CNN.

Figure 11.

F1-score per emotion.

Sequential CNN is the most suitable choice for emotion recognition on FER2013 due to its superior performance across all metrics. MobileNetV2’s inferior performance across all metrics suggests it might not be the best choice for this study. DeepFace scored more than 50% across all metrics; however, it could not outperform our sequential CNN, with our sequential CNN model scoring more than 60% across all metrics, and this could be due to the imbalanced FER2013 dataset DeepFace was trained on. Sequential CNN is the clear, better-performing model used to recognize the different emotions in the Streamlit App.

Table 2 shows that the model is better at correctly identifying images that contain handguns (TP = 228) than missing them (FN = 84). Given the number of false negatives, there is room for improvement in recognizing handguns in the images that have not been detected.

StatisticNumber of handgun images
True positive228
False positive32
False negative84

Table 2.

Statistics for handgun detection.

The model obtains a good false positive score (FP = 32); however, reducing false positives further could enhance the precision of the model, ensuring that fewer images are incorrectly labeled as containing handguns when they are not.

Table 3 suggests that the overall performance is satisfactory, obtaining an accuracy of 0.80. The balance between precision and recall seems slightly skewed towards precision (0.88 vs. 0.73), which suggests that the model potentially missed some actual handguns.

MetricYOLOv4 performance
Accuracy0.80
Precision0.88
Recall0.73
F1-Score0.80

Table 3.

Performance measure of YOLOv4 on handgun detection.

The screenshots of the model in action seen in Figure 12 show that the model accurately detected the handguns with high accuracy, given different types of handguns, different angles, and different backgrounds.

Figure 12.

Handgun detections.

4. Conclusion

This chapter successfully designed a collaborative safety tool in two separate Streamlit GUI (handgun detection and facial emotion recognition) for passenger and driver safety within ride-share services by developing an image processing system employing machine learning for emotion recognition and weapon detection. The objectives outlined were to detect fear from passengers’ facial expressions, identify handguns within a vehicle, and promptly alert in the presence of danger if the two threats were detected. In addition to the objectives at the start of the study, research questions were formulated: What method can be used to detect passengers’ facial expressions with at least 60% accuracy? What method can be used to detect a handgun in a vehicle? What approach can be used as a suitable alert system for either fear/handgun detection?

The comparative analysis of DeepFace, MobileNetV2, and sequential CNN on the FER2013 dataset proved it possible to recognize emotions from facial expressions. In addition, we also answered the research question of which model/method can be used to achieve at least 60% accuracy, with the sequential CNN model reaching an accuracy of 61%, which is reasonable given an ongoing research field. The sequential CNN exhibited commendable precision, recall, and F1-score, making it the preferred model due to its balanced performance and adaptability to our application. For Handgun Detection, the YOLOv4 model proved to be a great choice as it demonstrated proficient identification of images containing handguns, achieving an accuracy of 0.80. Saving the frames with either fear/handgun detected and sounding an alarm is a suitable alert system, but it can be improved.

This chapter contributes to the evolving landscape of safety technologies in ride-share services. The findings are not meant to replace existing safety measures but emphasize the potential of machine learning and image processing in mitigating safety concerns. The study hopefully acts as a steppingstone towards enhancing passenger and driver safety and highlights the importance of ongoing research in this domain. In conclusion, leveraging sequential CNN for emotion recognition and YOLOv4 for handgun detection, the developed image processing system represents a step in the right direction and one more “gear shift” closer to safer trips.

The implications of our work are significant for ride-share safety, laying the groundwork for advanced safety measures. Given certain limitations, such as computational resources, further improvements in the models are possible, especially regarding emotion recognition. A larger and better dataset can be used to improve accuracy. Transformers are rising in computer vision use cases and could produce better results. User feedback could also be implemented to gauge the general perception of the model and whether this study would be a welcomed addition in the attempt to make ridesharing trips safer. Concerning weapon detection, the dataset can be increased. It could include more weapons to expand its use beyond detecting handguns, which will play a pivotal role in ensuring a safer and more secure environment for all ride-share users.

Future work will encompass a diverse range of test scenarios. Additionally, input from psychologists and security specialists will be sought to design a system that emphasizes core principles of psychological security while addressing key aspects of safety. The hypotheses underpinning our approach and the implications of the proposed method will be comprehensively detailed.

Acknowledgments

The authors thanked Sol Plaatje University for infrastructural support.

Conflict of interest

The authors declare no conflict of interest.

References

  1. 1. Xiao H, Li W, Zeng G, Wu Y, Xue J, Zhang J, et al. On-road driver emotion recognition using facial expression. Applied Sciences. 2022;12:807. DOI: 10.3390/app12020807
  2. 2. Sukhavasi SB, Sukhavasi SB, Elleithy K, El-Sayed A, Elleithy A. A hybrid model for driver emotion detection using feature fusion approach. International Journal of Environmental Research and Public Health. 2022;19(5):3085
  3. 3. Mlamla S. Over 90 000 People Sign Petition Asking Bolt to Vet Its Drivers more Efficiently. [Blog] IOL. 2022. Available from: https://www.iol.co.za/capeargus/news/over-90-000-people-sign-petition-asking-bolt-to-vet-its-drivers-more-efficiently-bac70db8-2f67-4797-b2fd-c57458e2ab9c [Accessed: April 29, 2022]
  4. 4. Bonyhady N. Every Day, Two Sexual Assault or Misconduct Complaints Hit Uber. New South Wales, Australia: The Sydney Morning Herald [online]. Available from: https://www.smh.com.au/politics/federal/every-day-two-sexual-assault-or-misconduct-complaints-hit-uber-20211115-p59901.html; 2021 [Accessed: April 29, 2022]
  5. 5. Mohan AJ. Uber Panic Button: On Paper for Security, but in Car Only for Show. Mumbai: The Indian Express Group. Available from: https://indianexpress.com/article/express-exclusive/uber-files-india-panic-button-8021204/; 2022 [Accessed: April 28, 2023]
  6. 6. Chaudhry B, El-Amine S, Shakshuki E. Passenger safety in ridesharing services. Procedia Computer Science. 2018;130:1044-1050
  7. 7. Vemou K, Horvath A. Facial Emotion Recognition [online]. Rue Montoyer, Brussels: European Data Protection Supervisor. Available from: https://edps.europa.eu/data-protection/our-work/publications/techdispatch/techdispatch-12021-facial-emotion-recognition_en; 2021 [Accessed: May 12, 2022]
  8. 8. Mehendale N. Facial emotion recognition using convolutional neural networks (FERC). SN Applied Sciences. 2020;2(3):1-8
  9. 9. Lim JZ, Mountstephens J, Teo J. Emotion recognition using eye-tracking: Taxonomy, review and current challenges. Sensors. 2020;20(8):2384
  10. 10. Soft Computing and Intelligent Information Systems. Weapons Detection for Security and Video Surveillance. Soft Computing and Intelligent Information Systems. Online. Available from: https://sci2s.ugr.es/weapons-detection#Public%20datasets; [Accessed: July 1, 2023]
  11. 11. Ruiz-Santaquiteria J, Velasco-Mata A, Vallez N, Deniz O, Bueno G. Improving handgun detection through a combination of visual features and body pose-based data. Pattern Recognition. 2023;136:109252
  12. 12. Wang G, Ding H, Duan M, Pu Y, Yang Z, Li H. Fighting against terrorism: A real-time CCTV autonomous weapons detection based on improved YOLO v4. Digital Signal Processing. 2023;132:103790
  13. 13. Sampaio EV, Lévêque L, da Silva MP, Le Callet P. Are facial expression recognition algorithms reliable in the context of interactive media? A new metric to analyse their performance. In: EmotionIMX: Considering Emotions in Multimedia Experience (ACM IMX 2022 Workshop). Aveiro, Portugal; Jun 2022:hal-03789571
  14. 14. Terven J, Cordova-Esparza D. A comprehensive review of YOLO: From YOLOv1 to YOLOv8 and beyond. arXiv. 2023;5(4):1680-1716
  15. 15. Ahmed S, Bhatti MT, Khan MG, Lövström B, Shahid M. Development and optimization of deep learning models for weapon detection in surveillance videos. Applied Sciences. 2022;12(12):5772
  16. 16. Cai Y, Li X, Li J. Emotion recognition using different sensors, emotion models, methods and datasets: A comprehensive review. Sensors. 2023;23(5):2455. DOI: 10.3390/s23052455
  17. 17. Research Collection ETH Zurich. Detecting Emotion and Well-Being of Drivers under Naturalistic Condition. Zurich, Switzerland: Research Collection ETH Zurich; 2023. Available from: https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/541424/1/Dissertation_research_collection.pdf
  18. 18. Li W, Li G, Tan R, et al. Review and perspectives on human emotion for connected automated vehicles. Automotive Innovation. 2024;7:4-44. DOI: 10.1007/s42154-023-00270-z
  19. 19. Chen T, Wang M, Gong S, Zhou Y, Ran B. Connected and automated vehicle distributed control for on-ramp merging scenario: A virtual rotation approach, Transportation Research Part C: Emerging Technologies. 2021;133:103451. DOI: 10.1016/j.trc.2021.103451. Available from: https://www.sciencedirect.com/science/article/pii/S0968090X2100440X. ISSN 0968-090X
  20. 20. Ahmed M, Kaur H. Emotion recognition using different sensors, emotion models, methods and datasets: A comprehensive review. Sensors. 2022;23(5):2455. DOI: 10.3390/s23052455
  21. 21. Chicago Transit Authority. CTA Leverages Extensive Security Camera Network to Pilot Gun Detection Technology. Chicago: Chicago Transit Authority; 2024. Available from: https://www.transitchicago.com/cta-leverages-extensive-security-camera-network-to-pilot-gun-detection-technology/
  22. 22. Metro Los Angeles. Metro Expands Safety Measures and Pilot Weapons Detection Technology. Los Angeles: Metro Los Angeles; 2024. Available from: https://abc7.com/post/metro-expands-safety-measures-pilot-weapons-detection-technology/
  23. 23. CCTV Security Surveillance. AI Weapon Detection - CCTV Security Surveillance. Lake Mary, Florida: CCTV Security Surveillance; 2024. Available from: https://www.soundthinking.com/security/weapons-detection/
  24. 24. Evolv Technology. AI Weapons Detection Startups Compete with Industry Giant in Expanding Virginia School Market. Front Royal, Virginia: Evolv Technology; 2023. Available from: https://royalexaminer.com/ai-weapons-detection-startups-compete-with-industry-giant-in-expanding-virginia-school-market/
  25. 25. Gu Y, Liao X, Qin X, Yao Q. YouTube-GDD: A challenging gun detection dataset with rich contextual information. arXiv. preprint. 2022:arXiv:2203.04129. Available from: https://arxiv.org/abs/2203.04129
  26. 26. Dumitru IG, Cukierski W, Bengio Y. Challenges in Representation Learning: Facial Expression Recognition Challenge. Kaggle; 2013. Available from: https://kaggle.com/competitions/challenges-in-representation-learning-facial-expression-recognition-challenge
  27. 27. Lee C. How Many Images Do you Need for Object Detection? Medium. Available from: https://changsin.medium.com/how-many-images-do-you-need-for-object-detection-d33185629843#8b20; 2021 [Accessed: November 2, 2023]
  28. 28. Behera GS. Face Detection with Haar Cascade - towards Data Science. medium.com. Available from: https://towardsdatascience.com/face-detection-with-haar-cascade-727f68dafd08; 2020 [Accessed: October 20, 2022]
  29. 29. Sandler M, Howard A, Zhu M, Zhmoginov A, Chen LC. Mobilenetv2: Inverted residuals and linear bottlenecks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Salt Lake City, UT, USA: IEEE; 2018. pp. 4510-4520. DOI: 10.1109/CVPR.2018.00474. ISBN: 978-1-5386-6421-6
  30. 30. Team K. Keras Documentation: Transfer Learning & Fine-Tuning. Keras [Online]. Date created: 2020/04/15; Last modified: 2023/06/25. Available from: https://keras.io/guides/transfer_learning/; [Accessed: November 1, 2023]
  31. 31. Deep Network Designer. MobileNet-v2 Convolutional Neural Network - MATLAB. Deep Network Designer. MathWorks; 2024. Available from: https://www.mathworks.com/help/deeplearning/ref/mobilenetv2.html; [Accessed: November 2, 2023]
  32. 32. Korlakunta K. Yolov4: A Comprehensive Guide to Object Detection Using Darknet and Opencv. medium.com. Available from: https://korlakuntasaikamal10.medium.com/yolov4-a-comprehensive-guide-to-object-detection-using-darknet-and-opencv-bcf1688f57d7; 2023 [Accessed: November 1, 2023]
  33. 33. AlexeyAB. Darknet [Internet]. GitHub Repository. Available from: https://github.com/AlexeyAB/darknet/tree/master/src [Accessed: December 12, 2024]
  34. 34. Jurkus D. [Internet]. GitHub Repository. Available from: https://github.com/DominykasJurkus [Accessed: December 12, 2024]
  35. 35. mhadhbi, N. Python Tutorial: Streamlit. DataCamp [Online]. Available from: https://www.datacamp.com/tutorial/streamlit; 2021 [Accessed: November 2, 2023]

Written By

Gary Leander and Ibidun Christiana Obagbuwa

Submitted: 10 October 2024 Reviewed: 02 December 2024 Published: 16 April 2025