Method and system for comparing drawing differences of nuclear power plant

By improving the combination of the Canny operator and the U-Net model, the problems of low efficiency of manual comparison and poor robustness of existing algorithms in the detection of version differences in nuclear power plant drawing files are solved, and efficient and automated difference identification and accurate detection of low-quality drawings are achieved.

CN122048818APending Publication Date: 2026-05-15NAT NUCLEAR INFORMATION TECH CO LTD +4
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NAT NUCLEAR INFORMATION TECH CO LTD
Filing Date
2026-01-08
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

The manual comparison of nuclear power plant drawing files for version difference detection is inefficient and prone to omissions. Existing algorithms cannot adapt to low-quality scanned drawings, have poor robustness, and are difficult to apply stably to complex scenarios.

Method used

The Canny operator is improved by introducing an adaptive Gaussian filtering mechanism and a nonlinear interpolation method. Combined with the improved U-Net model, it is used for drawing difference detection. Edge detection is optimized by adaptive Gaussian filtering, multi-branch dilated convolution is introduced to expand the receptive field, FReLU activation function is set to enhance feature expression, and threshold segmentation and morphological post-processing are performed.

Benefits of technology

It improves robustness and accuracy under low-quality scanned drawing conditions, enables refined identification and automated detection of drawing differences, and enhances the overall accuracy and efficiency of drawing difference detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048818A_ABST
    Figure CN122048818A_ABST
Patent Text Reader

Abstract

The invention provides a nuclear power plant drawing difference comparison method and system, and the method comprises the steps: carrying out the unified format processing of a drawing file, and carrying out the edge detection of an image through an improved Canny operator; inputting the drawing after edge detection into the trained difference detection model, and outputting a difference probability graph; and performing threshold segmentation processing and morphological post-processing on the difference probability graph to obtain a final difference region labeling result. The method has the advantages that the robustness and accuracy under the condition of low-quality scanning drawings are improved, the overall precision of drawing difference detection is improved, and self-adaptive preprocessing of the work order drawings is achieved through coordination of region judgment and a priority mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of digital management and intelligent image processing technology for nuclear power plants, specifically relating to a method and system for comparing differences in nuclear power plant drawings. Background Technology

[0002] During the operation and maintenance of nuclear power plants, a large number of on-site construction drawings, design modification drawings, or scanned documents are generated as tasks such as on-site operations, equipment maintenance, and overhaul and renovation are carried out. These drawings and documents often have slight differences in size, symbols, annotations, or structure between different versions.

[0003] Currently, nuclear power plants face the following technical bottlenecks in processing drawing documents: 1. The detection of discrepancies in drawings relies on manual comparison, which is inefficient and prone to omissions. Drawings are mostly scanned copies, PDFs, or photographs. Due to the lack of automated comparison tools, staff can only check each page by hand, making it difficult to detect local differences in a timely manner, which can easily lead to omissions and potential safety hazards.

[0004] 2. Existing algorithms cannot adapt to low-quality scanned drawings. Work order drawings typically come from diverse sources and suffer from noise, skewness, and low resolution. Traditional methods based on pixel difference or template matching are prone to false alarms when distortion and alignment errors are large, exhibiting poor robustness and making them unreliable for complex drawing scenarios in nuclear power plants. Summary of the Invention

[0005] The purpose of this application is to overcome the shortcomings of the difficulty in automatically identifying differences in engineering drawing versions during the operation and maintenance of nuclear power plants, as well as the low efficiency and easy omissions in manual comparison.

[0006] To achieve the above objectives, this application proposes a method for comparing differences in nuclear power plant drawings, including: The drawing files are processed to a uniform format, and then the improved Canny operator is used to perform edge detection on the image; Input the edge-detected drawing into the trained difference detection model, and output a difference probability map; Threshold segmentation and morphological post-processing are performed on the difference probability map to obtain the final difference region annotation results.

[0007] As an improvement to the above method, the improved Canny operator includes: An adaptive Gaussian filtering mechanism based on local image features is introduced into the image smoothing and denoising step of the Canny operator, including: The Gaussian filter function is: ; in, To and The pixel-position-dependent adaptive standard deviation is used to reflect the smoothing intensity requirement of the local area; The following interval constraints must be met: ; in, The value range is 0.5 to 1.0; The value range is 2.0 to 3.5; Implemented using the following monotonic mapping function Adaptive adjustment: ; in: This is a reference variance value obtained based on statistics of the entire image or local sub-blocks; The normalized mapping function has an output range of [0,1], and can be a linear function, a fractional function, or a sigmoid function. For The local grayscale variance of a local neighborhood window centered on a pixel.

