You are on page 1of 161

BSc Project

CS Department
Project ID: UQU-CS-2022F-02
2 / 2023

‫ | اتقاء‬Etiqa’a: Android Application that detects inappropriate Arabic


messages in WhatsApp using Machine Learning

‫اتقاء‬

By:

Name ID
Manar Ahmad Saeed Bajafar 438018415
Faiza Mohammed Usman Baran 438018483
Lama Saleh Abdullah Alzughaybi 439010549
Maram Nasser Muslih Alsaedi 439000020
Thraa Freed Hassan Serdar 439004340

Supervisor name:
Dr. Olfat Meraj Mirza

Dept. of Computer Science


Faculty of Computer and Information Systems
Umm Al-Qura University, KSA

i
ACKNOWLEDGMENT:

First of all, we would like to thank Allah Almighty and express our gratitude to him for helping
us with this project despite the difficulties. And we would like to thank everyone who helped us during
the project, whether with advice or service and express our gratitude to them. We are pleased to thank our
supervisor, Dr. Olfat Mirza, for her advice and guidance during the project. We also thank our families
for their continued support and appreciate them for always being by our side. We cannot adequately
express how grateful we are to them.

ii
ABSTRACT
In today's world, using social media has become an essential part of daily life. For example,
WhatsApp. Whether they are active social media users or not, most people have heard of WhatsApp. One
of WhatsApp's most populous groups is Middle Easterners. In recent years, an increasing number of Arab
children have used WhatsApp to communicate with others on a local and global scale. This may have
several negative consequences in their lives. This includes the consequences associated with being bullied
and harassed online, so we propose Etiqa'a | ‫اتقاء‬, an application aimed to minimize risks and keep threats
against minors from becoming a reality. The application is based on WhatsApp messages, which would
then be received, analyzed, and classified using machine learning model that uses Logistic Regression
(LR) algorithm which our result showed to have an accuracy of 81.2% to classify the message as
appropriate or inappropriate based on the text of the conversation, and then the application sends a
detailed alert to their parents based on the inappropriate threats that are detected. We believe that our
project will have a significant impact and will provide more security to young WhatsApp users.

Keywords: Machine learning, Artificial intelligence, AI, Natural Language Processing, NLP, WhatsApp,
monitoring private messages, Arabic text classification, message classification.

iii
TABLE OF CONTENTS
ACKNOWLEDGMENT: ........................................................................................................................... ii

ABSTRACT ................................................................................................................................................ iii

LIST OF FIGURES .................................................................................................................................. vii

LIST OF TABLES ...................................................................................................................................... x

Chapter 1: INTRODUCTION ................................................................................................................... 1

1.1 Purpose of the Project ......................................................................................................................... 3

1.2 Purpose of this Document ................................................................................................................... 3

1.3 Scope of the Project ............................................................................................................................ 3

1.4 Project Description.............................................................................................................................. 6

1.5 Existing Systems and their problems .................................................................................................. 6

1.5.1 Bark .............................................................................................................................................. 7

1.5.2 Qustodio ....................................................................................................................................... 7

1.5.3 AirDroid Parental Control ............................................................................................................ 8

1.6 Overview of this Document .............................................................................................................. 10

Chapter 2: BACKGROUND .................................................................................................................... 11

2.1 Machine Learning ............................................................................................................................. 12

2.2 Natural Language Processing............................................................................................................ 16

2.3 Arabic Natural Language Processing (ANLP) based on Machine Learning .................................... 17

2.4 Methods to get WhatsApp Messages ................................................................................................ 18

2.4.1 Extract WhatsApp messages from the phone's local storage ..................................................... 18

2.4.2 Extract WhatsApp messages from notifications ........................................................................ 19

2.4.3 Scrape messages from WhatsApp web ...................................................................................... 20

2.5 Literature Review.............................................................................................................................. 20

Chapter 3: SYSTEM ANALYSIS ........................................................................................................... 23

3.1 System Requirements........................................................................................................................ 24

3.1.1 Functional requirements............................................................................................................. 24

iv
3.1.2 Non-functional requirements ..................................................................................................... 27

3.2 System Diagrams .............................................................................................................................. 28

3.2.1 Use Case Diagram...................................................................................................................... 28

3.2.2 DFDs .......................................................................................................................................... 37

3.2.3 Sequence Diagram ..................................................................................................................... 41

3.2.4 Activity Diagram........................................................................................................................ 47

3.2.5 Class Diagram ............................................................................................................................ 54

Chapter 4: DESIGN CONSIDERATIONS ............................................................................................ 56

4.1 Design Constraints ............................................................................................................................ 57

4.1.1 Hardware environment ............................................................................................................... 57

4.1.2 End user characteristics .............................................................................................................. 57

4.2 Architectural Strategies ..................................................................................................................... 58

4.2.1 Algorithm to be used .................................................................................................................. 58

4.2.2 Project management strategies ................................................................................................... 59

4.2.3 Development method ................................................................................................................. 60

Chapter 5: SYSTEM DESIGN ................................................................................................................ 63

5.1 System Architecture .......................................................................................................................... 64

5.2 System Database ............................................................................................................................... 65

5.3 Interface Design ................................................................................................................................ 68

5.3.1 Interface Structure Design (ISD) ............................................................................................... 68

5.3.2 Prototype .................................................................................................................................... 69

Chapter 6: DATA GATHERING ............................................................................................................ 81

6.1 Instagram “Cyberbullying” Dataset .............................................................................................. 82

6.2 Twitter “Dangerous” Dataset ........................................................................................................ 84

6.3 Multi Platforms Offensive Language Dataset ............................................................................... 85

6.4 Twitter “Offensive” Dataset.......................................................................................................... 85

Chapter 7: IMPLEMENTATION ........................................................................................................... 87

v
7.1 Development Tools ........................................................................................................................... 88

7.2 Machine Learning Component.......................................................................................................... 90

7.2.1 Data Preparation............................................................................................................................. 90

7.2.1.1 Datasets Merging and Labels Unifying................................................................................... 90

7.2.1.2 Data Cleaning.......................................................................................................................... 92

7.2.1.3 Data Processing Using ANLP ................................................................................................. 94

7.2.1.4 Feature Extraction ................................................................................................................... 96

7.2.2.1 Algorithms Selection............................................................................................................... 98

7.2.2.2 Model Training and Testing .................................................................................................... 98

7.2.2.3 Model Evaluation .................................................................................................................. 100

7.2.2.4 Model Exporting ................................................................................................................... 102

7.3 Database component ....................................................................................................................... 103

7.3.1 Create Tables ........................................................................................................................... 103

7.3.2 Create an Event to Delete Unsaved Messages Every Two Weeks .......................................... 105

7.4 PHP API component ....................................................................................................................... 106

7.5 Parent device component ................................................................................................................ 108

7.6 Child device component.................................................................................................................. 111

7.7 Python API component ................................................................................................................... 114

7.8 User Interfaces ................................................................................................................................ 116

Chapter 8: TESTING ............................................................................................................................. 123

8.1 Unit Testing .................................................................................................................................... 124

8.2 Integration Testing .......................................................................................................................... 124

8.3 System Testing ................................................................................................................................ 124

8.4 Acceptance Testing ......................................................................................................................... 125

Chapter 9: CONCLUSION .................................................................................................................... 127

9.1 DISCUSSION AND CONCLUSION ............................................................................................. 128

9.2 Challenges ....................................................................................................................................... 130

vi
9.3 Future Plans .................................................................................................................................... 130

Appendix A .............................................................................................................................................. 138

Appendix B .............................................................................................................................................. 145

LIST OF FIGURES
Figure 1: Cyber Harassment by Age Group (%)......................................................................................... 4
Figure 2: percentage of minor’s accessible devices and their usage of WhatsApp ..................................... 6
Figure 3: Supervised Learning Mechanism ............................................................................................... 13
Figure 4: Unsupervised Learning Mechanism ........................................................................................... 15
Figure 5: Software Use Case Diagram – ‫ | اتقاء‬Etiqa’a system main functions (ESMF). ........................... 29
Figure 6: Software Use Case Diagram – ‫| اتقاء‬Etiqa’a system on parents’ device...................................... 30
Figure 7: Software Use Case Diagram – ‫| اتقاء‬Etiqa’a system on child’s device........................................ 31
Figure 8: Software context level diagram .................................................................................................. 38
Figure 9: Software DFD Diagram – Level 0 ............................................................................................. 39
Figure 10: Software DFD Diagram – level 1 - Send an alert..................................................................... 40
Figure 11: Software DFD Diagram – level 1 - Edit account settings. ....................................................... 41
Figure 12: Software Sequence Diagram -Parent device (create account, log in)....................................... 42
Figure 13: Software Sequence Diagram -Parent device (add child), child device (log in, Give permission)
.................................................................................................................................................................... 43
Figure 14: Software Sequence Diagram -Parent device (view alert, advice ) ........................................... 44
Figure 15: Software Sequence Diagram -Parent device (settings) ............................................................ 45
Figure 16: Software Sequence Diagram -Parent device (settings 2) ......................................................... 46
Figure 17: Activity Diagram -Parent device (create account) ................................................................... 47
Figure 18: Activity Diagram - (Login) ...................................................................................................... 48
Figure 19: Activity Diagram - Parent device (Add child) ......................................................................... 49
Figure 20: Activity Diagram – child device (get permission) .................................................................. 50
Figure 21: Activity Diagram – (detect inappropriate message) ................................................................. 51
Figure 22: Activity Diagram –parent device (save message) .................................................................... 52
Figure 23: Activity Diagram –parent device (get advice)......................................................................... 53
Figure 24: Activity Diagram –parent device (delete account) .................................................................. 53

vii
Figure 25: Class Diagram of ‫ | اتقاء‬Etiqa’a system ..................................................................................... 55
Figure 26: Project management –Trello program card .............................................................................. 60
Figure 27: Waterfall model ........................................................................................................................ 60
Figure 28: Component architecture of ‫ | اتقاء‬Etiqa’a system. ..................................................................... 65
Figure 29: Entity Relationship Diagram (ERD) of ‫ | اتقاء‬Etiqa’a system ................................................... 66
Figure 30: Mapping ERD to Relational Schema of ‫ | اتقاء‬Etiqa'a system ................................................... 67
Figure 31: Interface Structure Design (ISD) of ‫ | اتقاء‬Etiqa’a system........................................................ 69
Figure 32: 0- About the application interface. ........................................................................................... 70
Figure 33: 1- Device selection interface. ................................................................................................... 70
Figure 34: 2- Create an account or login selection interface ..................................................................... 71
Figure 35: 2.1- Create an account interface. .............................................................................................. 71
Figure 36: 2.2- Login interface .................................................................................................................. 72
Figure 37: 2.1.1- Entering verification code interface ............................................................................... 72
Figure 38: 2.1.1.1- Confirmation interface ................................................................................................ 73
Figure 39: 2.2.1- Welcoming interface. ..................................................................................................... 73
Figure 40: 2.2.1.2- Parent's homepage with child added interface ............................................................ 74
Figure 41: 2.2.1.1- Parent's homepage with no child added interface ....................................................... 74
Figure 42: 2.2.1.2.1- Alert in more detail interface ................................................................................... 74
Figure 43: 2.2.1.2.2- Advice category interface......................................................................................... 75
Figure 44: 2.2.1.2.2.1- Specific category advice interface ........................................................................ 75
Figure 45: 2.2.1.2.3- Account settings interface. ....................................................................................... 75
Figure 46: 2.2.1.2.3.1- Account info interface. .......................................................................................... 76
Figure 47: 2.2.1.2.3.2- Children list interface. ........................................................................................... 76
Figure 48: 2.2.1.2.3.3- Alert history interface ........................................................................................... 76
Figure 49: 2.2.1.2.3.4- Help center interface ............................................................................................. 76
Figure 50: 2.2.1.2.3.1.1- Edit account info interface. ................................................................................ 77
Figure 51: 2.2.1.2.3.1.1- Delete warning window. .................................................................................... 77
Figure 52: 2.2.1.2.3.2.3- Add child interface ............................................................................................. 78
Figure 53: 2.2.1.2.3.2.2- Not activated child's device interface ................................................................. 78
Figure 54: 2.2.1.2.3.2.1.1- Edit not activated child's device interface ....................................................... 78
Figure 55: 3.2- Choose a child parent's homepage with child added ......................................................... 79
Figure 56: 3.2.1- Inactive child interface ................................................................................................... 79
Figure 57: 3.2.1.1- Permission window ..................................................................................................... 79
Figure 58: 3.2.1.1.1- Activation terminated interface ................................................................................ 79

