A digital twin reference architecture for pharmaceutical cannabis production

ABSTRACT The production of pharmaceutical cannabis is a complex and dynamic industry that has to meet critical challenges concerning product quality, compliance, traceability, food safety, sustainability and health. Digital twins have the potential to be powerful enablers for producers to meet these challenges. However, digital twins for the pharmaceutical production of cannabis are still under exploration and not yet researched. This paper contributes to overcoming this situation by proposing a reference architecture for the development and implementation of digital twins in this domain. Based on a design-oriented methodology, it defines and applies a coherent set of architecture views for modelling digital twin-based systems. Furthermore, a proof of concept of an immersive digital twin has been developed in order to test the applicability of reference architecture. This digital twin is developed in the open, cross-industry platform Unity and includes an extensive 3D model of a cannabis production facility. It is connected with real-world data through an application programming interface integration displaying real-time sensor data from a live greenhouse. The 3D environment is fully explorable, where the user takes control of an avatar character to walk around the facility and view real-time sensor readings. The expert validation shows that the developed digital twin is a valuable and innovative first step for remote management of pharmaceutical cannabis production. Further developments are needed to leverage its full potential, especially adding more types of sensor data, developing implementation-specific 3D models, extending the digital twin with predictive and prescriptive capabilities and connecting it to actuators.


Introduction
The production of pharmaceutical cannabis is a complex and dynamic industry that has to meet critical challenges concerning product quality, compliance, traceability, food safety, sustainability and health (van der Giessen, van Ooyen-Houben, and Moolenaar 2016;Vanhove, Van Damme, and Meert 2011).Digital twin technologies have the potential to be powerful enablers for producers to meet these challenges.
A digital twin is a comprehensive digital representation of a physical system, to which it is both realtime and remotely connected (Tekinerdogan and Verdouw 2020), thus providing stakeholders with features such as data analytics and prediction of query data (Anthony Howard et al. 2020;Howard, Ma, and Jørgensen 2020;Slot, Huisman, and Lutters 2020).Digital twin-driven technologies are able to mirror the behaviour, future or current states of the physical system over its life cycle in a virtual space (Rosen, Boschert, and Sohr 2018;Verdouw et al. 2021).Using digital twins for production management enables the decoupling of physical flows and processes from its planning and control.Production processes can be managed remotely based on (near) real-time digital information, which allows for fast, flexible and advanced analysis, decision-making and control decision-making (Ciano et al. 2021;Cimino, Negri, and Fumagalli 2019;Onaji et al. 2022).As such, digital twins are considered in the literature as a prerequisite for a cyber-physical production system, which is a core element of industry 4.0 (Uhlemann, Lehmann, andSteinhilper 2017, Ciano et a., 2021).
Digital twin-driven systems may be implemented in different manufacturing domains, including the production of pharmaceutical cannabis, which is the focus of the present article.This is a highly industrialised type of greenhouse production, which is characterised by large-scale production and heavy use of technology.Cannabis production differs significantly from factory-wise production of other medical products that can be fully standardized.Depending on the purpose of usage, the virtualised objects in greenhouse horticulture may range from individual plants' genetics to a greenhouse or the complete value chain.
Digital twins have the potential to substantially enhance greenhouse horticulture productivity and sustainability (Defraeye et al. 2021;Howard, Ma, and Jørgensen 2020;Tao et al. 2019;Tian et al. 2020).However, at the time of writing this article, digital twins for the pharmaceutical production of cannabis are still under exploration.As will be highlighted in Section 2, recent studies focus on the implementation of digital twins for a diverse range of crops (Ariesen-Verschuur, Verdouw, and Tekinerdogan 2022).However, to the best of our knowledge, this article is the first to document the use of a digital twin specifically for pharmaceutical cannabis production.
Therefore, the contribution to knowledge provided in this work involves analyses of how digital twins (DTs) can advance pharmaceutical cannabis production.The main output is the design of a reference architecture for the development and implementation of DT systems in pharmaceutical cannabis production.The novelty of the work is further enhanced by the usage of immersive technologies (specifically virtual reality) for more user-centric immersive DTs in product management.Therefore, this reference architecture will provide a coherent set of predefined models that can be used as a common language by designers of DT and VR-based DT systems.Most existing DT solutions tend to be developed as siloed/oneoff applications, and the knowledge is not always transferrable (Barricelli and Fogli 2022;Ma et al. 2019).There are also no specific standards or roadmaps for integration from a human-computerinteraction perspective.Thus, the reference architecture provided in this article offers a way to design by means of a user-centric approach.Moreover, this paper aims to develop a Proof of Concept of a DT in 3D visualization in order to test the applicability of the reference architecture.
The remainder of this article is as follows: Section 2 provides a background discussion on DTs and related applications within the agricultural domain.Section 3 outlines the methodology for the approach used in this research, with the reference architecture provided in Section 4. The Proof of Concept is presented in Sections 5. Finally, the main findings are summarized and discussed in section 6.