[0008] As an improvement to the above method, the improved Canny operator further includes: pixels to be processed Construct a local neighborhood window of size w×w centered on the target. Calculate the local gray-level variance of this region. : ; in, This represents the average grayscale value within the neighboring window. Image grayscale; Calculate the average gradient magnitude of the local region and structural response indicators Among them, structural response indicators Obtained by line structure detection operator or corner response function; When the following judgment relationship is satisfied: ; in, and These are the set local grayscale variance threshold and structural response index threshold, respectively; This area can then be classified as one with significant noise, drastic grayscale changes, but lacking clear structural features.

[0009] As an improvement to the above method, the improved Canny operator further includes: Areas with dense details include areas dominated by the edges of lines or symbols, as well as labeled areas; The method for determining the dominant region of the edge of the line or symbol is as follows: In pixels Centered on its neighborhood window Internal calculation of average gradient magnitude and gradient direction consistency index ; When the local region satisfies: ; in, and These are the set thresholds for average gradient magnitude and gradient direction consistency index, respectively. Then it is determined that the area has a clear and continuous edge structure and belongs to the area dominated by the edge of a line or symbol; The method for determining the marked area is as follows: Calculate the edge density index by statistically analyzing the percentage of edge pixels within a local window. : ; in, The number of pixels within the neighborhood window that are determined to be valid edges; when When the density exceeds the preset density threshold range, it indicates that the area is a labeled area.

[0010] As an improvement to the above method, the improved Canny operator further includes: For regions with dense detailed information, the adaptive Gaussian filter standard deviation Limited to a smaller range: ; in: The value range is 0.5 to 0.8; The value range is 1.0 to 1.2; Build with local detail intensity index The reverse mapping relationship: ; in: It consists of a normalized combination of gradient magnitude, edge density, or structural response; It is a monotonically increasing normalization function with an output range of [0,1].

[0011] As an improvement to the above method, the improved Canny operator further includes: An edge refinement method based on nonlinear interpolation is introduced in the nonmaximum suppression stage, including: Select four adjacent sampling points around the target pixel, including the target pixel itself. The sampling point in the lower left corner is denoted as M. 11The sampling point in the upper left corner is M. 12 The sampling point in the lower right corner is denoted as M. 21 The sampling point in the upper right corner is denoted as M. 22 The sampling points constitute a local two-dimensional neighborhood; First, perform two nonlinear interpolation operations along the x-direction of the image for the four sampling points. The interpolation expression is as follows: ; in, Let N1 and N2 represent the intermediate pixel values ​​obtained after interpolation in the x-direction; then, using N1 and N2 as inputs, the grayscale interpolation function is applied in the y-direction. Interpolation is performed to obtain the grayscale response value of the target pixel in the gradient direction.

[0012] As an improvement to the above method, the grayscale interpolation function A weighted nonlinear interpolation method is used to perform weighted calculations on the grayscale values ​​of adjacent pixels, including: Gray value interpolation function representation for: ; in, and For the gray values ​​of two adjacent sampling points selected along the gradient direction, the corresponding interpolation position weighting coefficients are ω and ω, respectively. 0≤ω≤1; the weighting coefficient ω is divided into weighting systems in the x and y directions. and The calculation method is as follows: ; Where θ is the gradient direction angle of the target pixel.

[0013] As an improvement to the above method, the difference detection model is obtained by modifying the U-Net model, and the modification method is as follows: Replace the convolutional layer structure at the encoder-decoder connection of the U-Net model with a multi-branch dilated convolutional feature extraction module; The multi-branch dilated convolution feature extraction module includes three dilated convolutional layers, each of which is followed by a 1×1 convolutional layer and an FReLU activation function. The dilation rates of the three dilated convolutional layers are 1, 3, and 5, respectively.

