Abstract
This article presents a novel gadget that utilizes machine vision technology to automatically measure the clearance of shield tails in real-time. The device uses image processing to pull out important details from pictures, which makes it possible to precisely find the inner zero point of the shield shell and the edge of the pipe segment, even when lighting is poor. Through the use of computer algorithms and the creation of a dynamic scale, the device gives accurate measurements of the distance between the shield and the tail right away. Consequently, this technological solution successfully addresses the challenge of measuring shield-tail clearance without requiring physical touch. Furthermore, based on data analytics and correlation screening of multi-source construction and geological parameters, a forecasting model centered on the Long Short-Term Memory (LSTM) neural network is proposed. Through integration of optimization techniques including genetic algorithms (GA) and particle swarm optimization (PSO), a composite forecasting framework is established. This framework incorporates generative adversarial networks and k-fold cross-validation methods to effectively mitigate model overfitting and enhance robustness. Finally, engineering simulations are performed using measured data from the Beijing Metro project to validate the accuracy of the automatic measurement equipment. Moreover, the intelligent prediction of shield-tail clearance is achieved by utilizing a combination prediction model framework that incorporates both shield construction parameters and geological parameters.
Introduction
Shield-tail clearance is a significant characteristic that characterizes the concentricity of the shield segment and its tail. It is defined as the gap between the inner diameter of the steel ring at the shield's tail and the outer diameter of the constructed segment (Zeng et al., 2022). This parameter is illustrated in Figure 1. In the process of conventional shield building, it is imperative to ensure that the shield tail clearance is consistently maintained within an acceptable range. An excessive amount of disparity can result in a cascade of issues, including the expedited deterioration of the shield tail seal, fragmentation of segments, significant settlement development, and potentially even accidents (Huang et al., 2023). Hence, the precise assessment of shield tail clearance holds immense importance in ensuring construction safety and maintaining engineering quality.

Schematic diagram of tail space.
Currently, the measurement methods primarily consist of the following: Manual measurement involves the direct assessment of shield tail clearance through the utilization of a measuring tool. Nevertheless, manual measurement is subject to uncertainties and restrictions as a result of human factors and operational errors. These limitations are particularly evident in situations involving confined spaces and complicated shapes, when the precision of measurements is constrained. Optical measuring involves the utilization of optical devices, such as theodolites and laser rangefinders, to quantify distances or gaps. Typically, these methods demonstrate a propensity for achieving high levels of accuracy. However, in practical engineering scenarios, the presence of measurement errors might arise as a result of several circumstances, such as the impact of light and the angle of view. Acoustic measurement involves utilizing the propagation properties of sound waves to assess the clearance of the shield tail. The aforementioned approach exhibits a degree of efficacy in mitigating the challenges associated with limited spatial constraints and obstructions. However, it is noteworthy that its performance is notably influenced by the properties of the materials used and the presence of ambient noise in the surroundings. The aforementioned measurement methods present several challenges in actual implementation, including elevated complexity in measurement, diminished precision, and limited real-time capabilities. The aforementioned issues can be effectively addressed through the utilization of machine vision technology, specifically through the implementation of an automatic measurement method that relies on image recognition algorithms (Perez & Tah, 2023; Zeng et al., 2022), such as YLOO-type and receptive field-attention-based methods (Fang et al., 2024; Tao et al., 2024). However, we specifically point out that these methods focus on robust feature extraction and small-targets detection in complex industrial scenes, which is conceptually aligned with our need to reliably detect segment edges and shield-shell features under poor illumination and occlusion. We also emphasize how our work differs: instead of generic object detection, we design a task-specific imaging and processing pipeline tailored to shield-tail geometry, and we couple this with a neural-network-based prediction module driven by tunneling and geological parameters.
On the other hand, numerous scholars have undertaken research on the prediction of shield construction using artificial intelligence techniques. These studies encompass various aspects, including the evaluation of tunneling performance of shield machines (Lin et al., 2021; Liu et al., 2022; Zhang et al., 2020; Zhang et al., 2021), construction risk management (Chung et al., 2019), analysis of ground deformation (Naghibi et al., 2022; Yu et al., 2024; Zhu et al., 2020), identification of abnormal faults in shield machine equipment (Hasanpour et al., 2020; Wan et al., 2022), and prediction of tool wear (Elbaz et al., 2020; Elbaz et al., 2021). Notably, these studies have yielded favorable outcomes in terms of prediction accuracy. Nevertheless, there is a scarcity of pertinent research on the forecasting of shield-tail clearance.
All in all, the automatic, precise measurement and intelligent prediction of shield tail clearance are still tough research subjects. In light of the aforementioned considerations, this study proposes a multi-camera non-contact sensing system for automated real-time measurement of shield tail gaps, based on machine vision and image recognition technology. Through joint calibration of the “inner surface zero point” and inversion of lower gap values from upper measurements, high-precision automated real-time measurement and visualization are achieved at approximately 30-s intervals. An end-to-end intelligent prediction framework based on neural networks, featuring “data analytics—feature screening—GAN enhancement—GA-PSO-LSTM,” is developed. This framework integrates multi-source geological and tunneling parameters, and incorporates generative adversarial networks (GAN) and k-fold cross-validation methods, which significantly enhance prediction accuracy and generalization capability. In practical engineering applications, the safety and efficiency of the proposed method have been validated through comparison with manual measurements, demonstrating superior performance over traditional approaches.
Device Architecture
The picture data is derived from the shield tail gap image that is automatically captured by the high-resolution Infrared Vision Camera (IVC) positioned in front of the shield tail. Non-contact automatic measurement is achieved by employing machine vision and digital image processing techniques to identify the position of the shield gap and measure its corresponding value. The device can be primarily categorized as image acquisition equipment, as depicted in Figure 2(a). Additionally, three IVCs are strategically positioned on the left, right, and upper sections of the front of the shield tail. It is important to acknowledge that in the course of the construction procedure, the lower shield tail frequently encounters obstructions such as silt and water, rendering it inaccessible for measurement. The lower shield tail clearance can be determined by the calculation of the higher shield tail clearance. The mathematical computation is illustrated in equation (1).

