Next Article in Journal
Overview of the Success of In Vitro Culture for Ex Situ Conservation and Sustainable Utilization of Endemic and Subendemic Native Plants of Romania
Next Article in Special Issue
Sentiment Computation of UK-Originated COVID-19 Vaccine Tweets: A Chronological Analysis and News Effect
Previous Article in Journal
Application of Fuzzy TRUST CRADIS Method for Selection of Sustainable Suppliers in Agribusiness
Previous Article in Special Issue
FSPV-Grid System for an Industrial Subsection with PV Price Sensitivity Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Blockchain-Driven Food Supply Chain Management Using QR Code and XAI-Faster RCNN Architecture

by
Surbhi Bhatia
* and
Abdulaziz Saad Albarrak
*
Department of Information Systems, College of Computer Science and Information Technology, King Faisal University, Al-Ahsa 31982, Saudi Arabia
*
Authors to whom correspondence should be addressed.
Sustainability 2023, 15(3), 2579; https://doi.org/10.3390/su15032579
Submission received: 27 December 2022 / Revised: 24 January 2023 / Accepted: 25 January 2023 / Published: 31 January 2023

Abstract

:
The availability of food in a country and the capacity of its citizens to access, acquire, and receive enough food are both referred to as having food security. A crucial component of food security is ensuring and maintaining safe and high-quality goods, which the supply chain process should take into due deliberation. To enhance the food supply chain, organic and wholesome food items should be encouraged. Although packaged goods are evaluated and approved by legal authorities, there is no mechanism in place for testing and assessing the market’s available supply on a regular basis. As a result, food manufacturers are compelled to provide nutritious and healthy products. In this research, we propose an explainable artificial intelligence-based faster regions with convolutional neural networks (XAI-based Faster RCNN) model to evaluate the contents of the food items through user-friendly web-based front-end design and QR code. To validate each communication token in the network, an elliptic curve integrated encrypted scheme (ECIES) based on blockchain technology is utilized. Additionally, artificial rabbit optimization (ARO) is used to register each user and assign him a key. The user will gain a deeper understanding of machine learning (ML) and AI applications using the XAI technique. An EAI-based Faster RCNN model is proposed to help digitize information about food products, rapidly retrieve the information, and discover any hidden information in the quick response (QR) code that could have impacted the safety and quality of the food. The results of the experiments indicated that the proposed method requires less response time than other existing methods with the increase of payload and users. The Shapley additive explanation is used to obtain a legal plea for the laboratory test based on the nutritional information present in the QR code. The benefits provided by ECIES-based blockchain technology assist policymakers, manufacturers, and merchants in efficient decision-making, minimizing public health hazards, and improving welfare. This paper also shows that the accuracy achieved by the proposed method reached 99.53%, with the lowest processing time.

1. Introduction

Food has always been fundamental to human life since it is the only tangible thing that humans consume. Food is becoming increasingly burdened by a range of demands, including flavor, color, health, and social events. Poor food consumption is a major contributor to global disease prevalence. As a result, various individual-based techniques for improving food consumption have been studied [1]. According to the Food and Agriculture Organization (FAO), 793 million people worldwide do not have enough food to live [2]. The growth in the intake of unhealthy foods is responsible for the growing incidence of noncommunicable illnesses.
According to the World Health Organization (WHO), obesity and an improper diet are responsible for 2.8 million worldwide deaths (5%) each year. A daily intake of 400 g of fruits and vegetables helps to prevent chronic illnesses and nutritional deficits [3]. The universal product code (UPC) is a 1D barcode that is used to electronically store food information. The barcode has 12 numeric digits and may hold a huge amount of information [4]. The issue of food traceability is addressed by the supply chain (SC). Distributed ledger technology (DLT) is a blockchain technique that has solved the problem of food traceability [5]. To tackle this challenge, the technique was used to connect the isolated and fragmented events along the supply chain [6]. Any transaction on the blockchain network may be traced back to its origin. However, blockchain technology has several challenges, such as the possibility of potential attacks and scalability issues [7]. The proposed method employs a deep learning model to improve the procedure. The BT-based framework is used to digitize food production data. The QR (quick response) code is used to readily access food information between producers and consumers at any time and in any location. Using deep learning and blockchain system privacy, the technique attempts to improve performance analysis and security.
To digitize the food supply chain, different studies [8,9] have been proposed using advanced technologies such as blockchain and QR codes. The researchers also utilized blockchain to improve food awareness. However, only a few researchers [8] have integrated cloud computing, deep learning blockchain, and QR codes for digitizing the food supply and our work is also one of them. These technologies change the standard ways of data collection, processing, and management and also enhance the food tracking process. Only a few works [9] have concentrated on privacy-preserving functionality in the food-tracking process. To bridge this gap, we introduce an elliptic curve integrated encrypted scheme for security. The traceability of the food products is improved using the QR code-enabled blockchain and the data accessibility is enhanced using cloud computing technology. The XAI-based Faster RCNN architecture intelligently identifies the harmful ingredients in the QR code that compromises food safety. To the best of our knowledge, this is one of the novel frameworks which integrates different technologies to identify the harmful substances in food products and improve food safety. This paper’s key contributions are as follows:
  • A blockchain-based elliptic curve integrated encrypted scheme is presented to validate every communication token and prevent a fraudster from entering the network;
  • An explainable artificial intelligence (XAI) technique is presented to make the user more competent in the field of artificial intelligence (AI) application and machine learning;
  • An XAI-based Faster RCNN model is proposed to digitize the food product information, retrieve it, and identify the hidden details in the QR code that affects food safety;
  • Artificial rabbit optimization (ARO) is implemented to register each user and provide him with the key including data storage.
