Restaurant_Recommendations_with_Implicit_User_Behavior_via_Image_Classification_and_Sentiment_Analysis_from_Social_Media

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Restaurant Recommendations with Implicit

User Behavior via Image Classification and


Sentiment Analysis from Social Media
Wei Chung Yap Kelvin Kai Jie Sing Ching Pang Goh
Faculty of Computing and Faculty of Computing and Faculty of Computing and
Information Technology Information Technology Information Technology
Tunku Abdul Rahman University of Tunku Abdul Rahman University of Tunku Abdul Rahman University of
Management and Technology Management and Technology Management and Technology
Kuala Lumpur, Malaysia Kuala Lumpur, Malaysia Kuala Lumpur, Malaysia
yapwc-wm20@student.tarc.edu.my kelvinskj-wm20@student.tarc.edu.my gohcp@tarc.edu.my
2024 3rd International Conference on Digital Transformation and Applications (ICDXA) | 979-8-3503-7342-4/24/$31.00 ©2024 IEEE | DOI: 10.1109/ICDXA61007.2024.10470702

Abstract—Traditional recommendation systems often fall (sentiment analysis) on users' comments to gain deeper
short in understanding users' true food preferences on social insights into how they perceive and interact with
media platforms. This paper introduces an innovative approach specific food-related content on social media.
to enhance the dining experience by leveraging implicit user
behavior via image classification and sentiment analysis. The • Implicit Recommendation System: The ultimate goal
proposed system combines food image classification is to create an implicit recommendation system to
(MobileNetV2) and sentiment analysis (Transformer Flair) on provide users with more accurate and satisfying
social media comments, creating a robust framework for restaurant suggestions, enhancing their overall dining
implicit recommendation. The results demonstrate the system's experience.
efficacy in accurately predicting food categories and extracting
positive sentiments from user comments. By systematically Recent developments in dermatology have acknowledged
linking these insights to user profiles, the paper establishes a that skin diseases, initially thought to be benign, can
recommendation system that considers both culinary significantly impact patients' physical, social, and
preferences and geographical location. The seamless integration psychological well-being, as well as affect those around them
of computer vision and natural language processing allows for a [1]. Furthermore, there is a growing belief that skin diseases
more tailored and personalized restaurant suggestion, may reflect internal health issues, presenting visible and
addressing the limitations of existing recommendation systems. detectable signs of underlying conditions [2]. This highlights
The research highlights the potential of harnessing implicit user the importance of vigilant skin monitoring by individuals.
data from social media to revolutionize the landscape of Consequently, a home-based solution for the detection and
personalized dining recommendations, setting the stage for classification of skin diseases has been proposed in this paper,
future advancements in understanding and adapting to users' empowering users to proactively manage their skin health.
evolving preferences.
II. RELATED WORK
Keywords— restaurant recommendation, image classification,
sentiment analysis, social media, implicit behavior A. Image Classification
A modified MobileNet architecture for food image
I. INTRODUCTION classification had been introduced [4] to address challenges
In the digital age, recommendation systems face related to diverse food perspectives and objects. This
challenges in providing personalized service, often relying on approach, incorporating global average pooling, batch
inadequate methods such as content-based or explicit data- normalization, ReLU activation, dropout layers, and a softmax
based approaches. These systems struggle to capture users' output layer, outperforms the original MobileNet when
true preferences and sentiments, especially in the context of combined with data augmentation techniques, achieving an
social media platforms [1],[2]. Consequently, users these days accuracy of 72.59%. Later, deep learning models has been
are dissatisfied with the specific recommendation system applied for food image classification, using Food-101 and an
since it does not truly learn or understand what consumers augmented dataset [5]. The results show that MobileNet
want in meals—rather, it simply makes recommendations achieved the highest accuracy among different models,
based on static data such as food quality, pricing, and service scoring 95% on the original Food-101 dataset, while
[3]. To enhance the overall user experience, it is necessary to EfficientNetB1 excelled with 96.13% accuracy on the
improve the system by harnessing implicit user behavior and augmented dataset. Both studies highlight the effectiveness of
including sentiment analysis from social media. The data augmentation in improving model accuracy and the
objectives of this review paper include: potential of MobileNet in food image classification, despite
differing image quantities per class in the datasets, warranting
• Utilize Social Media Data: Leverage the wealth of data further analysis.
users share on social media to understand their food
preferences more comprehensively via their posts. B. Sentiment Analysis
• Implicit Behavior Analysis: Investigate the implicit Sentiment analysis, a vital aspect of Natural Language
behavior exhibited by users on social media through Processing (NLP) known as Opinion Mining, enables the
distinguishing the food they share on social media assessment of sentiment in text, aiding in understanding the
posts with the Computer Vision technique (image emotional tone or opinions expressed [6]. There are 3
classification) and natural language processing sentiment labels used including Positive, Neutral and
Negative. It assists in promptly addressing concerns,