DT emergence
The principles behind the DT vision originate from the Product Lifecycle Management domain (Grieves 2014), where it was proposed to use a digital counterpart of each physical product as a central means to manage product data along the product life cycle.
NASA introduced the concept DT for this idea and used it for an ultra-high fidelity simulation of the space vehicle that would allow the engineers on earth to mirror the precise and actual conditions of the real vehicle during the mission (Boschert and Rosen 2016;Glaessgen and Stargel 2012).
Thus, DTs can be described as virtual, digital equivalents of physical objects (Tekinerdogan and Verdouw 2020).They are real-time and remotely connected to real objects and provide rich representations of these objects and their context.This representation may range from relatively basic digital models to advanced 3D visualizations based on immersive technologies (virtual, augmented and mixed reality), which are also called embodied DTs.
The essence of a DT is the dynamic, bidirectional mirroring with its physical sibling.This discerns DTs from digital models, digital generators and digital shadows (Kritzinger et al. 2018).A digital model is synchronized through manual intervention and does not include automated translation or interpretation between digital and physical objects.A digital generator goes one step further by using a digital object to automatically generate or enhance a physical object.In the case of digital shadows, mechanisms are provided (e.g.sensors) to provide an automatic data flow to the digital object.A DT goes beyond this one-way communication since digital and physical objects are causally connected and synchronized.
More specifically, a previous paper defined the essential characteristics of DTs as summarized in Table 1 (Verdouw et al. 2021).

Digital twins in manufacturing
DTs are expected to play a key role in smart, datadriven manufacturing systems.They allow to simulate and optimize production systems and provide a detailed visualization of the manufacturing process from single components up to the whole assembly (Kritzinger et al. 2018).Manufacturing DTs plays a key role in integrating across multiple stages of the life cycle of a production system (He and Bai 2021;Schleich et al. 2017).In the design stage, a digital model allows early and efficient assessment of consequences of design decisions on the manufacturing process, reducing the need to develop costly physical prototypes (Grieves and Vickers 2017;Schleich et al. 2017).Such a digital model, also called a digital mockup, can be considered as a precursor of a DT, since it is not yet connected to a physical object.After the design phase, the digital model of the production system can be used to generate the physical twin by serving as the basis to implement and configure the production system.During operational usage, the digital model is connected to the physical production system by using sensors and actuators.The resulting DT is used to remotely monitor the real-time state and behaviour and to intervene in case of actual or predicted deviations.Finally, the disposal phase takes place, in which the physical production system is disposed, but the conceptual object may remain for some period, e.g. for traceability, compliance and learning.
In each life cycle stage, different capabilities are required.For this reason, Verdouw et al. (2021) define a typology of six distinct DTs, as listed in Table 2.

Pharmaceutical cannabis production
After the decriminalisation of cannabis for medical use (or even recreational use) in various countries around the globe (e.g.USA, Canada and The Netherlands), the manufacture of high-quality cannabis products, as well as by-products, in the pharmaceutical domain of controllable greenhouse facilities is considered an additional challenge to the domain of horticultural production.Cannabis is an annual

Characteristic Definition Timeliness
DTs communicate with its physical twins in real-time.The state of the physical object are (instantly) identified and visually orchestrated (Durão et al. 2018;Park et al. 2019;Tao et al. 2018;Verdouw et al. 2016).

Fidelity
The reliability and the high levels of security must be indubitable providing the end user enormous trust towards decision-making processes by the system (Durão et al. 2018;Tao et al. 2018;Verdouw et al. 2015).

Integration
DTs should integrate data from different convergence input sources and aspects of the physical entity in a concise format (Kritzinger et al. 2018;Park et al. 2019;Schleich et al. 2017;Tao et al. 2018).

Intelligence
DTs additionally may include models that illustrate, predict and analyse the behavior of their physical twins, creating them more intelligent and independent towards decision making (Durão et al. 2018;Glaessgen and Stargel 2012;Kritzinger et al. 2018;Park et al. 2019;Schleich et al. 2017).