[0014] As an improvement to the above method, the threshold segmentation and morphological post-processing of the difference probability map include: For each pixel in the difference probability map Perform the following judgment: ; Among them, the judgment result Pixels with a value of 1 represent candidate difference regions, and pixels with a value of 0 represent non-difference regions, thus obtaining an initial binary difference map; the threshold T is obtained based on the pixel mean of the probability map. μ with standard deviation σ The statistical threshold method is used to determine: ; in, k This is an empirical coefficient; The initial difference binary image and the structuring element are subjected to erosion followed by dilation, and then the processed result and the structuring element are subjected to dilation followed by erosion. The structuring element is a rectangular structuring element with a size range of 3×3 to 7×7.

[0015] This application also provides a nuclear power plant drawing difference comparison system, implemented based on the above method, the system comprising: The format processing module is used to standardize the format of drawing files. An edge detection module is used to perform edge detection on images using an improved Canny operator; The module for obtaining the difference probability map is used to input the edge-detected drawing into the trained difference detection model and output the difference probability map. The module for obtaining differential region annotation results is used to perform threshold segmentation and morphological post-processing on the differential probability map to obtain the final differential region annotation results.

[0016] Compared with existing technologies, the advantages of this application are: 1. The traditional Canny operator is improved by introducing an adaptive Gaussian filtering mechanism to replace the fixed parameter filtering, and by combining nonlinear interpolation to optimize the nonmaximum suppression process, so as to achieve fine extraction of the edges of engineering drawings and improve the robustness and accuracy under the condition of low-quality scanned drawings.

[0017] 2. To address the need for detail recognition of differences in drawings, the bottom of the U-Net model pyramid structure is optimized by introducing dilated convolutions with different dilation rates to expand the receptive field and achieve effective fusion of multi-scale contextual information.

[0018] 3. After the dilated convolution module of the U-Net model, a 1×1 convolutional layer and the FReLU activation function are set to enhance the feature representation ability and improve the gradient propagation performance, thereby improving the overall accuracy of drawing difference detection.

[0019] 4. Differentiated Gaussian filtering standard deviation adjustment strategies are adopted for different types of local drawing areas. For noise-dominated areas with disordered grayscale changes, the smoothing effect is enhanced by increasing the σ value; while for areas with dense details such as lines, symbol edges, and annotations, the σ value is limited to a smaller range to protect structural features. Adaptive preprocessing of work order drawings is achieved through coordination of area determination and priority mechanisms. Attached Figure Description

[0020] Figure 1 The diagram shown is a flowchart of the method for comparing differences in nuclear power plant drawings. Figure 2 The diagram shows an edge refinement method based on nonlinear interpolation. Detailed Implementation

[0021] The technical solution of this application will be described in detail below with reference to the accompanying drawings.

[0022] This application provides a method and system for comparing differences in nuclear power plant drawings. This method and system, based on improved edge detection and deep learning, is used for automated difference identification and annotation of multiple versions of drawing files. Drawing files include, but are not limited to, exported CAD files, PDF files, scanned drawings, or on-site photographs.

[0023] Example 1 like Figure 1 As shown, the method for comparing differences in nuclear power plant drawings provided in this application includes: I. Drawing Data Acquisition and Preprocessing In practice, upon receiving the drawing files to be compared, the drawing data is first processed to achieve a unified format. For CAD files, they are first exported in a standardized manner and converted into high-resolution raster images; for PDF or scanned files, page images are extracted through image decoding and then processed to achieve unified resolution and grayscale.

[0024] In the drawing preprocessing stage, in order to further improve the adaptability to low-quality scanned drawings and photographed images, the Canny operator is used to perform edge detection processing on the images.

[0025] The Canny operator performs the following steps in image processing: 1. Image smoothing and denoising: Convolve the image with a 5×5 Gaussian filter to reduce noise interference (Gaussian filtering can balance the denoising effect and edge blurring, which is the basis for subsequent accurate detection). 2. Calculate gradient magnitude and direction: Calculate the gradient intensity (reflecting the magnitude of edge brightness changes) and gradient direction (the direction of the edge, usually classified into four directions: 0°, 45°, 90°, and 135°) of image pixels using the Sobel operator (x and y directions). 3. Non-maximum suppression (NMS): Traverse the gradient image, retain only the local maxima pixels along the gradient direction, discard the non-maximum pixels, and compress the wide edges to a single pixel width. 4. Dual threshold screening: Set a high threshold (H) and a low threshold (L, usually H=2L). Gradients with a gradient magnitude > H are "strong edges" (directly retained), those with a gradient magnitude < L are "weak edges" (directly removed), and those in between are "candidate edges". 5. Edge connection: If a candidate edge is directly connected to a strong edge, the candidate edge is retained (considered as an extension of the real edge); otherwise, it is discarded (considered as noise), thus forming a complete edge contour.

