← Back to Blogs & Publications Chemometric Modeling Software PCA Interface

Developing Robust Chemometric Classification Models via PCA

How a PCA model of reference spectra becomes a classification rule, where the Hotelling T² and Q residual limits come from, when SIMCA-type class-modelling is the right choice rather than PLS-DA, and how a qualitative NIR model is validated for specificity and robustness — with the chemometric and regulatory sources.

Qualitative questions need a different kind of model

Quantitative NIR models predict a number: moisture, protein, fat. Qualitative models answer a different question: is this material what the label says, and is it the grade that was ordered? In the chemical and pharmaceutical industries this is the goods-in identification task. The European Medicines Agency guideline on NIRS uses identification for confirming the identity of a substance and qualification for also distinguishing grades of it, such as particle size or polymorphic form; the unknown is compared against a spectral reference library built from several batches of several substances, and the match/no-match criteria must be justified [1]. The U.S. FDA guidance defines an identification test the same way [2].

From PCA scores to a class boundary

Principal component analysis compresses the hundreds of correlated absorbance channels of a spectrum into a few orthogonal components; each spectrum is described by its scores on those components, the loadings show which wavelengths each component uses, and whatever the model does not capture remains in the residuals [3]. A reference class modelled this way has two distance measures: the score distance, or leverage, is how far a sample lies from the class centre inside the model space, and the orthogonal distance is how much of its spectrum lies outside the model, its residual variance [4]. The first is conventionally expressed as Hotelling's T², the multivariate generalisation of Student's t [5]; the second as the Q statistic, for which Jackson and Mudholkar proposed a control procedure testing the residuals of a single observation against a reduced principal component model, with quality control in mind [6].

Pomerantsev showed that both distances can be modelled by scaled chi-squared distributions whose degrees of freedom are estimated from the training data, and used this to build SIMCA acceptance areas for a chosen significance level [4]. A class limit is therefore a statistical decision, not a fixed number: significance level, number of components and pre-treatment all move the boundary, which is why the EMA guideline requires thresholds, confidence limits or tolerances to be stated and justified [1].

Class-modelling or discriminant analysis?

Oliveri's tutorial separates qualitative modelling into two families: discriminant methods, appropriate when at least two classes are meaningfully defined, and class-modelling (one-class) methods, the right choice when the focus is a single class. That is the usual situation when a material is accepted or rejected against its own specification. Forcing a discriminant method onto a one-class problem biases the outcome [7]. SIMCA is the archetypal class-modelling method; the EMA guideline lists it with PCA, discriminant analysis, cluster analysis and correlation matching, and advises using the simplest algorithm that gives successful results [1].

When several known classes must be separated, PLS-DA is widely used. Barker and Rayens supplied the formal reason it works (PLS is linked through canonical correlation analysis to linear discriminant analysis) and concluded that PLS is to be preferred over PCA when discrimination is the goal [8]. Brereton and Lloyd, however, showed that for two equal-sized classes one-component PLS-DA equals Euclidean distance to centroids and full-rank PLS-DA equals linear discriminant analysis, warned of pitfalls with unequal class sizes, several classes and overfitting, and concluded that PLS-DA is one step in a classification procedure, not a method on its own [9].

Building the library

A library is a structure of models rather than one model. Blanco and Romero built an NIR library of 125 pharmaceutical raw materials using the correlation coefficient as the discriminating criterion and resolved materials with very similar spectra by sub-cascading libraries that branch off the main one and use chemometric procedures of higher discriminating power [10]. The EMA guideline describes the same architecture: a site-wide library may not give adequate specificity, so sub-libraries holding all samples of one class are used, and samples from all relevant suppliers belong in a goods-in library [1]. The data expectation is three sample sets: a calibration set that forms the library, a calibration test set or cross-validation for internal optimisation, and an independent validation set with positive and negative samples, not drawn from the same historical population of batches [1].

Validating a classification model

Both the EMA and the FDA require qualitative NIR procedures to be validated for, at minimum, specificity and robustness [1][2]. Specificity is demonstrated operationally: independent samples of library materials must pass and challenge samples must fail, the challenges including name and structure analogues and, for qualification, other grades, hydrates, polymorphs, particle sizes or vendors [1]. The FDA phrases it as positive controls of confirmed identity and negative controls such as placebos or spectrally similar materials [2]. Robustness covers temperature, humidity, sample position and presentation, and instrument changes such as a new lamp [1]. In class-modelling terms the fraction of true members accepted is the sensitivity and the fraction of non-members rejected the specificity; Ballabio and Consonni's tutorial walks through the calibration and validation steps of a PLS-DA model and what to evaluate at each [11]. Three points deserve emphasis:

  • Cross-validation alone overstates performance. Westerhuis et al. showed that PLS-DA overfits readily and that validation should combine cross model validation with permutation testing [12].
  • Score plots are not evidence. Westerhuis et al. and Brereton and Lloyd both advise against inferring class differences from PLS-DA score plots [9][12].
  • The external set must be external. A test set from the same historical batches is not independent validation; the validation set must come from different batches [1].

