Multivariate calibration of energy‐dispersive X‐ray diffraction data for predicting the composition of pharmaceutical tablets in packaging

HighlightsNon‐destructive screening of unpackaged and packaged tablet formulations.High accuracy of quantification using multivariate calibration methods.Data pre‐treatment prior to modelling and prediction not required.Improved prediction accuracy compared to angular dispersive X‐ray diffraction and comparable to Raman spectroscopy. ABSTRACT A system using energy‐dispersive X‐ray diffraction (EDXRD) has been developed and tested using multivariate calibration for the quantitative analysis of tablet‐form mixtures of common pharmaceutical ingredients. A principal advantage of EDXRD over the more traditional and common angular dispersive X‐ray diffraction technique (ADXRD) is the potential of EDXRD to analyse tablets within their packaging, due to the higher energy X‐rays used. In the experiment, a series of caffeine, paracetamol and microcrystalline cellulose mixtures were prepared and pressed into tablets. EDXRD profiles were recorded on each sample and a principal component analysis (PCA) was carried out in both unpackaged and packaged scenarios. In both cases the first two principal components explained >98% of the between‐sample variance. The PCA projected the sample profiles into two dimensional principal component space in close accordance to their ternary mixture design, demonstrating the discriminating potential of the EDXRD system. A partial least squares regression (PLSR) model was built with the samples and was validated using leave‐one‐out cross‐validation. Low prediction errors of between 2% and 4% for both unpackaged and packaged tablets were obtained for all three chemical compounds. The prediction capability through packaging demonstrates a truly non‐destructive method for quantifying tablet composition and demonstrates good potential for EDXRD to be applied in the field of counterfeit medicine screening and pharmaceutical quality control.


Introduction
EDXRD is a powerful tool for characterizing the chemical composition of crystalline materials. Materials which fall into this category include powder-form illicit drugs and plastic explosives, both of which have been studied using EDXRD [1][2][3]. The advantages of this technique include the use of high-energy photons which are capable of penetrating the surface of materials and characterising the layers beneath. This is a highly attractive capability in security screening contexts and for the determination of medicine quality. In both types of context a low level of disruption is desirable and EDXRD provides a non-destructive and non-invasive means of testing. A recent study has demonstrated that chemically-relevant features from EDXRD data can be observed for aspirin tablets when they are within blister packaging [4]. A quantitative analysis of unpackaged pharmaceutical formulations using EDXRD and mul-tivariate calibration methods was carried out in a previous study and demonstrated good capability to predict concentrations of the constituent compounds [5]. In the present study we demonstrate again this capability and extend it to modelling and quantifying the chemical composition of the same samples through blister and card packaging simultaneously.
There are many examples of Raman spectroscopy being combined with multivariate calibration for quantitative analysis of pharmaceutical mixtures [6][7][8][9][10]. One such study [10] looked at ternary mixtures of paracetamol, starch and sucrose, covering a range of concentrations. The Raman spectra were acquired through blister packaging to construct a partial least squares (PLS) regression model, resulting in a root mean square error of cross validation (RMSECV) of 1.4%, and the authors observed the potential application to counterfeit medicines detection. Fraser et al. carried out a semi-quantitative analysis of active pharmaceutical ingredients (APIs) in intact tablets of erectile dysfunction medicines, including counterfeit versions -the PLS calibration model in this case was constructed from Raman spectra from tablet 'cores', i.e. with Fig. 1. X-ray incident on two parallel planes at an angle Â, with photon wavelength and planar spacing d. The thicker ray line represents the additional path length traversed in a reflection from the lower plane which, for a coherent scattering event, is an integer multiple of the X-ray wavelength, satisfying Bragg's law. the coating removed. Using selected bands of the spectra and preprocessing, a RMSECV of 7.38% was achieved in the best case [9].
To the authors' knowledge, there have been no previous studies into the non-destructive quantitative analysis of pharmaceutical mixtures through packaging using EDXRD and chemometrics, which form the basis of this study. The following section introduces some principles of X-ray diffraction (XRD) to explain the physical phenomena giving rise to the features observed in the experimental data.