[0026] This application introduces an adaptive Gaussian filtering mechanism based on local image features into the image smoothing and denoising process of the Canny operator. Unlike traditional Gaussian filtering that uses a fixed standard deviation, this method dynamically adjusts the filtering parameters according to the noise distribution and grayscale changes in different regions of the drawing image, thereby maximizing the preservation of effective structural information in the drawing while ensuring noise suppression.

[0027] In specific implementation, let the input grayscale image be... In pixels The corresponding Gaussian filter function is defined as follows: in, This is an adaptive standard deviation parameter related to pixel location, used to reflect the smoothing intensity requirement of this local area. The value of is determined based on the local statistical characteristics of the image, such as by calculating the gray-level variance or gradient magnitude change rate within the neighborhood window centered on the pixel.

[0028] This invention determines whether a local region of an image belongs to image noise and the magnitude of gray-level changes based on a multi-feature joint quantization discrimination mechanism, specifically including the determination of local gray-level variance and gradient consistency, and the determination of gradient magnitude and structural response. 1. Joint determination based on local gray-level variance and gradient consistency pixels to be processed Construct a local neighborhood window of size w×w centered on the target. Calculate the local gray-level variance of this region. : in, This represents the average grayscale value within the neighborhood window. If a local area exhibits a large grayscale variance but the gradient direction is scattered and lacks a clear main direction, it can be determined that although there is strong grayscale fluctuation in this area, it belongs to a noise-dominated region.

[0029] 2. Determination based on gradient magnitude and structural response Calculate the average gradient magnitude of the local region and structural response indicators The structural response index can be obtained from the line structure detection operator or the corner response function.

[0030] When the following decision relationship is satisfied: This area can then be categorized as one with significant noise, drastic grayscale variations, but lacking clear structural features. and It is not a fixed constant, but a threshold range that is adaptively determined based on the statistical characteristics of the entire image.

[0031] Based on the above quantitative determination, this invention does not simply adopt discrete σ values, but constructs a continuous mapping relationship from local feature indicators to Gaussian standard deviation to achieve a smooth transition of filter intensity.

[0032] 3. Value range setting Standard deviation of adaptive Gaussian filter The following interval constraints must be met: in, The value ranges from 0.5 to 1.0 and is used for areas of drawings with dense details and clear structures. The value ranges from 2.0 to 3.5 and is used for scanning or photographing areas with significant noise and unstable structures.

[0033] 4. Mapping relationship with local features In practical implementation, the following monotonic mapping function is used. Adaptive adjustment: in: This is a reference variance value obtained based on statistics of the entire image or local sub-blocks; This is a normalized mapping function with an output range of [0,1]. It can be a linear function, a fractional function, or a sigmoid function.

[0034] When the local gray-level variance increases and the structural response weakens, the function The output approaches 1, making near This enhances smoothness; conversely, when the regional structure is clear, Automatically shrinks to preserve edge details.

[0035] In this application, areas with dense details such as lines, symbol edges, or annotation areas on drawings are not determined by subjective experience, but are identified by a multi-indicator quantitative judgment of local structural features.

[0036] 1. Determination based on the consistency between gradient magnitude and gradient direction In pixels Centered on its neighborhood window Internal calculation of average gradient magnitude and gradient direction consistency index .

[0037] When the local region satisfies: This indicates that the region possesses a clear and continuous edge structure, belonging to a region dominated by line or symbol edges. Specifically: G th and D th The threshold is adaptively determined based on the gradient distribution of the entire image; This measure measures the concentration of gradient directions within a local area; its value is larger when the direction distribution has a clear dominant direction. This type of area typically corresponds to pipeline outlines, component boundaries, or symbol frames in drawings.

[0038] 2. Determination based on local edge density In the edge map output by the improved Canny operator, the percentage of edge pixels within a local window is statistically analyzed, and an edge density index is defined. : in, N edge This represents the number of pixels within the neighborhood window that are determined to be valid edges. When When the density exceeds the preset threshold range, it indicates that the edge distribution of the area is dense, which usually corresponds to the area where the annotation text, size mark or symbol is concentrated, and can be classified as an area with dense detailed information.

