# Transfer Learning Analysis for Subvisible Particle Flow Imaging of Pharmaceutical Formulations
## 3 Results and Discussion
### CNN Transfer Learning for Subvisible Particle Classification  
To classify pharmaceutical formulation particles, we fine-tuned the VGG16 network based on the ImageNet dataset. For a total of 2000 \(\times\) 7 test set samples, the classification efficiency of this CNN classifier was 97.51% for seven different particles and 97.09% after excluding polystyrene standard particles. Using the confusion matrix (Figure 3), different metrics can be derived to indicate the classifier's performance, specifically for each class of particle; the accuracy of protein particles, cap fiber particles, glass particles, silicone oil microdroplets, and polystyrene beads was above 98%. The relative recognition rates of the silicone tubes and rubber particles were lower (91.70% and 95.70%, respectively). It is possible that the silicone tube particles were recognized as glass, protein, and rubber closure particles, and the rubber closure particles were misidentified as glass, silicone oil, and silicone tube particles. This may be related to the morphological diversity of granules at low sizes. The results show that by using the VGG16 architecture based on ImageNet pre-training, after transfer learning to train the fully connected layer, it is possible to achieve over 97% accurate recognitions of individual particles of different types. On the contrary, it is difficult for humans to make accurate subjective classifications directly from individual particle images. CNNs can achieve composition recognition of particles based on individual grayscale particle images, which in turn helps to trace the sources of particles under production conditions, optimize the sources in a targeted manner, improve the production process, and prevent exogenous particles from entering pharmaceutical formulations at the source. To evaluate the generalization ability of the model, we introduced precision, recall, \(F\)-score, and a receiver operating characteristic (ROC) curve in addition to accuracy. The precision for a class is the number of true positives divided by the total number of elements labeled as belonging to the positive class. In this context, recall is defined as the number of  
Figure 3: Confusion matrix of our CNN, tested on 2000 images from each class with an overall classification efficiency of 97.51%. true positives divided by the total number of elements that actually belong to the positive class. These are defined as follows:  
\[precision=\frac{TP}{TP+FP} \tag{1}\]  
\[recall=\frac{TP}{TP+FN} \tag{2}\]  
where \(TP\), \(FP\), \(TN\), and \(FN\) are defined as true positive, false positive, true negative, and false negative, respectively. The \(F\)-score is a composite of recall and precision and is the harmonic mean of the two, as defined below:  
\[F=2\ \frac{precision\text{-}recall}{precision+recall} \tag{3}\]  
The ROC curve is a graph showing the performance of the classification model at all classification thresholds. The curve consists of two parameters: the true positive rate (\(TP\)) in the vertical coordinate, and the false positive rate (\(FPR\)) in the horizontal coordinate. \(TP\) is equal to the recall rate; \(TP\) and \(FPR\) are defined below. The area under the curve (AUC) is typically used to assess the ROC curve, and provides an aggregate measure of performance across all possible classification thresholds. The AUC is scale-invariant and classification threshold-invariant. The AUC ranges from 0 to 1; generally, the closer the AUC is to 1, the higher the accuracy of the classifier. \[TPR=\frac{TP}{TP+FN} \tag{4}\]  
\[FPR=\frac{FP}{FP+TN} \tag{5}\]  
When considering one class of particles, the accuracy can be considered the same as the recall rate; accuracy-related conclusions have been mentioned previously. Table 2 lists the precision, recall, and \(F\)-scores of each particle. All particles showed high precision rates of 94% and above. Similar conclusions were obtained when the \(F\)-score was used to measure recall and precision, with a total combined \(F\)-score of 97.50% and scores above 93.50% for each particle class.