X-ray diffraction
Crystalline materials -such as polycrystalline powders of the chemicals used in pharmaceutical formulations -comprise molecules which are arranged in an ordered three-dimensional structure repeated throughout the crystal. Sets of parallel molecular planes arise from this long range order [18]. These sets of planes, in particular the separation between them, are unique to the material and thus present an opportunity for material identification. It is through XRD that we can achieve this characterisation of materials.
X-rays of the same energy scatter coherently from molecules in adjacent planes when constructive interference occurs. The conditions to be satisfied for the detection of a coherent scattering event are shown in Fig. 1 and are defined by Bragg's law: where is the wavelength of the incident X-ray, d is the interplanar spacing and Â is the angle subtended by the X-ray source, the sample and the detector. There are two ways in which Bragg's Law can be interpreted for use in XRD experiments. Firstly, in ADXRD, monochromatic Xrays are used (i.e. fixed ) and diffraction peaks are detected for a range of angles. ADXRD provides high-resolution XRD profiles, but the relatively low energy X-rays used do not pass through thick samples. Secondly, in energy-dispersive XRD (EDXRD), the sample is irradiated with polychromatic X-rays and an energy-resolving detector collects a diffraction spectrum at a fixed angle. The quality of diffraction patterns is limited by the energy resolution of the detector, and more importantly, by the loss of angular resolution due to collimators allowing a range of angles, i.e. deviations from the nominal angle, of X-rays through. This is a necessary compromise in order to collect an adequate number of counts in an acceptable time scale for screening applications, but results in significantly broader, overlapping peaks compared to ADXRD profiles.
It is common to convert the energies of an EDXRD spectrum to units of momentum transfer x, which incorporates diffraction dependence on scattering angles and X-ray energy. This is useful for making comparisons between EDXRD systems, and between ADXRD and EDXRD. Bragg's law (1) is rearranged to: using the relationship between energy of a photon and its wavelength: where h is Planck's constant c is the speed of light in vacuo.
The advantages of EDXRD are that the lack of moving parts in the instrumentation can make data collection more rapid and the higher energies of X-rays used can penetrate bulkier samples. EDXRD can therefore be used for non-destructive analysis of materials.
It is assumed that statistically, all possible orientations -and hence planes -of the crystals are represented equally in a powder. However, some crystals have shapes that create a tendency for them to align in a certain way, in which case some crystal planes are over-represented in the resulting diffraction pattern -this is the preferred orientation effect. This effect is often stated as being a limiting factor of the use of ADXRD in the aforementioned studies.
Another relevant physical phenomenon in X-ray screening is that of attenuation. Materials attenuate the beam and reduce the flux of photons which are transmitted through the material. Attenuation is greater for lower-energy photons as well as for thicker materials. Moreover, the molecular composition of the material itself has its own energy dependent attenuation profile, (E). The percentage of X-ray photons at an energy E which will be transmitted through a material of thickness x which has an attenuation coefficient of (E) is defined by the Beer-Lambert law: where I is the relative intensity of the X-ray beam at energy E following the interaction with the material. The effect of attenuation by packaged tablets at lower energies is therefore appreciable.

Sample preparation
Paracetamol (Acetaminophen BioXtra, ≥99.0%; Sigma Aldrich), caffeine (ReagentPlus; Sigma Aldrich), and microcrystalline cellulose (average particle size 50 m; Acros Organics) were the ingredients of the ternary mixtures and were all used as received. The former two are common APIs, and the latter is a common excipient used as a dilutant. Microcrystalline cellulose was an appropriate excipient as it has an XRD spectrum that is representative of other common excipients in terms of its peak broadness and momentum transfer range in its XRD profile.
The calibration mixture design is shown by the triangles in Fig. 2. Such a design simplex is common to mixture analysis experiments and has been used to enable the system to be compared to other studies [11,13].
Each sample mixture was ground with an agate mortar and pestle for three minutes to mix thoroughly and to reduce particle sizes -with the aim to decrease preferred orientation effects [13]. More vigorous mixing techniques such as milling were avoided to prevent potential polymorph phase transitions [11,13,15,19]. Sieving was also avoided as the paracetamol powder exhibited a build-up of electrostatic charge when ground, making it difficult to handle; this additional step also risked introducing artefacts resulting from selecting particles of a certain size [16,20]. 400 mg of each mixture was transferred to a 13 mm-diameter die and pressed into tablets using an automated Speca Press. A 1ton load (equivalent to 67.0 MPa) was applied, with a dwell time of two seconds before the pressure was released. The compacted tablets were then extracted carefully from the die.

