Bridge health monitoring method fusing machine vision and edge calculation
By combining machine vision algorithms and deep learning technology with edge computing devices, the problem of aging of contact sensors and image processing in low-light environments in bridge health monitoring is solved, achieving high-precision, low-latency bridge displacement monitoring and reducing costs.
Patent Information
- Application Number
- CN202410789295.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-10-15
AI Technical Summary
In existing bridge health monitoring technology, the aging and damage of contact sensors leads to huge consumption of manpower, material resources, and financial resources. The image processing compatibility of machine vision in low-light environments is poor, resulting in system delays and costs that are difficult to control.
Combining digital image processing technology with single-board computers, edge computing equipment is used for real-time collection and calculation, combined with machine vision algorithms, displacement measurement is performed through the AKAZE-BF detection matching algorithm and improved RANSAC algorithm, and deep learning and simulated annealing algorithms are used for low-level Lighting image enhancement.
It realizes bridge deformation monitoring without a large number of lines, calculates structural deformation and displacement in real time, has detection capabilities in low-light environments, and reduces system delays and costs.
Smart Images

Figure CN118776479A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of structural detection, and specifically relates to a bridge health monitoring method integrating machine vision and edge computing. Background Art
[0002] Changes in external environmental conditions such as wind load, geology, temperature, humidity, and earthquakes will gradually reduce the durability, stability, and safety of bridge structures. Therefore, there is an urgent need to conduct long-term online monitoring of engineering structures, conduct damage, life assessment, and reliability analysis based on dynamic monitoring data, and provide maintenance recommendations to maintenance departments to reduce engineering accidents.
[0003] In the health assessment of structures such as bridges, although bridge load tests can directly reflect the bearing capacity of bridges, they often require traffic closure. Therefore, it is necessary to use intelligent detection technology to conduct rapid bridge detection and bridge assessment without traffic closure. Nowadays, most of the health monitoring industry uses contact sensor monitoring systems, and there are also integrations of template matching algorithms, laser interferometers, radar technology, deep learning and other methods. However, considering that contact measurement may involve aging and damage of sensors, it will consume huge manpower, material and financial resources.
[0004] In recent years, machine vision measurement algorithms have been widely used in deformation monitoring and safety assessment of engineering structures. They have also attracted great attention from civil engineers due to their advantages such as non-contact, long-distance, and high resolution. However, the scenarios in which these visual algorithms are applied require a large amount of image data transmission, and processing a large amount of image data also requires a lot of computing and storage resources. At the same time, a large amount of image data needs to be transmitted and processed, which may increase system delays, making it difficult to effectively control the real-time and cost of safety monitoring.
[0005] In the displacement measurement of machine vision, the image optimization problem of complex scenes has always been a hot topic, especially in low-light environments, which not only affects the visual perception of the human eye, but also reduces the recognition, detection, analysis and understanding capabilities of existing visual intelligent perception devices. However, most image enhancement algorithms have the following problems: fuzzy processing of details, poor optimization under uneven lighting conditions, unsaturated colors, artifacts, etc. At the same time, there is little research on image enhancement based on deep learning, and it is difficult to improve the compatibility of image processing in low-light environments. Summary of the invention
[0006] The purpose of the present invention is to combine digital image processing technology with single-board computer (SBC) technology, use edge devices to realize real-time data collection and calculation, combine machine vision algorithms with edge devices, and propose an effective and feasible solution for monitoring small and medium-sized bridges that can complete high-precision displacement measurement.
[0007] The technical solution adopted by the present invention is:
[0008] A bridge health monitoring method integrating machine vision and edge computing includes the following steps:
[0009] Step 1: Connect the computer motherboard to the camera, set the motherboard system environment, fix the camera to the rigid support, install the lens on the camera, encapsulate the computer motherboard, camera, lens and rigid support into a sealed monitoring device housing, connect the antenna and lightning rod to the monitoring device housing, and connect them to the computer motherboard to form an integrated deformation monitoring device;
[0010] Step 2: attach the target to the side of the bridge and place the strain gauge at one of the monitoring points on the bridge model; place the loading trolley on the bridge surface;
[0011] Step 3: Using an incandescent lamp as light source, place a light intensity meter near the target to measure the light intensity at the target during the experiment, turn on the deformation monitoring device, pull the loading trolley to move on the bridge surface, and the deformation monitoring device collects bridge data video and strain data in real time;
[0012] Step 4, dividing the image with the passive target collected by the deformation monitoring device into several ROI areas for motion monitoring;
[0013] Step five: Take the first frame of video acquisition as the reference frame, compare the current frame image with the reference frame, use feature point detection and matching algorithm to identify and match the feature points at the passive target of the two frames, average the difference in coordinates between the feature points in the sequence image and the initial image to obtain the pixel displacement of the image, and use the displacement calibration coefficient to obtain the actual displacement of the bridge.
[0014] Furthermore, in step 4, the image with the passive target collected by the deformation monitoring equipment is divided into several ROI areas, and the specific process is as follows: according to the size of the original image, a mask matrix of the same size is created, wherein the mask matrix is a binary image, the pixel value not contained in the selected area is 0, and the pixel value contained in the selected area is 255; the selected area where the passive target is located is drawn on the mask, and the size is consistent with the size of the passive target, that is, a mask is created, and the selected area is consistent with the size of the passive target; the created mask is applied to the original image, and through a bitwise AND operation, the pixel values in the newly created mask selection area are retained, and the pixel values outside the newly created mask selection area are set to 0, thereby dividing the image area into several ROI areas for motion monitoring according to the distribution of passive targets on the bridge surface.
[0015] Furthermore, in step 5, after the video is framed, the original RGB three-channel data of the video data is converted into grayscale data. The grayscale conversion method is as follows:
[0016] frame_gray=cv2.cvtColor(frame,cv2.COLOR_BGRGRAY)
[0017] In the formula, the parameter frame is the frame to be processed, frame_grav is the frame after grayscale processing, cv2.cvtColor() and cv2.COLOR_BGRGRAY are the built-in grayscale methods and their parameters of OpenCV.
[0018] Furthermore, for the marker points in the grayscale image, the AKAZE-BF detection and matching algorithm is used to obtain the matching pairs of feature points between the current frame and the initial frame. The improved RANSAC algorithm is used to screen the matching pairs of feature points to further obtain the information of the image feature points after successful matching.
[0019] Furthermore, we first construct the AKAZE nonlinear scale space. According to the principle of nonlinear diffusion filtering, we know that:
[0020]
[0021] Where L is the image brightness; div is the gradient and divergence respectively; (x, y) is the image coordinate; t is the flow time, which is also the image scale parameter; c(x, y, t) is the conduction function; the nonlinear scale space construction method sets the O and S layers in the pyramid image. First, an initial scale σ0 is selected as the initial fuzzy scale, n is the total number of scale space images, and the image scale parameter σ i for:
[0022] σ i (o,s)=σ02 o+s / S
[0023] Flow time t i for:
[0024]
[0025] Where: i∈[0,N-1], N is the total number of images; image group o∈[0,O-1]; sub-level s∈[0,S-1]; σ0 is the initial scale parameter of the image;
[0026] The FED algorithm is used to solve the partial differential equation of formula (1) to generate a nonlinear scale image, which is expressed as follows:
[0027] L i+1 =(I+τA(L i ))L i
[0028] Where i∈[0,N-1], I is the unit matrix, σ is the time step, and A(Li) is the image matrix in dimension i;
[0029] Secondly, locate the position of the feature points and calculate the filtered image L under different nonlinear scales i The Hessian matrix of is:
[0030] L Hessian =σ 2 (L xx L yy -L xy ·L xy )
[0031] Where: σ is the normalized scale factor; L xx With L yy is the two-order horizontal and vertical partial derivatives of the contact network image; L xy is a two-order mixed cross partial derivative; the Hessian matrix value is compared with 8 pixels in the same layer and 18 pixels in the upper and lower adjacent layers, and the local maximum value of the Hessian after normalization at different scales is the image feature point at that scale;
[0032] Then determine the main direction of the feature point, perform first-order differentiation in the area of the feature point, and calculate the response value of the feature point in the image; and establish a 60° fan-shaped area with a certain feature point as the center, and calculate the sum of the gradient vectors of the feature points in the fan-shaped area around the point, and the vector direction with the largest vector sum is the main direction of the feature point;
[0033] After that, the descriptor of the feature point is obtained by dividing the area around the feature point into multiple sub-grids and resampling each sub-grid at intervals of scale σ to obtain a set of discrete points; then, for each discrete point, the mean of its corresponding pixel value and the reciprocal in the vertical and horizontal directions is calculated; finally, for each feature point, a feature point description vector with a length of 3 bits is generated;
[0034] Finally, feature points are matched. The matching method adopted is BF brute force matching. For each descriptor in the first set, the descriptor with the smallest distance to it is found from the second set as the matching point. At the same time, the Hamming distance is selected as the distance value, and the matching results are preliminarily screened through cross-validation to improve the quality of brute force matching.
[0035] Furthermore, the specific process of using the improved RANSAC algorithm to screen feature point matching pairs is as follows: first, use the cv2.estimateAffinePartial2D function to estimate the affine transformation matrix F between the two sets of feature points, and determine several key parameters in the RANSAC algorithm; for parameter selection, use the Monte Carlo optimization algorithm to improve threshold selection; the distance from the sample point to the affine transformation model uses the residual as the distance indicator, specifically using the difference between the predicted position and the actual position of the feature point under the affine transformation model mapping; change different threshold values, and use the threshold with the smallest average value of all distances in all iterations as the objective function:
[0036]
[0037] Where D min is the average value of all distance residuals, d i is the difference between the predicted position and the true position in each iteration, and n is the maximum number of iterations;
[0038] The constraints are:
[0039] d i ≤R j
[0040]
[0041] Where R j is the threshold value at the jth iteration, (x i ,y i ) is the predicted position under the affine transformation model mapping, (x, y) is the actual position of the feature point, and the threshold when the minimum value is reached is used as the final threshold size.
[0042] Furthermore, displacement calculation is performed on images under low light, low light image enhancement is performed through deep learning methods, and the image quality is optimized through simulated annealing algorithm to remove the noise caused by enhancement. The specific process is: first, the trained deep learning model is used to realize the image information extraction function, and the grayscale distribution characteristics and average grayscale information of the image are extracted by learning the mapping relationship between images. In terms of image contrast, the histogram equalization algorithm is used to enhance the contrast of the image and improve the visual effect and quality of the image. Then, the simulated annealing algorithm is applied to optimize the image quality and remove the noise caused by enhancement.
[0043] Furthermore, the process of using a deep learning model to implement the image information extraction function is as follows: first, a deep learning model architecture based on a generative adversarial network for image information extraction tasks is selected, then a data set containing a large number of image samples is prepared, ensuring that the images in the data set have various grayscale distribution characteristics and average grayscale, and at the same time, the architecture of the generator network and the discriminator network are defined, and they are combined into a generative adversarial network; the generator network is responsible for generating realistic image samples, while the discriminator network is responsible for distinguishing between the generated fake samples and the real samples;
[0044] The dataset is then used to train the generative adversarial network. A random noise vector is input into the trained generative adversarial network to generate a batch of realistic image samples. The grayscale distribution characteristics and average grayscale value of these generated image samples are calculated. Finally, the discriminator network will evaluate the authenticity of these results, optimize the network parameters to improve the generation ability of the generator and the judgment ability of the discriminator, analyze and evaluate the extracted grayscale distribution characteristics and average grayscale, and check whether they effectively reflect the distribution characteristics of the image data learned by the generative adversarial network.
[0045] Low-light image optimization strategy based on fused generative adversarial network: Use the stochastic gradient descent algorithm to optimize the network parameters to minimize the loss function. Using the loss function defined in the above formula, calculate the difference between the model's predicted output and the true label. Calculate the gradient of the loss function to the model parameters through the back-propagation algorithm. Starting from the output layer, calculate the gradient of each parameter to the loss function in the reverse direction of the network. Use stochastic gradient descent to update the model parameters according to the gradient of the parameters. The optimizer updates the parameters according to the learning rate and the direction of the gradient so that the loss function is gradually reduced. Optimize the model parameters through multiple iterations on the training set. Each iteration updates the model's parameters so that the model's prediction results gradually approach the true label. When the stopping condition is reached (such as reaching the maximum number of iterations, the loss function converges, etc.), stop the training process and obtain a trained model, that is, obtain grayscale distribution features and average grayscale with better predictions.
[0046] Furthermore, using the histogram equalization algorithm, the process of enhancing the image contrast is as follows: first, grayscale the color image, calculate the histogram of the grayscale image, that is, count the frequency of each gray level in the image, normalize the histogram, and obtain the cumulative distribution function:
[0047] P(r k )=n k / n
[0048]
[0049] where r k is the kth gray level, n k is the gray level r in the imagek The number of pixels in the image, n is the total number of pixels in the image, P(r k ) is the gray level density function, T(r) is the cumulative distribution function;
[0050] Then the cumulative distribution function is linearly stretched, and the cumulative distribution function value of each gray level is mapped to between 0 and 255 to obtain the corresponding new gray value. Through the obtained cumulative distribution function mapping relationship, the gray value of each pixel in the original image is replaced with its corresponding new gray value, and finally a contrast-enhanced image is obtained.
[0051] Furthermore, the specific process of using the simulated annealing algorithm to optimize the image quality and remove the noise caused by enhancement is as follows: first, an energy function is defined to evaluate the effect of image denoising. This energy function is evaluated based on the quality of the denoised image; initially, the Gaussian denoising method is used to generate the initial state, where the two-dimensional Gaussian filter function is:
[0052]
[0053] In each iterative step of the simulated annealing algorithm, we try to find a better denoising result by changing the current state. We randomly select a local area in the image by replacing the local area, use the pixel values of the area to perform certain local filtering, and then evaluate the energy of the new state based on the signal-to-noise ratio of the image.
[0054] Beneficial effects of the present invention:
[0055] The present invention combines software algorithms and hardware instruments, and can be used for bridge deformation monitoring and edge computing. The detection does not require the laying of a large number of lines. The present invention autonomously divides the captured image into ROI areas, uses the AKAZE-BF detection matching algorithm to obtain the feature point matching pairs of the current frame and the initial frame, and screens the feature point matching pairs. The improved machine vision algorithm is used to calculate the deformation displacement of the structure in real time, and the strain stress of each point on the bridge is calculated in real time. The degree of danger of the deformation displacement of the bridge is determined, and an early warning is issued according to the degree of danger. The present invention uses a comprehensive image enhancement system to perform post-processing of low-light image enhancement, so that the device has the ability to cope with low-light conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 Schematic diagram of the process of this method;
[0057] Figure 2 It is a schematic diagram of deformation monitoring equipment;
[0058] Figure 3 It is the flow chart of the visual algorithm of the deformation monitoring equipment;
[0059] Figure 4It is a flow chart of feature point detection, matching and screening;
[0060] Figure 5 Flowchart of the low-light image enhancement algorithm. DETAILED DESCRIPTION
[0061] This embodiment uses a 1:700 scale experimental model of the Guanhe Bridge, which is a double-tower double-sector cable-stayed bridge with a total of 3 spans, and the span combination is: 2.15+4.8+2.15=9.1m. The experimental instruments include the developed integrated deformation monitoring equipment, displacement meter, strain gauge, light intensity meter, loading trolley, etc.
[0062] like Figure 1 As shown, the method of the present invention comprises:
[0063] Step 1: Connect the computer mini motherboard to the camera, set the motherboard system environment, and encapsulate the computer motherboard, camera, lens, rigid support, lightning arrester, antenna and other components into a sealed monitoring device housing to form an integrated deformation monitoring device, such as Figure 2 As shown in the figure, the deformation monitoring device is placed 2m in front of the bridge span, and the loading trolley is placed on the bridge surface;
[0064] Daheng Mercury II camera transmits image data through USB3.0 data interface, integrates I / O (GPIO) interface, provides cable locking device, can work stably in various harsh environments, and is a highly reliable industrial digital camera product; the lens can replace 8mm, 15mm, 25mm, 35mm, 75mm adaptable lenses; LattePanda development board compresses the computing power of desktop PC to the size of palm, with Inter Cherry Trail Z8350 quad-core processor, product size is 88*70mm, super small, working voltage is 5V@2A; the assembly of lightning arrester and antenna is used to improve the transmission speed and stability of signal; at the same time, 3D printing technology is used to complete the overlap of rigid support to ensure the stability of each component in the connection.
[0065] Step 2: Stick the target on the side of the bridge and place the strain gauge at one of the monitoring points of the bridge model. Only one strain gauge needs to be set at one monitoring point for later displacement comparison.
[0066] Step 3: Complete the experiment indoors, use an incandescent lamp as the light source, place a light intensity meter near the target to measure the light intensity at the target during the experiment, turn on the deformation monitoring device, pull the loading trolley to move on the bridge surface, and the deformation monitoring device collects bridge data video and strain data in real time;
[0067] Step 4: Divide the image with passive targets collected by the deformation monitoring equipment into several ROI areas. The specific process is as follows: according to the size of the original image, create a mask matrix of the same size. The mask matrix is a binary image, and the pixel value not included in the selected area is 0, and the pixel value included in the selected area is 255; draw the selected area where the passive target is located on the mask, and the size is consistent with the size of the passive target, that is, create a mask, and the selected area is consistent with the size of the passive target; apply the created mask to the original image, and through bitwise AND operation, retain the pixel values in the newly created mask selection area, and set the pixel values outside the newly created mask selection area to 0, so as to divide the image area into several ROI areas for motion monitoring according to the distribution of passive targets on the bridge surface;
[0068] Step 5: Extract the displacement of the feature points of the target on the bridge model. After the video is framed, convert the original RGB three-channel data of the video data into grayscale data. The grayscale method is as follows:
[0069] frame_gray=cv2.cvtColor(frame,cv2.COLOR_BGRGRAY)
[0070] In the formula, the parameter frame is the frame to be processed, frame_grav is the frame after grayscale processing, cv2.cvtColor() and cv2.COLOR_BGRGRAY are the built-in grayscale methods and their parameters of OpenCV. Figure 3 For the marked points in the grayscale image, the AKAZE-BF detection and matching algorithm is used to obtain the matching pairs of feature points between the current frame and the initial frame. The improved RANSAC algorithm is used to screen the matching pairs of feature points, and the information of the image feature points after successful matching is further obtained. The difference in coordinates of the feature points in the sequence image and the initial image is averaged to obtain the pixel displacement of the image. The displacement calibration coefficient can be used to obtain the actual displacement of the bridge.
[0071] The improved machine vision algorithm is used to calculate the deformation displacement of the bridge monitoring point in real time during the experiment; σ=Eεto obtain the stress and strain of the structure.
[0072] Among them, the feature point information of the target used in the experiment is extracted and the feature points are matched and screened, such as Figure 4 , the specific process is:
[0073] First, construct the AKAZE nonlinear scale space. According to the principle of nonlinear diffusion filtering:
[0074]
[0075] Where L is the image brightness; div is the gradient and divergence respectively; (x, y) is the image coordinate; t is the flow time, which is also the image scale parameter; c(x, y, t) is the conduction function.
[0076] The nonlinear scale space construction method is similar to SIFT. Both of them set the O and S layers in the pyramid image. First, an initial scale σ0 is selected as the initial blur scale. n is the total number of scale space images. Then the image scale parameter σ i for:
[0077] σ i (o,s)=σ02 o+s / S (2)
[0078] Flow time t i for:
[0079]
[0080] Where: i∈[0,N-1], N is the total number of images; image group o∈[0,O-1]; sub-level s∈[0,S-1]; σ0 is the initial scale parameter of the image.
[0081] The FED algorithm is used to solve the partial differential equation of formula (1) to generate a nonlinear scale image, which is expressed as follows:
[0082] L i+1 =(I+τA(L i ))L i
[0083] Where i∈[0,N-1], I is the unit matrix, τ is the time step, and A(Li) is the image matrix in dimension i.
[0084] Secondly, locate the position of the feature points and calculate the filtered image L at different nonlinear scales i The Hessian matrix of is:
[0085] L Hessian =σ 2 (L xx L yy -L xy ·L xy )
[0086] Where: σ is the normalized scale factor; L xx With L yy is the two-order horizontal and vertical partial derivatives of the contact network image; L xyis a two-order mixed cross partial derivative. Compare the Hessian matrix value with the 8 pixels in the same layer and the 18 pixels in the upper and lower adjacent layers, and obtain the local maximum value of the Hessian after normalization at different scales, which is the image feature point at that scale.
[0087] After that, the main direction of the feature point is determined, and the first-order differential is performed in the area of the feature point to calculate the response value of the feature point in the image. A 60° sector area is established with a certain feature point as the center, and the sum of the gradient vectors of the feature points in the sector area around the point is calculated. The vector direction with the largest vector sum is the main direction of the feature point. After that, the descriptor of the feature point is obtained by dividing the area around the feature point into multiple sub-grids and resampling each sub-grid at intervals of scale σ to obtain a set of discrete points. Then, for each discrete point, the corresponding pixel value and the mean of the reciprocal in the vertical and horizontal directions are calculated. Finally, for each feature point, a feature point description vector with a length of 3 bits is generated.
[0088] Finally, feature points are matched. The matching method adopted is BF brute force matching. For each descriptor in the first set of two feature descriptors extracted from the two images, the descriptor with the smallest distance to it is found from the second set as the matching point. At the same time, the Hamming distance is selected as the distance value, and the matching results are preliminarily screened through cross-validation to improve the quality of brute force matching.
[0089] Among them, the specific process of using the improved RANSAC algorithm to screen feature point matching pairs is:
[0090] First, use the cv2.estimateAffinePartial2D function to estimate the affine transformation matrix F between the two sets of feature points and determine several key parameters in the RANSAC algorithm. For parameter selection, parameters such as the maximum number of iterations and the stopping probability are linearly related to the quality of the results. Only a single-direction gradient is needed to adjust the values of these parameters. However, considering that a smaller distance threshold can improve the accuracy of matching, it may increase the false detection rate. For the distance threshold for determining whether a sample point is an inner point, the Monte Carlo optimization algorithm is used to improve the threshold selection. The distance from the sample point to the affine transformation model uses the residual as the distance indicator. Here, the difference between the predicted position and the actual position of the feature point under the affine transformation model mapping is used. Transform different threshold sizes and use the threshold with the smallest average value of all distances in all iterations as the objective function:
[0091]
[0092] Where D min is the average value of all distance residuals, d iis the difference between the predicted position and the true position in each iteration, and n is the maximum number of iterations. The constraints are:
[0093] d i ≤R j
[0094]
[0095] In the formula, R j is the threshold value at the jth iteration, (x i ,y i ) is the predicted position under the affine transformation model mapping, (x, y) is the actual position of the feature point, and the threshold when the minimum value is reached is used as the final threshold size.
[0096] For matching and screening of different images, the set threshold can be selected adaptively to optimize the selection of parameters.
[0097] For images under low light, displacement calculation is performed, and a comprehensive image enhancement system is used to optimize the image. The comprehensive image enhancement system includes an image input module, a generative adversarial network module, a histogram equalization module, a simulated annealing optimization module, and an image output module. First, the trained deep learning model is used to realize the image information extraction function. By learning the mapping relationship between images, the generative adversarial network algorithm is used to extract the grayscale distribution characteristics of the image and the average grayscale information of the image. In terms of image contrast, the histogram equalization algorithm is used to enhance the contrast of the image and improve the visual effect and quality of the image. Then the simulated annealing algorithm is applied to optimize the image quality to remove the noise caused by enhancement, effectively reduce noise and retain details. The various modules work together to process different characteristics and problems of the image to improve the overall enhancement effect and applicability. Figure 5 , specifically including:
[0098] First, we select a deep learning model architecture based on the image information extraction task under the generative adversarial network. First, we use the grayscale distribution characteristics of the image and the average grayscale of the image as the connection network, which can be expressed as:
[0099] I=F I (L g ), R=F R (L)
[0100] In the formula, F I and F RRepresents the grayscale distribution characteristics and average grayscale of the image, and is used to convert the grayscale image into an estimated matrix of the grayscale distribution characteristics and average grayscale of the image. I and R are the estimated grayscale distribution characteristics and average grayscale of the image, respectively. Lg is the grayscale image of the input L original image under low light. Then prepare a dataset containing a large number of image samples, ensuring that the images in the dataset have a variety of grayscale distribution characteristics and average grayscales. At the same time, define the architecture of the generator network and the discriminator network, and combine them into a generative adversarial network. The generator network is responsible for generating realistic image samples, while the discriminator network is responsible for distinguishing between generated fake samples and real samples.
[0101] At the same time, the training losses of the designed network structure include mean square error (MSE) loss, perceptual loss and smooth L1 loss:
[0102] L C =L MSE +L F +L S
[0103] Where, L C Denotes the total loss for generating adversarial networks, L MSE represents the mean square error loss, L F represents the perceptual loss, L S Represents smooth L1 loss. Then use the dataset to train the generative adversarial network. On the trained generative adversarial network, input a random noise vector to generate a batch of realistic image samples. For these generated image samples, their grayscale distribution features, such as grayscale histogram, pixel value frequency distribution, etc., can be calculated, and their average grayscale value can be calculated. Finally, the discriminator network will evaluate the authenticity of these results, optimize the network parameters to improve the generation ability of the generator and the judgment ability of the discriminator, analyze and evaluate the extracted grayscale distribution features and average grayscale, and check whether they effectively reflect the distribution characteristics of the image data learned by the generative adversarial network.
[0104] Low-light image optimization strategy based on fused generative adversarial network: Use the stochastic gradient descent algorithm to optimize the network parameters to minimize the loss function. Using the loss function defined above, calculate the difference between the model's predicted output and the true label. Calculate the gradient of the loss function to the model parameters through the back-propagation algorithm. Starting from the output layer, calculate the gradient of each parameter to the loss function in the reverse direction of the network. Use stochastic gradient descent to update the model parameters according to the gradient of the parameters. The optimizer updates the parameters according to the learning rate and the direction of the gradient so that the loss function is gradually reduced. Optimize the model parameters through multiple iterations on the training set. Each iteration updates the model's parameters so that the model's prediction results gradually approach the true label. When the stopping condition is reached (such as reaching the maximum number of iterations, the loss function converges, etc.), stop the training process and obtain the trained model, that is, obtain the grayscale distribution characteristics of the image with better prediction and the average grayscale of the image.
[0105] The process of using the histogram equalization algorithm to enhance the image contrast is as follows: first, grayscale the color image, calculate the histogram of the grayscale image, that is, count the frequency of each gray level in the image, normalize the histogram, and obtain the cumulative distribution function:
[0106] P(r k )=n k / n
[0107]
[0108] In the formula, r k is the kth gray level, n k is the gray level r in the image k The number of pixels in the image, n is the total number of pixels in the image, P(r k ) is the grayscale density function, and T(r) is the cumulative distribution function. The cumulative distribution function is then linearly stretched to make the brightness distribution of the image more uniform.
[0109] Specifically, the cumulative distribution function value of each gray level is mapped to between 0 and 255 to obtain the corresponding new gray value. Thus, the gray value of each pixel in the original image is replaced with its corresponding new gray value through the obtained cumulative distribution function mapping relationship. Finally, the image with contrast enhancement is obtained.
[0110] Use simulated annealing algorithm to optimize image quality and remove noise. The specific process is as follows:
[0111] First, an energy function is defined to evaluate the effect of image denoising. This energy function is based on the quality of the denoised image. Initially, the Gaussian denoising method is used to generate the initial state. The two-dimensional Gaussian filter function is:
[0112]
[0113] In each iterative step of the simulated annealing algorithm, an attempt is made to find a better denoising result by changing the current state.
[0114] Specifically, a local area in the image can be randomly selected by replacing the local area, and the pixel values in the area can be used for local filtering. Next, the energy of the new state is evaluated based on the image signal-to-noise ratio index. The objective function is to maximize the image signal-to-noise ratio:
[0115] P max =SNR max
[0116] Combined with the simulated annealing algorithm, iterative process is applied to image denoising:
[0117] Set the initial temperature T0 and randomly select an initial solution x0 after Gaussian noise reduction;
[0118] Calculate the current solution x i and the objective function value P(x i ) and P(x′);
[0119] If P(x′) <P(x i ), then accept the new solution x′, that is, x i+1 = x′;
[0120] If P(x′)>=P(x i ), then with probability P = exp(-(E(x′)-E(x i )) / Ti) accepts the new solution x′, otherwise keeps the current solution xi;
[0121] Reduce the temperature T according to the linear cooling strategy i ;
[0122] When the temperature drops to a preset value or the maximum number of iterations is reached, the algorithm stops.
[0123] By switching on and off the laboratory ceiling light, change the light intensity at the measuring point to simulate environments with different light intensities that may be encountered in actual use, and repeat the above steps.
[0124] By comparing the calculated data under different lighting conditions with the measured data of the strain gauge, it can be found that the bridge displacement calculated using the above method is not much different from the measured data of the strain gauge. When compared with the data without image enhancement, the optimization algorithm and the data after optimizing the image using the simulated annealing algorithm, the effectiveness and efficiency of the above method can be further proved.
[0125] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A bridge health monitoring method integrating machine vision and edge computing, characterized in that: The following steps are involved: Step 1: Connect the computer motherboard to the camera, set the motherboard system environment, fix the camera to the rigid support, install the lens on the camera, encapsulate the computer motherboard, camera, lens and rigid support into a sealed monitoring device housing, connect the antenna and lightning rod to the monitoring device housing, and connect them to the computer motherboard to form an integrated deformation monitoring device; Step 2: attach the target to the side of the bridge and place the strain gauge at one of the monitoring points on the bridge model; place the loading trolley on the bridge surface; Step 3: Using an incandescent lamp as light source, place a light intensity meter near the target to measure the light intensity at the target during the experiment, turn on the deformation monitoring device, pull the loading trolley to move on the bridge surface, and the deformation monitoring device collects bridge data video and strain data in real time; Step 4, dividing the image with the passive target collected by the deformation monitoring device into several ROI areas for motion monitoring; Step five: Take the first frame of video acquisition as the reference frame, compare the current frame image with the reference frame, use feature point detection and matching algorithm to identify and match the feature points at the passive target of the two frames, average the difference in coordinates between the feature points in the sequence image and the initial image to obtain the pixel displacement of the image, and use the displacement calibration coefficient to obtain the actual displacement of the bridge.
2. The bridge health monitoring method integrating machine vision and edge computing according to claim 1 is characterized in that: As described in step 4, the image with passive targets collected by the deformation monitoring equipment is divided into several ROI areas. The specific process is: according to the size of the original image, a mask matrix of the same size is created, wherein the mask matrix is a binary image, the pixel value not included in the selected area is 0, and the pixel value included in the selected area is 255; the selected area where the passive target is located is drawn on the mask, and the size is consistent with the size of the passive target, that is, a mask is created, and the selected area is consistent with the size of the passive target; the created mask is applied to the original image, and through bitwise AND operation, the pixel values in the newly created mask selection area are retained, and the pixel values outside the newly created mask selection area are set to 0, thereby dividing the image area into several ROI areas for motion monitoring according to the distribution of passive targets on the bridge surface.
3. The bridge health monitoring method integrating machine vision and edge computing according to claim 1 is characterized in that: In step 5, after the video is framed, the original RGB three-channel data of the video data is converted into grayscale data. The grayscale conversion method is as follows: frame_gray=cv2.cvtColor(frame,cv2.COLOR_BGRGRAY) In the formula, the parameter frame is the frame to be processed, frame_grav is the frame after grayscale processing, cv2.cvtColor() and cv2.COLOR_BGRGRAY are the built-in grayscale methods and their parameters of OpenCV.
4. The bridge health monitoring method integrating machine vision and edge computing according to claim 3 is characterized in that: For the marker points in the grayscale image, the AKAZE-BF detection and matching algorithm is used to obtain the matching pairs of feature points between the current frame and the initial frame. The improved RANSAC algorithm is used to screen the matching pairs of feature points, and further obtain the information of image feature points after successful matching.
5. The bridge health monitoring method integrating machine vision and edge computing according to claim 4 is characterized in that: First, construct the AKAZE nonlinear scale space. According to the principle of nonlinear diffusion filtering, we know that: Where L is the image brightness; div is the gradient and divergence respectively; (x, y) is the image coordinate; t is the flow time, which is also the image scale parameter; c(x, y, t) is the conduction function; the nonlinear scale space construction method sets the O and S layers in the pyramid image. First, an initial scale σ0 is selected as the initial fuzzy scale, n is the total number of scale space images, and the image scale parameter ε i for: e i (o,s)=σ02 o+s / S Flow time t i for: Where: i∈[0,N-1], N is the total number of images; image group o∈[0,O-1]; sub-level s∈[0,S-1]; σ0 is the initial scale parameter of the image; The FED algorithm is used to solve the partial differential equation of formula (1) to generate a nonlinear scale image, which is expressed as follows: L i+1 =(I+τA(L i ))L i Where i∈[0,N-1], I is the unit matrix, τ is the time step, and A(Li) is the image matrix in dimension i; Secondly, locate the position of the feature points and calculate the filtered image L under different nonlinear scales i The Hessian matrix of is: L Hessian =σ 2 (L xx L yy -L xy ·L xy ) Where: σ is the normalized scale factor; L xx With L yy is the two-order horizontal and vertical partial derivatives of the contact network image; L xy is a two-order mixed cross partial derivative; the Hessian matrix value is compared with 8 pixels in the same layer and 18 pixels in the upper and lower adjacent layers, and the local maximum value of the Hessian after normalization at different scales is the image feature point at that scale; Then determine the main direction of the feature point, perform first-order differentiation in the area of the feature point, and calculate the response value of the feature point in the image; and establish a 60° fan-shaped area with a certain feature point as the center, and calculate the sum of the gradient vectors of the feature points in the fan-shaped area around the point, and the vector direction with the largest vector sum is the main direction of the feature point; After that, the descriptor of the feature point is obtained by dividing the area around the feature point into multiple sub-grids and resampling each sub-grid at intervals of scale σ to obtain a set of discrete points; then, for each discrete point, the mean of its corresponding pixel value and the reciprocal in the vertical and horizontal directions is calculated; finally, for each feature point, a feature point description vector with a length of 3 bits is generated; Finally, feature points are matched. The matching method adopted is BF brute force matching. For each descriptor in the first set, the descriptor with the smallest distance to it is found from the second set as the matching point. At the same time, the Hamming distance is selected as the distance value, and the matching results are preliminarily screened through cross-validation to improve the quality of brute force matching.
6. The bridge health monitoring method integrating machine vision and edge computing according to claim 5 is characterized in that: The specific process of using the improved RANSAC algorithm to screen feature point matching pairs is as follows: first, use the cv2.estimateAffinePartial2D function to estimate the affine transformation matrix F between the two sets of feature points, and determine several key parameters in the RANSAC algorithm; for parameter selection, use the Monte Carlo optimization algorithm to improve threshold selection; the distance from the sample point to the affine transformation model uses the residual as the distance indicator, specifically using the difference between the predicted position and the actual position of the feature point under the affine transformation model mapping; change different threshold values, and use the threshold with the smallest average value of all distances in all iterations as the objective function: Where D min is the average value of all distance residuals, d i is the difference between the predicted position and the true position in each iteration, and n is the maximum number of iterations; The constraints are: d i ≤R j Where R j is the threshold value at the jth iteration, (x i ,y i ) is the predicted position under the affine transformation model mapping, (x, y) is the actual position of the feature point, and the threshold when the minimum value is reached is used as the final threshold size.
7. The bridge health monitoring method integrating machine vision and edge computing according to claim 1 is characterized in that: The displacement of images under low light is calculated, and low-light images are enhanced through deep learning methods. The simulated annealing algorithm is used to optimize the image quality and remove the noise caused by enhancement. The specific process is: first, the trained deep learning model is used to realize the image information extraction function, and the grayscale distribution characteristics and average grayscale information of the image are extracted by learning the mapping relationship between images. In terms of image contrast, the histogram equalization algorithm is used to enhance the contrast of the image and improve the visual effect and quality of the image. Then, the simulated annealing algorithm is applied to optimize the image quality and remove the noise caused by enhancement.
8. The bridge health monitoring method integrating machine vision and edge computing according to claim 7 is characterized in that: The process of using a deep learning model to implement the image information extraction function is as follows: first, select a deep learning model architecture based on the image information extraction task under the generative adversarial network, then prepare a data set containing a large number of image samples, ensure that the images in the data set have various grayscale distribution characteristics and average grayscale, and define the architecture of the generator network and the discriminator network, and combine them into a generative adversarial network; the generator network is responsible for generating realistic image samples, while the discriminator network is responsible for distinguishing between the generated fake samples and real samples; Then, the dataset is used to train the generative adversarial network. A random noise vector is input into the trained generative adversarial network to generate a batch of realistic image samples. For these generated image samples, their grayscale distribution characteristics and average grayscale value are calculated. Finally, the discriminator network will evaluate the authenticity of these results and optimize the network parameters to improve the generation ability of the generator and the judgment ability of the discriminator. It will analyze and evaluate the extracted grayscale distribution features and average grayscale to check whether they effectively reflect the distribution characteristics of the image data learned by the generative adversarial network.
9. The bridge health monitoring method integrating machine vision and edge computing according to claim 7, characterized in that: The process of enhancing image contrast using the histogram equalization algorithm is as follows: first, grayscale the color image, calculate the histogram of the grayscale image, that is, count the frequency of each grayscale level in the image, normalize the histogram, and obtain the cumulative distribution function: P(r k )=n k / n where r k is the kth gray level, n k is the gray level r in the image k The number of pixels in the image, n is the total number of pixels in the image, P(r k ) is the gray level density function, T(r) is the cumulative distribution function; Then the cumulative distribution function is linearly stretched, and the cumulative distribution function value of each gray level is mapped to between 0 and 255 to obtain the corresponding new gray value. Through the obtained cumulative distribution function mapping relationship, the gray value of each pixel in the original image is replaced with its corresponding new gray value, and finally a contrast-enhanced image is obtained.
10. The bridge health monitoring method integrating machine vision and edge computing according to claim 7, characterized in that: The specific process of using the simulated annealing algorithm to optimize image quality and remove noise caused by enhancement is as follows: First, define an energy function to evaluate the effect of image denoising. This energy function is based on the quality of the denoised image. Initially, the Gaussian denoising method is used to generate the initial state, where the two-dimensional Gaussian filter function is: In each iterative step of the simulated annealing algorithm, we try to find a better denoising result by changing the current state. We randomly select a local area in the image by replacing the local area, use the pixel values of the area to perform certain local filtering, and then evaluate the energy of the new state based on the signal-to-noise ratio of the image.
Citation Information
Cited By
Method for automatically monitoring earthquake response of structure by using monitoring video
CN119516439A
FAKAZE-POCR digital instrument detection and identification method
CN119649359A
A FAKAZE-POCR digital instrument detection and recognition method
CN119649359B
Ultra-precision global bridge rotation angle measurement method
CN119845225A
Non-contact structural body deformation detection method based on image processing
CN120765659A