viii
Figure 59: 2.2.1.2.3.4.1- Application instructions interface ...................................................................... 80
Figure 60: 2.2.1.2.3.4.2- Instructions for adding a child interface............................................................. 80
Figure 61: 2.2.1.2.3.1.1.1- Confirm account deletion interface ................................................................. 80
Figure 62: Machine Learning Model ......................................................................................................... 90
Figure 63:Data Distrbution ........................................................................................................................ 93
Figure 64: Accuracy Formula [59] .......................................................................................................... 100
Figure 65: Confusion Matrix of SVM Model .......................................................................................... 101
Figure 66: Confusion Matrix of NB Model ............................................................................................. 101
Figure 67: Confusion Matrix of LR Model.............................................................................................. 101
Figure 68: Confusion Matrix of RF Model .............................................................................................. 101
Figure 69: Confusion Matrix of DT Model ............................................................................................. 101
Figure 70: Confusion Matrix of KNN Model .......................................................................................... 101
Figure 71: F1-Score Formula [59] ........................................................................................................... 102
Figure 72: Table structure for Parent table .............................................................................................. 103
Figure 73: Table structure for Child table ................................................................................................ 103
Figure 74: Table structure for WhatsApp message table ......................................................................... 104
Figure 75: Table structure for Advice table ............................................................................................. 104
Figure 76: delete_message_after_two_weeks event in etiqaa database ................................................... 105
Figure 77: About the application interface ............................................................................................. 116
Figure 78: Device selection interface. .................................................................................................... 116
Figure 79: Login interface (Parent's device) ............................................................................................ 116
Figure 80: Create account interface (Parent's device)............................................................................. 116
Figure 81: verification interface............................................................................................................... 117
Figure 82: Confirmation interface .......................................................................................................... 117
Figure 83: Welcoming interface .............................................................................................................. 117
Figure 84: Homepage with no child added (Parent's device).................................................................. 117
Figure 85: Homepage with child added (Parent's device)....................................................................... 118
Figure 86: Alert in more details interface ............................................................................................... 118
Figure 87: Advice category interface ....................................................................................................... 118
Figure 88: Specific category advice interface ......................................................................................... 118
Figure 89: Account settings interface ...................................................................................................... 119
Figure 90: Account info interface ........................................................................................................... 119
Figure 91: Children list interface ............................................................................................................. 119
Figure 92: Alert history interface ............................................................................................................ 119

ix
Figure 93: Help center interface .............................................................................................................. 120
Figure 94: Edit account info interface ..................................................................................................... 120
Figure 95: Delete warning window......................................................................................................... 120
Figure 96: Add child interface ................................................................................................................. 120
Figure 97: Inactive child interface (Child device) ................................................................................... 121
Figure 98: Permission window (Child device) ........................................................................................ 121
Figure 99: Activation terminated interface (Child device) ................................................................ 121
Figure 100: Application instructions interface........................................................................................ 121
Figure 101: Instructions for adding child interface.................................................................................. 122
Figure 102: Confirm account deletion interface ..................................................................................... 122

LIST OF TABLES
Table 1: Comparison between ‫ | اتقاء‬Etiqa’a and current systems ................................................................ 9
Table 2: Example of ANLP Operations [4] ............................................................................................... 17
Table 3: Use Case Scenario for Create account ......................................................................................... 32
Table 4: Use Case Scenario for login ......................................................................................................... 33
Table 5: Use Case Scenario for give permission ....................................................................................... 34
Table 6: Use Case Scenario for add a child ............................................................................................... 35
Table 7: Use Case Scenario for get advice................................................................................................. 36
Table 8: Use Case Scenario for receive alerts ............................................................................................ 36
Table 9: End-User Characteristics ............................................................................................................. 58
Table 10: labeling samples ......................................................................................................................... 83
Table 11: part of the Gulf comments in the dataset. .................................................................................. 83
Table 12: Top 10 most frequent ‘dangerous’ seeds and emojis in REST API dataset............................... 84
Table 13: binary labels of the dataset ......................................................................................................... 85
Table 14: Example for Dataset Before Unifying Labels ............................................................................ 91
Table 15: Example for Dataset After Unifying Labels .............................................................................. 91
Table 16: Sample of Cleaning Results ....................................................................................................... 93
Table 17: The Result of Stemmers and Lemmatizers ................................................................................ 95
Table 18: Sample of Processing Results .................................................................................................... 96
Table 19: Example of N-gram [54] ............................................................................................................ 97

x
Table 20: Accuracy Score for Training Models Using TF-IDF ................................................................. 99
Table 21: Accuracy Score for Training Models Using Count Vectorizer .................................................. 99
Table 22: Acceptance Testing .................................................................................................................. 125

xi
Chapter 1: INTRODUCTION
1.1 Purpose of the Project
1.2 Purpose of this Document
1.3 Scope of the Project
1.4 Project Description
1.5 Existing Systems and their problems
1.5.1 Bark
1.5.2 Qustodio
1.5.3 AirDroid Parental Control
1.6 Overview of this Document

1
Introduction
Nowadays, more and more young people use and misuse technology. Unfortunately, criminals are
concentrating their efforts on tracking down vulnerable people, such as minors, to contact them through
social media. They usually use deception to lure their victims and commit crimes. Although young people
use WhatsApp regularly to communicate with friends and family, there have been incidents in which
minors have been subjected to threats such as sexting, child pornography, and bullying [1] [2]. These
risks, if not identified and addressed in a timely manner, may cause the child physical and psychological
harm. In this context, the requirement for applications to have systems to alert about the presence of
dangers becomes critical. There are few applications that help parents monitor social media private
messages, but almost all of them lack Arabic language support, which is a shame because Arabic is the
official language of 22 countries and is partially spoken as a first language in 11 other countries, making
it the first language of more than 422 million people [3].

The Middle East is where the Afro-Asiatic language of Arabic originated. Modern Standard
Arabic Language (MSA), one of the numerous Arabic language formats, is used in official
communications and spoken speech in journalism and media. The Holy Quran, literary works, and poetic
poems were all written in the other type of Arabic, known as Classical Arabic (CA). Another category is
public dialects, which differ depending on where you reside [4].

The Arabic language has 28 different alphabets in the language, which are written from right to
left. The Arabic alphabet letters take on different forms depending on where they are in a word. For
example, the letter Ain (‫ )ع‬if it is at the beginning of the word, it would look like this (‫)عـ‬, at the center of
the word, it looks like this (‫)ـعـ‬, and at the end, it looks like this (‫[ )ـع‬5].

The Arabic language is the fourth most used language on social media platforms [3] so it is
necessary to have an application that can detect inappropriate messages in the Arabic language. In this
regard, our project intends to create an application that can detect inappropriate messages in Arabic and
notify parents as soon as possible after evaluating and classifying the content of messages into appropriate
or inappropriate. This saves the parent from having to read the child's private messages and invading their
privacy.

Our system is designed to classify any messages that are inappropriate based on the definition
provided by the Oxford Dictionary, inappropriate is not suitable behavior or language, such as sexual
harassment, or anything that causes damage or injury to a person, such as bullying. Our project is
significant because it seeks to keep minors safe on social media. For the time being, we will concentrate
on WhatsApp. However, in the future, we plan to enhance and expand this project to detect inappropriate

2
messages in Arabic on all social media platforms, including Twitter, Instagram, and Facebook.

We believe that by detecting any inappropriate messages across social media private messages
and making it easier for parents to know if anything inappropriate is being sent to their children, our
system will make social media a safer place for young Arabs.

1.1 Purpose of the Project


The main purpose of the project is to create an application that can detect inappropriate
WhatsApp messages in Arabic and notify parents about them. the project aims to protect minors on social
media from any inappropriate words being sent to them, give parents peace of mind knowing they will be
informed if their children ever receive any such remarks, and protect the minor's privacy by not allowing
the parent to see all the messages but only the inappropriate ones.

1.2 Purpose of this Document


This report was written to fully explain what is required to develop an application to monitor
private messages for children on WhatsApp to detect inappropriate words in Arabic, including the
gathering of requirements, the design process for the interfaces, diagramming the program path, and
develop the application. It also discusses and analyzes related works and current systems, making the
information understandable, clear, and available to everyone.

1.3 Scope of the Project


The idea emerged by thinking that a long time ago when people didn't have phones, parents used
to run behind their children to see where they were going and what they were doing, but nowadays there
are a lot of threats and harassment going on even while the child is in the comfort of his/her home, this is
why parents should definitely monitor child's phone.

‫ | اتقاء‬Etiqa’a is a mobile application for Android that automatically monitors children's messages
on WhatsApp using machine learning. The scope of the application serve’s Arab parents who have
children from the age of 7 to 16 years.

Social media bullying has expanded into a huge, hotly debated topic. The Arab world is
becoming more aware of cyberbullying. According to the Cyberbullying Report [6], about 60% of Gulf
Arab children openly admit the occurrence of cyberbullying among their peers. In addition, in 2018

3
Moafa et al showed in Figure 1 which shows the percentage of cyber harassment by age group in the
Kingdom of Saudi Arabia on the Web and online networking stages, where the dark color occupies the
largest percentage, which represents the cyber harassment of people from the age of 15 years until their
current age [7].

Figure 1: Cyber Harassment by Age Group (%)

The research study by Fahmy in 2021 [8] that involved 279 children in the 12 to 19 years old age
range discovered that "WhatsApp" accounted for 61.6% of all children social networking site usage,
followed by "Facebook" (53%), then "Instagram” (52.3%). Receiving bad messages and images is one of
the most significant forms of bullying that they experience, according to 60.4% of them, while receiving
threatening and intimidating messages is experienced by 45.6% of them. And because it is illegal to
monitor those who are older than the legal age, we restricted our age range to those not over 18.

In 2018 an online survey of 6,986 parents all around the world, including responses from 1,012
parents in KSA and UAE aged 18 and up with children aged 5 to 16 was commissioned by Norton &
Symantec and conducted by research firm Edelman Intelligence. The report showed that 31% of UAE
children 34% of KSA children from and age of 5-10 have smartphones of their own, while the age group
between 11-16 accounted for 70% of children owning their own smartphones in UAE and 74% in KSA.
The survey asked the parents if smartphones have a negative impact on their children (such as their
mental health and social skills) and 52% of UAE and 53% of KSA parents said that the smartphones does
impact their children negatively. The report also showed that 75% of UAE parent and 76% parents are
worried about online threats their children are vulnerable to, in fact parents in KSA say that they’re
significantly more concerned about online bullying than bullying a school. The survey also asked the
parents how strict they are when It comes child’s use of smartphones, UAE parents said their level of
strictness was 74%, while KSA’s level of sickness was 73%, the parents were also asked if they used any
parental control apps, 54% of UAE parents and 55& of KSA parents that they have set up parental

4
controls, the report also showed that 71% of UAE parents and 70% of KSA parents want to set limits and
parental controls, but they don’t know how to go about doing this, and 82% of UAE parents and 81% of
KSA parents said they wish they had more support/advice when it comes to protecting their children
online. [9]

A survey was published online by us to better identify the target age group and see if parents can look
through their children' devices. About 280 answered. The survey included questions such if they would
use the Eitqa’a application and their opinion on whether it was ethical or not.
Based on the survey we found that 77.1% of parents have access to their children’s devices, with 34.3%
of parents saying its ethical to go through their children’s device without their knowledge as a form of
protection method, and 42.8% of parents saying that their children are aware of them monitoring their
devices.

The parents were asked if their children use WhatsApp or not to see the age group of young WhatsApp
users, and we found that 48.28% of children from the age of 7 to 11 use WhatsApp, while the age group
from 12 to 17 had 88.10% of children using WhatsApp as its shown in
Figure 2.

Due to this our age group starts from the age of 7 to provide protection to young children using
WhatsApp.
The parents were also asked if they would use Etiqa’a application and found that 89.4% of parents said
they will use it. We found that 85.19% of parents who said that they don’t go through their children’s
devices due to the privacy issues, said they would use the Etiqa'a application commenting that its perfect
since it would protect their children's privacy and give the parents a peace of mind at the same time.

56.92% of parents that said they don’t have access to their children’s devices were older than 17 years old
Due to this our scope range limit 16 and younger. We concluded that our age range is from 7 to 16,
excluding children younger than 7 due to their low 22% WhatsApp usage, and including ages from 7 to
16 due to them being on WhatsApp and parents having access to their devices, while children form the
age of 17 and older were excluded due to parents not having or not wanting to access their children’s
devices.

5
100.00%
90.00%
80.00%
70.00%
60.00%
50.00%
40.00%
30.00%
20.00%
10.00%
0.00%
younger than 7 7-11 year old 12-17 year old older than 17

Percentage of parents that have access to their children's devices


Usage of whatsapp per age group

Figure 2: percentage of minor’s accessible devices and their usage of WhatsApp

To see the full detailed survey check appendix A

1.4 Project Description


‫ | اتقاء‬Etiqa’a is the name of our project application, and it comes from the fact that our
application can help parents to avoid the evil or danger that can happen due to bad people who
communicate with their children through social media. The application focuses on the most used social
media by minors, which is WhatsApp. It monitors messages and then sends an alert to the parent when a
inappropriate word is discovered.

Our application uses machine learning to detect inappropriate Arabic words, and its interfaces are
in Arabic to suit our community, and it can monitor private messages, not just public data and at the same
time protect the privacy of minors because parents cannot see all messages, only when needed.

1.5 Existing Systems and their problems


There are many parental control applications in the market, but most of them provide the usual
features, which are location monitoring, screen and applications usage management, activity reports, and
so on, in this report, we will focus on current software that helps parents to monitor their children
activities on the internet, what it offers to address detected issues and its main drawbacks.

6
Three parental control applications will be discussed, which are "Bark", "Qustodio", and
"AirDroid Parental Control".

1.5.1 Bark
Bark is a parental control app that uses machine learning algorithms and leans most heavily on
deep learning in neural networks, in addition of use contextual analysis and natural language processing
to monitor messages and media effectively and accurately for 32 apps and then it alerts parents on any
potential issues found, even Emojis are monitored [10], but the algorithms are only trained in English,
Spanish, and Afrikaans languages, so it does not support the Arabic language, also monitoring capabilities
is different depending on the platform and the app that it monitors, for example, Bark can only monitor
posts on the child’s Facebook timeline, as for Instagram it can monitor the child's posts with direct
messages on Android device but cannot monitor the DMs on iOS devices and its alerts are not real-time
alerts, it may take 15 minutes on average [11].

Thanks to artificial intelligence, children will be able to maintain their privacy and there is no
need for parents to waste a lot of their time reading all messages, in addition, Bark provides
recommendations in their blog to help parents deal with alerts issues they received from their children
with block access to specific apps, but there is no controlling provided over monitored accounts
(internally) [11].

The child app is installed through sideloading, which is a separate app downloaded from the
website that could potentially compromise the security of the mobile device because the software is not
thoroughly vetted and approved by the teams at Apple or Google, and no rooting is required [11].

1.5.2 Qustodio
Qustodio is a cross-platform parental control tool that provides many features for parents to help
them keep an eye on the online activities of their children, but we will concentrate on the feature that is
similar to our project despite the others, which is only text/SMS monitoring, Unfortunately, Qustodio
stopped providing social media monitoring as it used to do with Facebook in the past, it now only
monitors SMS messages, where it provide direct monitoring to them but requiring sideloading app and
rooting device [12].

7
Qustodio does not provide any kind of artificial intelligence to monitor messages but rather
reveals everything to the parents without restrictions, it gives access to the whole sent/received messages
content, the identity of the senders, and the time of arrived/sent messages, thus allows parents to violate
the privacy of their children and waste their time reading and tracking a huge amount of messages,
however, the current generation no longer uses SMS messages as they do now with social networking to
communicate with each other, in another world this feature is useless these days [12].

1.5.3 AirDroid Parental Control


AirDroid Parental Control is a comprehensive cross-platform app that allows parents to monitor
and manage their kid’s devices remotely, it offers many features to monitor and manage kids' devices
remotely to keep them safe while using the internet, for now, we will focus on screen mirroring feature,
which helps parents to see and monitor kid's activities on their screens in real-time remotely and manually
without the help of AI techniques [13].

Screen mirroring feature is comprehensive and shortens a lot of kids' activities, but it does not
respect the children's privacy, and it is also very difficult for busy parents to follow up on their kids'
activities constantly in the same moment, where the feature is live monitoring, so it does not save or track
any activities unless the parent connects to the kid screen [13].

Problems in the existing system


In this section in Table 1, we summarized the drawbacks of the current systems "Bark",
"Qustofio", and "AirDroid" that we mentioned in the previous section through a comparison table
between them and our project "‫ "اتقاء‬that will solve them.

8
Table 1: Comparison between ‫ | اتقاء‬Etiqa’a and current systems

Bark Qustodio AirDroid "‫"اتقاء‬

Messages Monitoring ✔ ✔ ✔ ✔

Smart Monitoring ✔ ✖ ✖ ✔

Suspicious Content
✔ ✖ ✖ ✔
Alert

Protect Children
✔ ✖ ✖ ✔
Privacy

Arabic Language ✔
✖ ✖ ✖
Support

Free ✖ ✖ ✖ ✔

Real-Time ✖ ✖ ✖ ✔

9
1.6 Overview of this Document
This document is structured as the following:

Chapter 1: This chapter provides an introduction, description, scope of the project, and existing
systems and their problems.

Chapter 2: This chapter provides background about machine learning, natural language
processing, and literature review.

Chapter 3: This chapter provides system requirements including functional and non-functional
requirements with diagrams such as (use case diagram, sequence diagram, activity diagram, class
diagram, and DFDs diagram)

Chapter 4: This chapter provides design consideration including design constraints from user and
system software and hardware environment, in addition to the used architectural strategies which
are algorithms, project management, and methodology for developing the project.

Chapter 5: This chapter provides system design, including architecture, database system, and
interface design.

Chapter 6: this chapter showcases the datasets that are used to train the model and all their
information’s.

Chapter 7: This chapter provides the development tools of the system, the machine learning model
implementation, the database implementation, the mobile application implementation, and the
model integration with the application.

Chapter 8: This chapter provides the testing stage of ‫ | اتقاء‬Etiqa’a application, type of testes that
were done and their results.

Chapter 9: This chapter provides conclusion of the project, the challenges we faced throughout the
making of ‫ | اتقاء‬Etiqa’a application, and what we plan to do with application in the future to
improve it.

10
Chapter 2: BACKGROUND
2.1 Machine Learning
2.2 Natural Language Processing
2.3 Arabic Natural Language
Processing based on Machine Learning
2.4 Methods to get WhatsApp messages
2.4.1 Extract WhatsApp messages from the phone's
local storage
2.4.2 Extract WhatsApp messages from notifications
2.4.3 Scrape messages from WhatsApp web
2.5 Literature Review

11
BACKGROUND
This chapter will provide some information about the technologies used in the application and
describes their meanings, some of their uses, and the different types of algorithms used in each of these
techniques.

The topics covered in this chapter are Machine Learning, Natural Language Processing,
Arabic Natural Language Processing based on Machine Learning, and how to Extract messages
from notifications. It will also contain Literature Review Where we discussed other existing models or
systems that have some similarities to our application.

2.1 Machine Learning


Machine learning is a wide-ranging field with uses in information technology, statistics,
probability, artificial intelligence, psychology, neurobiology, and a variety of other fields of study.
Machine learning can solve problems by simply creating a model that accurately represents a given
dataset.

Machine learning (ML) is a subdivision of artificial intelligence, it allows computers to learn


from the data its being trained with and improve over time. Machine learning algorithms can
acknowledge and gain knowledge from data patterns to make predictions.

Machine learning seeks to develop algorithms that enable computers to learn. Learning is the
process of discovering statistical regularities or other data patterns.

Machine learning algorithms are designed to mimic the human approach to learning a task. So,
machine learning algorithms are divided into two broad categories based on the desired outcome of the
algorithm: supervised learning and unsupervised learning [14].

1- Supervised Learning Method

To train models in supervised learning, previously collected data is needed. As an input, a


supervised learning model requires both previous data and previous results. By training with this data, the
model is able to predict more accurate results. In this case, the data that we use as input data is labeled. If
an algorithm must distinguish between animals, the data must be labeled or classified for each animal in
the collection. Figure 3 shows that the model takes dog, cat, and duck labeled data as input to train, so
when the test data shows a dog and cat, the model is able to predict them correctly [15].

12
Algorithms under supervision may be used to train regression or classification.

If the input variable and the output variable are related, regression algorithms are used. It is
employed in the forecasting of continuous variables, such as weather.

When the output variable is categorical—that is, there are just two classes—classification
algorithms are used. Examples of such classes include Male-Female and Yes-No.

Support Vector Machines, Naive Bayes, and Decision trees are supervised learning algorithms
that are used for Arabic text classification.

Figure 3: Supervised Learning Mechanism

Support Vector Machines (SVMs): a supervised learning algorithm that can be used for both
classification and regression, but it is most used for classification [16]. SVMs have been used successfully
in many pattern recognition problems in areas such as bioinformatics and biometrics. SVMs have
achieved the best results in text categorization and are widely used in NLP-related problems in different
languages, such as Arabic, for methods such as readability prediction and sentiment analysis [4]. This
model represents each dataset item as a point in space, with dimensions determined by the number of
features. Each point's value is mapped to the value of the corresponding feature. The classification is then
performed using a hyperplane to differentiate the data classes. Training data is made up of labeled
documents displayed as a vector space. It categorizes different documents into a limited dimensional
space and is also used to aid in the analysis of text, data, and documents in order to compute their
similarity. Linear algebra is used in this algorithm. When compared to other methods, this algorithm has a
distinct sense of ease. It instructs the machine to compute the degree of similarity between documents.

13
However, SVM has some limitations that may deter some users from using it. The difficulty of using
synonyms in Arabic represents a huge challenging obstacle because the Arabic language has many
synonyms for each word. Another difficult challenge is the assumption that its terms are statistically
independent. In fact, most Arabic terms are closely related [16].

Naive Bayes (NB): One of the first classification algorithms used in text classification was NB. It
is the most straightforward and second most commonly used classifier. The Naive Bayes classifier is a
popular text categorization technique that assigns documents to associated categories such as spam or
legitimate [17], as well as positive, negative, or neutral.

This algorithm is classified as a basic probability classifier. It is dependent on the application of


the Bayes theory with feature independence assumptions. This classifier is highly scalable, requiring only
a few linear parameters concerning the number of variables in the learning problem. The features and
predictors represent the number of variables. NB has been used to enhance the processing and
manipulation of text and data from various sources. NB is widely used to categorize documents and has a
high classification performance. NB computes the likelihood of documents categorized into different
classes and then designates them to the class with the highest likelihood. NB, like many other algorithms,
has numerous advantages. It is widely regarded as one of the most powerful algorithms in this field. NB
Simple to understand and implement. NB has some limitations, such as the requirement for class
occurrence because it is based on probability, whereas probability is usually based on the frequency of
occurrence [16].

Decision trees: Decision Tree classifiers, in addition to the Naive Bayes classifier, produce
excellent spam detection results. Because the model is simple, the decision tree classifier is a popular
machine learning technique. Marie-Sainte et al [4] showed how Abdallah et al demonstrated their hybrid
approach, in which they combined a rule-based approach with a decision tree, outperformed existing
classifiers for the Arabic Named Entity Recognition application. [4]

This algorithm is a Java-based implementation of the C4.5 algorithm. The Decision Tree
algorithm is used to divide data based on attribute values. Depending on the testing set phase, it can be
used for classifications in the form of generated rules or decision trees. The most important feature of the
decision tree algorithm is its ability to learn disjunctive expressions that are suitable for document
classification. However, the decision tree algorithm has some drawbacks, such as the interference of
irrelevant features, which may have a negative impact on its performance [18]. Aboalnaser [16] presents

14
an idea for using a decision tree to recognize the fonts of some popular Arabic words. When these fonts
are identified, they are generalized to lines, paragraphs, or neighboring non-common words because these
components of textual material almost always use the same font. The decision tree was used to recognize
Arabic fonts. The total number of features is 48. In this paper, 36 fonts were discussed. The precision was
90.8 percent. Other fonts provided 100 percent accuracy. The average time needed for recognition was
about 0.30 seconds.

2- Unsupervised Learning Method

Unsupervised learning does not require any prior data as input. It is the method by which the
model learns on its own using the data that you provide. The data is not labeled in this case, but the
algorithm aids the model in forming clusters of similar types of data [15].

For example, if we have dog, duck, and cat data, the model will process and train itself using the
data. Because it has no prior experience with the data, it will form clusters based on feature similarities.

Cats and dogs with similar characteristics will end up in the same cluster, as was done in Figure 4

The primary goal of unsupervised learning is to generate classification labels automatically.


These algorithms look for similarities between pieces of data to see if they can be categorized and
grouped. These groups are referred to as clusters, and they represent a broad range of clustering machine
learning techniques.

Unsupervised learning models, which conduct the three processes of clustering, association, and
dimensionality reduction, are useful tools for working with massive amounts of data.

Figure 4: Unsupervised Learning Mechanism

15
2.2 Natural Language Processing
An intelligent machine that can interact like a human being can be created using a field of study
called natural language processing, which analyzes language for its meaning. The language that
individuals naturally speak, like Arabic, is called natural language. Additionally, the NLP system accepts
a string of sentences as input and provides structured representations that fully capture their meaning. [19]

Natural Language Understanding (NLU) and Natural Language Generation (NLG) are the two
subfields of NLP. Machines can understand natural language thanks to the NLU and evaluate it by
extracting concepts, entities, emotions, keywords, etc. And the NLG is a method for creating meaningful
clauses, sentences, and paragraphs from an internal representation. [20]

NLP has issues such as:

• Multilingualism: 7100 languages are spoken throughout the world; some simply work
differently, and each has its own grammar. Therefore, various methods are required to develop
language models that can be used with all of these languages [21].

• Ambiguity: is the capacity to have more than one meaning or to be understood in more than
one manner. There are different kinds of ambiguity, for example:

1- Lexical ambiguity: a word can have more than one meaning. For instance, "the boy was
crying" and "the student may leave the class". The verb "cry" is unclear in the first phrase.
It can mean two things. It could be a reference to shouting or weeping. Therefore, it's
unclear from this statement whether the boy was weeping or shouting. Due to its dual
meaning, the auxiliary verb in the second sentence causes ambiguity. In one sense, the
student's exit from the class is feasible but not certain. In the second interpretation, the
teacher has given the student permission to leave.
2- Structural ambiguity: There are two possible meanings for the sentence. For instance, "The
man saw the girl with a telescope." This illustration can mean two different things. The
first "the man saw (the girl) (with a telescope)" It indicates that the man was looking
through the telescope to see the girl. The second "The man saw (the girl with a telescope)"
which indicates that it was the girl who was carrying the telescope . This demonstrates that
structural ambiguity is not caused by the words themselves, but rather by the possible
relationships between the elements that make up the sentence [22] [19].

16
2.3 Arabic Natural Language Processing (ANLP) based on Machine Learning
As it has mentioned in previous section, Natural language processing helps the machine to
understand human speech and the correct meaning from context, which increases its effectiveness and
accuracy to produce better results, However, processing the Arabic language is one of the biggest
challenges for several reasons according to CAMeL team, which are:

1- Language forms variation: it has three formats, which are Classical Standard Arabic for the
Qur'an, formal modern, and informal that used in dialects that vary as well.
2- Morphological richness: we can extract thousands of conjugations from one word root.
3- orthographic Ambiguity: sometimes it is hard to distinguish the word meaning without
diacritics, e.g., there are two possible meanings of the sentence " ‫ ضرب أحمد محمد‬,"It is very
challenging to determine who beat whom? Did Ahmed beat Mohammed? Or Ahmed was
beaten by Mohammed? We cannot distinguish the subject from the object in the sentence
because there are no diacritics.

Many techniques have emerged for Arabic Natural Language Processing, Table 2 shows an
example for the process, that goes through several which are:

1- Cleaning/Filtration: removing diacritics, punctuation marks, and anything that could be


neglected and has no phonetic value, such as the "tatweel" [5] [23].
2- Normalization: it has two different uses [23]:
1) letters that are so often misspelled unify to one form, e.g., the Ta-Marbuta (‫ )ة‬to Ha
(‫)ه‬.
2) Break up Unicode that appears as a combined sequence, e.g. (‫ )ﷺ‬to (‫)صلى هللا عليه وسلم‬.
3- Tokenization: the process of splitting sentences into words; each division is called a token
[5].
4- Stemming: get the word root by removing its suffix and prefix, e.g. (‫ )يكتبون‬will be
(‫ ون‬+ ‫ كتب‬+ ‫)يـ‬, where (‫ )كتب‬is the root [5].
5- Lemmatization: it is similar to stemming but the difference is that lemmatization uses lexical
information to turn a word to its correct root, e.g. (‫ )سيكتشفونه‬its root will be (‫[ )إكتشاف‬24].

Table 2: Example of ANLP Operations [4]

Operation Example Example


[Before applying the [After applying the
operation] operation]

17
Data Cleaning ‫ذهب أحمد إلى‬ ‫ذهب أحمد المدرسة‬
‫المدرسة‬
(Ahmed went to
school)
Normalization ‫ذهب أحمد إلى المدرسة‬ ‫ذهب احمد الى المدرسه‬
Tokenization ‫ذهب أحمد إلى المدرسة‬ [ ،‫ إلى‬،‫ أحمد‬،‫ذهب‬
‫]المدرسة‬
Stemming ،‫ الكاتب‬،‫)المكتبة‬ ‫کتب‬
)‫الكتاب‬ (Wrote)
(The library), (the
writer), (the book)

