Layout similarity calculation method and device, storage medium and electronic equipment
Patent Information
- Application Number
- CN202611383697.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-08
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]然而,目前的版图相似度计算方案属于无状态计算,即每次进行相似度判断时均需重新提取当前待比对版图图形的几何特征,已计算完成的图形特征无法被存储及复用,导致在处理大规模版图检索或批量比对任务时存在重复计算严重,导致版图相似度计算的效率低下
[0015]第三方面,本申请提供了一种存储介质,所述存储介质存储有多条指令,所述指令适用于处理器进行加载,以执行上述任一项所述的版图相似度计算方法。
Smart Images

Figure CN122967306A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of integrated circuit design automation (EDA) technology, specifically to a layout similarity calculation method, apparatus, storage medium, and electronic device. Background Technology
[0002] In the field of EDA technology, layout similarity calculation is a key technology in physical verification, layout retrieval, and intellectual property verification. As integrated circuit process nodes continue to evolve, the complexity of chip layouts is increasing exponentially. Traditional geometric comparison methods are inefficient when processing massive amounts of layout data, and there is an urgent need to introduce new technologies to improve the efficiency and intelligence of layout similarity calculation.
[0003] Currently, the calculation of map similarity mainly adopts the method of geometric feature extraction and comparison. The geometric features (such as vertex coordinates, side length, angle, area and topological relationship, etc.) of the two maps to be compared are extracted respectively, and the similarity is calculated by comparing the differences of features.
[0004] However, current map similarity calculation schemes are stateless, meaning that the geometric features of the current map to be compared must be extracted each time a similarity judgment is made. The calculated graphic features cannot be stored and reused, resulting in serious duplication of calculations when processing large-scale map retrieval or batch comparison tasks, leading to low efficiency in map similarity calculation. Summary of the Invention
[0005] This application provides a layout similarity calculation method, apparatus, storage medium, and electronic device, which can improve the efficiency of layout similarity calculation.
[0006] In a first aspect, embodiments of this application provide a method for calculating map similarity, including: Obtain the first and second layout graphics to be processed, extract the original coordinates of each vertex in the first and second layout graphics respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphics to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence. The first normalized coordinate sequence and the second normalized coordinate sequence are respectively converted into a first coordinate text sequence and a second coordinate text sequence; and / or, the first map graphic and the second map graphic are respectively rendered into a first rendered image and a second rendered image; Input the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain the first feature vector; Input the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain the second feature vector; Calculate the vector similarity between the first feature vector and the second feature vector, and use the vector similarity as the map similarity between the first map graphic and the second map graphic.
[0007] In the map similarity calculation method provided in this application embodiment, for any map graphic in the first map graphic and the second map graphic, the normalization of the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each map graphic includes: Obtain the set of all vertex coordinates of the layout graphic, calculate the minimum value of the x-coordinate and the minimum value of the y-coordinate in the vertex coordinate set, and use the coordinate point formed by the minimum value of the x-coordinate and the minimum value of the y-coordinate as the coordinate of the lower left corner of the bounding box of the layout graphic; Subtract the coordinates of the lower left corner of the bounding box from the coordinates of each vertex of the layout graphic to obtain a normalized coordinate sequence.
[0008] In the map similarity calculation method provided in this application embodiment, for any normalized coordinate sequence in the first normalized coordinate sequence and the second normalized coordinate sequence, the normalized coordinate sequence is converted into a coordinate text sequence, including: The x and y coordinates of each vertex in the normalized coordinate sequence are truncated to floating-point numbers with a fixed number of decimal places according to a preset precision. The truncated x and y coordinates of each vertex are concatenated into a continuous string in alternating order, and the concatenated string is used as the coordinate text sequence corresponding to the normalized coordinate sequence.
[0009] In the map similarity calculation method provided in this application embodiment, if the length of the coordinate text sequence corresponding to the first normalized coordinate sequence and / or the second normalized coordinate sequence exceeds the preset fixed sequence length, the Douglas-Pock curve simplification algorithm is used in advance to compress the polygon outline of the corresponding map graphic to control the number of compressed vertices to within half of the fixed sequence length before performing coordinate transformation.
[0010] In the map similarity calculation method provided in this application embodiment, if the length of the coordinate text sequence is greater than the fixed sequence length, the coordinate text sequence is truncated. If the length of the coordinate text sequence is less than the fixed sequence length, then placeholders are added to the end of the coordinate text sequence to align the length of the coordinate text sequence with the fixed sequence length.
[0011] In the layout similarity calculation method provided in this application embodiment, the pre-training process of the SigLIP network includes: Construct training sample pairs, using the coordinate text sequence and rendered image of the same map graphic as positive sample pairs, and the coordinate text sequence and rendered image of different map graphics as negative sample pairs. The positive and negative sample pairs are trained using a sigmoid loss function, which is expressed as follows:
[0012] in, ; In the above formula, N represents the batch size, i.e., the total number of sample pairs participating in each training iteration; x i y represents the feature vector of the graph mode in the i-th sample; j This represents the feature vector of the text modality in the j-th sample; is the temperature hyperparameter used to control the smoothness of the predicted distribution; b is the bias term; z ij This is a label item used to identify whether the current sample pair is a positive or negative sample pair; For vector x i Perform a transpose operation to transform the column vector into a row vector.
[0013] In the layout similarity calculation method provided in this application embodiment, during the data augmentation stage of the pre-training phase, the original vertex coordinates of the first layout graphic and / or the second layout graphic are rotated by 90 degrees, 180 degrees or 270 degrees, and / or horizontally flipped or vertically flipped. The rotated or flipped variant graphic and the coordinate text sequence of the same layout graphic are still used as positive sample pairs for training, so as to enhance the robustness of the SigLIP network to graphic rotation and mirroring.
[0014] Secondly, embodiments of this application provide a layout similarity calculation apparatus, including: The acquisition unit is used to acquire the first and second layout graphics to be processed, extract the original coordinates of each vertex in the first and second layout graphics respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphic to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence. The conversion unit is configured to convert the first normalized coordinate sequence and the second normalized coordinate sequence into a first coordinate text sequence and a second coordinate text sequence, respectively; and / or to render the first map graphic and the second map graphic into a first rendered image and a second rendered image, respectively. The extraction unit is configured to input the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain a first feature vector; and input the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain a second feature vector. The calculation unit is used to calculate the vector similarity between the first feature vector and the second feature vector, and to use the vector similarity as the map similarity between the first map graphic and the second map graphic.
[0015] Thirdly, this application provides a storage medium storing a plurality of instructions that are adapted for loading by a processor to execute the layout similarity calculation method described in any of the preceding claims.
[0016] Fourthly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the layout similarity calculation method described in any of the preceding claims.
[0017] In summary, the layout similarity calculation method provided in this application includes obtaining a first layout graphic and a second layout graphic to be processed; extracting the original coordinates of each vertex in the first layout graphic and the second layout graphic respectively; normalizing the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphic to obtain a corresponding first normalized coordinate sequence and a second normalized coordinate sequence; converting the first normalized coordinate sequence and the second normalized coordinate sequence into a first coordinate text sequence and a second coordinate text sequence respectively; and / or rendering the first layout graphic and the second layout graphic into a first rendered image and a second rendered image respectively; inputting the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain a first feature vector; inputting the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain a second feature vector; calculating the vector similarity between the first feature vector and the second feature vector, and using the vector similarity as the layout similarity between the first layout graphic and the second layout graphic. This application embodiment can extract feature vectors of the layout graphics through a pre-trained SigLIP network. In large-scale retrieval tasks, the feature vectors can be stored and reused by performing offline inference only once. Each time similarity is compared, the similarity between the stored feature vectors can be calculated directly without repeatedly extracting geometric features. Furthermore, the SigLIP network is pre-trained using the Sigmoid loss function, which can converge without relying on the global normalization factor within the batch size, reducing hardware overhead and thus improving the efficiency of layout similarity calculation. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram illustrating an application scenario of the layout similarity calculation method provided in the embodiments of this application.
[0020] Figure 2 This is a flowchart illustrating the layout similarity calculation method provided in the embodiments of this application.
[0021] Figure 3 This is a schematic diagram of the layout similarity calculation device provided in the embodiments of this application.
[0022] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0023] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.
[0024] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.
[0025] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0026] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.
[0027] In the description of this application, it should be noted that the terms "upper," "lower," "left," "right," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. In addition, terms such as "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0028] Current map similarity calculation schemes are stateless, meaning that the geometric features of the current map to be compared must be extracted each time a similarity judgment is made. The calculated graphic features cannot be stored and reused, resulting in serious duplication of calculations when processing large-scale map retrieval or batch comparison tasks, leading to low efficiency in map similarity calculation.
[0029] Based on this, embodiments of this application provide a layout similarity calculation method, apparatus, storage medium, and electronic device. Specifically, the layout similarity calculation apparatus can be integrated into an electronic device, which can be a server or a terminal, etc. The terminal can include mobile phones, wearable smart devices, tablets, laptops, and personal computers (PCs), etc., as well as other computer and auxiliary devices. The server can be a single server or a server cluster composed of multiple servers, and can be a physical server or a virtual server.
[0030] For example, such as Figure 1As shown, the electronic device can acquire a first layout graphic and a second layout graphic to be processed, extract the original coordinates of each vertex in the first layout graphic and the second layout graphic respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphic to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence; convert the first normalized coordinate sequence and the second normalized coordinate sequence into a first coordinate text sequence and a second coordinate text sequence respectively; and / or render the first layout graphic and the second layout graphic into a first rendered image and a second rendered image respectively; input the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain a first feature vector; input the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain a second feature vector; calculate the vector similarity between the first feature vector and the second feature vector, and use the vector similarity as the layout similarity between the first layout graphic and the second layout graphic.
[0031] The technical solutions shown in this application will be described in detail below through specific embodiments. It should be noted that the order of description of the following embodiments is not intended to limit the priority of the embodiments.
[0032] Please see Figure 2 , Figure 2 This is a schematic flowchart of the layout similarity calculation method provided in an embodiment of this application. The specific flow of the layout similarity calculation method can be as follows: 101. Obtain the first and second layout graphics to be processed, extract the original coordinates of each vertex in the first and second layout graphics respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphic to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence.
[0033] In this embodiment, the first and second layout graphics are any two partial layout areas to be compared within an integrated circuit layout. Each layout graphic may contain one or more polygons. In integrated circuit layout design, a complete chip layout typically contains hundreds of millions of geometric shapes. However, layout similarity calculation often does not require a global comparison of the entire chip layout; instead, it compares partial layout areas extracted from the complete layout. These extracted partial layout areas are the layout graphics. The polygons within the layout graphics can be linear polygons or curved polygons. Curved polygons are formed by connecting multiple vertices sequentially to create a broken line segment that approximates a curve.
[0034] The original coordinates of a vertex refer to its physical coordinates in the chip's global coordinate system, typically measured in nanometers or micrometers. Since the same pattern may have completely different absolute coordinates at different physical locations within the chip layout, directly using the original coordinates for similarity assessment could lead to misclassification of the same pattern as different patterns due to their different positions. To eliminate the influence of the absolute position of the pattern in the chip's global coordinate system on similarity assessment, the original coordinates of each vertex need to be normalized based on the coordinates of the lower-left corner of the bounding box of each pattern.
[0035] For any of the first and second map graphics, the specific process of normalizing the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of that map graphic is as follows: First, obtain the set of coordinates of all vertices of the graphic layout. Assuming the graphic layout contains m vertices, the set of vertex coordinates can be represented as {(X_1,Y_1),(X_2,Y_2),...,(X_m,Y_m)}.
[0036] Then, iterate through all vertices in the vertex coordinate set and calculate the minimum x-coordinate X_min and the minimum y-coordinate Y_min in the vertex coordinate set. Use the coordinate point (X_min, Y_min) formed by the minimum x-coordinate X_min and the minimum y-coordinate Y_min as the coordinates of the lower left corner of the bounding box of the map.
[0037] Here, the bounding box refers to the smallest rectangle that can exactly enclose all the vertices of the graphic. The coordinates of the lower left corner of the rectangle are the coordinates formed by the minimum x-coordinate and the minimum y-coordinate of all the vertices.
[0038] Next, subtract the coordinates of the lower left corner of the bounding box (X_min, Y_min) from the coordinates of each vertex of the layout graphic, that is, update the coordinates of each vertex of the layout graphic (X_i, Y_i) to (X_i-X_min, Y_i-Y_min), to obtain the normalized vertex coordinates. After the above normalization process, the coordinates of all vertices of the layout graphic are transformed into coordinate values in a local coordinate system with the lower left corner of the bounding box as the origin, and the minimum value of both the x-coordinate and y-coordinate is zero.
[0039] For example, suppose a map contains three vertices with original coordinates of (10,20), (30,40), and (50,10). The minimum x-coordinate and minimum y-coordinate of this set of vertex coordinates are both 10. Therefore, the coordinates of the bottom left corner of the bounding box are (10,10). Subtracting (10,10) from each vertex coordinate yields normalized vertex coordinates of (0,10), (20,30), and (40,0).
[0040] By performing the above normalization operation sequentially on the first and second layout graphics, a first normalized coordinate sequence and a second normalized coordinate sequence can be obtained. Each normalized coordinate sequence is formed by arranging the normalized vertex coordinates of all the corresponding layout graphics in a preset order, such as according to the connection order of the vertices in the polygon outline, in the format {(X_1,Y_1),(X_2,Y_2),...,(X_n,Y_n)}.
[0041] That is, for any one of the first and second layout graphics, the step "normalizing the original coordinates of each vertex based on the lower left corner coordinates of the bounding box of each layout graphic" may include: obtaining the set of coordinates of all vertices of the layout graphic, calculating the minimum value of the x-coordinate and the minimum value of the y-coordinate in the vertex coordinate set, using the coordinate point formed by the minimum value of the x-coordinate and the minimum value of the y-coordinate as the lower left corner coordinate of the bounding box of the layout graphic; subtracting the lower left corner coordinate of the bounding box from the coordinates of each vertex of the layout graphic to obtain the normalized coordinate sequence.
[0042] This application's embodiments eliminate the interference of the absolute position of the graphic in the chip's global coordinate system on subsequent similarity judgment by performing translation normalization on the layout graphics. Specifically, translation normalization ensures translation invariance, meaning that even if the same layout graphic appears in different physical locations on the chip layout, its normalized coordinate sequence is completely consistent, thus ensuring that the similarity judgment result is not affected by graphic translation. At the same time, the normalization process significantly reduces and concentrates the range of coordinate values, mapping the coordinate values of all layout graphics to a local coordinate system with the lower left corner of the bounding box as the origin. This avoids the numerical instability caused by excessive differences in the absolute coordinate value range of different layout graphics, which is beneficial for the subsequent efficient processing of the coordinate text sequence by the text encoder.
[0043] 102. Convert the first normalized coordinate sequence and the second normalized coordinate sequence into a first coordinate text sequence and a second coordinate text sequence, respectively; and / or render the first map graphic and the second map graphic into a first rendered image and a second rendered image, respectively.
[0044] In this embodiment, the input modality of the layout graphic supports multiple forms. Specifically, for any layout graphic, it can be that only the normalized coordinate sequence of the layout graphic is converted into a coordinate text sequence and input into the SigLIP network in text modality; or it can be that only the layout graphic is rendered into a rendered image and input into the SigLIP network in image modality; or it can be that the layout graphic is simultaneously converted into both a coordinate text sequence and a rendered image and input into the SigLIP network in both modalities.
[0045] It should be noted that the above-mentioned multiple modal input methods can be freely combined to adapt to the input format requirements of different engineering scenarios. For example, when two layout graphics are stored in graphic data structures (such as GDSII or OASIS file formats), their respective coordinate text sequences and rendered images can be extracted simultaneously; when one layout graphic is stored in a graphic data structure while the other layout graphic exists only as a screenshot or optical photograph, the former can extract coordinate text sequences and / or rendered images, while the latter can only provide rendered images. In this case, a text-image cross-modal comparison mode can be used.
[0046] For any normalized coordinate sequence in the first or second normalized coordinate sequence, the specific process of converting the normalized coordinate sequence into a coordinate text sequence is as follows: First, the x and y coordinates of each vertex in the normalized coordinate sequence are truncated to floating-point numbers with a fixed number of decimal places according to a preset precision. Since normalized coordinate values are usually floating-point numbers, retaining all decimal places would result in an excessively long coordinate text sequence, and too many decimal places are unnecessary for representing the geometric structure of the layout. The preset precision can be set according to actual application needs, such as retaining three or four decimal places. The truncation operation can be performed using rounding or direct truncation.
[0047] Then, the truncated x and y coordinates of each vertex are concatenated into a continuous string in alternating order. This concatenated string serves as the coordinate text sequence corresponding to the normalized coordinate sequence. Specifically, for the normalized coordinate sequence {(X_1,Y_1),(X_2,Y_2),...,(X_n,Y_n)}, the concatenated coordinate text sequence is "X_1,Y_1,X_2,Y_2,...,X_n,Y_n", where each coordinate value is separated by a delimiter (such as a comma).
[0048] For example, the normalized vertex coordinates are (0.1234, 10.5678) and (20.9012, 30.3456). If the preset precision is to retain three decimal places, the truncated values are (0.123, 10.568) and (20.901, 30.346). The concatenated coordinate text sequence is "0.123, 10.568, 20.901, 30.346".
[0049] In addition, since the text encoder requires a fixed sequence length for the input, a fixed sequence length is preset. This fixed sequence length refers to the maximum input sequence length that the text encoder can accept.
[0050] In some embodiments, if the length of the coordinate text sequence is greater than the fixed sequence length, the coordinate text sequence is truncated, for example, retaining the first K characters (K is the fixed sequence length) and discarding the excess. If the length of the coordinate text sequence is less than the fixed sequence length, a placeholder is added to the end of the coordinate text sequence, for example, by continuously adding "0" characters or specific padding marks to the end of the sequence, so that the length of the coordinate text sequence is aligned with the fixed sequence length.
[0051] It should be noted that the fixed sequence length is determined based on the vertex count distribution of all layout graphics in the training dataset. Specifically, it is the coordinate sequence length value corresponding to the 99.9th percentile of this distribution, to balance the complete representation of the vast majority of layout graphics with the rational use of computational resources. Since a very small number of layout graphics have a vertex count far exceeding the norm, setting the fixed sequence length according to the maximum value would result in a large amount of padding in most samples, wasting computational resources. Therefore, the 99.9th percentile is used as the fixed sequence length, which covers the vast majority of layout graphics while avoiding excessive waste of resources.
[0052] In another embodiment, for the first normalized coordinate sequence and / or the second normalized coordinate sequence, if the length of the corresponding coordinate text sequence after transformation exceeds the preset fixed sequence length, the Douglas-Puk curve simplification algorithm is used in advance to compress the vertices of the polygonal outline of the corresponding map graphic, and the number of vertices after compression is controlled to be within half of the fixed sequence length before the coordinate transformation is performed, so as to avoid the loss of high-frequency geometric information caused by direct truncation.
[0053] The Douglas-Pock curve simplification algorithm is a classic curve simplification algorithm. Its basic principle is as follows: given a curve defined by several vertices, a distance threshold is set, and the algorithm recursively removes intermediate vertices that contribute little to the overall shape. Specifically, the algorithm first connects the first and last vertices of the curve to form a straight line. Then, it calculates the perpendicular distance from all intermediate vertices on the curve to this straight line. If the maximum value of all distances is less than the preset threshold, all intermediate vertices are discarded; otherwise, the vertex with the largest distance is retained, and the curve is divided into two segments using this vertex as the dividing point. The simplification process is then recursively applied to each segment. The Douglas-Pock curve simplification algorithm effectively reduces the number of vertices while maintaining the overall outline of the graphic, allowing the coordinate text sequence to adapt to the input length requirements of the text encoder, while preserving geometric feature information to the maximum extent.
[0054] For any one of the first and second map graphics, render the map graphics into the corresponding rendered image, as follows: First, determine the target resolution of the rendering canvas based on the aspect ratio of the bounding box of the layout graphic. The target resolution can be preset, for example, to 224×224 pixels or 512×512 pixels. If the aspect ratio of the bounding box of the layout graphic does not match the aspect ratio of the target resolution, anisotropic scaling of the layout graphic is required to fit the rendering canvas. This involves scaling the graphic along both the horizontal and vertical directions at different ratios, ensuring the layout graphic precisely fills the rendering canvas. Anisotropic scaling ensures the layout graphic occupies the largest possible area on the rendering canvas, avoiding sparse image features due to excessive white space.
[0055] Secondly, the scaled-down graphic is rasterized to generate a raster image. Rasterization is the process of converting vector graphics (polygons defined by vertex coordinates) into a raster image (an image composed of a pixel matrix). During rasterization, pixels inside the polygons are filled with preset color values (such as white or a specific grayscale value), while pixels outside the polygons are filled with the background color (such as black). An anti-aliasing algorithm is used to smooth the edges of the polygons in the raster image. The anti-aliasing algorithm eliminates jagged visual effects by applying gradient color processing to the pixel edges of the graphic, making the edges of the polygons in the rendered image smoother and more continuous, which is beneficial for the image encoder to extract stable visual features.
[0056] When a layout graphic contains multiple different process layers, these layers are mapped to different color channels or pseudo-colors of a raster image to generate a multi-channel rendered image. For example, the first metal layer is mapped to the red channel, the second metal layer to the green channel, and the via layer to the blue channel. This allows the spatial location information and hierarchical relationships of multiple process layers to be preserved simultaneously in a single rendered image, enabling the image encoder to learn the inter-layer topology.
[0057] This application's embodiments can flexibly support two input modalities: coordinate text and rendered images. When one input is a coordinate data stream and the other is a rendered image, the model can still extract feature vectors through the text encoder and image encoder respectively, and perform similarity calculations in the same shared embedding space, thereby achieving cross-modal comparison. This multimodal adaptation mechanism greatly expands the applicability of the solution in engineering practice, making it compatible with various input formats such as GDSII files, OASIS files, layout screenshots, and optical microscopic images.
[0058] 103. Input the first coordinate text sequence and / or the first rendered image into the pre-trained SigLIP network to obtain the first feature vector; input the second coordinate text sequence and / or the second rendered image into the pre-trained SigLIP network to obtain the second feature vector.
[0059] It is understood that the SigLIP network in this application embodiment includes a text encoder for processing text modal input and an image encoder for processing image modal input, and the SigLIP network is pre-trained using the Sigmoid loss function.
[0060] It should be noted that the original CLIP network includes a text encoder and an image encoder, which encode natural language text and natural images respectively. Through contrastive learning, matching text-image pairs are brought closer together in the shared embedding space, while mismatched text-image pairs are pushed apart. This application replaces the input of the text encoder of the original CLIP network with a sequence of coordinate text representing a layout graphic, and replaces the input of the image encoder with a rendered image of the layout graphic. Through contrastive learning, the coordinate text sequences of the same layout graphic are brought closer to the rendered image in the shared embedding space, while the coordinate text sequences of different layout graphics are pushed apart, thereby enabling the encoder to learn the geometric structural features of the layout graphics.
[0061] In some embodiments, the text encoder of the SigLIP network adopts a Transformer architecture. For the input coordinate text sequence, the text encoder first performs word segmentation on the coordinate text sequence, splitting it into several words, then converting each word into an embedding representation (i.e., word vector) that the model can understand, and then encodes it through multiple Transformer layers, finally outputting a fixed-dimensional text feature vector.
[0062] In this embodiment, the text encoder employs a character-level segmentation strategy to segment the coordinate text sequence. Character-level segmentation refers to treating each character (including numeric characters, decimal points, minus signs, separators, etc.) in the coordinate text sequence as an independent word. Accordingly, a vocabulary containing only numeric characters (0 to 9), the decimal point character ".", the minus sign character "-", and separator characters (such as commas, "") is constructed. The advantage of using a character-level segmentation strategy is that, since the coordinate values of the map are constantly changing, if conventional word-level segmentation is used, almost every different coordinate value will generate a new word, leading to an infinitely expanding vocabulary and a large number of words rarely appearing during training; while the vocabulary size of character-level segmentation is fixed and extremely small, any coordinate value can be represented by a limited combination of numeric and symbol characters, avoiding the problem of the segmenter being unable to recognize due to changes in coordinate values.
[0063] In some embodiments, the image encoder of the SigLIP network can employ a Vision Transformer architecture or a ResNet architecture. When using the Vision Transformer architecture, the rendered image is divided into multiple fixed-size image blocks, for example, a 224×224 pixel rendered image is divided into 14×14 16×16 pixel image blocks. Each image block is linearly transformed and embedded into a vector sequence. Then, a multi-layer self-attention mechanism is used to model the global dependencies between the image blocks, capturing the global features of the rendered image, and finally outputting a fixed-dimensional image feature vector. When using the ResNet architecture, multiple convolutional layers progressively extract local features of the rendered image. Shallow convolutional kernels extract low-level geometric features such as edges and corners, while deep convolutional kernels extract more abstract graphic structural features. Finally, global average pooling aggregates all local features into a fixed-dimensional image feature vector.
[0064] After inputting the first coordinate text sequence and / or the first rendered image into the pre-trained SigLIP network, forward inference is performed through a text encoder and / or an image encoder to obtain the corresponding first feature vector. Specifically, if only the first coordinate text sequence is input, the first feature vector is obtained through the text encoder; if only the first rendered image is input, the first feature vector is obtained through the image encoder; if both the first coordinate text sequence and the first rendered image are input simultaneously, two feature vectors can be obtained respectively. In practical applications, one of them can be selected or the two can be fused as needed.
[0065] Similarly, after inputting the second coordinate text sequence and / or the second rendered image into the pre-trained SigLIP network, the second feature vector is obtained. The first and second feature vectors are located in the same shared embedding space, that is, a vector space with the same dimension, which facilitates subsequent vector similarity calculation.
[0066] In addition, in this embodiment of the application, the SigLIP network supports the following three inference modes during the input phase.
[0067] The first mode is text-to-text inference. This mode is enabled when the input consists of coordinate text sequences of two map graphics. The two coordinate text sequences are then input separately into a text encoder to extract features. This mode is suitable for scenarios where both map graphics exist in coordinate data form and image rendering is not required, offering the highest computational efficiency.
[0068] The second mode is text-image inference. This mode is enabled when the input consists of a coordinate text sequence of one layout graphic and a rendered image of another layout graphic. The coordinate text sequence is input to a text encoder, and the rendered image is input to an image encoder to extract features. This mode is suitable for scenarios where one layout graphic is stored as coordinate data while the other exists only as an image, such as comparing a standard layout graphic in a GDS file with a chip micrograph.
[0069] The third type is the image-image reasoning mode. This mode is enabled when the input consists of rendered images of two different map graphics. The two rendered images are then input into an image encoder to extract features. This mode is suitable for scenarios where both map graphics exist as images and there is no need for coordinate text serialization, such as directly comparing two map screenshots.
[0070] In this embodiment, a pre-trained SigLIP network is used to extract features from the layout graphics, encoding the high-dimensional, unstructured geometric information of the layout graphics into compact, structured feature vectors. Because the SigLIP network is pre-trained, its encoding process incorporates prior knowledge of geometric structure learned from large-scale layout data, resulting in feature vectors with stronger semantic expressiveness and generalization ability. Furthermore, the feature vectors obtained from a single inference can be stored in a database and directly reused in subsequent similarity judgments without repeated geometric feature extraction, effectively avoiding the problem of redundant computation in traditional methods.
[0071] In this embodiment of the application, the pre-training process of the SigLIP network can be specifically as follows: First, construct training sample pairs. Use coordinate text sequences and rendered images of the same graphic layout as positive sample pairs. Since the coordinate text sequences and rendered images in positive sample pairs originate from the same graphic layout and are geometrically identical, the model should encode them as similar feature vectors. Use coordinate text sequences and rendered images of different graphic layouts as negative sample pairs. Since the coordinate text sequences and rendered images in negative sample pairs originate from different graphic layouts and are geometrically different, the model should encode them as dissimilar feature vectors.
[0072] Then, the Sigmoid loss function is used for binary classification training on positive and negative sample pairs. This Sigmoid loss function transforms the similarity calculation between feature vectors into a binary classification problem, that is, determining whether the input coordinate text sequence and the rendered image belong to the same map. The expression for the Sigmoid loss function is:
[0073] in, ; In the above expression, the meanings of each parameter are as follows: N represents the batch size, i.e., the total number of sample pairs participating in each training iteration. During training, N map graphics are selected from the training dataset in each iteration. Each map graphic corresponds to a coordinate text sequence and a rendered image, for a total of N coordinate text sequences and N rendered images. These are then paired to form N×N sample pairs. Among them, N are positive sample pairs (coordinate text sequences and rendered images from the same map graphic), and N×(N-1) are negative sample pairs (coordinate text sequences and rendered images from different map graphics).
[0074] x i This represents the feature vector of the graphic mode of the i-th layout graphic. Specifically, when i takes values from 1 to N, x i x is the feature vector obtained by encoding the rendered image of the i-th layout graphic using an image encoder. i The dimension is d, which is the length of the feature vector.
[0075] y j This represents the feature vector of the text modality of the j-th layout graphic. Specifically, when j takes values from 1 to N, y j y is the feature vector obtained by encoding the coordinate text sequence of the j-th map graphic using a text encoder. j The dimension is also d, and the same as x. i They reside in a shared embedded space within the same dimension.
[0076] For vector x i Perform a transpose operation to transform the column vector into a row vector. Represents the eigenvector x i With the eigenvector y j The dot product between the two feature vectors. The larger the dot product value, the more consistent the directions of the two feature vectors, meaning the more similar the inputs of the two modalities; the smaller the dot product value, the greater the difference in the directions of the two feature vectors, meaning the less similar the inputs of the two modalities.
[0077] This is a temperature hyperparameter used to control the smoothness of the predicted distribution. When the value is small, the difference in the dot product value is amplified after scaling, and the model's prediction becomes more "sharp". When the value is large, the differences in the dot product are compressed after scaling, making the model's predictions more "smooth." Temperature hyperparameter It can be dynamically adjusted as the number of iterations increases during training, or it can be preset as a fixed hyperparameter.
[0078] b is a bias term used to adjust the activation threshold of the sigmoid function. The presence of the bias term b allows the model to produce reasonable prediction probabilities even when the dot product value is close to zero, thus enhancing the model's fitting ability.
[0079] z ij This is a label used to identify whether the current sample pair is a positive or negative sample pair. When i equals j, the i-th coordinate text sequence and the j-th rendered image originate from the same map graphic, z. ij A value of 1 indicates a positive sample pair. When i is not equal to j, the i-th coordinate text sequence and the j-th rendered image originate from different map graphics. ij A value of -1 indicates a negative sample pair.
[0080] In this embodiment, the training objective of the Sigmoid loss function is: for positive sample pairs, to make the output of the Sigmoid function approach 1, meaning that the coordinate text sequence and the rendered image are correctly identified as a match; for negative sample pairs, to make the output of the Sigmoid function approach 0, meaning that the coordinate text sequence and the rendered image are correctly identified as a mismatch. The network parameters of both the text encoder and the image encoder are updated simultaneously using the backpropagation algorithm until the loss function converges.
[0081] Understandably, CLIP's Softmax loss function requires global normalization over all sample pairs within the batch size. Specifically, the denominator of the Softmax loss function includes the sum of the similarities between the current sample pair and all other sample pairs within the batch size; therefore, the loss value of a single sample pair depends on every negative sample pair within the batch size. This global normalization mechanism requires a sufficiently large batch size (e.g., CLIP uses a batch size of 32768) to provide enough negative sample pairs to support effective contrastive learning. Large-batch training requires parallel computation on multiple GPUs and extensive feature communication (full collection operation) between these GPUs, resulting in significant hardware overhead. In contrast, the Sigmoid loss function used in this application does not rely on the global normalization factor within the batch size when calculating the loss of a single sample pair; the loss calculation for each sample pair is independent of other sample pairs within the batch size. Therefore, even with a smaller batch size (e.g., 256 or 512), the model can still converge effectively because the gradient signal of each sample pair originates only from the prediction error of that sample pair itself, rather than the relative ranking of all sample pairs within the batch size. This greatly reduces the hardware requirements for large batches of samples and extensive communication between multiple GPUs, enabling the proposed solution to be deployed in resource-constrained EDA design environments.
[0082] In the embodiments of this application, when performing data augmentation during the pre-training stage, the original vertex coordinates of the first and / or second layout graphics can be rotated by 90, 180, or 270 degrees, and / or flipped horizontally or vertically.
[0083] The purpose of data augmentation is to generate diverse training samples without altering the essential geometric structure of the graphic layout, thereby enhancing the model's generalization ability. Rotated or flipped variant graphics and their corresponding coordinate text sequences from the same graphic layout are still used as positive sample pairs for training, enhancing the SigLIP network's robustness to graphic rotation and mirroring. For example, rotating a graphic layout by 90 degrees rotates its rendered image, but its coordinate text sequence remains unchanged; these two form a positive sample pair. The model is trained to map the rotated rendered image and the original coordinate text sequence to similar feature vectors, thus learning rotation invariance. Similarly, horizontally or vertically flipped variant graphics also form positive sample pairs with the original coordinate text sequence, enabling the model to learn mirror invariance.
[0084] 104. Calculate the vector similarity between the first eigenvector and the second eigenvector, and use the vector similarity as the map similarity between the first map and the second map.
[0085] It is understandable that this vector similarity can be used to quantify the distance or directional consistency of two feature vectors in a shared embedding space. The higher the similarity value, the closer the two feature vectors are, that is, the more similar the corresponding two layout graphics are.
[0086] In the embodiments of this application, vector similarity can be measured using cosine similarity or Euclidean distance.
[0087] When using cosine similarity, the first and second eigenvectors can be pre-normalized in length, i.e., L2 norm normalization. L2 norm normalization involves dividing each component of the eigenvector by its L2 norm (the square root of the sum of the squares of its components), so that the L2 norm of the normalized eigenvector is 1, meaning the vector is a unit vector. Then, the dot product of the two eigenvectors is calculated as the vector similarity. A dot product value closer to 1 indicates that the two eigenvectors are more aligned in direction, meaning the two layouts are more similar; a dot product value closer to 0 indicates that the two eigenvectors are orthogonal, meaning the two layouts are unrelated; a dot product value closer to -1 indicates that the two eigenvectors are in opposite directions, meaning the two layouts are extremely different.
[0088] When using Euclidean distance, the Euclidean distance (i.e., the straight-line distance between two points) between the first and second eigenvectors can be calculated. A smaller Euclidean distance value indicates that the two eigenvectors are closer, meaning the two maps are more similar; a larger Euclidean distance value indicates that the two eigenvectors are more different, meaning the two maps are less similar. The difference between Euclidean distance and cosine similarity is that cosine similarity only considers the directionality of vectors and is unaffected by vector length; while Euclidean distance considers both vector direction and length. In practical applications, the appropriate measurement method can be chosen based on specific needs.
[0089] For example, assuming the first feature vector is A and the second feature vector is B, A and B are pre-normalized using the L2 norm to obtain A' and B', respectively. Then, the dot product of A' and B' is calculated as the vector similarity score. If the score is greater than a preset threshold (e.g., 0.85), the first and second image layouts are considered similar or identical; if the score is lower than the preset threshold, they are considered dissimilar. The specific value of the preset threshold can be set according to the accuracy requirements of the actual application scenario. The higher the threshold, the stricter the standard for determining similarity; the lower the threshold, the more lenient the standard for determining similarity.
[0090] Furthermore, it should be noted that this application embodiment also supports application scenarios of offline feature library construction and online retrieval. In the offline stage, feature vectors are extracted from each map graphic in the standard map library using steps 101 to 103 above, and the extracted feature vectors are associated with and stored with the corresponding map graphic identifiers. An inverted index is constructed using a vector retrieval tool (such as FAISS) to form an offline feature index library. An inverted index is an efficient similarity retrieval data structure that can transform the nearest neighbor search problem in a high-dimensional vector space into a fast index lookup problem, significantly improving retrieval efficiency. In the online stage, the user-inputted query map graphic is received, and the query feature vector corresponding to the query map graphic is extracted using steps 101 to 103 above. Then, several standard map graphics with the highest similarity to the query feature vector and their similarity scores are retrieved from the offline feature index library, and the retrieval results are output according to the similarity scores from high to low.
[0091] Furthermore, this application embodiment also supports an incremental learning mechanism. When an external input confirms the retrieval results with verified tags, the confirmed map image and its tags are used as new training data to incrementally fine-tune the SigLIP network at a preset low learning rate. Incremental fine-tuning refers to making small updates to the model parameters using new data based on an existing pre-trained model, rather than retraining from scratch. Incremental fine-tuning enables the model to continuously adapt to new map data distributions in actual deployment applications, continuously improving the accuracy of similarity judgment.
[0092] In practical applications, the layout similarity calculation method provided in this application embodiment can be applied to a variety of real-world scenarios.
[0093] For example, in the scenario of intellectual property rights verification, chip design companies need to conduct self-checks on their internal layout libraries to confirm whether there is any unauthorized use of third-party intellectual property rights. By performing steps 101 to 104 above on the layout graphic to be verified against each layout graphic in the standard intellectual property rights layout library, areas with high similarity to known intellectual property rights layouts in the published graphic can be quickly retrieved, providing efficient auxiliary judgment for intellectual property rights verification. Compared with traditional manual examination methods, this application's solution can achieve automated and high-precision similarity retrieval in massive layout data, significantly improving examination efficiency.
[0094] For example, in the scenario of deduplication management in a layout library, as design projects accumulate, the layout library may contain a large number of redundant layout graphics with the same or similar functions but stored in different file formats. This redundant data not only consumes storage resources but also increases the complexity of layout management. By calculating the similarity between layout graphics pairwise, layout graphics with a similarity higher than a preset threshold can be grouped together. After confirmation by designers, deduplication or merging can be performed, thereby reducing storage redundancy in the layout library and improving layout management efficiency.
[0095] For example, in the scenario of lithographic hotspot detection, certain specific geometric structures in the chip manufacturing process are prone to optical proximity effects, leading to manufacturing defects. These specific geometric structures are called lithographic hotspots. By calculating the similarity between each local area in the chip layout to be inspected and the layout pattern of known lithographic hotspots, the potential lithographic hotspot areas in the chip layout can be quickly located. This helps designers to optimize the layout in advance (such as adjusting linewidth, adding auxiliary patterns, etc.) and improve chip manufacturing yield.
[0096] In summary, the layout similarity calculation method provided in this application obtains a first layout graphic and a second layout graphic to be processed, extracts the original coordinates of each vertex in the first layout graphic and the second layout graphic respectively, and normalizes the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphic to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence; converts the first normalized coordinate sequence into a first coordinate text sequence and the second normalized coordinate sequence into a second coordinate text sequence respectively; and / or renders the first layout graphic into a first rendered image and the second layout graphic into a second rendered image respectively; inputs the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain a first feature vector; inputs the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain a second feature vector; calculates the vector similarity between the first feature vector and the second feature vector, and uses the vector similarity as the layout similarity between the first layout graphic and the second layout graphic. The embodiments of this application can extract feature vectors of the layout graphics through a pre-trained SigLIP network. In large-scale retrieval tasks, the feature vectors can be stored and reused by performing offline inference only once. Each time similarity is compared, the similarity between the stored feature vectors can be calculated directly without repeatedly extracting geometric features. Furthermore, the SigLIP network is pre-trained using the Sigmoid loss function, which can converge without relying on the global normalization factor within the batch size, reducing hardware overhead and thus improving the efficiency of layout similarity calculation.
[0097] To facilitate better implementation of the layout similarity calculation method provided in this application, this application also provides a layout similarity calculation apparatus. The meanings of the terms used are the same as in the above-described layout similarity calculation method, and specific implementation details can be found in the descriptions within the method embodiments.
[0098] Please see Figure 3 , Figure 3 This is a schematic diagram of the layout similarity calculation device provided in an embodiment of this application. The layout similarity calculation device may include an acquisition unit 201, a conversion unit 202, an extraction unit 203, and a calculation unit 204. The acquisition unit 201 is used to acquire the first and second layout graphics to be processed, extract the original coordinates of each vertex in the first and second layout graphics respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphic to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence. The conversion unit 202 is used to convert the first normalized coordinate sequence and the second normalized coordinate sequence into a first coordinate text sequence and a second coordinate text sequence, respectively; and / or to render the first map graphic and the second map graphic into a first rendered image and a second rendered image, respectively. Extraction unit 203 is used to input the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain a first feature vector; and to input the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain a second feature vector; The calculation unit 204 is used to calculate the vector similarity between the first feature vector and the second feature vector, and to use the vector similarity as the layout similarity between the first layout graphic and the second layout graphic.
[0099] For specific implementation methods of each of the above units, please refer to the embodiments of the above-described layout similarity calculation method, which will not be repeated here.
[0100] In summary, the layout similarity calculation device provided in this application embodiment can acquire the first and second layout graphics to be processed by the acquisition unit 201, extract the original coordinates of each vertex in the first and second layout graphics respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphic to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence; the conversion unit 202 converts the first normalized coordinate sequence and the second normalized coordinate sequence into a first coordinate text sequence and a second coordinate text sequence respectively; and / or, renders the first and second layout graphics into a first rendered image and a second rendered image respectively; the extraction unit 203 inputs the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain a first feature vector; inputs the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain a second feature vector; and the calculation unit 204 calculates the vector similarity between the first feature vector and the second feature vector, and uses the vector similarity as the layout similarity between the first and second layout graphics. The embodiments of this application can extract feature vectors of the layout graphics through a pre-trained SigLIP network. In large-scale retrieval tasks, the feature vectors can be stored and reused by performing offline inference only once. Each time similarity is compared, the similarity between the stored feature vectors can be calculated directly without repeatedly extracting geometric features. Furthermore, the SigLIP network is pre-trained using the Sigmoid loss function, which can converge without relying on the global normalization factor within the batch size, reducing hardware overhead and thus improving the efficiency of layout similarity calculation.
[0101] This application also provides an electronic device that may integrate the layout similarity calculation device of this application, such as... Figure 4As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically: The electronic device may include components such as a processor 301 with one or more processing cores and a memory 302 with one or more computer-readable storage media. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 301 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs stored in the memory 302 and / or the methods provided in this application, and by calling data stored in the memory 302, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operation of the storage medium, user interface, and application programs, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 301.
[0102] The memory 302 can be used to store software programs and the methods provided in this application. The processor 301 executes various functional applications and data processing by running the software programs stored in the memory 302 and the methods provided in this application. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store applications required for operating the storage medium and at least one function; the data storage area may store data created based on the use of the electronic device. In addition, the memory 302 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
[0103] Although not shown, the electronic device may also include a display unit, an input unit, and a power supply, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 301 in the electronic device loads the executable files corresponding to the processes of one or more application programs into the memory 302 according to the following instructions, and the processor 301 runs the application programs stored in the memory 302 to realize various functions, as follows: Obtain the first and second layout graphics to be processed, extract the original coordinates of each vertex in the first and second layout graphics respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphics to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence. The first normalized coordinate sequence and the second normalized coordinate sequence are respectively converted into a first coordinate text sequence and a second coordinate text sequence; and / or, the first map graphic and the second map graphic are respectively rendered into a first rendered image and a second rendered image; Input the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain the first feature vector; Input the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain the second feature vector; Calculate the vector similarity between the first feature vector and the second feature vector, and use the vector similarity as the map similarity between the first map and the second map.
[0104] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0105] Therefore, embodiments of this application provide a storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the methods provided in embodiments of this application. For example, the instructions can execute the following steps: Obtain the first and second layout graphics to be processed, extract the original coordinates of each vertex in the first and second layout graphics respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphics to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence. The first normalized coordinate sequence and the second normalized coordinate sequence are respectively converted into a first coordinate text sequence and a second coordinate text sequence; and / or, the first map graphic and the second map graphic are respectively rendered into a first rendered image and a second rendered image; Input the first coordinate text sequence and / or the first rendered image into the pre-trained SigLIP network to obtain the first feature vector; input the second coordinate text sequence and / or the second rendered image into the pre-trained SigLIP network to obtain the second feature vector; Calculate the vector similarity between the first feature vector and the second feature vector, and use the vector similarity as the map similarity between the first map and the second map.
[0106] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0107] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0108] Since the instructions stored in the storage medium can execute the steps of any method provided in the embodiments of this application, the beneficial effects that any method provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0109] The foregoing has provided a detailed description of the layout similarity calculation method, apparatus, storage medium, and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for calculating map similarity, characterized in that, include: Obtain the first and second layout graphics to be processed, extract the original coordinates of each vertex in the first and second layout graphics respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphics to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence. The first normalized coordinate sequence and the second normalized coordinate sequence are respectively converted into a first coordinate text sequence and a second coordinate text sequence; and / or, the first map graphic and the second map graphic are respectively rendered into a first rendered image and a second rendered image; Input the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain the first feature vector; Input the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain the second feature vector; Calculate the vector similarity between the first feature vector and the second feature vector, and use the vector similarity as the map similarity between the first map graphic and the second map graphic.
2. The map similarity calculation method as described in claim 1, characterized in that, For any one of the first and second map graphics, the normalization of the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each map graphic includes: Obtain the set of all vertex coordinates of the layout graphic, calculate the minimum value of the x-coordinate and the minimum value of the y-coordinate in the vertex coordinate set, and use the coordinate point formed by the minimum value of the x-coordinate and the minimum value of the y-coordinate as the coordinate of the lower left corner of the bounding box of the layout graphic; Subtract the coordinates of the lower left corner of the bounding box from the coordinates of each vertex of the layout graphic to obtain a normalized coordinate sequence.
3. The map similarity calculation method as described in claim 2, characterized in that, For any normalized coordinate sequence in the first normalized coordinate sequence and the second normalized coordinate sequence, the normalized coordinate sequence is converted into a coordinate text sequence, including: The x and y coordinates of each vertex in the normalized coordinate sequence are truncated to floating-point numbers with a fixed number of decimal places according to a preset precision. The truncated x and y coordinates of each vertex are concatenated into a continuous string in alternating order, and the concatenated string is used as the coordinate text sequence corresponding to the normalized coordinate sequence.
4. The map similarity calculation method as described in claim 3, characterized in that, For the first normalized coordinate sequence and / or the second normalized coordinate sequence, if the length of the corresponding coordinate text sequence after transformation exceeds the preset fixed sequence length, the Douglas-Pock curve simplification algorithm is used in advance to compress the vertices of the polygonal outline of the corresponding map graphic, and the number of vertices after compression is controlled within half of the fixed sequence length before the coordinate transformation is performed.
5. The map similarity calculation method as described in claim 3, characterized in that, If the length of the coordinate text sequence is greater than the fixed sequence length, then the coordinate text sequence is truncated. If the length of the coordinate text sequence is less than the fixed sequence length, then placeholders are added to the end of the coordinate text sequence to align the length of the coordinate text sequence with the fixed sequence length.
6. The method for calculating map similarity as described in claim 1, characterized in that, The pre-training process of the SigLIP network includes: Construct training sample pairs, using the coordinate text sequence and rendered image of the same map graphic as positive sample pairs, and the coordinate text sequence and rendered image of different map graphics as negative sample pairs. The positive and negative sample pairs are trained using a sigmoid loss function, which is expressed as follows: in, ; In the above formula, N represents the batch size, i.e., the total number of sample pairs participating in each training iteration; x i y represents the feature vector of the graph mode in the i-th sample; j This represents the feature vector of the text modality in the j-th sample; is the temperature hyperparameter used to control the smoothness of the predicted distribution; b is the bias term; z ij This is a label item used to identify whether the current sample pair is a positive or negative sample pair; For vector x i Perform a transpose operation to transform the column vector into a row vector.
7. The map similarity calculation method as described in claim 6, characterized in that, During the data augmentation phase of pre-training, the original vertex coordinates of the first and / or second layout graphics are rotated by 90, 180, or 270 degrees, and / or flipped horizontally or vertically. The rotated or flipped variant graphics and the coordinate text sequence of the same layout graphics are still used as positive sample pairs for training to enhance the robustness of the SigLIP network to graphic rotation and mirroring.
8. A map similarity calculation device, characterized in that, include: The acquisition unit is used to acquire the first and second layout graphics to be processed, extract the original coordinates of each vertex in the first and second layout graphics respectively, and normalize the original coordinates of each vertex based on the coordinates of the lower left corner of the bounding box of each layout graphic to obtain the corresponding first normalized coordinate sequence and second normalized coordinate sequence. The conversion unit is configured to convert the first normalized coordinate sequence and the second normalized coordinate sequence into a first coordinate text sequence and a second coordinate text sequence, respectively; and / or to render the first map graphic and the second map graphic into a first rendered image and a second rendered image, respectively. The extraction unit is used to input the first coordinate text sequence and / or the first rendered image into a pre-trained SigLIP network to obtain a first feature vector; Input the second coordinate text sequence and / or the second rendered image into a pre-trained SigLIP network to obtain the second feature vector; The calculation unit is used to calculate the vector similarity between the first feature vector and the second feature vector, and to use the vector similarity as the map similarity between the first map graphic and the second map graphic.
9. A storage medium, characterized in that, The storage medium stores multiple instructions, which are applicable to a processor for loading to execute the layout similarity calculation method according to any one of claims 1-7.
10. An electronic device, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the layout similarity calculation method as described in any one of claims 1-7.