# Trend-Based Categories Recommendations and Age-Gender Prediction for Pinterest and Twitter Users
## Materials and Methods  
### Method Description  
The proposed category recommendation method for Pinterest users consists in predict an initial profile based on the age and gender of the user using tweets or images datasets. Most of the existing methods combine both datasets to improve gender and age classification results while using the same social network. As we know, Twitter allows users to publish mainly text while Pinterest allows mostly images. However, in addition to text messages, Twitter users can also publish images. Unlike texts, images are posted with less frequency than text and, therefore, images in Twitter could be less representative than text for predicting the user profile. In this context, our first goal is to predict age and gender by analyzing user text and images separately, as such data come from social networks with different approaches.  
Figure 1 shows the proposed methodology for age and gender prediction using images. Our method requires a set of images and it is based on transfer learning. Thus, given the DB1 database of posted images in Pinterest, the first step is to resize the images. Next, the full image database is split to create the training set and the testing set. The images in the training set go through a VGG16 Convolutional Neural Network (CNN) and, finally, to age and gender classifiers by means of a multi-output layer. With this technique, some layers of the network are trained after initialization.  
Figure 1: General Methodology using images.  
The age and gender classifier that is based on tweets analysis will be described in Section 2.5. After predicting the age and gender of the user, a second classifier to predict the category of a pinned image in Pinterest is implemented. This classifier is trained using the same method that is described in Figure 1, however instead of using a multi-output layer this model uses a single-output layer with 32 outputs, that is, one output for each category in the dataset. Once the image category is obtained, we evaluate a set of rules generated by the Apriori Algorithm using a dataset with a large number of proactive users in the social network. Ideally, Apriori rules are used to extract only the most frequent item-sets to find their behavior and, in most cases, extract important information that can be used to improve the accuracy of the classifier. In our scenario, we used Apriori rules to know the behavior for all the items in our dataset. The validation to recommend additional categories to users is performed using two proposed methods A and B according to their pinned images. This validation includes the analysis of a dataset with information from more than 400,000 users. This approach is explained in detail in Section 3.  
The method that is proposed in this work extracts additional information from social networks when compared with classic methods typically used in the state of the art. Therefore, our method is capable of predicting the user's age and gender with high accuracy and, at the same time, it is able to predict category information from the user without violating privacy issues.