## 1 Introduction  
Micro-electro-mechanical systems (MEMS) comprise both mechanical and electronic components manufactured on a common silicon substrate, and have gained significant attention in the last three decades. Due to the miniaturized size, low cost, high manufacturing throughput, and expectancy of superior performance, MEMS are used in a wide range of consumer, automotive, medical, and industrial products [1, 2]. With the increase in the integration density and the reduction in the feature size, high-aspect-ratio (HAR) structures in silicon play an increasingly important role in micro-sensors and actuators [3, 4]. Most MEMS HAR structures are fabricated by the dry etching process, especially deep reactive-ion etch (DRIE) with the Bosch process [5, 6]. The precisely controlled profile of HAR structures is required for better device performance and higher resolution and reliability [7]. Due to aspect-ratio-dependent etching and microloading effects, there is a complex interplay during etching between the device design (topology dimensions and shape) and etch parameters [8]. Therefore, in situ, real-time critical dimension and depth measurement for HAR structures is critical for optimizing the Bosch deep etching process. To date, various methods have been used to measure the HAR structures of MEMS [9, 10]. Scanning electron microscopy (SEM) is a commonly used tool with high resolution and high magnification, but it is costly, inefficient, and not suitable for online real-time detection. Optical methods, such as scatterometry and infrared reflectometry, are reported to measure repeated structures with high throughput, but are limited in their ability for the dimensional analysis of isolated HAR structures. Moreover, a silicon oxide film usually exists in etched MEMS device, which makes it more problematic for SEM and scatterometry. Through-focus scanning optical microscopy (TSOM) is a novel fast and low-cost optical measurement method with nanometer sensitivity, and is achieved with bright-field optical microscopy [11]. The conventional TSOM method is a model-based metrology method analyzing the scattering intensity reflected from the target and the intensity change as the target performs through-focus scans along the optical axis. The dimensional information of the target is extracted by matching the intensity information with the simulation results in the database. For improving the performance, great attention has been paid to minimizing the dissimilarities between the intensity information acquisition and simulation conditions [12; 13; 14; 15; 16; 17; 18; 19]. In the meantime, model-based TSOM utilizes only the optical intensity range and the mean-square intensity information of the TSOM image; hence, large amounts of intensity distribution information correlated to the dimensional information of the targets is ignored. To date, TSOM has only been used to measure targets with critical dimensions and depth of 1 \(\upmu\)m or less, which is far from sufficient for MEMS. Deep learning (DL) is a powerful artificial intelligence technology and has made important progress in pattern recognition, computer vision, automatic speech recognition, natural language processing, and other fields. Training DL algorithms directly with measurement data is a new approach to TSOM, an alternative to establishing a simulation database. It improves the TSOM performance by taking advantage of additional intensity information and avoiding the adverse effect of the dissimilarities between information acquisition and simulation conditions [20]. A convolutional neural network (CNN), as one of the most representative DL algorithms, can automatically learn the deep correlations between the scattering intensity information and dimensional information of the targets [21], and is often used in the field of image processing.