Tunnel electromechanical device intelligent detection and automatic calibration method based on computer vision
By combining an autoencoder with a whale optimization algorithm, high-precision attitude recognition and automatic calibration of tunnel electromechanical devices are achieved, solving the problems of insufficient detection accuracy and inability to close the loop in calibration control in existing technologies, and improving the system's intelligence level and response efficiency.
Patent Information
- Application Number
- CN202510995358.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies for the detection and calibration of tunnel electromechanical devices suffer from low detection accuracy, slow response speed, strong reliance on manual experience, difficulty in achieving standardized management, and lack of intelligent calibration mechanisms. In particular, the models have poor robustness in complex environments, making it impossible to achieve automatic adjustment and closed-loop control of equipment attitude.
An image reconstruction feature extraction using an autoencoder and a structural parameter adaptive tuning mechanism using a whale optimization algorithm are employed to construct a closed-loop system for image perception and motion calibration. The autoencoder model extracts the device's posture features, and the whale optimization algorithm optimizes the model parameters to generate posture calibration control commands that drive the actuators to perform automatic calibration.
It achieves high-precision equipment posture recognition and automatic calibration, forming a closed-loop control process, which improves detection accuracy and system robustness. It is suitable for intelligent detection and calibration of electromechanical devices in complex tunnel environments, reduces operation and maintenance costs and time, and improves the system's intelligence level and response efficiency.
Smart Images

