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

: 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 artiﬁcial 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, artiﬁcial 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 beneﬁts provided by ECIES-based blockchain technology assist policymakers, manufacturers, and merchants in efﬁcient 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.


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.

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 agrifood 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).The properties of the products are not analyzed Tsang et al. [9] BIFTS Integrate usage of blockchain, IoT, and fuzzy logic into a system that maintains the full traceability and shelf life of perishable goods.

Offers reliable decision support
The user is not able to verify the food source Chen et al. [10] DR-SCM Making a decision that is efficient for food production and secure for the agri-food tracking data.The food surplus data is not easily available

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 XAIbased faster RCNN model.Moreover, the initial four phases are utilized; they include processing, retailing, production, and distribution.

•
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 (cls) and box-regression layer (reg).

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 cls layer outputs 2c scores which evaluate the probability of an object or not an object for each proposal, while the reg layer outputs 4c 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 groundtruth 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: 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 cls is represented as the log loss.When , the regression loss is used.The robust loss function is indicated by G.The clsreg layers' outputs are r j and V j , correspondingly.The two terms are weighted by a balancing parameter β and normalized by R cls and R reg .By the many anchor locations, the term reg is normalized, while the term cls is normalized through the mini-batch size.The parameterizations of the four following coordinates are used for bounding box regression.
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.

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.
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.

Input Module
The following details f j about the products are true when we observe f j to be the jth food item instance generated in an FPI such as PN j .t j represents the product name and type.FPI j , s j , PD j and BD 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 = PN j , t j , FPI j , SP j , PD j , BD j In information f j , the specific FPI id FPI 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.

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.

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.
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 .
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.

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.
In this case, ) (y f  is indicated as the explanation model that, when Here, M represented all input features.For j, SHAP's internal workings take into account two different models: and ) ( y g S .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.

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

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: 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: 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.
where j, c, and m 2 follow the standard distribution.G represents a hidden parameter.G reduces 1 to 1/F max .

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.

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.

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.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 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 100 th epoch.The XIA-based Faster RCNN method performs with significantly increasing accuracy and decreasing losses.From Figures 3a and 3 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, 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 (1specificity).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.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.The trade-off between specificity and sensitivity is depicted by the ROC curve (1specificity).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.

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.

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 draw-backs 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.
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

Figure 2 .
Figure 2. Processing time of various methods.

Figure 2 .
Figure 2. Processing time of various methods.

Figure
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 Figure3a,b, we can observe that the training score is higher than the testing score for both accuracy and loss curves.
nication 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 Figure6.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.

Figure 4 .
Figure 4. Evaluation of the proposed method in the cloud environment.

Figure 4 .
Figure 4. Evaluation of the proposed method in the cloud environment.

Figure 4 .
Figure 4. Evaluation of the proposed method in the cloud environment.

Figure 6 .
Figure 6.Training and cross-validation score of the proposed method.

Figure 6 .
Figure 6.Training and cross-validation score of the proposed method.

Figure 7 .
Figure 7. ROC curve of the proposed model.

Figure 7 .
Figure 7. ROC curve of the proposed model.

Table 2 .
Comparative analysis of accuracy.

Table 2 .
Sustainability 2023, 15, 2579 13 of 17deviates 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.Comparative analysis of accuracy.