UV/VIS imaging-based PAT tool for drug particle size inspection in intact tablets supported by pattern recognition neural networks

The potential of machine vision systems has not currently been exploited for pharmaceutical applications, although expected to provide revolutionary solutions for in-process and final product testing. The presented paper aimed to analyze the particle size of meloxicam, a yellow model active pharmaceutical ingredient, in intact tablets by a digital UV/VIS imaging-based machine vision system. Two image processing algorithms were developed and coupled with pattern recognition neural networks for UV and VIS images for particle size-based classification of the prepared tablets. The developed method can identify tablets containing finer or larger particles than the target with more than 97% accuracy. Two algorithms were developed for UV and VIS images for particle size analysis of the prepared tablets. According to the applied statistical tests, the obtained particle size distributions were similar to the results of the laser diffraction-based reference method. Digital UV/VIS imaging combined with multivariate data analysis can provide a new non-destructive, rapid, in-line tool for particle size analysis in tablets.


Introduction
Tablets represent a significant portion of the pharmaceutical dosage forms, due to their several advantageous properties, for example, convenient administration, stability, portability, and dosing accuracy [1] [2] [3]. In 2015, the U.S Food and Drug Administration (FDA) approved the first commercial product, Orkambi by Vertex, manufactured using continuous technology. the manufacturing by monitoring and controlling process parameters and quality attributes [9].
In the modernization concept, data-driven solutions can contribute to understanding the processes and controlling the intermittent variability to enable consistent quality in each step of the production. These reserve an essential role in implementing QbD and real-time release testing (RTRT) approaches [10]. Particle sizes and the particle size distributions (PSDs) of the components are vital parameters in the pharmaceutical development and manufacturing phases. These critical material attributes (CMAs) affect critical quality attributes (CQAs) and the critical process parameters (CPPs) considering the systematic concept of QbD [11][12] [13]. Based on the general quality target product profile (QTPP) of tablets, the content uniformity, in vitro dissolution behavior, and bioavailability of the final dosage form, which are more significant related to poorly water soluble APIs, are among the affected CQAs. The time and the blend uniformity are affected CPPs belonging to the homogenization step of the API with excipients, where the particle size of the API potentially represents a high risk. In the compaction step, the compactibility of the powder blends, the compression force, the tensile strength, and the porosity can be affected by the mentioned CMAs [11][12] [13].
Consequently, particle sizes and PSDs of the components in tablets significantly affect the efficacy, stability, and safety of the final product. During the production of solid dosage forms, operations are performed, affecting the particle size of the applied materials. Therefore, the monitoring and control of these CMAs are crucial in both powders and the final dosage form throughout the manufacturing [12] [11]. The development of real-time, in-line particle size analysis methods in intact tablets can contribute to getting more information about the processes throughout the manufacturing, including tableting [11].
The characterization of a particulate system by PAT tools has been in the attention of industrial companies in the recent decade [9]. There are several methods for the determination of PSDs of powders or granules, such as sieve analysis [14], microscopic measurements [15], sedimentation [16], spectroscopic methods [17], and image analysis [11]. However, only a few publications assess particle sizes and distributions in intact tablets.
Simek et al. applied hot stage microscopy for particle size determination of tablets containing meloxicam and tadalafil as APIs. In the context of the sample preparation methods, destructive mechanical and liquid disintegration was applied [12].
Thakral et al. published a 2-dimensional X-ray diffraction method where the particle size of the API was estimated in intact flat-faced tablets containing lactose-monohydrate and sucrose with different particle sizes. There are a few limitations of this technique, such as the curvature of the surface [11].
Skelbaek-Pedersen et al. investigated the effect of different particle sizes on material fragmentation during the tableting process. They applied diffuse reflectance near-infrared spectroscopic technique and executed a qualitative examination of the particle size of microcrystalline cellulose and calcium hydrogen phosphate dihydrate in tablets using principal component analysis [3].
The most important advantage of the mentioned methods is the capability to examine the particle size of the components in tablets. However, the hot stage microscopic technique appears available for offline analysis of PSD because of the instrumentation, the requirements, and the destructive manner of the sample preparation. The 2-dimensional X-ray diffractometry does not require such sample preparation, although it cannot be applied as a PAT tool due to the instrumentation. Both methods have limitations in the context of the examinable sample number. The U.S. FDA approved the application of near-infrared spectroscopy for in-line measurements despite the mentioned publication only qualitatively examining the particle size in intact tablets.
Machine vision is a specific solution in many fields [18][19] [20], which is recently gaining interest in the pharmaceutical industry. It may provide a new, cost-efficient, and rapid way in quality assessment of pharmaceutical products and process control [21]. A few paper reports on the analysis of the final pharmaceutical products, such as tablets. For instance, these mainly focus on monitoring coating processes [8], defects [22], and pellet distribution on the surface of the tablets [23]. According to the authors' knowledge, a machine vision system is not applied for particle size analysis in intact tablets. However, these can assist or supplement other instrumentations and methods in manufacturing and contribute to the process controlling. One of the significant advantages of applying these systems is that all the produced tablets can be examined. The rejected products can be isolated immediately, which reduces the financial loss.
The application of artificial intelligence gained ground in the business processes, the drug development in the pharmaceutical industry and also emerged in the manufacturing of pharmaceutical dosage forms [24][25] [26]. Neural networks are nonlinear computational methods that model the communication of neurons in the human brain [27]. These computational methods are popularly used for approximations and pattern recognition [28].
Pattern recognition neural networks are classifiers and similar in structure to a feed-forward neural network. The difference between them is in the softmax transfer function of the output layer [29]. The application of pattern recognition neural networks can be found in other industrial sectors [30].
This proof-of-concept paper aimed to develop and apply a machine vision system based on digital UV/VIS imaging for qualitative and quantitative particle size assessment of the API in intact tablets. Image processing algorithms were developed, and pattern recognition neural networks were applied for classification based on the different particle sizes of the API.
Subsequently, the paper intended to predict the PSD of the API in tablets by combining the classification results and the image processing algorithms. At last, an application example was presented, in which the developed system is introduced for automatic tableting where the tablets included different particle sizes of meloxicam, a yellow model API. The purpose of the final experiment was to determine whether the produced tablets met the criteria for the particle size, thus performing a quality-based selection. 2.2. Preparation of different particle size fractions from MLX Different particle size fractions were produced from the initial MLX using crystallization methods for particle size analysis. The denotation of these groups contained the measured, rounded D50 values in the subscript. If any crystallization process was applied, the solvent was named in the superscript. The denotations and the differences between the particle size groups were summarized in Table 1.