979-8-3503-7342-4/24/$31.00 ©2024 IEEE 39

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on June 18,2024 at 07:40:46 UTC from IEEE Xplore. Restrictions apply.
improving decision-making, and gathering insights from selected, each containing exactly 100 images, total is
diverse data sources such as call records, social media, 5000 images.
reviews, and more, with a focus on factors like customer
satisfaction [7]. Pretrained models such as VADER, TextBlob • Social Media Food Posts: The acquisition of social
and Flair are used to determine which is more suitable to media content involved the retrieval of food-related
analyze the particular data tweeted by developers. One of the posts and comments from two major social media
studies has used pre-trained sentiment models to identify platforms, Instagram and YouTube. By searching the
public opinion to public perceptions of a topic, product, and food names as keyword that are available in the food
service provided by industry players to the government in the image dataset, 20 food samples were captured using
Indonesian language [8]. The researchers had used a lot of text the "Snipping Tool". These collected social media food
preprocessing techniques and translation before the sentiment posts were designated for deployment purposes in the
modeling part for transforming raw text data into a more image classification phase.
appropriate format [9]. The comparison result of accuracy • Social Media Comments: In parallel, comments from
levels from each sentiment model shows that Vader was the Instagram were harvested using the
most accurate to estimate sentiment. In this paper, the user "IGCommentsExport" Chrome extension, while
comments under the food posts in social media platforms are comments from YouTube were obtained using the
used to undergo sentiment assessment with one of the NLP YouTube Data API v3 in conjunction with a Google
pre-trained models, Flair to understand what’s their real Sheet Extension and Apps Script. 20 sample comments
thoughts for each post. Flair is the most suitable for this related to crawled social media posts were earmarked
domain because it can capture contextual information of for subsequent sentiment analysis utilizing Natural
words in a comment and support diverse linguistic Language Processing (NLP).
environment especially in social media site.
C. Context-Aware Approach Recommendation System
The challenge of choosing dining options in a world with
numerous choices has been addressed by using a context-
aware recommendation system for restaurants [10]. The
limitations of existing recommender systems like Yelp and
Google Maps were highlighted. A novel recommendation
system called ILOVEFOOD! has been proposed in this paper,
implemented as a smartphone app, which takes into account
various contextual elements, including a user's current
location, time, weather, user preferences, and restaurant
reviews. By incorporating these elements, the system provides
complex and personalized restaurant recommendations,
enhancing user satisfaction. This innovative approach
leverages context awareness to modify the ranking of
suggestions based on the current context, demonstrating its
effectiveness in enhancing overall system usability. However,
it's crucial to consider users' implicit habits, ensuring that the
system can provide more precise and up-to-date
recommendations aligned with their true desires. Implicit
feedback's real-time nature distinguishes it from explicit data
in order to improve the recommendation system to be more
precise by considering what users really desire [11].
III. METHODOLOGY
A. Description of Dataset
This study encompasses four distinct datasets, each
serving specific purposes for the research objectives as shown
in Fig. 1, encompassing food image classification, social
media posts for deployment, social media comments for
sentiment analysis (NLP), and restaurant details.
• Food Images: The training dataset is made up of food
images from well-known culinary image sources, such
as food-101, uecfood100 and mafood121 datasets.
However, these pre-existing datasets exhibit a notable
deficiency in their representation of Malaysian
culinary diversity. To redress this shortfall, a
supplementary dataset was curated through web
scraping of images from Google, utilizing the
"Download All Images" browser extension. From the
combined dataset, 50 unique food categories were Fig. 1. Research Flowchart