2.4 Methods to get WhatsApp Messages


One of the most widely used messaging apps right now that works across all platforms is
WhatsApp. It enables you to communicate with your contacts via messaging, voice and video
conversations, and file sharing. We found several methods to collect WhatsApp messages that will be
discussed in this section, which are Extracting WhatsApp messages from the phone's local storage,
Extracting WhatsApp messages from notifications, and Scraping messages from WhatsApp web.

2.4.1 Extract WhatsApp messages from the phone's local storage


One of WhatsApp's primaries selling features is that it supports End-to-End encryption, which
ensures that no one can read your messages but you and the person with whom you are corresponding.
This includes WhatsApp itself.

The fact that WhatsApp does not keep a record of your communication history on its servers is
another crucial aspect of the service. WhatsApp only stores messages you send on its servers for a
maximum of 30 days or until the recipient receives them. Even then, WhatsApp cannot read your message
due to end-to-end encryption. A message is only ever kept on WhatsApp's servers if the intended recipient
is unable to receive it (maybe because they are offline or don't have a WhatsApp account). In situations
like those, WhatsApp automatically deletes the message(s) you sent from its system after 30 days. you
may be wondering where your communications are kept if WhatsApp doesn't keep them on their servers
in light of this. WhatsApp messages are kept locally on the phone as encrypted backups.

The location of WhatsApp messages on an Android device will depend on how the device is

18
configured, so we'll need to look through the settings to see where the messages are kept.

By default, WhatsApp will make a local backup every day at two in the morning (on Android).
This can be found in the phone's file system under "WhatsApp/Databases." A week's worth of backups is
stored by the program, each with a date. But we won't be able to read any of the information because
these will be encrypted.

We must root the phone to get to the file, gaining root access essentially gives you more
permissions. With root access, you may launch specialized programs that need administrator-level
permissions, change, or replace system applications and settings, and carry out other tasks that are
otherwise unavailable to regular Android users. However, rooting a phone could void the product's
warranty. Additionally, it can render the device unstable or, if done incorrectly, might disable the device
entirely, therefore this technique was excluded.

Types of WhatsApp Message Encryptions

End-to-end encryption was provided by WhatsApp as one of its security features in September
2012. This action is being done to stop session hijacking and packet analysis, which frequently occurred
in the past.

All data on WhatsApp is encrypted using the crypt2, crypt5, crypt7, crypt8, crypt12, and crypt14
forms. This makes it nearly impossible to read all chat messages by hacking the database files.

How to decrypt WhatsApp files?

WhatsApp updates its chat files backup (crypt14 file) every night at 2 am. therefore, we need to
read it at every updated new message, then we will consider crypt14 saved files, therefore reading
messages will not be instantaneous.

2.4.2 Extract WhatsApp messages from notifications


A notification is a message that can be displayed outside of the application's default User
Interface, according to the Google Android website [25].

We can read the notifications from Android applications. Such notifications for low battery or

19
messages from Facebook or WhatsApp. Even we are able to read the call notification.

To read the notifications we need to use NotificationListenerService class, we can use it to listen
when notifications are posted or removed.

2.4.3 Scrape messages from WhatsApp web


Data scraping is one of the earliest methods for obtaining information from the Internet [26]. The
word "scrapers" has replaced the term "wrapper," which was once used to extract data and transform it
into the relational form [27]. Since data scraping deals with a variety of visual and textual data, it has
recently become incredibly effective. "Scraping data" or "extracting data" is the process used to obtain
information from the Internet. In particular, via Social Media sites, it can be done manually or
automatically with minimal programming to undergo further processing or storage [28]. The practice of
data scraping has expanded significantly in recent years, and it is now used for a variety of visual and
textual data. One of the many data extraction tools, such as Scrapy and Selenium WebDriver Python-
based open-source framework, can be used to scrape data from the Internet. After being scraped, the data
will be organized into text files so that its features may be easily accessed.

Using Selenium WebDriver, which is capable of completely automating all browser actions, we
can build code to read WhatsApp messages and use browser profiles to scan QR codes once. First: Set up
a browser profile and manually log in using a number (one time). Second: If you use this browser profile
when you launch a web driver, web.whatsapp.com won't prompt you for a QR scan again.

Due to the time constrain we couldn’t make this method work, although it is the best, but we used
the notification instead to read the messages.

2.5 Literature Review


In this section, we focus on discussing other research have a similar idea to our project.

20
There is a research that was conducted by Moreno et al. in 2019 [29] who developed a parental
control app on the Android platform to monitor sent and received messages on WhatsApp of teens'
phones, the application analyzes and classifies messages using natural language processing to detect any
threats like drugs, sex, and pulley to alert their parents, but the researchers used an insecure method to
access private WhatsApp messages, leaving behind a security breach that could put the device at risk.

Then in 2019, a group of Arab researchers [30], developed a real-time tool that parents can use to
monitor the activities of their kids on Twitter and alert them directly when any form of bullying is
detected in Arabic tweets, The tool's detection is limited to monitor public messages or "tweets" and its
warning is also limited to only bullying messages.

There is also research conducted by Jamoussi et al. in 2022 [31], They suggest a child protection
app protects children from online threats it analyzes children's online activities, monitors constantly used
dangerous vocabulary, and informs parents of the harm. But the application has not been implemented
yet.

There is a review conducted by AlGhamdi and Khan in 2020 [32], It provides a system that finds
suspicious messages in Twitter tweets, The system tokens and preprocesses the dataset collected from
Twitter tweets, the dataset used to train the classifier using (6) machine learning algorithms and the
algorithms used are: k-nearest neighbors, artificial neural networks, linear discriminant algorithm, support
vector machine, decision tree, and long short-term memory networks. A comparison was made between
them in terms of speed of execution, accuracy, and confusion matrices of the classifier. The results
showed that SVM achieved the best results while ANN is the lowest algorithm.

Kateb and Kalita conducted research in 2015 [33], This research discusses the difficulty of
processing data in social media (Twitter) due to the short content like tweets and conversations that can
be short of social media content, unlike long documents, The shortness of the content causes inaccuracy
of the results. The research also discusses another challenge which is the huge flow of data that is
constantly added, the research gives some successful solutions to overcome the problem of short text and
ways to overcome the flow of data.

In 2009 Farghaly and Shaalan conducted research [34], This research describes some of the
challenges that exist in Arabic Natural Language Processing (ANLP). And provides some solutions that
help overcome these challenges and also shows the general features of the Arabic language and its
specific characteristics of it.

21
A review conducted by Kanan et al. in 2019 [5], This paper uses Arabic machine learning with
social media and reviews the most used ANLP tools with AML software on social media to determine the
best tool.

The last research conducted by Alsubait and Alfageh in 2021 [35], talks about discovering
bullying texts from YouTube comments where they compareed machine learning algorithms by using
three models: Complement Naïve Bayes (CNB), Multinomial Naïve Bayes (MNB), and Linear
Regression (LR). The experiment was carried out using two feature extraction methods. feature extraction
used to reduce dimensionality in machine learning the method used is Count Vectorizer and Tfidf
Vectorizer both used to convert text data into a machine-readable format. The result of the research is that
when using a count vectorizer the Logistic Regression model can outperform both Naïve Bayes models
and Multinomial Complement and when using a Tfidf vectorizer can Complement Naive Bayes and can
also outperform the other two models.

22
Chapter 3: SYSTEM ANALYSIS
3.1 System Requirements
3.1.1 Functional and data requirements
3.1.2 Non-functional requirements
3.2 System Diagrams
3.2.1 Use Case Diagram
3.2.2 DFDs
3.2.3 Sequence Diagram
3.2.4 Activity Diagram
3.2.5 Class Diagram

23
SYSTEM ANALYSIS
The system requirements and diagrams are shown in this chapter's description of the software
demonstration. System requirements are specified in section 3.1. Diagrams are used to explain the system
in section 3.2.

3.1 System Requirements


System requirements are descriptions of what the system must do, how it must behave, what
characteristics, it must have, and what the system limitations are, and it is divided into functional
requirements and non-functional requirements.

To gather requirements in this chapter and to know what are the most important features that we
need to include in our application to be distinctive and achieve the reaching the intended goal, a
questionnaire has been published on social media. About 162 answered. It was also used to ask the
opinion of the target group about the idea of the application and how much they need it and whether they
are using similar existing applications (see Appendix A for more details).

3.1.1 Functional requirements


A Functional Requirement (FR) describes what the system should do, in other words, it outlines
the functions that software must accomplish. It describes a piece of software or a software system. The
following are the functional requirement of the system:

1 The system will ask the parent whether it is the child's device or the parent's device for the first time
the application is downloaded.

2 If the "parent's device" was selected, this means the parent is using the application on his/her device.

2.1 the parent can create an account in the system.

2.1.1 The parent can create an account with specific information (name, email,
password, gender), all the fields are required.

2.1.2 Information going to be registered in the database if the email wasn't existed, in
another word " unique ".

2.1.3 The system will send a verification code to the email and will allow the user to
request resending the code, then parent will enter the code and if it matches the

24
sent code, a message " ‫ " تم تسجيلك بنجاح‬will be displayed. And if it doesn't match it
the system will display a message that says” ‫الرمز ال يطابق الرجاء ادخال الرمز مرة‬
‫”اخرى‬

2.1.4 If the email was already registered in the database, the system will alert the user
to log in instead of creating a new account.

2.2 The parent can login via his/her account.

2.2.1 The parent can login after creating the account by the email and password used to
create the account.

2.2.2 The system will check the entered information with the accounts stored in the
database.

2.2.2.1.1. If there wasn't any match, an error message will be displayed “ ‫البريد اإللكتروني غير‬
‫صالح‬/‫”كلمة المرور خاطئة‬, Otherwise, the parent will login successfully.

2.2.3 The password can be reset if the parent forgot it by email, then the system will
send a verification message only if the email was registered in the database, then
the user can change the password.

2.2.3.1 If the email was stored in the database, then the system will allow the
parent to change the password.

2.2.3.2 If the email did not exist in the database the parent will get an error
message “‫ يرجى التحقق منه وإعادة المحاولة‬،‫البريد اإللكتروني غير صالح‬.”

2.3 The parent can add up to 3 children.

2.3.1 The parent can add a child by creating a simple account for him/her using the
name, age, and gender of the child.

2.3.2 The system will check if the account was already registered, it will display an
error message “‫هذا الطفل مضاف‬.” Otherwise, the child will be added.

2.3.3 If the parent added three children, the “add child” button will disappear.

2.4 The system will show the parent the alerts of inappropriate messages from the child's
device that contains (inappropriate message content, the date and time the message was
sent, name of the sender).

2.4.1 The system will ask the parent if he/she wants to save the alert.

25
2.4.2 If he/she agrees, the alert will be saved in the alert history, otherwise, it will not
be saved.

2.5 Alerts for all children will be displayed and listed for the parent on the homepage for two
weeks.

2.5.1 If a specific child is selected, its alerts will be displayed alone.

2.6 The parent can view the alerts from the history and delete alerts if he/she wants.

2.7 The system gives advice to the parent to help them deal with inappropriate alerts they
received from their child’s messages.

2.8 The system provides a help center for the parent to explain how the application works
and what are the frequently asked questions and their answers.

2.9 The parent can edit the accounts.

2.9.1 The parent can edit his/her account information.

2.9.2 The parent can edit the child's account information.

2.10 The parent can delete the accounts.

2.10.1 The parent can delete the child's account and stop the system from monitoring the
child's messages.

2.10.2 The parent can delete his/her account.

2.11 The parent can log out from his/her account.

3 If the "child's device" field was selected, this means the parent is using the application on his/her
child's device.

3.1 The parent must have an account that will be used to login and connect the child's device
with the parent's device, login process will be like step 2.2.

3.2 The system will take some permissions to monitor the child's WhatsApp messages
correctly.

3.2.1 The application will be able to listen to the device notifications after taking the
required permission.

3.2.2 The system will filter the notifications and collect only WhatsApp messages
notifications.

26
3.3 The application will be hidden from the child's device.

3.4 The system shall be able to detect inappropriate messages in the child's device.

3.4.1 The system will classify the messages into appropriate or inappropriate.

3.4.2 The application shall send alerts to the parent's device only if it detects any
inappropriate messages.

3.1.2 Non-functional requirements


A set of specifications known as non-functional requirements, or NFRs, explain the system's
operational capabilities and constraints and make an effort to increase its functionality. These are the
requirements that define how well it will function, such as security, reliability, and speed. The system's
non-functional requirements are as follows:

1. Security

• The user can have an account secured with password to save his/her personal information.

• The system shall ask for needed permission only.

2. Privacy

• The data of each user and its analysis cannot be viewed by other users.

• The system shall protect the child's privacy by not showing all the messages to the parent, but
rather the inappropriate messages only.

3. Availability

• The system shall be available and provide its services to the users 99% per week.

4. Performance
• The performance should be high so that the system can detect messages and alert the parent
in a short time.

5. Usability
• We expect the app interfaces and icons to be clear to the user so that it is easy to understand
how to use the app.

27
6. Reliability
• The system shall be reliable when classifying messages as inappropriate or not.

7. Portability
• The system shall work on the android platform.

3.2 System Diagrams


The system diagrams, which include use case diagrams, DFD diagrams, sequence diagrams, activity
diagrams, and class diagrams, are represented in this section.

3.2.1 Use Case Diagram


A use case is a used to show how the actor interacts with system in order to achieve a goal. The
actor can be a human or an external system.

The first use case diagram shown in Figure 5 represents the main functions of the system without
including the create account and login process, it shows 2 users interacting with the system, the
user(parent on his device) interacts with the system via 3 main functions: (1) receive alerts, (2) add a
child which has an include relation with “save child information” This relation means that the behavior of
the “save child information” use case is part of the “add a child” use case, so when the user adds a child,
the system will save child information in the database, and (3) get advice.

So, after the user (parent on his device) logins to the system, he/she is able to receive alerts, add a
child to the system, and can get advice.

The second user(parent on child’s devices) interacts with one use case which is give permissions
which has an include readership with “read messages” This relation means that read messages only
happens if the user gives permission, “read messages” has an include relation with “detect inappropriate
messages” which is done by Machine learning tool(“ML tool”), “detect inappropriate messages” has an
include relation with “save inappropriate messages” which are saved in the database this relation means
that in order for the system to save messages in the database it will have to detect inappropriate messages
first, and “save inappropriate messages” has an include relation with “receive alerts” this relation means
that when detecting inappropriate messages this will lead to sending alert to the parent on his/her device.

28
Figure 5: Software Use Case Diagram – ‫ | اتقاء‬Etiqa’a system main functions (ESMF).

Figure 6 shows how the parent on his device can use ‫ | اتقاء‬Etiqa’a system, the parent can (1)
create account which has an include relation with “save user information” and “send verification email”,
which means that “save user information” is a part of create account, so when the user creates and
account the system will save user information in the database, and “send verification email” is part of
create account which means when the user creates and account, the system will send a verification email
to email system. The user can (2) receive alerts, (3) get advice and (4) add a child, they all have an
include relation with login which means “receive alerts”, “get advice” and “add a child” are a part of
“login”, “add a child” has an include relation with “save child information” this relation means that “save
child information” is a part of “add a child”, so when the user(parent) adds a child, the child’s information
is stored in the database, “login” has an extend relation with “display error message”, this relation means
“display error message” will happen under a certain condition relating to “login”.

29
‫اتقاء‬ |

Figure 6: Software Use Case Diagram – ‫| اتقاء‬Etiqa’a system on parents’ device.

30
The third use case is showcased in Figure 7 which is about parents’ behavior with ‫ | اتقاء‬Etiqa’a
on child’s device, the user can give permission which has an include relation with “login” this relation
means that in order for the user to give permission he/she has to login first, “login” has an extend relation
with “display error message” this relation n means that “display error message” will only happen under a
certain condition, give permissions has an include readership with “read messages” This relation means
that read messages only happens if the user gives permission, “read messages” has an include relation
with “detect inappropriate messages” which is done by Machine learning tool(“ML tool”), “detect
inappropriate messages” has an include relation with “save inappropriate messages” which are saved in
the database this relation means that in order for the system to save messages in the database it will have
to detect inappropriate messages first, and “save inappropriate messages” has an include relation with
“receive alerts” this relation means that when detecting inappropriate messages this will lead to sending
alert to the parent on his/her device.

‫| اتقاء‬

Figure 7: Software Use Case Diagram – ‫| اتقاء‬Etiqa’a system on child’s device

31
Table 3: Use Case Scenario for Create account

Use Case Name Create account Issue Date 26/10/2022


Use Case ID UC01
• Actors Parent on his/her device, database
• Description The user wants to create an account on his/her device
• Data Name, email, password, gender
• Stimulus Click on create account button
• Response The system displays a message to inform the user that the
account has been created successfully
• The flow of Event(s) • The user opens the application.
• The user has 2 options displayed to him/her.
1: This is my device, 2: this is my child’s device
• The user clicks option 1, to confirm he/she is
using the application on their own device [A1]
• The user has 2 options displayed 1:login 2:create
an account
• The user chooses option 2, to create an account
• The user enters his/her information
• The system checks if there is an existing account
with the same information [E1]
• The system sends an email verification code to
user’s email [A2]
• The user writes the code in the system
• The system checks the codes [E2]
• The system saves user information in the database
• The system displays a message to inform the user
that the account has been created successfully
• The use case ends
• Exceptional/Alternate Flow(s) [A1] The user clicks on option 2
• The user is taken login page
• The use case ends

[E1] The email exists in the database


• The system displays a message that informs the
user that the email already exists in the database
• The user recognizes the error
• The system asks the user to use another email
• The use case continues

[A2] User clicks on “re-send code” button


• The system resends the code
• The use case continues

[E2] The code is invalid


• The system displays an error message saying the

32
code doesn’t match
• The user acknowledges the error
• The user re-writes the code
• use case continues
• Constraint(s) The email must be unique in the system database

Table 4: Use Case Scenario for login

Use Case Name Login Issue Date 26/10/2022


Use Case ID UC02
• Actors Parent on child’s device, parent on his device
• Description The parent wants to login
• Data Email, password
• Stimulus Click on login button
• Response The user gets access to the application
• The flow of Event(s) • The user opens the application
• The user has 2 options displayed to them 1:
this is my device, 2: this is my child’s
device
• The user clicks option 2, to confirm he/she
is using the application on the child’s
device [A1]
• The user clicks the login button
• The user enters email and password
• The user clicks on login button [A2]
• The system checks the email and password
[E1]
• The user gets access to the application
• Exceptional/Alternate Flow(s) [A1] The user clicks option 1
• The user is taken to a page that has 2
options 1:login, 2:create an account
• The user chooses option 1
• The use case continues

[E1] Email and password don’t match with data


stored in database
• The system notifies the user with a
message to inform him/her that the email
and password don’t exist in the database.
• The user recognizes the error.
• The system requests the user to write the
correct email and password.
• The use case continues.
• Constraint(s) The parent must create an account on his/her own
device before logging in on the child’s device.
The
• Email and password must match with the

33
data stored in the database.

Table 5: Use Case Scenario for give permission

Use Case Name Give permission Issue Date 28/10/2022


Use Case ID UC03
• Actors Parent on child’s device
• Description The user wants to monitor his/her child’s
WhatsApp messages
• Data -
• Stimulus Choosing which child the device belongs to after
login
• Response Having access to child’s WhatsApp messages
• The flow of Event(s) • The user logs in
• The user accesses the application and is
taken to the home page where he/she is
asked to choose which child’s device the
application is downloaded on
• The user chooses the child associated with
the device
• The user is asked permission to access the
child’s WhatsApp messages
• The user clicks “Allow” [A1]
• The system accesses child’s messages
• The user is taken out of the application
• The application disappears from child’s
device
• Exceptional/Alternate Flow(s) [A1] The user clicks “Deny”
• A message is displayed to the user saying
“ ‫يحتاج التطبيق لالذن من اجل الوصول لرسائل‬
.‫”الواتساب الخاصة بالطفل‬
• The user is given 2 choices, 1:give access ,
2: deny and exit
• The user chooses option 2
• The user is taken out of the application
• The use case ends

[A1] The user clicks “Deny”


• A message is displayed to the user saying
“ ‫يحتاج التطبيق لالذن من اجل الوصول لرسائل‬
.‫”الواتساب الخاصة بالطفل‬
• The user is given 2 choices, 1:give access ,
2: deny and exit
• The user chooses option 1
• The use case continues

34
• Constraint(s) • Allow the system to access child’s
messages

Table 6: Use Case Scenario for add a child

Use Case Name Add a child Issue Date 28/10/2022


Use Case ID UC04
• Actors Parent on his device
• Description Parent on his device wants to add a child
• Data Name, age, gender
• Stimulus Click on add child button
• Response Child added to the system
• The flow of Event(s) • The parent clicks on add child button
• The parent enters child’s information
• The system checks if the child already
exists [E1]
• The child is added to the system
• The system checks number of added
children [A1]

• Exceptional/Alternate Flow(s) [E1] Child account already exists.


• The system displays an error message
saying “‫”الطفل مسجل‬
• The user acknowledges the error.
• The user changes child information
• The use case continues.

[E1] Child account already exists.


• The system displays an error message
saying “the child already exists”
• The user acknowledges the error.
• The use case ends.

[A1] Added child is child number 3.


• The system disables the add a child button.

• Constraint(s) • Parent on his device must be logged in

35
Table 7: Use Case Scenario for get advice

Use Case Name Get advice Issue Date 28/10/2022


Use Case ID UC05
• Actors Parent on his device
• Description The parent seeking to get advice
• Data -
• Stimulus Click on get advice button
• Response Display articles
• The flow of Event(s) • The parent moves to advice section by
clicking on advice icon in the bar.
• The system gives the user topics to choose
from
• The parent chooses a topic.
• The system displays articles about chosen
topic.
• Exceptional/Alternate Flow(s) -
• Constraint(s) Parent on his device must be logged in

Table 8: Use Case Scenario for receive alerts

Use Case Name Receive alerts Issue Date 28/10/2022


Use Case ID UC06
• Actors Parent on his device
• Description The parent receives an alert from the system
• Data Inappropriate message content, date, and time the
message was sent, name of the sender
• Stimulus -
• Response -
• The flow of Event(s) • The parent receives an alert that contains
the inappropriate data.
• The parent clicks on the alert
• The system asks the parent if he/she wants
to save the alert.
• The parent clicks yes [A1]
• The alert is saved to alert history
• Exceptional/Alternate Flow(s) [A1] The parents click no
• the alert will be deleted from the
homepage.
• Use case ends
• Constraint(s) • Parent on his device must be logged in

36
3.2.2 DFDs
A data flow diagram (DFD) shows how data will flow through the system and how it is
processed.

Context level diagram:

The context diagram for the relationship between ‫ | اتقاء‬Etiqa'a system and the external entities is
shown in Figure 8, parent on his device, email system, parent on child’s device, and machine learning
tool. The parent on his device fills his/her information: name, email, password, and gender into ‫| اتقاء‬
Etiqa’a system to create an account then the system will send a verification code to the email, then he/she
can log in with the email and password to add a child with his/her name, age, and gender and then logs in
from the child's device with his account that he/she created to take the permissions to access the
WhatsApp messages notifications, then the machine learning tool receives the and processes them to
produce the classifications (appropriate messages or not). After that, the system sends alerts to the parent's
device if an inappropriate message is detected. The alert contains message content, date, time, and sender
name.

He/ She can also reset his/her password when he/she forgets it, edit account information, and take
advice to help them deal with alerts issues they received from their children.

37
Figure 8: Software context level diagram

DFD level 0

The system processes are shown in Data Flow Diagram Level 0 is shown in Figure 9. process 1
“Create an account” the parent on his device fills in his/her information: name, email, password and
gender then the system will send the verification code to the e-mail, then enter the code and if it matches
the sent code, a registration confirmation message will display and stores the information in the parent
data store. process 2 “Login” the parent should enter his/her email and password to login into the system
or can process 3 “Reset password” when he forgot it by sending a verification message to parent’s email.
In process 4 “Add a child” the parent can add a child with his/her name, age, and gender and stores the
information in the child data store. In process 5 “Listen to device notification” the parent logs in from the
child's device with his account that he created to take the permissions to access the WhatsApp messages
and then send request to API with notification details. Then process 6 “call API” sends the messages to
the machine learning tool and analyzes them to produce the classification result (appropriate messages or
not) then store it in WhatsappMessage data store. After that, the parent on his device in process 7 “send
an alert” receive an alert if an inappropriate message is detected with message content, date, time, and
sender name. In process 8 “Get advice” the parent can get advice to help them deal with alerts issues they
received from their children. In process 9 “Edit account settings” he can edit his/her account information
and then update it in the parent data store.

38
Figure 9: Software DFD Diagram – Level 0

DFD level 1 – Send an alert

Data Flow Diagram Level 1 for process 7 “Send an alert” demonstrates the send an alert process,
which is shown in Figure 10. It contains process 7.1 “generate an alert” which takes inappropriate
messages and sends it to the parent’s device. In process 7.2 “Display alert list on homepage” the system
display list of alerts coming from the WhatsappMessage data store to the homepage of parent’s device.
The parent can save the alert, then the WhatsappMessage data store will be updated that the message has
been saved Then, if the parent selects a specific child the system will display his/her alert only process
7.3 “Display specific child alert.”

39
Figure 10: Software DFD Diagram – level 1 - Send an alert

DFD level 1 - Edit account settings

Data Flow Diagram Level 1 for process 9 “Edit account settings” demonstrates the edit account
settings process, is shown in Figure 11. It contains process 9.1 “Update account information” the parent
gives information to update his/her account the updates will be stored in the parent data store. In process
9.2 “Delete an account” the parent request to delete his/her account, then the account information will be
deleted from the parent data store. In process 9.3 “Update child information” and process 9.4 “Delete a
child,” the same as the previous two processes occur, and the information is stored in the child data store.
In process 9.5 “Display alert history” the system will retrieve all the alerts that the parent has saved from
the WhatsappMessage data store. Finally, in process 9.6 “Display help center” the system provides a help
center for the parent to explain how the application works and what are the frequently asked questions
and their answers. In process 9.7 “Logout” the parent can logout from the application.

40
Figure 11: Software DFD Diagram – level 1 - Edit account settings.

3.2.3 Sequence Diagram


Sequence diagram model the interaction between actors and objects in the system.

Figure 12 shows that a parent on his/her device can log in by writing the email and password then
the application will check if the information is valid by comparing it with the information in the database
if the information is not valid an error message will appear else the user will be taken to home page,
parent can create account by writing his/her email, password, and gender, after that the application will
check if the user is valid by comparing it with users saved in the database if user not valid an error
message will appear else the user will be saved.

41
Figure 12: Software Sequence Diagram -Parent device (create account, log in)

Figure 13 shows that the parent on his/her device can add child by entering the child's name and
age after checking, if the child is not added before the child will be saved in the data base but need to
connect the child device to the application, to connect child device parent must log in from the child
device and choose the child he/she entered before from his/her device then child device will be connected
to the application.

42
Figure 13: Software Sequence Diagram -Parent device (add child), child device (log in, Give
permission)

Figure 14 shows that the parent on his/her device can view the alert of the inappropriate message content
for all children he/she has added, if he/she chooses a specific child then just the alert of that child will be
shown, the parent can see more information about the alert, and can save the alert in history.

43
Figure 14: Software Sequence Diagram -Parent device (view alert, advice )

Figure 15 shows that the parent on his/her device can see is/her account information and can edit
or delete his/her account. The parent can view the child he/she has and their information, he/she can also
edit or delete the child, and the parent can add a child as we mentioned before.

44
Figure 15: Software Sequence Diagram -Parent device (settings)

45
Figure 16 shows that the parent on his/her device can view the alert he/she saved before in the
database, he/she also can see more information about the alert and unsaved alert, he/she can see the help if
he/she needed any help using the application.

Figure 16: Software Sequence Diagram -Parent device (settings 2)

46
3.2.4 Activity Diagram
Activity diagrams are graphical representations of workflows that include activities and actions to
support choice, iteration, and concurrency.

The first activity diagram shown in Figure 17 represents the account creation activity on
the parent's device. First, the user must select the main device to create an account. Secondly, the login
page will appear for the user, then the user will choose "Register Now," and the account creation page
will appear for him to enter his information. Then, the system will check whether the information is
unique or not. If the information is not unique, the system will send an error message. Otherwise, the
system will send the verification code to the email entered by the user, and then the user will enter the
code to create the account. In case the verification code is valid, the user’s information will be saved in
the database, and confirmation page for creating an account will be displayed. If it is invalid, the user can
re-enter the code or re-send it. He/she can also go back and enter his/her information again.

Figure 17: Activity Diagram -Parent device (create account)

47
Figure 18 shows a diagram of the login activity on parent's device and child's device. First, the
user will select the device he/she is using; in both cases a login page will appear for the user to enter their
information. Then the system will check whether the information is in the database or not. If the
information is not present, the system will send an error message to re-enter his/her information again. In
the other case, the system will allow the user to log in. If the user is logged in with his/her device, the
user's home page will appear. If it is through the child's device, the inactive children list page will appear
to the user.

Figure 18: Activity Diagram - (Login)

Figure 19 shows the activity diagram of a parent adding a child to his/her account. First, the user
can add a child either from the home page or the settings page. If the user chooses to add from the settings
page, the user can move to the children list page and then to the addition page. If the addition is from the
home page, the user will be taken directly to the addition page. In both cases, the parent can add a child
by entering the child's information. The system will check if the child is already registered and display an
error message to the user. Otherwise, the child will register.

48
Figure 19: Activity Diagram - Parent device (Add child)

Figure 20 shows an activity diagram of how to get permission for the child's device. Firstly, the
parent should log in on the child's device using his/her account. The system will display the children's list
page. Then the parent selects the child and gives permission for the system to listen to device
notifications. Finally, the app will disappear.

49
Figure 20: Activity Diagram – child device (get permission)

Figure 21 shows an activity diagram for detecting inappropriate messages. At first, the system
will receive input messages. The system will check if the message is inappropriate or not. If the message
is appropriate, the message will be ignored. In the other case, the system will alert the parent.

50
Figure 21: Activity Diagram – (detect inappropriate message)

Figure 20: Activity Diagram – (detect inappropriate message)


Figure 22 shows an activity diagram of saved messages in alert history. Firstly, the system will
display the homepage to the user, including all inappropriate messages. Then the user can select a specific
message, and it will appear with more information. The system will display a question for the user to save
the message or not. If the user chooses yes, the message will be saved in the alert history. If the user
chooses no, the message will be deleted.

51
Figure 22: Activity Diagram –parent device (save message)

Figure 23 shows an activity diagram for getting advice. First, the system will display the advice
page to the user. Then the user can select a specific advice type and it will appear with more details.

52
Figure 23: Activity Diagram –parent device (get advice)

Figure 24 shows an activity diagram of a deleted account. Firstly, the system will display the
settings page to the user, and the user can access the account information page. Then the user can delete
his/her account.

Figure 24: Activity Diagram –parent device (delete account)

53
3.2.5 Class Diagram
Class Diagram is a form of static structure diagram that displays a system's classes, attributes,
operations, and relationships between objects to illustrate the structure of the system.

Figure 25 shows the class diagram of ‫ | اتقاء‬Etiqa’a project, which consists of 6 classes, starting
from the Parent class, only parents will be able to create an account with their name, email, password,
and gender, then login with the email and the password used, verify the email by a verification code that
will be sent to the email using emailVerificationCode method, reset the password in case they forgot it
and edit or delete the account, they can also add their children to their account, where the application
allows parents to add up to 3 children using the child's name, age, and gender through Child class, and
each child will belong to only one parent who can edit or delete the account.

After adding children, the application will listen for all the child’s device notifications and filter
them through the Notification class to get only WhatsApp notifications, then the filtered messages will be
sent to the MessageAnalysis class, in this class, the software will process the message through Arabic
natural language processing (ANLP method), then vectorize it using vectorizer and classify with the
model into appropriate or inappropriate.

If the application found inappropriate messages, it will create an alert using the Alert class for
each inappropriate message that contains the message sender, time and the message contents then send it
to the parents to warn them, the parent can view some advice that could help them to address the issue.

There will be an alerts history for each child in the parent account that will be created
automatically after adding the child through the AlertsHistory class, which will let the parent save their
child's alerts because they will be destroyed when their date expires.

Child cannot exist without parent, also notification and alertHistory will not be existed without a
child, this is why there is a composition relation between them.

54
Figure 25: Class Diagram of ‫ | اتقاء‬Etiqa’a system

55
Chapter 4: DESIGN CONSIDERATIONS
4.1 Design Constraints
4.1.1 Hardware environment
4.1.2 End user characteristics
4.2 Architectural Strategies
4.2.1 Algorithms to be used
4.2.2 Project management strategies
4.2.3 Development method

56
DESIGN CONSIDERATIONS
In this chapter, we will discuss what are the design constraints (hardware and software
environment, end-user characteristics) and the architectural strategies used in the implementation process
of ‫ | اتقاء‬Etiqa’a application.

4.1 Design Constraints


The constraints that are imposed on the design solution are called Design constraints.

These restrictions are usually imposed by the development organization, the customer, or external
regulations. Hardware, software, operational procedures, interfaces, data, and any other component of the
system can be constrained.

4.1.1 Hardware environment

Hardware:

The system will be compatible with Android devices that have the following attributes:

• The device type is a smartphone.

• The device runs on android version 6.0.1(Marshmallow) or above.

• The device is connected to the internet.

• The device has a Minimum of 4GB RAM and 32GB storage.

• The parent device must support Google Play services.

4.1.2 End user characteristics


Table 9 below shows the end-user characteristics who will use ‫ | اتقاء‬Etiqa’a system.

57
Table 9: End-User Characteristics

User Characteristics

Full population of Arab parents who have children from the age
Size of the user group
of 7 to 16.

Age range No particular age ranges.

Gender The application can be used by both males and females.

Arabic will be the main language.


Language and
The system will reveal some of the terms that are known to the
culture
Arabs as being inappropriate

Educational
At least can read and has a little experience with technology.
level/Qualifications

For now, the system is not using any assistance tools for people
Disabilities with physical/visual handicaps to use the system, thus they are
not included.

The user may need convincement skills to convince the child to


Special Skills download the application on his/her device if the user does not
have access to it

4.2 Architectural Strategies


Define any design decisions and/or techniques that impact the general organization and higher-
level system structures. These strategies provide insight into the key abstractions and mechanisms of the
system architecture.

4.2.1 Algorithm to be used


We used supervised machine learning and chose to test our model with the following algorithms that we
found from research’s that are similar to the idea of our project.

Alsubait and Alfageh [35] talked about discovering bullying texts from YouTube comments and

58
used three machine learning algorithms to train the model, The results of their research showed that the
best algorithms they used were.

• Complement Naïve Bayes (NB) classifier: It's far a version of the Multinomial Naïve Bayes
that uses statistics from the complement of every class to decide the model’s weight.

• Logistic Regression (LR): It's a linear classification model, which takes a variable vector and
evaluates the weights for every variable then predicts item class as a vector.

AlGhamdi and khan [32] created a system that finds suspicious messages in Twitter tweets and used six
supervised machine learning algorithms, The results of their research showed that the best algorithms they
used were:

• Support Vector Machine (SVM): Used for solving classification problems. Its training
algorithm builds a model that assigns examples from the text into classes. The goal is to produce
a classification model, based on the training set and predict the testing set. through the training
phase, only a subset of the training dataset is needed.

• k-Nearest Neighbors (KNN): May be used for classification by using leveraging similarities
among textual content. Having a set of training data with labels. When given one of the testing
data, it compares its vocabulary with those trained before Then, take the most similar.

4.2.2 Project management strategies


We used a program called (Trello) to manage and plan our project. Trello is a project
management tool, it manages tasks among team members by creating cards and giving tasks to each
member, it also shows the task progress in the card, and it shows the deadline for card (task). It can be
downloaded on mobile phones (Android or iPhone) so that it is easy to see the tasks, also the program is
free.

59
Figure 26: Project management –Trello program card

Gantt chart

Gantt chart is a visual representation of tasks, it shows what work is scheduled and when every
task must be submitted. Gantt chart of our project management plan can be found in Appendix B .

Figure 27: Waterfall model

4.2.3 Development method


Waterfall methodology was followed to develop ‫ | اتقاء‬Etiqa’a project, which is a strict approach

60
with 5 phases as shown in .‫ خطأ! لم يتم العثور على مصدر المرجع‬that flow sequentially emulating a cascade w
aterfall in its diagrammatic and processes flows, where no phase begins until the prior phase is complete,
also returning to the previous phase is not allowed.

1- Requirement gathering and analysis: this phase describes how the system will work through
requirements and analyze them using different types of UML diagrams.

For this phase a questionnaire has been used to study the feasibility of the project, determine the age
group targeted by the project and provide space for end users to suggest desired features, after that a
study for previous works from research and similar applications has been done to find the drawbacks
and finally decide the project requirements, which was analyzed using DFD, Use Case, Active,
Sequence, and Class Diagram.

2- System design: this phase focus on the system design from all its aspect, which are the architecture
design, database design, and interfaces or prototype design.

The project has a relational database that has been designed using a conceptual ER-Diagram, where
interfaces were designed based on the design principles in addition to usability goals that have been
taken into consideration.

3- Implementation: design and implementation phases are interleaved, where we convert the structure
into an executable program to satisfy the desired function requirements.

The application is created either by creating a program from scratch or by reusing and configuring
already existing components. Program errors are then found and fixed during debugging.

The implantation of our project starts by building the machine learning model and the user interfaces,
followed by building and integrating the database with the application after coding the function for
both child and parent device, and finally integrating the model with the application.

4- Testing: during the testing phase, developers execute the system using test cases produced from the
specification of the real data to determine whether the code and programming meets the requirement
and intended functions, so it has 3 stages: component testing done by the developer, system tested by
testing team, and user testing which is done by end users.

For our project, the tests that were carried out are: Unit testing, Integration testing which was done

61
after each component that was integrated, such as integrating the model with the application, and the
last test done by us was system testing after the whole project was finished, we test each requirement
to make sure that the system work correctly.

After we finished the development test, we moved to the user test and tested the acceptence of our
application by the users.

5- Maintenance: After the product has been fully operational, this phase begins. Software upgrades,
corrections, and repairs are all examples of software maintenance. Application upgrades and
integration with newly deployed systems by the customer are frequent requirements.

But for a graduation project, this phase would not be necessary.

62
Chapter 5: SYSTEM DESIGN
5.1 System Architecture
5.2 System Database
5.3 Interface Design

63
SYSTEM DESIGN
The system design is presented in this chapter. The architecture of the system is shown in Section
5.1, the Database design using the entity relationship diagram is shown in Section 5.2, And the interface
design and its description is presented in Section 5.3.

5.1 System Architecture


System Architecture uses a few block diagrams to describe the main components and how they
work together to give a high-level description of the system architecture.

This application has six main components as shown in Figure 28 which are: Parent device
component, which has two subcomponents which are: Login component and Service component, Child
device component, which has two subcomponents which are: Login component and Notification
component, Database component, PhpAPI component, PythonAPI component and Machine learning
tool, through which inappropriate messages will be detected (It will be detailed in Chapter 7).

Firstly, the Parent device component contains Login component, in which the parent can enter
his/her email and password to be able to use the application. And Service component through which the
parent through which can get many services such as adding a child, get an alert, getting advice and
adjusting account settings. the PhpAPI component interact with Parent device component by receiving a
request from it to obtain this services or update information, and a response will be returned to it.

Secondly, the Child device component contains Login component, in which the parent can enter
his/her email and password and then give permission to the Notification component to allow the system to
monitor notifications which in turn interacts with the PythonAPI component by sending request with
notifications to process them.

Lastly, The PythonAPI component send the notification details to Machine learning tool
component then get the classification of it. And if the notification is inappropriate, it will be stored in the
Database component then send alert to the parent’s device.

64
Figure 28: Component architecture of ‫ | اتقاء‬Etiqa’a system.

5.2 System DatabaseFigure 27: Component architecture of ‫ | اتقاء‬Etiqa’a system.


‫ | اتقاء‬Etiqa'a system database structure was modeled using ER-Diagram in Chen notation.

Entity Relationship Diagrams, or ER-Diagrams, shows the relationships between the entity sets
that are maintained in a database and the attributes to explain the logical structure of databases.

‫ | اتقاء‬Etiqa'a system database shown in Figure 29 consists of 4 entities and 3 relationships, a


Parent entity will be strong with the ID attribute as the primary key and name, email, gender, and
password as other simple attributes, in addition to the token attribute that will be used to send the alert
notification for the parent, and finally the verify code . each parent will have 0 or more children, while the
child will belong to one parent only.

The Child entity depends on Parent entity, so it is weak, it has a name attribute as a partial
primary key, in addition to the gender and age attributes.

A child may receive WhatsApp messages, then the messages will go through processing and

65
classification to labeled as either appropriate or inappropriate, only inappropriate WhatsApp messages
will be stored to show them to the parent, WhatsAppMessage entity attributes are sender, message
content, date and time the message was received, and msg_ID as a partial primary key to identify each
message.

the inappropriate messages will remain until its expirationDate denotes that they have been
expired unless the parent chooses to save and keep them.

There will be an Advice entity that gives the parent some advice which could help them deal with
or address the issue, the entity consists of category attribute where we will classify the advice into several
categories, and each category will consist of several a sections that will be distinguished using title
attribute, reference URL and ID as primary attribute.

Figure 29: Entity Relationship Diagram (ERD) of ‫ | اتقاء‬Etiqa’a system

• Mapping Entity Relation Diagram to Relational Schema


Figure
This part explains the28: Entity Relationship
conversion Diagram
of ER Diagram to the(ERD) of ‫اتقاء‬
relational | Etiqa’a
schema system.
which is shown in Figure
30

66
1- Mapping of regular entities
The ER-Diagram of Etiqa'a consists of 2 regular entities, Parent and Advice, a relation table has
been created for each of them with their simple attributes.
2- Mapping of weak entities
The ER-Diagram of Etiqa'a consists of 2 weak entities, Child and WhatsAppMessages, a
relation table has been created for each of them with their simple attributes, and due to their weak
type each of the relations included the owner primary key to be a foreign key in their table and
composite primary key with their partial key.
The Child table included the primary key ParentID from its owner table Parent, while
WhatsAppMessage table is owned by the Child table, therefor it included the Child primary
key, which is a composite key of the ChildID and the ParentID

3- Mapping of 1:N relationships


In this step we need to identify the relations that participate in the N-side and include the primary
key of the other side to them. This step has been done while mapping the weak entities.

Figure 30: Mapping ERD to Relational Schema of ‫ | اتقاء‬Etiqa'a system

Figure x:…

67
• Normalization for Relational Schema
This part shows the process of minimizing data redundancy if it exists.
o First Normal Form (1NF)

There is no multivalued attribute.

o Second Normal Form (2NF)

There is no partial dependency.

o Third Normal Form (3NF)

There is no transitive dependency.

5.3 Interface Design


In this section the interface design will be represented, which includes the Interface Structure Design
(ISD), and the prototype.

5.3.1 Interface Structure Design (ISD)


The interface structure design outlines the fundamental parts of the interface and how they
interact to give users functionality. The relationship between each screen and form utilized by the system
is displayed using an interface structure diagram (ISD), as well as how the user navigates between them
[36]. Figure 31 shows (ISD) of ‫ | اتقاء‬Etiqa’a system.

68
Figure 31: Interface Structure Design (ISD) of ‫ | اتقاء‬Etiqa’a system.

5.3.2 Prototype
Figure 29: Interface Structure Design (ISD) of ‫ | اتقاء‬Etiqa’a system.
Design Principles were considered when designing the application interfaces, which are:
Visibility, Feedback, Constraints, Consistency, and Affordance.

As shown in Figure 32, when a user initially launches the application, an interface with the
application's logo and a brief description of the application appears.

69
Figure 32: 0- About the application interface.

As shown in Figure 33, the app will then display an interface with the parent's device and the child's
device as options for the user to enter the app.

Figure 30: 0- About the application interface.

Figure 33: 1- Device selection interface.

After that, if the user selects


Figurethe
31:parent's device,
1- Device a screen
selection with two options—creating an account
interface.
and logging in—will appear. As shown in Figure 34.

70
Figure 34: 2- Create an account or login selection interface

The interfaces for creating an account and logging in are shown in Figure 35 and Figure 36.

Figure 32: 2- Create an account or login selection interface.

Figure 35: 2.1- Create an account interface.

71
Figure 36: 2.2- Login interface

After that the user enters his/her information, a verification code will be sent to the email entered
by the user, and an interface will appear to verify the code as shown in Figure 37.

Figure 37: 2.1.1- Entering verification code interface

72
A screen that leads to a login will appear once the user creates an account, as shown in Figure 38.

Figure 38: 2.1.1.1- Confirmation interface

Figure 39 shows the screen that will appear after the login is complete and contains some
instructions for using the device.

Figure 39: 2.2.1- Welcoming interface.

73
If the user had previously registered children, the user would then be presented with a homepage
that contains the inappropriate messages, as shown in Figure 40. If no children have yet been added, the
homepage will show up as in Figure 41.

Figure 40: 2.2.1.2- Parent's Figure 41: 2.2.1.1- Parent's homepage with no
homepage with child added interface child added interface

As shown in Figure 42, a specific message will appear with additional information if the user
selects it.

Figure 37: 2.2.1.2- Parent's


homepage with child added interface.

Figure 42: 2.2.1.2.1- Alert in more detail interface

74
The advice interfaces are shown in Figure 43 and Figure 44.

Figure 43: 2.2.1.2.2- Advice category Figure 44: 2.2.1.2.2.1- Specific


interface category advice interface

The settings interface is shown in Figure 45.

Figure 45: 2.2.1.2.3- Account settings interface.

75
The user can switch to other interfaces from the Settings interface, as seen in Figure 46, Figure
47, Figure 48, and Figure 49.

Figure 46: 2.2.1.2.3.1- Account info Figure 47: 2.2.1.2.3.2- Children list
interface. interface.

Figure 48: 2.2.1.2.3.3- Alert history Figure 49: 2.2.1.2.3.4- Help center
interface interface

76
From the previous Figure 46, the user can go to the account editing interface as shown in Figure
50 and if he/she chooses to delete the account, a warning window will appear as shown in Figure 51.

Figure 50: 2.2.1.2.3.1.1- Edit account Figure 51: 2.2.1.2.3.1.1- Delete


info interface. warning window.

From the previous Figure 47, the user can move to an interface that enables him/her to add a child
as shown in Figure 52. After adding the child, a user interface will appear containing the child’s
information through which he can modify and delete the child’s account, as shown in the following
Figure 53 and Figure 54.

77
Figure 52: 2.2.1.2.3.2.3- Add child Figure 53: 2.2.1.2.3.2.2- Not activated
interface child's device interface

Figure 54: 2.2.1.2.3.2.1.1- Edit not


activated child's device interface

Also, the previous Figure 53 shows


Figure a child
52: whose procedure
2.2.1.2.3.2.1.1- Edit notis still incomplete. The processes to
finish the child's procedures are in the child's child's
activated device device
shown interface
in the following Figure 55, Figure 56, Figure
57, and Figure 58.

Figure 51: 2.2.1.2.3.2.1.1- Edit not


activated child's device interface
78
Figure 55: 3.2- Choose a child Figure 56: 3.2.1- Inactive child
parent's homepage with child added interface

Figure 53: 3.2- Choose a child Figure 54: 3.2.1- Inactive child
parent's homepage with child added interface

Figure 52: 3.2- Choose a child Figure 53: 3.2.2- Inactive child
parent's homepage with child added interface.
interface.

Figure 57: 3.2.1.1- Permission Figure 58: 3.2.1.1.1- Activation


window terminated interface

Figure 55: 3.2.1.1- Permission Figure 56: 3.2.1.1.1- Activation


window terminated interface
From the help center interface in the previous Figure 49, the user can move to interfaces that
explain the methods of using the application and others, as shown in Figure 59 and Figure 60.

Figure 54: Permission window. .Figure 55: 3.2.1- Active child interface

79
Figure 59: 2.2.1.2.3.4.1- Application Figure 60: 2.2.1.2.3.4.2- Instructions for
instructions interface adding a child interface

Figure 57: 2.2.1.2.3.4.1- Application Figure 58: 2.2.1.2.3.4.2- Instructions for


In the end, ifinstructions
the user wants to delete his/her account,adding
interface the interface in Figure 50 will enable
a child interface
him/her to do so, and an interface will appear confirming the deletion of the account as in Figure 61.

Figure 56: 2.2.1.2.3.4.1 Application Figure 57: 2.2.1.2.3.4.2- Instructions for


instructions interface. adding a child interface.

Figure 61: 2.2.1.2.3.1.1.1- Confirm


account deletion interface

Figure 59: 2.2.1.2.3.1.1.1- Confirm


account deletion interface

80
Figure 58: 2.2.1.2.3.1.1.1- Confirm
account deletion interface.
Chapter 6: DATA GATHERING
6.1 Instagram “Cyberbullying” Dataset

6.2 Twitter “Dangerous” Dataset

6.3 Multi Platforms Offensive Language Dataset

6.4 Twitter “Offensive” Dataset

81
Chapter 6: DATA GATHERING
To detect harmful/inappropriate words in Arabic, we needed a dataset to train our model. We
combined the datasets listed below and labeled them as APROP for appropriate comments and
NOT_APROP for inappropriate ones, and we used the combined dataset to train our model.

6.1 Instagram “Cyberbullying” Dataset


Dataset collected by ALBayari et al [37] data was gathered to introduce the first Instagram Arabic
corpus and contribute to closing the gap in Arabic language modeling.

To find accounts, an internet search for Arab social influencers was conducted. Google was used
to find accounts of: Arabic (fashionistas, singers, YouTubers, and bloggers) who had been bullied.

To make sure that the accounts selected would meet the objectives of study, they used the
following quality assessment criteria: Instagram profiles, Arabic accounts, The post must have at least
200 comments.

In March 2021, they crawled Instagram and posted dates ranging from 2019 to 2021 using the
official Instagram APIs, 200,000 Arabic comments in total was collected.

Dataset Labeling

The manual labeling approach was chosen because of the different dialects, as well as some
comments that may contain bullying/hatred without any obvious offensive words. The labeling task was
done by three annotators who were from three different Arabic dialects (Jordanian, Egyptian, and one is
Iraqi). All of the annotators had a bachelor's degree and were between the ages of 23 and 27. After
categorizing the comments as (positive/negative/neutral), they classified the negative comments further
by categorizing them according to their level of negativity into two categories (toxic and bullying), as
shown in Table 10.‫خطأ! لم يتم العثور على مصدر المرجع‬. The annotators also manually labeled the dialect. If the d
ialect of the comment was not obvious, NA was written by the annotators (not available).

82
Table 10: labeling samples

Dataset Descriptive Analysis

There were 46,898 comments in total, with 18,193 being negative, 17,376 being positive, and
11,329 being neutral. The annotators were asked to reclassify the negative comments into two groups
(bullying or toxic). There were 12,256 bullying comments, 5937 toxic comments, 17,376 positive
comments, and 11,329 neutral comments in the final corpus. The dataset included four dialects: Egyptian,
MSA, Gulf, and Levantine. Table 11 shows sample of the gulf data.

Table 11: part of the Gulf comments in the dataset.

83
6.2 Twitter “Dangerous” Dataset
Dataset was collected by Alshehri et al [38] constructed ‘dangerous’ seed list was used to search
Twitter. REST API was used in 2020 for two weeks, 2.8M tweets were collected, then user ids were
extracted from all the users who had contributed the REST API data (a total of 399K users), the timelines
of those users was crawled resulting in 705M tweets, 107.5M tweets which had one or more items from
the ‘dangerous’ seed list was acquired, the combined datasets (the REST API dataset and the dataset
based on the timelines) resulted in 110.3M tweets

Dataset Labeling

At first 1K tweets from the REST API dataset were randomly sampled. And Two of the authors
annotated each tweet and labeled them as (‘dangerous’) or not (‘safe’). The sample annotation’s Kappa
(κ) resulted in a score of 0.57, then another random sample of 4K tweets (for a total size of 5K) was
added to the annotation pool. After wide revisions of the disagreement cases by the two annotators, the κ
score for the whole dataset (5K) was found to be at 0.90.

The resulted annotated dataset had a total of 1, 375 tweets in the ‘dangerous’ class and 3, 636 in
the ‘non-dangerous’ class.

To further understand dangerous language, 5, 011 tweets from the annotated dataset were
analyzed. They identify a number of patterns in the data, cutting across both the ‘dangerous’ and ‘safe’
classes, Table 12 shows sample of the dangerous seed and emojies. Also the dialect was manually labeled
by the annotators.

Table 12: Top 10 most frequent ‘dangerous’ seeds and emojis in REST API dataset.

84
6.3 Multi Platforms Offensive Language Dataset
The dataset was collected by Absar Chowdhury et al [39]. Amazon Mechanical Turk (AMT) was
used to annotate collected dataset. The data was collected from three different online platforms: Twitter,
Facebook, and YouTube. In addition to the offensive comments, the contents were manually annotated to
analyze the distribution of hate speech (HS) and vulgar (but not hate) (V) content.

Dataset Labeling

The dataset includes binary labels: Non-Offensive or Offensive as shown in Table 13. The label is
the final label agreed upon by at least 2 (out of 3) annotators, then the labeling was done by an expert who
further classified the offensive comments, mentioning if the comment is either hate speech (HS), vulgar
(V) or just offensive (-).

Table 13: binary labels of the dataset

6.4 Twitter “Offensive” Dataset


The dataset was collected by Mubarak et al [40]. This is currently the largest available dataset,
which researchers intend to make public along with annotation guidelines. The goal was to create a large
dataset of Arabic offensive language that is not biased toward specific dialects, topics, or goal by not
using a seed list of offensive words. They used methodology to tag a 10,000 Arabic tweet dataset for
offensiveness, which accounted for roughly 19% of the tweets. Tweets were also classified as vulgar or
hate speech. They use this dataset to characterize Arabic offensive language in order to determine the
topics, dialects, and gender of users who use offensive language the most. One of the major challenges
was that offensive tweets render up a small percentage of total tweets. To quantify their proportion, they
took three random samples of tweets from different days, each with 1,000 tweets, and discovered that
only 1-2 percent of them were offensive (including pornographic advertisements)

Dataset Labeling

Following the OffensEval2019 guidelines, they developed annotation guidelines in collaboration


with an experienced annotator who is a native Arabic speaker with good knowledge of various Arabic

85
dialects. Tweets were assigned one of four labels: offensive, vulgar, hate speech, or clean. Because the
offensive label encompasses both vulgar and hate speech, and vulgarity and hate speech are not mutually
exclusive, a tweet can be solely offensive or offensive, vulgar, and/or hate speech.

The annotation adhered to the following guidelines:

OFFENSIVE (OFF): Offensive Tweets contain explicit or implicit insults or attacks on other
people, as well as inappropriate language, such as Direct threats or incitement.

VULGAR (VLG): Vulgar tweets are offensive tweets containing expletives, such as references to
private parts or sexual acts.

HATE SPEECH (HS): Hate speech tweets are offensive tweets that target a specific group based
on shared characteristics such as Race, ex: ̇‫“( يا زنجي‬yA znjy” – “O Negro”)

CLEAN (CLN): Clean tweets do not contain vulgar or offensive language.

86
Chapter 7: IMPLEMENTATION
7.1 Development Tools

7.2 Machine Learning Component


7.2.1 Preparing Data

7.2.1.1 Datasets Merging and Labels Unifying


7.2.1.2 Data Cleaning
7.2.1.3 Data Processing Using ANLP
7.2.1.4 Feature Extracting
7.2.2 Model Building

7.2.2.1 Algorithm Selection


7.2.2.2 Model Training
7.2.2.3 Performance Evaluation
7.2.2.4 Model Exporting
7.3 Database Component
7.3.1 Create Tables

7.3.2 Create an Event to Delete Unsaved Messages Every


Two Weeks

7.4 PHP API Component

7.5 Parent Device Component

7.6 Child Device Component

7.7 Python API Component

87
Chapter 7: IMPLEMENTATION
This chapter presents the tools and the implementation of the system. Section 7.1 presents the
development tools of the system and, Section 7.2 presents the machine learning model implementation,
section 7.3 and 7.4 presents the database implementation, section 7.5 and 7.6 presents the mobile
application implementation, and the last section 7.7 present the model integration with the application.

7.1 Development Tools


• For the Application:
o Flutter
A framework based on dart language that is created and supported by Google.
Flutter is used to create cross-platform applications; therefore, it can be used to create apps
for both iOS and Android, it can also be used to create desktop and web applications, which
will be useful for the future expanding plan.
with flutter we can develop apps in short time and high quality with beautiful UI supported
Material design [41].

o Visual Studio Code


Free, easy-to-use, and lightweight editor with an excellent Flutter support, This Flutter
support is offered through a VS Code extension, and broad use among developers so it has
many helpful resources [42].

• For the Machine Learning:


o Google Colaboratory
We can build and run Python code with preloaded libraries using Google Colab, which is a
cloud-based research platform for data science and machine learning. We can also
import/save notebooks from/to Google Drive, document the code, and share the notebook
easily [43].

o Scikit-Learn
is an easy-to-use open-source data analysis library that serves as the best standard for
Machine Learning in the Python environment. It includes algorithmic decision-making

88
methods such as classification to identify and categorize data according to patterns, which
was used to build our model, as well as evaluation methods and matrix for the machine
learning model evaluation phase, as well as many vectorizer and feature extraction techniques
[44].

• For Natural Language Processing (NLP)


o CAMeL tool
Python toolkit that allows sentiment analysis, named entity recognition, dialect identification,
morphological modeling, and pre-processing of Arabic and Arabic dialects, which is
discretization, normalizing word by providing rules that unify spelling differences,
tokenization to split sentence into words called tokens, and finally stemming and
lemmatization.
These utilities are covered by the command-line interfaces (CLIs) and application
programming interfaces (APIs) [45].

o NLTK
NLTK stand for Natural Language Toolkit (NLTK), which is a popular open-source Python
library for NLP that support many languages, the Arabic language is one of them. For text
tokenization, stemming, stop word removal, and so on [46].

• For the Database


o PHPMyAdmin

Free software tool in PHP language, dealing with MySQL over the web, supports a vast
variety of operations on MySQL and MariaDB. Used operations (handling databases,
permissions, users, columns, relations, tables, indexes, and many others) may be done
through the user interface. At the same time, continue to have the capability to execute any
SQL statement directly. [47]

• For linking the model to the application:


o Flask
A popular micro web framework for Python API development is flask. Because it does not
need any special tools or libraries and aims to keep the core basic but extensible, it is known
as a micro web framework. It just provides the fundamental components for development,

89
such as request handling, routing, etc. The Flask application is great for beginners because it's
so simple to use. It can be applied to both straightforward and complex applications.
Additionally, it is used to quickly and easily deploy machine learning models [48].

7.2 Machine Learning Component


“‫ | اتقاء‬Etiqa'a” is an application that uses machine learning to detect inappropriate Arabic content
in WhatsApp private messages, for the phase 1 we need a model that can process and classify the Arabic
language text messages into appropriate or inappropriate label according to its content, the needed process
to establish the model is shown in Figure 62.

Figure 62: Machine Learning Model

7.2.1 Data Preparation


We obtained multiple datasets from various platforms; in this section, we worked on the
combined data sets mentioned in Section 6.1.
The datasets were combined, resulting in a single dataset with 64K+ rows and two columns, one
containing the text (the message) and the other containing its label indicating whether it is appropriate or
inappropriate. The dataset was then cleaned of any non-Arabic letter, character, number, or emoji.
processed with ANLP and Vectorized.

7.2.1.1 Datasets Merging and Labels Unifying


With the exception of the dangerous Twitter dataset, three of the four datasets mentioned in the
Dataset Collection section 6.1 were fully merged. The dangerous twitter dataset was excluded due to its
labeling process that was based on emojis which will be removed in the cleaning phase, However, after

90
cleaning and reviewing its labels a part of its data was used in order to balance between appropriate and
inappropriate classes, after merging we got 64662 text to train the model.

The mechanism of unifying the labels was as follows:

• Instagram Dataset: Comments were categorized into 4 labels: "toxic", "bullying", "neutral" and
"positive". The toxic and bullying were changed to inappropriate (NOT_APROP), The neutral and the
positive were changed to appropriate (APROP).
• Multi-Platform Dataset: Its data was classified into two labels: "offensive" and "non-offensive", the
label of the offensive was changed to inappropriate (NOT_APROP) and the non-offensive to
appropriate (APROP).
• Twitter Bullying Dataset: its tweets were categorized into 4 labels: “offensive”, “vulgar”,
“hateSpeech” and “clean”, the three first labels changed into inappropriate (NOT_APROP) and the
clean label was changed into appropriate (APROP).
• Twitter “Dangerous” Dataset: its tweets were categorized into 2 labels: “dangerous”, and “safe”,
the dangerous label changed into inappropriate (NOT_APROP) and the safe label was modified to be
appropriate (APROP).

A sample of the dataset before and after labels unifying shown in Table 14 and Table 15

Table 14: Example for Dataset Before Unifying Labels

Table 15: Example for Dataset After Unifying Labels

91
7.2.1.2 Data Cleaning
Arabic text cleaning is an essential step before building the machine learning model that will help
to remove the text noises and improve the model performance, which is typically informal (not standard).
It is more difficult because of factors like the presence of dialect text, frequent spelling errors, extra
characters, diacritical markings, elongations, and so on.

According to Hegazi et al. [49] the majority of the earlier algorithms clean the noises by
anticipating all potential noises, then searching for each of them within the text, and cleaning it. As a
result, the degree of noise anticipation determines how clean the text is, which can be challenging and
produce inaccurate results.

Therefore, in order to facilitate the process and increase its accuracy of cleaning we eliminated
any non-Arabic characters in addition to other stuff that were removed, such as hashtags in Twitter
datasets, Arabic diacritics or symbols, and so on, the summary of the cleaning process:

1. Eliminate duplicate rows.


2. Eliminate hashtags in Twitter datasets.
3. Eliminate any non-Arabic stuff (emojis, symbols, English words and letters, and so on)
4. Eliminate diacritics and Arabic punctuation or symbols.
5. Eliminate repeated characters.
6. Eliminate extra spaces with one space.
7. Trim spaces at the beginning and end of the sentence.
8. Eliminate empty rows or that with one character.
9. Mapp extended Urdu and Persian Letters to normal letter.
such as mapping ‫ ۈۇۆۅۄۋ‬to .‫و‬
10. Correct misspelled Arabic words.

cleaning(text):

all the previous cleaning steps except 9 and 10 were defined in this function using substring regular
expression function re.sub() to match the specified string, and strip() function to trim spaces.

The ninth step which is mapping was done manually on the data only due to the difference in the way
some letters are used among the Arabs, therefore no function was produced to do this step later on the text
messages.

92
the tenth step (correcting) was also done manually because we did not find any tool that corrects
misspelling Arabic dialects, and due to the time constrain the data was classified using CAMeL tool
dialect identifier pretrained model to identify each dialect in the data, after that we chose to filter them
and continue with Saudi Arabic dialect only.
and after cleaning the data we ended up with approximately 18000 rows of data, and Table 16 shows
sample of the data before and after cleaning.

Table 16: Sample of Cleaning Results

To find out the data distribution between our classes we plot a histogram, as we see in Figure 63 the
plot shows that the data is approximately balanced.

Figure 63:Data Distrbution

93
7.2.1.3 Data Processing Using ANLP
Data processing is the process of the data being manipulated by a computer, in this phase, the
data is converted from raw data to machine-readable form, NLP helps to get rid of ambiguity in the
language, it processes, analyzes, and understands a large amount of data.

The following steps were taken for data processing using NLP

1. Normalize common misspelled letters (‫ أإآ‬, ‫ ى‬, ‫)ة‬


This process establishes general rule to unify spelling differences between people that lead to the
same meaning, for example "‫ "يإخذك‬becomes "‫ "ياخذك‬to reduce the spelling difference that could
lead for so many vocabularies.
2. Tokenize
It is the process of splitting sentences into words; each division is called a token. Tokenizing was
done because some stemmer or lemmatize functions don’t have built in tokenizer, so it is done
when needed, otherwise, some lemmatizes or stemmers have a built-in tokenizer.

3. Use a lemmatizer or stemmer


Before starting this step, a deep dive into lemmatization and stemmers was done, to know the
difference between them and choose which one is appropriate for our data. A study was
conducted by Zeroual et al [50] to see the impact of stemming and lemmatization on Arabic, the
results showed that both stemmers and lemmatization had great results, this is why we planned on
testing both of these methods, the next step was to find the best algorithms for the Arabic
language. In 2021 an experiment was done by Alhawarat et al [51] to see which algorithms
(stemmers and lemmatizers) are more accurate when it comes to Arabic languages, the outcome
of the experiment showed that using Arabic light stemmer (ARLSTem), Farasa light stemmers,
Farasa and Qalsadi Lemmatizers, and Tashaphyne heavy stemmers generated the greatest results.
The best improvement in Pearson correlation was roughly 7.34 percent. Stemming often greatly
enhances sentence text performance, and this is also true for Arabic. However, some stemmers,
such as Khoja heavy stemmer and AlKhalil light stemmer, produce outcomes that are worse than
those for the original text.
The best 8 algorithms were chosen and tested, we found out that CAMeL stemmer and
lemmatizer works the best for us, Table 17 shows the chosen algorithms and the results of each
algorithm.

94
Table 17: The Result of Stemmers and Lemmatizers

Camel tool has a built in database for analyzing Gulf Arabic words (calima-glf-01). When we
tried it, the quality of stemming/lemmatizing was bad compared to Camel_lem and CAMeL_stem
which use the default database(calima-msa-r13), the default database uses a model
(MLEDisambiguator.pretrained()) that is already pre trained to find the best stemmer/lemmtizer
result automatically, while the Gulf Arabic database only gives us all the results and lets us
choose which stemmer/lemmatizer result we want, since we can’t tell which is best, the model
always ends up choosing the first choice even though the first choice isn’t always the best choice,
due to this we stuck with the default database(calima-msa-r13) since it gave much better results

4. Remove diacritics
Since CAMeL tool was used to extract words roots, it produced diacriticked root, therefore an
extra step to remove diacritics was needed.

ANLP(text):

all the previous processing steps were defined in this function everything that was used was from
CAMeL_tool library, starting with normalization, the function that was used is
normalize_alef_maksura_ar to replace all (‫ )ى‬with (‫)ي‬, normalize_alef _ar to replace any variation
of Alef (‫ )أإآ‬to plain one (‫)ا‬, normalize_alef_maksura_ar to replace any (‫ )ة‬with (‫)ه‬.
After that, the normalized text was tokenized using simple_word_tokenize function, then
disambiguate function in pretrained morphology disambiguate was used to stem and lemm the text,
lastly, we remove the diacritics using dediac_ar function.

95
Table 18 shows sample of the data after performing ANLP function.

Table 18: Sample of Processing Results

In this step we also removed stop words but after making a copy of the processed one so we can
test them all and find which one is the best.
For stop words removing we used mixed of NLTK stop words and multi dialect Arabic stop
words list that was collected by Alaa [52]

remove_stopwords(text):
We first split the text into single tokens using simple_word_tokenize from CAMeL_tools,
then iterate over each token to check if it exists in the stop words list or not, if it was exist then
the token will be deleted from the text, after the loop is finished the tokens will be joined back
to sentence using join method

7.2.1.4 Feature Extraction


Feature extraction is a crucial preprocessing step that must be used to extract numerical
and statistical features from the text by turning the unstructured text data into structured text
through turning the text into a vector so it can be used with machine learning algorithms, this is
known as text vectorization for feature extraction.
According to Aljarah et al. [53] the most common techniques are BoW, TF and TF-IDF,
and they explained them in the following way:
o Bag-of-Words (BoW) is a textual representational approach that views any text as a
collection of words and reflects the occurrences of words inside the text regardless of how
often they appear.
o Word Frequency (TF), which is similar to the BoW technique but different in that it focuses
on frequency of terms in the text rather than its presence only, the frequency is calculated by
finding the number of occurrences of each term in a text divided by the total number of terms

96
in the text, the most frequently occurring terms in a text are given the most weights, even if
they may be unimportant or uninformative.
o Frequency-Inverse Document Frequency (TF-IDF): One of the most sophisticated solutions
to the TF problem, which gives uncommon or rare terms in any text a higher weight than
frequent ones, by calculating the product of TF and IDF, where TF is the frequency of the
word in the current document, whereas the IDF is a measure of how rare the keyword is
across all documents.

Another popular feature extracting technique is the words N-gram, which is a continuous
series of N words or tokens from a given text, it could be a unigram of 1 word length as
illustrated in Table 19, bigram refers to length 2, trigram refers to length 3, and so on [54].

Table 19: Example of N-gram [54]

Two different researches have tested more than one feature extraction techniques, where
first research was by Abro et al. [55] used three types of features namely n-gram (bigram) with
TF-IDF, Word2vec and Doc2vec, the highest Fscore (77%) were obtained by SVM classifier
using TF-IDF with bigram features representation, while the other research that was done by
Maghfour et al. [56] tested TF with Unigram, TF with Unigram and Bigram, TF-IDF with
Unigram, and TF-IDF with Unigram and Bigram. the best performance was registered under NB
classifier through the configuration TF with Unigram (Fscore = 85.79%).

Because of the different nature of the data and the desired goal, the two (TF-IDF/Bigram,
TF/Unigram) techniques were tested to get the best results, and it was used from Scikit_Learn
library exactly feature_extraction.text module, for TF-IDF/Bigram
TfidfVectorizer(ngram_range=(1,2)) class was used, and for TF/Unigram
CountVectorizer(ngram_range=(1,1)) class was used, but before vectorizing, the data was split
into train and test using train_test_split method from Scikit_Learn library.

97
7.2.2.1 Algorithms Selection
In sections 2.1 and 2.5 we did a deep dive of researcher’s uses of algorithms and their results. In
4.2.1 we chose the algorithms that yielded the best results when it comes to Arabic language, the
following algorithms are the ones we chose: Complement Naïve Bayes classifier, Logistic
Regression, Support Vector Machine (SVM), k-Nearest Neighbors (KNN), and to make sure no good
algorithms were left out we added two more algorithms to build a model from, based on expert
recommendation, the following additional algorithms were used along with the others: Random forest
and Decision tree.

1- Naïve Bayes (NB): both Naive Bayes classifier for multinomial model and The Complement
Naive Bayes classifier were used to build a model, multinomial yielded the best results so it was
chosen for training and testing phase.

2- Logistic Regression (LR): Logistic Regression classifier was used with no added penalty, with
random_state set to None, and multi_class set to 'auto'.

3- Support Vector Machine (SVM): SVC classifier was tested using 4 different kernels: SVC with
linear kernel, SVC with linear kernel, SVC with RBF kernel and SVC with polynomial kernel,
polynomial was tested for different degrees from a range of 1 to 100, since SVC with RBF kernel
outperformed the others, it was chosen for training and testing phase.

4- K-Nearest Neighbors (KNN): K-Neighbors Classifier was tested with different Number of
neighbors (n_neighbors) ranging from 1 to 1000, the best n_neighbors value was at 46.

5- Random Forest (RF): The number of trees in the forest (n_estimatorsint) was tested in the range
of 90 to 250 with best results generating when the value was at 200.

6- Decision Tree (DT): Decision tree classifier was used with split at each node set to ‘best’, and
random_state set to None.

7.2.2.2 Model Training and Testing


Modules from Scikit_Learn library were used to create all the model and test it, the training score for
most of the models was above 90%. Each algorithm was tested using the two different vectorizers in 4
different dataset conditions:

98
1- Dataset features extracted by lemmatizing text and keeping the stop-words.
2- Dataset features extracted by stemming text and keeping the stop-words.
3- Dataset features extracted by lemmatizing text and with stop-words being removed.
4- Dataset features extracted by stemming text and with stop-words being removed.

Table 20 and Table 21 shows the accuracy score that was obtained from model training and testing.

Table 20: Accuracy Score for Training Models Using TF-IDF

Using TF-IDF Vectorizer


Naïve Bayes Logistic SVM KNN Random Decision
Regression forest tree
lemmatized
text with 77.8 % 76.6 % 77.2 % 72.2 % 76.8 % 70.3 %
stop-words
stemmed
text with 78.4 % 77.1 % 77.8 % 72.2 % 75.2 % 68.5 %
stop-words
lemmatized
text without 75.2 % 75.7 % 76.1 % 71.1 % 74.4 % 70.3 %
stop-words
stemmed
text without 75.3 % 75.6 % 75.4 % 71.5 % 74.8 % 70.7 %
stop-words

Table 21: Accuracy Score for Training Models Using Count Vectorizer

Using Count Vectorizer


Naïve Bayes Logistic SVM KNN Random Decision
Regression forest tree
lemmatized
text with 76.5 % 79.2 % 76.5 % 54.8 % 76.5 % 71.1 %
stop-words
stemmed
text with 76.4 % 78.9 % 76.3 % 54.8 % 74.6 % 68 %
stop-words
lemmatized
text without 75 % 75.7 % 74 % 52.7 % 73.1 % 71.2 %
stop-words
stemmed
text without 74.8 % 75.5 % 74 % 53 % 72.5 % 70.6 %
stop-words

99
The best accuracy score was for Logistic Regression Algorithm using Count Vectorizer that trained on
lemmatized text with stop-words which is 79.2 %, and the worst was for K-nearest Neighbor with 52.7 %
accuracy.

to determine how well our model operates and what the highest accuracy outcome it can get, we had to
train the model on different training sets, which requires to break our data into many distinct segments.
To do that we used k-fold cross validation technique, the basic idea of it is that it partitions the dataset
into k bins of equal size, and then runs k times, in each run it will take one k set to be the test data, and the
rest will be the training data [57], the best result was produced by lemmatized data with stop words from
Logistic Regression algorithm that used count vectorizer with 81.2% accuracy score.

7.2.2.3 Model Evaluation


The model was evaluated using the following evaluation methods:

1- Accuracy: is the number of correct calls (true-positive and true-negative) that were made in
proportion to total dataset [58] the accuracy formula showed in Figure 64, where t is true, f is
false, p is positive, and n is negative. Accuracy score for each model was showed in Table 20 and
Table 21.

Figure 64: Accuracy Formula [59]

2- Confusion matrix: is a table that lists the effectiveness of a classification model that show the
actual and predicted classes [58].
A confusion matrix for best score for each algorithm was calculated, and shown in the Figure
65,Figure 66 , Figure 67, Figure 68, Figure 69, and Figure 70. The confusion matrix was
calculated by plotting the confusion matrix as heatmap.

plot(y_true, y_pred)
this function was defined to take unique labels of our data, predicated labels were assigned as columns
while actual labels were assigned as rows, then DataFrame function was used to show table with data
from confusion matrix, and sns.heatmap was used to visualize the Confusion Matrix.

100
Figure 66: Confusion Matrix of NB Model Figure 65: Confusion Matrix of SVM Model

Figure 68: Confusion Matrix of RF Model Figure 67: Confusion Matrix of LR Model

Figure 70: Confusion Matrix of KNN Model Figure 69: Confusion Matrix of DT Model

101
3- F1-Score: is function of true-positive rate and positive predictive value (Precision and Recall) to
give overall indication of performance of classifier [58], Figure 71 shows F1-Score formula,
where P is Precision and R is Recall.

Figure 71: F1-Score Formula [59]

The F1-Score was found for the best accuracy score cases for each model, for NB the F1-score
was (80%), SVM (79.2%), RF (80%), LR (81.2%), KNN (76.4%), and DT (74.3%). The F1 score
that resulted from k-fold cross validation technique is 81.5% and it was for LR algorithm. The
difference between the F1-score and the accuracy score is very simple, this is because our data is
approximately balanced.

7.2.2.4 Model Exporting


When using the Scikit Learn library for machine learning, we must export the trained models and
vectorizer in a file and then restore them in order to test the model on new data. Data exporting is referred
to as serialization, and data retrieval as deserialization [60].

Pickle module is one of the most popular ways to serialize objects in Python, our machine
learning model may be saved to a file and serialized using Pickle. The trained model can be accessed and
used to make predictions by deserializing the file at a later time or in a different script. It provides the
following functions [60]:

• pickle.dump to serialize an object hierarchy, you simply use dump().


• pickle.load to deserialize a data stream, you call the loads() function.

102
7.3 Database component

7.3.1 Create Tables


• Parent table
o Table structure

Figure 72: Table structure for Parent table

o Indexes
PRIMARY KEY (`parent_id`),
UNIQUE KEY `email` (`email`);

• Child table
o Table structure

Figure 73: Table structure for Child table

o Indexes

PRIMARY KEY (`child_name`,`parent_id`),

103
FOREIGN KEY (`parent_id`) REFERENCES `parent` (`parent_id`) ON
DELETE CASCADE ON UPDATE CASCADE;

• WhatsApp message table


o Table structure

Figure 74: Table structure for WhatsApp message table

o Indexes
PRIMARY KEY (`msg_id`,`parent_id`,`child_name`),
FOREIGN KEY (`child_name`) REFERENCES `child` (`child_name`) ON
DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`parent_id`) REFERENCES `parent` (`parent_id`) ON
DELETE CASCADE ON UPDATE CASCADE;