The rest of this paper is as follows: Section 2 illustrates the related works; Section 3 explains the proposed methodology; Section 4 describes the result and discussion; Section 5 explains the conclusion of the paper.

2. Related Works

Bechtsis et al. [8] developed a hyper ledger fabric framework to examine the two-stage containerized food supply chains (TSFSC). The development of blockchain technology (BT) coincides with the progress of food SC operations, adding significant value. Better traceability and parameter authentication are provided by this technique. For food traceability, Tsang et al. [9] introduced blockchain-IoT-based food traceability systems (BIFTS). Perishable food was managed with the use of IoT technology. The features are utilized in the blockchain to determine the need for traceability of vaporized and lightweight foods. The integrated consensus process was developed taking into account transit time and cargo volume.
Chen et al. [10] investigated a blockchain-based agriculture security chain (ASC) framework for making optimal food production decisions and ensuring the security of agri-food tracking data. Extensive simulation trials validated the blockchain-based framework’s performance with the deep reinforcement learning-based supply chain management (DR-SCM) technique for ASC optimization. As a result, the blockchain-based ASC framework was able to establish consistent product traceability and agri-food safety. Hu et al. [11] used edge computing and blockchain technologies to create a trust crisis framework solution for supporting organic agriculture supply networks. To build an organic agricultural supply chain (OASC) trust framework, the consistency of blockchain and the paradigm of edge computing must make a trade-off between cost and efficiency. When compared to the existing approach, the evaluated results showed improved performance and cost savings.
Casino et al. [12] created a revolutionary food supply chain traceability (FSC) solution using blockchain. To build a collection of features that enable varied qualities, a local private blockchain and smart contract were used. The smart contract stored the information and exchanges between them in a verifiable manner; however, this approach needed additional maintenance time. Huang et al. [13] created a safe food traceable system utilizing blockchain to avoid data manipulation and boost traceability accuracy. Inter planetary file system (IPFS) was utilized to store data in a chain. Cooperative handling of on- and off-chain data reduced the quantity of data for a single node.
Dey et al. [4] presented a food safety quick response (Food SQRBlock) framework using blockchain and cloud technologies. Blockchain technology is used to digitize food production information to offer easier access to sellers and buyers. Li et al. [14] developed an IoT-based real-time packaged food supply chain tracing platform using extensible markup language (XML) and integrating the QR code with the RF tags. The results showed that the method is economical and efficient for real-time data collection. Ahamed et al. [15] utilized blockchain to manage the seafood supply chain. They have improved the supply chain using some unique tags such as near-field communication (NFC), QR codes, and RFID tags. The main reason for using these details is to gather the data from the manufacturer such that no one can alter the manufacturing data on the go.
Karumanchi et al. [16] presented a mask recurrent convolutional neural network and Merkle tree (MRCNN-MT) for monitoring the condition of commercial goods in the transport cargo. The MRCNN-MT model is integrated with blockchain technology to offer secure communication during supply chain management. The network storage is preserved using synchronized registry entries and the information security is offered via encryption. Hu et al. [17] utilized the gated recurrent unit (GRU) and bidirectional long short-term memory (BILSTM) for vaccine supply chain management during the COVID-19 pandemic. They mainly integrated the IoT, deep learning, and blockchain technologies. The vaccine demand is predicted using the GRU model and the BiLSTM is used to analyze the sentiments present in the vaccine reviews and offered an accuracy of 80%.
Dey et al. [18] presented a model named SmartNoshWaste by integrating different technologies such as blockchain, cloud computing, reinforcement learning, and QR code. The main aim of their model is to minimize food wastage using the reinforcement learning technique. This model was capable of reducing food wastage by nearly equal to 9.46%. A new block is created in different phases of the food supply chain and the data block is also visible in the form of a QR code. The SHA256 hash function is used here for security purposes.
To decrease food waste in the home, food management applications are now available to consumers to remind them of the expiration/best-before dates and product contents of the packaged foods. With the use of these applications (apps), a customer may keep track of the food items they’ve purchased, their expiration and best-before dates, and nutritional information to set reminders for when to eat them or avoid doing so. The consumer still needs to enter the expiration/best-before dates of each item separately in these apps even though barcode scanning allows for automatic entry of the purchased food products into the apps. This is due to the absence of information encoded in the barcode [15]. This necessitates the development of technology that gives consumers the capacity to automatically retrieve the relevant expiry/best before the date, and the ability to trace the origin of the food they purchased across the supply chain. Even though the existing techniques [19,20,21] offered improved benefits, they often fail to incorporate efficient deep learning techniques or explainable AI for efficient decision-making. The efficient traceability of food supply chains is the only issue that is addressed by all the existing BT frameworks [22,23], which do not address technical solutions to improve consumer access to food traceability so that they can verify and track the food they have purchased, possibly using a mobile phone. Motivated by these challenges, we propose an XAI-based faster RCNN to evaluate the nutritional advantages of food products and identify customers who are at high risk of jeopardizing their health if they consume unhealthy products. In this sense, our research is novel, and there are few other research approaches in this domain that analyze the health benefits of a product using a QR code (Table 1).

3. Proposed Blockchain-based Secure Food Recommendation Framework Using QR Mechanism

The different activities and phases involved in a typical food supply chain (FSC) must be investigated in order to design a blockchain technology (BT)-based architecture that would improve the accessibility and traceability of food production data [4]. The proposed framework’s study focuses on the food production industry (FPI) supply chain, which comprises five main phases and is illustrative of a broader FSC:
  • Production: All FPI-related operations are represented by the first stage of production;
  • Processing: The produce is harvested and transformed into products during the processing stage. Through a production batch code, every packet is identified, and the phase includes the product’s packaging and preparation;
  • Distribution: After the product has been labeled and packed, the product is distributed to various warehouses and product storage in other distribution centers which are conducted in the distribution phase;
  • Retailing: products are supplied from the distribution centers to the retailers during retailing phase so they can sell them to the customers;
  • Consumption: The food supply chain’s final user is the consumer who purchases the product, demands the traceability of quality standards, and accesses other pertinent information about the product like the expiration date.