EDXRD system
A schematic of the system used in the EDXRD experiment is shown in Fig. 3. The X-ray source was a water-cooled Comet MXR-160 X-ray tube with tungsten target. The source was operated at a peak voltage of 60 kV and 2 mA current.
A high-purity germanium (HPGe) detector (model GLP-36360/13-P, EG&G Ortec) was positioned at approximately 4 cm from the scatter collimator to detect scattering events. The detector was held at a temperature of 77 K and was coupled to a multichannel analyser to produce an energy-space histogram for each sample. Each detected photon was assigned to one of 512 channels.
The nominal scattering angle (2Â) was 6.3 • -determined by comparing the peak positions for a caffeine sample spectrum to those from a caffeine reference spectrum. The beam spot size was calculated to be 1.6 mm in diameter at the sample.

Sample scanning
All samples were scanned in triplicate, with a different part or side of the tablet scanned each time. For the "packaged" sample scans, pieces of card, foil and plastic taken from Sainsbury's paracetamol packaging were cut to size and fashioned into a sample holder such that the tablets would have foil and card on one side, and plastic and card on the other.
After initial scans, a preferred orientation effect was evident in all samples containing paracetamol, with some peaks showing large variations in intensity between scans. Rotating the sample was not an option in this experimental setup, nor would it be suitable for the ultimate goal of scanning whole tablets in packaging. Others have overcome this issue by either shaking samples, or by scanning at different points to smooth out discrepancies [21,22]. In this instance, a set of translation stages was added and used to scan all paracetamol-containing tablets in 30 positions for 10 s per step. All samples not containing paracetamol were scanned continuously for 300 s.

Multivariate analysis
The two multivariate analysis methods used in this study were principal component analysis (PCA) and partial least squares regression (PLSR). Both methods are powerful tools in chemical mixture analysis, for X-ray diffraction data and spectroscopic data in general. Such data have high correlation between variables within their profiles, specifically between energy channels in this study. As such, the high dimensional spectral data have a low-dimensional latent structure to describe the variation in the chemistry of the mixture set. This lower dimensionality, often referred to as chemical rank, corresponds closely to the number of compounds comprising the mixtures. These methods transform the data into a few mutually-orthogonal latent variables which between them account for almost all of the variance found in the data set, and allow us to discard uninformative data or noise.
PCA is used in this study as an exploratory tool, enabling us to identify possible groupings or patterns of samples from transforming the EDXRD data alone, and to then compare these groupings to known reference chemistry. By doing this we get an insight into the power of the experimental system to discriminate chemical information of interest.
PLSR is used to build calibration models which relate the known chemical information, such as sample concentrations, to the instrumental response measured by our system. If we define the concentrations of a compound as a response vector y and the corresponding multivariate EDXRD profiles as a matrix of explanatory variables X, then the calibration building stage aims to form a linear regression model between the two: where ˇ is the vector of regression coefficients which we estimate asˆ using the method of partial least squares [23,24]. ε is the error not explained by the model. PLS models the covariance between the reference chemistry and the EDXRD profiles of the calibration data.
Typically, a small number of principal latent variables are selected and the regression coefficients between the reference chemistry and the instrumental response are calculated. The model is then used with EDXRD profiles of test samples to predict their concentrations in order to validate the regression model. The method of model validation used in this study is leave-one-sample-out crossvalidation. A RMSECV is calculated for the model from the average magnitude of the residual of predicted concentration and reference concentration for all samples. It is through validation that the appropriateness of data pre-treatment methods, the range of energies, and the number of latent variables in the PLS model can be assessed and an optimal modelling approach determined.