40

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on June 18,2024 at 07:40:46 UTC from IEEE Xplore. Restrictions apply.
• Restaurant Information: To assemble comprehensive purposes. Leftover social media comment texts from
restaurant details, the Place API, an integral commenters are converted to lowercase to avoid those texts
component of the Google Maps API suite, was being treated as different tokens. For emoticon handling, those
employed [12]. 50 restaurants that related to food emojis are demojized to text format for data consistency and
image dataset are scraped correspondingly. By easier analysis for sentiment models [17]. In the modeling
providing specific geolocation coordinates, a section, one of the transformer models, Flair, is used for
maximum search radius, keywords, and restaurant determining the sentiment labels for social media user
types to the Place API, it facilitated the extraction of comments and whether they like or dislike the particular food
detailed restaurant information tailored to the specified posted. It is also a NLP sentiment pre-trained model which is
criteria. Geolocation coordinates for West Malaysia easy to use and considered as ready-to-use out of the box in
were obtained from CalcMaps, a dedicated website for order to save developers’ time and resources on data
retrieving longitude and latitude coordinates regarding collection, feature engineering, particular model training and
to various geographic locations within the state [13]. also hyperparameter tuning. The sentiment evaluation on
social media comments is Human-Level Performance (HLP)
B. Food Image Classification where the generated sentiment label is according to the
In the initial phase, a set of precisely 5000 food images was developer's own knowledge and understanding. The processed
assembled to serve as the foundational dataset for food image social media comments with the sentiment “Positive” label are
classification. After that, a structured dataframe with the exported to an Excel named “Processed Comments”.
image file paths and labels was created. This approach was
chosen to enhance data manipulation and facilitate data D. Restaurant Recommendation System
preprocessing with greater flexibility and control. To further From the "Processed Comments" excel dataset, the
enrich and diversify the dataset, data augmentation techniques extraction of usernames and corresponding user profile URLs
were applied. The objective was to expand the existing facilitated the systematic generation of individual user
dataset, amplifying each food category from its initial 100 profiles. Considering privacy constraints inherent to social
images to a more extensive 500 images, total 25000 food media data and the absence of explicit user address
images. This augmentation strategy served to enrich the information, a pseudorandom state allocation mechanism was
dataset and furnish the model with an extensive range of implemented, assigning a notional state to each user,
diverse training instances, thereby fortifying its ability to presuming their residence within the geographical bounds of
generalize effectively. The data distribution for training, West Malaysia. Furthermore, leveraging the insights garnered
testing, and validation was meticulously organized, allocating from the deployment of the food image classification model,
70% of the data for training purposes, while allocating 15% an automated assignment of food tags to users exhibiting
each for testing and validation. An image data generator was positive sentiment in their comments under specific posts was
employed to facilitate efficient data loading in batches [14]. In executed. This process of attributing food tags to users
the model architecture selection, MobileNetV2 was chosen, as contributed to the refinement and enrichment of the
it demonstrates an improved overall performance while comprehensive user profiles. Consequently, the establishment
maintaining computational efficiency [15]. Evaluation of the of a comprehensive User Profile repository was achieved,
model's performance encompassed key metrics such as wherein each user profile encompassed crucial details,
accuracy, generating a confusion matrix, and constructing a including username, user profile URL, assigned state, and
classification report. These evaluations were crucial in corresponding food tags. Moreover, through the utilization of
assessing the model's efficacy in classifying each food the username as an input parameter, the extraction of the user's
category. Upon successful training and the attainment of assigned state and associated food tags from the User Profile
commendable performance on the test images, the model repository was seamlessly executed. The extracted food tags
transitioned to its deployment phase, wherein it undertook the were subsequently employed to facilitate the retrieval of
task of predicting food categories in the context of social precise restaurant details aligned with specific food
media posts. preferences, while the user's assigned state played a pivotal
role in facilitating location-based comparisons with the
C. Sentiment Analysis of User Comments geographical distribution of restaurants. This systematically
Since every social media comment scraped is considered recommended restaurants in close proximity to the user's
as unstructured data, it is necessary to make sure the whole assumed location, fostering an enhanced user experience and
dataset is processed in an appropriate and structured format personalized recommendation services.
consistently. Therefore, text preprocessing is a must to
undergo before analyzing them with sentiment models as well. IV. RESULT
The social media comments are preprocessed with a translator Illustrated in Fig. 2, the deployed model demonstrates its
using Google Translate API. Social media platforms are efficacy in accurately predicting the content of social media
globally user-based and they are required to translate to a posts pertaining to various food items. Notably, the model
common language like English to ensure the content can reach accurately classifies "1.png" as Curry Mee, with a confidence
a broader audience, facilitating communication and level of 72.97%, and "10.png" as Spaghetti Bolognese, with a
interaction among users from different language backgrounds. remarkably high confidence level of 99.99%. These precision
Next, the social media comments are processed with text levels underscore the model's robust performance in
normalization including removing HTML tags, punctuations discerning intricate nuances within diverse culinary
and empty rows. HTML tags and punctuations are treated as compositions, thereby enabling precise classification
noise in the text or phrase whereas empty rows are the missing outcomes. Subsequent to the successful classification of food-
values that might mislead the insights especially for sentiment related posts, the corresponding food tags are systematically
assessment [16]. These need to be removed so that those stored within the user profile repository. This mechanism is
comments are standardized for further sentiment analysis strategically designed to associate users who exhibit a positive