[0039] 3. Value range setting For regions with dense detailed information, the adaptive Gaussian filter standard deviation Limited to a smaller range: in: The value range is 0.5 to 0.8; The value range is 1.0 to 1.2; this range setting ensures that while reducing minor noise, the clarity and continuity of the line edges are preserved.

[0040] 4. Mapping relationship with the intensity of detail features In the specific implementation, construct with local detail intensity index The reverse mapping relationship: in: It can be composed of a normalized combination of gradient magnitude, edge density, or structural response; It is a monotonically increasing normalization function with an output range of [0,1].

[0041] When the lines or symbols in a local area are more distinct The larger, the corresponding The closer This reduces the smoothing intensity, preventing details from being weakened; conversely, in areas where details are relatively weak but the structural integrity still needs to be maintained, the smoothing intensity is increased. It can be appropriately increased to balance noise suppression and structural preservation.

[0042] In regions with significant noise, drastic grayscale changes, but lacking clear structural features, the adaptive mechanism will increase... The value of expands the coverage of the Gaussian filter kernel, thereby enhancing the smoothing effect and suppressing random noise and scanning artifacts; while in areas with dense details such as lines, symbol edges, or annotation areas, the value is reduced accordingly. This is to avoid over-smoothing that could cause broken lines or loss of detail.

[0043] This interval setting ensures that while reducing subtle noise, the clarity and continuity of line edges are preserved.

[0044] After adaptive Gaussian filtering and smoothing, the drawing image enters the non-maximum suppression stage of the improved Canny operator. Non-maximum suppression filters pixels along the gradient direction, removing response points that do not belong to the true edges, thus achieving accurate edge localization. Traditional Canny operators typically only compare adjacent pixels in a fixed direction, failing to fully consider the continuity between the gradient direction and the distribution of neighboring pixels. This can easily lead to false edges or edge breaks in areas with dense lines or significant noise interference.

[0045] To overcome the above problems, this invention introduces an edge refinement method based on nonlinear interpolation during the nonmaximum suppression process. This method performs sub-pixel-level interpolation calculations along the gradient direction on the target pixel and its neighboring pixels to improve edge localization accuracy. For example... Figure 2 As shown, four adjacent sampling points, including the target pixel, are selected around the target pixel, and denoted as M. 11 M 12 M 21 M 22 The sampling points constitute a local two-dimensional neighborhood.

[0046] In practice, two nonlinear interpolation operations are first performed on the four sampling points along the x-direction of the image. The interpolation expression can be expressed as: in, This represents the grayscale interpolation function, where N1 and N2 are the intermediate pixel values ​​obtained after interpolation in the x-direction. Subsequently, using N1 and N2 as inputs, interpolation is performed in the y-direction to obtain the accurate grayscale response value of the target pixel in the gradient direction.

[0047] In specific implementation, the grayscale interpolation function A weighted nonlinear interpolation method is used to calculate the gray values ​​of adjacent pixels. Let the gray values ​​of two adjacent sampling points selected along the gradient direction be... and The corresponding interpolation position weight coefficients are ω and ω, respectively. Where 0≤ω≤1, the interpolation function can be expressed as: The weighting coefficient ω is determined based on the angle between the gradient direction of the target pixel and the coordinate axis direction, and is used to reflect the relative positional relationship between the interpolation point and the two sampling points.

[0048] In this invention, let the gradient direction angle of the target pixel be θ, then the weighting coefficients in the x and y directions can be defined as follows: Based on the aforementioned weighting coefficients, interpolation is first performed on the four neighboring sampling points in the x-direction to obtain the intermediate gray values ​​N1 and N2: By employing the aforementioned two-dimensional nonlinear interpolation process along the gradient direction, the discrete limitations of pixel center points can be overcome, enabling sub-pixel-level estimation of edge positions. The system compares this precise grayscale response value with its adjacent interpolation results along the gradient direction, retaining only the pixels corresponding to local maxima while suppressing the remaining pixels, thereby effectively eliminating false non-edge responses.