We concentrated on digitizing information in the framework by proposing an XAI-based faster RCNN model. Moreover, the initial four phases are utilized; they include processing, retailing, production, and distribution.

3.1. Faster RCNN Model

  • Faster RCNN:
Faster RCNN is an object detection system that contains two modules including a deep fully convolutional network and a faster R-CNN detector. The below section explains the properties and design of the regional proposal network.
a.
Region proposal Networks:
The input of the region proposal network is the image, and the set of rectangular object proposals is the output; each contains the score of abjectness [24]. We overlay a tiny network with the convolutional feature map generated through the last transferred convolutional layer to produce region proposals. The input convolutional feature map’s m × m spatial window for this tiny network serves as the input. A lower-dimensional feature is assigned to each sliding window. The two fully connected layer features are box classification ( c l s ) and box-regression layer ( r e g ).
b.
Anchors:
We concurrently forecast numerous region proposals at each sliding-window location; here, c represents the higher number of proposals that can be made at each site. The c l s layer outputs 2 c scores which evaluate the probability of an object or not an object for each proposal, while the r e g layer outputs 4 c storing the locations of c boxes.
c.
Translation-Invariant Anchors:
Our method’s translation invariance both with regard to the functions and the anchors which calculate suggestions related in to the anchors is a key characteristic. When an object in an image is translated, the proposition should follow suit and should be predictable in either location using the same function. By our method the translation, the invariant property is assured.
d.
Multi-scale Anchors as Regression references
In contrast, on a pyramid of anchors, our anchor-based approach is structured and is then more economical. Bounding boxes are categorized and regressed using anchor boxes with different scales and aspect ratios in our method. It only employs filters of one size and only uses images and single-scale feature maps. We can easily employ the single-scale convolutional features computed by the Fast R-CNN detector, owing to this multi-scale design based on anchors. A significant factor for sharing features is not incurring additional costs for addressing scales which is the establishment of multi-scale anchors.
  • Loss function
It is designed to assign a binary class label to every anchor for the training of region proposal networks (RPNs). There are two different types of anchors: the greatest intersection-over-union (IoU) and the IoU interconnect that exceeds 0.7 over any ground-truth box. Multiple anchors may receive positive labels from a single ground-truth box. For the determination of the positive samples, the second condition is adequate, but the first condition is adopted because the second condition did not detect a positive sample in some rare cases. Anchors that fall into none of the positive or negative categories do not advance the training goal. The below equation defined the loss function:
Q ( { r j } , { v j } ) = 1 R c l s j Q c l s ( r j , r j * ) + β 1 R r e g r j * Q r e g ( v j , v j * )
where j represents the anchor’s index and r j indicates as the anchor’s predicted probability. When the anchor is positive, the ground-truth label r j * is 1; and if the anchor is negative, it is 0. v j is donated as a vector which is representing four parameterized. Q c l s is represented as the log loss. When Q r e g ( v j , v j * ) = G ( v j v j * ) , the regression loss is used. The robust loss function is indicated by G. The c l s r e g layers’ outputs are { r j } and { V j } , correspondingly. The two terms are weighted by a balancing parameter β and normalized by R c l s and R r e g . By the many anchor locations, the term r e g is normalized, while the term c l s is normalized through the mini-batch size. The parameterizations of the four following coordinates are used for bounding box regression.
v Y = ( y y b ) / z b ,   v X = ( x x b ) / e a ,
v Z = log ( z / z b ) ,   v e = log ( e / e b ) ,
v Y * = ( y * y b ) / z b ,   v x * = ( x * x b ) / e b ,
v Z * = log ( z * / z b ) ,   v e * = log ( e * / e b )
Here, the box’s width, height, and center coordinates are represented by y, x, z, and e. All region sizes share the same regression weights.
e.
Training RPNs
End-to-end RPN training may be accomplished using backpropagation and stochastic gradient descent (SGD). Every mini-batch begins with a single image that has a large number of both strong and poor example anchors, making it possible to improve the loss functions of all anchors. Every new layer was initiated by randomly selecting weights from a zero-mean Gaussian distribution with a standard deviation of 0.01. When a model is pre-trained, it initializes all of its layers. For the initial 60 k mini-batches, a learning rate of 0.001 was employed.

3.2. Formation of Blockchain-Driven XAI-Based Faster RCNN Model