Materials and Methods
The applied technique for the particle size enlargement of was based on the 25 publication of crystallization using a slow cooling method by Bolourchian et al. [31].
Accordingly, 1 g of was placed in a crystallization dish and dissolved in acetone at 25 50°C using 100 rpm stirring. The applied concentration was 0.45 w/v%. The solution 25 was kept overnight at room temperature to evaporate the applied solvent. The obtained crystals were gathered in a glass sample holder and stored at room temperature. When ethanol solvent was applied, the aforementioned slow cooling method was used and the concentration 25 was set to 0.16 w/v% Crystallization was also applied to produce a fine particle size fraction from . Based hydroxide solution (1 equivalent of NaOH with respect to , water/ ratio was 25 25 set to 30) at 45°C, using 100 rpm stirring. When a clear solution was obtained, the pH was adjusted to 4 with hydrochloric acid. The obtained suspension was kept at 45°C for 60 minutes [32]. After a cooling step, crystals were filtered, washed with distilled water, and dried. The obtained crystalline fraction was gathered and stored the same as mentioned. The applied crystallization methods were reproduced in both cases to collect sufficient amount of crystalline samples. the vibration of the tray, the sample was fed into a sieve with bearings for controlled sample flow and to break the loose agglomerates. The sample flow and the dispersion were provided by compressed air. The applied standard operation procedure parameters were the followings: vibrational feed rate was set to 40%, dispersive air pressure was set to 1 bar, and measurement time was 30 seconds. The applied theory of particle size analysis is based on the Mie theory.
The measurement range of this instrument takes from 100 nm to 2 mm.

Preparation of the tablets
In the first experiment, tablets were produced to train, validate, and test the pattern recognition neural network, which executed the particle size-based classification task. These tablets were also crucial in the development phase of the algorithms for particle size analysis using UV/VIS images, especially identifying the API with different particle sizes. To test the capabilities of the developed system in finer and larger particle size ranges than the target, powder blends from the four different particle size samples ( Table 1.) and a mixture was prepared from 25 and and used as APIs. The authors determined the PSD of as target.

