Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a method for searching the leakage source position of a building.
The method of locating a leak source of a building may include:
dividing a thermal imaging image of a building by using an FCN-DARG dividing algorithm, and finding out the lowest temperature point so as to obtain a first possible leakage source position;
obtaining a second possible leak source location from the building artwork of the building through the dual-discriminant generation type challenge network;
and comprehensively judging the first possible leakage source and the second possible leakage source through Gaussian distribution, and obtaining accurate leakage source positions.
According to a preferred embodiment of the present invention, the method for segmenting a thermal imaging map of a building by using an FCN-DARG segmentation algorithm to find a lowest temperature point so as to obtain a first possible leakage source position comprises the following steps:
s110: the method comprises the steps of obtaining features of an original infrared image of a building by utilizing FCN, carrying out semantic prediction classification from pixel level by convolution calculation from different stages of a convolution network, and forming an FCN rough segmentation result;
s120: taking the minimum rectangular frame of the target area obtained from the FCN rough segmentation result, and obtaining the position of the target area;
s140: performing secondary segmentation on the image result on the original infrared image by using the minimum rectangular frame and utilizing a self-adaptive region growing algorithm to form a secondary segmentation result;
s150: and fusing the FCN rough segmentation result with the secondary segmentation result to obtain a lowest temperature point, thereby obtaining a first possible leakage source position.
According to a preferred embodiment of the present invention, the adaptive region growing algorithm comprises the steps of:
s141: according to the FCN rough segmentation result, taking a rectangle frame with the smallest target segmentation result, positioning according to the rectangle frame, and extracting an image of the rectangle frame position on the original infrared image;
s142: taking the centroid of the rectangular frame as an initial seed point for region growth, and defining 8-field pixel points of the seed point as a growth initial region s according to an 8-field mode 0 Calculate S 0 Pixel mean value m of (2) 0 And dynamic difference D 0 And S is combined with 0 The gray value of all pixels in the pixel array is set as m 0 ;
S143: iterating according to step 142, calculating D according to formula (1) each time n And m n To determine the threshold range omega of new, growing pixels n :
Ω n =[m n-1 -θD n-1 ,m n-1 +θD n-1 ] (1)
In formula (1), θ is a regulator;
D n for the dynamic difference, a formula (2) is defined as:
wherein x is 1 ,x 2 ,…,x n For the newly added pixel gray value, m at each iteration n The average gray value of all pixel points in the grown region after the nth iteration;
s144: if the region S after the nth growth n No longer expands or reaches a preset threshold and growth stops.
According to a preferred embodiment of the present invention, the FCN rough segmentation result and the secondary segmentation result are fused to obtain a lowest temperature point, so as to obtain a first possible leakage source position, which is specifically as follows:
let the FCN division result area be S FCN The method comprises the steps of carrying out a first treatment on the surface of the The area of the segmentation result obtained by the dynamic self-adaptive region growth is S DARG In order to unify gray values to facilitate image superposition, pixels of the two are simultaneously valued as 1, two segmentation results are superposed, and finally, the value of the fusion image I (x, y) result is determined according to a formula (3):
according to a preferred embodiment of the present invention, the obtaining of the second possible leakage source location from the construction artwork of the building by means of the dual arbiter-generated challenge network comprises the steps of:
step S210: the building original image is transmitted into a generator, and the generator generates a picture of a leakage source;
step S220: transmitting the picture of the leakage source into a first discriminator, and judging the picture of the leakage source by the first discriminator to obtain a first judging result;
step S230: transmitting the picture of the leakage source into a second discriminator, and judging the picture of the leakage source by the second discriminator to obtain a second judging result; wherein the first and second discriminant parameters are not shared;
step S240: and carrying out overall judgment on the first judgment result and the second judgment result to obtain the second possible leakage source position.
According to a preferred embodiment of the present invention, a generator training step is further included before said step S210;
a first discriminant training step is further included before said step S220;
a second discriminant training step is also included before said step S230.
According to a preferred embodiment of the present invention, the first discriminant training step comprises:
s251: collecting n seepage building original pictures and corresponding seepage sources, and establishing a sample set: { (c) 1 ,x 1 ),(c 2 ,x 2 ),...,(c n ,x n ) -where c is the leakage building artwork and x is the corresponding leakage source;
s252: obtaining n noise samples { z } from a distribution 1 ,z 2 ,...,z n };
S253: obtaining n generated data from a generator
S254: obtaining n random leakage source pictures from a database
S255: bringing the data collected in steps S251-S254 into formulas (14) and (15), and adjusting the parameter θ d Maximizing the size of the device;
in the formulas (14) and (15),
representing leakage sources corresponding to the original drawings of the leakage building;
representing the leakage source generated by the leakage building original image corresponding to one generator;
representing a non-corresponding random leakage source picture corresponding to the leakage building artwork.
According to a preferred embodiment of the present invention, the second discriminant training step comprises:
s261: collecting n seepage building original pictures and corresponding seepage sources, and establishing a sample set: { (c) 1 ,x 1 ),(c 2 ,x 2 ),...,(c n ,x n ) -where c is the leakage building artwork and x is the corresponding leakage source;
s261: taking out one sample from the sample set collected in step S261 (c m ,x m );
S262: will c m Transmitting into CNN for calculation to obtain a result O m ;
S263: obtaining an output value o m And the true target value x m Is a difference in (2);
s264: weight adjustment is performed by using a BP algorithm, and the adopted formulas are shown as a formula (16), a formula (17), a formula (18) and a formula (19):
δ i =v i (1-v i )(x m i -v i ) (16)
δ k ←δ i (17)
w ji ←w ji +μδ j O m ji (19)
wherein: delta i For the error of each node in the neural network, v i For output of the output layer, alpha i For hidden layer output, w ki For the connection weight of the input layer to the hidden layer, mu is the learning rate constant, w ji Is the i node to j node weight, x ji Is the value that the inode passes to the j node.
According to a preferred embodiment of the invention, the generator training step comprises:
s271: collecting n seepage building original pictures and corresponding seepage sources, and establishing a sample set: { (c) 1 ,x 1 ),(c 2 ,x 2 ),...,(c n ,x n ) -where c is the leakage building artwork and x is the corresponding leakage source;
s272: obtaining n noise samples { z } from a distribution 1 ,z 2 ,...,z n };
S273: obtaining n generated data from a generator
S274: obtaining n random leakage source pictures from a database
S275: bringing the sample data collected in steps S271-S274 into formula (20), formula (21), and adjusting the generator parameter θ g Maximizing the size of the device;
wherein,
representing a score obtained by passing the data generated by the generator into the first arbiter;
representing a score obtained by passing the data generated by the generator into the second arbiter;
θ g parameters representing the incoming generator;
the gradient (gradient) is represented by the Learning rate (Learning rate).
According to a preferred embodiment of the present invention, the comprehensively determining the first and second possible leak sources by gaussian distribution comprises:
importing the leakage source frame body position and the score obtained by the FCN-DARG segmentation algorithm and the double-discriminant generation type countermeasure network into a result after normal distribution, and taking the leakage source position picture information with the score above a specified score as an output result;
performing loss calculation on the output result according to the formula (23):
L (reg) (t i ,t′ i )=R(t i -t′ i ) (23)
wherein t is i ,t′ i Representing predicted values and actual conditions of different frames.
L (reg) Representing t i ,t′ i Is a regression loss value of (2);
r represents a smoothL1 function.
Compared with the prior art, the method for searching the leakage source position of the building has the following beneficial effects:
the method for searching the leakage source position of the building is not only judged through a thermographic image, but also a generated type countermeasure network is introduced to search the leakage source of the building. The leakage source is searched through the double discriminators respectively, then the two results are combined to obtain a more accurate leakage source, and if the difference between the results obtained by the two discriminators is larger, the result of thermal image segmentation is introduced to carry out comprehensive judgment. The methods herein can greatly improve the accuracy of leak location finding compared to using only thermography to determine the location of the leak source.
Additional features of the invention will be set forth in part in the description which follows. Additional features of part of the invention will be readily apparent to those skilled in the art from a examination of the following description and the corresponding figures or a study of the manufacture or operation of the embodiments. The features of the present disclosure may be implemented and realized in the practice or use of the various methods, instrumentalities and combinations of the specific embodiments described below.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that if the terms "first," "second," and the like are referred to in the description of the present invention and the claims and the above figures, they are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the invention herein. Furthermore, if the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the invention discloses a method for searching a leakage source position of a building. The method for searching the leakage source position of the building processes the thermal imaging picture on one hand, and the lowest temperature point is found by dividing the thermal imaging picture by using the FCN-DARG dividing algorithm, so that a possible leakage source is found; on the other hand, the dual-discriminant generation type countermeasure network is utilized to find possible leakage sources in the original building drawings; and finally, carrying out comprehensive judgment on the two results so as to find a real leakage source.
Compared with the method for judging the leakage source position by using the thermal image, the method for searching the leakage source position of the building can greatly improve the accuracy of searching the leakage position.
The invention will be described in detail below with reference to the drawings in connection with embodiments.
As shown in fig. 1, the method for finding the leakage source position of the building comprises the following steps:
dividing a thermal imaging image of a building by using an FCN-DARG dividing algorithm, and finding out the lowest temperature point so as to obtain a first possible leakage source position;
obtaining a second possible leak source location from the building artwork of the building through the dual-discriminant generation type challenge network;
and comprehensively judging the first possible leakage source and the second possible leakage source through Gaussian distribution, and obtaining accurate leakage source positions.
By thermodynamic theorem, it is known that no substance can reach absolute zero degrees in a limited number of steps, and all substances above absolute zero degrees continuously emit radiant energy (thermal radiation) to the outside in the form of electromagnetic waves. The wavelength of this radiant energy is typically between 0.76 μm and 1000 μm, which is longer than red visible light and shorter than microwaves, and is therefore often referred to as infrared light or infrared light. For the same substance, the emissivity and the infrared radiation characteristics reflected under the condition of different temperatures are different, and the temperature is closely related to the infrared radiation characteristics, so that the purpose of measuring the temperature of the object can be achieved by measuring the infrared radiation characteristics emitted by the object through a thermal imaging related instrument, and then the object is displayed in a visible light form on the instrument display screen. The above is the basic principle of infrared thermal imaging.
The infrared thermal imaging technology is widely applied in various aspects, for example, as early as 1975, canadian forest research center utilizes a helicopter to carry an AGA750 portable thermal imager, and 15 hidden fires are found in forest fires, so that the probability of forest fires is greatly reduced. Also, infrared thermal imaging technology is applied to other aspects such as fault diagnosis.
The detection of building leakage by infrared thermal imaging is also an application of the infrared thermal imaging principle, and the temperature of the building surface is judged by detecting the radiant energy of the building surface, so as to judge whether leakage exists or not. The uneven house settlement causes wall surface cracking, rain and snow and mould erosion, and the wall surface is likely to leak due to factors such as thermal expansion and cold contraction caused by climate, flaws occurring during construction and the like. Once leakage occurs on the surface of a building, the surface temperature of a water seepage part is often lower than that of a drying part, and the leakage area of the building can be primarily judged through scanning by a thermal imaging camera.
In this embodiment, the method for segmenting the thermal imaging map of the building by using the FCN-DARG segmentation algorithm, and finding the lowest temperature point, thereby obtaining the first possible leakage source position, includes the following steps:
s110: the method comprises the steps of obtaining features of an original infrared image of a building by utilizing FCN, carrying out semantic prediction classification from pixel level by convolution calculation from different stages of a convolution network, and forming an FCN rough segmentation result;
s120: taking the minimum rectangular frame of the target area obtained from the FCN rough segmentation result, and obtaining the position of the target area;
s140: performing secondary segmentation on the image result on the original infrared image by using the minimum rectangular frame and utilizing a self-adaptive region growing algorithm to form a secondary segmentation result;
s150: and fusing the FCN rough segmentation result with the secondary segmentation result to obtain a lowest temperature point, thereby obtaining a first possible leakage source position.
Specifically, aiming at the condition that the infrared image segmentation is not ideal under the complex background, an FCN and a dynamic self-adaptive region growing infrared image segmentation algorithm (FCN-DARG) are fused. The basic flow of the FCN-DARG segmentation algorithm is shown in FIG. 2.
The algorithm is divided into two modules, namely a coarse segmentation module and a fine segmentation module. The rough segmentation module mainly acquires original image features by using FCNs, performs semantic prediction classification from pixel level by convolution calculation from different stages of a convolution network, and forms a rough segmentation result. And the target area obtained by dividing the FCN is subdivided into a minimum rectangular frame, the position of the target area is obtained, then the rectangular frame is used for carrying out secondary division on the image result by utilizing the self-adaptive area growth algorithm on the original image, and finally the two are fused to obtain the final result.
The specific process of FCN coarse segmentation is as follows:
in order to obtain the basic outline of the target area and eliminate the influence of a possible complex background environment, the infrared thermal image is first subjected to FCN rough segmentation. The FCN rough segmentation adopts an algorithm of an FCN network structure, the FCN structure is divided into 8 layers, all the layers are convolution layers, and the convolution layers (conv) and pooling layers (pool) are alternately connected. After this convolution, the image is smaller and smaller, for example, after 5 layers of convolutions are performed on an image, the image is reduced by a factor of 2, 4, 8, 16 and 32 from the first layer to the fifth layer, respectively. In order to restore the original image resolution, the output feature image needs to be up-sampled, but the resolution of the image is reduced by 32 times after 5 convolutions, and at this time, FCN-32s is obtained by directly up-sampling by 32 times, but the segmentation accuracy is drastically reduced. In order to compensate for the loss of image precision, up-sampling is performed by adopting a multi-stage fusion mode: firstly, up-sampling the feature map output after the 7 th layer convolution by 2 times, and then fusing the feature map with the feature map output by the 4 th layer pooling layer to form FCN-16s; and then, carrying out 2-time up-sampling on the feature map just fused, then fusing the feature map with the feature map output by the pooling layer 3, and then, carrying out 8-time up-sampling to obtain the FCN-8s. The segmentation of FCN-8s is best compared to FCN-32s and FCN-16 s. Fig. 3 shows the FCN convolution and deconvolution up-sampling process.
The region growing algorithm is firstly proposed by Levine et al, the algorithm idea is simple and easy to realize, and the segmentation result can keep target details to the greatest extent, so that the method is particularly suitable for infrared images with prominent brightness characteristics and mostly communicated regions. However, the initial seed points of the conventional region growing algorithm need to be selected or designated manually, and cannot meet the requirement of automatic segmentation. Based on this, a dynamically adaptive region growing algorithm is proposed. The region growing method is characterized in that image details can be kept, but over-segmentation or under-segmentation is easy to cause. This feature does not have much effect on simple background images, but for complex background images, over-segmentation or under-segmentation makes it difficult for the target to be accurately described, so that the effect of target recognition cannot be achieved. If the whole image is segmented by the region growing method, the target position is difficult to locate under the condition of complex background, and over-segmentation is easily caused under the influence of factors such as growth sequence, seed pixel selection and the like, so that the target is submerged. However, if the seed growing points of the area where the target is located are determined by adopting a manual interaction mode, the meaning of automatic segmentation is lost.
And the position of the target area can be easily obtained on the original image by the rough segmentation result obtained by FNC (full convolution network) and then determining the minimum rectangular frame at the segmentation target. This is of great importance for the end result of the region growing method, which on the one hand avoids the situation that the target cannot be identified due to global growth, and on the other hand, in the case of target region determination, the best position of the seed pixel must be at the centroid of the holding region. On the basis, region growing and dividing are carried out on the original image, so that a finer dividing result can be obtained.
In this embodiment, the adaptive region growing algorithm includes the following steps:
s141: according to the FCN rough segmentation result, taking a rectangle frame with the smallest target segmentation result, positioning according to the rectangle frame, and extracting an image of the rectangle frame position on the original infrared image;
s142: taking the centroid of the rectangular frame as an initial seed point for region growth, and defining 8-field pixel points of the seed point as a growth initial region S according to an 8-field mode 0 Calculate S 0 Pixel mean value m of (2) 0 And dynamic difference D 0 And S is combined with 0 The gray value of all pixels in the pixel array is set as m 0 ;
S143: iterating according to step 142, calculating D according to formula (1) each time n And m n To determine the threshold range omega of new, growing pixels n :
Ω n =[m n-1 -θD n-1 ,m n-1 +θD n-1 ] (1)
In formula (1), θ is a regulator; the larger the value of theta is, the more sufficient the region grows, but the phenomenon of over-division is easy to occur; on the contrary, the smaller the value of the theta factor is, the more easily the under-segmentation phenomenon is generated.
D n For the dynamic difference, a formula (2) is defined as:
wherein x is 1 ,x 2 ,…,x n For the newly added pixel gray value, m at each iteration n The average gray value of all pixel points in the grown region after the nth iteration; after each iteration, the gray value of the grown region is changed, D n Is also dynamically adjusted along with the threshold value range omega of the pixel points which can grow n And also dynamically changes. The algorithm has stronger automatic adaptability, and can effectively relieve the phenomenon of under-segmentation or over-segmentation.
S144: if the region S after the nth growth n No longer expands or reaches a preset threshold and growth stops.
Since the region growing method can keep the image details to the greatest extent (by adjusting the value of θ), the rough segmentation result obtained by FCN can be corrected by using the second segmentation result.
In this embodiment, the FCN rough segmentation result and the secondary segmentation result are fused to obtain a lowest temperature point, so as to obtain a first possible leakage source position, which is specifically as follows:
let the FCN division result area be S FCN The method comprises the steps of carrying out a first treatment on the surface of the The area of the segmentation result obtained by the dynamic self-adaptive region growth is S DARG In order to unify gray values to facilitate image superposition, pixels of the two are simultaneously valued as 1, two segmentation results are superposed, and finally, the value of the fusion image I (x, y) result is determined according to a formula (3):
as can be seen from equation (3), the fused image is based on the contour of the region growing segmentation, because, for the infrared image, once the rectangular target region is determined, the contrast between the target and the background in the region is already very obvious, which is equivalent to converting a complex background image into a simple background image, and the region growing segmentation effect is far better than that of the FNC algorithm. However, as the detail is kept more by the region growing, the fusion result image may have holes and needs to be processed. Here, the morphology processing method is used to fill the hole by performing a one-time closing operation (Closing Operation, CO) using 3×3 morphology structural elements, and a final divided image is obtained.
The basic idea of the generated countermeasure network (Generative adversarial network) is derived from two-person zero and gaming. In GAN, only one generator and one arbiter are typically included, as shown in fig. 4.
In GAN, the generator generates new data based on the source data and submits the new data to the arbiter for discrimination, and the arbiter determines the input data to find out which are real data and which are generated data. The GAN will train as above until the data generated by the generator can fully fool the arbiter. To win in this game, both the generator and the arbiter are continuously trained to increase the respective generating and determining capabilities, ultimately reaching a Nash equilibrium state.
The GAN training formula is shown as formula (4):
wherein: e is the expected value, P data P is the real data distribution situation z Representing the distribution of the generated data. In training, we need the smaller the loss value (V (D, G)) for the generator, the better the loss value for the arbiter.
The principle of the generation type countermeasure network is shown in fig. 4, the source data is input into a generator G, the data G (z) is generated by the generator, then the data is transmitted into a discriminator D together with the real data x to obtain a result D (G (z)), whether the data is the real data is judged, and finally the generator and the discriminator are adjusted according to the judging result until the discriminator cannot judge whether the real data is input or the data is generated, and the generator and the discriminator reach an equilibrium state at the moment.
The input of the discriminator of the GAN is the data generated by the generator, and then a value between 0 and 1 is output to represent the similarity degree between the data generated by the generator and the real data, and the closer the output value of the discriminator is to 0, the more likely the input is the data generated by the generator, and the closer to 1, the more likely it is to be the real data.
In this embodiment, a new arbiter D is added to the conventional GAN structure 2 A generating type countermeasure network with double discriminators is formed, two discriminators in the network respectively train, and parameters are not shared.
The method for obtaining the second possible leakage source position from the original building picture of the building through the dual-discriminant generation type antigen network comprises the following steps:
step S210: the building original image is transmitted into a generator, and the generator generates a picture of a leakage source;
step S220: transmitting the picture of the leakage source into a first discriminator, and judging the picture of the leakage source by the first discriminator to obtain a first judging result;
step S230: transmitting the picture of the leakage source into a second discriminator, and judging the picture of the leakage source by the second discriminator to obtain a second judging result; wherein the first and second discriminant parameters are not shared;
step S240: and carrying out overall judgment on the first judgment result and the second judgment result to obtain the second possible leakage source position.
Further, before the step S210, a generator training step is further included; a first discriminant training step is further included before said step S220; a second discriminant training step is also included before said step S230.
Specifically, the overall process applied by the dual arbiter-generated challenge network herein is: and (3) transmitting the original building image into a generator, generating a picture of the leakage source by the generator, then respectively transmitting the picture into two discriminators, respectively judging the leakage source by the two discriminators to obtain two results, and integrally judging the two results to obtain the real leakage source.
In order to make the generated leakage source picture more real, training the generator and the discriminator respectively is needed, the basic thought for optimizing the GAN is to make D and G perform iterative optimization, D is fixed when G is optimized, G is fixed when D is optimized, and the whole process needs to be in a convergence state when optimizing.
For multi-discriminant training, a first discriminant D 1 And a second discriminator D 2 Is not shared as two independent discriminators. During training, G, D 1 ,D 2 Following equation (5):
in equation (5), the parameters α, β (α > 0, β+.ltoreq.1) are to stabilize the learning process and control the effect of KL divergence and inverse KL divergence on the optimization. In order to make training more stable, an attempt may be made to adjust the values of α and β.
Given a fixed generator G, max V (G, D 1 ,G 2 ) Obtaining the best discriminator as formula (6) and formula (7)
And (3) proving: according to the legal measure theorem, two expectations are equal: for equation (5), when f (x) = -D 1 (x 1 ) Or f (x) =log d 2 (x 2 ) When it is availableNamely:
given interval x, byObtain->And->Order D 1 ,D 2 =0 can be obtained:
because ofThe solid evidence holds true.
ObtainingThen substituting formula (5) to train G to obtain G * . Given->Nash equalization points (G, D) generated in this against the problem of maximum and minimum optimization in the network 1 ,D 2 ) For each component there are forms as equation (9) and equation (10).
And (3) proving: will beTaking into formula (5), we get:
wherein D is KL (P data ||P G ) And D KL (P G ||P data ) KL and inverse KL divergence, respectively, only inAnd 0, the remainder typically being greater than 0. Distribution generated at generator->When the data distribution is completely equal, the return values of both distributions are 1, in which case neither discriminator can judge whether the sample is true or false.
In formula (13), the error of the generator indicates that increasing the value of the parameter α can optimize the KL divergence, increasing the value of β can optimize the anti-KL divergence, and adjusting α and β can balance the effects of the KL divergence and the anti-KL divergence, thereby increasing the algorithm robustness.
In the present embodiment, a dual arbiter-generating type counter-network first arbiter D 1 Is a classical discriminator.
For the first discriminator D 1 The training steps of (a) include:
s251: collecting n seepage building original pictures and corresponding seepage sources, and establishing a sample set: { (c) 1 ,x 1 ),(c 2 ,x 2 ),...,(c n ,x n ) -where c is the leakage building artwork and x is the corresponding leakage source;
s252: obtaining n noise samples { z } from a distribution 1 ,z 2 ,...,z n };
S253: obtaining n generated data from a generator
S254: obtaining n random leakage source pictures from a database
S255: bringing the data collected in steps S251-S254 into formulas (14) and (15), and adjusting the parameter θ d Maximizing the size of the device;
in the formulas (14) and (15),
indicating that the original map of the leak corresponds to its corresponding source of leak, a higher score should be obtained;
indicating the source of leakage generated by a generator in the leakage building artwork, and therefore should be a lower score;
indicating that a non-corresponding random leakage source picture corresponds to the leakage building artwork, a lower score should be obtained.
In the present embodiment, the second discriminator is based on a CNN (convolutional neural network) algorithm and a BP algorithm.
CNN is a feed-forward neural network that includes convolutions and can perform depth structure computation, and belongs to one of algorithms for deep machine learning, which is commonly used for feature extraction.
The basic steps of CNN are: inputting an image; performing convolution calculation through a convolution layer; extracting features through a sampling layer; and then convolved again to extract features, thereby cycling. After multiple cycles, the characteristic data are finally obtained through classification of the full connection layer, as shown in fig. 6.
As shown in fig. 7, the basic process of the BP algorithm is to train continuously through the input data, and adjust and correct the weights connected in the input layer, the hidden layer and the output layer during the training process, so as to finally reach the minimum error value.
In this embodiment, the second discriminant training step includes:
s261: collecting n seepage building original pictures and corresponding seepage sources, and establishing a sample set: { (c) 1 ,x 1 ),(c 2 ,x 2 ),...,(c n ,x n ) -where c is the leakage building artwork and x is the corresponding leakage source;
s261: taking out one sample from the sample set collected in step S261 (c m ,x m );
S262: will c m Transmitting into CNN for calculation to obtain a result O m ;
S263: obtaining output value O m And the true target value x m Is a difference in (2);
s264: weight adjustment is performed by using a BP algorithm, and the adopted formulas are shown as a formula (16), a formula (17), a formula (18) and a formula (19):
δ i =v i (1-v i )(x m i -v i ) (16)
δ k ←δ i (17)
w ji ←w ji +μδ j O m ji (19)
wherein: delta i For the error of each node in the neural network, v i For output of the output layer, a i For hidden layer output, w ki For the connection weight of the input layer to the hidden layer, mu is the learning rate constant, w ji Is the i node to j node weight, x ji Is the value that the inode passes to the j node.
In this embodiment, the generator training step includes:
s271: collecting n seepage building original pictures and corresponding seepage sources, and establishing a sample set: { (c) 1 ,x 1 ),(c 2 ,x 2 ),...,(c n ,x n ) -where c is the leakage building artwork and x is the corresponding leakage source;
s272: obtaining n noise samples from a distribution z 1 ,z 2 ,...,z n };
S273: obtaining n generated data from a generator
S274: obtaining n random leakage source pictures from a database
S275: bringing the sample data collected in steps S271-S274 into formula (20), formula (21), and adjusting the generator parameter θ g Maximizing the size of the device;
wherein,
representing the score obtained by passing the data generated by the generator into the first discriminator D1;
representing the score obtained by passing the data generated by the generator into the second discriminator D2;
θ g parameters representing the need for an incoming generator;
the gradient (gradient) is represented by the Learning rate (Learning rate).
The normal distribution is the most important one. The normal distribution concept was first proposed by german mathematicians and astronomists Moivre in 1733, but since german mathematicians Gauss first applied them to astronomical research, normal distribution is also called gaussian distribution.
In this embodiment, the comprehensively determining the first possible leakage source and the second possible leakage source through gaussian distribution includes:
importing the leakage source frame body position and the score obtained by the FCN-DARG segmentation algorithm and the double-discriminant generation type countermeasure network into a result after normal distribution, and taking the leakage source position picture information with the score above a specified score as an output result;
and carrying out loss calculation on the output result.
Specifically, the two leakage sources obtained and the separation result of the thermal image by FCN-DARG are processed in the manner shown in figure 8.
According to the normal distribution formula (22), μ is an average number, σ is a standard deviation, and f (x) is a normal distribution function.
By image segmentation and two discriminators we obtained a plurality of leakage source pictures, all leakage source frame positions and scores were in normal distribution relationship as shown in fig. 9.
And taking the picture information of the leakage source position above a specified score as an output result according to the leakage source frame body position and the result after the score is imported into normal distribution.
Finally, the calculated result is subjected to loss calculation according to the formula (23).
L (reg) (t i ,t′ i )=R(t i -t′ i ) (23)
Wherein t is i ,t′ i Representing predicted values and actual conditions of different frames.
L (reg) Representing t i ,t′ i Is a regression loss value of (2);
r represents a smoothL1 function; here σ=3:
the parameters of the FCN-DARG and the double-discriminant generation type antagonism network are regulated, so that the loss value is reduced, and the accuracy after comprehensive judgment is improved.
It should be noted that all of the features disclosed in this specification, or all of the steps in a method or process disclosed, may be combined in any combination, except mutually exclusive features and/or steps.
In addition, the foregoing detailed description is exemplary, and those skilled in the art, having the benefit of this disclosure, may devise various arrangements that, although not explicitly described herein, are within the scope of the present disclosure. It should be understood by those skilled in the art that the present description and drawings are illustrative and not limiting to the claims. The scope of the invention is defined by the claims and their equivalents.