Tunnel primary support surrounding rock deformation monitoring system and method
By deploying data acquisition equipment and edge servers on the inner side wall of the initial branch surrounding rock of the tunnel, combining low-latency IoT technology and MQTT protocol, using the convolutional neural network model CNN for data preprocessing and deformation trend prediction, the existing tunnel deformation monitoring is solved. The methods have limited computing resources, long model training time, insufficient real-time performance, etc., which achieves efficient and stable data transmission and improved monitoring efficiency.
Patent Information
- Application Number
- CN202411477184.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing tunnel initial branch surrounding rock deformation monitoring methods have problems such as limited computing resources, long model training time, insufficient real-time performance, blind spots in network coverage, and signal interference, resulting in unstable data transmission and poor compatibility, which increases project complexity and cost.
By deploying data acquisition devices and edge servers, combining low-latency IoT technology and MQTT protocols, rapid data acquisition, efficient compression and real-time transmission are achieved. The convolutional neural network model CNN is used to perform data preprocessing and deformation trend prediction, and feature dimensionality reduction is performed through principal component analysis to reduce the computational complexity. When the deformation trend exceeds the set threshold, an early warning is issued immediately.
It realizes efficient and stable data transmission, improves monitoring efficiency and accuracy, reduces computing complexity, enhances the real-time and reliability of the system, and avoids the occurrence of safety accidents.
Smart Images

