Harnessing Artificial Intelligence for the Next Generation of 3D Printed Med- icines

This is a PDF file of an article that has undergone enhancements after acceptance, such as the addition of a cover page and metadata, and formatting for readability, but it is not yet the definitive version of record. This version will undergo additional copyediting, typesetting and review before it is published in its final form, but we are providing this version to give early visibility of the article. Please note that, during the production process, errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.

1 Intelligent 3D Printing of Personalised Medicines 2 The last 25 years have experienced a digital revolution: from the naissance of wireless internet access to 3 global smart phone uptake, widespread use of cloud storage, and the permeation of social media into 4 everyday life. At first, it was human intelligence that conceived and utilised these transformative 5 technologies. Now, we find that technology is being hardwired for intelligence far beyond human 6 capacity; allowing it to entertain us, highlight lucrative financial investments, and maintain our health, to 7 name just a few applications [1][2][3][4][5]. The language of data is fast surpassing traditional spoken or written 8 languages on the stage of global communication and connectivity. As data storage and capacity steadily 9 mount with each passing year, systems are fed increasing information, allowing them to become 10 smarter [6]. 11 Artificial intelligence (AI) encompasses a plethora of technologies driving the current data 12 revolution [7]. Applications of AI can be narrow, whereby intelligence is directed at single tasks, such as 13 smartphone personal assistants, the discovery of novel drugs, or diagnosis of disease from medical 14 images [8][9][10]. Alternatively, AI applications can be afforded cognitive ability similar to the human brain, 15 by which robust AI systems retain memory and apply knowledge across different domains. The latter 16 form of AI is growing in momentum, exemplified by the development of driverless cars that 17 autonomously recognise unexpected obstructions, monitor exact lane position, and govern optimal 18 vehicle functioning simultaneously [11]. An even more recent application of AI is its unification with 19 networks of interconnected hardware, known as the 'Internet of Things' (IoT). In an IoT, devices with 20 distinct capabilities are wirelessly connected to perform integrated functions. IoT has conceived the 21 concept of smart houses, in which a network of sensors and control devices fully automate tasks of daily 22 living: from the management of heating, lighting, and security, to ordering groceries and synchronising a 23 morning alarm with breakfast [12]. Combined, AI and IoT permit the intelligent automation of limitless 24 processes.

25
The Food and Drug Administration (FDA) has placed emphasis on innovation through utilising 26 digital health technologies and developing novel analytical approaches to advance healthcare [13], 27 which was answered by diagnostic companies, where recently the FDA has approved AI-based software 28 for diagnostics [14,15]. Compared to other fields, the development and supply of pharmaceuticals sits 29 behind the forefront of modern technology, who employ in silico tools to expedite discoveries. BASF 30 released Zoomlab™ for predicting the properties of formulations, such as tabletability. The software is 31 based on the SEDEM system that was developed 15 years ago but is yet to be widely adopted by microdevices with stimuli-responsive release mechanisms; and abuse-deterrent opioid tablets [32][33][34][35][36][37]. final product, such as the different compositions of the starting materials, design considerations (e.g. 5 shape and dimensions), and printing parameters (e.g. speed, temperature), the process of designing a 6 formulation presents an innumerable number of options that ordinarily require expert navigation. Here, 7 ML can be leveraged to learn from the large volume of pre-existing data to predict new outcomes, 8 irrespective of the number of variables that need to be analysed. Consequently, the need for expert 9 formulation scientists is reduced from the clinical setting, and ML can manage the formulation of 3DP 10 medicines for any given scenario. ML can also guide the printing process by calculating ideal processing 11 parameters, such as printing temperature, nozzle diameter, laser speed, or light exposure time. In 12 contrast to Zoomlab™ and F-CAD, ML does not require specific material properties to make the 13 prediction, and hence does not require the user to expend time and money collecting further data, 14 although the option is there should the researcher wishes to include the properties. Moreover, 15 continuous maintenance of printers can be AI-managed, ensuring that supply of medicines is not 16 interrupted due to machine failures [42,43]. An advanced goal of pharmaceutical 3DP is to achieve a 17 fully autonomous and intelligent pipeline of personalised medicines supply in the healthcare setting. 18 IoT-based technology can realise this vision: a network of robots will be connected to 3D printers to 19 support formulation compounding, post-processing, quality control (QC), and packaging. As such, human 20 resources, error, and bias will be almost entirely removed from pharmaceutical 3DP and patients will 21 gain 24/7 access to quality, personalised medicines.