System architecture.
Where,
Figures 2(b) and (c) depict the computation and analysis module, as well as the data display module, respectively.
The image acquisition terminal comprises a synchronization system, an opto-electronic conversion system, and an A/D conversion system for the purpose of generating image signals as output. The principle is depicted in Figure 3.

Image acquisition principle.
The IVC facilitates the instantaneous capture of images in real-time from the shield tail region. It is strategically positioned on the periphery of the shield tail propulsion cylinder, as depicted in Figure 4(a). The device incorporates an image-vision system that enables reliable image acquisition in challenging environmental conditions. By incorporating advanced picture restoration capabilities, the system attains long-term operational efficiency by means of a specifically designed protective enclosure. The disintegration of the IVC structure is depicted in Figure 4(b).

Measurement principle.
The shield tail clearance image was acquired by the IVC, and subsequently partitioned into three distinct components: the segment, tail clearance, and shell.Please refer to Figure 4(c) for a visual representation. The machine vision image algorithm is employed for the purpose of detecting the boundary of the segment and determining the reference point on the inner surface of the shield shell. This algorithm also calculates the width of the gap, as depicted in Figure 4(d). The resulting calculations and visual image are then transmitted to the control room of the shield machine operation. Additionally, a dynamic measurement scale is utilized to provide a real-time display of the tail gap value, as shown in Figure 4(e). This display assists the shield operator in making adjustments to the parameters of the shield machine. It is imperative to ensure that the clearance of the tail is maintained within acceptable parameters.
The primary interface of real-time measurement equipment encompasses four fundamental functionalities: real-time data visualization, virtual dynamic scale interpretation, configuration of PLC parameter functions, and platform extension interface. The interface displaying real-time data is depicted in Figure 5. The upper portion of the diagram illustrates the real-time measurements of the tail gap at three different positions: the left position (CameraA), the right position (CameraC), and the top position (CameraB). Simultaneously, the current distance between the device used for image acquisition and the gap between the shield and the tail is visually presented in real-time. The lower section of the diagram displays the present count of tunneling rings within the shield, as well as the graphical representation of the alteration in shield tail clearance at three designated measuring points, namely A, B, and C.

Real-Time measurement display interface.
Utilizing machine vision image processing technology, the device is capable of real-time measurement of the dynamic value of shield tail clearance. The automatic measurement frequency can achieve a rate of 30 s per measurement, effectively compensating for the limitations of manual measurement methods that can only be conducted after the completion of segment assembly. Furthermore, the device displays the real-time dynamic change curve of shield tail clearance throughout the entire process of shield tunneling (Figure 6(a)). Simultaneously, the real-time display of the relative position relationship between the shield and the shell is depicted (Figure 6(b)), facilitating the operator's enhanced comprehension of the present position relationship between the shield tail and the segment.

Display of shield tail clearance variation.
Accurately calibrating the zero point within the shield is a crucial component in the process of tail clearance identification. The device utilizes image processing and vision technology in order to discern and recognize distinct marks or features, thereby enabling precise determination of the actual position. The technique for calibrating the zero location is depicted in Figure 7.

Zero calibration procedure.
The Hough circle detection algorithm is employed for the purpose of identifying circles within an image (Zhou & He, 2017). This approach provides the necessary parameters for each identified circle, including the center coordinates
Where
The distance, denoted as d, between the IVC and the tail of the shield can be determined using laser ranging. The horizontal and vertical angles of the IVC, as well as the resolution of the picture, are also obtained by laser ranging. The method of calculating the position can be achieved by following the steps outlined in reference (Yao & Yi, 2016).
Step1: Calculation of the horizontal angle. The calculation of the horizontal angle
Where w is the image width and
Step2: Calculation of vertical angles. In a similar vein, one can determine the vertical angle
Where
Step3: Calculation of position. The calculation of the coordinates
The aforementioned computation method establishes the link between the position of the circular mark in the image and its equivalent position in the shield coordinate system. By utilizing this correlation, the determination of the zero position in the shield coordinate system may be achieved by referencing the mark location in the image during the actual construction process. This enables the precise calibration of the zero position within the inner region of the shield shell.
The process of shield propulsion cylinder elongation is documented through image collection by the IVC, as depicted in Figure 8. The inner zero point of the shield shell is calibrated using an ideal position, and an imaging model of the shield tail clearance is established. This allows for the determination of the matching relationship between the inner zero point of the shield shell and the position of the IVC. The procedure of zero calibration and recognition is depicted in Figures 4(c) and (d).

Interior zero calibration of shield.
The edge detection of segment edges is achieved by the utilization of the canny operator, which is based on the convolution technique (as depicted in Figure 9(b)) (Cao et al., 2018; Cheng et al., 2021). The canny operator is a computational optimization operator utilized for the purpose of edge detection, subject to specific criteria. In contrast to Roberts, Sobel, Prewitt, and other edge detection operators that rely on the first derivative, the Canny operator employs a twofold threshold approach, enabling precise edge localization and effective noise reduction (Kanchanatripop & Zhang, 2020; Teng et al., 2022). The process begins with obtaining the pixel number of the segment's edge and width. Subsequently, the resulting segment image undergoes region interception, gray-level processing, histogram equalization, and median filtering. These steps are followed by local adaptive threshold segmentation, Canny operator edge detection, and the Hough transform. Ultimately, the segment's edge is identified, and feature extraction is performed (Luo et al., 2022; Zhou et al., 2021).

Edge segment identification.
The process of canny operator edge detection mostly consists of the subsequent stages.
Step1: Calculate the gradient and edge orientation. The Sobel operator is employed for the computation of the picture gradient along both the horizontal and vertical axes. The horizontal gradient, denoted as
The gradient amplitude G and gradient direction
Step2: Non-maximum suppression. To maintain the highest possible value of the local gradient amplitude, the edges undergo a process of refinement. The non-maximum suppression technique is employed to suppress the gradient amplitude G of each pixel in the direction
Step3: Dual-threshold processing. In the context of dual-threshold processing, it is necessary to establish both a high threshold, denoted as
Step 4: Edge connections. The weak edge pixels that are connected to the strong edge pixels are also designated as edge pixels, based on the connectivity between them. The task can be accomplished using either a recursive or iterative approach.
The depicted diagram in Figure 9(a) illustrates the sequential steps involved in the edge recognition method. Figure 9(c) displays the binary representation of the segment edge recognition image.
LSTM Neural Network
In contrast to the conventional recurrent neural network (RNN), the Long Short-Term Memory (LSTM) successfully addresses the issues of gradient vanishing and gradient exploding encountered by standard RNN models. This is achieved by the use of gating mechanisms and memory units (Ma et al., 2022; Yu et al., 2021). The LSTM model incorporates several processes, including the forgetting gate, input gate, and output gate, which facilitate its ability to selectively retain, discard, and output information. These /mechanisms provide a more refined level of control over the flow of information within the LSTM model. Furthermore, the memory component of the LSTM architecture facilitates the retention and transmission of information across temporal instances, effectively capturing significant long-range dependencies within the sequential data.The enhanced structure of LSTM has been found to yield exceptional results in several sequence modeling tasks, including natural language processing (Li & Wu, 2015), speech recognition (Fasoli et al., 2021), and machine translation (Intelligence And Neuroscience C, 2023). As a result, LSTM has become the favored method for handling intricate sequence patterns. The structure of the LSTM neural network is depicted in Figure 10.