In recent times, the field of research, explainable artificial intelligence (XAI) is increasing. The main purpose of the XAI is to make the user more competent in the field of artificial intelligence (AI) application and machine learning. In this paper, we utilize the post hoc method to demonstrate XAI on faster RCNN; therefore, the user can trust and understand the faster RCNN AI approach. Furthermore, the detection of model results may be understood, and the dataset can be modified throughout the training phase to adjust the application for changes. We use post hoc techniques such as visuals and written explanations. In this study, we used the following post hoc approaches for the OSA XAI demonstration: graphics, text explanations, and example-based explanations. Faster RCNN XAI application software was built to assist customers in understanding it. Faster RCNN XAI is comprised of four primary screens. These displays are used for testing, training, monitoring, and calculating metrics. The model state is shown using the visualization approach based on the accuracy numbers for each model. When one of these three accuracy values falls below 80%, the color of the relevant accuracy statistic is changed. Furthermore, using the text explanation technique, training progress steps are provided inside the training process in a more intelligible form, and the application analyzes the importance of the accuracy values after the training operation. The final trained model is activated automatically. At the same time, the user can select one of the previous models from the list. Shelf images may be taken around every hour during peak hours and every three hours during off-peak hours for the Faster RCNN system to assess. The model is then used for subsequent image classification, and the images are saved by the system. When empty or almost empty shelves are discovered, the responsible shop employee receives a notification to examine the relevant area. To prevent losing money and consumers, a sensible employee can place new items on the shelf after receiving a notification. For non-AI professionals and developers consumers, Faster RCNN XAI provides an opportunity to comprehend, trust, and govern AI applications to boost Faster RCNN. Results can be easily interpreted, and the dataset can be expanded with images without labels for the demand alters. Here, information is stored in BT for consumer accessibility and traceability at the stage of consumption. The blockchain stores and maintains every piece of digital information related to the initial four phases within a cloud [25].
  • System design: A layered system is developed for the creation of our BT framework. The 3 layers of our system are as follows:
  • Physical layer: Various food items from various FPI and manufacturers along the supply chain frame the physical layer;
  • Digital information layer: The physical layer’s production is associated with the digital information layer, which will be used for accessibility and traceability. The food item’s expiration date is an example of the data related to the product;
  • Cloud layer: Through the usage of BT, which is employed for accessibility and traceability, digital information is processed in the cloud in the cloud layer.
Our XAI-based Faster RCNN model framework is introduced with an example of how food production data in the first four stages of the supply chain can be digitally archived and made available to consumers through a quick response (QR) code to be used in data verification. In Figure 1, an FPI creates and processes a food product, where the pertinent data is digitalized and saved in a genesis Block 0. The item is moved to the distribution facility and then carried into the store for customers to purchase. The preceding block’s hash is stored in another block that is created in the supply chain stage so that the item can always be traced and tracked. We also employ the elliptic curve integrated encryption scheme (ECIES) technique, where the hash function provides the block before its hash. The ECIES technique encrypts information many times for sensitive data, but only once for non-sensitive data. The encrypted data is then stored utilizing cloud switches [4]. We adopt ECIES for the hash function in our XAI-based quicker RCNN model since it provides the required cloud security for the associated computational cost. If we utilize other hashing algorithms, such as ECIES, the computational cost eventually rises since it is computationally more expensive and takes a long time to calculate on the cloud. This is especially true if millions of electronically created data are processed daily on the cloud. The two components that comprise the XAI-based faster RCNN model are input and output. The input module creates the blocks, the data-carrying QR code, and digitizes the formed data. QR codes are an efficient data transfer medium that is used in product tracking, mobile payments, advertising, and other sectors. This QR code is defined by forty symbol variations and four error correction levels (ECL). The larger QR variants have greater payloads and the 40 code versions have a capacity of 2596 bytes. The error-correcting capacity introduced by the QR code standard, which recovers data accurately even if a component is broken, is a critical aspect of the bar code. The Reed–Solomon error-correcting method was used to rectify the flaw. The error-corrected codeword is attached to the rear of the QR code’s data codewords. The larger QR code version and higher ECL give the increased payload and dependability. Consumers use the output module, or open-source software, to access and verify the manufacturer’s data.

3.2.1. Input Module

The following details ( f j ) about the products are true when we observe f j to be the j th food item instance generated in an FPI such as P N j . t j represents the product name and type. F P I j , s j , P D j and B D j represent the FPI id, produce’s size, production date, and best-before date, which is digitized so that the consumer can use this data to trace and verify the block as it moves through the system. The below-given equation illustrates the digitized data.
f j = { P N j , t j , F P I j , S P j , P D j , B D j }
In information f j , the specific FPI id F P I j , which corresponds with the FPI data, is saved in a database that keeps track of all the FPI. The hash function is also used to produce the specific FPI id from the FPI’s stored information, guaranteeing that each FPI has a unique identifier. The information f j is saved in the genesis block. The latest block that contains the unique information f j and the previous block’s hash is generated each time a component of the supply chain moves the products or processes them. The data passed in the block is stored in the QR code, which can be created at any stage of the supply chain.

3.2.2. Output Module

Utilizing a QR code scanner, the output module retrieves the information f j and the preceding block’s hash from the QR code. From the preceding block, the output module applies a hash function to the data which is created online for consumer verification. The outcome is contrasted with the hash value acquired from the QR code. The data regarding the product is accurate when the hash values are identical. The FPI information where the product originated is retrieved from the unique FPI received from the QR code, and the data is shown to the customer together with extra data about the item. The FPI id can be used to conduct a reverse database search since the FPI’s specifics are kept in a database. Figure 1 displays the dairy product data that was retrieved from the QR code in Figure 1. The XAI-based Faster RCNN architecture also analyzes the harmful ingredients like the sugar, calories, and saturated fats listed in the product’s ingredients. The overall architecture of the XAI-based Faster RCNN model is represented in Figure 1.

3.2.3. SHAP Analysis