Data pre-treatment
In addition to modelling the raw EDXRD data, the data have been transformed by a range of pre-treatments using common chemometric techniques to determine whether they improve the performance of the PLSR model compared to using only the raw profiles. The transformations used are standard normal variate (SNV) and multiplicative scatter correction (MSC), which have been shown in NIR spectroscopy to correct for multiplicative scattering and other physical effects such as particle size and in some instances lead to model improvement. A first-order derivative pretreatment has also been carried out on the EDXRD data which may  correct for potential baseline drift across profiles [25]. In order to determine the effect on prediction accuracy of X-ray attenuation at low energies, both a 'short' and 'long' spectral region were studied. The former region corresponds to 12.2-40.3 keV, or 0.538-1.78 nm −1 ; the latter region encompassed the full range of the X-ray tube spectrum, i.e. 4.02-56.6 keV, or 0.178-2.50 nm −1 .

Software
The plotting of EDXRD profiles was carried out using Matlab (R2017b, v.9.3, Mathworks). The Unscrambler (v.9.5, CAMO, Norway) software was used for the multivariate analysis methods PCA and PLSR, pre-treatments and model checking diagnostics.

Unpackaged samples
Each sample was scanned in triplicate and the three profiles per sample were averaged. Plots (A) and (C) in Fig. 4 show triplicate measurements of two samples containing paracetamol, samples 2 and 11. Very prominent preferred orientation effects can be observed between 0.5 and 1.0 nm −1 in momentum transfer space between the triplicate measurements. However, when the translational stages were implemented the preferred orientation effects of paracetamol were greatly reduced as shown plots (B) and (D) of Fig. 4. The 22 averaged profiles for the unpackaged mixtures are plotted in Fig. 5(A). An important feature of EDXRD data is heavy overlapping of peaks which is demonstrated in the figure. No particular energy range can therefore describe the variation of a particular chemical across the sample set, which motivates the use of multivariate analysis.
The Beer-Lambert equation given in (3) enables the attenuation effect of compounds of specified thicknesses and densities on particular X-ray energies to be calculated. The attenuation effect on X-rays of caffeine, paracetamol and microcrystalline cellulose at thicknesses of ∼0.25 cm used in this experiment only become appreciable below ∼11 keV (0.5 nm −1 in this setup) -calculated using tables of mass attenuation coefficients ( ) obtained from the NIST X-COM database [26]. The majority of the energy window for EDXRD profiles is not therefore affected by self-attenuation effects.
A principal component analysis was carried out on meancentred, 'long', averaged profiles of the 22 samples in the training set. Fig. 5(B) shows the scores plot for the first two PCs, which account for 93% and 5.6% of the explained variance across the data, respectively. A two-dimensional principal component projection of the EDXRD data clearly separates the sample profiles closely in accordance with their coordinates in the mixture design of Fig. 2. This is an encouraging result for when the aim is to regress the EDXRD against the reference concentrations to build a regression model.

Packaged samples
The 22 averaged profiles for the packaged mixtures are plotted in Fig. 5(C). The aluminium and polyvinyl chloride (PVC) which comprises blister packaging [27], plus the card material of the outer packaging, contribute to X-ray attenuation and scattering in the profiles. Fig. 6 demonstrates the effect of packaging for samples 4, 9 and 18 compared to unpackaged samples. Despite the attenuation effect of the packaging material, the diffraction peak features are still observed. There is a higher intensity for packaged tablets around a momentum transfer of 1.2 nm −1 than for unpackaged samples which can be attributed to the scattering from the packaging material itself.
In the principal component analysis of the packaged samples the between sample explained variances for the first three PCs were 90%, 8.1% and 0.74% respectively. The first two PCs have been plotted in Fig. 5(D). Despite the packaging effects causing observable   (2) distortion to the diffraction profiles, the scores from the PCA still separate the objects in a manner comparable to the ternary design of the mixture compositions shown in Fig. 2.

