# Frequency Range Optimization for Continuous Wave Terahertz Imaging
## 5 Frequency Range Optimization  
The frequency range in THz-FDS is linked directly to the longer acquisition times. To be able to estimate a phase shift using a zero-crossing detection algorithm, the frequency resolution needs to be high enough. The detected THz wave frequency dependent photocurrent in the PCA receiver is integrated over a set integration time to increase the fidelity of the measurement. This paper aims for the automatic selection of frequency range, while frequency resolution and integration time would stay the same. With a narrower frequency range, the acquisition time will be lower. Figure 8 shows the principle of this paper. A dataset for material classification was acquired in the first phase. The dataset consisted of 10 batches of 50 wide-spectrum measurements for each plastic plate used in the observed sample. The dataset was then transformed using WSD, and used for CNN training, as shown in Section 4. The trained CNN was utilized in the proposed frequency range optimization (FRO) algorithm. The first step in the proposed FRO is the CNN's occlusion sensitivity estimation, followed by the occlusion sensitivity function estimation and frequency range selection using predefined criteria. The selected frequency ranges were to be used in image acquisition and compared against the empirically-determined frequency range by the expert in the field, as shown in the preliminary work [17]. The proposed frequency range optimization (FRO) algorithm, shown in Figure 9, is based on occlusion sensitivity. Occlusion sensitivity will provide a map of features that have a higher impact on classification. CNNs are typically a black box. With the help of CNN visualization tools, such as occlusion sensitivity, the inner workings of CNN can be inspected, as shown in [20]. How a CNN predicts the results and which features are \begin{table}
\begin{tabular}{c c c c} \hline \hline \(\mu\) & \(t_{1}\) (h) & \(\alpha\) & \(e_{max}\) \\ \hline
0.992 & 0.1 & 0.0001 & 100 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: CNN Training results, where \(\mu\) is the learning accuracy, \(t_{1}\) is the learning time in hours, \(\alpha\) is the initial learning rate, and \(e_{max}\) is the maximal number of epochs. Figure 8: Principle of the proposed frequency range optimization. important for predicting with high accuracy can be crucial in the CNN's design and data preparation. CNN visualization tools can also present a unique opportunity for specific applications, such as [21]. Occlusion sensitivity analysis is a relatively simple process. It assumes that the probability score in the CNN's class prediction will change if an area of the image is occluded. An occluded area, or occlusion mask, can be a single pixel or a larger area in the image. The probability score differences can be overleaped if the occluded area is moved across the image. The probability score differences will form an occlusion map--an image of the same size as the original image, but its pixel values are the probability score differences. The occlusion sensitivity principle is shown in Figure 10.  
The occlusion map is created for a single class. Three different classes were chosen in the proposed solution--gray, white, and a black plastic plate. Several occlusion maps were estimated for each class, and all occlusion maps were averaged. In the resulting average occlusion sensitivity map (AOSM), an intersection was performed between points of interest. The AOSM withholds information on areas in the 2D image most important for successful prediction for all three classes. In the second step of the proposed FRO algorithm, rows in the AOSM are combined to form an occlusion sensitivity function (OSF). An OSF is a function of frequency and not a position in a 2D image. An inverse WSD algorithm and linear interpolation were used for creating the OSF. The data series' length was estimated  
Figure 10: Occlusion sensitivity principle. Figure 9: Proposed frequency range optimization algorithm based on occlusion sensitivity.