• Advice table
o Table structure

Figure 75: Table structure for Advice table

o Indexes
PRIMARY KEY (`advice_id`),

104
7.3.2 Create an Event to Delete Unsaved Messages Every Two Weeks
Events in MySQL are tasks that carry out in accordance with a predetermined schedule. They are
sometimes called scheduled events. Events in MySQL are named objects that have one or more SQL
statements. They are carried out at a set number of intervals after being saved in the database. For
instance, you could design an event that runs every Sunday at 1:00 AM and optimizes every table in the
database. In many situations, including database table optimization, log cleanup, data preservation, and
the creation of intricate reports during off-peak hours, MySQL Events can be quite helpful [61].

So, Figure 76 shows the event that was created, which will be executed daily. It will delete
messages that the user hasn't saved and that are two weeks or more old.

Figure 76: delete_message_after_two_weeks event in etiqaa database

105
7.4 PHP API component
• To connect PHP file to the database, we used PDO (PHP Data Objects) it's a lightweight,
constant interface for having access to databases [62]. By creating an instance from PDO with
following information (database name, username, password) we can use SQL instructions
using PHP language to deal with the database.

• Since flutter can't deal with PHP, we used JSON. And JSON (JavaScript Object Notation) is
an interchange format for light-weight data [63]. We used it for data exchange between the
back end (PHP) and the front end (Flutter).

