1. A method of accurate neural network training for library-based critical dimension (CD) metrology, the method comprising: optimizing a threshold for a principal component analysis (PCA) of a spectrum data set to provide a principal component (PC) value; estimating a training target for one or more neural networks; training, based both on the training target and on the PC value provided from optimizing the threshold for the PCA, the one or more neural networks; and providing a spectral library based on the one or more trained neural networks.