Complexity
DTs can represent a wide range of physical objects, resources process and activities in different level of detail scale (El and Fieee 2002;Glaessgen and Stargel 2012;Grieves 2014;Kahlen, Flumerfelt, and Alves 2016;Verdouw et al. 2016).
Table 2. DT categories and typologies.

DT Typology Imaginary Digital Twin
May be considered as a proof-of-concept (predefined requirements, 3D production models, disposal specs, etc.), with the purposes of visualizing an object not yet existent.Yet, all the needed information that will later be used as an input in the materialization process of its physical twin (Kahlen, Flumerfelt, and Alves 2016;Verdouw et al. 2015) is provided, with the ability to simulate the behaviour between predefined thresholds (Flumerfelt 2017;Kahlen, Flumerfelt, and Alves 2016).

Monitoring Digital Twin
Is a digital illustration of the actual form of a real-life physical entity monitoring in real-time the aspects that are needed to be tracked.
It may obtain forecasting characteristics, providing information about in present or past states of the connected real-life object (growth predictive model tuned with weather forecast model).

Predictive Digital Twin
A digital representation of the future behaviour and states of the corresponding physical system of entities using predictive algorithms, simulation, artificial intelligence, machine learning methods, mathematical models for statistical forecasting etc.

Prescriptive Digital Twin
Is considered as a sophisticated digital object that recommends preventive or corrective activities on the physical object based on optimization models.The output of monitoring and predictive twins is used as an input to consult the end user which actions need to be taken to reach the predefined requirements for the ultimate outcome.The decisions on the recommendations from the prescriptive DT are still taken by the end users or experts, remotely or on-site.

Autonomous Digital Twin
Can operate independently while controlling fully the behaviour of real-life objects without human intervention.(Porter and Heppelmann 2015;Verdouw et al. 2016).Autonomous twins also can become self-adaptive systems that are self-configurable based on explicitly modeled domain expertise (Bolender et al. 2021).

Recollective Digital Twin
Stores all the historical data of the physical object of no existence in real-life while forming a digital copy of the object.This twin is of high importance for environmental impact reduction of disposals as well as for optimization of the next smart digital representation of object production (Kahlen, Flumerfelt, and Alves 2016;Tao et al. 2019).
herb of Central Asian origin, used many years as a herbal medicine in the eastern medicine (Chandra, Lata, and ElSohly 2017;Famiglietti, Memoli, and Khaitan 2021).It is characterized by a large production uncertainty because living, natural products are involved and production depends on natural conditions such as weather, diseases, seasons and climate.As a result, cannabis production differs a lot from other from the factory-wise production of other medical products that can be fully standardized.
For commercial cannabis production in modernday greenhouses, a significant emphasis is placed on creating a uniform product.Some of the specifications that must be kept tightly controlled are the temperature, irradiance levels, day lengths, planting densities, Ph levels, EC (electric conductivity) levels, Co2 levels, water uptake, etc. (Backer et al. 2019;Chandra, Lata, and ElSohly 2017;Eaves et al. 2020;Kovalchuk et al. 2020;Vanhove, Van Damme, and Meert 2011).Figure 1 presents schematically these cultivation phases of pharmaceutical cannabis production based on (Chandra, Lata, and ElSohly 2017;Hazekamp, Tejkalová, and Papadimitriou 2016;Potter 2014).
From the perspective of a producer, the life cycle of a cannabis plant starts with defining the requirements of the cannabis products to be produced.The producer then selects an existing variety that fits best or develops a new variety in collaboration with a breeder.The next step is raising mother plants either from seed or tissue culture plantlets.If the mother plants are ready for production, cuttings are harvested and rooted.After the vegetative growing stages, the next phase is flower formation.At this stage, the root system has developed fully gathering nutrients and resources throughout the growing process.The stem is fully developed and extended from the room system formatting branches with leaves.The fan leaves are responsible for biomass production, and the sugar leaves (buds, trims) can be converted into extracted or not cannabis end products or by products used in the pharmaceutical domain.At the top of the cannabis branches, the cola (which refers to the flowering state of the female plant) is formatted providing room for flower growth.In the cola, the trichomes are formatted with an orb structure at the top of them.The trichomes are emerging, while formulating the cannabinoid and terpene profile of the plant, describing the aroma and euphoric effects.In Figure 2, the plant anatomy of cannabis is presented, thus detailing the plant physiology.As soon as the flowers are in the good stage, they can be harvested, along with other useful parts of the plants.Industrial harvesting of cannabis plants is usually done at once, but multiple harvesting cycles are also possible.The harvested flowers, leaves and stems are dried and further processed into pharmaceutical cannabis products.Finally, the deteriorated plants are disposed of.All aforementioned activities are performed under strict governmental rules regarding cannabinoid content, optimal manufacture practices and traceability (Aguilar et al. 2018).