The most popular model-neutral technique is Shapley additive explanations (SHAP) where the SHAP values, which are a cooperative game theory concept, serve as the foundation [16]. Utilizing an additive feature attribution analysis, SHAP breaks down a model’s prediction amid each of the features that are involved.
f ( y ) = π 0 + j = 1 N π j y j
In this case, f ( y ) is indicated as the explanation model that, when y = o y ( y ) , equals the original model f(y). y { 0 , 1 } N where a number of input features are represented by N. For π j , the baseline model is represented by π 0 , and the contribution of feature j in order to the prediction of the model is represented by π j .
π j = S M \ j | S | ! ( N | S | 1 ) ! N ! [ g Y ( S j ) g Y ( S )
Here, M represented all input features. For j, SHAP’s internal workings take into account two different models: g S { j } ( y ) and g S ( y ) . The difference in prediction between the two models is then calculated. This distinction is a result of feature j. Here the SHAP analysis is conducted to acquire a legal plea for a laboratory test based on the health benefits and nutritional benefits listed in the product QR code. Figure 2 illustrates the processing time of various methods.

3.3. Artificial Rabbits Optimization (ARO) for Secure Cloud Storage

At first, the user will be registered with a reputable authority. It obtains the key of ARO for data encryption. After that, the user will authenticate by providing an ID of the user, password, and random number. In the cloud, the encrypted data can be updated by the authenticated user. For the encryption algorithm’s purpose, we develop the elliptic curve integrated encryption scheme (ECIES) algorithm. On non-sensitive data, encryption is performed only once. The ARO algorithm is used for registration. Random hiding and detour foraging are two rabbit survival principles that are typically utilized to introduce the ARO algorithm [17]. The detour foraging approach is designed to keep rabbits safe from natural predators while the grass around the nest is consumed by rabbits. The rabbits employ a random hiding tactic to hide and travel to another burrow. The search algorithm is in the process of being initialized. The design variable dimension is represented as t, the artificial rabbit colony’s size is represented as M, the lower bound is represented as l b , and the upper bound is represented as u b . The initialization process is as follows:
y j , o   = q . ( u b o l b o ) + l b o       , o =   1 , 2 , ..... , t
where y j , o represents the position of the jth rabbit of the cth dimensions, and q represents the random number. The metaheuristic algorithm generally regards the two processes—exploitation and exploration—and at the same time detour foraging generally regards the exploration phase. Detour foraging is employed to all rabbit’s food sources and chooses the location of another rabbit to earn enough food. The detour foraging updated formula is as follows:
s j   ( p + 1 ) = y c ( p ) + W . ( y j ( p ) y c ( p ) ) + r o u n d ( 0.5 . ( 0.05 + q 1 ) ) . x 1
W = h . B
h = ( g g ( p 1 I max ) 2 ) . sin ( 2 π q 2 )
B ( o ) = { 1 i f   o = = F ( h ) 0 e l s e } k = 1 , ....... , t   a n d   h = 1 , ........ [ q 3   . t ]
F = r a n d p ( t )
x 1   M ( 0 , 1 )
where d j , o   ( p + 1 ) represents the artificial rabbit’s new position. The disposition of artificial rabbits is denoted by j , c = 1 , .... , M .   y j and y c denotes the artificial rabbits in other random positions. The maximum number of iterations is denoted by Imax. Rounding to the nearest integer is represented by the ceiling function ⌈f⌉. Random stochastic layout permutation of numbers from 1 to t was represented as q 1 , q 2 ,     q 3 . During detour foraging, the running length, denoted by the l, is the rate of movement. The common normal distribution follows x 1 . Through the common distribution x 1 random number, the perturbation is mainly reflected. Equation (10) is the last term perturbation aid to perform a global search and ARO to avoid local extremum. Random hiding is primarily formed in the algorithm’s exploration phase. To lessen the likelihood of being eaten, rabbits typically create various burrows over their nests and select a random single burrow to which to retreat. We start by explaining how rabbits create burrows at random.
b j , c ( d ) = y j ( d ) + G . h . y j ( d )
G = F max d + 1 F max . m 2
m 2 ~ M ( 0 , 1 )
h ( o ) = { 1 i f   o = = c 0 e l s e   q   o = 1 , t
where j, c, and m 2 follow the standard distribution. G represents a hidden parameter. G reduces 1 to 1 / F max .

4. Results and Discussion

This paper introduces XIA-based Faster RCNN for tracing food behaviors using blockchain-based technology. Deep Reinforcement learning-based supply chain management (DR-SCM), Fuzzy based blockchain-IoT food traceability systems (BIFTS), and food traceable schemes based on blockchain and Ethernet blockchain (FTS-BAEPC) are the currently available food tracing methods selected for analyzing and comparing the performance of the proposed method. The Google cloud platform (GCP) is chosen for implementing the proposed XIA-based Faster RCNN model.

4.1. Experimental Evaluation

GCP is an 8-vCPU virtual machine with 500 GB of disc storage and 16 GB of RAM. A computer running Debian GNU OS (Linux) Version 10 serves as the computing engine. Various criteria, such as response time, payload size, and the number of connected users with the system, are utilized to validate the proposed method in real-world scenarios. The evaluation of the measures is given below.
  • Response time: It computes the time that the mobile client device takes to send the messages to the agent, and then it is transferred between the agent and the server. It includes the time it takes to save data in the database, which is measured in milliseconds (MS);
  • Payload size: It defines the volume of data transferred together which is represented in bytes;
  • User numbers: These refer to the users simultaneously using the system and requests for service along the network. It denotes the true scalability of the system.

4.2. Comparative Analysis

Figure 2 illustrates the time taken for processing the information in different methods with the Google Cloud platform (GCP). The processing time of the proposed XIA-based Faster RCNN model is comparatively lower than the existing methods; time is measured based on seconds. The processing time is evaluated here for the thousand products. The processing time of the XIA-based Faster RCNN method is 443 s.
Table 2 describes the comparative analysis of the proposed XIA-based Faster RCNN and existing methods in terms of different performance metrics such as accuracy, precision, recall, and F1-score. The percentage of accurate outcomes is called precision. The recall is a percentage metric that represents the proportion of accurate findings discovered. The harmonic mean of a system’s precision and recall values is known as an F-score, and it can be calculated using the following formula: 2 × [(Precision × Recall)/(Precision + Recall)]. One way to think about precision is as an inverted measure of noise; the further away from the greatest score it is, the more erroneous data will be included in the system’s output. Similar to recall, which is an inverted measure of silence, the more this number deviates from a perfect score, the more crucial data will be missing from the output the system produces. The proposed method attains the highest accuracy of 99.5%, whereby the existing DR-SCM methods reached 95.24% and Fuzzy-based BIFTS achieves 94.32% accuracy. The rest of the method taken for comparison is FTS-BAEPC which achieves 92.10% accuracy. The precision, recall, and F1-score of the proposed model are 98.56%, 98.65%, and 94.89%, respectively. Therefore, it is concluded that the XIA-based Faster RCNN method attained the highest performance among the other underlying methods.
Figure 3a,b compares the accuracies and loss values of the proposed method’s training and testing sets. The observations from these figures are explained as follows: the training performance begins at the 87.5% range and maintains stable performance till the 43 epochs. After these points, it witnessed more instabilities and attained the highest score of 92.35%. Similarly, the testing accuracy begins at the range of 80.42%. After maintaining a stable performance until 43 epochs, it witnessed unstable performance until the highest score of 90.25%. Conversely, the training and testing accuracies receded with the increasing epochs. The training loss started at 0.48 and decreased to 0.12 with the 100 epochs. Moreover, the test score begins with 0.38 and ends with a score of 0.1 at the 100th epoch. The XIA-based Faster RCNN method performs with significantly increasing accuracy and decreasing losses. From Figure 3a,b, we can observe that the training score is higher than the testing score for both accuracy and loss curves.
Figure 4 shows the response time of the user requests made by the user. A user creates twenty requests continuously. This helps them to analyze the efficiency of the proposed XIA-based Faster RCNN system in the cloud environment. Figure 5 demonstrates the scalability of the proposed XIA-based Faster RCNN method. The payloads are chosen at the range between 16 to 1024 bytes and their respective response time data is also gathered. Between 340 and 360 milliseconds, the response time maintains a constant motion between 16 and 256 payload bytes. After these 256 bytes, there is a noticeable increase in reaction time. Blockchain technology rejects the idea of massive data storage; as a result, scalability measurement is a crucial aspect of this. On the other hand, even if the communication distance is greater across the shared network and server setup of the cloud, this indicates a slower reaction time. The proposed XIA-based Faster RCNN method’s analysis results for training and cross-validation scores are shown in Figure 6. Cross-validation, testing, and training datasets are included in the three segments that make up the entire dataset. The majority (80%) of the dataset was used for training, with the remaining 20% being used for testing. Moreover, the K-fold cross-validation experiment uses both testing and training sets. At 87.52%, both curves merged. The training and cross-validation scores rise steadily as the number of products increases.
The trade-off between specificity and sensitivity is depicted by the ROC curve (1—specificity). Classifiers perform better when their curves are closer to the top-left corner. An initial assumption is that a random classifier will produce diagonal points (sensitivity = specificity). The ROC curve of the proposed model that differentiates between the harmful and healthy ingredients is presented in Figure 7.

5. Conclusions

This paper proposes a novel blockchain-based technology called XIA-based Faster RCNN which helps to digitalize food production data and combines the QR codes for tracing and validating data through the producers and consumers. The GCP platform is utilized to simulate a real-world food processing situation. The performances of the proposed method were measured based on accuracy, performance time, and scalability. Three underlying blockchain-based food traceability mechanisms are selected for comparison: deep reinforcement learning-based supply chain management (DR-SCM), fuzzy based blockchain-IoT food traceability systems (BIFTS), and food traceable schemes based on blockchain and Ethernet blockchain (FTS-BAEPC). The results indicated that the proposed method requires less response time and the lowest processing time compared with other existing methods. The accuracy achieved by the method is 99.53% and it was completed in less response time even with the increased payload and user number. The proposed work’s shortcoming is that the model’s scalability and interoperability were not evaluated in more practical contexts. To increase operational optimization in the supply chain for fast food, further research into data analytics approaches will be required in the future. A reliable warning system should also be developed to stop mishaps involving food.
Even though the proposed model improves the food traceability scenario, certain challenges still need to be addressed when deploying these solutions in real-time applications. The US is one of the nations which have has the world’s highest blockchain funds and most of the companies funding the blockchain space are in the starting stage of development. The lack of a fitness and lifestyle field in the blockchain is also one of the drawbacks faced. Hence, in the future, the application fields in the blockchain can be expanded and we can experiment with food traceability using a novel approach.
One of the challenges faced by many developing nations is the inability to satisfy the needs of the citizen in terms of both technology and services. Blockchain latency is another challenge faced by the proposed approach during the consensus process due to the increase in throughput. Sensor failure is another problem that needs to be focused on in the future because if the sensor tracking the crucial information fails at some point, it results in loss of the valid information. Hence, the safety of the sensor tracking the QR code information also needs to be addressed.
To deploy the system in real-time, we should ensure that the customers have basic knowledge of the blockchain system, i.e., how to use it, its requirements, and what drawbacks may be faced. The collection of users’ sensitive information should not be high in food traceability systems. One of the issues faced when dealing with data from different organizations is satisfying the regulatory requirements. A cost-efficient data acquisition process can be implemented by automatically extracting the data during the warehousing, manufacturing, and shipping processes. An important step that can improve food traceability is the gathering of crucial data from customers in order to analyze the nutritional benefits of the product.

Author Contributions

Conceptualization, S.B. and A.S.A.; methodology, S.B. and A.S.A.; software, S.B.; validation, S.B. and A.S.A.; formal analysis, S.B. and A.S.A.; investigation, A.S.A.; resources, A.S.A.; data curation, S.B.; writing—original draft preparation, S.B.; writing—review and editing, A.S.A.; project administration, A.S.A. All authors have read and agreed to the published version of the manuscript.

Funding

The authors extend their appreciation to the Deputyship for Research and Innovation, Ministry of Education in Saudi Arabia, for funding this research work (Project number INST038).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Toledo, R.Y.; Alzahrani, A.A.; Martinez, L. A food recommender system considering nutritional information and user preferences. IEEE Access 2019, 7, 96695–96711. [Google Scholar] [CrossRef]
  2. Kakani, V.; Nguyen, V.H.; Kumar, B.P.; Kim, H.; Pasupuleti, V.R. A critical review on computer vision and artificial intelligence in food industry. J. Agric. Food Res. 2020, 2, 100033. [Google Scholar] [CrossRef]
  3. Vecchio, R.; Cavallo, C. Increasing healthy food choices through nudges: A systematic review. Food Qual. Prefer. 2019, 78, 103714. [Google Scholar] [CrossRef]
  4. Dey, S.; Saha, S.; Singh, A.K.; McDonald-Maier, K. FoodSQRBlock: Digitizing food production and the supply chain with blockchain and QR code in the cloud. Sustainability 2021, 13, 3486. [Google Scholar] [CrossRef]
  5. Al-Rakhami, M.S.; Al-Mashari, M. ProChain: Provenance-Aware Traceability Framework for IoT-Based Supply Chain Systems. IEEE Access 2021, 10, 3631–3642. [Google Scholar] [CrossRef]
  6. Chan, K.Y.; Abdullah, J.; Khan, A.S. A framework for traceable and transparent supply chain management for agri-food sector in malaysia using blockchain technology. Int. J. Adv. Comput. Sci. Appl. 2019, 10, 1–8. [Google Scholar] [CrossRef] [Green Version]
  7. Gadekallu, T.R.; Pham, Q.V.; Nguyen, D.C.; Maddikunta, P.K.R.; Deepa, N.; Prabadevi, B.; Pathirana, P.N.; Zhao, J.; Hwang, W.J. Blockchain for edge of things: Applications, opportunities, and challenges. IEEE Internet Things J. 2021, 9, 964–988. [Google Scholar] [CrossRef]
  8. Bechtsis, D.; Tsolakis, N.; Bizakis, A.; Vlachos, D. A blockchain framework for containerized food supply chains. In Computer Aided Chemical Engineering; Elsevier: Amsterdam, The Netherlands, 2019; Volume 46, pp. 1369–1374. [Google Scholar]
  9. Tsang, Y.P.; Choy, K.L.; Wu, C.H.; Ho, G.T.S.; Lam, H.Y. Blockchain-driven IoT for food traceability with an integrated consensus mechanism. IEEE Access 2019, 7, 29000–129017. [Google Scholar] [CrossRef]
  10. Chen, H.; Chen, Z.; Lin, F.; Zhuang, P. Effective management for blockchain-based agri-food supply chains using deep reinforcement learning. IEEE Access 2021, 9, 36008–36018. [Google Scholar] [CrossRef]
  11. Hu, S.; Huang, S.; Huang, J.; Su, J. Blockchain and edge computing technology enabling organic agricultural supply chain: A framework solution to trust crisis. Comput. Ind. Eng. 2021, 153, 107079. [Google Scholar] [CrossRef]
  12. Casino, F.; Kanakaris, V.; Dasaklis, T.K.; Moschuris, S.; Rachaniotis, N.P. Modeling food supply chain traceability based on blockchain technology. Ifac-Pap. 2019, 52, 2728–2733. [Google Scholar] [CrossRef]
  13. Huang, H.; Zhou, X.; Liu, J. Food supply chain traceability scheme based on blockchain and EPC technology. In Proceedings of the International Conference on Smart Blockchain, Birmingham, UK, 11–13 October 2019; Springer: Cham, Switzeland; pp. 32–42. [Google Scholar]
  14. Li, Z.; Liu, G.; Liu, L.; Lai, X.; Xu, G. IoT-based tracking and tracing platform for prepackaged food supply chain. Ind. Manag. Data Syst. 2017, 117, 1906–1916. [Google Scholar] [CrossRef]
  15. Ahamed, N.N.; Karthikeyan, P.; Anandaraj, S.P.; Vignesh, R. Sea food supply chain management using blockchain. In Proceedings of the 2020 6th International Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore, India, 6–7 March 2020; pp. 473–476. [Google Scholar]
  16. Karumanchi, M.D.; Sheeba, J.I.; Devaneyan, S.P. Blockchain Enabled Supply Chain using Machine Learning for Secure Cargo Tracking. Int. J. Intell. Syst. Appl. Eng. 2022, 10, 434–442. [Google Scholar]
  17. Hu, H.; Xu, J.; Liu, M.; Lim, M.K. Vaccine supply chain management: An intelligent system utilizing blockchain, IoT and machine learning. J. Bus. Res. 2023, 156, 113480. [Google Scholar] [CrossRef] [PubMed]
  18. Dey, S.; Saha, S.; Singh, A.K.; McDonald-Maier, K. SmartNoshWaste: Using Blockchain, Machine Learning, Cloud Computing and QR Code to Reduce Food Waste in Decentralized Web 3.0 Enabled Smart Cities. Smart Cities 2022, 5, 11. [Google Scholar] [CrossRef]
  19. Mishra, N.; Mistry, S.; Choudhary, S.; Kudu, S.; Mishra, R. Food Traceability System Using Blockchain and QR Code. In IC-BCT 2019; Springer: Singapore, 2020; pp. 33–43. [Google Scholar]
  20. Tian, F. An agri-food supply chain traceability system for China based on RFID & blockchain technology. In Proceedings of the 2016 13th International Conference on Service Systems and Service Management (ICSSSM), Kunming, China, 24–26 June 2016; pp. 1–6. [Google Scholar]
  21. Köhler, S.; Pizzol, M. Technology assessment of blockchain-based technologies in the food supply chain. J. Clean. Prod. 2020, 269, 122193. [Google Scholar] [CrossRef]
  22. Basnayake, B.M.A.L.; Rajapakse, C. A Blockchain-based decentralized system to ensure the transparency of organic food supply chain. In Proceedings of the 2019 International Research Conference on Smart Computing and Systems Engineering (SCSE), Colombo, Sri Lanka, 28 March 2019; pp. 103–107. [Google Scholar]
  23. Dong, Y.; Fu, Z.; Stankovski, S.; Wang, S.; Li, X. Nutritional quality and safety traceability system for China’s leafy vegetable supply chain based on fault tree analysis and QR code. IEEE Access 2020, 8, 161261–161275. [Google Scholar] [CrossRef]
  24. Gupta, A.; Siddiqui, S.T.; Alam, S.; Shuaib, M. Cloud computing security using blockchain. J. Emerg. Technol. Innov. Res. 2019, 6, 791–794. [Google Scholar]
  25. Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 7–12 December 2015. [Google Scholar]
Figure 1. Overall architecture of blockchain-driven XAI-based Faster RCNN model.
Figure 1. Overall architecture of blockchain-driven XAI-based Faster RCNN model.
Sustainability 15 02579 g001
Figure 2. Processing time of various methods.
Figure 2. Processing time of various methods.
Sustainability 15 02579 g002
Figure 3. Analyzing training and testing: (a) accuracy; (b) loss.
Figure 3. Analyzing training and testing: (a) accuracy; (b) loss.
Sustainability 15 02579 g003
Figure 4. Evaluation of the proposed method in the cloud environment.
Figure 4. Evaluation of the proposed method in the cloud environment.
Sustainability 15 02579 g004
Figure 5. Scalability analysis.
Figure 5. Scalability analysis.
Sustainability 15 02579 g005
Figure 6. Training and cross-validation score of the proposed method.
Figure 6. Training and cross-validation score of the proposed method.
Sustainability 15 02579 g006
Figure 7. ROC curve of the proposed model.
Figure 7. ROC curve of the proposed model.
Sustainability 15 02579 g007
Table 1. Existing literature contribution.
Table 1. Existing literature contribution.
AuthorTechniqueAimAdvantageLimitations
Bechtsis et al. [8] TSFSCDeploying a demonstration application using blockchain and verifying its traceability via critical parametersSecure information sharing and improves process controlThe properties of the products are not analyzed
Tsang et al. [9]BIFTSIntegrate usage of blockchain, IoT, and fuzzy logic into a system that maintains the full traceability and shelf life of perishable goods.Offers reliable decision supportThe user is not able to verify the food source
Chen et al. [10]DR-SCMMaking a decision that is efficient for food production and secure for the agri-food tracking data.Consistent product tracing and food safetyItem level tracking is not conducted
Hu et al. [11]OASCTo address the shortcomings of blockchain’s price and efficiencyOffers inexpensive traceability options for individualsProne to Byzantine faults
Casino et al. [12]FSCCreate a distributed functional model based on smart contracts and blockchain technology to allow automatic, decentralized FSC traceability.Prevents health risks and minimizes monetary lossStill needs improvement in the decision-making process
Huang et al. [13]Electronic Product Code and blockchainFood tracking and tracing throughout the agricultural supply chainReduce the data explosion in the Internet of Things blockchainIncrease in capital construction cost
Dey et al. [4]Food SQRBlockInformation retrieval using a BT and QR code-based framework for food productionImproved traceabilityArises storage issues
Li et al. [14]XML, QR, and RFTo cut implementation costs while achieving fine-grained monitoring and tracingAll parties involved may stand to gain from the effective implementation of prepackaged food monitoring and tracking across its supply chain.Failed to provide timely decision-making and improve consumer health
Ahamed et al. [15]Blockchain and QR codeUsing blockchain and specific product identifiers to enhance supply chain managementThe benefits of a customized tag allow everyone from the manufacturer to the consumer to learn more about a product’s reliable production process.Absence of smart sensors and AI technologies
Karumanchi et al. [16]MRCNN-MTMonitor the conditions of commercial products in the cargo industrySecure communication and storage improvementsThis study does not focus on minimizing the impact of product wastage
Hu et al. [17]GRU and BILSTMVaccine supply chain management during COVID-19Accuracy nearly equal to 80%Results in massive QR code generation
Dey et al. [18]Reinforcement learningMinimize food wastageReduces food wastage by up to 9.46%The food surplus data is not easily available
Table 2. Comparative analysis of accuracy.
Table 2. Comparative analysis of accuracy.
MethodsAccuracy (%)Precision (%)Recall (%)F1-Score
Proposed99.5398.5698.6598.54
DR-SCM95.2494.5695.6994.89
Fuzzy based BIFTS94.3294.3594.5694.34
FTS-BAEPC92.1091.5692.1591.32
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Bhatia, S.; Albarrak, A.S. A Blockchain-Driven Food Supply Chain Management Using QR Code and XAI-Faster RCNN Architecture. Sustainability 2023, 15, 2579. https://doi.org/10.3390/su15032579

AMA Style

Bhatia S, Albarrak AS. A Blockchain-Driven Food Supply Chain Management Using QR Code and XAI-Faster RCNN Architecture. Sustainability. 2023; 15(3):2579. https://doi.org/10.3390/su15032579

Chicago/Turabian Style

Bhatia, Surbhi, and Abdulaziz Saad Albarrak. 2023. "A Blockchain-Driven Food Supply Chain Management Using QR Code and XAI-Faster RCNN Architecture" Sustainability 15, no. 3: 2579. https://doi.org/10.3390/su15032579

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop