Artificial intelligence-based historical building mural protection and repair identification method
By combining the differential sum analysis of visible light and thermal imaging images, an artificial intelligence-based method is used to distinguish between real cleaning and artifact areas, solving the problem of mural damage caused by misjudgment in existing technologies, and realizing real-time and quantitative control of the protection of murals in historical buildings.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 刘谨仪
- Filing Date
- 2026-05-07
- Publication Date
- 2026-07-24
AI Technical Summary
In the protection and restoration of murals in historical buildings, existing technologies that rely on the inter-frame difference method of visible light images during the cleaning process are prone to misjudging solvent diffusion as the actual cleaning area, leading to further solvent diffusion and causing brittle detachment of the original pigment layer and the aged organic layer. There is a lack of effective methods to distinguish between actual cleaning and solvent diffusion.
Using an artificial intelligence-based approach, combining visible light and thermal images, pixel-level spatial registration, differential operations, and connected component analysis are employed to calculate the spatial overlap ratio, temporal offset, and temperature fluctuation significance, thereby distinguishing between real cleaning areas and artifact areas, and adjusting the dosage of cleaning agent in real time.
It achieves real-time, quantitative, and closed-loop control of the cleaning process, avoids irreversible damage caused by misjudgment, reduces the risk of brittle shedding, and cuts off the positive feedback chain that amplifies misjudgment by artifacts.
Smart Images