Figure CN120876608A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent optimization control and electromechanical equipment testing technology, and in particular to a method for intelligent testing and automatic calibration of tunnel electromechanical devices based on computer vision. Background Technology
[0002] In the construction and operation of current tunnel projects, numerous electromechanical devices are widely used in key subsystems such as ventilation, lighting, monitoring, and fire protection. Their operational status directly affects tunnel safety and environmental quality. Traditional methods for detecting and calibrating tunnel electromechanical devices mainly rely on manual inspections and periodic maintenance. Workers use manual observation, measuring tools, or portable terminals to visually inspect and adjust the position and orientation of the equipment. However, these methods have many limitations, such as low detection accuracy, slow response speed, high operating costs, strong reliance on manual experience, and difficulty in achieving standardized management. Especially in tunnel environments with high-frequency equipment vibration, long-term operation, and frequent emergencies, problems such as equipment installation misalignment, tilting, and parameter drift can easily occur, leading to a decline in system functionality and even operational risks.
[0003] In recent years, computer vision-based target detection and recognition technologies have been gradually applied to infrastructure monitoring. These technologies use cameras to perceive the status of critical equipment and deep learning models for target recognition, location analysis, and anomaly detection, partially replacing traditional manual inspection processes. However, existing methods largely rely on fixed-structure deep neural network models, lacking the ability to adaptively adjust to specific equipment features. This results in poor robustness in recognizing complex background interference, lighting changes, or irregularly shaped equipment. Furthermore, image recognition remains at the detection level, failing to form a closed loop with attitude calibration, thus hindering automatic adjustment and closed-loop control of equipment offset states. In addition, existing control strategies often employ static control parameter configurations, unable to dynamically generate optimal calibration actions based on different attitude errors and equipment responses, thus limiting the path to intelligent equipment operation and maintenance.
[0004] To address the aforementioned issues, this invention proposes an intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision. It integrates the image reconstruction feature extraction capability of an autoencoder with the adaptive optimization mechanism of the whale optimization algorithm to achieve high-precision identification and difference detection of device status. Simultaneously, through a difference-driven attitude adjustment control method, a closed-loop system for image perception and motion calibration is constructed, overcoming the technical shortcomings of existing technologies such as insufficient detection accuracy, poor model generalization ability, and lack of intelligent calibration mechanisms.
[0005] Therefore, how to provide intelligent detection and automatic calibration methods for tunnel electromechanical devices based on computer vision is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose a computer vision-based intelligent detection and automatic calibration method for tunnel electromechanical devices. This invention fully integrates the image reconstruction and feature extraction capabilities of autoencoders, as well as the structure and adaptive adjustment mechanism of the whale optimization algorithm. It describes in detail the closed-loop control process for realizing attitude recognition, deviation extraction and intelligent calibration of electromechanical devices in complex tunnel scenarios, and has the advantages of high detection accuracy, high degree of automation of attitude adjustment and strong system robustness.
[0007] The intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision according to an embodiment of the present invention includes the following steps:
[0008] S1. Collect image data of electromechanical devices inside the tunnel, preprocess the image data, and generate a standardized image dataset;
[0009] S2. Construct an autoencoder model. The autoencoder model consists of two parts: an encoder and a decoder. The encoder is used to extract the latent feature representation of the normalized image, and the decoder is used to restore the latent features to reconstruct the original image.
[0010] S3. The whale optimization algorithm is used to jointly optimize the structural parameters and training parameters of the autoencoder model. Each whale individual is encoded as a set of parameter combinations. The population is iterated through the shrinking encirclement mechanism and spiral update mechanism of the whale optimization algorithm, and the optimal parameter combination that minimizes the reconstruction error is output.
[0011] S4. Use the whale-optimized autoencoder model to extract and reconstruct features from the target image, calculate the pixel difference distribution between the original image and the reconstructed image, determine the current attitude state of the device, and extract attitude deviation information.
[0012] S5. Based on the attitude deviation information, control commands are generated to drive the intelligent actuator of the electromechanical device to perform automatic attitude calibration.
[0013] S6. Acquire the image of the calibrated electromechanical device and re-input it into the whale-optimized autoencoder model for detection. If there is still an attitude deviation, repeat steps S5 to S7 until the error is lower than the set threshold to achieve closed-loop adaptive calibration control.
[0014] Optionally, the image data specifically includes the structural outline, position and orientation, surface condition, and installation background information of the electromechanical device in the tunnel environment.
[0015] Optionally, the preprocessing of the image data specifically includes noise reduction, brightness equalization, distortion correction, and image normalization operations.
[0016] Optionally, S2 specifically includes:
[0017] S21. Assume the input image data is in tensor form. Where h represents the image height, w represents the image width, and c represents the number of image channels;
[0018] S22. Input the input image X into the encoder module. The encoder consists of n fully connected layers, and the output of each layer is:
[0019] Z i =σ(W i Z i-1 +b i ), i = 1, 2, ..., n;
[0020] Where Z0 = flatten(X), Let be the weight matrix of the i-th layer. Here, σ is the bias term, d is the activation function, and d is the activation term. i This represents the number of neurons in the i-th layer, and the final output is the latent representation vector Z. n ;
[0021] S23. Transform the latent representation vector Z... n The input is fed into the decoder module. The decoder has a symmetrical structure, consisting of n fully connected layers. The output of each layer is:
[0022]
[0023] in The final output is a reconstructed image vector. Then, the image is restored to its original format using the reshape operation.
[0024] S24. Calculate the image reconstruction error:
[0025]
[0026] Where L rec This represents the mean squared error of image reconstruction, used as the fitness function value in the whale optimization algorithm.
[0027] Optionally, S3 specifically includes:
[0028] S31. Let the size of the whale population be N, and the size of each individual in the population be W. j A combination of an autoencoder structure and training parameters is defined as follows:
[0029] W j =[d1,d2,...,d n ,η,λ,θ1,θ2],j=1,2,...,N
[0030] Where d iθ1 represents the number of nodes in the i-th layer of the encoder, η represents the learning rate, λ represents the regularization coefficient, θ1 is the activation function number, and θ2 is the Dropout ratio.
[0031] S32. Initialize the location of the whale population and generate N initial solutions W. j Calculate the fitness value for each individual. The fitness function is defined as:
[0032] f(W j ) = L rec (W j )+α·R(W j );
[0033] Where L rec (W j ) indicates the use of individual W j The reconstruction error of the corresponding autoencoder structure on the training data, R(W) j ) represents the parameter redundancy penalty term, and α is the regularization weight coefficient;
[0034] S33. In each iteration, based on the current optimal solution W * With the current individual W j Based on the relationship, the individual position is updated using the encirclement mechanism and spiral update mechanism of the whale optimization algorithm. The update formula is as follows:
[0035]
[0036] Where A = 2a·ra, C = 2·r, a is a linearly decreasing coefficient, r∈[0,1] is a random number, and W rand This refers to a randomly selected individual in a population.
[0037] S34. After each iteration update, calculate the new fitness value and select the current optimal solution W. * (t+1), when the number of iterations reaches the set upper limit T or the change in optimal fitness is less than the convergence threshold, the optimal parameter combination W is output. * And as the final autoencoder model structure configuration.
[0038] Optionally, S4 specifically includes:
[0039] S41. Standardize the image data of tunnel electromechanical equipment. Input the optimal autoencoder model obtained by the whale optimization algorithm to obtain its latent feature representation vector Z. n and reconstructed image
[0040] S42. Calculate the pixel-level error matrix between the input image and the reconstructed image. The positional error of each pixel is defined as:
[0041]
[0042] Where i∈[1,h],j∈[1,w],k∈[1,c], is used to reflect the degree of reconstruction distortion at that position;
[0043] S43. Construct a heatmap based on the error matrix E, locate target regions in high-error areas of the image, and extract the device boundary contour region through morphological analysis.
[0044] S44, For region R d The edge features in the image are fitted with the minimum bounding rectangle to obtain the coordinates of the center point (x) of the current pose contour rectangle of the device. t ,y t ), horizontal projection angle θ t Equipment boundary length l t Width w t ;
[0045] S45. Transfer the currently detected attitude parameters (x) t ,y t ,θ t The attitude deviation is calculated by comparing it with the initial installation reference parameters (x0, y0, θ0):
[0046] Δx=x t -x0,Δy=y t -y0,Δθ=θ t -θ0;
[0047] S46. Output attitude deviation information [Δx, Δy, Δθ], which is used for the generation of subsequent calibration control commands.
[0048] Optionally, S5 specifically includes:
[0049] S51. Represent the attitude deviation information as a triple ΔP = [Δx, Δy, Δθ], where Δx is the offset of the device center point in the horizontal direction, Δy is the offset in the vertical direction, and Δθ is the attitude rotation angle deviation.
[0050] S52. Apply the proportional adjustment function f to the attitude deviation ΔP. c The resulting adjustment amount C = [δ] x ,δ y ,δ θ ]:
[0051] δ x =K x ·Δx,δ y =K y ·Δy,δθ =K θ ·Δθ;
[0052] Where K x ,K y ,K θ The adjustment gain coefficient set for the system is used to control the adjustment speed and step size;
[0053] S53. Construct a control instruction set U = {u1, u2, u3}, whose corresponding instructions are defined as follows:
[0054] u1: Drives the electromechanical device to move δ along the horizontal axis x Unit length;
[0055] u2: Drives the electromechanical device to move δ along the vertical axis y Unit length;
[0056] u3: Rotation δ around the reference axis θ Angle-based attitude calibration;
[0057] S54. Send the control command set U to the intelligent actuator connected to the electromechanical device. The actuator includes a stepper motor, servo motor, linear drive assembly or multi-axis rotary platform to complete the mechanical movement adjustment of the equipment position and attitude.
[0058] S55. After completing the instruction execution, update the current physical state of the device and enter the image re-acquisition and secondary detection process to verify the attitude calibration effect.
[0059] Optionally, S6 specifically includes:
[0060] S61. After executing the attitude adjustment command set U = {u1, u2, u3}, acquire the calibrated electromechanical device image. The image is input into the whale-optimized autoencoder model to obtain the reconstructed image. With latent feature vectors
[0061] S62. Calculate the reconstruction error matrix E of the calibrated image. (t+1) (i,j) and mean reconstruction error:
[0062]
[0063] S63, Based on the image error matrix E (t+1) Extract new attitude parameters (x) t+1 ,y t+1 ,θ t+1 And calculate the attitude deviation:
[0064] Δx t+1 =x t+1-x0,Δy t+1 =y t+1 -y0,Δθ t+1 =θ t+1 -θ0;
[0065] S64. Determine whether the current deviation meets the calibration termination condition:
[0066] |Δx t+1 |≤∈ x ,|Δy t+1 |≤∈ y ,|Δθ t+1 |≤∈ θ ;
[0067] Where ∈ x ,∈ y ,∈ θ This is the preset attitude error tolerance threshold;
[0068] S65. If the above conditions are not met, then based on [Δx] t+1 ,Δy t+1 ,Δθ t+1 Update adjustment amount C (t+1) Generate a new control instruction set U (t+1) Repeat steps S51 to S65;
[0069] S66. If the conditions are met, the calibration process is terminated, and the device attitude closed-loop adaptive correction is completed.
[0070] The beneficial effects of this invention are:
[0071] The intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision proposed in this invention effectively solves the problems of low detection accuracy, weak model generalization ability, and inability to close the loop in calibration control in existing technologies. This invention employs the whale optimization algorithm to jointly optimize the structural and training parameters of the autoencoder model, enabling the model to automatically adapt the network structure according to different tunnel environments, lighting conditions, and device shapes, thereby improving the accuracy of extracting the target device's posture features and the quality of image reconstruction. Simultaneously, posture difference analysis is performed using the reconstruction error matrix, and the offset and rotation angle of the device are accurately obtained through difference calculation, achieving non-contact, high-precision posture deviation recognition.
[0072] Furthermore, by combining attitude deviation measurements to generate control commands and drive the actuators to complete automatic calibration, a closed-loop logic is formed in the detection-analysis-calibration process, enabling adaptive adjustments of the equipment without manual intervention. The calibrated image is then fed back into the detection module, and a preset threshold is used to determine whether the control command should continue, ensuring the stability and accuracy of the calibration results. This method is particularly suitable for high-frequency monitoring and dynamic maintenance of electromechanical devices such as lights, fans, and cameras within tunnels, significantly improving the system's intelligence and response efficiency.
[0073] In summary, this invention achieves high-precision visual detection and intelligent control calibration of electromechanical equipment attitude status while maintaining a simple system structure. It has comprehensive advantages such as low deployment cost, convenient maintenance, fast control response and strong operational reliability, and has good engineering application prospects and promotion value. Attached Figure Description
[0074] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0075] Figure 1 This is a flowchart of the intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision proposed in this invention;
[0076] Figure 2 This is an optimization iterative flowchart of the whale optimization algorithm for jointly optimizing the autoencoder parameters in the intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision proposed in this invention. Detailed Implementation
[0077] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0078] refer to Figure 1 and Figure 2 A computer vision-based intelligent detection and automatic calibration method for tunnel electromechanical devices includes the following steps:
[0079] S1. Collect image data of electromechanical devices inside the tunnel, preprocess the image data, and generate a standardized image dataset;
[0080] S2. Construct an autoencoder model. The autoencoder model consists of two parts: an encoder and a decoder. The encoder is used to extract the latent feature representation of the normalized image, and the decoder is used to restore the latent features to reconstruct the original image.
[0081] S3. The whale optimization algorithm is used to jointly optimize the structural parameters and training parameters of the autoencoder model. Each whale individual is encoded as a set of parameter combinations. The population is iterated through the shrinking encirclement mechanism and spiral update mechanism of the whale optimization algorithm, and the optimal parameter combination that minimizes the reconstruction error is output.
[0082] S4. Use the whale-optimized autoencoder model to extract and reconstruct features from the target image, calculate the pixel difference distribution between the original image and the reconstructed image, determine the current attitude state of the device, and extract attitude deviation information.
[0083] S5. Based on the attitude deviation information, control commands are generated to drive the intelligent actuator of the electromechanical device to perform automatic attitude calibration.
[0084] S6. Acquire the image of the calibrated electromechanical device and re-input it into the whale-optimized autoencoder model for detection. If there is still an attitude deviation, repeat steps S5 to S7 until the error is lower than the set threshold to achieve closed-loop adaptive calibration control.
[0085] In this embodiment, the image data specifically includes the structural outline, position and orientation, surface condition, and installation background information of the electromechanical device in the tunnel environment.
[0086] In this embodiment, the preprocessing of image data specifically includes noise reduction, brightness equalization, distortion correction, and image normalization operations.
[0087] In this embodiment, S2 specifically includes:
[0088] S21. Assume the input image data is in tensor form. Where h represents the image height, w represents the image width, and c represents the number of image channels;
[0089] S22. Input the input image X into the encoder module. The encoder consists of n fully connected layers, and the output of each layer is:
[0090] Z i =σ(W i Z i-1 +b i ), i = 1, 2, ..., n;
[0091] Where Z0 = flatten(X), Let be the weight matrix of the i-th layer. Here, σ is the bias term, d is the activation function, and d is the activation term. i This represents the number of neurons in the i-th layer, and the final output is the latent representation vector Z. n ;
[0092] S23. Transform the latent representation vector Z...n The input is fed into the decoder module. The decoder has a symmetrical structure, consisting of n fully connected layers. The output of each layer is:
[0093]
[0094] in The final output is a reconstructed image vector. Then, the image is restored to its original format using the reshape operation.
[0095] S24. Calculate the image reconstruction error:
[0096]
[0097] Where L rec This represents the mean squared error of image reconstruction, used as the fitness function value in the whale optimization algorithm.
[0098] In this embodiment, S3 specifically includes:
[0099] S31. Let the size of the whale population be N, and the size of each individual in the population be W. j A combination of an autoencoder structure and training parameters is defined as follows:
[0100] W j =[d1,d2,...,d n ,η,λ,θ1,θ2],j=1,2,...,N
[0101] Where d i θ1 represents the number of nodes in the i-th layer of the encoder, η represents the learning rate, λ represents the regularization coefficient, θ1 is the activation function number, and θ2 is the Dropout ratio.
[0102] S32. Initialize the location of the whale population and generate N initial solutions W. j Calculate the fitness value for each individual. The fitness function is defined as:
[0103] f(W j ) = L rec (W j )+α·R(W j );
[0104] Where L rec (W j ) indicates the use of individual W j The reconstruction error of the corresponding autoencoder structure on the training data, R(W) j ) represents the parameter redundancy penalty term, and α is the regularization weight coefficient;
[0105] S33. In each iteration, based on the current optimal solution W *With the current individual W j Based on the relationship, the individual position is updated using the encirclement mechanism and spiral update mechanism of the whale optimization algorithm. The update formula is as follows:
[0106]
[0107] Where A = 2a·ra, C = 2·r, a is a linearly decreasing coefficient, r∈[0,1] is a random number, and W rand This refers to a randomly selected individual in a population.
[0108] S34. After each iteration update, calculate the new fitness value and select the current optimal solution W. * (t+1), when the number of iterations reaches the set upper limit T or the change in optimal fitness is less than the convergence threshold, the optimal parameter combination W is output. * And as the final autoencoder model structure configuration.
[0109] In this embodiment, S4 specifically includes:
[0110] S41. Standardize the image data of tunnel electromechanical equipment. Input the optimal autoencoder model obtained by the whale optimization algorithm to obtain its latent feature representation vector Z. n and reconstructed image
[0111] S42. Calculate the pixel-level error matrix between the input image and the reconstructed image. The positional error of each pixel is defined as:
[0112]
[0113] Where i∈[1,h],j∈[1,w],k∈[1,c], is used to reflect the degree of reconstruction distortion at that position;
[0114] S43. Construct a heatmap based on the error matrix E, locate target regions in high-error areas of the image, and extract the device boundary contour region through morphological analysis.
[0115] S44, For region R d The edge features in the image are fitted with the minimum bounding rectangle to obtain the coordinates of the center point (x) of the current pose contour rectangle of the device. t ,y t ), horizontal projection angle θ t Equipment boundary length l t Width w t ;
[0116] S45. Transfer the currently detected attitude parameters (x) t ,yt ,θ t The attitude deviation is calculated by comparing it with the initial installation reference parameters (x0, y0, θ0):
[0117] Δx=x t -x0,Δy=y t -y0,Δθ=θ t -θ0;
[0118] S46. Output attitude deviation information [Δx, Δy, Δθ], which is used for the generation of subsequent calibration control commands.
[0119] In this embodiment, S5 specifically includes:
[0120] S51. Represent the attitude deviation information as a triple ΔP = [Δx, Δy, Δθ], where Δx is the offset of the device center point in the horizontal direction, Δy is the offset in the vertical direction, and Δθ is the attitude rotation angle deviation.
[0121] S52. Apply the proportional adjustment function f to the attitude deviation ΔP. c The resulting adjustment amount C = [δ] x ,δ y ,δ θ ]:
[0122] δ x =K x ·Δx,δ y =K y ·Δy,δ θ =K θ ·Δθ;
[0123] Where K x ,K y ,K θ The adjustment gain coefficient set for the system is used to control the adjustment speed and step size;
[0124] S53. Construct a control instruction set U = {u1, u2, u3}, whose corresponding instructions are defined as follows:
[0125] u1: Drives the electromechanical device to move δ along the horizontal axis x Unit length;
[0126] u2: Drives the electromechanical device to move δ along the vertical axis y Unit length;
[0127] u3: Rotation δ around the reference axis θ Angle-based attitude calibration;
[0128] S54. Send the control command set U to the intelligent actuator connected to the electromechanical device. The actuator includes a stepper motor, servo motor, linear drive assembly or multi-axis rotary platform to complete the mechanical movement adjustment of the equipment position and attitude.
[0129] S55. After completing the instruction execution, update the current physical state of the device and enter the image re-acquisition and secondary detection process to verify the attitude calibration effect.
[0130] In this embodiment, S6 specifically includes:
[0131] S61. After executing the attitude adjustment command set U = {u1, u2, u3}, acquire the calibrated electromechanical device image. The image is input into the whale-optimized autoencoder model to obtain the reconstructed image. With latent feature vectors
[0132] S62. Calculate the reconstruction error matrix E of the calibrated image. (t+1) (i,j) and mean reconstruction error:
[0133]
[0134] S63, Based on the image error matrix E (t+1) Extract new attitude parameters (x) t+1 ,y t+1 ,θ t+1 And calculate the attitude deviation:
[0135] Δx t+1 =x t+1 -x0,Δy t+1 =y t+1 -y0,Δθ t+1 =θ t+1 -θ0;
[0136] S64. Determine whether the current deviation meets the calibration termination condition:
[0137] |Δx t+1 |≤∈ x ,|Δy t+1 |≤∈ y ,|Δθ t+1 |≤∈ θ ;
[0138] Where ∈ x ,∈ y ,∈ θ This is the preset attitude error tolerance threshold;
[0139] S65. If the above conditions are not met, then based on [Δx] t+1,Δy t+1 ,Δθ t+1 Update adjustment amount C (t+1) Generate a new control instruction set U (t+1) Repeat steps S51 to S65;
[0140] S66. If the conditions are met, the calibration process is terminated, and the device attitude closed-loop adaptive correction is completed.
[0141] Example 1:
[0142] To verify the feasibility of this invention in practice, it was applied to an underground traffic tunnel management project in a certain city. This provincial capital city used multiple sets of suspended LED intelligent lighting fixtures as the main lighting system. These electromechanical devices were evenly distributed along the tunnel ceiling, with a total length of approximately 6.3 kilometers and over 1200 installation points on one side. Due to factors such as vehicle vibration, temperature and humidity changes, and aging of the mounting brackets in the long-term operating environment, some lighting fixtures experienced problems such as tilting, displacement, and inconsistent lamp head pointing. This not only affected the uniformity of lighting and visual comfort but also created blind spots, uneven energy consumption, and safety hazards.
[0143] This embodiment selects section B of the tunnel, which is 1.2 kilometers long and contains 260 lighting nodes, for intelligent detection and automatic attitude calibration experiments. An edge computing unit, equipped with a 5-megapixel industrial camera, is installed every 10 meters along the tunnel ceiling and connected to an actuator (including a dual-axis servo turntable and a micro linear motor) to achieve image acquisition, attitude analysis, and automatic adjustment of the target equipment. The image acquisition frequency is set to once every 6 hours, with additional acquisitions every hour for critical areas.
[0144] During system deployment, the visual detection and automatic posture calibration method based on a whale-optimized autoencoder proposed in this invention was adopted. The input image size of the autoencoder model was 256×256×3, with the encoding layers set to [512, 256, 128] and the decoding layers symmetrically set. The whale optimization algorithm optimized the model structure parameters for 100 generations, with a population size of 30 and a fitness function that was a combination of weighted reconstruction error and parameter complexity. After optimization, the model accurately extracted the center point, direction vector, and angle deviation of the lamp's posture. Through posture comparison, the system identified 73 nodes with significant offsets (offsets greater than 1.5° or position offsets exceeding 20mm) and automatically generated three-axis adjustment commands to control the actuators to complete the fine-tuning of angle and position. The entire process required no manual intervention, with an average posture correction time of 2.8 seconds and an error controlled within ±0.4°.
[0145] Table 1 Comparison of experimental results between the present invention and traditional methods.
[0146]
[0147] Based on the comparative data in Table 1, it is evident that the present invention has significant advantages in several key performance indicators, demonstrating its application value and technological advancement in practical engineering scenarios.
[0148] Firstly, regarding detection frequency and response capability, traditional manual inspection methods typically involve inspections every 7 days, with an average inspection cycle of 168 hours, posing risks such as detection lag and delayed problem discovery. In contrast, the method of this invention, relying on edge computing and automatic image acquisition mechanisms, shortens the average inspection cycle to 6 hours, and allows for hourly additional image acquisition in critical areas, significantly improving the timeliness of equipment anomaly detection. The attitude deviation alarm response time is drastically reduced from the traditional 8 hours (480 minutes) to 4.2 minutes, achieving near real-time anomaly response and rapid closed-loop correction.
[0149] Secondly, in terms of recognition and calibration accuracy, this invention uses a whale-optimized autoencoder for image reconstruction and posture feature extraction, which reduces the average recognition error from ±2.7° of the traditional method to ±0.38°, and the average error after posture calibration from 22.6mm to 3.1mm. This shows that the system has extremely high detection sensitivity and adjustment accuracy, and can effectively cope with small displacements in complex tunnel environments.
[0150] In terms of human resource efficiency, traditional methods require at least 3 people per calibration cycle and involve nighttime construction, safety risks, and repetitive labor. In contrast, the method of this invention achieves "zero human intervention" operation through intelligent identification and automatic control, significantly reducing operation and maintenance costs and freeing up human resources.
[0151] Furthermore, in terms of operational efficiency, traditional methods take an average of 138 seconds for single-node calibration, while the control command generation and execution process of this invention is highly automated, with an average single-node calibration time of only 2.8 seconds. This significantly improves operational efficiency and is particularly suitable for scenarios requiring large-scale, multi-device parallel deployment. The overall system availability has increased from 93.2% to 99.1%, significantly reducing downtime caused by installation errors or failures.
[0152] It is worth noting that this invention also demonstrates added value in terms of energy consumption optimization. Because the lighting direction is more concentrated and uniform after the automatic calibration of the lamp posture, the overall energy consumption of the system is reduced by 12.5% while maintaining the same illuminance standard, demonstrating practical benefits in energy conservation and emission reduction.
[0153] In summary, the data in this table fully verifies the technical advantages of this invention in multiple dimensions such as detection efficiency, recognition accuracy, intelligent control, adaptive capability, and energy consumption control, providing an effective solution for the high-quality operation and intelligent upgrading of tunnel electromechanical equipment.
[0154] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for intelligent detection and automatic calibration of tunnel electromechanical devices based on computer vision, characterized in that, Includes the following steps: S1. Collect image data of electromechanical devices inside the tunnel, preprocess the image data, and generate a standardized image dataset; S2. Construct an autoencoder model. The autoencoder model consists of two parts: an encoder and a decoder. The encoder is used to extract the latent feature representation of the normalized image, and the decoder is used to restore the latent features to reconstruct the original image. S3. The whale optimization algorithm is used to jointly optimize the structural parameters and training parameters of the autoencoder model. Each whale individual is encoded as a set of parameter combinations. The population is iterated through the shrinking encirclement mechanism and spiral update mechanism of the whale optimization algorithm, and the optimal parameter combination that minimizes the reconstruction error is output. S4. Use the whale-optimized autoencoder model to extract and reconstruct features from the target image, calculate the pixel difference distribution between the original image and the reconstructed image, determine the current attitude state of the device, and extract attitude deviation information. S5. Based on the attitude deviation information, control commands are generated to drive the intelligent actuator of the electromechanical device to perform automatic attitude calibration. S6. Acquire the image of the calibrated electromechanical device and re-input it into the whale-optimized autoencoder model for detection. If there is still an attitude deviation, repeat steps S5 to S7 until the error is lower than the set threshold to achieve closed-loop adaptive calibration control.
2. The intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision according to claim 1, characterized in that, The image data specifically includes the structural outline, position and orientation, surface condition, and installation background information of the electromechanical device in the tunnel environment.
3. The intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision according to claim 1, characterized in that, The image data preprocessing specifically includes noise reduction, brightness equalization, distortion correction, and image normalization.
4. The intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision according to claim 1, characterized in that, S2 specifically includes: S21. Assume the input image data is in tensor form. Where h represents the image height, w represents the image width, and c represents the number of image channels; S22. Input the input image X into the encoder module. The encoder consists of n fully connected layers, and the output of each layer is: WITH i =σ(W i WITH i-1 +b i ),i=1,2,...,n; Where Z0 = flatten(X), Let be the weight matrix of the i-th layer. Here, σ is the bias term, d is the activation function, and d is the activation term. i This represents the number of neurons in the i-th layer, and the final output is the latent representation vector Z. n ; S23. Transform the latent representation vector Z... n The input is fed into the decoder module. The decoder has a symmetrical structure, consisting of n fully connected layers. The output of each layer is: in The final output is a reconstructed image vector. Then, the image is restored to its original format using the reshape operation. S24. Calculate the image reconstruction error: Where L rec This represents the mean squared error of image reconstruction, used as the fitness function value in the whale optimization algorithm.
5. The intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision according to claim 1, characterized in that, S3 specifically includes: S31. Let the size of the whale population be N, and the size of each individual in the population be W. j An autoencoder structure and its combination of training parameters are defined as follows: W j =[d1,d2,...,d n ,η,λ,θ1,θ2],j=1,2,...,N Where d i θ1 represents the number of nodes in the i-th layer of the encoder, η represents the learning rate, λ represents the regularization coefficient, θ1 is the activation function number, and θ2 is the Dropout ratio. S32. Initialize the location of the whale population and generate N initial solutions W. j Calculate the fitness value for each individual. The fitness function is defined as: f(W j )=L rec (W j )+α·R(W j ); Where L rec (W j ) indicates the use of individual W j The reconstruction error of the corresponding autoencoder structure on the training data, R(W) j ) represents the parameter redundancy penalty term, and α is the regularization weight coefficient; S33. In each iteration, based on the current optimal solution W * With the current individual W j Based on the relationship, the individual position is updated using the encirclement mechanism and spiral update mechanism of the whale optimization algorithm. The update formula is as follows: Where A = 2a·ra, C = 2·r, a is a linearly decreasing coefficient, r∈[0,1] is a random number, and W rand This refers to a randomly selected individual in a population. S34. After each iteration update, calculate the new fitness value and select the current optimal solution W. * (t+1), when the number of iterations reaches the set upper limit T or the change in optimal fitness is less than the convergence threshold, the optimal parameter combination W is output. * And as the final autoencoder model structure configuration.
6. The intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision according to claim 1, characterized in that, S4 specifically includes: S41. Standardize the image data of tunnel electromechanical equipment. Input the optimal autoencoder model obtained by the whale optimization algorithm to obtain its latent feature representation vector Z. n and reconstructed image S42. Calculate the pixel-level error matrix between the input image and the reconstructed image. The positional error of each pixel is defined as: Where i∈[1,h],j∈[1,w],k∈[1,c], is used to reflect the degree of reconstruction distortion at that position; S43. Construct a heatmap based on the error matrix E, locate target regions in high-error areas of the image, and extract the device boundary contour region through morphological analysis. S44, For region R d The edge features in the image are fitted with the minimum bounding rectangle to obtain the coordinates of the center point (x) of the current pose contour rectangle of the device. t ,y t ), horizontal projection angle θ t Equipment boundary length l t Width w t ; S45. Transfer the currently detected attitude parameters (x) t ,y t ,θ t The attitude deviation is calculated by comparing it with the initial installation reference parameters (x0, y0, θ0): Δx=x t -x0,Δy=y t -y0,Δθ=θ t -θ0; S46. Output attitude deviation information [Δx, Δy, Δθ], which is used for the generation of subsequent calibration control commands.
7. The intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision according to claim 1, characterized in that, S5 specifically includes: S51. Represent the attitude deviation information as a triple ΔP = [Δx, Δy, Δθ], where Δx is the offset of the device center point in the horizontal direction, Δy is the offset in the vertical direction, and Δθ is the attitude rotation angle deviation. S52. Apply the proportional adjustment function f to the attitude deviation ΔP. c The resulting adjustment amount C = [δ] x ,δ y ,δ θ ]: d x =K x ·Δx,δ y =K y ·Δy,δ θ =K θ ·Dth; Where K x ,K y ,K θ The adjustment gain coefficient set for the system is used to control the adjustment speed and step size; S53. Construct a control instruction set U = {u1, u2, u3}, whose corresponding instructions are defined as follows: u1: Drives the electromechanical device to move δ along the horizontal axis x Unit length; u2: Drives the electromechanical device to move δ along the vertical axis y Unit length; u3: Rotation δ around the reference axis θ Angle-based attitude calibration; S54. Send the control command set U to the intelligent actuator connected to the electromechanical device. The actuator includes a stepper motor, servo motor, linear drive assembly or multi-axis rotary platform to complete the mechanical movement adjustment of the equipment position and attitude. S55. After completing the instruction execution, update the current physical state of the device and enter the image re-acquisition and secondary detection process to verify the attitude calibration effect.
8. The intelligent detection and automatic calibration method for tunnel electromechanical devices based on computer vision according to claim 1, characterized in that, S6 specifically includes: S61. After executing the attitude adjustment command set U = {u1, u2, u3}, acquire the calibrated electromechanical device image. The image is input into the whale-optimized autoencoder model to obtain the reconstructed image. With latent feature vectors S62. Calculate the reconstruction error matrix E of the calibrated image. (t+1) (i,j) and mean reconstruction error: S63, Based on the image error matrix E (t+1) Extract new attitude parameters (x) t+1 ,y t+1 ,θ t+1 And calculate the attitude deviation: Δx t+1 =x t+1 -x0,Δy t+1 =y t+1 -y0,Δθ t+1 =θ t+1 -θ0; S64. Determine whether the current deviation meets the calibration termination condition: |Δx t+1 |≤∈ x ,|Δy t+1 |≤∈ y ,|Δθ t+1 |≤∈ θ ; Where ∈ x ,∈ y ,∈ θ This is the preset attitude error tolerance threshold; S65. If the above conditions are not met, then based on [Δx] t+1 ,Δy t+1 ,Δθ t+1 Update adjustment amount C (t+1) Generate a new control instruction set U (t+1) Repeat steps S51 to S65; S66. If the conditions are met, the calibration process is terminated, and the device attitude closed-loop adaptive correction is completed.