Related digital twin applications
In the agriculture and horticulture domain, DTs are (at the time of writing this article) still in their infancy (Ariesen-Verschuur, Verdouw, and Tekinerdogan 2022).In the pharmaceutical cannabis domain, only one paper about digital twins in the cannabis domain was found (Wang et al. 2020).This study introduced a simulation-based cyber-physical system DT for the blockchain-enabled industrial hemp supply chain.The research covered information of end-to-end processes, quality control verification, etc. in automated cultivation and supply chain system of cannabidiol CBD (cannabidiol) dominant crops, which is ideal for future cannabis-related DT implementations.However, this supply chain DT is not used for production management.To the best of our knowledge, such a DT is not yet researched.This reveals a significant gap in knowledge, indicating that the digitalization of pharmaceutical cannabis production by means of DTs under the umbrella of Industry 4.0 technologies is within its infancy.
Yet, in the broader context of agricultural production, DTs are considered to be the next generation of digital innovative technologies (Basso and Antle 2020; Gangwar, Tyagi, and Soni 2022; Nasirahmadi and Hensel 2022).For example, by combining DTs models and IoT technology, farmers can have an optimal yield production and resource utilization via sustainable agricultural practices (Alves et al. 2019;Gangwar, Tyagi, and Soni 2022;Moghadam, Lowe, and Edwards 2020).

Research approach
For the research approach, a design-oriented methodology was adopted, which is an ideal approach to get a more optimal understanding of relatively new and complex concepts, such as DTs (Verschuren and Hartog 2005).A design-oriented methodology focuses on building purposeful artefacts that address heretofore unsolved problems and which are evaluated with respect to the utility provided in solving those problems (Hevner et al. 2004;March and Smith 1995).The design artefact developed in this paper is a reference architecture for the development and implementation of DT systems in pharmaceutical cannabis production.
Based on Verschuren & Hartog there are six stages of constructing a research approach: 1) first hunch, 2) requirements and assumptions, 3) structural specification, 4) prototype development and 5) implementation, 6) evaluation.These stages were also used to construct the basis for the adopted research methodology for the development of the reference architecture presented in Section 4. In Figure 3, the intermediate stages of the adopted research approach are detailed.

Reference architecture design
The reference architecture is based on design requirements and a set of architectural viewpoints as presented schematically in Figure 4, which is adapted from the article by Verdouw et al. (2019).
The starting point of the reference architecture design is the definition of basic design requirements.
The purpose of identifying all the elements of the reference architecture is the representation of the connection between the physical objects and the DTs offering a basis for the design and the implementation of a DT system for cannabis industry interconnecting all the production departments.The following basic design requirements in Table 3 are defined.The reference architecture must include the interaction of all the counterparts between the Physical Twin and the DT; R2 The reference architecture must support the business design and technical implementation of DT-based production management systems applied in pharmaceutical cannabis production; R3 The reference architecture must support the processes for the production pharmaceutical cannabis production in controllable facilities across its life cycle (design, implement, use, retire); R4 The reference architecture must provide information about the systems used to sense, predict and control the cultivation of pharmaceutical cannabis; R5 The reference architecture must represent all the greenhouse management activities plan, control and monitor of production enabled by the designed DT; R6 The reference architecture must provide all the corresponding information about of the data integration and data management processes from all sources and aspects of the Physical Twin in concise format ensuring convergence; R7 The reference architecture should provide information about systems and algorithms that describe, analyze, predict, prescribe and control the Physical Twin's state and behavior.