22
This review will focus on the next era of pharmaceutical 3DP, in which AI is harnessed to achieve 23 the streamlined and autonomous production of 3DP medicines. As methods of pharmaceutical 3DP are 24 manifold, we begin by providing an overview of technologies available, with consideration of challenges 25 within each. Non-AI industrial techniques for process optimisation will then be discussed, namely design 26 of experiments; mechanistic models; pharmacokinetic modelling; and finite element analysis. Next, a 27 background on AI and ML will be covered, followed by how they overcome the pitfalls of traditional 28 unintelligent techniques, and an in-depth analysis of how they can be leveraged for 3DP of medicines.

29
Finally, an overview of IoT and an evaluation of the trajectory of the pharmaceutical 3DP field will be 30 provided.    accuracy that can be achieved, which in some instances has been found to be more accurate than

17
Classic AI, also referred to as symbolic AI, was able to achieve this through a rule-based system, whereby 18 rules were hard-coded into models through human intervention. Hence, symbolic AI requires 19 researchers to first learn the rules and then code the relationship into an algorithm. This is a drawback 20 because time and resources are needed to first identify relationships. Moreover, rules will need to be 21 revised if new rules are identified, which consequently makes symbolic AI difficult to scale-up. ML AI on 22 the other hand uses statistical learning techniques that allow a machine to establish its own relationship 23 between explanatory and response variables. Therefore, ML is able to adapt as the training data 24 changes ( Figure 2). ML algorithms can work at speeds well beyond human intellect, with a much lower 25 risk of error, therefore it is unsurprising how ML has come to transform so many contemporary 26 disciplines and processes [8, 151-154].

27
The ML process involves a series of stages that combine to form an overall pipeline (Figure 3). 28 Typically, data must be pre-processed and possibly vectorised prior to any learning taking place. The 29 pre-processing stage is to ensure the data is cleaned and ML-friendly. In a survey conducted, it was 30 found that ML practitioners spend most of their time, up to 60-80%, on cleaning data and pre- plug-and-play manner, whereby unprocessed data is directly fed to an algorithm, taking the additional 7 steps to clean and pre-process data can significantly improve prediction performance. An adage used 8 within physical experimentation also applies to ML: by taking the additional steps to ensure the starting 9 materials are properly pre-treated, one can improve the consistency of the end product.    Figure 3. Overview of a typical ML pipeline. ML can handle text, images and numeric data formats.
3 Though a 'plug-and-play' approach can be taken with ML, pre-processing can help enrich input data and 4 ultimately improve model performance.  directing an algorithm to solve a specific question. The algorithm is presented with data that has been 10 labelled, describing the question of interest. For example, labels could be medicine 3D printability, or 11 optimum 3DP temperature [156]. The former label in this example illustrates a classification ML task, as 1 medicines are classified as being 3D printable, or alternatively, not 3D printable. The latter exemplifies a 2 regression task, because a specific printing temperature is given from a continuous range (Figure 4). A 3 supervised ML algorithm takes a subset of the labelled data, known as the training data, and uses it to 4 learn how dataset features relate to labels; e.g. how the physical properties of a medicine affect its 3D 5 printability. After learning how data features relate to data labels, the ML algorithm can use a second 6 subset of the data, known as testing data, which is unseen to the machine, to verify how accurate its     supervised and unsupervised learning is portrayed in Figure 8.   4 Semi-supervised learning, as its name suggests, sits at the intersection between supervised and 5 unsupervised methods [169]. Semi-supervised projects begin with a dataset that is partially labelled. In 8 Subsequently, supervised techniques are then used to identify relationships between data features and 9 their labels. Semi-supervised learning is a useful approach for increasing the quantity of useable data in 10 a set. Increasing the amount of data is often sought after to increase the external validity of a ML model.

11
As with all experiments, increased sampling typically leads to more reliable and transferable results. existing for decades, it was only recently that the two began to merge (Figure 9). ML    3DP medicines (Figure 10). ANN  achieve near perfect predictions, as depicted in Figure 10  ML has also been used to predict the printability of formulations: a key consideration of 3DP formulation 8 design [156]. In the first study using big pharmaceutical 3DP data with ML, researchers built a dataset 9 comprised of 614 drug-loaded formulations for FDM filaments produced by HME, incorporating 145 10 distinct excipients. Each formulation was labelled according to the filament mechanical characteristics 11 (e.g. good, brittle, flexible), printability (i.e. printable or not), and both extrusion and printing 12 temperatures. With this labelled dataset it was possible to employ supervised learning to predict 13 filaments' printability ( Figure 11). The  can also be applied to the pre-processing stage of ML to reduce dataset noise. PCA has been used to 7 predict the feedability of filaments for FDM pharmaceutical printing ( Figure 12 (A)) [226]. By 8 measuring mechanical properties of filaments, and generating a force-distance profile, PCA was found to 9 cluster similar filaments together, which were termed as 'feedable', 'tunable' or 'non-feedable'. Here 10 PCA shows that complex mechanical plots can be made more interpretable with ML, allowing the 11 discernment of patterns. As illustrated in Figure 12(A), it is visually easier to interpret PCA results than 12 raw data. Alternatively, PCA can be paired with another unsupervised technique, k-means, to further 13 streamline ML [227]. K-means seeks to cluster neighbouring points, which in the example in Figure   14

