Go back

Anticipating changes in food consumption from user behavior on the internet

07/10/2024

Introduction

Understanding food consumption patterns is key to better align supply with demand, which improves product availability and reduces spoilage. Furthermore, demand forecasts can be compared to supply information to detect potential surplus and quantify food loss. Nevertheless, the estimation of food demand is challenging due to its dependence on customer taste, which may significantly vary over time.

To monitor food demand, the FOLOU project has proposed the use of posts from the social network X (formerly Twitter), and queries to the search engine Google (Figure 1). With that purpose, CIRCE is employing two branches of the field of artificial intelligence: natural language processing and machine learning.

Figure 1. FOLOU tool for market demand.

The first year of development focused on the solution design and the data acquisition. At the moment, the processing of network messages and the analysis of search data have started. An initial study of Google queries and food consumption has provided promising results, which are described next.

Search queries as indicator of food consumption

The search engine Google provides a numerical variable to characterize the interest of terms or topics. This data can be exported for specific spatial regions and time periods, enabling their further processing and analysis. However, the relationship between search interest and food demand is uncertain, requiring further research.

To evaluate this connection, CIRCE has collected data for the search interest and consumption of different foods. For example, Figure 2 shows the case of tomato between 2021 and 2023 in Spain. In this case, the popularity of the food had a strong relationship with its consumption, showing a high potential for the estimation of demand. By using only search interest and discarding time dependence, consumption was estimated with a relative error of 17 %.

Figure 2. Consumption and search interest for tomato, between 2021 and 2023 in Spain.

Search interest can also be analyzed for the detection of overstocking scenarios. In the case of Spanish olive oil consumption, these situations were reported for the start of the war in Ukraine (March 2022) and due to a continuous trend of price increases (September 2023). These events were characterized by peaks of search interest (Figure 3), showing again the potential of search interest for the monitoring of demand variations.  

Figure 3. Consumption of and interest in olive oil between 2021 and 2023 in Spain.

What’s next?

This first analysis of search queries and food consumption has provided positive results, encouraging the next stages of development. CIRCE will continue to work on increasing the readiness of this technology, with the aim of correlating food consumption and user behavior on the Internet. Regarding the posts from X, Figure 4 shows the preliminary results obtained by running a pre-trained sentiment analysis to a data subset.

Figure 4. Preliminar sentiment analysis results for concept “Hake”.

Finally, consumption time series will be forecasted employing feature engineering along sentiment analysis results, testing different deep learning architectures such as FCNN and LSTM to provide estimations of future consumption.