Example :
This is SQL instruction takes parent email and password and get the row with the
same information .
$stmt = $con->prepare("SELECT * From `parent` WHERE `password`
= $password AND `email` = $email ");

If a row with the same information is found in the database, a message in the form
of JSON is sent to flutter with the success or failure status of the operation.
$count = $stmt->rowCount();
if ($count > 0 ) {
echo json_encode(array("status"=> "success", 'data'
=>$data));
}else{
echo json_encode(array("status"=> "fail"));
}

106
Example :
In PHP file we can write SQL instruction take parent email and password and get
the row with the same information.
$stmt = $con->prepare("SELECT * From `parent` WHERE `password`
= $password AND `email` = $email ");

If a row with the same information is found in the database, then send a post
request with a message in the form of JSON to flutter with the success or failure
status of the operation.
$count = $stmt->rowCount();
if ($count > 0 ) {
echo json_encode(array("status"=> "success", 'data'
=>$data));
}else{
echo json_encode(array("status"=> "fail"));
}

• To connect flutter, we created two functions one deals with post request and the other deals
with get request, HTTP library is needed to handle the requests. To connect flutter, we created
two functions one deals with post request and the other deals with get request, HTTP library is
needed to deal with requests. And convert library is needed to change from JSON to dart.

The method postRequest(String url, Map data) that deals with post request.
This method takes the URL that contains the request and the data that we need to
send (like email and password in previous example). Then it uses http to save the
request that has the JSON message in variable.
var response = await http.post(Uri.parse(url), body: data);

After that, it decodes the JSON message and returns the success or failure status
that we can use in flutter.(check if parent exist in database in previous example).
var responsebody = jsonDecode(response.body);
return responsebody;

107
7.5 Parent device component
• Login
loginp ():
This method is called if a parent chooses to log in from the parent device, it
checks if the parent account exists in the database by searching for an account
with the same email and password. If the parent account does not exist, an error
message will appear. Otherwise, the parent will be taken to the home page and
update his token device in database. What a token is will be explained at the end
of the section.

• Create account.
Signup ():
This method is called if a parent chooses to sign up it only can be done on the
parent's device, it saves all parent account information in the database only if the
account does not exist before. If the parent account does exist in the database, an
error message will appear. Otherwise, the parent will be saved in the database
then an email will be sent containing the verify code saved in the database.
After signing up, the confirmation (): method will call.
This method checks if the verify code entered by the parent is like the verify code
in the database.

• Change password.
To change the password, the parent needs to confirm his/her email by
confirmation (): method if he/she succeeds the method forgetPassChange() will
be called.
This method will change the old password in the database to the new password.

108
• Add child.
addChild():
This method is called if parent wants to add a new child, it saves all new child
account information in the database unless the parent has a child with the same
name before. If there is a child with the same name in the database, an error
message will appear. Otherwise, the new child will be saved in the database.

• View inappropriate alerts.


messages ():
This method will display all the messages information associated with all
the children of this parent in the database.

Also, we have childMessage(int index): method.


This method displays message information for a specific child.

• Save and delete alert from alert history.


If the parent displays the alert information, an option will appear if he/she wants
to save the message to alert history.
When the parent chooses to save the alert the method saveMessage() will be call
When parent want to delete the alert the method deleteMessage() will be called .

• View the alerts from the history.

historyMessages ():
This method will display all the messages marked as saved in the database.

109
• Edit the accounts.
The parent can edit his/her account information.
The method accountInfo() display parent information saved in database , and the
method editAccount() will change the old information of parent account to the
new information .
The parent also can edit the child's account information.
If the parent wants to edit child information he/she need to choose one of his/her
children. the method childrenList() will display all the children that parent has.
After choosing one of the children, parent will be taken to child account page,
then he/she can edit this child information by calling the method editChild() this
method will replace old child information with the new information .

• Delete the accounts.


The parent can delete his/her account.
The method deleteAccount() will delete parent account from database.
The parent also can delete any one of his/her children account.
For the child account to be deleted, parent needs to choose one of his/her children.
After choosing one of the children, the method deleteChild() will delete child
account from database.

• Advice

advice ():
This method will display all the advices with specific category from the
database.

Regarding sending an alert to the parent's device, Firebase Cloud Messaging (FCM) was
used and will be detailed in Section 7.7. As for receiving alerts, Firebase must first be
added to the application, add the necessary dependencies, then configure it. An alert will
be sent to the parent's device by obtaining his/her token when he/she logs in. Each

110
instance of the client application is identified by a unique token string. To send a message
to a particular device, the token is necessary.
As for sending an alert to the user while he is inside the application, the alert will not
appear to the user unless you add an alert message or an internal alert. This can be done
using the flutter_local_notifications package.

• onMessage.listen

FirebaseMessaging.onMessage.listen((RemoteMessage event):
This method handles messages when your application is in foreground. A
RemoteMessage that contains information about the payload including its origin,
its unique ID, the time it was sent, whether it contained a notification, and more
[73]. Information will be displayed by flutterLocalNotificationsPlugin.show((
method which is from flutter_local_notifications package is used to show the alert
on the screen.

7.6 Child device component


• Login
loginc ():
This method is called if a parent chooses to log in from the child device, its
similar to loginp(), but the different is if parent account exists parent will be taken
to choose child page .

• Notification
flutter_notification_listener plugin is used to listen for all incoming notifications for Android.
Its features are [64]:
Service: launches a service to receive notifications.
Simple: The fields of a notification are easily accessible.
Backgrounded: After rebooting, run the dart code in the background to automatically start
the service.
Interactive: The flutter notification is interactive.

111
Flutter plugins are thin Dart wrappers on top of native (Java, Kotlin, ObjC, Swift) mobile
APIs and services. For instance, the only method to access a sensor on a phone is to create a
plugin or utilize one that is currently available. The plugin's API was created in Dart. The
plugin's implementation is written in Java/Kotlin for Android support, ObjC/Swift for iOS
support, or in both languages (for cross-platform support) [65].

This sub-component contains six methods which are: onInit, start Listening, callback,
initPlatformState, process message and activate the child account.

• onInit
@override
onInit():
initPlatformState()

This method is called initially when the screen is loaded, we need to call
initPlatformState method there to initialize the plugin.

• start Listening
startListening():
This method checks permission and starts the service.

• activate the child account


activateC():
This method changes the value of the isActive column to 1 in the child table in
the database.

112
• process message
processMsg(NotificationEvent msg):
• First, the http package is used to make POST requests to the server.
• Then, we must define the URL to which to send the POST request.
• This method takes the notification then send POST request from our
flutter application will be sent to the “/” route in the PythonAPI
component which we will discuss in the next section (7.7) with that
notification and its details.
• NotificationEvent is a built-in class, it provides title, message, package
name and date of each notification.

To run the code in the background we need the following methods:


• callback
static callback(NotificationEvent evt):
This method takes every incoming notification in the background then call
processMsg method with that notification as an argument to process it.

initPlatformState
initPlatformState():
// register the static to handle the events
NotificationsListener.initialize(callbackHandle: _callback)

This method registers callback method to handle the event.


From the package documentation: “It's recommended that you should register
your own static function callbackHandle to handle the event which make sure
events consumed.” [64]

113
7.7 Python API component
Once the machine learning model is exported, (discussed in 7.2.2.4), it can be turned into an API
using Flask and sending requests to it via a flutter application.

Overview of this component:

1- Uses the cleaning and ANLP functions discussed in machine learning component section 7.2.
2- Get the notification from POST Method.
3- Loads the model.
4- Predicts the notification label.
5- If the notification is inappropriate, stores it in the database.
6- Send an alert to the parent's device.

Regarding sending an alert to the parent's device, Firebase Cloud Messaging (FCM) was used., is
a Google cloud service that is available for free, enables app developers to deliver messages and
notifications to users across a variety of platforms, including Android, iOS, and web applications. FCM is
provided by Firebase, a company that Google purchased in 2014. Through an application programming
interface (API), FCM enables software developers to push notifications for their apps to end users. FCM
can send messages to apps in three different ways: directly to a single device, to a group of devices, or to
devices that have subscribed to a topic [66].

114
• First, we create an instance of our flask application.

• Then get the cleaning and ANLP functions discussed in machine learning component section
7.2 to use it.

• After that, defining a route in Flask, we use the decorator @app.route)’/’( , where @app is the
name of the object containing our Flask application, it used to facilitate POST request from
our flutter application.

• Then, we need to import trained vectorizer and model.

• Then, getting the response data (notification from application) and converting it from json to
key value pair.

• After thar, assigning this data to variables.

• Then, send the content of notification as an argument to the cleaning function and then the
ANLP function.

• Then, we apply the vectorizer on it to convert it to numbers, and then we send it to the Model
to classify it.

• After that. we store the result of the classification in in a variable called result.

• If the result of the notification classification is not appropriate, store the notification details in
the database, and get the parent token from parent table.

• Finally, send an alert to the parent's device.


sendnoti (title, body, token):
This method takes the title and content of the alert to be sent to the parent by obtaining its
device token.

Note: to start the server we call the run() method of the Flask object.

115
7.8 User Interfaces

Figure 77: About the application interface Figure 78: Device selection interface.

Figure 79: Login interface (Parent's device) Figure 80: Create account interface
(Parent's device)

.
116
Figure 81: verification interface Figure 82: Confirmation interface

Figure 83: Welcoming interface Figure 84: Homepage with no child added
(Parent's device)

117
Figure 85: Homepage with child added Figure 86: Alert in more details interface
(Parent's device)
.

Figure 87: Advice category interface Figure 88: Specific category advice
interface

118
Figure 89: Account settings interface Figure 90: Account info interface

Figure 91: Children list interface Figure 92: Alert history interface

119
Figure 93: Help center interface Figure 94: Edit account info interface

Figure 95: Delete warning window Figure 96: Add child interface

120
Figure 97: Inactive child interface (Child Figure 98: Permission window (Child
device) device)

Figure 99: Activation terminated interface Figure 100: Application instructions interface
(Child device)
.

121
Figure 101: Instructions for adding child Figure 102: Confirm account deletion
interface interface

122
Chapter 8: TESTING
8.1 Unit Testing

8.2 Integration Testing

8.3 System Testing

8.4 Acceptance Testing

8.3 System Testing

8.4 Usability Testing

123
Chapter 8: TESTING
This chapter discusses the testing stage of ‫ | اتقاء‬Etiqa'a application in order to detect and resolve
any problems or difficulties, as well as to ensure that the application is ready and free of errors that could
impair its function or effectiveness.

8.1 Unit Testing


The purpose of testing was to isolate the code and ensure it worked as intended. ‫ | اتقاء‬Etiqa'a
application consists of a collection of functions that were each individually written such as: message
cleaning, message classification, create an account, login, data fetching from database, etc. Then each one
of them was tested, and confirmed to be error-free.

8.2 Integration Testing


The purpose of testing was to expose any flaws that may occur when components are integrated
and must interact with one another. ‫ | اتقاء‬Etiqa'a application has different components that must integrate
and work together such as the integration of ML model and the application, which was tested and
confirmed to work perfectly together and with no flaws or errors.

8.3 System Testing


The purpose of this test was to evaluate the functionality of the application, identify and fix bugs,
and ensure that the system is bug-free and that all of its components work together perfectly. ‫ | اتقاء‬Etiqa'a
application has a collection of different functions and components that work together so we tested the
entire application from the beginning to the end, and confirmed it’s bug-free, works as it supposed to all
together, and that all the requirements are met.

124
8.4 Acceptance Testing
The purpose of user acceptance testing is to evaluate the system's compliance with the
requirements and verify if it has met the required criteria for delivery to end users. This test is performed
by end users, allowing them to participate in the testing process and provide feedback on the application
to help it improve.

The users were observed during this test, and notes were taken about their performance and behavior on
each move they made while using the application.

Table 22: Acceptance Testing

Was the
message
Model's
User Sent Sentence classified Problem Justification
Classification
correctly?
)Q4 answer(
‫عمه في وجهك ياحمار ياوصخ‬ NOT_APROP Yes -
‫كلب جحش حيوان غبي ثور‬ NOT_APROP Yes -
User 1 training data size was
small; hence it didn't
‫اتوطا في بطنك‬ APROP No
cover all the inappropriate
words
‫السالم عليكم ورحمة هللا وبركاته‬ APROP Yes -
‫مساء الخير لمى‬ APROP Yes -
‫وينك يا زق ليش ما تجين‬ NOT_APROP Yes -
User 2
‫فاتك نص عمرك جنى الحيوانة اليوم‬
NOT_APROP Yes -
‫جات‬
‫يا حيوانه‬ NOT_APROP Yes -
‫السالم عليكم كيفك‬ APROP Yes -
‫لو انك ولد امك و ابوك قابلني بعد‬
User 3 NOT_APROP Yes -
‫المدرسة وتشوف ايش حسوي فيك‬
‫وهللا اقتلك‬ NOT_APROP Yes -
There are no good tools
for correcting
‫ياكلبة‬ APROP No misspellings for Arabic
User 4 dialects and training data
was spelled correctly
‫وريني صدرك واعطيك اللي تبين‬ NOT_APROP Yes -
‫روحي انتحري محد يبغاك يا منبوذة‬ NOT_APROP Yes -
‫يا غبي‬ NOT_APROP Yes -
‫ياحبيبي‬ APROP Yes -
‫سمعت انك كلمت اخويا ع اللي صار‬
User 5 APROP Yes -
‫امس‬
‫لو سمحت ال تتدخل مرة ثانية وال قسم‬
NOT_APROP Yes -
‫باهلل اقتلك‬

125
‫اذبحك‬ NOT_APROP Yes -
User 6 ‫غبيه ومحد يبغاك يامنبوذة‬ NOT_APROP Yes -
‫فسخي وصوري لي وحاجيب لك‬ NOT_APROP Yes -
‫يا حقيره‬ NOT_APROP Yes -
User 7 ‫زباله انقلعي‬ NOT_APROP Yes -
‫ال ترسلي شي‬ APROP Yes -
‫كل شي سيء في الحياه منك‬ APROP No Limited training data
User 8 ‫هللا يلعنك‬ NOT_APROP Yes -
‫شكلك المعفن ينحسنا‬ NOT_APROP Yes -
User 9 ‫حالة اللي يغتصبك ويقتلك بعدها يا سالم‬ NOT_APROP Yes -

Result and evaluation:

Our application was tested by 9 different parents from the age of 20 to 50+, the tests were
conducted in person, the application was downloaded to user device who were then asked to use it. After
the users were done using the application, a questionnaire was given to them to get their feedback.
see appendix A.
55.6% of users of our application were experts in technology, 33.3% considered their level in technology
to be medium while 11.1% considered themselves to be beginners,
The users were asked to use the ‫ | اتقاء‬Etiqa'a application without limitation, the parents set up their
accounts on their devices and their children devices with no problems, then the parents sent messages to
their child's WhatsApp to test the application, the results show that 25/28 (89.3%) of messages that were
sent by the users were classified correctly, while 3/28 (10.7%) messages were misclassified, this problem
was caused because of the following reasons
1- the model was trained on a small and limited dataset
2- the lack of tools that can correct Arabic dialect misspelled words.
100% of the users said they received a notification to alert them about the inappropriate messages.
88.8% of the parents found that the application was clear and easy to use, while 11.1% found it difficult to
understand some of the instructions and phrases in the application.
Most parents suggested for the model be taught more inappropriate words to improve the application
performance, and all of them confirmed that the ‫ | اتقاء‬Etiqa'a application is valuable and will be very
useful in protecting their children. Overall, all the users were pleased with the application and its services.

126
Chapter 9: CONCLUSION
9.1 Discussion and Conclusion

9.2 Challenges

9.3 Future plans

9.3 Conclusion

127
Chapter 9: CONCLUSION
This chapter contains conclusion of the project, the challenges we faced throughout the making of
‫ | اتقاء‬Etiqa’a application and what we plan to do with application in the future to improve it.

9.1 DISCUSSION AND CONCLUSION


In this study we proposed an application called ‫ | اتقاء‬Etiqa'a that analyzes WhatsApp messages using
a machine learning model and classifies them according to the content of the message as appropriate or
inappropriate, and if it finds the message to be inappropriate, it will send an alert to the parent informing
them of the message content and the sender, the creation of the application consists of 2 parts, building a
machine learning model, and building the actual application.

To build a machine learning model first we needed a dataset, we gathered 4 different datasets from
different social media platforms, then we combined them into one dataset, the content of the dataset was
labeled either as appropriate(APROP) or inappropriate (NOT_APROP), then the dataset was cleaned by
removing any duplicate row and any rows that had one or no characters , non-Arabic characters and
emojis were removed , extra spaces at begging and end of sentences were removed and multiple spaces at
middle of the sentences were replaced with one space only, we corrected misspelled words and mapped
extended Urdu and Persian letters into normal letters for example all ‫ ۈۇۆۅۄۋ‬were mapped to ‫و‬, then the
data was normalized and tokenized using different stemmers and lemmatizes to find the best one that will
improve classification performance, the camel lemmatize and stemmer were them chosen, then data
features were extracted using 2 methods (Count Vectorizer and Frequency-Inverse Document Frequency
(TF-IDF)), the data was tested using 6 different algorithms, Complement Naïve Bayes classifier, Logistic
Regression, Support Vector Machine (SVM), k-Nearest Neighbors (KNN), Random forest and Decision
tree. Each algorithm was tested using the two different vectorizers in 4 different dataset conditions:
1- Dataset features extracted by lemmatizing text and keeping the stop-words.
2- Dataset features extracted by stemming text and keeping the stop-words.
3- Dataset features extracted by lemmatizing text and with stop-words being removed.
4- Dataset features extracted by stemming text and with stop-words being removed.

The results showed that the best Dataset features extractor was camel lemmatize, and it performed its best
with the stop-words not removed. And the algorithm that yielded the best results was Logistic Regression
with an accuracy of 81.2%, and F1 score of 81.5%.

128
Before creating the application, a database was created, the database is made of 4 tables, a table
for parents’ information, another for child’s information, a table to save messages in, and table for advice,
the database component is mentioned in details in section 7.3

As for the creation of the actual application, we built a system that would work differently based
on if the application is on parent’s device or child’s device which will be determined when the parent first
opens the application and chooses whether he/she is on child’s device or his/her device , if the application
is on parents device then it will allow the parent to perform these main functions ‘create account’, ‘login’,
and ‘add a child’, the parent can only create an account if he/she is using the application on his/her
device, if he/she is on child’s device he/she will not have a create account option, after the user has
confirmed his/her email, he/she can login and add a child, adding a child will require child’s name and
date of birth, after that the child will be gray, it will not be activated until the parent logs in to ‫ | اتقاء‬Etiqa'a
application from child’s device to give access permission.

The parent can login into the application using the account he/she created while using | ‫اتقاء‬
Etiqa'a application on her//his device, when the parent logs in from child’s device, the inactive children
will be shown then the parent can choose which child the device belongs to, then the child becomes active
and access permission is asked by the application and when given by the parent, the ‫ | اتقاء‬Etiqa'a
application can start listening to notification by using flutter_notification_listener plugin in flutter
application , only WhatsApp messenger notification are filtered and sent to the ML model to be analyzed
and classified as appropriate or inappropriate, the ML model and application were connected using
Python API component which turned the model into an API using flask application and sending requests
to it via a flutter application, this component allows WhatsApp messages to be read from child’s device
and sends them to the model which then clean the message, perform ANLP and predicts whether it’s an
appropriate message or inappropriate, and if the ML model finds the messages to be inappropriate then it
stores it in the database and sends a notification via Firebase Cloud Messaging (FCM) to parents device to
inform him/her about the content of the message.

129
9.2 Challenges
During the development phase of this project, we encountered various challenges.

1- Lack of good tools that help dealing with Arabic dialect text.

2- Lack of time to prepare more data and enhance model accuracy in classifying the messages.

3- The scarcity of sources that clarify the packages used to listen to notifications.

4- Lack of time to try more ways to get WhatsApp messages and selecting the best one.

5- We were having a difficulty designing screens responsive for different screen sizes, and we tried
many ways and packages until we were able to solve this challenge.

6- We were facing a challenge in the appearance of unexplained errors among some team members
and not the other when sharing the codes until it became clear to us that it was because we used
different versions of the programs.

Every project has its ups and downs, but we persevered and worked as a wonderful team to
complete it as well as we could. We had some challenges, but they helped us to be more patient, and we
are pleased with the outcomes.

9.3 Future Plans


Due to lack of time, a lot of constraints have been put on the project, but we plan to improve the
system in the future by adding the following:

1- Make the system available on iOS platform.

2- Extend the system scope to monitor other social media applications.

3- Make the system usable for all people including people with physical/visual handicaps!

4- Improve the model so that it can recognize all inappropriate/harmful words and sentences.

5- Make the classification of messages more accurate by adding more specified categories such as
suicidal, bullying, and sexual harassment.

6- Improve the message extraction method to overcome drawbacks such as not being able to see the
receivers (child’s) messages.

7- Improve the application interface.

8- Improve our model to detect not only inappropriate messages but inappropriate photos and voice
messages as well.

130
REFERENCES

[1] H. Firmansyah and A. A. Azha, "Analysis of Sexual Predator Network News Framing in
Children," Journal of Humanities and Social Sciences Innovation, vol. 2, no. 4, 2022.

[2] G. Kashy-Rosenbaum and D. Aizenkot, "Exposure to Cyberbullying in WhatsApp Classmates'


Groups and Classroom Climate as Predictors of Students‘ Sense of Belonging: A Multi-Level
Analysis of Elementary, Middle and High Schools," Children and Youth Services Review, vol. 108,
pp. 1-10, 2020.

[3] O. Oueslati, E. Cambria, M. B. HajHmdia and H. Ounelli, "A review of sentiment analysis
research in Arabic language," Future Generation Computer Systems, vol. 112, pp. 408-430, 2020.

[4] S. Marie-Sainte, N. Alalyani, S. Alotaibi, S. Ghouzali and I. Abunadi, "Arabic Natural Language
Processing and Machine Learning-Based Systems," IEEE Access, vol. 7, pp. 7011 - 7020, 2018.

[5] T. Kanan, O. Sadaqa, A. Aldajeh, H. Alshwabka, W. AL-dolime, S. AlZu’bi, M. Elbe, B. Hawashi


and M. A. Alia, "Review of Natural Language Processing and Machine Learning Tools Used to
Analyze Arabic Social Media," in IEEE Jordan International Joint Conference on Electrical
Engineering and Information Technology (JEEIT), Jordan, 2019.

[6] ICDL Arabia, "Cyber Safety Report: Research into the online behaviour of Arab youth and the
risks they face," 2015. [Online]. Available: https://icdlarabia.org/downloads/y8auRNa9oj.
[Accessed 12 October 2022].

[7] F. Moafa, K. Ahmad, W. M. Al-Rahmi, N. Yahaya, Y. Kamin and M. M. Alamri, "Cyber


harassment prevention through user behavior analysis online in kingdom of Saudi Arabia (KSA),"
Journal of Theoretical and Applied Information Technology, vol. 96, no. 6, 31 March 2018.

[8] B. M. Fahmy, "Cyberbullying among Adolescents on Social Media Networks," Egyptian Journal
of Public Opinion Research, vol. 20, no. 3, pp. 289 - 335, 2021.

[9] Norton, "Norton's My First Device Report," 2018. [Online]. Available:


https://now.symassets.com/content/dam/norton/global/pdfs/reports/Norton_My_First_Device_Rep
ort_Oct_2018_Final.pdf. [Accessed 23 November 2022].

[10] B. Bason, "An Open Letter About Why and How We Use AI at Bark," Bark, 21 April 2021.
[Online]. Available: https://www.bark.us/blog/open-letter-brian-bason/.

131
[11] B. Bason, "How Bark Works," Bark, 2022. [Online]. Available: https://www.bark.us/how/.

[12] J. G. a. J. G. Eduardo Cruz, "The all-in-one parental control and digital wellbeing solution,"
qustodio, 2022. [Online]. Available: https://www.qustodio.com/en/.

[13] AnsonX, "AirDroid Parental Control," AirDroid , 2022 . [Online]. Available:


https://www.airdroid.com/parental-control/.

[14] "IMB, What is machine learning?," IMB, [Online]. Available:


https://www.ibm.com/topics/machine-learning.

[15] C. Donalek, "caltech, Department of Astronomy," 4 2011. [Online]. Available:


https://sites.astro.caltech.edu/~george/aybi199/Donalek_classif1.pdf. [Accessed 2022].

[16] S. A. Aboalnaser, "Machine learning algorithms in Arabic Text Classification: A Review,"


Developments in eSystems Engineering (DeSE), Medina, Saudi Arabia, 2019.

[17] A. S. Ghareb, A. A. Bakara, Q. A. Al-Radaideh and A. R. Hamdan, "Enhanced Filter Feature


Selection Methods for Arabic Text Categorization," international Journal of Information Retrieval
Research, vol. 8, no. 2, pp. 1-24, 2018.

[18] M. Elarnaoty and A. Farghaly, "Machine Learning Implementations in Arabic Text Classification,"
in Intelligent Natural Language Processing: Trends and Applications, Springer, 2018, pp. 295-
324.

[19] D. Jurafsky and J. H. Martin, Speech and language processing: An introduction to natural language
processing, computational linguistics, and speech recognition, Upper Saddle River, NJ: Pearson
Education, 2009.

[20] D. Khurana, A. Koli, K. Khatter and S. Singh, Natural language processing: state of the art, current
trends and challenges, Multimed Tools Appl, 2022.

[21] S. Nguyen, "Multilingual NLP: Solutions to challenges," StageZero Technologies, 19 July 2022.
[Online]. Available: https://stagezero.ai/blog/multilingual-nlp-solutions/. [Accessed 10 October
2022].

[22] H. Al-Najjar, Some Aspects of Ambiguity in English and Arabic: A Comparative Study,
Department of English, Faculty of Arts, Ibb University, 2008.

132
[23] O. Obeid, N. Zalmout, S. Khalifa, D. Taji, M. Oudah, B. Alhafni, G. Inoue, F. Eryani, A. Erdmann
and N. Habash, "CAMeL tools: An open source python toolkit for Arabic natural language
processing.," in Proceedings of the 12th language resources and evaluation conference, 2020.

[24] A. Muaad, H. Davanagere, M. Al-antari, J. V. Benifa and C. Chola, "AI-based misogyny detection
from Arabic levantine twitter tweets," Computer Sciences & Mathematics Forum, p. 15, September
2021.

[25] "Notifications Overview : Android Developers," 4 October 2022. [Online]. Available:


https://developer.android.com/develop/ui/views/notifications. [Accessed 5 October 2022].

[26] D. Glez-Peña, A. Lourenço, . H. López-Fernández, M. Reboiro-Jato and F. Fdez-Riverola, "Web


scraping technologies in an API world," Briefings in Bioinformatics, vol. 5, p. 788–797, September
2014.

[27] A. Barbaresi, "Trafilatura: A Web Scraping Library and Command-Line Tool for Text Discovery
and Extraction," Proceedings of the 59th Annual Meeting of the Association for Computational
Linguistics and the 11th International Joint Conference on Natural Language Processing: System
Demonstrations, August 2021.

[28] D. Glez-Peña, A. Lourenço, . H. López-Fernández, M. Reboiro-Jato and F. Fdez-Riverola, "Web


scraping technologies in an API world," Briefings in Bioinformatics, vol. 5, pp. 788-97, April
2013.

[29] C. Moreno, E. Francisco, C. Salazar and G. K. Katherine, "Development of an Application for


Parental Control of WhatsApp on Android Mobile Devices," in 2019 International Conference on
Information Systems and Software Technologies (ICI2ST), Quito, Ecuador, IEEE, 2019, pp. 16-23.

[30] D. Mouheb, M. Abushamleh, M. Abushamleh, Z. Aghbari and I. Kamel, "Real-Time Detection of


Cyberbullying in Arabic Twitter Streams," in 2019 10th IFIP International Conference on New
Technologies, Mobility and Security (NTMS), Spain, IEEE, 2019, pp. 1-5.

[31] H. Ameur, A. Rekik, S. Jamoussi and A. Ben Hamadou, "ChildProtect: A parental control
application for tracking hostile surfing content," Entertainment Computing, 2022.

[32] M. AlGhamdi and M. A. Khan, "Intelligent Analysis of Arabic Tweets for Detection of
Suspicious," Arabian Journal for Science and Engineering, p. 6021–6032, 10 March 2020.

133
[33] F. Kateb and J. Kalita, "Classifying Short Text in Social Media: Twitter as Case Study,"
International Journal of Computer Applications, pp. 1-12, February 2015.

[34] A. Farghaly and k. Shaalan , "Arabic Natural Language Processing: Challenges and Solutions,"
ACM Transactions on Asian Language Information Processing, p. 1–22, 01 December 2009.

[35] T. Alsubait and D. Alfageh, "Comparison of Machine Learning Techniques for Cyberbullying,"
IJCSNS International Journal of Computer Science and Network Security, January 2021.

[36] A. Dennis, B. H. Wixom and R. M. Roth, Systems Analysis and Design, 5th ed., John Wiley &
Sons, 2012.

[37] R. ALBayari and S. Abdallah, "Instagram-Based Benchmark Dataset for Cyberbullying Detection
in Arabic Text," MDPI, vol. 7, no. 7, 2022.

[38] A. Alshehri, E. M. Nagoudi and M. Abdul-Mageed, "Understanding and Detecting Dangerous


Speech in Social Media," SUNY at Buffalo, Natural Langauge Processing Lab, The University of
British Columbia, 2020.

[39] S. Chowdhury, H. Mubarak, A. Abdelali, S.-g. Jung, B. Jansen and J. Salminen, "A Multi-Platform
Arabic News Comment Dataset for Offensive Language Detection," in LREC - Language
Resources and Evaluation Conference, Marseille, France, 2020.

[40] H. Mubarak, A. Rashed, K. Darwish, Y. Samih and A. Abdelali, "Arabic Offensive Language on
Twitter: Analysis and Experiments," Qatar Computing Research Institut, pp. 126-135, 2021.

[41] "Flutter vs Java," Javatpoint, [Online]. Available: https://www.javatpoint.com/flutter-vs-java.


[Accessed 25 October 2022].

[42] L. Cianci, "Best IDEs for Flutter in 2022," 21 February 2022. [Online]. Available:
https://blog.logrocket.com/best-ides-flutter-2022/.

[43] K. Sherrer, "Google Colab vs Jupyter Notebook: Compare data science software," 25 May 2022.
[Online]. Available: https://www.techrepublic.com/article/google-colab-vs-jupyter-notebook/.

[44] ActiveState, "What is Scikit-Learn in Python?," 5 August 2022. [Online]. Available:


https://www.activestate.com/resources/quick-reads/what-is-scikit-learn-in-python/.

[45] O. Obeid, N. Zalmout, S. Khalifa, D. Taji, M. Oudah, B. Alhafni, G. Inoue, F. Eryani, A. Erdmann
and N. Habash, "CAMeL Tools: An Open Source Python Toolkit for Arabic Natural Language

134
Processing," in Proceedings of the Twelfth Language Resources and Evaluation Conference,
European Language Resources Association, 2020, pp. 7022-7032.

[46] K. Arbabifard and V. Gudivada, "Chapter 3 - Open-Source Libraries, Application Frameworks,


and Workflow Systems for NLP," in Handbook of Statistics, Greenville, NC, United States, East
Carolina University, 2018, pp. 31-50.

[47] M. Kofler, The Definitive Guide to MySQL5, vol. phpMyAdmin , Berkeley, CA: Apress, (2005),
p. pp 87–116.

[48] "Python FastAPI vs Flask: A Detailed Comparison," turing, [Online]. Available:


https://www.turing.com/kb/fastapi-vs-flask-a-detailed-comparison#what-is-flask?. [Accessed 22
January 2023].

[49] M. O. Hegazi, Y. Al-Dossari, A. Al-Yahy and A. Al-Sumari, "Preprocessing Arabic text on social
media," Heliyon, 2021.

[50] I. Zeroual and A. Lakhouaja, "Arabic Information Retrieval: Stemming or Lemmatization?," in


Intelligent Systems and Computer Vision (ISCV), Oujda, Morocco, 2017.

[51] M. O. Alhawarat , H. Abdeljaber and A. Hilal, "Effect of stemming on text similarity for Arabic
language at sentence level," PeerJ Comput Sci, 2021.

[52] A. Alharbi, "Multi dialect Arabic stop words," 2021 Feb 22. [Online].

[53] I. Aljarah, M. Habib and N. Hijazi, "Intelligent detection of hate speech in Arabic social network:
A machine learning approach," Journal of Information Science, pp. 1-19, 2020.

[54] D. Gamel, M. Alfonse, E.-S. El-Horbaty and A.-B. Salem, "Implementation of machine learning
algorithms in Arabic sentiment analysis using n-gram features," in Procedia Computer Science ,
2019.

[55] S. Abro, S. Shaikh and Z. Khand, "Automatic Hate Speech Detection using Machine Learning: A
Comparative Study".(IJACSA) International Journal of Advanced Computer Science and
Applications.

[56] M. Maghfour and A. Elouardighi, Standard and Dialectal Arabic Text Classification for Sentiment
Analysis, Morocco, 2018.

135
[57] D. Berrar, "Cross-validation," Tokyo Institute of Technology, Tokyo 152-8550, Japan, 2019.

[58] G. Handelman1, H. Kuan Kok, R. Chandra, A. Razavi7, S. Huang, M. Brooks, M. Lee and H.
Asadi, "Peering into the black box of artificial intelligence: evaluation metrics of machine learning
methods," American Journal of Roentgenology, pp. 38-43, 2019.

[59] Dalianis and Hercules, "Evaluation metrics and evaluation," in Clinical text mining, 2018, pp. 45-
53.

[60] "Saving a machine learning Model," geeksforgeeks, 11 January 2023. [Online]. Available:
https://www.geeksforgeeks.org/saving-a-machine-learning-model/. [Accessed 26 January 2023].

[61] "Working with MySQL Scheduled Event," mysqltutorial.org, [Online]. Available:


https://www.mysqltutorial.org/mysql-triggers/working-mysql-scheduled-event/. [Accessed 29
January 2023].

[62] M. Achour, F. Betz, A. Dovgal, H. Magnusson and G. Richter, "PHP Manual," php, 09 February
2023. [Online]. Available: https://www.php.net/manual/en/intro.pdo.php. [Accessed 09 February
2023].

[63] "ECMA-404 The JSON Data Interchange Standard.," Ecma International , December 2017.
[Online]. Available: https://www.json.org/json-en.html.

[64] "flutter_notification_listener," pub.dev, [Online]. Available:


https://pub.dev/packages/flutter_notification_listener. [Accessed 26 January 2023].

[65] "Flutter Plugin or Dart Package?," medium, 16 August 2017. [Online]. Available:
https://medium.com/@mehmetf_71205/flutter-plugin-or-dart-library-246c68df15f. [Accessed 26
January 2023].

[66] T. Contributor, "Firebase Cloud Messaging (FCM)," [Online]. Available:


https://www.techtarget.com/whatis/definition/Firebase-Cloud-Messaging-FCM. [Accessed 8
February 2023].

[67] "Features overview," [Online]. Available: https://developer.android.com/studio/features. [Accessed


25 October 2022].

[68] "What is TensorFlow? The machine learning library explained," [Online]. Available:
https://www.infoworld.com/article/3278008/what-is-tensorflow-the-machine-learning-library-

136
explained.html. [Accessed 25 October 2022].

[69] "Firebase Realtime Database Store and sync data in real time," [Online]. Available:
https://firebase.google.com/products/realtime-database. [Accessed 25 October 2022].

[70] I. Vyas, "Advantages of Firebase Mobile App Development," 29 March 2022. [Online]. Available:
https://citrusbug.com/blog/advantages-of-firebase-mobile-app-development. [Accessed 25 October
2022].

[71] [Online].

[72] "Using JSON," dart.dev, [Online]. Available: https://dart.dev/guides/json. [Accessed 29 January


2023].