Definition of architectural views
A reference architecture is usually not drawn in one diagram but rather separated in multiple architecture views where each describes an architectural model type to address a specific stakeholders' concern (Clements et al. 2003).These views are based on viewpoints that define the concepts and conventions for constructing and using a particular view (way of modelling).Based on our literature review and the predefined design requirements, some welldefined and widely adopted viewpoints and generic, cross-industry reference architectures were selected as a basis of our design, as presented in Table 4.
The Context Diagram presents all functions and entities involved in the development and later usage of the system.It provides information about the stakeholders and their position within the boundaries of the system.The view uses the IDEF0 modelling viewpoint (Dorador and Young 2000), and the stakeholders are defined based on the stakeholder management architecture of TOGAF (The Open Group 2018).
The Information Model presents in a structured form all the corresponding (e.g.relations, attributes, services) of all the information for the DT information system.The view uses the class diagram of UML (Object Management Group 2017).It is based on the information model of the Internet of Things Architecture, which is developed by the European project IoT-A (Gubbi et al. 2013).
The Functional Decomposition view decomposes the system into categories according to the functionality of the elements into the system while illustrating their relationship with the different functionalities.It uses the layered view of the Open Systems Interconnection (OSI) model and the IoT functional model of IoT-A (Gubbi et al. 2013).
Finally, the Deployment View defines a detailed technical architecture in UML notation of system concerns and elements and overall functionalities (Köksal and Tekinerdogan 2019;Kramp, van Kranenburg, and Lange 2013;Tekinerdogan and Sözer 2012;Verdouw et al. 2019).The view uses the deployment diagram of UML (Object Management Group 2017) and is based on especially the communications model of IoT-A (Gubbi et al. 2013).

DT reference architecture for pharmaceutical cannabis production
In this section, the architectural design views are applied to the domain of pharmaceutical cannabis production.

Context diagram
The context diagram represents the elements of the system and its interfaces with an external environment.The graphic shows the system boundaries and the entities involved, this providing information about the context of the interior and exterior boundaries of the system and is often the first viewpoint of architectural information for a reader (Kossiakoff et al. 2011;Tummers, Kassahun, and Tekinerdogan 2021).
In Figure 5, the context diagram applied in the pharmaceutical cannabis production is presented, providing insight into the stakeholders involved in the domain of controllable pharmaceutical cannabis production.
Research institutes are included due to their contribution in the domain of digital transition and cannabis research.Furthermore, the governmental office of medical cannabis is responsible for informing the public about pharmaceutical cannabis and controlling the pharmaceutical cannabis production according to the predefined law requirements.The context diagram can be modified according to the predefined requirements for the DT of a pharmaceutical cannabis company.For instance, input suppliers (e.g.seeds, nutrients, growing trays for germination, etc.) and machinery suppliers (e.g.extraction, LED lights, irrigation pumps, smart pots, etc.) can also be included in the diagram.
Nonprofit organizations can also be included in the graph as valuable entities bringing awareness for the usage of this alternative medicine and stigmatized therapeutic multipurpose crop (Famiglietti, Memoli, and Khaitan 2021).
Enterprises that are pioneers in the domain of pharmaceutical cannabis production can also contribute towards the road of augmentation of the various production steps.Further, software providers can also be included as external parties providing various innovative traceability services and gadgets for the entities involved in the domain of smart production.

Information model
The information model defines and schematically presents the structure (e.g.relations, attributes, services) of the transferred information between DTs (Kramp, van Kranenburg, and Lange 2013).With this model, questions, such as like 'who, what, when and where', are answered providing a detailed version of the information transfer between the entities of the DT.In Figure 6, which is a modification of the work by Kramp et al. (2013), the elements of the information model (as well as their information flows) are presented.The DT has attributes with specific names and values to which information can be associated via means of metadata.The association between a DT and a digital service is listed in a sense to correlate with a certain attribute.The service type can relates either to information or to actuation.
Every named Attribute has one-to-many values and a predefined type.The type of attribute is specified by the type.For example, in Figure 6, the value represents PAR (Photosynthetic Active Radiation) with every ValueContainer categorizing one value and zero-to-many information to the related Value (Kramp, van Kranenburg, and Lange 2013) via means of metadata.Quality parameters, the timestamp of the value, are also stored also in a metadata form.The ServiceDescription-DT association acts as a connection hub for ServiceDescription.The important aspects (interface, etc.) of a Service are described from the ServiceDescription (Kramp, van Kranenburg, and Lange 2013).
In Figure 6, a sensor sends a PAR value measured from a Physical entity to the DT Attribute associated with the measurement.So, the PAR measurement would replace the value belonging to the attribute PAR of the DT (Kramp, van Kranenburg, and Lange 2013).

