# Evaluating Secure Methodology for Photo Sharing in Online Social Networks
## 5 The Methodology
### Face-Recognition Library in Python  
The proposed system aims, as we stated previously, to prevent the publication of photos on social networking sites without prior permission. In this section, we describe this system in which detecting people in the photo, identifying them, and then obtaining permission to publish are detailed in the following sections. We decided to use a Flutter language to build both the smartphone applications, as this language supports building smartphone applications with a single code for Apple and Android [10]. Afterward, Firebase was chosen as Backend-as-a-Service (BaaS), which includes datastore, real-time database, authentication, hosting, and machine learning [23]. The face-recognition library is recognized and handled faces from Python or the command line using dlib's and CNN models [24]. Dlib Library is one of the most widely used packages in the facial recognition [25]. There are two integrated face detection procedures. The first one is the Histograms of Oriented Gradients (HOG) + linear Support Vector Machine (SVM) Face detector [26]. This is an accurate and effective face detection algorithm. The second one is the Max-Margin Object Detection (MMOD) CNN Face detector [27]. This is a very accurate and very robust, from different viewpoints Face detection in lighting and occlusion conditions. Figures 1 and 2 describe how to address the mentioned issues to demonstrate the proposed system design. Each step of the proposed methodology is explained as follows:  
* The first step (1) is the application request for the user to create an account, where they are asked to fill in their details like name, family, gender, date of birth, email, username, and password. All of these data will be automatically stored in the Firebase datastore. * The second step (2) where the person should take Live Photos. * The third step (3): our system detects and recognizes the face in the uploaded photos using Face-recognition Library in Python. We used the Google cloud platform as a local machine for run Python code. The Python code includes the basic operations of our application. We have two operations face detection in images and the face recognizing. Additionally, we used Google Cloud as a server for connecting the local machine with the flutter app. We can simplify this library's work by proceeding as shown in Figure 3. The image is initially received Figure 3a and then converted to a black and white image Figure 3b. Each pixel of the image is watched and gradations of brightness in Figure 3c,d, that is from light to dark, are deduced for the whole  
Figure 2: The Pseudo code for the proposed system. image. Afterward, the pictures will be divided into small squares, each containing 16 \(\times\) 16 pixels and color gradations will be calculated for each pixel in any direction, then replace the square with stronger pixel directions. At last, we will obtain a simple representation of the basic structure of the face as in Figure 3e. The outcome is that we convert the original image into a very simple representation that captures the basic facial structure in a simple way. We will emphasize the eyes and lips are centered. This image will be taken and passed across a neural network to measure facial features, and these 128 measurements will be recorded as in Figure 3f. Our system compares the resulting features with the features stored in the database by using evaluation measures that calculate the distance between the parameters, to prevent impersonation or identity theft. The registration process is completed when the results of an image match in the Firebase data store are negative. * In the fourth step (4), the new user data and image are added to the Firebase database used for our application. * In the fifth step (5), a person can log in and then post photos that represent the sixth step (6). * Before publishing the photo, the seventh step (7) is to scan the uploaded photo to verify that there are no unauthorized people in the photo.