[73] "Receive messages in a Flutter app," firebase.google.com, [Online]. Available:


https://firebase.google.com/docs/cloud-messaging/flutter/receive. [Accessed 10 February 2023].

137
Appendix A
Questionnaire 1:

This questionnaire was published on social media. About 162 answered. The goal was to ask the opinion
of the target group about the idea of the application, how much they need it and whether they are using
similar existing applications, and it was used to gather requirements in chapter 3 to know what are the
most important features that need to include in our application to be distinctive and achieve the reaching
the intended goal.

The most important results that we obtained:


70.4% the people who answered the questionnaire have a child between 12 and 18 years old.

138
Then Likert scale was used from 1 to 5 to determine their opinion of the application idea, corresponding
to (1) strongly disagree, (2) disagree, (3) neutral, (4) agree, and (5) strongly agree. We found 76.5% of
people strongly agree with it.

Then they were asked if they used a similar current system and what was its name, 91.9% of people
said they never used a similar application and 0.7% said they used an applicaton called “family link”.

139
Finally, they were asked about the features they would like to have in the application, and they gave us
many opinions and suggestions such as: the application interfaces should be clear and easy to use, hide
the application from the child's device, the accuracy and speed of sending alerts to parents.

Questionnaire 2:

This questionnaire is directed to Arab parents, and it was published on social media. About 280 answered.
defining the target age group more precisely and to see if parents can browse their children's The goal was
devices and to ask them if they will use the application and their opinion about whether it is ethical or not.