25
After weighing the appropriate amount from the different particle size samples of MLX ( Table   1.), 10.5 g powder blends with 2.5 m/m% API content were prepared using MCC as excipient ( Table 2.). The API content was determined based on the commercially available MLXcontaining tablets. In the first experiment, no MgSt addition was to avoid other interfering parameters in the development phase of the particle size analysis methods. The lubrication was provided between the tableting of the different particle size groups.
To maintain the integrity of the different particle size samples and to avoid the breaking of the prepared crystals, the homogenization step was executed by manual blending for 10 minutes.
From each powder mixture, 25 tablets were produced one by one on a Dott Bonapace CPR-6 (Dott Bonapace, Italy) eccentric tablet press, equipped with a single concave punch using 10 ± 1 kN compression force. Biconvex tablets were obtained with a diameter of 14 mm, the weight of the tablets was 15 mg, and the content of the applied API was 10 0.5 mg per tablet. 400 ± ± The further experiment aimed to test the capabilities of the developed machine vision system to identify changes in the particle size from . The tableting was executed in automatic 25 mode on the same instrumentation supplemented with a feed frame. Two blends containing the target and finer or larger particle size fractions ensure the changes in the system. After weighing the components, 22 g of powder blends were prepared using the homogenization method. The compositions of the applied powder blends are presented in Table 3. In this experiment, MgSt was also added to the powder blends to determine its effect on the classification and particle size analysis both in UV and VIS images. After 5.5g of powder blend containing was 25 fed into the feed frame of the tablet press, the tableting process started. Defined amounts of the following blends were layered in a specific order ( Table 3.) with time shifts to ensure the occurrence of tablets containing the approved particle size of the API.

Figure 1. UV and VIS image processing algorithms for classification and particle size analysis
After the image importing and the background extraction steps, UV images were resized to 20% of the original size. The resizing allowed the reduction of the image processing duration and the time consumption of the classification. For the classification task, the determination of the exact R, G, and B threshold values were not necessary because only the extraction of the distinguishable features and the regions of interest (ROIs) were required. Identifying ROIs was achievable using more permissive thresholds for only one channel from the applied colorspace.
After the thresholding step, the obtained logical values were used to generate binary images.
Then area equivalent diameters of the ROIs were calculated. Histograms were created from these values and used as input for pattern recognition neural network after normalization.
In the applied network, 50 neurons were applied in one hidden layer with a saturating linear transfer function, and 5 neurons were applied in the output layer with softmax transfer function.
The pattern recognition neural network was trained using scaled conjugate gradient backpropagation. The end of the training was determined by reaching the appropriate number of validation checks. The training sample set contained 70%, the validation and the test set contained 15%-15% of the samples prepared in the first tableting experiment. Classes were determined according to the prepared different particle size samples and marked with Boolean operators in a target matrix. For evaluating the performance of the network, cross-entropy and mean squared error were calculated. Neural networks were also trained using the resized images and only two classes in the target matrix for approval or rejection of the tablets.
A similar method was applied to determine area equivalent diameters of ROIs based on VIS images as for UV images. The main difference is in the concentrical segmentation of the tablet to the edge and the central regions. Due to the shape and the applied compression force the prepared tablets were changed in the saturation of color from the center to the edge. The changes in the color saturation were also observable, mainly when and groups were 25 5 applied. caused a more saturated color on the surface of the tablets than . 5 25 Thus, after the conversion from RGB to HSV colorspace, the S channel histograms were applied. In the last step of VIS image processing, histograms of the S channel and the area equivalent diameter values were fused to create the input dataset for the pattern recognition neural network. The applied neural network structure was the same as used in the classification of UV images.
The developed algorithms also contained a simple approval limit for the particle size of the API. This made easily identifiable even one large MLX particle on UV and VIS images, and it supported the results of the pattern recognition neural networks. In that case, precise thresholding was applied for the API. Then the sizes of MLX particles were determined based on section 2.6.2. The upper approval limit (100 μm) was determined based on the obtained PSD of . 25 2.6.2. Particle size analysis of tablets The algorithms for the particle size analysis using UV and VIS images are shown in Figure 1.
The appropriate threshold values for R, G, and B channels were applied to identify the MLX particles on UV images. Binary images were created from the obtained logical values. The area equivalent diameters were determined in pixels, and then these values were converted to micron. The PSDs, D10, D50, D90 values, and span were calculated in the last step.
A complex algorithm had to be developed for particle size analysis using VIS images.