Functional decomposition view
The Functional Decomposition viewpoint categorizes the system into manageable parts illustrating their functional relationship.Additionally, it describes the system's runtime, the responsibilities, default actions, interfaces and the primary interactions of all the functional components (Kramp, van Kranenburg, and Lange 2013).The functional decomposition consists of seven longitudinal functionality groups accompanied by two transversal functionality groups delivering each moment the pre-defined functionalities of the longitudinal (Kramp, van Kranenburg, and Lange 2013).
In Figure 7, the functional decomposition diagram is presented substituting the virtual entity with the DT entity applied in the smart domain of pharmaceutical cannabis production under controlled conditions in modern production facilities.The layers are subsequently outlined.
• Application Layer -The functional layer contains all the software applications used to control and monitor each level of production.It includes an eXtended Realities (XR) user interface to the DT projection and various applications across the life cycle of cannabis production from design to retire.The applications provide end user features to dynamically manage and control pharmaceutical cannabis production in (near) real-time.For example, growth parameters can be monitored, cultivation managers can be alerted in case of an issue, they can simulate various interventions to solve the issue, etc.
• Device Layer -The device layer includes all the sensors and actuators used in a sophisticated cannabis greenhouse compartment.The sensors obtain data about the conditions of the internal (temperature, humidity, Ph, etc.) and external (Weather Data etc.) boundaries of the greenhouse compartment.Any alternation in the climate of the greenhouse compartment is monitored by the sensors.If any deviation is tracked from them for the predefined thresholds of all growing requirements (humidity, soil moisture, nutrients etc.), the corresponding actuator is used (dehumidifier, irrigation pump, nutrient pump, etc.) and adjusted accordingly to alternate any existing conditions that may cause problems in sustainable production of high-end pharmaceutical products.

Deployment view
This view focuses on the general functionality of all features of the designed system.It depicts hierarchically the location behaviour and deployment of either hardware or software components.Furthermore, the view defines a detailed technical architecture in UML notation of system concerns and elements (Köksal and Tekinerdogan 2019;Kramp, van Kranenburg, and Lange 2013;Tekinerdogan and Sözer 2012;Verdouw et al. 2019).
In Figure 8, the deployment view applied for the pharmaceutical cannabis production is presented.The main blocks are the local farm PC, cloud platform of the greenhouse data, data authorization, cloud platform, weather data services, etc.As modules may consider decision support modules (e.g actuators, data logging, data mining processes etc.) the packages contain the modules.Further, the package that contains the sensor modules is named sensor, while the one that contains the actuator modules is named actuators.This view may provide a plug-in developer with valuable information for the various modules and packages for a future version of the developed system.

Proof of Concept
In order to test the application of the reference architecture, in this section a DT proof-of-concept case study is provided.The DT depicts in 3D visualization pharmaceutical cannabis production under controlled conditions.The facility 1 consists of multiple modified units that visualize cannabis growth in various controllable cultivation stages and processes, as well as, the machinery and equipment used in the production of high end pharmaceutical products.The unique features of the environment are the connectivity throughout the designed API with live sensor data.Additionally, the end user can navigate in all directions and even fly with character in a form of a bee 2 both throughout the environment and the pharmaceutical production individual units.
The intention for this design is to showcase future DT concepts (micro bee drone, plants, machinery, etc.) by adding realism through flying, realistic movement speed, gravity forces, collision detection, etc., and to test the reference architecture presented in Section 3. The character can move using the keyboard to the corresponding directions A:Left, S:Back, D:Right, W:Front.With the movement of the mouse, a view in every possible direction is possible, providing the user with multiple views of the DTs.The user can obtain and visualize the data by right clicking the corresponding data acquisition button from the designed User Interference in the top right corner of the DT view.

Applied reference architecture
The prototype is designed by applying the reference architecture as presented before.Figure 9 presents the applied Functional Decomposition View as an example.
This Functional Decomposition View shows that the core of the DT prototype is developed in the cross-platform game engine Unity.This engine is commonly used to create three-dimensional (3D) and two-dimensional (2D) model games or environments combined with interactive simulations.The engine has been adopted by various industries automotive, architecture, engineering, etc., besides the video gaming.The PoC includes plant, greenhouse, machinery and extraction facility virtualizations that are integrated in one 3D DT environment in Unity.
The DT in Unity is connected via a standardized API with a greenhouse sensing platform.This platform stores the information obtained from sensors connected with crops or growing compartments with an update frequency of every 30 s (i.e.twice a minute).The sensing data can also be accessed via a dashboard that is available in the greenhouse platform.To connect the DT with the existing API, an authorization key and the access to the platform had to be retrieved.Sensor data are parsed from JSON format into readable output in Unity.