Figure CN119394204A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of tunnel deformation monitoring, and in particular to a system and method for monitoring deformation of primary surrounding rock of a tunnel. Background Art
[0002] The existing tunnel primary support surrounding rock deformation monitoring methods have the following main shortcomings:
[0003] (1) In practical applications, although existing monitoring methods use deep learning models for data processing, existing technologies face problems such as limited computing resources, long model training time, and insufficient real-time performance. For complex and changeable tunnel environments, the model's adaptability and robustness need to be further improved;
[0004] (2) In the process of monitoring data transmission, problems such as network coverage blind spots and signal interference inside the tunnel still affect the reliability and real-time performance of data transmission. With the increase in the number of monitoring points and the amount of data, ensuring the efficiency and stability of data transmission is also a problem to be solved;
[0005] (3) There are often compatibility issues between different types of monitoring equipment and systems, making it difficult to achieve seamless integration and collaborative work. As a result, in actual applications, a large amount of resources need to be invested in equipment selection and system debugging, which increases the complexity and cost of the project. Summary of the invention
[0006] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a tunnel primary support surrounding rock deformation monitoring system and method. In this method, by deploying data acquisition equipment and edge servers, combined with low-latency Internet of Things technology and MQTT protocol, rapid data acquisition, efficient compression and real-time transmission are achieved to ensure efficient and stable data transmission. Data acquisition equipment and edge servers are installed and deployed on the inner wall of the tunnel primary support surrounding rock. The collection frequency of the data acquisition equipment is set according to the monitoring accuracy. The data acquisition equipment collects the original data to ensure that the data coverage is comprehensive and not excessively redundant. The convolutional neural network model CNN is selected to ensure that the convolutional neural network The model CNN can accurately predict the deformation of the primary support surrounding rock of the tunnel, perform online analysis on the pre-processed data of the primary support surrounding rock deformation transmitted in real time, predict the deformation trend of the primary support surrounding rock of the tunnel, obtain trend data, extract relevant features in the trend data, apply principal component analysis to perform feature dimensionality reduction, reduce the computational complexity, and obtain a reduced dimensionality feature set. When the trend data after dimensionality reduction exceeds the set deformation threshold, an early warning message is immediately sent to the monitoring and early warning module, integrating the functions of original data collection, transmission, processing, analysis and early warning of the primary support surrounding rock deformation of the tunnel, forming a complete tunnel primary support surrounding rock deformation monitoring system, which improves the monitoring efficiency and accuracy.
[0007] The technical solution adopted by the present invention is as follows: A tunnel primary support surrounding rock deformation monitoring system provided by the present invention includes a data acquisition device, an edge server, a cloud server and a monitoring and early warning module, specifically including the following contents:
[0008] The data acquisition equipment acquires the original deformation data of the primary support surrounding rock of the tunnel;
[0009] The edge server compresses the original data to generate binary data;
[0010] The cloud server performs data preprocessing on the binary data to generate preprocessed data, and then performs real-time analysis on the training set in the preprocessed data through a convolutional neural network model CNN, predicts the deformation trend of the primary support surrounding rock of the tunnel, obtains trend data, extracts relevant features in the trend data and reduces the dimension, and generates a reduced dimension feature set;
[0011] The monitoring and early warning module monitors the dimension reduction feature set, and when the dimension reduction feature set exceeds a deformation threshold, the monitoring and early warning module responds immediately.
[0012] The present invention provides a method for monitoring deformation of primary support surrounding rock of a tunnel, which is applied to a system for monitoring deformation of primary support surrounding rock of a tunnel. The method comprises the following steps:
[0013] Step S1: Data collection: Data collection equipment and edge servers are installed and deployed on the inner wall of the tunnel primary support surrounding rock. The collection frequency of the data collection equipment is set according to the monitoring accuracy. The data collection equipment collects raw data to ensure that the data coverage is comprehensive and not excessively redundant.
[0014] Step S2: Data transmission: The original data is transmitted to the edge server in real time using a low-latency wireless method of the Internet of Things. The data transmission process is combined with the MQTT protocol. The edge server compresses the data to generate binary data, which is then uploaded to the cloud server for storage and further processing;
[0015] Step S3: Data preprocessing: First, the binary data is cleaned to remove invalid data, and the cleaned binary data is smoothed to reduce noise interference and generate preprocessed data;
[0016] Step S4: Model training and verification: Select the convolutional neural network model CNN, divide the preprocessed data into a training set and a test set, adjust the parameters of the convolutional neural network model CNN, add a regularization term to optimize the performance of the convolutional neural network model CNN, obtain the trained convolutional neural network model CNN, use the test set to evaluate the accuracy and generalization ability of the convolutional neural network model CNN, and ensure that the convolutional neural network model CNN can accurately predict the deformation of the primary support surrounding rock of the tunnel;
[0017] Step S5: Real-time analysis: Use the trained convolutional neural network model CNN to perform online analysis on the pre-processed data transmitted in real time, predict the deformation trend of the primary support rock of the tunnel, and obtain trend data;
[0018] Step S6: Feature extraction: extract relevant features from the trend data, apply principal component analysis to perform feature dimensionality reduction, reduce computational complexity, and obtain a reduced-dimensionality feature set;
[0019] Step S7: Early warning and response: When the trend data after dimensionality reduction exceeds the set deformation threshold, an early warning message is immediately sent to the monitoring early warning module.
[0020] Furthermore, step S2 specifically includes the following contents:
[0021] Step S21: Encapsulate the original data into a format suitable for network transmission;
[0022] Step S22: Select the MQTT protocol and use the data acquisition device to send the encapsulated raw data to the specified MQTT agent in the form of an MQTT message;
[0023] Step S23: the edge server acts as a subscriber of the MQTT agent, monitoring and receiving data messages from the MQTT agent;
[0024] Step S24: The edge server compresses the original data using the Zstd algorithm. First, the original data is analyzed and a dictionary is constructed. Then, the LZ77 algorithm is used to find and compress repeated data segments. After finding the repeated data segments, the Zstd algorithm performs Huffman coding on the data that cannot be directly compressed by the LZ77 algorithm. Zstd combines a large number of related data blocks together for coding. The processed original data is output as a continuous binary data segment, which includes header information and the actual compressed data portion.
[0025] Step S25: The edge server transmits the binary data to the cloud server.
[0026] Further, step S3 specifically includes the following steps:
[0027] Step S31: Data cleaning: remove invalid data from binary data, check whether there are missing values NaN, use polynomial interpolation to process missing values NaN, and use the Z-core algorithm to identify and eliminate invalid data. The formula used by the Z-core algorithm to calculate invalid data is as follows:
[0028] ;
[0029] Among them, Z is invalid data, For binary data, is the mean of binary data, is the standard deviation of binary data;
[0030] Step S32: Data smoothing: Select exponential smoothing technology to process the binary data after data cleaning, and reduce noise by giving greater weight to newer data. The formula used to calculate the smoothing value at time t is as follows:
[0031] ;
[0032] in, is the smoothed value at time t, is the smoothing constant (0< <1)、 is the actual observed value at time t, is the smoothed value at time t-1;
[0033] Step S33: Generate preprocessed data: organize the binary data after data smoothing into a format suitable for subsequent analysis and modeling.
[0034] Further, step S4 specifically includes the following steps:
[0035] Step S41: selecting a convolutional neural network model CNN, dividing the preprocessed data into a training set and a test set, and using Bayesian optimization to adjust the parameters of the convolutional neural network model CNN so that the convolutional neural network model CNN achieves a fitting effect on the training set while avoiding overfitting;
[0036] Step S42: Add L2 regularization to the convolutional neural network model CNN for model optimization. The total loss function is formed by adding the square sum of weights to the original loss function, thereby constraining the model complexity. The formula used to calculate the total loss function is as follows:
[0037] ;
[0038] in, is the total loss function, is the original loss function, is the weight vector, is the regularization coefficient, is the number of weights, is the first vectors;
[0039] Step S43: Use the test set to verify the trained convolutional neural network model CNN. First, set the error setting value. If the test error of the convolutional neural network model CNN in the test set is greater than the set value, repeat steps S41-S42 for iterative optimization. After verification, deploy the trained convolutional neural network model CNN to the cloud server.
[0040] Further, step S5 specifically includes the following steps:
[0041] Step S51: Model loading: loading the trained and verified convolutional neural network model CNN from the cloud;
[0042] Step S52: Online analysis and prediction: input the preprocessed data into the convolutional neural network model CNN to obtain the deformation prediction value as the trend data output.
[0043] Further, step S6 specifically includes the following steps:
[0044] Step S61: Select time domain features from the trend data, perform statistics on the time domain features, and use Fourier transform to transform the time domain features into frequency domain features. The formula used to calculate the frequency domain features is as follows:
[0045] ;
[0046] in, is a complex function in the frequency domain, is a complex function in the time domain, is a complex exponential function, i is an imaginary unit, and satisfies , is the angular frequency, t is the time;
[0047] Step S62: Combining the extracted frequency domain features into a feature set for output;
[0048] Step S63: Perform feature dimensionality reduction on the feature set by using principal component analysis to obtain a reduced dimensionality feature set.
[0049] As a further preferred embodiment of this solution, step S63 specifically includes the following steps:
[0050] Step S631: Find the main change direction of the feature set by calculating the covariance matrix of the feature set, and project the feature set onto the main change direction. The formula used to calculate the covariance matrix of the feature set is as follows:
[0051] ;
[0052] in, represents the covariance matrix, is the total number of data points, For the A vector of data points, is the data mean vector, is the transpose of the matrix;
[0053] Step S632: performing eigenvalue decomposition on the covariance matrix to find the largest eigenvalue and its corresponding eigenvector;
[0054] Step S633: Project the feature set onto these feature vectors to obtain a reduced-dimensional feature set.
[0055] The beneficial effects achieved by the present invention using the above scheme are as follows:
[0056] (1) In this method, data acquisition equipment and edge servers are deployed on the inner wall of the tunnel's primary surrounding rock, combined with low-latency Internet of Things technology and MQTT protocol, to achieve rapid data acquisition, efficient compression and real-time transmission. The data acquisition equipment is responsible for collecting the original deformation data of the tunnel's primary surrounding rock to ensure that the data coverage is comprehensive and not excessively redundant. The edge server compresses the original deformation data of the tunnel's primary surrounding rock and uses the Zstd algorithm to generate binary data to reduce the amount of data transmission and improve transmission efficiency. The monitoring and early warning module can monitor the deformation of the tunnel's primary surrounding rock in real time. When the deformation exceeds the safety threshold, an early warning is issued in time to effectively avoid the occurrence of safety accidents. This solves the need for regular measurements in traditional tunnel deformation monitoring methods and achieves real-time monitoring of deformation conditions.
[0057] (2) During the data transmission process, the MQTT protocol and Zstd algorithm are used to efficiently compress the original data, reducing the amount of data transmission and storage requirements while ensuring the validity and integrity of the data. This optimization enables efficient data transmission even in tunnel environments with limited bandwidth or poor network conditions;
[0058] (3) In the data preprocessing stage, data cleaning, smoothing and other preprocessing techniques are used to effectively remove noise and invalid data, improve data quality, and provide a more accurate data basis for subsequent model training. Compared with directly using the original data, the preprocessed data can significantly improve the accuracy of model prediction, solve the complex feature extraction and data analysis process of the tunnel initial support surrounding rock deformation monitoring process, reduce the amount of calculation, and enhance the real-time and accuracy of the tunnel initial support surrounding rock deformation monitoring process;
[0059] (4) During the model training and verification process, the convolutional neural network model CNN was selected, and the model parameters were adjusted through Bayesian optimization and regularization techniques, which effectively avoided the overfitting problem and improved the generalization ability and prediction accuracy of the model. This model selection and training method is more efficient than traditional statistical models or simple machine learning models, and realizes real-time monitoring and early warning of the deformation trend of the primary support rock of the tunnel;
[0060] (5) In the feature extraction stage, principal component analysis is combined with feature extraction and dimensionality reduction, which not only reduces the computational complexity of real-time monitoring of the deformation trend of the primary support surrounding rock of the tunnel, but also retains the main feature information of the data, improving the efficiency and accuracy of the early warning system. Compared with manual feature selection, automated feature extraction is more objective and ensures the accuracy and reliability of data in the tunnel environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A schematic diagram of a flow chart of a method for monitoring deformation of primary support surrounding rock of a tunnel provided by the present invention;
[0062] Figure 2 A schematic diagram of the flow of model training and verification of a tunnel primary support surrounding rock deformation monitoring method provided by the present invention;
[0063] Figure 3 A structural schematic diagram of a tunnel primary support surrounding rock deformation monitoring system provided by the present invention;
[0064] Figure 4 This is a schematic diagram of the AI monitoring device body structure provided by the present invention.
[0065] Among them, 1. AI monitoring device body, 101. monitoring camera, 102. monitoring display, 103. transmitting antenna, 104. monitoring fixture, 105. monitoring dedicated power supply, 2. mobile phone monitoring device, 3. computer monitoring device, 4. tunnel advance anchor pipe support, 5. tunnel initial steel arch frame support, 6. tunnel arch steel frame.
[0066] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0067] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0068] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.
[0069] Example 1, see Figure 1 The present invention provides a method for monitoring deformation of primary support surrounding rock of a tunnel, the method comprising the following steps:
[0070] Step S1: Data collection: Data collection equipment and edge servers are installed and deployed on the inner wall of the tunnel primary surrounding rock. According to the monitoring accuracy of 0.1 mm, the collection frequency of the data collection equipment is set to once per hour. The data collection equipment collects raw data to ensure that the data coverage is comprehensive and not excessively redundant.
[0071] Step S2: Data transmission: The original data is transmitted to the edge server in real time using a low-latency wireless method of the Internet of Things. The data transmission process is combined with the MQTT protocol. The edge server compresses the data to generate binary data, which is then uploaded to the cloud server for storage and further processing;
[0072] Step S3: Data preprocessing: First, the binary data is cleaned to remove invalid data, and the cleaned binary data is smoothed to reduce noise interference and generate preprocessed data;
[0073] Step S4: Model training and verification: Select the convolutional neural network model CNN, divide the preprocessed data into a training set and a test set, adjust the parameters of the convolutional neural network model CNN, add a regularization term to optimize the performance of the convolutional neural network model CNN, obtain the trained convolutional neural network model CNN, use the test set to evaluate the accuracy and generalization ability of the convolutional neural network model CNN, and ensure that the convolutional neural network model CNN can accurately predict the deformation of the primary support surrounding rock of the tunnel;
[0074] Step S5: Real-time analysis: Use the trained convolutional neural network model CNN to perform online analysis on the pre-processed data transmitted in real time, predict the deformation trend of the primary support rock of the tunnel, and obtain trend data;
[0075] Step S6: Feature extraction: extract relevant features from the trend data, apply principal component analysis to perform feature dimensionality reduction, reduce computational complexity, and obtain a reduced-dimensionality feature set;
[0076] Step S7: Early warning and response: When the trend data after dimensionality reduction exceeds the set deformation threshold, an early warning message is immediately sent to the monitoring and early warning module.
[0077] Embodiment 2: This embodiment is based on the above embodiment, and step S2 specifically includes the following contents:
[0078] Step S21: Encapsulate the original data into a format suitable for network transmission;
[0079] Step S22: Select the MQTT protocol and use the data acquisition device to send the encapsulated raw data to the specified MQTT agent in the form of an MQTT message;
[0080] Step S23: the edge server acts as a subscriber of the MQTT agent, monitoring and receiving data messages from the MQTT agent;
[0081] Step S24: The edge server compresses the original data using the Zstd algorithm. First, the original data is analyzed and a dictionary is constructed. Then, the LZ77 algorithm is used to find and compress repeated data segments. After finding the repeated data segments, the Zstd algorithm performs Huffman coding on the data that cannot be directly compressed by the LZ77 algorithm. Zstd combines a large number of related data blocks together for coding. The processed original data is output as a continuous binary data segment, which includes header information and the actual compressed data portion.
[0082] Step S25: the edge server transmits the binary data to the cloud server;
[0083] In this embodiment, the processing process is as follows:
[0084] Initialization settings: configure the communication parameters between the edge server and the cloud server;
[0085] The MQTT broker address (MQTT_BROKER) is set to "mqtt.example.com";
[0086] The MQTT port (MQTT_PORT) is set to 1883;
[0087] The MQTT topic (MQTT_TOPIC) is set to "sensor / data";
[0088] Set the edge server ID (EDGE_SERVER_ID) to "edge_server_1";
[0089] Prepare the data to be sent: define raw_data as "this is some raw data that needs to be transmitted";
[0090] Convert the original data into JSON format and encode it into UTF-8 for transmission. The converted data is stored in data_to_send.
[0091] Set up the MQTT client: Initialize the MQTT client and use the edge server identifier (EDGE_SERVER_ID) as the client identifier;
[0092] Define the callback function on_connect when the connection is successful. This function will print the connection result code and subscribe to the specified MQTT topic.
[0093] Define the callback function on_message when a message is received. This function will decode the received message, print the message content, and call the process_data function (which is used to process the received data);
[0094] Connect to the MQTT broker: Use the MQTT broker address and port set previously, and a timeout of 60 seconds to connect to the MQTT client;
[0095] Define a function to send data to MQTT: define a function send_data_to_mqtt, which publishes the previously prepared data_to_send data to the MQTT topic;
[0096] In this embodiment, the data processing process is as follows:
[0097] Parse the received data: define the process_data function, which first parses the JSON data in the global variable raw_data_received and converts it into a dictionary format and stores it in data_dict;
[0098] Extract the value with key "data" from data_dict and encode it into a byte string in UTF-8 format and store it in raw_data_for_compression;
[0099] Data compression: Create a zstd.ZstdCompressor instance for data compression;
[0100] Create an io.BytesIO instance as the output stream of compressed data and store it in compressed_stream;
[0101] Use the compressor's stream_writer method to convert compressed_stream into a writer and write raw_data_for_compression into that writer for compression;
[0102] Get the compressed data from compressed_stream and store it in compressed_data;
[0103] Send data to the cloud server: Import the requests library to send HTTP requests;
[0104] Set the request header and set Content-Type to 'application / octet-stream', indicating that binary data is sent;
[0105] Use the requests.post method to send the compressed data compressed_data to the cloud server endpoint CLOUD_SERVER_ENDPOINT with the set request header;
[0106] Print the response content of the cloud server;
[0107] Start the MQTT client thread and send data: Create and start the MQTT client thread: Import the threading library for multi-threaded operations;
[0108] Create a thread mqtt_thread and set the target function to the loop_forever method of the MQTT client, which will keep the client running and processing MQTT messages.
[0109] Start the mqtt_thread thread;
[0110] Send data to MQTT: Call the previously defined send_data_to_mqtt function to publish the prepared data to the MQTT topic.
[0111] Embodiment 3: This embodiment is based on the above embodiment, and step S3 specifically includes the following steps:
[0112] Step S31: Data cleaning: Remove invalid data from binary data, check for missing values NaN, use polynomial interpolation to process missing values NaN, and use the Z-core algorithm to identify and remove invalid data. The formula used by the Z-core algorithm to calculate invalid data is as follows:
[0113] ;
[0114] Among them, Z is invalid data, For binary data, is the mean of binary data, is the standard deviation of binary data;
[0115] Step S32: Data smoothing: Select exponential smoothing technology to process the cleaned data, and reduce noise by giving greater weight to newer data. The formula used to calculate the smoothing value at time t is as follows:
[0116] ;
[0117] in, is the smoothed value at time t, is the smoothing constant (0< <1)、 is the actual observed value at time t, is the smoothed value at time t-1;
[0118] Step S33: Generate preprocessed data: organize the data after data smoothing into a format suitable for subsequent analysis and modeling;
[0119] In this embodiment, the data smoothing process selects exponential smoothing process, and the processing process is as follows:
[0120] Exponential smoothing algorithm: Initialization: Define a function called exponential_smoothing, which receives a time series data series and a smoothing coefficient alpha (0.5) as input;
[0121] Create an empty list smooth_values to store the smoothed values;
[0122] Get the first value first_val of the time series data and add it to the smooth_values list;
[0123] Calculate the smoothed value: loop through each time point in the time series data (starting from the second time point), using the loop variable t;
[0124] For each time point, calculate the smoothed value smooth_val; the calculation method is: the value at the current time point multiplied by the smoothing coefficient alpha, plus the previous smoothed value multiplied by (1 - alpha);
[0125] Add the calculated smooth value smooth_val to the smooth_values list;
[0126] Return result: Convert the smooth_values list to a pd.Series object whose index is the same as the original time series data; return this new pd.Series object, which contains the smoothed time series data;
[0127] Apply the exponential smoothing algorithm: define a DataFrame named df_cleaned, which contains the time series data to be smoothed;
[0128] Use the apply method to apply the exponential_smoothing function to each row of df_cleanedDataFrame (axis=0), thus obtaining a new DataFrame df_smoothed; this new DataFrame contains the result of exponential smoothing for each row of time series data in the original DataFrame;
[0129] The data after data cleaning and data smoothing are organized into CSV files for subsequent use.
[0130] Embodiment 4: This embodiment is based on the above embodiment. Figure 2 As shown, step S4 specifically includes the following steps:
[0131] Step S41: selecting a convolutional neural network model CNN, dividing the preprocessed data into a training set and a test set, and using Bayesian optimization to adjust the parameters of the convolutional neural network model CNN so that the convolutional neural network model CNN achieves a fitting effect on the training set while avoiding overfitting;
[0132] Step S42: Add L2 regularization to the convolutional neural network model CNN, and the formula used to calculate the total loss function is as follows:
[0133] ;
[0134] in, is the total loss function, is the original loss function, is the weight vector, is the regularization coefficient, is the number of weights, is the first vectors;
[0135] Step S43: Use the test set to verify the trained convolutional neural network model CNN. First, set the error setting value. If the test error of the convolutional neural network model CNN in the test set is greater than the setting value, repeat steps S41-S42 for iterative optimization. After verification, deploy the trained convolutional neural network model CNN to the cloud server.
[0136] In this embodiment, the test set is used to verify the convolutional neural network model CNN and iteratively optimize, and the processing process is as follows:
[0137] Model evaluation mode: Set the convolutional neural network model to evaluation mode, which is usually achieved by calling the model's eval() method; in evaluation mode, the model will turn off training-specific operations such as dropout and batch normalization;
[0138] Create a test data loader: Use the DataLoader class to create a test data loader test_loader; this loader will load data from TensorDataset(X_test, y_test), where X_test is the feature data of the test set and y_test is the corresponding label data;
[0139] Set the batch_size parameter of the loader to the best batch size best_params['batch_size'] found previously through grid search;
[0140] Set the shuffle parameter to False, because it is usually not necessary to shuffle the data order during the testing phase;
[0141] Initialize test loss and correct prediction count: Initialize a variable test_loss to 0 to accumulate the total loss on the test set; initialize a variable correct to 0 to count the number of correct predictions made by the model;
[0142] Use gradient calculation and traverse the test data: Use the torch.no_grad() context manager to disable gradient calculation, because backpropagation is not needed during the test phase;
[0143] Iterate over each batch of data (inputs, labels) in the test data loader test_loader;
[0144] Model forward propagation and prediction: pass the current batch of input data inputs to the model to get output outputs;
[0145] Use torch.max(outputs.data, 1) to find the maximum index of each sample in the output, that is, the model's predicted result predicted;
[0146] Calculate loss and update count: Calculate the loss of the current batch of data using the predefined loss function criterion and add it to test_loss; Calculate the number of correct predictions made by the model in the current batch and add it to correct; This is achieved by comparing the predicted results predicted and the true labels labels to see if they are equal and summing the equal cases;
[0147] Calculate the average test loss and accuracy: Calculate the average test loss on the entire test set, that is, divide test_loss by the total number of samples in the test set (len(test_loader.dataset)); calculate the accuracy of the model, that is, divide the number of correct predictions correct by the total number of samples in the test set and multiply by 100 to get the percentage form;
[0148] Save the best model: If the calculated accuracy is lower than the preset accuracy threshold DESIRED_ACCURACY_THRESHOLD, save the state dictionary of the current model to the file 'best_cnn_model.pth'; this usually means that we want to keep a better performing model version until we achieve a higher accuracy.
[0149] Embodiment 5: This embodiment is based on the above embodiment, step S6 specifically includes the following steps:
[0150] Step S61: Select time domain features from the trend data, perform statistics on the time domain, and use Fourier transform to transform the time domain features into frequency domain features. The formula used to calculate the frequency domain features is as follows:
[0151] ;
[0152] in, is a complex function in the frequency domain, is a complex function in the time domain, is a complex exponential function, i is an imaginary unit, and satisfies , is the angular frequency, t is the time;
[0153] Step S62: Combining the extracted spectrum features into a feature set for output;
[0154] Step S63: performing feature dimensionality reduction on the feature set by using principal component analysis to obtain a reduced dimensionality feature set;
[0155] In this embodiment, the processing process is as follows:
[0156] Feature extraction and principal component analysis (PCA) dimensionality reduction:
[0157] Import necessary libraries: Import the NumPy library for arrays and mathematical operations;
[0158] Import the PCA class from the scikit-learn library for principal component analysis;
[0159] Import the fft function from the SciPy library to perform Fast Fourier Transform (FFT).
[0160] Generate time series data: Use the np.linspace function to generate an arithmetic sequence t as the time axis, ranging from 0 to 1, with a total of 500 points;
[0161] Create a time series data data, which is a 5Hz sine wave signal plus Gaussian noise with a mean of 0 and a standard deviation of 0.5;
[0162] Calculate the statistical characteristics of the data: calculate the mean value mean_value of the data data;
[0163] Calculate the standard deviation std_value of data data;
[0164] Calculate the variance variance_value of data data;
[0165] Perform fast Fourier transform (FFT): Use the fft function to perform FFT on the data data and get the FFT result fft_result;
[0166] Calculate the absolute value fft_magnitudes of the FFT result, which represents the amplitude of each frequency component;
[0167] Select FFT features: Select the first N (here N=10) elements of the FFT amplitude as features, i.e. selected_fft_features;
[0168] Construct feature set: combine mean, standard deviation, variance and selected FFT features into a new feature set feature_set;
[0169] Reshape feature_set into a two-dimensional array for subsequent PCA processing;
[0170] Print feature set: print out the constructed feature set feature_set;
[0171] Perform principal component analysis (PCA): create a PCA object pca and set the number of principal components to 2;
[0172] Use the fit_transform method to perform PCA dimensionality reduction on the feature set feature_set to obtain the reduced feature set reduced_feature_set;
[0173] Print the feature set after dimensionality reduction: Print the feature set reduced_feature_set after dimensionality reduction.
[0174] Embodiment six, as Figure 3-Figure 4 As shown, a tunnel primary support surrounding rock deformation monitoring system provided by the present invention includes a data acquisition device, an edge server, a cloud server and a monitoring and early warning module, which specifically includes the following contents:
[0175] The data acquisition device collects the original data of the deformation of the primary surrounding rock of the tunnel. In this embodiment, the data acquisition device includes an AI monitor device body 1, and the AI monitor device body 1 includes a monitor camera 101, a monitor display 102, a transmitting antenna 103, a monitor fixing device 104 and a monitoring-specific power supply 105. The monitor camera 101 is located at the center of the AI monitor device body 1, the monitor display 102 is located above the monitor camera 101, the transmitting antenna 103 is located at the top of the monitor display 102, the monitor fixing device 104 is located on the side of the transmitting antenna 103, and the monitoring-specific power supply 105 is fixedly connected to the monitor fixing device 104;
[0176] The edge server compresses the original data to generate binary data;
[0177] The cloud server performs data preprocessing on the binary data to generate preprocessed data, and then performs real-time analysis on the training set in the preprocessed data through a convolutional neural network model CNN, predicts the deformation trend of the primary support surrounding rock of the tunnel, obtains trend data, extracts relevant features in the trend data and reduces the dimension, and generates a reduced dimension feature set;
[0178] The monitoring and early warning module monitors the dimension reduction feature set. If the dimension reduction feature set exceeds the deformation threshold, the monitoring and early warning module responds immediately. In this embodiment, the monitoring and early warning module includes a mobile phone monitoring device 2 and a computer monitoring device 3;
[0179] In this embodiment, a tunnel initial support surrounding rock deformation monitoring system also includes a tunnel advance anchor pipe support 4, a tunnel initial steel arch frame support 5 and a tunnel arch steel frame 6. The AI monitoring device body 1 is fixedly installed at the center of the arch within 50m from the tunnel excavation face. The AI monitoring device body 1 emits monitoring camera infrared rays to monitor the deformation of the tunnel advance anchor pipe support 4, the tunnel initial steel arch frame support 5, and the tunnel arch steel frame 6, and transmits the monitoring data to the edge server and the cloud server for processing, and then transmits it to the mobile phone monitoring device 2 and the computer monitoring device 3.
[0180] The present invention and its embodiments are described above, which is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it and design structural methods and embodiments similar to the technical solution without creativity without departing from the purpose of the invention, they should all fall within the protection scope of the present invention.
Claims
1. A method for monitoring deformation of primary support surrounding rock of a tunnel, applied to a system for monitoring deformation of primary support surrounding rock of a tunnel, the system comprising a data acquisition device, an edge server, a cloud server and a monitoring and early warning module, characterized in that: The method comprises the following steps: Step S1: Data collection: Data collection equipment and edge servers are installed and deployed on the inner wall of the primary surrounding rock of the tunnel, and the collection frequency of the data collection equipment is set according to the monitoring accuracy. The data collection equipment collects raw data; Step S2: Data transmission: The original data is transmitted to the edge server in real time using a low-latency IoT method. The data transmission process is combined with the MQTT protocol. The edge server compresses the data to generate binary data, which is then uploaded to the cloud server for storage and further processing; Step S3: Data preprocessing: Clean the binary data on the cloud server to remove invalid data, and perform data smoothing on the cleaned binary data to generate preprocessed data; Step S4: model training and verification: select a convolutional neural network model CNN, adjust the parameters of the convolutional neural network model CNN, add a regularization term to optimize the performance of the convolutional neural network model CNN, and obtain a trained convolutional neural network model CNN; Step S5: Real-time analysis: Use the trained convolutional neural network model CNN to perform online analysis on the pre-processed data transmitted in real time, predict the deformation trend of the primary support rock of the tunnel, and obtain trend data; Step S6: Feature extraction: extract relevant features from the trend data, apply principal component analysis to perform feature dimensionality reduction, reduce computational complexity, and obtain a reduced-dimensionality feature set; Step S7: Early warning and response: When the dimension reduction feature set exceeds the set deformation threshold, an early warning message is immediately sent to the monitoring early warning module.
2. A method for monitoring deformation of primary support rock of a tunnel according to claim 1, characterized in that: Step S4 specifically includes the following steps: Step S41: selecting a convolutional neural network model CNN, dividing the preprocessed data into a training set and a test set, and using Bayesian optimization to adjust the parameters of the convolutional neural network model CNN so that the convolutional neural network model CNN achieves a fitting effect on the training set while avoiding overfitting; Step S42: Add L2 regularization to the convolutional neural network model CNN for model optimization. The total loss function is formed by adding the square sum of weights to the original loss function, thereby constraining the model complexity. The formula used to calculate the total loss function is as follows: ; in, is the total loss function, is the original loss function, is the weight vector, is the regularization coefficient, is the number of weights, is the first vectors; Step S43: Use the test set to verify the trained convolutional neural network model CNN. First, set the error setting value. If the test error of the convolutional neural network model CNN in the test set is greater than the error setting value, repeat steps S41-S42 for iterative optimization. After verification, deploy the trained convolutional neural network model CNN to the cloud server.
3. A method for monitoring deformation of primary support rock of a tunnel according to claim 1, characterized in that: Step S6 specifically includes the following steps: Step S61: Select time domain features from the trend data, perform statistics on the time domain features, and use Fourier transform to transform the time domain features into frequency domain features. The formula used to calculate the frequency domain features is as follows: ; in, is a complex function in the frequency domain, is a complex function in the time domain, is a complex exponential function, i is an imaginary unit, and satisfies , is the angular frequency, t is the time; Step S62: Combining the extracted frequency domain features into a feature set for output; Step S63: Perform feature dimensionality reduction on the feature set by using principal component analysis to obtain a reduced dimensionality feature set.
4. A method for monitoring deformation of primary support rock of a tunnel according to claim 3, characterized in that: Step S63 specifically includes the following steps: Step S631: Find the main change direction of the feature set by calculating the covariance matrix of the feature set, and project the feature set onto the main change direction. The formula used to calculate the covariance matrix of the feature set is as follows: ; in, represents the covariance matrix, is the total number of data points, For the A vector of data points, is the data mean vector, is the transpose of the matrix; Step S632: performing eigenvalue decomposition on the covariance matrix to find the largest eigenvalue and its corresponding eigenvector; Step S633: Project the feature set onto these feature vectors to obtain a reduced-dimensional feature set.
5. A method for monitoring deformation of primary surrounding rock of a tunnel according to claim 1, characterized in that: Step S3 specifically includes the following contents: Step S31: Data cleaning: remove invalid data from binary data, check whether there are missing values NaN, use polynomial interpolation to process missing values NaN, and use the Z-core algorithm to identify and eliminate invalid data. The formula used by the Z-core algorithm to calculate invalid data is as follows: ; Among them, Z is invalid data, For binary data, is the mean of binary data, is the standard deviation of binary data; Step S32: Data smoothing: Select exponential smoothing technology to process the binary data after data cleaning, and reduce noise by giving greater weight to newer data. The formula used to calculate the smoothing value at time t is as follows: ; in, is the smoothed value at time t, is the smoothing constant (0< <1)、 is the actual observed value at time t, is the smoothed value at time t-1; Step S33: Generate preprocessed data: organize the binary data after data smoothing into a format suitable for subsequent analysis and modeling.
Citation Information
Patent Citations
Tunnel surrounding rock grade intelligent determination method based on VGG convolutional neural network
CN113112447A
Deformation monitoring method and system suitable for mine laneway
CN115792949A
Monitoring and early warning method and system for mining subsidence deformation of mining area
CN116659410A
Tunnel surrounding rock deformation prediction method based on high-precision sensor and Transform
CN116817777A
Remote prediction method and system for residual life of power equipment based on state health information
CN117609716A
Cited By
Deformation monitoring method and system
CN119935064A