41

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on June 18,2024 at 07:40:46 UTC from IEEE Xplore. Restrictions apply.
sentiment in their comments under specific posts with the
relevant food tags.
In Fig. 3, the Excel spreadsheet stored commenters’ social
media comments with only a “Positive” sentiment label under
each particular food post. After the food post had detected
accurately in the food image classification deployment stage,
all of the crawled comments under the specific food post is
analyzed with the sentiment model, Transformer Flair, in
order to analyze every commenter’s own opinion in their
comment as implicit information. The transformer model
generated “Positive” and “Negative” sentiment labels for
each comment and all of the comments were evaluated with
Human Level Performance (HLP). Nevertheless, Flair does
not provide “Neutral” sentiment label as it might not have
been explicitly documented unless setting a threshold for
model’s confidence scores on “Neutral” labelling. After the
evaluation, the sentiment label with “Positive” as well as
having the sentiment confidence level higher than 85% were
exported to “Processed Comments” Excel format for further
restaurant recommendation purposes. Fig. 2. Food Image Classification

Fig. 3. Processed comments

Fig. 4. User profile

42

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on June 18,2024 at 07:40:46 UTC from IEEE Xplore. Restrictions apply.
Fig. 5. Restaurant Recommendation System

Fig. 4 depicts the comprehensive user profiles including analyzing Out of Vocabulary (OOV) words for a better
usernames and corresponding user profile URLs, extracted understanding of implicit social media user behavior in
from the processed comments dataset, a result of the sentiment context-aware restaurant recommendation systems.
analysis process. To address privacy concerns and the absence
of explicit geographical data, a pseudorandom allocation of ACKNOWLEDGMENT
states is implemented to signify the assumed residence of each The authors are grateful to the FOCS faculty for their great
user within the region of West Malaysia. Subsequently, food support and direction during the research effort. With the
tags are methodically assigned to users who express positive support of numerous libraries and internet resources, this
sentiments in their comments beneath relevant posts. This study has proven feasible. Lastly, we want to take this
integrated approach to user profiling enhances the system's opportunity to convey our sincere gratitude to everyone who
capacity for personalized recommendations and augments the took part in the research's development and assessment stages,
user experience. without whom this research might not become achievable.
As depicted in Fig. 5, the system is designed to efficiently REFERENCES
retrieve user-specific information upon receiving a username
[1] S. Sawant and G. Pai, “Yelp Food Recommendation System.”
as input. This information includes the user's assigned state Available: http://cs229.stanford.edu/proj2013/SawantPai-
and the associated food tags within their individual profile, as YelpFoodRecommendationSystem.pdf.
extracted from the User Profile repository. Leveraging this [2] Y. Gao, W. Yu, P. Chao, R. Zhang, A. Zhou, and X. Yang, “A
information, the system takes into account both the user's Restaurant Recommendation System by Analyzing Ratings and
culinary preferences, represented by food tags, and their Aspects in Reviews,” Database Systems for Advanced Applications,
assumed geographical location, denoted by the assigned state. pp. 526–530, 2015, doi: https://doi.org/10.1007/978-3-319-18123-
3_33.
This can facilitate the seamless curation of relevant and nearby
restaurant recommendations tailored to the user's individual [3] M. Ahmed, M. D. Ansari, N. Singh, V. K. Gunjan, S. K. B. V., and M.
Khan, “Rating-Based Recommender System Based on Textual
preferences and geographical proximity. For example, one of Reviews Using IoT Smart Devices,” Mobile Information Systems, vol.
the social media users named “burntfinger61” who lives in 2022, p. e2854741, Jul. 2022, doi:
Johor and loves to eat curry mee. The restaurant https://doi.org/10.1155/2022/2854741.
recommendation system returns all restaurant information that [4] S. Phiphitphatphaisit, & O. Surinta, “Food Image Classification with
sells curry mee in Johor according to the rating popularity for Improved MobileNet Architecture and Data Augmentation,”
the particular user. There are 30 social media users used the ResearchGate, 2020,
https://www.researchgate.net/publication/340470168_Food_Image_C
recommendation system and meet their expectation and lassification_with_Improved_MobileNet_Architecture_and_Data_Au
satisfaction on dining options. gmentation.
[5] Doaa Al-Rubaye, & Serkan Ayvaz, “Deep Transfer Learning and Data
V. CONCLUSION Augmentation for Food Image Classification.” Oclc.org, 2023,
The research paper concludes that the integration of image https://ieeexplore.ieee.org/document/10010432.
classification (MobileNetV2) and sentiment analysis [6] S. Arora, “Sentiment Analysis Using Python,” Analytics Vidhya, Jul.
07, 2022. https://www.analyticsvidhya.com/blog/2022/07/sentiment-
(Transformer Flair) from social media data has advanced analysis-using-python/.
personalized restaurant recommendations for social media [7] Husna, “What is Sentiment Analysis? Types and Use Cases,” 2021,
users. This more sophisticated recommendation system www.taus.net. https://www.taus.net/resources/blog/what-is-sentiment-
utilizes implicit user behavior, extracting valuable insights analysis-types-and-use-cases.
from image and sentiment data shared on social media. The [8] A. A. Arifiyanti, D. S. Y. Kartika and C. J. Prawiro, "Using Pre-Trained
approach, achieving at least an 80% accuracy rate, goes Models for Sentiment Analysis in Indonesian Tweets," 2022 6th
beyond explicit details like star ratings, likes, or follows, International Conference on Informatics and Computational Sciences
(ICICoS), Semarang, Indonesia, 2022, pp. 78-83, doi:
focusing on capturing implicit preferences and contextual 10.1109/ICICoS56336.2022.9930599.
complexities expressed in social media comments. The
[9] G. Singhal, “Importance of Text Pre-processing | Pluralsight,”
findings suggest the potential for more accurate and tailored www.pluralsight.com, Oct. 05, 2020.
dining suggestions, with future work focusing on improving https://www.pluralsight.com/guides/importance-of-text-pre-
image classification accuracy, expanding food categories, and processing.