[0049] By repeating the interpolation and judgment process for each candidate edge pixel in the drawing image, continuous, refined, and accurately positioned edge contours can be obtained. Compared with traditional nonmaximum suppression methods, this improved scheme significantly reduces false edge phenomena caused by noise, scan distortion, or line overlap, and effectively reduces edge width, providing high-quality edge images for subsequent differential feature extraction and deep learning model input.

[0050] II. Construction of Differential Feature Extraction Model After edge detection preprocessing, the processed drawing image is input into the improved U-Net difference detection model. The overall structure of this model is based on an encoder-decoder framework, and while maintaining the original U-Net skip connection structure, targeted improvements are made to the bottom module of the pyramid structure.

[0051] Specifically, at the encoder-decoder connection point of the U-Net model, i.e., at the bottom of the network pyramid structure, the original ordinary convolutional layer structure is replaced with a multi-branch dilated convolutional feature extraction module. The dilation rates of this multi-branch dilated convolutional feature extraction module are set to 1, 3, and 5, respectively. Without increasing the number of parameters or computational complexity, this effectively expands the receptive field of feature extraction, enabling the model to simultaneously capture local detail differences and large-scale structural changes in drawings, adapting to drawings of different sizes and scales.

[0052] Let the input feature map be The output feature map Y is obtained by performing a dilated convolution operation on it. in, This represents a dilated convolution operation, where the dilation rate d takes values ​​of 1, 3, and 5. W i The weights are the convolution kernel weights, and `Concat` represents concatenating the output along the channel dimension. Through multi-scale convolution, the model can simultaneously perceive local details and structural information over a larger area.

[0053] After each dilated convolutional module, a 1×1 convolutional layer is set up to adjust the number of feature map channels, so as to achieve the fusion and compression of multi-scale features. After the 1×1 convolutional layer, the FReLU activation function is introduced to enhance the nonlinear expression capability through spatial condition modeling, which is beneficial to the learning of complex drawing texture and structural features.

[0054] To fuse multi-scale features and control the feature map depth, a 1×1 convolution and the FReLU activation function are introduced: in, W 1×1 is the convolution kernel weight, b is the bias, and the FReLU activation function is a spatially conditional nonlinear function that can effectively enhance feature representation and improve gradient propagation.

[0055] III. Drawing Difference Identification and Result Output In this invention, the improved U-Net model, after inference on the input drawing pair, outputs a difference probability map with the same size as the original image. Each pixel in the difference probability map corresponds to a difference confidence value within the interval [0,1], used to characterize the probability that the pixel belongs to a "difference region". To transform the difference probability map, which is in the form of a continuous probability distribution, into a discrete difference region that can be used for subsequent analysis, this invention performs threshold segmentation processing on the difference probability map, specifically including the following steps: 1. Threshold setting method The threshold T is not a fixed constant, but is adaptively set based on the overall distribution characteristics of the difference probability map. The threshold T is determined by the pixel mean of the probability map. μ with standard deviation σ The statistical threshold method is used to determine this, that is: Where k is an empirical coefficient; 2. Binarization process For each pixel in the difference probability map The following judgment rules shall be applied: In this model, pixels with a value of 1 represent candidate difference regions, and pixels with a value of 0 represent non-difference regions, thus obtaining the initial difference binary map.

[0056] Since the difference probability map may still have problems such as edge breakage, isolated noise or regional holes after segmentation, the present invention further performs morphological post-processing on the difference binary map to improve the integrity and interpretability of the difference region.

[0057] 1. Structural element settings The structural elements used in morphological operations are adaptively selected based on the drawing resolution and line width. The size range of rectangular structural elements is 3×3 to 7×7 to match the scale of common CAD lines and symbols.

[0058] 2. Isolated noise removal (opening operation) First, perform an opening operation on the difference binary image, i.e., erosion followed by dilation: Where S is a structural element.

[0059] This step is used to remove isolated noise regions that are small in area and irregular in shape, so as to avoid misidentifying non-real differences as valid differences.

[0060] 3. Region Connectivity and Edge Repair (Closed Operation) The processing result is then subjected to a closing operation, i.e., expansion followed by erosion: This step can fill the voids inside the difference region, repair the edge breakage caused by threshold segmentation, and make the difference region more spatially coherent.

[0061] The final annotated difference regions are obtained by thresholding and performing morphological post-processing on the difference probability map. These difference regions may include, but are not limited to, changes in line position, addition or deletion of symbols, adjustment of dimensions, and alteration of structural outlines. The system presents the difference results in the form of highlighted overlays, outline selections, or color markings for staff to quickly locate and verify.