Identification libraries on USTECH analyzers

In the caliX chemometrics software, PCA class models and PLS-based discriminant models are built on reference spectra, with the T² and Q limits, number of components and pre-treatment chosen and documented as described above [1][4]. Library spectra are collected at the sampling point on the handheld TrueLine 17EC or in-line on the ProLine17EC, and ProChem passes the result to the plant PLC. Whether one library or a cascade of sub-libraries is needed, and how many batches per material the required specificity takes, is established in a feasibility study with your own materials and their challenge samples.

References

  • [1] European Medicines Agency (2014). Guideline on the use of near infrared spectroscopy by the pharmaceutical industry and the data requirements for new submissions and variations, EMEA/CHMP/CVMP/QWP/17760/2009 Rev2, Sections 5.1–5.4. EMA, London. ema.europa.eu (PDF)
  • [2] U.S. Food and Drug Administration, CDER (2021). Development and Submission of Near Infrared Analytical Procedures. Guidance for Industry, Section V.A and Glossary. FDA, Silver Spring. fda.gov/media/91343/download
  • [3] Bro, R., Smilde, A.K. (2014). Principal component analysis. Analytical Methods, 6(9), 2812–2831. doi:10.1039/C3AY41907J
  • [4] Pomerantsev, A.L. (2008). Acceptance areas for multivariate classification derived by projection methods. Journal of Chemometrics, 22(11–12), 601–609. doi:10.1002/cem.1147
  • [5] Hotelling, H. (1931). The Generalization of Student's Ratio. The Annals of Mathematical Statistics, 2(3), 360–378. doi:10.1214/aoms/1177732979
  • [6] Jackson, J.E., Mudholkar, G.S. (1979). Control Procedures for Residuals Associated With Principal Component Analysis. Technometrics, 21(3), 341–349. doi:10.1080/00401706.1979.10489779
  • [7] Oliveri, P. (2017). Class-modelling in food analytical chemistry: Development, sampling, optimisation and validation issues – A tutorial. Analytica Chimica Acta, 982, 9–19. doi:10.1016/j.aca.2017.05.013
  • [8] Barker, M., Rayens, W. (2003). Partial least squares for discrimination. Journal of Chemometrics, 17(3), 166–173. doi:10.1002/cem.785
  • [9] Brereton, R.G., Lloyd, G.R. (2014). Partial least squares discriminant analysis: taking the magic away. Journal of Chemometrics, 28(4), 213–225. doi:10.1002/cem.2609
  • [10] Blanco, M., Romero, M.A. (2001). Near-infrared libraries in the pharmaceutical industry: a solution for identity confirmation. The Analyst, 126(12), 2212–2217. doi:10.1039/b105012p
  • [11] Ballabio, D., Consonni, V. (2013). Classification tools in chemistry. Part 1: linear models. PLS-DA. Analytical Methods, 5(16), 3790. doi:10.1039/c3ay40582f
  • [12] Westerhuis, J.A., Hoefsloot, H.C.J., Smit, S., Vis, D.J., Smilde, A.K., van Velzen, E.J.J., van Duijnhoven, J.P.M., van Dorsten, F.A. (2008). Assessment of PLSDA cross validation. Metabolomics, 4(1), 81–89. doi:10.1007/s11306-007-0099-6
USTECH Innovations Logo

Discuss this application for your process

Our application team can walk through the method, share the supporting literature and discuss how it applies to your process.

Contact Us

Read Next

Optimizing Starch Extraction Efficiency in Wet Corn Milling
ARTICLE

Optimizing Starch Extraction Efficiency in Wet Corn Milling

Where starch is lost in a corn wet mill, how separation performance is measured, and what published work says spectroscopy can and cannot monitor in slurry streams.

Read Article
Optical Fiber Interface Designs for Corrosive Chemical Reactors
GUIDE

Optical Fiber Interface Designs for Corrosive Chemical Reactors

How probe geometry, the silica fibre, the sapphire window, the wetted alloy and the seal decide what an NIR spectrometer actually sees inside a corrosive or hot reactor, with the literature behind each choice.

Read Guide