Testing & virtual view mode
In Figure 10, the view of cannabis plants in flower formation stage is depicted.The plants are potted and placed on cultivation racks with LED lights.The greenhouse structure was chosen to have a dome form providing a different version for plant orientation and placement.Different views were obtained from the virtual environment.
The static pots that the plants are placed in a future version of the designed DT can be designed to depict smart IoT pots.These pots connected with sensors may provide data for each individual plant to the end user about soil moisture, soil mass, root health, weight, irrigation strategies etc.
In Figure 10, the user can navigate close to the canopy of the DT of the plant and have an overview of the potential growth and yield or even obtain information and diagnostics for nutrient defiance in a future version of the model with predictive models and algorithms.
The data visualization of the connected sensors after the user request is displayed on the righthand side of Figure 11a (for clarity, the sensor readings from Figure 11a are also provided in Appendix Table A1).In Figure 11b a further depiction of the 3D version of a cannabis plant into flower formation stage is demonstrated.The plant physiology (flowers, cola, trichomes etc.) can be viewed by the end user.
The developed DT Proof of Concept was exported in an executable format and shared with the domain experts who were involved in the research for an initial validation (two cannabis producers, two software companies, one consultant).Table 5 shows that the experts were especially positive about its inspiration for future innovations.They considered it to be an effective and innovative first step for remote management of production facilities with a lot of potential value.The main suggestions for further development are as follows: • adding more types of sensor data including plant physiology data, crop state (leave area index, stem thickness), camera vision data, product job and inspection data; • tailoring the 3D model to the company-specific production facility and cultivation system; • extending the system with predictive capabilities, including simulation of the effects of different production control strategies on expected yield, quality, production costs, etc.; • connecting the DT to actuators in order to remotely control, e.g., the climate conditions.

Discussion
The objective of this research was to design a reference architecture for the development and  implementation of DTs in the domain of pharmaceutical cannabis.At the time of writing this article, we found a lack of availability in the literature and methods describing the use of DT-based systems in pharmaceutical cannabis production.DTs for the pharmaceutical production of cannabis are still under exploration.To the best of our knowledge, this article is the first to document the use of a digital twin specifically for this domain.
Pharmaceutical production of cannabis is a highly instructive sector for the study of digital twins in manufacturing in particular because it is characterized by a large production uncertainty.It deals with living, natural products and production depending on natural conditions such as weather, diseases, seasons and climate.As a result, cannabis production differs a lot from other from the factory-wise production of other medical products that can be fully standardized.
A second objective of this paper was to develop a Proof of Concept of a DT in 3D visualization in order to test the applicability of the reference architecture.This immersive DT is connected with real-world data through an API integration displaying real-time IoT sensor data from a live greenhouse.The 3D environment is fully explorable, where the user takes control of an avatar character to walk around the facility and view real-time sensor readings.The main scientific contribution of this Proof of Concept is the integration of immersive technologies and DTs.To the best of our knowledge, this is also the first work on this specific application for pharmaceutical cannabis DTs.
The main practical value of the designed architecture allows us to model DT-based systems in a timely, punctual and coherent way and ss such contributes to the development of innovative tools for the manufacture of traceable high-quality end products.The reference architecture, the 3D visualization in a gaming engine, as well as the connectivity with live sensor data of the developed model contribute to bridging the knowledge gap of implementing DTs for pharmaceutical cannabis production.The research provides background information about the concept of DTs developed for the greenhouse horticulture production, the architectural reference models applied in smart farming IoT systems as well as the pharmaceutical cannabis production cultivation and extraction processes.
The criteria used to narrow down all the available information for the development of the reference architecture applied to the research were strict.An overview was obtained to design and implement the reference architecture, as well as the futuristic 3D DT proof-of-concept for the cannabis production domain.The significance of this research is that it provides information regarding the steps followed in most of the implementation processes applied towards the creation of a newly introduced innovative proof of concept for the pharmaceutical cannabis production domain.
The DT was designed by means of a methodology that can be modified towards the needs for the domain of pharmaceutical cannabis.By virtualizing cannabis in different stages of their growth according to various sensor data combined with predictive algorithms and agricultural practices for sustainable indoor production, a more sophisticated version of the model can be obtained from plug-in developers.