[0062] Example 2 This application also provides a nuclear power plant drawing difference comparison system, implemented based on the above method, the system comprising: The format processing module is used to standardize the format of drawing files. An edge detection module is used to perform edge detection on images using an improved Canny operator; The module for obtaining the difference probability map is used to input the edge-detected drawing into the trained difference detection model and output the difference probability map. The module for obtaining differential region annotation results is used to perform threshold segmentation and morphological post-processing on the differential probability map to obtain the final differential region annotation results.

[0063] This application may also provide a computer device, including: at least one processor, memory, at least one network interface, and a user interface. The various components in this device are coupled together via a bus system. It is understood that the bus system is used to implement communication between these components. In addition to a data bus, the bus system also includes a power bus, a control bus, and a status signal bus.

[0064] The user interface can include a display, keyboard, or clicking device. Examples include a mouse, trackball, touchpad, or touchscreen.

[0065] It is understood that the memory in the embodiments disclosed in this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memories described herein are intended to include, but are not limited to, these and any other suitable types of memory.

[0066] In some implementations, the memory stores elements such as executable modules or data structures, or subsets thereof, or extended sets thereof: operating systems and applications.

[0067] The operating system includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application programs include various applications, such as media players and browsers, used to implement various application functions. Programs implementing the methods of the embodiments of this disclosure can be included in the application programs.

[0068] In the above embodiments, the processor can also invoke programs or instructions stored in memory, specifically programs or instructions stored in an application program, for the following purposes: Follow the steps described above.

[0069] The above methods can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the processor's hardware or by software instructions. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic diagrams disclosed above. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the disclosed methods can be directly implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0070] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof.

[0071] For software implementation, the technology of this application can be implemented by executing the functional modules (e.g., procedures, functions, etc.) of this application. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0072] This application may also provide a non-volatile storage medium for storing a computer program. When the computer program is executed by a processor, it can implement the steps in the above method embodiments.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of this application do not depart from the spirit and scope of the technical solutions of this application, and should all be covered within the scope of the claims of this application.

Claims

1. A method for comparing differences in nuclear power plant drawings, comprising: The drawing files are processed to a uniform format, and then the improved Canny operator is used to perform edge detection on the image; Input the edge-detected drawing into the trained difference detection model, and output a difference probability map; Threshold segmentation and morphological post-processing are performed on the difference probability map to obtain the final difference region annotation results.

2. The method for comparing differences in nuclear power plant drawings according to claim 1, characterized in that, The improved Canny operator includes: An adaptive Gaussian filtering mechanism based on local image features is introduced into the image smoothing and denoising step of the Canny operator, including: The Gaussian filter function is: ; in, To and The pixel-position-dependent adaptive standard deviation is used to reflect the smoothing intensity requirement of the local area; The following interval constraints must be met: ; in, The value range is 0.5 to 1.0; The value range is 2.0 to 3.5; Implemented using the following monotonic mapping function Adaptive adjustment: ; in: This is a reference variance value obtained based on statistics of the entire image or local sub-blocks; The normalized mapping function has an output range of [0,1], and can be a linear function, a fractional function, or a sigmoid function. For The local grayscale variance of a local neighborhood window centered on a pixel.

3. The method for comparing differences in nuclear power plant drawings according to claim 2, characterized in that, The improved Canny operator also includes: pixels to be processed Construct a local neighborhood window of size w×w centered on the target. Calculate the local gray-level variance of this region. : ; in, This represents the average grayscale value within the neighboring window. Image grayscale; Calculate the average gradient magnitude of the local region and structural response indicators Among them, structural response indicators Obtained by line structure detection operator or corner response function; When the following judgment relationship is satisfied: ; in, and These are the set local grayscale variance threshold and structural response index threshold, respectively; This area can then be classified as one with significant noise, drastic grayscale changes, but lacking clear structural features.

