## 7 General Approaches in RIID Algorithms  
Current RIID algorithms can be categorized into a few distinct approaches, each of which involves at least implicitly a spectral library [5, 6, 19]. Algorithm categories include: expert interactive, simple library comparisons, region of interest (ROI) methods, template matching, and variable subset selection. Expert interactive methods often look at largest peak(s) and seek corroborating \(\gamma\)-rays within the library. A user should correct each peak area to compensate for differences in the branching ratio for \(\gamma\)-ray and the detector's efficiency as a function of energy. This approach is best for HpGe or high resolution detectors; however, expert spectroscopists can accomplish the same goal with NaI detectors. Library comparison methods often use the centroid of each peak but not the peak area or branching ratio of candidate sources. Slight drifts or inaccuracies in the energy calibration can lead to incorrect identifications. Complications of this approach include a significant number of low-energy lines being shielded and missing due to absorbers, or numerous nuclides emitting \(\gamma\)-rays of similar energy. ROI methods develop one or more ROIs for every nuclide in the library and need to avoid overlap of ROIs. This is difficult as the library size grows. An example challenge are the \({}^{177}\)Lu peaks at 378.502 keV and 413.658 keV, and \({}^{239}\)Pu peaks at 375.018 keV and 413.691 keV, so other energies would need to be used to distinguish \({}^{177}\)Lu and \({}^{239}\)Pu because of the closeness of these two pairs of peaks. Template matching methods quantify the quality of the fit between the test spectrum and each member of a spectral template library. The library consists of several templates for each isotope, varying the detecting medium, intervening materials, and source-to-detector spacings. It is possible to infer source(s) and absorber(s), but source mixtures are problematic, although additive combinations can be considered. Often decay chains are used that include daughter products as precomputed mixtures. In template matching, the correlation coefficient \(r\) between two measured spectra \(C_{\text{\tiny{1}}i}\) and \(C_{\text{\tiny{2}}i}\) or between a library spectra and a test spectra is also often used, defined as \(r=\dfrac{\sum\limits_{i=1}^{n}(C_{\text{\tiny{1}}i}-\overline{C}_{\text{\tiny{1 }}})(C_{\text{\tiny{2}}i}-\overline{C}_{\text{\tiny{2}}})}{\sqrt{\sum\limits_{i= 1}^{n}(C_{\text{\tiny{1}}i}-\overline{C}_{\text{\tiny{1}}})^{2}\left(C_{\text{ \tiny{2}}i}-\overline{C}_{\text{\tiny{2}}}\right)^{2}}}\). Also, a standard chi-squared goodness of fit is used, defined as \(\chi^{2}=\sum\limits_{i=1}^{n}\dfrac{(c_{i}-TP_{i})^{2}}{\sigma_{i}^{2}}\), where \(c_{i}\) is the number of counts in channel \(i\), \(TP_{i}\) is the expected number of counts in channel \(i\) with \(T\) the total counts in the entire spectrum, \(P_{i}\) the relative probability of observing a count in channel \(i\), and \(\sigma_{i}\) the standard deviation in the number of counts in the histogram at channel \(i\). Because of the Poisson assumption previously described, \(\sigma_{\text{\tiny{1}}}\) is typically estimated as the mean, which is written here as \(TP_{i}\). Peak finding and characterization methods often apply spectral smoothing [20, 21] followed by peak fitting and corresponding peak area estimation. Peak area estimation is useful because each radio-isotope in the library has known \(\gamma\)-emission energies and relative intensities. For example, [22] proposed the first practical method for measuring the isotopic composition of an arbitrary (in size, shape, composition, and measurement geometry) plutonium sample by an analysis of its \(\gamma\)-ray spectrum from a relatively high resolution detector such as HpGe.