Unpackaged
PLSR was used for model calibration using the mean spectra for the 22 samples in the training set as explanatory variables, X, and the nominal concentrations of the mixture components as the response variables y. The pre-treatments described in Section 2.5 were applied to the data and a separate model built for each.
The models were validated using leave-one-out cross-validation where for each model a RMSECV was calculated. The optimum number of PLS-factors was then chosen by selecting the number of latent variables which minimized the error statistic with lower numbers of latent variables favoured, when errors were comparable, to avoid overfitting the data. The results are provided in Table 1.
Diagnostic tools presented in Beebe et al. [28] were used to check for sample leverage and sample outliers for each model. No samples had high leverage and residuals simultaneously for any of the models and therefore no samples were identified as outliers.  The application of MSC and SNV as pre-processing methods did not improve the model, as can be seen from the similar or higher RMSECVs. For MSC, the diagnostic plot of spectral value versus mean spectral value did not show any strong tendencies for different slopes or offsets between samples, which indicated that it was probably not needed.
In the absence of any improvement to the model performance from using pre-treatments, the use of raw EDXRD in a PLSR model was deemed suitable. The predicted concentrations from crossvalidation for the raw, 'long' spectra are plotted against reference concentrations in Fig. 7.
The paracetamol concentration predictions were more spread, as expected by the variations in spectra from preferred orientation. The RMSECV values thus follow from this by showing that the largest errors were for paracetamol; the caffeine and cellulose values exhibited smaller errors. It is important to note that the nominal concentration values are likely to differ from the actual concentrations due to errors introduced when measuring the powders and due to possible inhomogeneity in the mixture; in a similar experiment by Moore et al., the cumulative error in preparing such tablets was estimated to be 2-3% [16].
These results are therefore encouraging -in fact, the RMSECV values were better than those quoted in the literature for quantitation of ternary mixtures by ADXRD, and on a par with results from Raman spectroscopy [15].

Packaged
The same modelling used for unpackaged tablets was applied to packaged tablets.
RMSECVs for the PLSR model based on raw, 'long' spectra were in general higher than for the unpackaged case. There was a 20% and 24% increase on the RMSECV values for paracetamol and microcrystalline cellulose respectively, but only a 2% increase for caffeine. It is possible that some of the potential change in prediction error for caffeine has been mitigated by the greater effect of attenuation on its first peak, with lower peak amplitudes having smaller errors according to Poisson counting statistics [29].
The results from the modelling of packaged tablets are comparable to those of unpackaged tablets and within the range of uncertainty of the reference chemistry according to Moore et al. [16]. As with the unpackaged models, modelling of the raw EDXRD data was found to be as good or better than when using data pre-treatments and no sample outliers were observed from model diagnostic tests for any model. The predicted concentrations from cross-validation for the raw, 'long' spectra were plotted against reference concentrations in Fig. 8.

Conclusions
A preliminary study using energy dispersive X-ray diffraction to predict the concentration of common ingredients in pharmaceutical tablets has been carried out. An EDXRD system has been developed and multivariate calibration has been used to model the EDXRD profiles when the tablets are unpackaged and packaged. This study shows similar accuracy is obtained for both the unpackaged and packaged scenarios for the mixtures.
One disadvantage of calibration methods for composition resolution is that they cannot model or account for all possible adulterants or interferents which may be encountered during screening. Future work will therefore explore soft modelling methods to characterise the chemistry of samples which are more robust to interferents.
A further limitation to the study is that only three pharmaceutical compounds have been analysed and the formulations were prepared in the laboratory for the purposes of the study. Fur-ther work is required to determine the capability of predicting the concentrations of industrially manufactured medicines using the method described. Furthermore, the current trend to include amorphous compounds in pharmaceutical formulations motivates the evaluation of the method using less crystalline compounds. However, a recent study by Moss et al. [30] has demonstrated the potential of EDXRD to discriminate amorphous materials in breast tissue such as tumour and fatty tissue.
Limitations notwithstanding, the analysis here shows that high accuracy can be achieved using EDXRD to characterise pharmaceutical formulations and the technology could be put to effective use for truly non-destructive counterfeit medicine screening and pharmaceutical quality control.

Contributions
CC set up the EDXRD system, carried out the experiment, performed the analysis and contributed to manuscript drafting. PK drafted the manuscript and consulted on the statistical modelling methodology and analysis. DO'F assisted to set up and calibrate the EDXRD system. RS is the principal investigator for the project. All authors read and approved the final manuscript.