LSTM neural network.
Consider a given series of data, whereby the input at each time step is denoted as
Step1: Calculate the forgetting gate output. The forget gate is responsible for determining which information is to be removed from the memory unit. By utilizing the hidden state
The symbol
Step2: Calculate the input gate output. The input gate is responsible for determining the specific information that has to be updated within the memory unit. In a similar manner, the output value
Step 3: Update the memory unit. The contents of the memory unit can be updated by employing forget gates, input gates, and candidate values. The process entails the multiplication of the previous memory with the output of the forgetting gate, followed by the addition of fresh information.
Step 5: Compute the hidden state. The calculation of the hidden state
In the context of optimizing LSTM neural networks, it is imperative to apply the method due to the intricate structure and numerous parameters associated with LSTM neural networks. The performance of these networks is greatly influenced by the parameter configuration. The process of manually modifying these factors is both laborious and intricate, with the potential to yield suboptimal outcomes or unsatisfactory results. The utilization of optimization algorithms, such as genetic algorithms or particle swarm algorithms, enables the automated exploration of optimal parameter combinations within the parameter space. This process leads to enhancements in the performance, generalization ability, and modeling capability of neural networks when applied to sequence data.
Genetic Algorithm
The Genetic Algorithm (GA) is an optimization technique that draws inspiration from the principles of biological evolution in order to address intricate search and optimization challenges. The algorithm program emulates the genetic and evolutionary mechanisms observed in natural systems, employing evolutionary operations to explore the problem's solution space in order to identify the best solution or a solution that closely approximates it (Katoch et al., 2021).
The choice of the fitness function in a genetic algorithm has a direct impact on the rate at which the algorithm converges and its ability to identify the optimal solution. In the context of function optimization, the fitness function
Particle Swarm Optimization (PSO) is an optimization technique that draws inspiration from patterns of social behavior in order to address intricate search and optimization problems. The primary objective is to iteratively modify the position and velocity of particles by means of inter-particle interaction, thereby facilitating their progressive convergence towards the ideal solution within the solution space. To attain this objective, each particle modifies its search path based on two factors: the individual optimal particle (
Where
In order to optimize the LSTM neural network using GA and PSO, it is important to represent the parameters of the LSTM network as variables within the optimization problem. The parameters encompassed in this context consist of weight, bias, and learning rate. The performance index of a neural network is transferred to the aim of an optimization issue by the establishment of a fitness function. This allows for the measurement of the quality of different parameter combinations.
Within the context of GA, the initial chromosomes serve as representations of distinct configurations pertaining to the parameters of LSTM models. By employing genetic operations such as selection, crossover, and variation, the chromosome undergoes optimization on a generational basis, leading to a progressive convergence towards an improved solution. The decoding process involves mapping each chromosome to LSTM parameters, followed by training the neural network using the training data. The fitness function is then utilized to assess the effectiveness of the solution.
In the context of PSO, the starting particles are representative of distinct combinations of parameters pertaining to LSTM. Through iterative updates of its velocity and position, the particle progressively approaches the direction of an improved solution. Every individual particle in the system represents a specific parameter set for the LSTM model. These parameters are used to evaluate the fitness of the solution by training the neural network and producing a fitness function.
Both algorithms employ an iterative process within the population to systematically explore the potential solution space and identify the optimal combination of LSTM parameters. The objective of this optimization procedure is to identify the most favorable arrangement of parameters for a LSTM network, considering the constraints of computational resources and time limitations, in order to achieve optimal performance on a specific job.The method of optimization is depicted in Figure 11.

Optimization logic.
The framework depicted in Figure 12 illustrates the intelligent model for predicting shield tail gap, which is based on an LSTM neural network model that has been tuned using GA and PSO. The framework comprises three distinct stages.

Intelligent model framework.
Stage 1: Data collection and processing. The data sets can be classified into two distinct categories: geological parameters and shield parameters.Geological parameters are acquired by the collection of samples from boreholes used in geological exploration.The shield parameters are obtained from the shield's automated data collection system.Following the completion of data cleaning and outlier processing, the further steps involve data normalization and feature engineering. The correlation between shield parameters is determined using Pearson analysis, and the parameters exhibiting a strong connection are selected for inclusion in the prediction model. The data set is ultimately partitioned into three distinct subsets, namely the training set, verification set, and test set, in a proportion of 7:2:1. The training set is primarily utilized for training the neural network model, while the validation sets are employed to fine-tune the hyperparameters of the model. The purpose of the test set is to assess the efficacy and capacity for generalization of the predictive model. As depicted in Figure 12 (a).
Stage 2: Model training and validation. The prediction model network architecture is developed by combining the weight and bias improved by the GA and PSO methods with the LSTM neural network. The training of the neural network model involves the configuration of hyperparameters, the incorporation of a generative adversarial network, the generation of novel data samples, the mitigation of overfitting, and the improvement of robustness. The performance of the model can be assessed in a more thorough and trustworthy manner by employing k-fold cross-validation. As seen in Figure 12(b).
Stage 3: Performance evaluation. The evaluation of the model's prediction ability is conducted by the assessment of its generalization performance. Additionally, the reliability of the model in practical applications is determined by examining its prediction accuracy and effectiveness on new data. Ultimately, the effectiveness of the model was assessed using quantitative measures such as Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Percentage Error (MAPE), and R-squared (R2). As seen in Figure 12(c).
Project Profile
The Beijing Metro Line 17 project holds significant importance as a crucial rail transit trunk line located in the eastern region of the city. The line layout seen in Figure 13(a) is presented. The whole length of the segment of Line 05 measures approximately 4555 m. This portion is separated into two phases and is constructed using an earth pressure balancing shield machine. The tunnel segments have an outside diameter of 6.4 m, an inner diameter of 5.8 m, and a ring width of 1.2 m. The predominant strata encountered consist of a fine silty sand layer, a silty clay layer, and clay silt layer.The engineering plan and geological profile are depicted in Figures 13(b) and (c), respectively.

Project profile.
The shield tail gap is measured using the approach of selecting every 10 rings, with one ring chosen randomly as the verification ring. In order to assure the representativeness of the samples, a selection of 30 groups of data is made for measurement. The provided measurements pertain to the numerical data associated with the left, right, and upper sections of the tail gap. The value for the lower shield tail clearance can be determined using equation (1). To assure the precision and dependability of the measurement, the data collection process employs the manual ruler measurement method to obtain the real-size data. The location of the measurement site is depicted in Figure 14. The data obtained from automatic measurements is compared with the results obtained from manual measurements, and the absolute error value between the two measurement methods is determined in order to verify the accuracy. The results of accuracy verification are depicted in Figure 15.

Field measurement of shield tail clearance.

Accuracy verification of shield tail clearance.
The analysis of Figure 15 reveals that the pattern of the automated measurement data closely aligns with that of the manual measurement data. However, it is evident that certain rings exhibit significant discrepancies, with the highest absolute error reaching
Overall, when significant external interference effects are excluded, the discrepancy between automatic measurement and manual measurement is not significant, with an average absolute error that can be maintained at
Data Set
The dataset utilized in this study encompasses geological considerations as well as shield parameters. The dataset is presented in Table 1. The geological parameters are acquired by geological investigation, whereas the shield parameters are immediately extracted by the Programmable Logic Controller (PLC) program of the shield machine.
Data Set.
Data Set.
The primary determinants of shield tail clearance are predominantly associated with the characteristics of the shield machine. Based on empirical engineering expertise and an extensive literature review, the shield tail clearance is influenced by a comprehensive set of 16 shield parameters. These parameters encompass the propulsion cylinder stroke (comprising 4 parameters), articulated cylinder stroke (comprising 4 parameters), rolling angle (comprising 1 parameter), pitch angle (comprising 1 parameter), and attitude of the shield machine (comprising 6 parameters). It is important to note that all of these parameters, either directly or indirectly, impact the magnitude of the shield tail clearance. As seen in Figure 16.

Shield machine parameters.
The stage of data preparation holds significant importance in the fields of machine learning and data analysis. The process encompasses data cleansing, which involves the identification and rectification of errors, as well as the handling of missing numbers. Outlier processing involves the identification and remediation of anomalous data points. Data normalization is a process that aims to establish uniform data scales by employing linear or nonlinear transformations. Feature engineering is a crucial process in machine learning that encompasses the creation, selection, and transformation of features with the aim of enhancing the performance and interpretability of models. Collectively, these procedures guarantee the quality and uniformity of data, mitigate the influence of extreme values and variations in magnitude, and establish a dependable foundation of data for the purposes of model training and analysis. Consequently, these measures enhance the trustworthiness and efficacy of data science endeavors (Jiao & Yuan, 2025; Kolarik et al.; Garbin et al., 2020). The equation (21) displays the formula for normalizing.
Where
Correlation analysis is a valuable tool for identifying and comprehending the link between parameter features. Its primary purpose is to pick characteristics that possess the highest information value, while simultaneously mitigating the influence of dimension and noise. By doing so, correlation analysis enhances both model performance and interpretability (Cao et al., 2017; Kalina & Vidnerová, 2023). The Pearson correlation coefficient (PCC) is a widely used statistical measure for quantifying the degree of correlation between variables (Wang et al., 2024). The calculation formula is presented in equation (22).
Where
The interpretation of the PCC computed using the two sets of variables X and Y is as follows:
When the correlation coefficient is zero, it indicates that there is no correlation between the X and Y vectors. When there is an increase (reduction) in the value of X and a decrease (increase) in the value of Y, it can be inferred that the two vectors X and Y exhibit a negative correlation. This negative correlation is quantified by a correlation coefficient that falls within the range of −1.0 to 0.0. When there is a rise (reduction) in the value of X, and a corresponding increase (decrease) in the value of Y, the X and Y vectors exhibit a positive correlation, as indicated by a correlation coefficient ranging from 0.0 to +1.0.
Correlation heat maps can be utilized to visually represent the numerical matrix resulting from calculating the correlation between variable components. Correlation research was undertaken based on the 16 shield parameters described in Section 4.3.1. Figure 17 displays the thermal map illustrating the association between shield tail clearance and shield parameters.

Correlation heat map.
The matrix diagram utilizes color coding to depict different types of correlation. Specifically, the color red is used to indicate a positive correlation, while the color blue is employed to denote a negative correlation. Furthermore, the intensity or depth of the color is utilized to convey the size of the association between the correlation coefficient values. The strength of the correlation increases as the hue becomes darker. The p-value serves as an indicator of the level of significance of observed differences among data, whereas Correlation measures the strength of the correlation coefficient between data points. The elucidation is presented in Table 2.
P-Value and Correlation Explanation.
The findings indicate a strong statistical correlation (P ≤ 0.001) between the attitude of the shield and the P-value of the clearance between the articulated cylinder stroke and the shield tail. This suggests that these two sets of parameters have a substantial impact on the measurement and control of the shield tail clearance. It is important to highlight that there exists a Correlation coefficient greater than 0.5 between the vertical attitude of the shield and the upper shield tail clearance. This indicates a robust positive correlation between these variables, suggesting that modifying the vertical attitude of the shield can have a substantial impact on the value of the upper shield tail clearance. The aforementioned findings align with empirical observations in the field of engineering.
The aforementioned correlation study yielded a set of 11 shield parameters, including articulated cylinder stroke, angle of pitch, and attitude of the shield machine. These factors exhibited a significant correlation with shield tail clearance. In conjunction with geological parameters, the input variable of the intelligent prediction model is used, while the shield tail gap serves as the output variable for intelligent prediction.
Network Architecture
GA and PSO are used to optimize the weight and bias parameters inside the LSTM model, with the aim of enhancing its overall performance. In the course of this procedure, an appropriate activation function, ReLU, is chosen (Dennis et al., 2020) (as shown in equation 23) in order to include non-linear characteristics that facilitate the model's acquisition and depiction of intricate connections within time series data. The construction of the network architecture for the prediction model has been completed.
The Generative Adversarial Network (GAN) is composed of two primary components, namely the Generator and the Discriminator (Megahed & Mohammed, 2024).
The objective of the generator is to establish a correspondence between stochastic noise (often denoted as
Where G represents a generator function.
The objective of the discriminator is to assess the input data (either actual data
In general, the discriminator produces a continuous value ranging from 0 to 1, which signifies the likelihood that the input data is derived from actual sources. The use of the Sigmoid activation function may be employed to accomplish this task, as seen in equation (25).
The objective of training GANs is to create a competitive dynamic between the generator and discriminator components, with the aim of minimizing the error of the discriminator while simultaneously maximizing the error of the generator.
The goal function serves as a driving force for the interplay between the generator and discriminator. The generator's aim is to produce data that closely resembles actual data, therefore deceiving the discriminator. Conversely, the discriminator's mission is to effectively differentiate between genuine and fabricated data. The aforementioned technique undergoes iterative cycles during the training phase until certain convergence criteria are met (Gui et al., 2023).
Folding cross-validation is a widely used technique in machine learning for evaluating the performance of models. This approach involves partitioning the original dataset into k subsets, and then doing k iterations. During each iteration, one of the subsets is used for validation, while the other subsets are used for training the model. The performance evaluation index is determined by calculating the average value of k validation findings. This approach has the capability to properly assess the model's generalization capacity, mitigate the evaluation bias arising from randomness, identify overfitting, facilitate hyperparameter adjustment, and optimize the use of data resources (Shi et al., 2022). In this work, the researchers choose to use 10-fold cross-validation as a means to get a dependable assessment of the intelligent model's generalization ability.As seen in Figure 18.

Folding cross verification (k = 10).
Performance index
The accuracy of the created model is assessed by quantifying the discrepancy between the tested value and the predicted value. The research included five performance assessment indices, namely mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE), mean absolute percentage error (MAPE), and coefficient of determination (R2), to assess the predictive efficacy of the model (Zemouri et al., 2010). The mathematical representations for the five performance metrics are presented in equations (26) to (30).
Where
Our prediction task is a regression problem. MAE and MAPE describe the average magnitude of the error in absolute and relative terms, which are directly interpretable for engineers. MSE and RMSE place more weight on larger errors and are therefore sensitive to peaks and outliers, which is important for assessing safety-critical mispredictions. The coefficient of determination R2 measures the proportion of variance in the measured data that is explained by the model and is widely used to quantify overall goodness-of-fit.
In accordance with the intelligent model framework outlined in Section 3.4, a total of 100 data sets have been chosen to serve as test sets for the purpose of evaluating the performance of the model. Figures 19–21 show the prediction outcomes of the LSTM neural network model, in sequential order. This set of figures presents the comparison between the shield tail gap prediction curves of LSTM and the measured curves at three measuring points (A/B/C) based on 100 selected test samples. Overall, LSTM can capture the general trend, but it exhibits “tracking lag” and amplitude underfitting in response to the rapid fluctuations of the gap and the peak-to-valley transitions, resulting in larger absolute errors in the fluctuation segments. Among the three points, the prediction performance at the upper measuring point is superior to that at the left and right measuring points. This is related to the fact that the horizontal attitude variation amplitude during the construction process is usually larger than the vertical one; the variation regularity of the shield tail gap in the vertical direction is easier to capture accurately, thus achieving more precise prediction results. Therefore, the vertical direction has stronger regularity and better predictability. This observation is consistent with the quantitative results in Table 3: the error levels of LSTM at the three measuring points (A/B/C) are MAE = 7.12/5.86/7.05 mm, RMSE = 9.66/5.57/9.58 mm, and R² = 0.69/0.76/0.67, respectively. These results indicate that LSTM achieves more stable fitting at the upper measuring point, while the left and right measuring points have larger residuals in the fluctuation segments. The findings indicate that the performance of the intelligent model in fitting is average, and it lacks precision in predicting the fluctuation pattern of the shield tail gap. The overall predictive accuracy is rather modest, and the absolute inaccuracy is substantial, reaching a maximum value of

LSTM-camera A prediction result.

LSTM-camera B prediction result.

LSTM-camera C prediction result.
Performance Evaluation.
Figures 22–24 depict the prediction outcomes derived from the GA-PSO-LSTM neural network model. This set of figures presents the prediction comparison of the LSTM optimized by GA-PSO on the same test set and the same group of three measuring points (A/B/C). Compared with the previous group (unoptimized LSTM), the improved model captures the fluctuation patterns and turning points more closely to the measured data, with significant convergence of amplitude and phase deviations at the peaks/valleys. The overall fitting accuracy and stability are enhanced, especially showing better performance at the upper measuring point. Quantitatively, Table 3 shows that the MAE decreased from 7.12/5.86/7.05 mm to 5.92/4.41/5.35 mm (A/B/C), reducing by 16.9%/24.7%/24.1% respectively. The RMSE decreased from 9.66/5.57/9.58 mm to 7.96/4.87/7.64 mm (a decrease of 17.6%/12.6%/20.3%), and the R² increased to 0.85/0.91/0.88, indicating consistent improvements in both relative error and tail error. The results show that compared with the traditional LSTM neural network, the optimized prediction model achieves better fitting performance and can capture the variation trend of the shield tail gap more accurately. The maximum error occurs at the left shield tail gap, with an error value of 15.9 mm, indicating that the left gap remains the most challenging channel. However, the improved model can better track its dynamic changes and suppress abnormal deviations. At the same time, it can be seen that the optimized model achieves the best prediction results for the upper shield tail gap, with an average absolute prediction error of only 4.41 mm.

GA-PSO-LSTM-camera A prediction result.

GA-PSO-LSTM-camera B prediction result.

GA-PSO-LSTM-camera C prediction result.
Table 3 presents the results of evaluating the prediction performance of the neural network model, using the calculation formulas (26) to (30) for the performance index. A higher value of R2 indicates a stronger fit of the model. When the MAE, MSE, RMSE, and MAPE exhibit lesser values, it indicates a higher level of accuracy in the model. Furthermore, MSE and RMSE are more responsive to the impact of predictions, while MAE and MAPE demonstrate greater resilience to outliers.
As seen by the data presented in Table 3, the R2 index of the improved neural network intelligent model demonstrates a higher proximity to 1, indicating a superior fitting effect. In the present study, the implementation of algorithms for hyperparameter optimization, the use of adversarial networks for model creation, the incorporation of folding cross-validation, and other relevant techniques have collectively contributed to the prevention of overfitting in the model. Furthermore, the MAE,MSE, RMSE, and MAPE metrics exhibit reduced values, suggesting that the model has improved predictive accuracy and increased robustness against outliers. It is important to highlight that the upper shield tail gap (Camera B) exhibited superior predictive outcomes in both neural networks. Conversely, the left (Camera A) and right (Camera C) shield tail gaps demonstrated inadequate predictive performance. This suggests that current AI models still struggle to achieve high levels of accuracy when confronted with datasets characterized by significant fluctuations.
In summary, the connection between shield tail clearance and shield parameters and geological parameters is characterized by complexity, nonlinearity, and uncertainty. Neural network models are widely recognized as useful methods for addressing difficult issues. Moreover, these models have a broad application and may enhance prediction accuracy by leveraging larger datasets.
This research presents the introduction of a measuring instrument with high accuracy for real-time assessment of the shield tail gap. Additionally, a framework for an intelligent prediction model based on algorithm optimization using neural networks is constructed. The verification of the measurement device's accuracy is shown via a realistic case study in the field of Beijing Metro engineering. By including geological characteristics and shield parameters as input, the intelligent prediction of shield tail clearance is effectively achieved. The findings indicate that the automated measurement device, using the zero identification algorithm and the convolution algorithm, demonstrates enhanced precision in identifying the inner zero of the shell and the edge of the segment, as compared to the conventional human measurement approach. In practical construction scenarios, when comparing the data obtained from manual measurements, it is seen that the greatest absolute error is
Furthermore, a comprehensive study using PCC reveals that the angle of pitch, attitude of the shield, and articulated cylinder significantly impact the measurement and management of shield tail clearance. A significant association exists between tail clearance and shield attitude, particularly with respect to upper tail clearance and vertical attitude. This observation suggests that during the actual construction phase, it is essential to rigorously regulate the orientation of the shield in order to prevent any occurrence of “stuck” between the shield tail and the segment.
This research presents predictions using a well-established intelligent model framework and enhances the performance of the LSTM neural network by optimizing the GA and PSO algorithms. The use of generative adversarial networks and folding cross-validation has been shown to successfully mitigate the issue of overfitting in models, enhancing their resilience and facilitating more accurate predictions.
Nevertheless, this algorithm is not without limitations. For instance:
Overall, in the presence of intense environmental interference, particularly regarding the illumination requirements at the tail of the shield, there is a need for further enhancement of the anti-interference capability of the automated measuring equipment. Simultaneously, the efficacy of the intelligent prediction model is significantly contingent upon the quality and quantity of the training data. In instances where the data set exhibits significant fluctuations or contains highly intricate anomalies, the intelligent model may have challenges in effectively capturing these patterns, hence potentially compromising the accuracy of its forecast outcomes.
Footnotes
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the Natural Sciene Foundation Project for Young Scholars of Inner Mongolia Autonomous Region, (grant number 2025QN05079).
Declaration of Conflicting Interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Data Availability Statement
Some data, models, or code that support the findings of this study are available from the corresponding author on reasonable request,including (1) samples of the image data used in the experiment; and (2) related information about the object detection model and code.