12(A) would have been able to distinguish between feedable and non-feedable filaments. With this
15 combination the raw data could have been directly fed to a k-means algorithm, outputting a filament's 16 feedability without needing to visually inspect the PCA plot (Figure 12 (A iii)).

17
Clearly, ML has many applications in the pre-printing stage of medicines manufacture.

18
Researchers can harness computer intelligence to streamline formulation development, producing 3D 19 printable formulations that will result in products personalised to individual patients. Whereas manual 20 compounding and testing of many iterations of formulations could take weeks to find a suitable product, 21 AI can dramatically reduce this timeline. Ultimately, this will mean that development of personalised 22 3DP medicines will be accelerated; granting patients access to bespoke pharmaceuticals with shorter 23 lead times. This will be particularly useful in time-sensitive clinical situations.

9
A key goal of pharmaceutical 3DP is to leverage AI to create a seamless, autonomous 3DP process. 10 Currently, researchers are required to input printing process parameters before each batch of medicines 11 is produced. Setting fixed parameters is not an option in the production of personalised analysis allowed rapid interpretation of the relationship between multiple variables. For example, using 21 a PCA biplot, it was observed that printing speed was negatively correlated with product road width and 22 product mass. Figure 12 (Bii) illustrates that samples printed with the same printing speed clustered 23 together. Besides these categorical features, another key dependent variable are the processing 24 temperatures. Historically, recommended starting HME temperature for formulations is guided by a rule 25 of thumb, which recommends starting with anywhere between 15-60 °C above the T g of the formulation. 26 Recently, supervised ML techniques were used to predict optimal HME and FDM printing temperatures,

27
where accuracies of ± 8.9 and ± 8.9 °C, respectively, were achieved (Figure 11 (B)) [156]. The benefit 28 with this approach over the rule of thumb is it obviates the need to perform time-consuming differential 29 scanning calorimetry measurements to determine the T g . 14 The algorithm was trained on a dataset containing pixels that were classed as either anomaly-free, or 15 one of the six potential anomalies frequented during the printing process (Figure 13). Positively to achieve an accuracy of above 98% in predicting the quality of the part, and predictions were made at 26 times considerably faster than human reactions permit.  Figure 14. The challenge of 3DP on live 8 organs is that the surface is non-planar and dynamic, which is in contrast to 3DP on build-plates that 9 have a flat surface and the movement thereof is encoded and known via the .gcode (i.e. the command 10 code for the printer). The study recognised these issues for printing on porcine lungs, and exploited ML 11 to predict tissue surface deformation occurring during the lung breathing. The potential primary 12 advantages of ML-guided in situ 3DP, like robotic surgery, include higher precision, better safety profiles, 13 and a reduction in invasiveness [235]. In the context of pharmaceutics, in situ printing can be exploited  separate drugs in a single SLS-printed product (Figure 15 (A)) [244]. The authors noted that the QC 10 measure was able to provide rapid dose prediction in 10 seconds per tablet. In a separate study by the 11 same research group, a portable NIR device was used to predict drug concentration in tablets across a 12 range of 4 to 40 w/w% (Figure 15 (B) (Figure 15 (C)   [237]. Essentially, ML would provide actionable insight from data, to which 3DP will execute. Whilst 3 building a pharmaceutical 3DP cyber-physical system may still present relatively large upfront costs, the 4 resultant obviation of human labour will dramatically reduce expenditure in the medium to long term.

5
Moreover, machines and AI algorithms can work 24/7 at full capacity without increasing error or the 6 need for rest; hence facilitating high throughput production of patient-centred medicines at all hours of 7 the day, every day of the year. Figure 16 is an illustration depicting stages of the 3DP workflow that can 8 be interconnected with IoT and AI.  instance, consideration should be given to producing a unified database relevant to pharmaceutical 3DP 8 that will facilitate data mining. As progress continues, it will become increasingly tiresome to data-mine 9 directly from individual published articles or produce data in house. A structured database will readily 10 allow the extraction of ML-friendly relevant data for use by all, which could be achieved through a 11 strategic and unified approach to data collection. These efforts will ultimately aid policymakers in