Particle size analysis of the prepared MLX crystals
The acquired UV images taken from the different particle size samples are shown in Figure 2.
Based on the obtained statistical values of the measured PSDs the different particle size fractions of MLX were successfully prepared. As Boluruchian et al. mentioned the agglomerates cannot be disaggregated with 1 minute sonication [31]; this affected , 176 and groups. The occurring aggregates also caused differences between the measured 303 statistical values in the presented and the mentioned publication. However, the utilization of the prepared crystals and agglomerates are suitable for the goal of the authors to detect and classify defective tablets in the context of particle size, to determine the particle size of and 25 particle domain size of and , and to identify tablets containing . 3.2. Acquired images from the prepared tablets containing different particle sizes of MLX The acquired images from the prepared tablets for the classification and the particle size analysis were shown in Figure 3. ) of the images was taken using UV illumination, the second row of the images was taken using VIS illumination of the same tablets. Figure 3, the API particles of the different particle size groups were more distinguishable using UV illumination. On the VIS images, API particles of , and MLX EtOH 303 μm ML were distinguishable to the naked eyes. Individual particles were not X Acetone 176 μm 5 distinguishable at the API content of 2.5 m/m%, making the particle size analysis not feasible in that group. The differences in particle size were not observable between the and 5 groups using VIS illumination; only a slight color change differentiated the two 25 groups. However, these observations enabled the qualitative analysis of the tablets under UV and VIS illumination in the case of the group. 5 The acquired images from the application experiment of the machine vision system are shown in Figure 4.

and VIS illumination)
The + containing tablets were more identifiable with UV images than with 5 25 VIS images. In the case of + containing tablets, the appearance was 176 25 similar to the group with the aleatory occurrence of large particles.

176
However, few particles were on the surface of the presented tablet (Figure 4.), there 176 could be high variability in the occurrence of these large particles.

Particle size-based classification of the prepared tablets
The particle size-based classification was executed with the developed image processing algorithms and pattern recognition neural networks (Figure 1.) based on the images taken from the prepared tablets using the two different illuminations (Figure 3.).
The cross-entropy and mean squared error values for the training, validation, and test set were summarized in Table 4. and the confusion matrices obtained with the developed image processing were shown in Figure 5. for the different illuminations.  According to Table 4. binary classification can be executed with or without preprocessing of the resized UV or VIS images.

Figure 5. Confusion matrices of the pattern recognition neural network-based classification using image processing algorithms and five classes (a) training, b) validation, c) test set for UV images, d) training, e) validation and f) test set for VIS images)
When five classes were applied regarding the different particle size samples, satisfactory results were achieved using UV images with or without the preprocessing algorithm. However, when VIS images were used as inputs, better results were achieved with the developed image processing algorithm. Due to the applied image processing algorithms, neural networks used a significantly smaller matrix as input dataset containing the appropriate information. This related to the duration of the classification, which might be a significant advantage.
In Figure 5. the obtained confusion matrices were presented using five classes and image processing. In the case of the training set of UV images, only one tablet side, thus a tablet was misclassified to instead of group. From the validation sample set one was 3.4. Particle size analysis of the prepared tablets containing different particle sizes of MLX After the prepared tablets were classified, the particle size analysis was executed. The obtained PSDs and the statistical values were shown in Figure 6. and Table 5. for UV and VIS images.
These distributions and statistical values were obtained as a summary from all the images taken from the prepared tablets. The reference distributions and statistical values were obtained from the initial crystals of different particle size samples of MLX using an off-line laser diffractionbased method.  The fine particle size of made the particle size analysis not feasible because the 5 individual particles were not distinguishable with the applied resolution of the images. In other cases, the calculated distributions were similar to the measured distributions. Between the measured and the predicted PSDs differences could occur because the agglomerates or the crystals can break apart and deform during the homogenization or the tableting steps of the process.
Considering the statistical values in Table 5., a slight difference can be observed between the measured and the predicted D50, D10, D90, and span values in the group. These 25 deviations are substantially higher in respect of and groups. the measured PSDs. However, the Wasserstein distance values were higher than for the group. 25 Using the developed image processing algorithms for UV and VIS images, the determination of PSD of group was possible, which was also supported by statistical comparisons. 25 However, only a domain size can be accurately determined in the context of the 176 and groups. Important to mention that the machine vision system can collect 303 information from every individual tablet, which can monitor these unexpected changes during the production process. 3.5. Application of the developed machine vision system for particle size-based classification and particle size distribution determination in intact tablets An automated tableting-based experiment was executed to model an API batch change or segregation. The presented work tended to show the changes in particle sizes in the prepared tablets, being above or below the desired particle size. The created two scenarios were presented in Figure 7. a) and b). These justified the necessity of applying the pattern recognition-based classification and the extended version of thresholding to the desired value. adding + to the initial powder mixture) 5