4. The method for comparing differences in nuclear power plant drawings according to claim 2, characterized in that, The improved Canny operator also includes: Areas with dense details include areas dominated by the edges of lines or symbols, as well as labeled areas; The method for determining the dominant region of the edge of the line or symbol is as follows: In pixels Centered on its neighborhood window Internal calculation of average gradient magnitude and gradient direction consistency index ; When the local region satisfies: ; in, and These are the set thresholds for average gradient magnitude and gradient direction consistency index, respectively. Then it is determined that the area has a clear and continuous edge structure and belongs to the area dominated by the edge of a line or symbol; The method for determining the marked area is as follows: Calculate the edge density index by statistically analyzing the percentage of edge pixels within a local window. : ; in, The number of pixels within the neighborhood window that are determined to be valid edges; when When the density exceeds the preset density threshold range, it indicates that the area is a labeled area.

5. The method for comparing differences in nuclear power plant drawings according to claim 4, characterized in that, The improved Canny operator also includes: For regions with dense detailed information, the adaptive Gaussian filter standard deviation Limited to a smaller range: ; in: The value range is 0.5 to 0.8; The value range is 1.0 to 1.2; Build with local detail intensity index The reverse mapping relationship: ; in: It consists of a normalized combination of gradient magnitude, edge density, or structural response; It is a monotonically increasing normalization function with an output range of [0,1].

6. The method for comparing differences in nuclear power plant drawings according to claim 1, characterized in that, The improved Canny operator also includes: An edge refinement method based on nonlinear interpolation is introduced in the nonmaximum suppression stage, including: Select four adjacent sampling points around the target pixel, including the target pixel itself. The sampling point in the lower left corner is denoted as M. 11 The sampling point in the upper left corner is M. 12 The sampling point in the lower right corner is denoted as M. 21 The sampling point in the upper right corner is denoted as M. 22 The sampling points constitute a local two-dimensional neighborhood; First, perform two nonlinear interpolation operations along the x-direction of the image for the four sampling points. The interpolation expression is as follows: ; in, Let N1 and N2 represent the intermediate pixel values ​​obtained after interpolation in the x-direction; then, using N1 and N2 as inputs, the grayscale interpolation function is applied in the y-direction. Interpolation is performed to obtain the grayscale response value of the target pixel in the gradient direction.

7. The method for comparing differences in nuclear power plant drawings according to claim 6, characterized in that, The grayscale interpolation function A weighted nonlinear interpolation method is used to perform weighted calculations on the grayscale values ​​of adjacent pixels, including: Gray value interpolation function representation for: ; in, and For the gray values ​​of two adjacent sampling points selected along the gradient direction, the corresponding interpolation position weighting coefficients are ω and ω, respectively. 0≤ω≤1; the weighting coefficient ω is divided into weighting systems in the x and y directions. and The calculation method is as follows: ; Where θ is the gradient direction angle of the target pixel.

8. The method for comparing differences in nuclear power plant drawings according to claim 1, characterized in that, The difference detection model is derived from a modified U-Net model, and the modification method is as follows: Replace the convolutional layer structure at the encoder-decoder connection of the U-Net model with a multi-branch dilated convolutional feature extraction module; The multi-branch dilated convolution feature extraction module includes three dilated convolutional layers, each of which is followed by a 1×1 convolutional layer and an FReLU activation function. The dilation rates of the three dilated convolutional layers are 1, 3, and 5, respectively.

9. The method for comparing differences in nuclear power plant drawings according to claim 1, characterized in that, The threshold segmentation and morphological post-processing of the difference probability map include: For each pixel in the difference probability map Perform the following judgment: ; Among them, the judgment result Pixels with a value of 1 represent candidate difference regions, and pixels with a value of 0 represent non-difference regions, thus obtaining an initial binary difference map; the threshold T is obtained based on the pixel mean of the probability map. μ with standard deviation σ The statistical threshold method is used to determine: ; in, k This is an empirical coefficient; The initial difference binary image and the structuring element are subjected to erosion followed by dilation, and then the processed result and the structuring element are subjected to dilation followed by erosion. The structuring element is a rectangular structuring element with a size range of 3×3 to 7×7.

10. A nuclear power plant drawing discrepancy comparison system, implemented based on the method described in any one of claims 1-9, characterized in that, The system includes: The format processing module is used to standardize the format of drawing files. An edge detection module is used to perform edge detection on images using an improved Canny operator; The module for obtaining the difference probability map is used to input the edge-detected drawing into the trained difference detection model and output a difference probability map; and The module for obtaining differential region annotation results is used to perform threshold segmentation and morphological post-processing on the differential probability map to obtain the final differential region annotation results.