<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Blockchain for Enhanced Safron Evaluation: A Focus on Filament Curvature Assessment</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mohammad Rowhani Sistani</string-name>
          <email>Mohammad.rowhanisistani@unipa.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pierluigi Gallo</string-name>
          <email>pierluigi.gallo@unipa.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Maria Timoshina</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>SEEDS s.r.l.</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Italy</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Blockchain</institution>
          ,
          <addr-line>Safron, Computer Vision, Supply chain, Image processing</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Camerino</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Palermo</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, we present a study on the curvature analysis of safron filaments using computer vision. The goal is to develop a reliable method for detecting altered safron by analyzing the curvature of safron iflaments in captured pictures using image processing. Safron can be altered through processes such as pressing and ironing, one of the usual frauds on the safron supply chain. We explore the integration of blockchain technology in the safron supply chain to enhance traceability and ensure economic and societal sustainability.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>CEUR
ceur-ws.org</p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction</title>
      <p>
        Safron, the most expensive spice in the world, derived from the Crocus sativus flower, is a highly
sought-after spice known for its distinct flavor, aroma, and vibrant color. The harvesting and
processing of safron involve intricate methods, and the quality of safron is often determined
by the characteristics of its filaments [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Safron, often referred to as ”red gold” holds a special
place not only in the culinary world but also in traditional medicine and cultural practices.
Its scarcity, along with the intensive harvesting process, contributes to its high market value.
Undoubtedly, the primary factor driving its value is the extensive requirement for manual labor
at constantly increasing costs, compressed into a limited number of days and just a few hours
each day.
      </p>
      <p>
        Additionally, post-harvest, a dehydration treatment is essential to transform the stigmas of
Crocus sativus L. into safron spice. This dehydration process results in the stigmas losing
approximately 80% of their original weight [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        Another reason for the high price and value of safron is its low cultivation area which leads to
its low production in the world. Iran, Spain, and the Republic of India are the largest producers
of safron in the world, collectively responsible for around 90% of global production, equivalent
to approximately 300 tons annually [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>The majority of safron production in India is concentrated in the Jammu and Kashmir
region. Currently, Kashmiri safron encounters challenges in the selling process, primarily
stemming from issues such as the absence of standardization, certification, and quality assurance.
Adulteration emerges as a significant concern contributing to a decline in safron demand, it
leads to a deterioration in its overall quality, reduces customer trust, and causes health problems
for consumers.</p>
      <p>
        In our study, we delve into how computer vision can be a game changer for identifying the
characteristics of safron. The fundamental concept involves endowing machines with the
ability to recognize what is apparent to humans, particularly in inspecting safron filaments
and distinguishing its color, length, and straightness. The objective entails instructing
computational systems to visually perceive and interpret images or videos akin to an experienced
specialist, albeit with the precision and steadfast attention characteristic of algorithms [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. By
leveraging image processing, a key component of computer vision, we can notably enhance
both the precision and eficiency of the safron evaluation process. This analysis, a facet of
image processing, enhances the reliability and speed of quality assessment by reducing noise,
improving contrast, and extracting pertinent features from the safron imagery. Our objective
is to implement a repeatable, automatic, reliable, and foolproof system resilient against errors
and human oversight, capable of promptly assessing the quality of safron. This efort is aimed
at maintaining standards and providing assurance to consumers regarding the authenticity of
the product [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>The pervasive challenge of ensuring product authenticity and data integrity in the face of
manipulation calls for robust solutions. In response to this, technology emerges as a valuable
tool. Blockchain ofers a transparent, traceable, and decentralized ledger system that is
tamperresistant by design. This secure framework holds particular promise for enhancing transparency
and ensuring the traceability of high-value goods such as safron. Products like safron are
susceptible to counterfeiting, both in terms of physical products and associated data throughout
the safron supply chain. By integrating blockchain into the safron supply chain, we can
significantly reduce the risk of fraud and protect the data from being altered illicitly. The
technology not only supports secure transactions but also paves the way for trusted
decisionmaking among multiple stakeholders in the supply chain, industry, and consumers.</p>
      <p>Blockchain technology transforms the concept of a shared registry into a tangible reality
across diverse application domains, spanning from cryptocurrency to potential implementations
in decentralized, resilient, and trustworthy decision-making within multi-stakeholder industrial
systems. Particularly notable is its utilization to enhance sustainability, such as establishing a
high-trust supply chain, which impacts economic viability, environmental preservation, and
social equity, which are the primary focus of exploration in this study.</p>
    </sec>
    <sec id="sec-3">
      <title>2. Related works</title>
      <p>A diverse range of research and innovation fields ofers a wealth of novel perspectives,
sophisticated techniques, and cutting-edge technological developments. This section explores the</p>
      <sec id="sec-3-1">
        <title>Blockchain</title>
        <p>Network
collecting
information
from farm to
fork
reduced human
errors,
interferences and
frauds
Sustainability
Traceability and
Transparency</p>
      </sec>
      <sec id="sec-3-2">
        <title>Saffron</title>
      </sec>
      <sec id="sec-3-3">
        <title>Products</title>
      </sec>
      <sec id="sec-3-4">
        <title>Computer</title>
      </sec>
      <sec id="sec-3-5">
        <title>Vision</title>
        <p>features of
saffron
strands
current body of knowledge on safron analysis in related works, several projects in various
image processing applications, computer vision applications in food quality assessment, and the
revolutionary potential of blockchain technology in supply chain management. These linked
works demonstrate the dynamic nature of research in these fields and provide the framework
for comprehending the complex strategies and solutions used in various domains.</p>
        <sec id="sec-3-5-1">
          <title>2.1. Safron Analysis Literature</title>
          <p>
            This paper extends a previous work on computer vision and blockchain for safron in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ]. The
paper focuses on enhancing the transparency, traceability, and quality control of the safron
supply chain through the integration of blockchain technology and computer vision, introducing
objective quality assessment focusing on filament color and length moving beyond subjective
human assessment. The system validates data with a blockchain network on Multichain to
ensure a secure and tamper-resistant tracking mechanism across the supply chain. The present
paper extends that work by analysing curvature of filaments and moving forward towards a
methodology for safron identification.
          </p>
          <p>
            In [
            <xref ref-type="bibr" rid="ref7">7</xref>
            ] the authors propose a safron quality classification based on its aroma. The paper
addresses a critical issue in the safron industry, where the high value of safron makes it
susceptible to adulteration. Adulteration methods, such as adding cheaper materials or immersion of
safron in substances like honey or oils, pose challenges for both spice industries and consumers.
The paper introduces an innovative approach utilizing an electronic nose system with metal
oxide semiconductor sensors for detecting safron adulteration. The electronic nose captures
aroma fingerprints, and the data are analyzed using principal component analysis (PCA) and
artificial neural networks (ANN).
          </p>
          <p>
            The work in [
            <xref ref-type="bibr" rid="ref8">8</xref>
            ] ofers significant insights into theme of safron adulteration detection
highlighting such methods as 1H NMR spectroscopy and multivariate data analysis. It underscores
the absence of a robust method to distinguish pure high-grade safron from adulterated samples,
motivating the study. The paper asserts that the combination of 1H NMR spectroscopy and
multivariate data analysis serves as a potent approach for detecting safron adulteration. This
method provides a rapid, minimally invasive, and comprehensive detection tool but spectroscopy
is not available at customers’ premise neither in many industrial environments.
          </p>
        </sec>
        <sec id="sec-3-5-2">
          <title>2.2. Image Processing Benefits</title>
          <p>The research on the relationship between computer vision and food quality assessment is
particularly relevant to our analysis.</p>
          <p>
            In [
            <xref ref-type="bibr" rid="ref9">9</xref>
            ] it is listed a range of studies and applications demonstrating computer vision
technology’s transforming power in the food sector. The volume delves into various approaches and
strategies employed in utilizing computer vision to assess food product quality, from dairy and
meat to fruits and vegetables. The authors highlighted technical solutions and methodologies
including the use of computed tomography and magnetic resonance imaging in food science,
including their ability to provide detailed internal images of food products. This methodology is
useful for studying foods’ internal structure, such as salt distribution in dry-cured ham or fat in
meats. MRI, with its excellent renditions of soft materials, is suitable for visualizing most food
objects, monitoring dynamic changes as foods are processed, and characterizing the physical
state of water in frozen corn, among other applications. The work describes pre-processing
techniques for detecting food attributes to improve image quality before segmentation. It ofers
various segmentation techniques based on thresholds, regions, gradients (edge detection), and
classifications segmentation. Techniques such as noise removal (using linear and median filters)
and contrast enhancement (through histogram scaling and equalization) are discussed. The
authors stress the fact that pre-processing steps are crucial for achieving accurate segmentation
results in food quality evaluation and that diferent types of food images may require diferent
segmentation techniques for optimal results. In our paper we focus on computer vision
techniques that can be potentially taken with low-cost devices, eventually with a smartphone and
integrate this with blokcchain and smart contracts.
          </p>
        </sec>
        <sec id="sec-3-5-3">
          <title>2.3. Blockchain in Supply Chain Management</title>
          <p>
            After exploring the importance and capabilities of image processing in data visualization, the
focus now shifts to another critical aspect of modern technology: blockchain in supply chain
management. A recent contribution to this field is evident in the paper ”A Blockchain-Based
System for Agri-Food Supply Chain Traceability Management” by [
            <xref ref-type="bibr" rid="ref10">10</xref>
            ], which introduces a
comprehensive model for a blockchain-based agri-food supply chain traceability system. While
image processing enhances the ability to analyze and interpret visual data, blockchain technology
ofers a decentralized and transparent framework for tracking and verifying the authenticity
and integrity of products as they move through the supply chain. Embracing Hyperledger Fabric
as its framework, the proposed system leverages a permissioned blockchain, ofering a scalable
and distributed solution tailored to the specific needs of the agri-food industry. The system
uses smart contracts to automate supply chain operations, allowing for seamless registration of
product types, batch creation, and ownership transfers among participating organizations. The
integration of rule-based mechanisms further enhances the system’s capabilities, enabling the
implementation of quality control measures to ensure adherence to predefined parameters. The
significance of this paper lies in its practical use cases, illustrating the successful automation
of supply chain management and the maintenance of transparent and immutable traceability
information. The presented scenarios, ranging from ideal operations to alternative pathways
with challenges, underscore the adaptability and robustness of the proposed model. As a
valuable addition to the literature on blockchain applications in agri-food supply chains, this
paper lays the groundwork for more sophisticated rule engines and performance evaluations,
signalling a promising trajectory for future advancements in the field.
          </p>
          <p>The literature review highlights the diverse range of research eforts to address challenges in
safron quality assessment, spanning from innovative approaches in image processing to utilising
blockchain technology for supply chain integrity. These studies underscore the multidisciplinary
nature of safron quality research and the significance of technological advancements in ensuring
the authenticity and quality of this prized spice.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>3. Safron cultivation, classification and market</title>
      <p>In this section, we aim to delve into the various facets of safron production, distribution, and
classifications. We also aim to expound upon the predominant global locations where safron
cultivation is prolific. Furthermore, our discourse endeavours to elucidate the diverse categories
of safron and shed light on the key stakeholders within the safron supply chain.</p>
      <p>
        Safron, known as ”the red gold”, is a valuable plant and one of the most expensive cash crops
worldwide [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. With a history spanning over 4000 years, it has traditionally been used for its
tonic and antidepressant qualities in medicine [12]. Derived from the dried red stigmas of the
Crocus sativus L. flower, safron is not only used to enhance the colour, flavour, and aroma of
various dishes such as ’paella’ in Spain, ’Milanese risotto’ in Italy, and ’Lussekatter’ buns in
Sweden, it is also gaining popularity in the food industry for its health benefits. In the modern
context, safron’s inclusion in diets is on the rise, driven by its perceived positive impact on
human health, making it particularly appealing to consumers [13].
      </p>
      <p>The world’s leading safron producers include Iran, Greece, Morocco, Spain, and Italy.
Additionally, since 2015, Afghanistan, a neighbouring country to Iran, has also become involved in
this market [14]. India also contributes to global safron production, accounting for
approximately 5% of the total output. Most of India’s safron production, about 90%, is concentrated in
the Jammu and Kashmir region [15]. Experts in Iran classify safron into three main categories:
Sargol, Pushal, and Negin. This categorization is significant as it denotes distinct grades of
safron. Sargol, for instance, represents the top portion of the red filament and is characterized
by a high concentration of crocin compounds, which contribute to safron’s distinctive colour
[16]. Crocin, functioning as the primary carotenoid, is accountable for the safron colour.
Picrocrocin, conversely, is the compound responsible for the bitter taste associated with safron. As
for Safranal, it is among the many molecules contributing to the distinctive aroma of safron
[17].</p>
      <p>Appreciating the diferences among various safron types is essential for its efective utilization
across diverse fields such as medicine, culinary, and textile production.</p>
      <p>The proliferation of adulteration on safron or altered safron poses a considerable challenge,</p>
      <p>Year
as it undermines the integrity of the safron market. Issues such as adulteration and mislabeling
compromise the quality of safron products and erode consumer trust. Detecting and addressing
these fraudulent practices are crucial not only for safeguarding the economic interests of the
safron industry but also for ensuring consumers receive genuine, high-quality safron with its
intended health benefits and culinary attributes.</p>
      <p>
        Kashmiri safron is encountering sales challenges due to the absence of standardization,
certification, and quality assurance. Additionally, a lack of analysis and development further
compounds the issues. Adulteration emerges as a significant concern, contributing to a decline
in safron demand and subsequently leading to a deterioration in its overall quality [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Based
on a study conducted on safron available in the Indian market, findings reveal that only 52%
of the safron samples are authentic, while 30% are of poor quality, and 17% are adulterated.
This alarming trend of safron adulteration is rapidly growing, presenting itself as a significant
challenge and a form of white-collar fraud [18].
      </p>
      <p>While accurate, traditional laboratory methods for detecting safron adulteration are often
inaccessible to many due to their complexity and the need for specialized equipment.
Consequently, there’s a growing necessity for more user-friendly, cost-efective methods that can be
utilized outside laboratory settings. These methods aim to empower consumers and small-scale
vendors to verify the authenticity of safron using a camera cellphone or other functional daily
tools, ensuring quality and safety in the market. The development of such methods is critical in
combating the widespread issue of food fraud, specifically in the safron industry, where the
stakes are exceptionally high due to the spice’s esteemed status and economic value. Indeed,
crocin, safranal, and picrocrocin are vital components that determine safron quality. Global
standards stipulate that these compounds, along with safron’s appearance, dictate its overall
quality [19]. This article aims to empower users to discern potential safron fraud by addressing
these components.</p>
      <p>Various factors can influence the quality of safron, and temperature is one of them. Several
research studies have proven that heat has many negative efects on the vital components of
safron, such as crocin and safranal. Exposure to normal to high temperatures, especially those
exceeding 60 degrees Celsius, can degrade crocin content and destroy other vital components
of safron [ 20, 21].</p>
      <p>One prevalent form of safron fraud, often referred to in the safron market as ”Indian safron”
or ”ironed safron,” involves using a steam press machine. This method involves pressing safron
strands between two heated fabric plates, exposing safron to steam. The goal is to straighten
the safron filaments and increase their length. However, this fraudulent practice damages the
plant tissue and alters the safron’s appearance characteristics, which are crucial determinants
of its quality. Furthermore, the process results in the loss of essential compounds such as crocin,
safranal, and picrocrocin, rendering the final product devoid of nutritional value.</p>
    </sec>
    <sec id="sec-5">
      <title>4. Blockchain for safron quality and sustainability</title>
      <p>The potential of blockchain technology to enhance quality control in the agri-food supply chain
is increasingly recognized. Its immutable and decentralized ledger system ofers unparalleled
traceability and transparency, addressing key challenges within the industry. By tracking
agricultural products from farm to fork, blockchain ensures each process step is documented
and verifiable. This level of traceability is crucial for verifying the authenticity of food items,
enabling real-time monitoring of manufacturing, processing, and delivery phases.</p>
      <p>The current challenges in agri-food quality assurance, such as adulteration and lack of
traceability, are significant hurdles to ensuring food safety and consumer trust. Adulteration, the
deliberate addition of inferior materials, is a common issue in the food industry, compromising
the quality and safety of products. Similarly, the lack of a transparent and traceable supply chain
makes it dificult to pinpoint the origin and handling of food products, leading to potential health
risks and loss of consumer confidence. Blockchain technology addresses these challenges by
providing a secure and transparent way to record and verify each transaction within the supply
chain. The supply chain evolves into a more interconnected framework in a blockchain-enabled
system. Every transaction recorded on the blockchain becomes accessible to every member
within the network. This transparency improves the ability to track products, fostering greater
confidence in the entire process [ 22].</p>
      <p>Blockchain technology ofers a multitude of solutions to enhance traceability and transparency
in the safron supply chain, as well as in other food product supply chains. One of these solutions
is MultiChain platform or Hyperledger Fabric, the use of MultiChain platform, a permissioned
blockchain platform, is crucial. It creates a secure and controlled environment, ideal for scenarios
involving a network of known and trusted organizations. This aspect of the system ensures
that sensitive supply chain data is managed securely, maintaining the integrity of information
across various stakeholders.</p>
      <p>Additionally, using smart contracts to automate supply chain operations represents a
significant innovation. The smart contracts, executed within the blockchain, automate transactions
and processes, enhancing the eficiency and reliability of the supply chain management. This
automation is particularly efective in reducing human error and increasing the speed of
operations, providing a robust mechanism for handling complex supply chain workflows. In the
safron supply chain, where consumers may lack the necessary information to recognize the
qualities and distinguish between diferent types of safron, the use of automatic systems such
as IoT sensors or computer vision helps to record information with complete details accurately.
Such validation ensures that the products adhere to the regulatory requirements and quality
standards, thus enhancing the food supply chain’s overall quality control and safety.</p>
      <p>These elements collectively contribute to creating a more eficient, secure, and reliable
agrifood supply chain management system, representing significant advancements in leveraging
blockchain technology for enhancing traceability and quality assurance in the food industry.
IOT Sensors
Blockchain
Platform
MultiChain
Platform
Smart
Contract
Quality
Control
Distributor
Retailer
Customer</p>
      <p>Records cultivation data</p>
      <p>Sends data to blockchain
Immutable &amp; Transparent</p>
      <p>Ledger
y
sse itso Automates Transactions</p>
      <p>r
se th
c c
cA udo Ensures Standards &amp; Safety
r
p</p>
      <p>Stores data security</p>
      <p>Ttriggers smart contract</p>
      <p>VVerifies product quality</p>
      <p>Approves and forwards products</p>
      <p>Distributes verified products
Sells to customers</p>
      <p>Farmer
IOT Sensors
Blockchain
Platform
MultiChain
Platform
Smart
Contract
Quality
Control
Distributor
Retailer
Customer</p>
    </sec>
    <sec id="sec-6">
      <title>5. Digital Technologies</title>
      <p>Computer vision technology ofers multifaceted applications, ranging from noise reduction and
object removal in images to facial recognition and database searches for identifying individuals.
This advanced technology is crucial in mitigating human diagnostic errors, particularly in
contexts such as safron analysis, where intricate details within each filament must be accurately
assessed and diferentiated. These advancements in image processing algorithms, particularly
when combined with tools like OpenCV and MATLAB, ofer a framework for the classification
and grading of safron. The proposed algorithms can discern subtle diferences in safron
samples, aiding in quality control and fraud detection in the safron industry.</p>
      <p>
        Image processing involves defining a two-dimensional function,  (,  ) , where  and 
represent spatial coordinates, and the amplitude of  at any pair (,  ) is the image intensity or
grey level. When  ,  , and amplitude values are finite and discrete, the image is termed a digital
image. Digital image processing, carried out by a computer, involves manipulating these finite
elements. Computer vision, a branch of artificial intelligence and image processing, focuses
on computer interpretation of real-world images. It combines low-level image processing (e.g.,
noise removal, contrast enhancement) with higher-level pattern recognition to identify image
features [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>In the field of agri-food technology, the creation of image data processing systems is an
important advancement. These systems greatly lessen the need for laborious and possibly
arbitrary manual inspection by automating the analysis process. They can accurately and
reliably identify and categorise characteristics like safron appearance diferences and fraudulent
product manipulations. This improves agricultural productivity and sustainability by enabling
Image Processing</p>
      <sec id="sec-6-1">
        <title>ColeocftiSonafPfroicntures</title>
      </sec>
      <sec id="sec-6-2">
        <title>ColeocftiSonafPfroicntures</title>
        <p>Data input
Colection
Data input
Colection
Data input</p>
        <p>Colection
real-time monitoring and decision-making and ensuring more objective results.</p>
        <p>The development of mobile or portable devices utilizing image processing technology for
on-the-spot quality assessment of safron represents a significant advancement. This technology
empowers vendors and buyers in markets by providing immediate, accurate assessments,
reducing the risk of adulteration, ensuring fair pricing, and ofering the opportunity to identify real
quality safron in a user-oriented way without the need for laboratory equipment. Additionally,
it facilitates recording information throughout the safron supply chain by all stakeholders
involved. Furthermore, integrating such technology in the safron market streamlines the quality
assurance process and enables the submission of data gathered from these algorithms onto the
blockchain network. This integration ensures the retention and preservation of accurate data
on a transparent network.</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>6. Methodology and Data</title>
      <p>This research introduces an innovative methodology for the computational analysis of safron
iflament curvature, diverging from traditional quality assessment methods. The approach
combines computer vision’s precision with MATLAB and OpenCV’s analytical power to ofer a
groundbreaking way of evaluating safron quality through its filament curvature. A
comprehensive dataset of safron filament images is compiled from various authentic sources, ensuring
a wide range of curvature variations. These images are meticulously selected to represent
diferent grades and conditions of safron, providing a robust foundation for the analysis.</p>
      <p>The images undergo a sophisticated processing pipeline, which utilizes advanced filtering
and segmentation techniques; the individual filaments are isolated from the image background,
focusing on their unique curvature attributes. A custom-built algorithm is developed to analyze
and quantify the curvature of the safron filaments. This algorithm leverages the capabilities of
(a)
(b)
MATLAB and OpenCV to detect subtle curvature diferences for quality assessment. The
curvature data extracted from the algorithm undergoes statistical analysis to establish correlations
between filament curvature and safron quality to detect normal safron without fraud. This
analysis aims to identify patterns and thresholds that can be used to identify safron objectively.</p>
      <sec id="sec-7-1">
        <title>6.1. Data Collection</title>
        <p>For the initial development of the algorithm and image processing, standard safron images
were captured in a laboratory using common mobile cameras with typical noise levels. This
approach was chosen to make the algorithm easily usable for everyday users. During this data
collection phase, specific guidelines and methods were established, leading to the following
steps:
1. Photos of adulterated safron, high-quality safron and lower-grade safron were taken to
form the first set of samples. In this set, the safron with the longest filaments represented
the highest quality and the shortest had the lowest quality.
2. The safron was laid out on a white sheet of paper, and the camera was positioned 20 cm
away from the plate.
3. Each safron sample weighed exactly one gram.
4. To capture diverse images, each identical sample was photographed ten times. The paper
was shaken between each shot to rearrange the safron strands in various orientations.
5. The same safron filaments were then crushed to simulate low-quality safron for
additional photography, forming the second set of samples. However, the adulterated safron
samples were left as is for this process.</p>
      </sec>
      <sec id="sec-7-2">
        <title>6.2. Analysis of Filament Size</title>
        <p>This section focuses on a technique to enhance the visibility of safron filaments in images.
The method begins by converting images to grayscale and creating a binary representation
to diferentiate between black and white areas. The process then involves measuring the
length and thickness of the safron filaments. Specific criteria are used to select filaments
for analysis, and their lengths are plotted in histograms. This analysis is further applied to
safron samples of diferent quality levels, allowing for an evaluation of safron quality. The
Cumulative Distribution Function (CDF) is employed in this script to draw comparisons in
safron quality across various categories. This part of the study delves into three distinct quality
categories of safron: ’A’, ’B’, and ’C’. For each category, the research meticulously examined ten
images of safron filaments. A key analysis component was using data visualization techniques,
particularly histograms, to illustrate the distribution of filament lengths across each quality
category. Cumulative Distribution Functions (CDFs) provided additional insight into the range
and variability of filament lengths.</p>
        <p>
          The methodology also entailed calculating and visually representing the proportions of red
and yellow colours in the safron filaments, which served as an objective indicator of colour
composition. The colour composition of safron filaments is crucial in determining their potency
and general quality, so it is evaluated with special attention. Notably, one of the important
factors in detecting safron quality is that higher-quality safron filaments are frequently linked
to a richer red colour. This relationship arises from the carotenoid pigment crocin, which
gives safron its characteristic red colour and directly correlates with strength and quality.
Conversely, yellow segments in safron filaments, often found towards the ends of the strands,
indicate lower quality [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Bright red indicates a high crocin concentration, which indicates
superior colouring power for high-quality safron. Furthermore, the analysis involved isolating
objects based on their diameters to understand the correlation between size and quality. This
classification enabled an exploration of filament length distributions within each size class, using
histograms and CDFs to assess cumulative probability trends and the proportion of filaments
within specific length ranges. After the initial inspection and grading of safron quality, the
curvature degrees of safron filaments are calculated using the previous data of the filaments’
length and diameter by creating a mathematical ratio of width to length. Finally, the algorithm
identifies the filaments of each group of safron as safron adulteration if the curvature value is
less than normal.
        </p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>7. Final Remarks and Future Directions</title>
      <p>Blockchain application, developed on the MultiChain platform, streamlines the management of
the safron supply chain. Leveraging Bitcoin’s underlying technology, MultiChain enables swift
blockchain application development. It organizes data in distinct streams based on user and year,
each containing user-generated data blocks or transactions. The application ofers three types
of data streams - public, business, and reserved - tailored to diferent privacy needs. User data
is distributed across multiple blockchain nodes to enhance stability and security. Additionally,
users can utilize dedicated nodes, ensuring data redundancy. A notable aspect of our system
is the use of ”smart filters,” which serve as a more eficient alternative to conventional smart
contracts. These filters assess data before it’s added to the blockchain, deciding whether to log
it or tag it with special identifiers. For example, safron meeting certain criteria can be tagged
as ”organic.” Smart filters also validate existing data when added to the blockchain, allowing
0.9
0.8
for ongoing quality checks. All stakeholders in the safron supply chain, including farmers,
producers, sellers, and buyers, contribute data to the blockchain. This collaborative approach
creates a detailed product history, ensuring complete traceability. In the specific case of the
safron supply chain, smart filters evaluate the length and colour of safron strands through
50</p>
      <p>100 150
Filaments Length [mm]</p>
      <p>Type C
Type B</p>
      <p>Type A
200
250</p>
      <p>Short Filaments
Middle Filaments</p>
      <p>Long Filaments
50</p>
      <p>100 150
Filament Length [mm]
200
250
Algorithm 1 Algorithm for detecting safron adulteration</p>
      <p>regionprops(binary_image)
bwconncomp( ) ▷</p>
      <p>Feret( ) ▷
_ ← outMax.MaxDiameter(1 ∶ maxLabel)
▷ Convert RGB image to grayscale
▷ Convert image to binary image</p>
      <p>▷ Invert binary image
▷ Find contours and shape properties
Find and count connected components
Get shape stats and filter out outlayers</p>
      <p>▷ Get maximum diameters for each
outMin.MinDiameter(1 ∶ maxLabel) ▷ Get minimum diameters for each
_)
_ℎ)
_ℎ)
_ℎ) ▷</p>
      <p>▷ Compute Feret properties
▷ Find lengths of valid filament
▷ Find thicknesses of valid filament
▷ Calculate width to length ratio on each</p>
      <p>Classified the safron normal and abnormal according
ℎ ← rgb2gray(image)
 ← im2bw(image)
 ←∼ 
 ←
 ←
[ ,  ] ←
 
iflament
  _ℎ ←
iflament
[ ,  ] ←
  ←
 ℎ ←
 ℎ ←
 ℎ ←
threshold
image analysis and assign quality marks based on predefined standards.</p>
      <p>In this research, we used the Multichain platform to evaluate the methodology and feasibility
of traceability and quality verification in the safron supply chain. The blockchain can eficiently
handle the requested transaction volumes, the number of which depends on the statistical
compression of the row data. Time to run the CV algorithm makes writing on the blockchain
processing time, as the requirements are not strict. We consider one image per second of
the conveyor belt and then analyze 60 images; this implies one writing on the blockchain
per minute, showcasing its scalability and robustness. These performance metrics fit the
blockchain’s capability to provide real-time traceability and immutable record-keeping in a
high-demand market like safron.</p>
      <p>Our blockchain implementation uses MultiChain technology, which is tailored to facilitate
the secure and eficient management of the safron supply chain by integrating its data ingestion
with the capability of Computer Vision. Our system’s architecture is built around a tailored
consensus algorithm through a smart filter derived from MultiChain’s inherent multilateral
mining approach. This consensus model is engineered to distribute control equitably among
all participating nodes, ensuring no single entity can dominate the decision-making process.
Additionally, it enhances the robustness of our blockchain-based platform by preventing any
single point of failure, which is crucial for maintaining continuous operations through the
safron supply chain. This setup ensures real-time transaction verification and consistent
updates across all nodes. Furthermore, we have developed specific smart filters to enhance the
traceability and the automation level of the safron quality verification. These smart contracts
streamline operations such as batch tracking, quality certification, and payment processes,
enhancing the safron market’s operational eficiency and transparency.</p>
      <sec id="sec-8-1">
        <title>7.1. Create and deploy Redgold Blockchain on Multichain</title>
        <p>The initial step in establishing the Redgold blockchain involved creating and deploying the
ifrst node onto the network. For this task, we utilized MultiChain and incorporated various
stakeholders of the safron supply chain, ranging from farmers to customers. This process
included installing MultiChain on the primary node and configuring the genesis block, which
serves as the foundation of the blockchain. After the creation, the Redgold blockchain was
deployed by starting the blockchain on the primary node, we created other permissions and
rules on the network. Additional nodes were connected to the Redgold blockchain network
by installing Multichain on other machines and using the connection information provided
by the primary node. This step is crucial for creating a decentralized network where multiple
participants can interact with the blockchain. For each participant in the supply chain, a unique
blockchain address was generated. These addresses represent farmers, logistics providers,
quality control labs, distributors, retailers, and customers.</p>
        <p>Streams were created on the Redgold blockchain to represent categories of data and
transactions relevant to the supply chain. Each stream was assigned to an aspect of the supply
chain, such as production data for farmers to submit all data from the producing step, like
the Origin area of the product, and other streams like logistics, quality control, distribution,
retail, and customer feedback. Permissions were allocated to each participant, allowing them
specific interactions with the streams. The permissions include writing, reading, and sending
transactions within assigned streams. This granularity in permission settings ensures data
integrity and access control within the blockchain network, as explained in Algorithm 2.</p>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>8. Conclusion</title>
      <p>This research provides a methodological approach to safron quality assessment, blending
computer vision’s objectivity with blockchain technology’s transparency. Our study
demonstrates the efectiveness of using a quality metric and algorithm for analyzing the curvature of
safron filaments in quality assessment to detect counterfeit safron. This method addresses
a significant gap in quality control practices, predominantly focused on colour, aroma, and
chemical composition.</p>
      <p>By introducing a reliable and accessible way to evaluate safron quality, this approach
empowers producers, suppliers, and consumers to ensure the authenticity and purity of safron.
Integrating blockchain technology into the safron supply chain is a pivotal advancement in
the digital domain but still requires special attention to guarantee correspondence with the
physical one. In addition to using decentralized and secure digital platforms, we suggest to use
computer vision to monitor safron during the whole supply chain, requiring a methodology
that automatically extract info from filaments and compare them over time. Future research
should focus on the potential of the proposed integration of blockchain and computer vision
also to use visual features as markers that fingerprint the product; in order to identify it beyond
classification.
[12] M. Shokrpour, Safron (crocus sativus l.) breeding: Opportunities and challenges, Advances
in Plant Breeding Strategies: Industrial and Food Crops 6 (2019) 675–706. doi:10.1007/
978-3-030-23265-8_17.
[13] A. Kyriakoudi, S. A. Ordoudi, M. Roldan-Medina, M. Tsimidou, A functional spice, Austin</p>
      <p>J Nutri Food Sci 3 (2015). URL: www.austinpublishinggroup.com.
[14] H. Mohammadi, M. Reed, Safron marketing: challenges and opportunities, Safron:
Science, Technology and Health (2020) 357–365. doi:10.1016/B978-0-12-818638-1.
00022-8.
[15] A. Kumar, M. Devi, R. Kumar, S. Kumar, Introduction of high-value crocus sativus (safron)
cultivation in non-traditional regions of india through ecological modelling, Scientific
Reports 2022 12:1 12 (2022) 1–11. URL: https://www.nature.com/articles/s41598-022-15907-y.
doi:10.1038/s41598-022-15907-y.
[16] M. M. Moghadam, M. Taghizadeh, H. Sadrnia, H. R. Pourreza, Nondestructive classification
of safron using color and textural analysis, Food Science and Nutrition 8 (2020) 1923–1932.
doi:10.1002/FSN3.1478.
[17] A. Bergomi, V. Comite, L. Santagostini, V. Guglielmi, P. Fermo, Determination of
saffron quality through a multi-analytical approach, Foods 2022, Vol. 11, Page 3227 11
(2022) 3227. URL: https://www.mdpi.com/2304-8158/11/20/3227/htmhttps://www.mdpi.
com/2304-8158/11/20/3227. doi:10.3390/FOODS11203227.
[18] A. M. Husaini, S. A. U. Haq, A. Shabir, A. B. Wani, M. A. Dedmari, The menace of safron
adulteration: Low-cost rapid identification of fake look-alike safron using foldscope and
machine learning technology, Frontiers in Plant Science 13 (2022) 945291. doi:10.3389/
FPLS.2022.945291/BIBTEX.
[19] K. . Kour, D. . Gupta, J. . Rashid, K. . Gupta, J. . Kim, K. . Han, K. Kour, D. Gupta, J. Rashid,
K. Gupta, J. Kim, K. Han, K. Mohiuddin, Smart framework for quality check and
determination of adulterants in safron using sensors and aquacrop, Agriculture 2023, Vol.
13, Page 776 13 (2023) 776. URL: https://www.mdpi.com/2077-0472/13/4/776/htmhttps:
//www.mdpi.com/2077-0472/13/4/776. doi:10.3390/AGRICULTURE13040776.
[20] Z. Khadfy, H. Atifi, R. Mamouni, S. M. Jadouali, A. Chartier, R. Nehmé, Y. Karra, A. Tahiri,
Nutraceutical and cosmetic applications of bioactive compounds of safron (crocus sativus
l.) stigmas and its by-products, South African Journal of Botany 163 (2023) 250–261.
doi:10.1016/J.SAJB.2023.10.058.
[21] S. Karasu, Y. Bayram, K. Ozkan, O. Sagdic, Extraction optimization crocin pigments
of safron (crocus sativus) using response surface methodology and determination
stability of crocin microcapsules, Journal of Food Measurement and Characterization
13 (2019) 1515–1523. URL: https://link.springer.com/article/10.1007/s11694-019-00067-x.
doi:10.1007/S11694-019-00067-X/TABLES/4.
[22] M. L. Di Silvestre, P. Gallo, J. M. Guerrero, R. Musca, E. Riva Sanseverino, G.
Sciumè, J. C. Vásquez, G. Zizzo, Blockchain for power systems: Current trends and
future applications, Renewable and Sustainable Energy Reviews 119 (2020) 109585.
URL: https://www.sciencedirect.com/science/article/pii/S1364032119307932. doi:https:
//doi.org/10.1016/j.rser.2019.109585.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J. P.</given-names>
            <surname>Melnyk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. F.</given-names>
            <surname>Marcone</surname>
          </string-name>
          ,
          <article-title>Chemical and biological properties of the world's most expensive spice: Safron</article-title>
          , Food Research International
          <volume>43</volume>
          (
          <year>2010</year>
          )
          <fpage>1981</fpage>
          -
          <lpage>1989</lpage>
          . doi:
          <volume>10</volume>
          . 1016/J.FOODRES.
          <year>2010</year>
          .
          <volume>07</volume>
          .033.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>M.</given-names>
            <surname>Carmona</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Zalacain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. E.</given-names>
            <surname>Pardo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>López</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Alvarruiz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. L.</given-names>
            <surname>Alonso</surname>
          </string-name>
          ,
          <article-title>Influence of diferent drying and aging conditions on safron constituents</article-title>
          ,
          <source>Journal of Agricultural and Food Chemistry</source>
          <volume>53</volume>
          (
          <year>2005</year>
          )
          <fpage>3974</fpage>
          -
          <lpage>3979</lpage>
          . URL: https://pubs.acs.org/doi/full/10.1021/jf0404748. doi:
          <volume>10</volume>
          .1021/jf0404748.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J.</given-names>
            <surname>Amin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Selwal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Sabha</surname>
          </string-name>
          , Saps:
          <article-title>Automatic safron adulteration prediction systems, research issues, and prospective solutions</article-title>
          ,
          <source>Proceedings - 2021 4th International Conference on Computational Intelligence and Communication Technologies</source>
          ,
          <string-name>
            <surname>CCICT</surname>
          </string-name>
          <year>2021</year>
          (
          <year>2021</year>
          )
          <fpage>64</fpage>
          -
          <lpage>71</lpage>
          . doi:
          <volume>10</volume>
          .1109/CCICT53244.
          <year>2021</year>
          .
          <volume>00024</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Szeliski</surname>
          </string-name>
          , Computer Vision: Algorithms and Applications, Springer,
          <year>2020</year>
          . URL: https: //books.google.it/books?hl
          <article-title>=en&amp;lr=&amp;id=QptXEAAAQBAJ&amp;oi=fnd&amp;pg=PR9&amp;dq=whats+ computer+vision&amp;ots=BNuaz0Ywsm&amp;sig=BQRLhJFePZhrJ5Vl894pGUkwyTY&amp;redir_esc= y#v=onepage&amp;q&amp;f=false.</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S.</given-names>
            <surname>Nagabhushana</surname>
          </string-name>
          ,
          <article-title>Computer vision</article-title>
          and imaging processing (
          <year>2006</year>
          )
          <article-title>206</article-title>
          . URL: https://books.google.com/books/about/Computer_Vision_and_Image_Processing.html? id=eSu5I9pU3rUC.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>M. R.</given-names>
            <surname>Sistani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Gallo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Timoshina</surname>
          </string-name>
          ,
          <article-title>Red gold traceability: computer vision and blockchain for safron quality</article-title>
          ,
          <source>BlockSys 2023 - Proceedings of the 5th ACM International Workshop on Blockchain-enabled Networked Sensor Systems</source>
          (
          <year>2023</year>
          )
          <fpage>13</fpage>
          -
          <lpage>20</lpage>
          . URL: https://dl.acm.org/ doi/10.1145/3628354.3629530. doi:
          <volume>10</volume>
          .1145/3628354.3629530.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>K.</given-names>
            <surname>Heidarbeigi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. S.</given-names>
            <surname>Mohtasebi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Foroughirad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ghasemi-Varnamkhasti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Rafiee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Rezaei</surname>
          </string-name>
          ,
          <article-title>Detection of adulteration in safron samples using electronic nose</article-title>
          ,
          <source>International Journal of Food Properties</source>
          <volume>18</volume>
          (
          <year>2015</year>
          )
          <fpage>1391</fpage>
          -
          <lpage>1401</lpage>
          . URL: https://www.tandfonline.com/doi/ abs/10.1080/10942912.
          <year>2014</year>
          .
          <volume>915850</volume>
          . doi:
          <volume>10</volume>
          .1080/10942912.
          <year>2014</year>
          .
          <volume>915850</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>R.</given-names>
            <surname>Dowlatabadi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Farshidfar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Zare</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Pirali</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Rabiei</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. R.</given-names>
            <surname>Khoshayand</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. J.</given-names>
            <surname>Vogel</surname>
          </string-name>
          ,
          <article-title>Detection of adulteration in iranian safron samples by 1h nmr spectroscopy and multivariate data analysis techniques</article-title>
          ,
          <source>Metabolomics</source>
          <volume>13</volume>
          (
          <year>2017</year>
          )
          <fpage>1</fpage>
          -
          <lpage>11</lpage>
          . URL: https://link.springer. com/article/10.1007/s11306-016-1155-x. doi:
          <volume>10</volume>
          .1007/S11306-016-1155-X/FIGURES/7.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Nixon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Aguado</surname>
          </string-name>
          ,
          <article-title>Feature Extraction and Image Processing for Computer Vision</article-title>
          , Academic Press,
          <year>2020</year>
          . URL: https://books.google.it/books? hl
          <article-title>=en&amp;lr=&amp;id=KcW-DwAAQBAJ&amp;oi=fnd&amp;pg=PP1&amp;dq=computer+vision+ and+image+processing+projects+on+food+products&amp;ots=11hw6mWx5S&amp;sig= t-gz2dpxlIdr1I7DzI4DGhkILxY&amp;redir_esc=y#v=onepage&amp;q&amp;f=false.</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>A.</given-names>
            <surname>Marchese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Tomarchio</surname>
          </string-name>
          ,
          <article-title>A blockchain-based system for agri-food supply chain traceability management</article-title>
          ,
          <source>SN Computer Science</source>
          <volume>3</volume>
          (
          <year>2022</year>
          )
          <fpage>1</fpage>
          -
          <lpage>21</lpage>
          . URL: https://link.springer.com/ article/10.1007/s42979-022-01148-3. doi:
          <volume>10</volume>
          .1007/s42979-022-01148-3.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>S.</given-names>
            <surname>Leone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Recinella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Chiavaroli</surname>
          </string-name>
          , G. Orlando,
          <string-name>
            <given-names>C.</given-names>
            <surname>Ferrante</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Leporini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Brunetti</surname>
          </string-name>
          , L. Menghini,
          <article-title>Phytotherapic use of the crocus sativus l. (safron) and its potential applications: A brief overview</article-title>
          ,
          <source>Phytotherapy Research</source>
          <volume>32</volume>
          (
          <year>2018</year>
          )
          <fpage>2364</fpage>
          -
          <lpage>2375</lpage>
          . doi:
          <volume>10</volume>
          .1002/PTR. 6181.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>