Figure CN122453785A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of architectural mural conservation, specifically to an artificial intelligence-based method for the conservation, restoration, and identification of historical architectural murals. Background Technology
[0002] Currently, monitoring the cleaning process in the conservation and restoration of murals in historical buildings mainly relies on the inter-frame difference method of visible light images. This method determines the cleaning area by detecting changes in the mural's surface appearance and adjusts the cleaning agent dosage accordingly. However, this method has a fundamental flaw: when the cleaning solvent diffuses laterally across the mural surface, solvent wetting causes a change in the refractive index of the aged organic layer (such as natural resin varnish), producing optical distortion similar to actual cleaning. This leads the difference method to misjudge diffusion artifacts as effective cleaning areas, triggering a feedback adjustment to increase the cleaning agent dosage. This forms a positive feedback chain of "artifact expansion, dosage increase, further solvent diffusion, and interface debonding," ultimately causing the brittle overall detachment of the original pigment layer and the aged organic layer. Furthermore, existing technologies lack an effective means to distinguish between actual cleaning (accompanied by simultaneous thermal effects such as frictional heat generation, exothermic reactions, or evaporative endothermic reactions) and simple solvent diffusion (with weak thermal response that lags behind visual changes) from a thermodynamic coupling mechanism, making it difficult to fundamentally solve the misjudgment problem. Summary of the Invention
[0003] The purpose of this invention is to provide an artificial intelligence-based method for the protection, restoration, and identification of murals in historical buildings, in order to address the shortcomings of the prior art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for the protection, restoration, and identification of murals in historical buildings based on artificial intelligence, comprising: The visible light image stream and thermal imaging image stream of the mural cleaning area were acquired, and pixel-level spatial registration was performed on the two images. Perform difference operations on the visible light image and thermal imaging image at adjacent time points to extract the visual change region and the thermal change region; Each connected component is segmented from the visually changing region, and the spatial overlap ratio between the connected component and the thermally changing region is calculated. The first fluctuation sequence of visible light intensity over time and the second fluctuation sequence of temperature over time within the connected component are extracted. The time offsets of the two sequences and the significance of the temperature fluctuation amplitude relative to the background thermal noise are calculated. When the spatial overlap ratio is higher than the first threshold, the absolute value of the time offset is lower than the second threshold, and the temperature fluctuation is significantly higher than the third threshold, the connected component is determined to be a real cleaning region; otherwise, it is determined to be an artifact region caused by solvent diffusion. Only the actual cleaning area is considered as the effective cleaning zone. The dosage or contact time of the cleaning agent is adjusted according to the changes in its area, and an emergency stop is triggered when the area exceeds the safety limit. The effect of artifact areas on the adjustment of cleaning parameters is masked, and a lateral diffusion warning is issued.
[0005] Preferably, pixel-level spatial registration is performed on the two images; at least three non-collinear temporary thermal markers are generated in the non-core area of the mural using a brief contact heat source. The thermal markers exhibit a visually discernible shape under visible light and a temperature peak under thermal imaging; a visible light image and a thermal imaging image containing the thermal markers are acquired, and the visual center coordinates of each thermal marker in the visible light image and the temperature peak center coordinates in the thermal imaging image are extracted respectively; the perspective transformation parameters from the thermal imaging image to the visible light image are calculated based on the correspondence between the visual center coordinates and the temperature peak center coordinates; the perspective transformation parameters are applied to each frame of the thermal imaging image acquired in real time afterward, and aligned pixel by pixel with the visible light image.
[0006] Preferably, differential operations are performed on the visible light image and thermal imaging image at adjacent time points to extract the visual change region and the thermal change region; the absolute value of the gray level difference between the registered current frame visible light image and the previous frame visible light image is calculated pixel by pixel to obtain a visible light difference map; the binarization threshold is dynamically determined based on the gray level variance in the neighborhood of each pixel in the visible light difference map, pixels with values higher than the threshold are marked as changed pixels, and isolated noise points with an area of less than three pixels are removed to obtain the visual change region; The absolute value of the temperature difference between the current frame thermal imaging image and the previous frame thermal imaging image after registration is calculated pixel by pixel to obtain a thermal difference map. The thermal difference map is binarized using a fixed temperature difference threshold, and an expansion operation is performed on the binarization result to fill the internal holes, thereby obtaining the thermal change area.
[0007] Preferably, the spatial overlap ratio between the connected components and the thermally changed regions is calculated; The four-connected seed filling method is used to traverse the visual change region. Each unvisited change pixel is extracted as a seed point, which is the start of the segmentation of a new connected component. Starting from the seed point, all change pixels adjacent to its four neighbors are recursively visited. Each pixel is marked as belonging to the current connected component. At the same time, it is checked whether the corresponding position of the pixel in the thermal change region is marked as a temperature change pixel. If so, the overlap count of the connected component is incremented by 1. Repeat the calculation process until all changed pixels in the visually changing region have been accessed, and record the total number of pixels and the corresponding overlap count for each connected component; divide the overlap count of each connected component by the total number of pixels in that connected component, and the resulting ratio is the spatial overlap ratio between the connected component and the thermally changing region.
[0008] Preferably, the first fluctuation sequence of visible light intensity over time and the second fluctuation sequence of temperature over time within the connected component are extracted, and the time offsets corresponding to the two sequences are calculated. For each connected component, the average visible light grayscale of all pixels in the region covered by that connected component is recorded at each moment within a continuous time window, forming the first fluctuation sequence. Simultaneously, the average temperature of all pixels in the region covered by the connected component is recorded at each moment within the same time window to form the second fluctuation sequence; The second wave sequence is shifted relative to the first wave sequence by multiple candidate offsets. Each candidate offset corresponds to a shifted second wave sequence. The product of the first wave sequence and the shifted second wave sequence at the same time is calculated and accumulated to obtain the relevant accumulated value corresponding to each candidate offset. The maximum value is found from the relevant accumulated values corresponding to all candidate offsets, and the candidate offset corresponding to the maximum value is taken as the time offset.
[0009] Preferably, the significance of temperature fluctuation amplitude relative to background thermal noise is calculated; an outer ring region is defined around each connected component, and the temperature values of all pixels within the ring region within a 3-second time window prior to the current moment are extracted, and the standard deviation of the temperature values is calculated as the background thermal noise benchmark; the maximum and minimum values in the second fluctuation sequence within the connected component are extracted, and the difference between the maximum and minimum values is calculated as the temperature fluctuation amplitude; the temperature fluctuation amplitude is divided by the background thermal noise benchmark, and the resulting ratio is the temperature fluctuation significance of the connected component.
[0010] Preferably, the specific steps for adjusting the dosage or contact time of the cleaning agent based on changes in the effective cleaning area are as follows: For connected components identified as real cleaning regions in multiple consecutive frames of images, their area values are recorded frame by frame to form an area time series. Calculate the difference between the area of the current frame and the area of the previous frame to obtain the area change, and at the same time calculate the moving average of the areas of the last five frames to obtain the area baseline value. When the area change is less than 5% of the area reference value and lasts for two frames, increase the cleaning agent dosage by one unit step. When the area change is greater than 5% of the area reference value and lasts for two frames, decrease the cleaning agent dosage by one unit step. When the absolute value of the area change is less than 2% of the reference value, maintain the current dosage.
[0011] The technical effects and advantages provided by the present invention in the above technical solution are as follows: 1. This invention overcomes the limitations of existing technologies that rely solely on visible light appearance changes. In actual cleaning processes, the mechanical contact or chemical reaction between the cleaning tools and the mural surface inevitably involves localized thermal effects: frictional heat generation, solvent evaporation with heat absorption, or stain dissolution with heat release. These thermal effects occur synchronously with visible light appearance changes in time and are strictly co-located spatially. However, the optical distortion caused by lateral solvent diffusion stems solely from the refractive index matching effect, and its temperature change originates only from the slow evaporation of the solvent, resulting in a weak amplitude and a significant time lag relative to visual changes. This invention, by simultaneously acquiring visible light and thermal imaging signals in both bands, extracts the spatial overlap ratio, the offset corresponding to the temporal cross-correlation peak, and the significance of temperature fluctuations relative to background thermal noise. Based on the physical essence of thermal-optical coupling, it fundamentally distinguishes between real cleaning and artifact areas. This mechanistic level of differentiation is completely lacking in purely visual methods.
[0012] 2. This invention solves the most serious risk of brittle detachment in existing technologies by breaking the positive feedback chain of "artifact enlargement, misjudgment as effective cleaning, increased solvent dosage, and further artifact enlargement." In existing technologies, visual changes caused by lateral solvent diffusion are mistakenly interpreted as an expansion of the cleaning area. The system then incorrectly increases the cleaning agent dosage or extends the contact time, causing the solvent to continuously penetrate to the interface between the original pigment layer and the aged organic layer, ultimately leading to brittle detachment of the entire material. This invention only considers the connected components of the truly cleaned area as the effective cleaning zone, adjusting cleaning parameters based on changes in their actual area. Simultaneously, it shields the adjustment effect on artifact areas and issues diffusion warnings. This mechanism avoids the application of excessive solvent due to misjudgment, thus eliminating the conditions that induce interface debonding. Compared to existing technologies that rely on subjective observation or post-processing detection, this invention achieves real-time, quantitative, and closed-loop control of the cleaning process, significantly reducing the probability of irreversible damage. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0014] Figure 1 This is a flowchart of the artificial intelligence-based method for the protection, restoration, and identification of murals in historical buildings according to the present invention.
[0015] Figure 2 This is a flowchart of the method for extracting visually changing regions according to the present invention.
[0016] Figure 3 This is a flowchart of the method for extracting the thermal change region according to the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] For examples, please refer to Figure 1 As shown in this embodiment, the method for identifying and protecting historical building murals based on artificial intelligence includes: The system acquires visible light and thermal imaging streams of the mural cleaning area and performs pixel-level spatial registration on the two images. It performs differential operations on the visible light and thermal imaging images at adjacent time points to extract visual and thermal change regions. Each connected component is segmented from the visual change region, and the spatial overlap ratio between the connected component and the thermal change region is calculated. The system extracts the first fluctuation sequence of visible light intensity over time and the second fluctuation sequence of temperature over time within the connected component, calculates the cross-correlation peak of the two sequences and their corresponding time offset, and the significance of the temperature fluctuation amplitude relative to the background thermal noise. When the spatial overlap ratio is higher than a first threshold, the absolute value of the time offset is lower than a second threshold, and the significance of the temperature fluctuation is higher than a third threshold, the connected component is determined to be a real cleaning area; otherwise, it is determined to be an artifact region caused by solvent diffusion. Only the real cleaning area is considered the effective cleaning area. The dosage or contact time of the cleaning agent is adjusted according to its area change, and an emergency stop is triggered when the area exceeds the safety limit. The artifact region's adjustment effect on cleaning parameters is masked, and a lateral diffusion warning is issued.
[0019] The process involves acquiring visible light and thermal imaging streams of the mural cleaning area, and prior to the formal cleaning, selecting the edges of the mural or non-core areas that have been determined not to contain the original pigments, such as exposed ground layer areas or areas of historical restoration patches.
[0020] A short-contact heat source, using a thermal pen with a tip diameter of 1 to 2 millimeters, was employed. The pen was set to a heating temperature of 40 to 50 degrees Celsius, and the contact time was controlled to 0.5 to 1 second to avoid any thermal damage to the mural. The operator used the thermal pen to lightly touch three points on the mural surface. These three points were not collinear in space; that is, no three points were on the same straight line, and the distance between them was at least 5 millimeters. Each touch point, under visible light, formed a circular visual mark approximately 1 millimeter in diameter due to slight local surface thermal deformation or residual pen marks. Simultaneously, in the thermal imaging image, each touch point appeared as a clearly identifiable temperature peak point because its local temperature was higher than the background.
[0021] Start the visible light camera and the thermal imaging camera, and simultaneously acquire at least one frame of an image containing the three thermal markers mentioned above at the same frame rate (e.g., 30 frames per second). For the visible light image, use the difference of Gaussian filtering method to enhance the edge contrast of the marker points, and then locate the pixel-level region of each marker point through connected component analysis. Take the centroid of the region as the visual center coordinates and record it as (x-coordinate value, y-coordinate value).
[0022] For thermal imaging images, the value of each pixel corresponds to the temperature reading at that point. First, the thermal imaging image is subjected to median filtering to eliminate isolated noise points. Then, a temperature threshold is set, which is equal to the background average temperature plus three times the background temperature standard deviation. All connected components above this threshold are extracted, and each connected component corresponds to a thermal marker. Within each connected component, the pixel's temperature value is used as a weight, and the weighted average position is calculated as the coordinates of the temperature peak center, also recorded as (x-axis value, y-axis value). This yields three pairs of corresponding coordinate points.
[0023] Perspective transformation is used to describe the projection mapping from one plane to another and requires 8 independent parameters. Since we already have 3 non-collinear point pairs, each providing 2 equations, for a total of 6 equations, it is insufficient to uniquely determine the 8 parameters.
[0024] Therefore, this invention employs the least squares estimation method, solving the problem using at least four point pairs. In practice, four or more temporary thermal markers can be generated. For simplicity and to ensure computational feasibility, four point pairs are used as an example. The goal of perspective transformation is to transform any pixel coordinate (u, v) in the thermal imaging image into coordinates (x, y) in the visible light image. The transformation relationship satisfies: x equals (a multiplied by u plus b multiplied by v plus c) divided by (g multiplied by u plus h multiplied by v plus 1), y equals (d multiplied by u plus e multiplied by v plus f) divided by (g multiplied by u plus h multiplied by v plus 1), where a, b, c, d, e, f, g, and h are the eight transformation parameters to be determined. Substituting the thermal imaging coordinates of the four thermal marker points into the above relationship yields the corresponding visible light coordinates, thus constructing eight linear equations. Gaussian elimination is used to solve these eight equations, obtaining the specific values of a, b, c, d, e, f, g, and h. This set of parameters constitutes the perspective transformation matrix from the thermal imaging image space to the visible light image space.
[0025] After completing the above calibration, the calculated eight parameters a, b, c, d, e, f, g, and h are stored in the computer memory. For each frame of thermal imaging image acquired in real time, each pixel in the image is traversed to obtain its original coordinates (u, v). Based on the transformation relationship in step three, the corresponding coordinates (x, y) of the pixel in the visible light image space are calculated. Since (x, y) are usually non-integers, bilinear interpolation is used to sample the temperature value from the original thermal imaging image and assign it to the target coordinate position.
[0026] This generates a transformed thermal image with the same resolution as the visible light image, where each pixel is aligned with a visible light pixel. This transformed thermal image can then be used for subsequent difference operations and feature extraction.
[0027] Please see Figure 2 and Figure 3 As shown, differential operations are performed on the visible light image and thermal imaging image at adjacent time points to extract the visual change region and the thermal change region.
[0028] The absolute value of the grayscale difference between the registered current frame visible light image and the previous frame visible light image is calculated pixel by pixel to obtain the visible light difference map.
[0029] After pixel-level spatial registration, each frame of thermal imaging image has been transformed to the same pixel coordinate system as the visible light image, and the two images have the same resolution, for example, 1920 pixels horizontally and 1080 pixels vertically.
[0030] Let the visible light image acquired and registered at the current moment be the current frame visible light image, and denote the grayscale value of each pixel as an integer ranging from 0 to 255. Simultaneously, the visible light image acquired and registered at the previous moment is stored in memory and denoted as the previous frame visible light image. For each pixel position, calculate the absolute value of the difference between the grayscale value of the current frame visible light image and the grayscale value of the previous frame visible light image.
[0031] If the grayscale value of the current frame is greater than that of the previous frame, the difference is equal to the grayscale value of the current frame minus the grayscale value of the previous frame; if the grayscale value of the previous frame is greater than that of the current frame, the difference is equal to the grayscale value of the previous frame minus the grayscale value of the current frame; if the two are equal, the difference is 0. The calculated difference is used as the absolute value of the grayscale difference of that pixel. After traversing all 1920 multiplied by 1080 pixel positions, a visible light difference map with the same size as the original image is obtained. The value of each pixel in this difference map represents the grayscale change range of that position between two adjacent frames.
[0032] The binarization threshold is dynamically determined based on the gray-level variance in the neighborhood of each pixel in the visible light difference image. Pixels with values above the threshold are marked as changed pixels, and isolated noise points with an area of less than three pixels are removed to obtain the visually changed region.
[0033] After obtaining the visible light difference map, it is necessary to separate the pixels that actually cause visual changes due to the cleaning action, while suppressing false responses caused by camera noise and small fluctuations in illumination.
[0034] This invention employs a dynamic thresholding method based on local gray-level variance. For each pixel in the visible light differential image, a square neighborhood with a side length of 5 pixels is taken centered on that pixel, containing a total of 25 pixels. The average gray-level value of these 25 pixels is calculated as follows: first, all 25 gray-level values are summed to obtain a total, and then the sum is divided by 25 to obtain the average value. Next, the square of the difference between each pixel's gray-level value and the average value is calculated, and these squared values are summed and divided by 25 to obtain the gray-level variance of the neighborhood. This variance reflects the dispersion of gray-level values within the neighborhood.
[0035] The dynamic threshold is set to 0.8 times the grayscale variance. If the absolute value of the grayscale difference of the center pixel is greater than the dynamic threshold, the pixel is marked as 1, indicating a changed pixel; otherwise, it is marked as 0, indicating a non-changed pixel.
[0036] After traversing all pixels, a binary image is obtained. This binary image contains many isolated connected regions, where isolated noise points with an area of less than 3 pixels are highly likely caused by random noise. Therefore, connected component analysis is performed on the binary image to count the number of pixels contained in each connected region. For connected regions with fewer than 3 pixels, all their pixel values are set to 0, i.e., they are removed from the change region. All remaining pixels marked as 1 constitute the final visual change region.
[0037] The absolute value of the temperature difference is calculated pixel by pixel between the registered current frame thermal imaging image and the previous frame thermal imaging image to obtain a thermal difference map.
[0038] In parallel with visible light image processing, a similar but different differential operation is performed on the thermal imaging image. Both the current frame and the previous frame of the thermal imaging image have been registered to the pixel coordinate system of the visible light image through the aforementioned perspective transformation, and the value of each pixel directly represents the temperature value of that point in degrees Celsius, expressed as a floating-point number with two decimal places.
[0039] For each pixel location, calculate the absolute value of the difference between the current frame temperature value and the previous frame temperature value: if the current frame temperature value is greater than the previous frame temperature value, then the absolute value of the temperature difference equals the current frame temperature value minus the previous frame temperature value; if the previous frame temperature value is greater than the current frame temperature value, then the absolute value of the temperature difference equals the previous frame temperature value minus the current frame temperature value; if the two are equal, then the absolute value of the temperature difference is 0. After traversing all pixels, a thermal differential map is obtained, in which the value of each pixel represents the temperature change range between two adjacent frames, in degrees Celsius.
[0040] The thermal differential map is binarized using a fixed temperature difference threshold, and an expansion operation is performed on the binarized result to fill the internal voids, thus obtaining the thermal change region.
[0041] Thermal imaging images typically have a lower signal-to-noise ratio than visible light images, but the physical meaning of their temperature changes is clear. This invention employs a fixed temperature difference threshold for binarization processing. The value of this fixed temperature difference threshold is determined based on the noise-equivalent temperature difference parameter of the thermal imaging instrument.
[0042] In this specific embodiment, the noise equivalent temperature difference of the thermal imaging instrument used is 0.05 degrees Celsius, and the fixed temperature difference threshold is set to four times this noise equivalent temperature difference, i.e., 0.2 degrees Celsius. For each pixel in the thermal difference map, it is determined whether its absolute temperature difference is greater than 0.2 degrees Celsius. If it is greater, the pixel is marked as 1, indicating a significant temperature change; if it is less than or equal to 0, it is marked as 0, indicating no significant temperature change. After traversing all pixels, an initial binary thermal change map is obtained. Due to the continuity of temperature diffusion in the thermal imaging image, tiny internal voids may appear in the initial binarization result, that is, a small number of pixels marked as 0 exist within areas that should be continuous thermal change regions.
[0043] To eliminate these holes, a mathematical morphological dilation operation is performed on the initial binary thermal map. The dilation operation uses a square structuring element with sides of 3 pixels, i.e., a 3x3 matrix of all 1s. The center of this structuring element is sequentially aligned with each pixel in the initial binary thermal map. If at least one of the nine pixels covered by the structuring element has a value of 1, the center pixel is set to 1; otherwise, it is set to 0. After this dilation operation, the previously isolated small holes are filled by the surrounding pixels marked as 1, without excessively expanding the region boundaries. The resulting binary image after the dilation operation is the final thermal change region.
[0044] Each connected component is segmented from the visually changing region, and the spatial overlap ratio between the connected component and the thermally changing region is calculated.
[0045] Before performing segmentation, the binary images of the visual change region and the thermal change region output from the previous step are obtained. The two images have the same pixel size, for example, 1920 pixels horizontally and 1080 pixels vertically.
[0046] In the visual change region, each pixel has a value of 1 indicating a visual change and a value of 0 indicating a non-visual change. In the thermal change region, each pixel has a value of 1 indicating a temperature change and a value of 0 indicating a non-temperature change.
[0047] To record whether each pixel has been visited during the segmentation process, a marker array with the same size as the visually variable region is created. Each element of this array is initialized to 0, where 0 indicates that it has not been visited by any connected component and 1 indicates that it has been visited and belongs to a connected component.
[0048] Simultaneously, prepare two lists: the first list stores the total number of pixels for each connected component, and the second list stores the overlap count between each connected component and the thermally varied region. Additionally, set up a connected component number counter, initially set to 0.
[0049] A four-connected seed-filling method is used to traverse the visually changing region, segmenting connected components and simultaneously accumulating overlap counts. Starting from the first row and first column of pixels in the visually changing region, each pixel is scanned from left to right and from top to bottom. When a pixel with a value of 1 and a corresponding position of 0 in the marker array is scanned, it indicates that a new seed point for a connected component has been found. At this time, the connected component number counter is incremented by 1, and a new empty stack is created, pushing the coordinates of the current seed point onto the stack. Simultaneously, the total number of pixels in this connected component is temporarily stored as 0, and the overlap count is temporarily stored as 0. Then, the seed-filling loop is entered: when the stack is not empty, a pixel coordinate is popped from the top of the stack and recorded as the current pixel. First, the value corresponding to the current pixel in the marker array is checked. If it is 1, it means that it has already been processed and is skipped directly; if it is 0, it is marked as 1, and the total number of pixels in this connected component is incremented by 1. Next, the pixel value at the same coordinates as the current pixel in the hot-change region is queried. If the value is 1, it means that the position also belongs to the hot-change region, and the overlap count of this connected component is incremented by 1. Next, examine the four neighboring pixels of the current pixel: the pixel above, the pixel below, the pixel to the left, and the pixel to the right. For each neighboring pixel, first determine whether its coordinates are within the image boundary range, i.e., the row coordinates are between 1 and 1080, and the column coordinates are between 1 and 1920.
[0050] If the pixel is within the boundary, check if the value of the neighboring pixel in the visual change region is 1, and if the value of the neighboring pixel in the marker array is 0. If both conditions are met, push the coordinates of the neighboring pixel onto the stack. Repeat the above process of popping, marking, counting, and pushing until the stack is empty. At this point, all pixels of the current connected component have been processed, and its total pixel count and overlap count have been completely recorded. Store these two values into the two lists described in the first step, corresponding to the total pixel count and overlap count of the current value of the connected component number counter, respectively. Continue scanning the next unvisited pixel in the visual change region, repeating the above seed filling process, until all pixels in the entire visual change region have been scanned.
[0051] Record the total number of pixels and the corresponding overlap count for each connected component. After the complete scan in the second step, all visually changing pixels in the marker array are marked as 1, and the total number of pixels and overlap count for each connected component are stored in two lists respectively. The length of each list is equal to the total number of connected components in the visually changing region. For example, if there are 5 independent connected components in the visually changing region, the first list will have 5 values, representing the total number of pixels for the 1st to 5th connected components; the second list will also have 5 values, representing the overlap count for the corresponding connected components. For ease of subsequent calculations, these two lists are stored in the same index order, that is, the total number of pixels for the i-th connected component is associated with the i-th overlap count.
[0052] Calculate the spatial overlap ratio between each connected component and the thermally changed region. For each connected component, calculate its spatial overlap ratio with the thermally changed region based on the total number of pixels and the overlap count recorded in step three. Perform a division operation using the overlap count as the dividend and the total number of pixels as the divisor. The result is the spatial overlap ratio of that connected component. This ratio is a real number between 0 and 1.
[0053] For example, if a connected component has a total of 100 pixels and an overlap count of 80, then the spatial overlap ratio is 80 divided by 100, which equals 0.8. If the overlap count is 0, the ratio is 0, indicating that the connected component has no overlap with the thermally variable region. If the overlap count equals the total number of pixels, the ratio is 1, indicating that every pixel of the connected component is located within the thermally variable region.
[0054] After calculating the spatial overlap ratio of all connected components, each connected component receives a corresponding value. This value serves as a crucial basis for determining whether the connected component belongs to the actual cleaned region in subsequent steps. The entire segmentation and ratio calculation process is completed in a single scan, eliminating the need for additional storage of intermediate images and ensuring real-time processing efficiency.
[0055] Extract the first fluctuation sequence of visible light intensity over time and the second fluctuation sequence of temperature over time within the connected component, calculate the time offset of the two sequences, and the significance of the temperature fluctuation amplitude relative to the background thermal noise.
[0056] For each connected component, the average visible light grayscale of all pixels in the area covered by the connected component is recorded at each moment within a continuous time window to form a first fluctuation sequence. At the same time, the average temperature of all pixels in the area covered by the connected component is recorded at each moment within the same time window to form a second fluctuation sequence.
[0057] During real-time cleaning and monitoring, for each segmented connected component, the system records its visible light grayscale and temperature data at a fixed sampling interval. The sampling interval is set to 0.1 seconds, i.e., 10 samples per second. The time window length is set to 3 seconds, so each fluctuation sequence contains 30 data points, corresponding to the sampling moments from the current moment back to 3 seconds ago. For each moment, the registered visible light image and thermal image at that moment are first acquired. Then, for the set of pixels covered by the current connected component (which maintains its spatial position within the continuous time window), the arithmetic mean of the visible light grayscale values of all pixels in the set is calculated: the grayscale values of all pixels are added together to obtain the sum, and then the sum is divided by the number of pixels. The resulting value is a data point of the first fluctuation sequence at that moment.
[0058] Similarly, the same arithmetic mean operation is performed on the temperature values of all pixels within the connected component to obtain a data point of the second fluctuation sequence at that moment. This process is repeated for 30 moments within the time window to obtain the first fluctuation sequence, which contains 30 chronologically ordered average visible light grayscale values; simultaneously, the second fluctuation sequence is obtained, which contains 30 chronologically ordered average temperature values. The two sequences correspond one-to-one in time.
[0059] To measure the similarity between two wave sequences at different time delays, a cross-correlation function needs to be calculated. The candidate offset values are set to range from -10 frames to +10 frames, i.e., from -1.0 second to +1.0 second, with each candidate offset corresponding to an integer number of frames. For each candidate offset, each data point in the second wave sequence is shifted according to that offset: if the offset is positive, it means that the second wave sequence is shifted in the positive direction (future direction) of the time axis by a specified number of sampling intervals; if the offset is negative, it means that it is shifted in the negative direction (past direction) of the time axis.
[0060] After the translation, the length of the second wave sequence remains unchanged, but the initial alignment position of the sequence changes. Then, within the time range jointly covered by the first wave sequence and the translated second wave sequence (i.e., when both have data), the product of the value of the first wave sequence and the value of the translated second wave sequence at each moment is calculated. These products are then summed to obtain the relevant accumulated value corresponding to the candidate offset.
[0061] For example, when the offset is 0, the two sequences are perfectly aligned, and they are directly multiplied and accumulated at each time step. When the offset is positive 1, the second wave sequence is shifted backward by one sampling interval so that the first data point of the second wave sequence is aligned with the second data point of the first wave sequence, and then the multiplication and accumulation of the aligned parts are calculated. By traversing all candidate offsets, a set of related accumulated values is obtained, with each candidate offset corresponding to one related accumulated value.
[0062] After completing the above calculations, a correlation accumulation value array is obtained. The length of this array is equal to the number of candidate offsets, i.e., 21 (from -10 to +10). The largest value among these 21 correlation accumulation values is selected; this maximum value is the cross-correlation peak. The candidate offset value corresponding to this maximum value is recorded; this value is the time offset. For example, if the maximum correlation accumulation value occurs at an offset of +3, the time offset is +3 sampling intervals, i.e., +0.3 seconds, indicating that the temperature fluctuation is delayed by 0.3 seconds relative to the visible light fluctuation. If the maximum value occurs at an offset of -2, the time offset is -0.2 seconds, indicating that the temperature fluctuation leads the visible light fluctuation by 0.2 seconds. If the maximum value occurs at an offset of 0, it indicates that the two fluctuation sequences are synchronized in time. This time offset will serve as one of the core features for subsequently determining the true cleaned area and the diffusion artifact area.
[0063] For each connected component, its outer boundary is used as the inner edge, and it is radially expanded outward by 10 pixels to form an annular region surrounding the connected component. The temperature values of all pixels within the annular region are extracted within a continuous 3-second time window, and the standard deviation of these temperature values is calculated as the background thermal noise benchmark.
[0064] After segmenting the connected components and obtaining their spatial locations, it is necessary to determine the background region surrounding each connected component to estimate the statistical characteristics of the environmental thermal noise. For each connected component, its outer boundary contour is first obtained, which consists of a series of edge pixels.
[0065] Starting from each edge pixel on the outer boundary, extend radially outward by 10 pixels in a direction away from the interior of the connected component.
[0066] In practice, morphological dilation is performed on the connected components. A circular structuring element with a radius of 10 pixels is used. After dilation, a new region is obtained. Then, the region occupied by the connected component itself is subtracted, and the remaining part is a ring-shaped region with a width of 10 pixels. This ring-shaped region tightly surrounds the connected component but does not contain any pixels inside the connected component. Within this ring-shaped region, for each frame of thermal imaging image within a consecutive 3-second time window, the temperature values of all pixels within this ring-shaped region are extracted. The sampling interval of the time window is 0.1 seconds, so 3 seconds contains 30 time points. For each time point, the number of pixels contained in the ring-shaped region is denoted as N, and all N temperature values are extracted. First, the arithmetic mean of these 30 multiplied by N temperature values is calculated: all temperature values are summed to obtain the sum, and then divided by the total number (30 multiplied by N) to obtain the average value.
[0067] Then, for each temperature value, calculate the difference between it and the average value, and square this difference to obtain the squared difference. Sum all the squared differences to obtain the sum of squares. Divide the sum of squares by the total number of values to obtain the variance. Finally, take the square root of the variance to obtain the standard deviation. This standard deviation serves as the background thermal noise benchmark, measured in degrees Celsius, reflecting the degree of random temperature fluctuation in both time and space within the annular region.
[0068] Find the maximum and minimum values from the second fluctuation sequence of the connected component, and calculate the difference between them as the temperature fluctuation amplitude.
[0069] During the calculation of the cross-correlation peak and time offset, the second fluctuation sequence of the connected component was obtained. This sequence contains the average temperature value at 30 moments within a continuous 3-second time window. The average temperature value at each moment is obtained by taking the arithmetic mean of the temperature values of all pixels within the connected component. These 30 values are iterated through to find the maximum and minimum values. The maximum value is the largest of the 30 values, and the minimum value is the smallest. Then, the maximum value is subtracted from the minimum value; the difference is the temperature fluctuation amplitude of the connected component, in degrees Celsius. This amplitude reflects the overall drastic change in temperature along the time axis of the area covered by the connected component during the cleaning process.
[0070] The temperature fluctuation significance is obtained by dividing the temperature fluctuation amplitude by the background thermal noise baseline. The calculated temperature fluctuation amplitude is used as the dividend, and the calculated background thermal noise baseline is used as the divisor; performing a division operation yields the temperature fluctuation significance, which is a dimensionless real number.
[0071] For example, if the temperature fluctuation is 0.4 degrees Celsius and the background thermal noise baseline is 0.05 degrees Celsius, then the significance is 0.4 divided by 0.05, which equals 8.0. If the temperature fluctuation is less than or equal to the background thermal noise baseline, then the significance is less than or equal to 1.0. The larger this significance value, the more significantly the temperature change within the connected component is compared to the background thermal noise, meaning that the temperature fluctuation in this region is more likely caused by a real heat source (such as frictional heat generation during the cleaning process, exothermic reactions, or endothermic solvent evaporation) rather than random noise. This significance will serve as one of the core features for subsequently distinguishing between the real cleaning region and the diffusion artifact region, and will be input into the discrimination logic along with the spatial overlap ratio and temporal offset.
[0072] When the spatial overlap ratio is higher than the first threshold, the absolute value of the time offset is lower than the second threshold, and the temperature fluctuation is significantly higher than the third threshold, the connected component is determined to be a real cleaning region; otherwise, it is determined to be an artifact region caused by solvent diffusion.
[0073] Three discrimination thresholds were set, including the spatial overlap ratio threshold, the absolute value of the time offset threshold, and the significance of temperature fluctuation threshold. The values of each threshold were determined through preliminary experimental statistics.
[0074] Before the formal cleaning operation begins, a preliminary experiment needs to be conducted on a simulated test block with the same material as the mural to be protected. The simulated test block uses the same ground layer formula, the same pigment layer, and the same aged stain layer.
[0075] Two types of operations were performed on the simulated test block: the first was a real cleaning operation, which involved using cleaning tools and cleaning agents to physically or chemically remove the stain layer; the second was a simple solvent diffusion operation, which involved simply dripping solvent onto the mural surface without any wiping, allowing the solvent to diffuse naturally laterally and produce optical distortion artifacts. Both operations were performed under the monitoring of a dual-band camera, collecting data from at least 50 real cleaning events and 50 diffusion artifact events. For each event, the spatial overlap ratio, temporal offset, and temperature fluctuation significance of the resulting connected components were calculated according to the aforementioned steps.
[0076] The value ranges of three characteristic quantities in real cleaning events were statistically analyzed. The minimum value of the spatial overlap ratio was recorded as the lower limit, and this lower limit was taken as the spatial overlap ratio threshold, set to 0.6. That is, only when the spatial overlap ratio is greater than 0.6 can it be judged as real cleaning. The maximum value of the absolute value of the time offset in real cleaning events was recorded as the upper limit, and this upper limit was taken as the absolute value threshold of the time offset, set to 1 sampling interval (i.e., 0.1 seconds). That is, only when the absolute value of the time offset is less than 0.1 seconds does it meet the time synchronization characteristic of real cleaning. The minimum value of the temperature fluctuation significance in real cleaning events was recorded as the lower limit, and this lower limit was taken as the temperature fluctuation significance threshold, set to 3.0. That is, only when the temperature fluctuation significance is greater than 3.0 is the temperature fluctuation considered to be significantly higher than the background noise. At the same time, the distribution of the three characteristic quantities in diffusion artifact events was statistically analyzed to confirm that the above three thresholds can effectively separate the two types of events. Once the above thresholds are determined, they remain unchanged in the subsequent formal cleaning process.
[0077] For the current connected component, obtain its spatial overlap ratio, temporal offset, and temperature fluctuation significance, and compare them with the corresponding thresholds.
[0078] During real-time monitoring, for each connected component whose features have been segmented and calculated, firstly, its spatial overlap ratio is read, which is between 0 and 1. This value is compared with the spatial overlap ratio threshold (0.6) determined in the first step to determine if it is greater than 0.6. Secondly, the time offset of the connected component is read, which may be positive, negative, or zero. Its absolute value is taken, i.e., the sign of the offset value is removed to obtain a non-negative absolute value. This absolute value is compared with the time offset absolute value threshold (0.1 seconds) determined in the first step to determine if it is less than 0.1 seconds. Finally, the temperature fluctuation significance of the connected component is read, which is a dimensionless real number. This value is compared with the temperature fluctuation significance threshold (3.0) determined in the first step to determine if it is greater than 3.0.
[0079] When all three comparison conditions are met, the current connected component is determined to be a real cleaned region; otherwise, it is determined to be an artifact region caused by solvent diffusion. If the spatial overlap ratio is greater than 0.6, the absolute value of the time offset is less than 0.1 seconds, and the temperature fluctuation significance is greater than 3.0, then all three conditions are met, and the connected component is determined to belong to a real cleaned region.
[0080] Conversely, if any of the above three conditions are not met, namely, the spatial overlap ratio is less than or equal to 0.6, or the absolute value of the time offset is greater than or equal to 0.1 seconds, or the temperature fluctuation significance is less than or equal to 3.0, then the connected component is determined to belong to the artifact region caused by solvent diffusion.
[0081] For example, if a connected component has a spatial overlap ratio of 0.8, a time offset of 0.05 seconds, and a temperature fluctuation significance of 5.0, then it meets all three conditions and is determined to be a true cleaned region. Another connected component has a spatial overlap ratio of 0.9 but a time offset of 0.3 seconds; even if the other two conditions are met, it is still determined to be an artifact region.
[0082] This determination result will serve as the sole basis for subsequent cleaning dosage control and alarm triggering. The entire determination process is performed independently once for each active connected component at each sampling time.
[0083] Only the actual cleaning area is considered as the effective cleaning zone. The dosage or contact time of the cleaning agent is adjusted according to the changes in its area, and an emergency stop is triggered when the area exceeds the safety limit. The effect of artifact areas on the adjustment of cleaning parameters is masked, and a lateral diffusion warning is issued.
[0084] For connected components identified as real cleaning regions in multiple consecutive frames of images, their area values are recorded frame by frame to form an area time series.
[0085] During real-time monitoring, after each frame of image undergoes the aforementioned discrimination steps, several connected components that are identified as real cleaning areas are output. Each connected component corresponds to an independent spatial region where cleaning is in progress. For each connected component of a real cleaning area, its area change needs to be continuously tracked, and an emergency stop is triggered when the area exceeds a safety limit.
[0086] Using the unique identifier of each connected component as an index, a fixed-length queue is maintained in memory, with a queue length set to 10 frames. After processing each frame of image, for each connected component of the actual cleaned area appearing in the current frame, its area value is calculated. The area value is calculated by counting the number of pixels contained in the connected component. Since each pixel corresponds to a fixed physical dimension on the mural surface (known through camera calibration, for example, each pixel corresponds to 0.05 mm multiplied by 0.05 mm), the number of pixels is directly used as the dimensionless representation of the area in this step because subsequent scaling is based on relative changes rather than absolute physical area. This number of pixels is used as the area value of the current frame and pushed to the tail of the queue corresponding to the connected component.
[0087] Simultaneously, if the queue length exceeds 10 frames, the area value of the oldest frame at the head of the queue is removed. Thus, each connected component maintains a time-series sequence of area values that slides over time, containing area samples from the most recent 10 moments, with a sampling interval of 0.1 seconds, corresponding to a 1-second time span. For newly appearing connected components, their queue is initially empty, and is filled frame by frame starting from the first frame they appear in, until a full 10 frames are reached before a complete moving average calculation can be performed.
[0088] Calculate the difference between the area of the current frame and the area of the previous frame to obtain the area change. At the same time, calculate the moving average of the areas of the last five frames to obtain the area baseline value.
[0089] For each connected component of the real cleaned region being tracked, after the area is recorded in each frame, the following two calculations are performed. The first calculation is the area change. The area value of the current frame (i.e., the latest value at the tail of the queue) and the area value of the previous frame (i.e., the second-to-last value in the queue) are taken from the temporal sequence of the area of the connected component. The area of the current frame is subtracted from the area of the previous frame; the difference is the area change. This change can be positive, negative, or zero: a positive value indicates that the cleaned region is expanding, a negative value indicates that the cleaned region is shrinking, and zero indicates that the area remains unchanged.
[0090] The second calculation is the area baseline value. The area values of the last five frames are taken from the area time-series, i.e., the last five values in the queue. These five values are added together to obtain a sum, and then the sum is divided by 5. The quotient is the moving average of the area of the last five frames, denoted as the area baseline value.
[0091] This baseline value reflects the average area level of the currently cleaned region over the most recent 0.5 seconds, serving as a dynamic reference for determining whether area changes are significant. It's important to note that if a connected component exists for less than five frames, no further adjustment is performed until five frames of data have been accumulated.
[0092] Based on the comparison between the area change and the area baseline value, and the persistence of the change trend, the method for adjusting the dosage of cleaning agent is determined.
[0093] Three percentage thresholds are set: -5%, +5%, and +2%. These percentages are relative to a baseline area value. The specific calculation method is as follows: First, multiply the baseline area value by 0.05 to obtain the value corresponding to 5% of the baseline value; multiply the baseline area value by 0.02 to obtain the value corresponding to 2% of the baseline value. Then, compare the area change obtained in the first step with these thresholds.
[0094] The first scenario: When the area change is less than 5% of the baseline area value, meaning the area change is a negative number and its absolute value is greater than 5% of the baseline value, it indicates that the cleaning area is shrinking at a relative rate exceeding 5%. In this case, further check the continuity condition: determine whether the previous frame also met the same condition (i.e., the area change in the previous frame was also less than 5% of the baseline value).
[0095] If the condition is met for two consecutive frames, the cleaning effect is considered insufficient, and the cleaning action needs to be enhanced. In this case, the cleaning agent dosage is increased by one unit step. The definition of the unit step depends on the specific type of cleaning equipment: if a peristaltic pump is used to drip the cleaning agent, one unit step corresponds to the pump rotating one step angle, for example, increasing the cleaning agent output by 0.01 ml; if a pneumatic spray device is used, one unit step corresponds to extending the solenoid valve opening time by 0.05 seconds; if a prompt is provided for manual cleaning, one unit step corresponds to the voice prompt "Increase dosage once". If only one frame meets the condition while the previous frame does not, no immediate adjustment is made to avoid malfunction.
[0096] The second scenario: When the area change exceeds 5% of the baseline area value (i.e., the area change is positive and exceeds 5% of the baseline value), it indicates that the cleaning area is expanding at a relative rate exceeding 5%. In this case, check if this condition is met for two consecutive frames. If so, the cleaning action is considered too strong, potentially leading to over-cleaning or damage, and the cleaning action needs to be reduced. In this case, decrease the cleaning agent dosage by one unit step. The reduction is symmetrical to the increase, for example, reducing the peristaltic pump output by 0.01 ml, or advancing the solenoid valve closing time by 0.05 seconds.
[0097] The third scenario: When the absolute value of the area change is less than two percent of the baseline area value, meaning the area change is within ±2 percent, it indicates that the area of the cleaned region is basically stable with extremely small changes. In this case, regardless of whether the cleaning agent application is continuous or not, the current dosage of cleaning agent should be maintained unchanged without any adjustments.
[0098] The fourth scenario: When the area change is between -5% and -2%, or between +2% and +5%, it is considered a moderate change. The system does not adjust the dose, but continues to monitor the trend of change in subsequent frames.
[0099] The entire adjustment process is executed independently for each connected component of the actual cleaning region at each sampling time (every 0.1 seconds). When multiple connected components exist simultaneously, the adjustment result of the connected component with the largest area is taken as the final execution command, as the largest area represents the main cleaning action zone. The new dose adjustment value will be applied to subsequent cleaning actions until the next adjustment occurs. Through this feedback control based on the area change rate and with continuous confirmation in two frames, fine and stable adjustment of the cleaning process can be achieved, avoiding frequent fluctuations caused by single-frame noise.
[0100] For artifact areas determined to be caused by solvent diffusion, the area change and area reference value corresponding to these artifact areas are excluded from the input data of the dosage control algorithm in the cleaning parameter adjustment loop. This means they are not included in any calculation or update of the cleaning agent dosage or contact time, ensuring that visual changes in the artifact areas do not lead to erroneous adjustments of the cleaning parameters. On the operation interface, the boundary of the artifact area is marked in real time with a blue semi-transparent outline, and a warning icon is displayed at the center of the area. The time, location, and area information of the artifact area's appearance are recorded in the system log. Then, a prompt message, "Lateral solvent diffusion detected; please reduce solvent usage or check local sealing," is broadcast via a voice synthesis module. This prompt message is limited to a maximum of once every 10 seconds to avoid repeated interference with the operator.
[0101] If the same artifact area appears repeatedly within 30 seconds and continues to expand, a higher-priority "runaway spread" alarm will be triggered, requiring operators to immediately stop the current cleaning operation and conduct an inspection.
[0102] The aforementioned shielding and alerting mechanisms not only prevent artifact areas from negatively interfering with the cleaning process, but also promptly inform operators of potential solvent spread risks.
[0103] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for identifying and protecting murals in historical buildings based on artificial intelligence, characterized in that: include: The visible light image stream and thermal imaging image stream of the mural cleaning area were acquired, and pixel-level spatial registration was performed on the two images. Perform difference operations on the visible light image and thermal imaging image at adjacent time points to extract the visual change region and the thermal change region; Each connected component is segmented from the visually changing region, and the spatial overlap ratio between the connected component and the thermally changing region is calculated. The first fluctuation sequence of visible light intensity over time and the second fluctuation sequence of temperature over time within the connected component are extracted. The time offsets of the two sequences and the significance of the temperature fluctuation amplitude relative to the background thermal noise are calculated. When the spatial overlap ratio is higher than the first threshold, the absolute value of the time offset is lower than the second threshold, and the temperature fluctuation is significantly higher than the third threshold, the connected component is determined to be a real cleaning region; otherwise, it is determined to be an artifact region caused by solvent diffusion. Only the actual cleaning area is considered as the effective cleaning zone. The dosage or contact time of the cleaning agent is adjusted according to the changes in its area, and an emergency stop is triggered when the area exceeds the safety limit. The effect of artifact areas on the adjustment of cleaning parameters is masked, and a lateral diffusion warning is issued.
2. The method for identifying and protecting historical building murals based on artificial intelligence according to claim 1, characterized in that, Pixel-level spatial registration is performed on the two images; at least three non-collinear temporary thermal markers are generated in the non-core area of the mural using a brief contact heat source. The thermal markers exhibit a visually discernible shape under visible light and a temperature peak under thermal imaging; visible light images and thermal imaging images containing the thermal markers are acquired, and the visual center coordinates of each thermal marker in the visible light image and the temperature peak center coordinates in the thermal imaging image are extracted respectively; the perspective transformation parameters from the thermal imaging image to the visible light image are calculated based on the correspondence between the visual center coordinates and the temperature peak center coordinates; the perspective transformation parameters are applied to each frame of the subsequent real-time acquired thermal imaging image and aligned pixel by pixel with the visible light image.
3. The method for identifying and protecting historical building murals based on artificial intelligence according to claim 1, characterized in that, Perform difference operations on the visible light image and thermal imaging image at adjacent time points to extract the visual change region and thermal change region; calculate the absolute value of the gray level difference pixel by pixel between the registered current frame visible light image and the previous frame visible light image to obtain the visible light difference map; The binarization threshold is dynamically determined based on the gray-level variance in the neighborhood of each pixel in the visible light difference image. Pixels above the threshold are marked as changed pixels, and isolated noise points with an area of less than three pixels are removed to obtain the visual change region. The absolute value of the temperature difference between the current frame thermal imaging image and the previous frame thermal imaging image after registration is calculated pixel by pixel to obtain a thermal difference map. The thermal difference map is binarized using a fixed temperature difference threshold, and an expansion operation is performed on the binarization result to fill the internal holes, thereby obtaining the thermal change area.
4. The method for identifying and protecting historical building murals based on artificial intelligence according to claim 1, characterized in that, Calculate the spatial overlap ratio between the connected components and the thermally varied regions; The four-connected seed filling method is used to traverse the visual change region. Each unvisited changed pixel is extracted as a seed point, which is to start the segmentation of a new connected component. Starting from the seed point, recursively visit all changed pixels adjacent to its four neighbors. For each pixel visited, mark it as belonging to the current connected component. At the same time, query whether the corresponding position of the pixel in the thermal change region is marked as a temperature change pixel. If so, increment the overlap count of the connected component by 1. Repeat the calculation process until all changed pixels in the visually changing region have been accessed, and record the total number of pixels and the corresponding overlap count for each connected component; divide the overlap count of each connected component by the total number of pixels in that connected component, and the resulting ratio is the spatial overlap ratio between the connected component and the thermally changing region.
5. The method for identifying and protecting historical building murals based on artificial intelligence according to claim 4, characterized in that, Extract the first fluctuation sequence of visible light intensity over time and the second fluctuation sequence of temperature over time within the connected component, and calculate the time offsets corresponding to the two sequences. For each connected component, the average visible light grayscale of all pixels in the region covered by that connected component is recorded at each moment within a continuous time window, forming the first fluctuation sequence. Simultaneously, the average temperature of all pixels in the region covered by the connected component is recorded at each moment within the same time window to form the second fluctuation sequence. The second wave sequence is shifted relative to the first wave sequence by multiple candidate offsets. Each candidate offset corresponds to a shifted second wave sequence. The product of the first wave sequence and the shifted second wave sequence at the same time is calculated and accumulated to obtain the relevant accumulated value corresponding to each candidate offset. The maximum value is found from the relevant accumulated values corresponding to all candidate offsets, and the candidate offset corresponding to the maximum value is taken as the time offset.
6. The method for identifying and protecting murals in historical buildings based on artificial intelligence according to claim 5, characterized in that, Calculate the significance of temperature fluctuation amplitude relative to background thermal noise; delineate an outer ring region around each connected component, extract the temperature values of all pixels within the ring region within a 3-second time window prior to the current moment, and calculate the standard deviation of the temperature values as the background thermal noise benchmark. Extract the maximum and minimum values in the second fluctuation sequence within the connected component, and calculate the difference between the maximum and minimum values as the temperature fluctuation amplitude; divide the temperature fluctuation amplitude by the background thermal noise benchmark, and the resulting ratio is the temperature fluctuation significance of the connected component.
7. The method for identifying and protecting murals in historical buildings based on artificial intelligence according to claim 1, characterized in that, The specific steps for adjusting the dosage or contact time of the cleaning agent based on changes in the effective cleaning area are as follows: For connected components identified as real cleaning regions in multiple consecutive frames of images, their area values are recorded frame by frame to form an area time series. Calculate the difference between the area of the current frame and the area of the previous frame to obtain the area change, and at the same time calculate the moving average of the area of the last five frames to obtain the area baseline value. When the area change is less than 5% of the area reference value and lasts for two frames, increase the cleaning agent dosage by one unit step. When the area change is greater than 5% of the area reference value and lasts for two frames, decrease the cleaning agent dosage by one unit step. When the absolute value of the area change is less than 2% of the reference value, maintain the current dosage.