# RecPOID: POI Recommendation with Friendship Aware and Deep CNN
## 2 Materials and Methods
### Proposed CNN Architecture  
As outlined in the former part, CNN models can exploit key information from an input matrix. So, we proposed a new framework in this study based on all visited sites and related time. The proposed RecPOID framework is illustrated in Figure 3. Our implemented CNN model. Our approach uses six input feature maps including user's ID, month, day, hour, minute, and second of the visiting moment by each user. As is clearly shown in Figure 4, there are 10 convolutional layers with a different number of the filter. We applied three filters with the size of the \(2\times 1\) in the three first layers. We use the batch normalization layer to improve the training and normalize the data values. Its output fed to an activation layer, as mentioned in Section 2.2, the ReLU activation function is applied. The next layer has 16 filter banks to extract features, followed by three layers and their corresponding 32 filters. We utilize the Batch normalization layer and the activation layer again. In the next layer, there are 64 filters with the same dimensions. The batch normalization layer and ReLU function are used to keep the output values within the normal range and prevent the overfitting effect. The final convolution layers include two layers of 128 filters that are followed by two flattened layers. Moreover, to decrease the overfitting effect using control of the fitting process, we added two dropout layers [40] with a 0.01% dropout probability into our CNN model to make neurons independently trained and less dependent on other neurons. The value of 0.01 is based on trial-and-error. Two fully connected layers are then applied to achieve robust high-level features. Finally, because the result is continuous, we utilize the regression layer; the regression layer undertakes the responsibility of producing two values that indicate the predicted longitude and location of the recommended locations relying on the training data. The number of epochs for the training process is 800, and the learning rate is 0.01. Algorithm 1 summarizes the detailed steps of the RecPOID algorithm. Figure 3: Our implemented convolutional neural network (CNN) model. ```
Input: user U, social relation \(G\), check-in matrix R, DateTime T (month, day, hour, minute, and second), location L (ID, latitude and longitude) Output: top-K POIs for each user \(u\) based on friendship K_cluster = 5 Epochs = 800 Learning rate = 0.01 Dropout probability = 0.01%
1. Identify each user's friends
2. Divide the time span into 4 spans (00-06, 06:01-12, 12:01-18, 18:01-24)
3. part_time = (0.00-06.00, 6.01-12.00, 12.01,18.00, 18.01-24)
4. for i = 1: size(part_time)
5. clustering users and their friendship based on the fuzzy c-means algorithm
6. selecting 10 percent of the most overlapping between the user's clusters and friendship clusters
7. end for
8. Utilized proposed CNN architecture
9. return predicted locations
10. error = calculate the distance between the predicted location and the user's friendship locations
11. if error = 0 then
12. return top-k POIs
13. else
14. Measure the shortest time distance with a similar friendship check-in pattern
15. return top-k POIs
16. end
```  
**Algorithm 1** RecPOID algorithm  
In our proposed model, due to the network layers and their parameters, there is no need for the data to be in a sequence. The user's current position is considered, and it is  
Figure 4: RecPOID framework for recommending points-of-interest (POIs) according to the importance of friendship. unnecessary to know where he was a few minutes ago. In the training phase, it received the essential training and randomly arranged the data. These two outputs give us not exactly the proposed location, so in this step, we need to calculate the distance between this predicted location and all possible locations in the vicinity area based on top-related friendship investigated in the 2.1 steps. It means that to calculate the distance, there are only those locations related to the same user and other selected users based on the friendship.