140
In the beginning, the parent will be asked whether he has children or not, to direct him to the
appropriate section.

84.3% the parents who answered the questionnaire have children, so they are directed to Section A.

The most important results that we obtained:


36.9% of parents have a child between 7 and 11 years old. And 35.6% of parents have a child between
12 and 17 years old.

141
63.6% of children use the WhatsApp application from their own devices.

63.1% of parents have the ability to browse the contents of their child's device, such as private
messages, and so on.

142
34.3% of parents consider it ethical to browse their child's device without his knowledge in order to
ensure his safety, while 22.9% believe that it is not ethical and they do not browse their children's
devices, while 42.8% allow their parents to browse their devices

The idea of the application was presented, and parents were asked if they would use it or not, and
89.4% of parents answered yes.

143
As for the 15.7% of parents who do not yet have children, these are the most important results that we
obtained:

54.5% of parents consider it ethical to browse their children’s device by parents without their
knowledge in order to preserve their safety, while 9.1% believe that it is immoral and parents should
not browse their children’s devices, while 36.4% believe that the child should know that the parent is
browsing his device.

The idea of the application was presented, and parents were asked whether they would advise
someone to use it or not, and 88.6% of parents answered yes.

144
Questionnaire 3:

This questionnaire is to test the ‫ | اتقاء‬Etiqa'a application by end users to find out its efficiency and
effectiveness by providing feedback on the application to help it improve.

145
146
147
148
149
Appendix B
Gantt chart for project management plan(first semester)

Gantt chart for project management plan(second semester)


application development team (AD team) , machines learning team (ML team).

150

You might also like