Future work
Opportunities for further research are related to further validation and development of the reference architecture as well as the DT implementation.
The present reference architecture is validated in a Proof of Concept implementation for an experimental greenhouse facility.The data provided were derived from various sensors located in greenhouse production facilities of different crops and not First, in the current Proof of Concept, climaterelated sensor data are included.In the future, a wealth of other sensor data could be added, including crop and production management data.An further option for continued development would be the introduction of sensors for individual plants in the actual greenhouse depicting each time the actual daily growth of plants into 3D visualization according to the acquired data.Image data can be obtained by various new types of infrared cameras that later can be processed and modeled using the corresponding digital software.
Second, an important challenge is the development of implementation-specific 3D-models.In the ideal situation, 3D-models should be dynamically generated from live data.
Third, a crucial next step is making the DT more intelligent, by adding predictive and prescriptive analytics.For example, crop growth models in combination with deep learning could be used to simulate the effects of different production control strategies on expected yield, quality, production costs, etc.The farmer may have 3D projection of past and future states of each track and traced cannabis plant.Next, integrated advice systems could prescribe predictive actions such as adjusting the climate and lighting regimes in order to optimize the production performance.In that way, cultivation practices can be adjusted by the farmer or the same DT in case, it is fully autonomous.Finally, the connectivity of actuators from the corresponding sensors may be considered a future development for the model.If actuators are connected controlling the greenhouse production accordingly, the developed model shifts to a more sophisticated version with many capabilities.For instance, an actuator of a greenhouse window can be depicted in a digital version in a future version of the DT.The model can be autonomous, the sensors, when receiving at a specific time the predefined value for activation of the corresponding actuator, a command would be correctly inclined to the window according to weather data or greenhouse data adjusting in that way autonomously the window incline.The connection of the model with multiple physical twins and their consumption in resources may also be considered a future expansion of the model.A smart pot that a plant can be transferred may provide information about the weight, soil moisture, scan the internal root structure, biomass production, stem length and quality providing information for management and resource utilization.

Conclusions
This paper has analyzed how DTs can advance pharmaceutical cannabis production.More specifically, it has introduced a reference architecture for the development and implementation of DTs in the domain of pharmaceutical cannabis.It uses a design-oriented methodology to get a better understanding of relatively new and complex concepts such as Digital Twins.The reference architecture defines a coherent set of architecture views for modelling DT-based systems and applies these views to the domain of pharmaceutical cannabis production.Furthermore, a Proof of Concept of a 3D immersive DT has been developed in order to test the applicability of reference architecture.This DT is developed in the open, cross-industry platform Unity and includes an extensive 3D model of a cannabis production facility and a real-time integration with an IoT platform.

Figure 1 .
Figure 1.Main steps of the life cycle of pharmaceutical cannabis plants from the perspective of a producer (adapted from Chandra, Lata, and ElSohly 2017).

Figure 2 .
Figure 2. Anatomy of a cannabis plant.

Figure 4 .
Figure 4. Guideline for the application of reference architecture.

Figure 9 .
Figure 9. Functional Decomposition view of the Proof of Concept.

Figure 10 .
Figure 10.Internal view from bee avatar of the cannabis facility with plants in the flower formation stage.

Figure 11A .
Figure 11A.Plant canopy & data visualization of connected sensors.

Figure 11B .
Figure 11B.3D version of cannabis plants in flower formation.

Table 4 .
Views point & Definition applied in the case study.
Analyses the complexity of an IoT system by categorizing it into smaller and more manageable functional parts, while understanding and demonstrating their relationship.(Kramp,van Kranenburg, and Lange 2013) OSI IoT-A Deployment View Defines a detailed technical architecture in UML notation of system concerns and elements (Köksal and Tekinerdogan 2019; Kramp, van Kranenburg, and Lange 2013; Tekinerdogan and Sözer 2012; Verdouw et al. 2019) UML IoT-A (Kramp, van Kranenburg, and Lange 2013)esponsible for ensuring the privacy of Information systems(Kramp, van Kranenburg, and Lange 2013).
(Kramp, van Kranenburg, and Lange 2013)yer combines all the functionalities responsible for the overall management and communication of the IoT system(Kramp, van Kranenburg, and Lange 2013).

Table 5 .
Results of the expert validation.pharmaceuticalcannabis.The lack of data from sensors placed in cannabis cultivation facilities was the main limitation of this research.The connection with sensors placed in facilities can be feasible only if a cultivation company is highly equipped with accurate calibrated sensors and willing to shift to digitalized production.In future research, it should be validated in real-life production facilities of cannabis with different cultivation methods and in different locations in the world.Important research opportunities for further development are related to the suggestions of the experts: i) adding more sensing data, ii) customizing the 3D model, iii) adding predictive and prescriptive analytics and iv) connecting the DT to actuators.