25
The image processing algorithms and pattern recognition neural networks were the same as used for assessing the tablets prepared in the first tableting experiment. The approval limit approach played a considerable role in the occurring scenarios, especially when 176 was presented in the initial powder mixture. 25 In the automatic tableting mode, 155 tablets were prepared (   According to UV and VIS images, rejected tablets in the sample range of 1-65 were classified to + group by pattern recognition neural networks. From sample range of 5 25 66-155 the approvable tablets were classified into the group of and the thresholding 25 algorithms detected the occurrence of particles. If the percentage of incorrect 176 classification is considered from the summarized results of approval values, 2% was obtained in the case of UV and 1.3% was obtained for VIS illuminated images. In Figure 9. the resulted PSDs of the digital UV/VIS imaging-based particle size analysis were presented. In the case of the target group the PSDs were similar to the measured 25 distributions based on the statistical comparisons ( Table 7.)  The changes in particle size from the target have a significant impact on the quality, safety and efficiency of the tablets. The in vitro dissolution rate significantly increases, and the dissolution profile can be modified with the application of fine API particles. The large particle significantly slower the dissolution of the product. The particle size also affects the flowability and compressibility, thus fine particles have the worst performance.
The applied MLX concentration in this work was considered adequate but relatively low. The developed thresholding-based method can be applied up to the API concentration when the particles are not overlapping. Consequently, the developed model should be applied to much higher MLX concentrations without any modifications. Although, when the particles overlap to a large extent, advanced methods should be applied for particle identification.
It is worth mentioning that the developed method needs to be adjusted to the API UV activity and color in VIS, the applied particle size, the API content, the applied excipients and the resolution of the images. A single tablet image can be enough to determine if the particle size analysis works. Another outstanding feature is that the algorithms do not depend on the camera type.
This work presented the PSD determination and particle size-based classification of the API.
The same high-resolution UV and VIS images allow the system to examine the particle size of MCC. Because the MCC particles are less defined than the API, an advanced method should be applied to identify the edges. In the case of MgSt, due to the small particle size and weight fraction, the application of the machine vision system demands a more comprehensive investigation. In the context of MLX, other excipients or different particle sizes of excipients may not require modified algorithms.

CONCLUSION
With the shift towards continuous technologies supported by the regulatory agencies in the pharmaceutical industry, the appropriate sensors, multivariate data analysis, and data-driven methods are becoming more and more valuable. According to that, the newly developed machine vision systems will soon gain more interest in industrial applications. The digital UV/VIS imaging-based particle size classifications supported by the developed image processing algorithms and the applied pattern recognition neural networks were successfully executed with more than 97% accuracy using UV or VIS images. The developed method was applicable in the case of 2.5 w/w% MLX content, and the application was not restricted to particle size fractions higher or lower than the optimal particle size of the applied API. On the other hand, the particle size analysis based on digital UV and VIS images of the tablets was restricted to those particle size fractions, which D50 value was higher than 5 μm. Although in that case, the defective tablets, which contained fine particles, can be detected, and rejected based on the results of the classification. The particle size analysis of the tablets, when d50 higher than 5 μm was successfully carried out when the mixtures of the API with the target and defected particle size were applied. The presented methods can be feasible for pharmaceutical applications and can open a new perspective for particle size analysis qualitatively and quantitatively based on a single UV or VIS image of an intact tablet.