43

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on June 18,2024 at 07:40:46 UTC from IEEE Xplore. Restrictions apply.
[10] K. Karmakar, “A Context-Aware Approach To Restaurant [15] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen,
Recommendations: System Algorithm and Case Study.”,2020, “MobileNetV2: Inverted Residuals and Linear Bottlenecks,” 2019.
ResearchGate, https://doi.org/10.13140/RG.2.2.12720.38409. Available: https://arxiv.org/pdf/1801.04381.pdf.
[11] P. Berkem, “Explicit Data vs Implicit Data: What Is the Difference?”, [16] C. Goyal, “Text Cleaning and Preprocessing | Guide to Master NLP
storyly, Nov. 14, 2022, https://www.storyly.io/post/explicit-vs- (Part 3),” Analytics Vidhya, Jun. 15, 2021.
implicit-data. https://www.analyticsvidhya.com/blog/2021/06/part-3-step-by-step-
[12] “Overview | Places API,” Google Developers. guide-to-nlp-text-cleaning-and-preprocessing/.
https://developers.google.com/maps/documentation/places/web- [17] V. Grover, “Exploiting Emojis in Sentiment Analysis: A Survey,”
service/overview. Journal of The Institution of Engineers (India): Series B, Jun. 2021,
[13] CalcMaps, “Map Radius Calculator,” CalcMaps, 2015. doi: https://doi.org/10.1007/s40031-021-00620-7.K. YW, “The impact
https://www.calcmaps.com/map-radius/. of skin disorders on patients’ quality of life in Malaysia,” Journal of
Clinical Intensive Care and Medicine, vol. 4, no. 1, pp. 001–009, Jan.
[14] A. Rosebrock, “Keras ImageDataGenerator and Data Augmentation,” 2019, doi: https://doi.org/10.29328/journal.jcicm.1001018
PyImageSearch, Jul. 08, 2019.
https://pyimagesearch.com/2019/07/08/keras-imagedatagenerator-
and-data-augmentation/.

44

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on June 18,2024 at 07:40:46 UTC from IEEE Xplore. Restrictions apply.

You might also like