Methods for creating spectral library index tree and searching spectral library
The spectral library index tree is established through the random point sampling method, which solves the problem of low spectral library search efficiency in optical scattering measurements, achieves rapid creation and efficient search, and meets actual production needs.
Patent Information
- Application Number
- CN202210466715.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-04-29
AI Technical Summary
In optical scattering measurements, due to the high data dimension and insufficient discrimination of sub-data sets during spectral library search, the traditional tree structure index method has slow construction speed and low matching efficiency, making it difficult to meet actual production needs.
The random point sampling method is used to establish the spectral library index tree, and the tree structure is optimized through multiple rounds of division, sequence tags, and depth tags to reduce the creation time complexity and improve search efficiency.
While ensuring accuracy, it significantly reduces the creation time of the spectral library index tree, improves search speed and accuracy, and improves spectral matching efficiency.
Smart Images

Figure CN114969030B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical scattering measurement, and more specifically, to a method for creating a spectrum library index tree and a spectrum library search method. Background Art
[0002] The optical scattering measurement method, also known as the optical critical dimension (OCD) measurement method, can be summarized as follows: a beam of polarized light with a special polarization state is projected onto the surface of the sample to be tested, and then the reflected light of the polarized light on the sample to be tested is measured to obtain the change in the polarization state of the polarized light before and after being reflected by the sample to be tested, and then the structural parameters of the sample to be tested are extracted from it. For example, the thickness of the film obtained from the coating process such as chemical vapor deposition, and the line width, line height, side wall angle of the nano grating obtained from the processes such as lithography and etching.
[0003] Compared with scanning electron microscope, atomic force microscope and other microscopic morphology measurement methods, optical scattering measurement technology has the advantages of fast speed, low cost, non-contact and non-destructive, so it has been widely used in the field of advanced process online monitoring. However, scanning electron microscope, atomic force microscope and other measurement methods can directly obtain the microscopic morphology and structural parameters of the sample to be tested, which is a "what you see is what you get" measurement method. In contrast, optical scattering measurement technology only obtains a set of light intensity signals and other derivative signals about the incident wavelength or incident angle distribution, such as reflectivity, ellipsometry parameters, Mueller matrix, etc., and it is necessary to use certain data analysis methods to extract the sample's structural parameters from the measurement signal. Its basic process can be summarized as follows: first, establish a corresponding physical model for the structure of the sample to be tested; second, divide the parameter grid and establish its theoretical spectrum library for the structural parameters of the sample to be tested; then, use the spectrum matching method to search for a set of theoretical spectra with the smallest deviation from the measured spectrum in the spectrum library L; at this time, it is considered that the structural parameters corresponding to this set of theoretical spectra are the structural parameters of the sample to be tested.
[0004] Usually, a library search is used to search the spectral library L for a set of theoretical spectra with the smallest deviation from the measured spectrum. In actual applications, the most commonly used method in library search is the linear scanning method, that is, the exhaustive search method, which calculates the spectral distance between each set of theoretical spectra and the measured spectrum in the spectral library L in turn, and then extracts the structural parameters corresponding to the set of theoretical spectra with the smallest spectral distance as the structural parameters of the sample to be tested, where the spectral distance refers to the spectral deviation of the two spectra. The spectral deviation can be the absolute error, root mean square difference, etc. of the reflectivity of a certain band or the entire band. This method is simple in principle and easy to implement. However, when the scale of the theoretical spectral library is large (a single spectrum contains a large number of discrete points, or the number of spectra in the library is large), the time complexity required for this method will increase sharply, and it is difficult to meet the requirements for measurement efficiency in actual production. Specifically, the time complexity of the linear scanning method is O(N k ), where k is the number of discrete points in a single spectrum (the number of discrete wavelengths), that is, the data dimension, and N is the number of spectra.
[0005] Another method of library search is to realize fast search of data by constructing a spectral library index tree. Because test data (measured spectra) generally present a clustered form, based on this feature, the hyperplane (a linear subspace with a codimension of one in the n-dimensional Euclidean space) can be used to divide the library data (theoretical spectra in the spectral library) into several sub-datasets and store them locally. When searching the library, only the sub-datasets that are closest to the test data need to be searched. Therefore, this method greatly improves the efficiency of library search. For example, as one of the most commonly used tree structure indexing methods, the time complexity of the K-dimensional (KD) tree indexing method for searching the library is only The time complexity is significantly lower than that of the linear scan method.
[0006] However, there are still great challenges when directly using traditional tree-structured search methods for library searches in optical scattering measurements. On the one hand, in the tree structure construction stage, when traditional methods use hyperplanes to divide sub-data sets, multiple traversals along the data dimension are required, and the tree construction efficiency is directly related to the data dimension. However, the data dimensions of the theoretical spectral library used in optical scattering measurements range from hundreds to thousands, so the speed of building a tree using traditional methods is extremely slow. On the other hand, each wavelength of the spectral data represents the characteristics of the spectrum. The more discrete points of the spectral wavelength, the more dispersed the characteristics of the spectrum, which easily leads to insufficient distinction between the sub-data sets. Therefore, in the library search stage, in order to ensure the matching accuracy, traditional methods will search most or even all of the sub-data sets, resulting in a sharp decline in the efficiency of measuring spectrum matching, even equivalent to the linear scanning method, which is difficult to meet the needs of actual measurements.
[0007] To this end, the present invention provides a method for creating a spectral library index tree and a spectral library search method, which improve the spectral matching efficiency of library search while ensuring accuracy. Summary of the invention
[0008] The present invention provides a method for creating a spectrum library index tree and a spectrum library search method, which improve the spectrum matching efficiency of library search while ensuring accuracy.
[0009] In a first aspect, the present invention provides a method for creating a spectral library index tree, comprising:
[0010] S1. Establish a spectrum library L, wherein the spectrum library L includes N theoretical spectra, and the theoretical spectra include k discrete wavelength points, wherein N and k are both integers greater than 1;
[0011] S2. Perform multiple rounds of division on the N theoretical spectra to create the spectrum library index tree, wherein the index tree includes a plurality of nodes, each of which corresponds to one of the theoretical spectra, and the multiple rounds of division include:
[0012] S2-1. Select any one of the theoretical spectra as the theoretical spectrum l of the mth node of the spectrum library index tree. m , m is a positive integer;
[0013] S2-2. Randomly select a discrete wavelength point p m , obtain the theoretical spectrum l of the mth layer node m At the discrete wavelength point p m The spectral value l m [p m ];
[0014] S2-3, Division 1: If the remaining theoretical spectrum is at the discrete wavelength point p m The corresponding spectral value is not greater than the spectral value l m [p m ], then it is divided into the theoretical spectrum l of the mth layer node m The theoretical spectrum of the left subtree, otherwise, it is divided into the theoretical spectrum l of the m-th layer node m The right subtree theoretical spectrum of ; or,
[0015] Division 2: If the remaining theoretical spectrum is at the discrete wavelength point p m The corresponding spectral value is not greater than the spectral value l m [p m ], then it is divided into the theoretical spectrum l of the mth layer node m The theoretical spectrum of the right subtree, otherwise, it is divided into the theoretical spectrum l of the m-th layer node m The left subtree theoretical spectrum of ;
[0016] The multiple rounds of division start from m=1, and when m=1, any one of the theoretical spectra in the spectral library L is selected as the theoretical spectrum l of the mth node of the spectral library index tree. m ;
[0017] When m≠1, the theoretical spectrum l from the m-1th layer node m-1 In the left subtree theoretical spectrum of , any one of the theoretical spectra is selected as the theoretical spectrum l of the mth layer node of the spectrum library index tree m , and repeat S2-2 to S2-3 until the theoretical spectrum of the m-th node is l m The number of theoretical spectra of the left subtree and the theoretical spectrum of the m-th layer node l m The number of theoretical spectra of the right subtree is zero; from the theoretical spectrum of the m-1th layer node l m-1 In the right subtree theoretical spectrum of , any one of the theoretical spectra is selected as the theoretical spectrum l of the mth layer node of the spectrum library index tree m , and repeat S2-2 to S2-3 until the theoretical spectrum of the m-th node is l m The number of theoretical spectra of the left subtree and the theoretical spectrum of the m-th layer node l m Until the number of theoretical spectra of the right subtree is zero; wherein the m-th layer node is the left child node or the right child node of the m-1-th layer node directly connected to the m-th layer node.
[0018] The beneficial effect is that the present invention establishes the spectral library index tree by adopting the random point sampling method, which reduces the complexity of the creation time while ensuring the search accuracy, and has the characteristics of fast tree building speed, high search accuracy and fast search speed.
[0019] Optionally, a discrete wavelength point p is randomly selected in each round of partitioning m is any one of the k discrete wavelength points.
[0020] Optionally, the theoretical spectrum of the m-th layer node is m The absolute value of the difference between the theoretical spectrum number of the left subtree and the theoretical spectrum number of the right subtree is not greater than 10.
[0021] Further optionally, any one of the theoretical spectra is selected as the mth level node theoretical spectrum l of the spectrum library index tree m , the theoretical spectrum of the m-th layer node is l m At the discrete wavelength point P m The spectral value l m [p m ] satisfies the following conditions: when m=1, the spectral value l m [p m] is all the spectra in the spectral library L at the discrete wavelength point p m The median of the spectral value; when m≠1, the spectral value l m [p m ] is the theoretical spectrum l of the m-1th layer node m-1 The left subtree of the theoretical spectrum is all spectra at the discrete wavelength point p m The median of the spectrum values, or the theoretical spectrum l of the m-1th layer node m-1 The right subtree of the theoretical spectrum is all spectra at the discrete wavelength point p m The median of the spectral values.
[0022] The beneficial effect is that the number of theoretical spectra of the left subtree and the right subtree of any node of the spectrum index tree is basically the same or the number is very different, so when searching the spectrum library, the search efficiency can be improved and the search accuracy can be guaranteed.
[0023] Optionally, the method for creating the spectral library index tree further includes adding sequence labels to the spectral library index tree: adding a left sequence label and a right sequence label to each node of the spectral library index tree; wherein the left sequence label of the m-th layer node is smaller than the left sequence label of the m+1-th layer node directly connected to the m-th layer node, and the right sequence label of the m-th layer node is larger than the right sequence label of the child node of the m+1-th layer node directly connected to the m-th layer node; or, the left sequence label of the m-th layer node is larger than the left sequence label of the m+1-th layer node directly connected to the m-th layer node, and the right sequence label of the m-th layer node is smaller than the right sequence label of the m+1-th layer node directly connected to the m-th layer node.
[0024] The beneficial effect is that by adding sequence tags to the spectrum library index tree, the nodes of the spectrum library index tree can be quickly determined when searching the spectrum library, thereby improving the search efficiency.
[0025] Further optionally, the method for creating the spectral library index tree further includes adding a depth label to the spectral library index tree: adding a depth label to each node of the spectral library index tree, wherein the depth labels of nodes at the same layer are the same, and the depth label of the node at the mth layer is less than the depth label of the node at the m+1th layer.
[0026] The beneficial effect is that when searching a spectral library, all child nodes of the current node can be determined according to the depth label of the node of the search spectral library index tree, that is, the number of theoretical spectra that have not been searched can be determined.
[0027] Optionally, establishing the spectral library L also includes: obtaining the variation range of each structural parameter of the sample to be tested; simulating and calculating a theoretical spectrum by any method of rigorous coupled wave analysis, finite element analysis, and boundary element analysis; the theoretical spectrum includes one or a combination of reflectivity, transmittance, ellipsometric parameters, and Mueller matrix.
[0028] In a second aspect, the present invention provides a spectral library search method, comprising:
[0029] S1. Creating a spectral library index tree by using a method for creating a spectral library index tree as described in any one of the first aspects;
[0030] S2, obtaining the measurement spectrum y of the sample to be tested;
[0031] S3. Perform the first search to obtain the theoretical spectrum l of the m-th layer node m , obtain the measured spectrum y at the discrete wavelength point p m The spectral value y[p m ], compare the spectral value y[p m ] and the spectral value l m [p m Size:
[0032] If the spectral library index tree satisfies the partition one, when y[p m ]≤l m [p m ], then search the left child node of the m-th layer node, otherwise, search the right child node of the m-th layer node until the node of the last layer is searched;
[0033] If the spectral library index tree satisfies the second partition, when y[p m ]≤l m [p m ], then search the right child node of the m-th layer node, otherwise, search the left child node of the m-th layer node until the node of the last layer is searched;
[0034] Wherein, the first search starts from m=1;
[0035] S4. Record the first search path, and obtain the spectral distance between each node on the first search path and the measured spectrum:
[0036] (y[p m ]-l[p m ]) 2 ,
[0037] Among them, l[p m ] is the theoretical spectrum corresponding to any node on the first search path at a randomly selected discrete wavelength point p m The corresponding spectral value, y[pm ] is the measured spectrum y at the discrete wavelength point p m The corresponding spectral values;
[0038] Based on the spectral distance sorting, the minimum spectral distance and the corresponding minimum spectral distance node are obtained, and the Euclidean distance between the theoretical spectrum corresponding to the minimum spectral distance node and the measured spectrum y is obtained, and is used as the Euclidean distance threshold ε0:
[0039]
[0040] S5, performing a backtracking search, taking the minimum spectral distance node as the backtracking starting point, obtaining the theoretical spectrum corresponding to the backtracking starting point, repeating the steps of the first search, recording the backtracking search path, and re-ordering to obtain the minimum spectral distance and the minimum spectral distance node;
[0041] If the minimum spectral distance obtained by reordering is less than the Euclidean distance threshold, the node with the minimum spectral distance obtained by reordering is used as a new backtracking starting point, and the backtracking search is continued. If the Euclidean distance between the theoretical spectrum corresponding to the new backtracking starting point and the measured spectrum is less than the Euclidean distance threshold, the Euclidean distance threshold is updated; otherwise, the Euclidean distance threshold is not updated;
[0042] If the minimum spectral distance obtained by reordering is greater than or equal to the Euclidean distance threshold, the search is terminated, and the current Euclidean distance threshold and its corresponding threshold node are obtained. The theoretical spectrum corresponding to the threshold node is the spectrum that best matches the measured spectrum.
[0043] Optionally, the sorting is dynamic sorting, and the dynamic sorting includes any one of quick sorting, linked list sorting, minimum heap sorting and binary sorting.
[0044] Its beneficial effect is that through dynamic sorting, after each search is completed, the node with the minimum spectral distance among all search nodes can be quickly obtained, and the starting point of the backtracking search can be quickly determined, so as to improve the efficiency of the backtracking search.
[0045] Optionally, the spectral library search method further includes: setting a search depth threshold, obtaining the sum of the number of left subtree theoretical spectra and right subtree theoretical spectra of the current search node, and when the sum of the number is not greater than the search depth threshold, searching all spectra of the left subtree theoretical spectra and the right subtree theoretical spectra of the current search node.
[0046] Its beneficial effect is that by setting the search depth threshold, when the number of child nodes corresponding to the current search node is small, the search strategy can be changed to search all child nodes of the current node, thereby improving the search efficiency and ensuring the search accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A flowchart of an embodiment of a method for creating a spectral library index tree provided by the present invention;
[0048] Figure 2 A schematic diagram of a structure embodiment of a spectrum library index tree provided by the present invention;
[0049] Figure 3 A schematic diagram of an embodiment of a spectral library searching method provided by the present invention. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "the", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in a "or" relationship.
[0051] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0052] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0053] The present invention provides a method for creating a spectral library index tree, the process of which is as follows: Figure 1 As shown, including:
[0054] S101, establishing a spectrum library L, wherein the spectrum library L includes N theoretical spectra, and the theoretical spectra include k discrete wavelength points, wherein N and k are both integers greater than 1.
[0055] In this step, optionally, the establishment of the spectral library L includes: obtaining the variation range of each structural parameter of the sample to be tested; simulating and calculating a theoretical spectrum by any method of rigorous coupled wave analysis (Rigorous Coupled-Wave Analysis), finite element method (Finite Element Method), and boundary element method (Boundary Element Method); the theoretical spectrum includes one or a combination of reflectivity, transmittance, ellipsometric parameters, and Mueller matrix.
[0056] S102, performing multiple rounds of partitioning on the N theoretical spectra to create the spectrum library index tree, wherein the index tree includes a plurality of nodes, each of which corresponds to one of the theoretical spectra.
[0057] In this step, the discrete grid points of the structural parameter combination can be obtained according to the variation range of each structural parameter of the sample to be tested and its corresponding parameter grid step. Each discrete grid point in the spectrum library L corresponds to a theoretical spectrum.
[0058] The multiple rounds of division in S102 include: S102-1, selecting one of the theoretical spectra as the mth level node theoretical spectrum l of the spectrum library index tree m , m is a positive integer; S102-2, randomly select a discrete wavelength point p m , obtain the theoretical spectrum l of the mth layer node m At the discrete wavelength point p m The spectral value l m [p m ]; S102-3, Division 1: If the remaining theoretical spectrum is at the discrete wavelength point p m The corresponding spectral value is not greater than the spectral value l m [p m], then it is divided into the theoretical spectrum l of the mth layer node m The theoretical spectrum of the left subtree, otherwise, it is divided into the theoretical spectrum l of the m-th layer node m The right subtree theoretical spectrum; or, division two: if the remaining theoretical spectrum at the discrete wavelength point p m The corresponding spectral value is not greater than the spectral value l m [p m ], then it is divided into the theoretical spectrum l of the mth layer node m The theoretical spectrum of the right subtree, otherwise, it is divided into the theoretical spectrum l of the m-th layer node m The left subtree theoretical spectrum of .
[0059] The multiple rounds of division start from m=1, and when m=1, any one of the theoretical spectra in the spectral library L is selected as the theoretical spectrum l of the mth node of the spectral library index tree. m ; When m≠1, the theoretical spectrum l from the m-1th layer node m-1 In the left subtree theoretical spectrum of , any one of the theoretical spectra is selected as the theoretical spectrum l of the mth layer node of the spectrum library index tree m , and repeat S102-2 to S102-3 until the theoretical spectrum of the m-th node is l m The number of theoretical spectra of the left subtree and the theoretical spectrum of the m-th layer node l m The number of theoretical spectra of the right subtree is zero; from the theoretical spectrum of the m-1th layer node l m-1 In the right subtree theoretical spectrum of , any one of the theoretical spectra is selected as the theoretical spectrum l of the mth layer node of the spectrum library index tree m , and repeat S102-2 to S102-3 until the theoretical spectrum of the m-th node is l m The number of theoretical spectra of the left subtree and the theoretical spectrum of the m-th layer node l m Until the number of theoretical spectra of the right subtree is zero; wherein the m-th layer node is the left child node or the right child node of the m-1-th layer node directly connected to the m-th layer node.
[0060] The present invention uses a random point sampling method to establish a spectrum library index tree, which reduces the complexity of the creation time while ensuring the search accuracy, and has the characteristics of fast tree building speed, high search accuracy and fast search speed. m [p m ] are all theoretical spectra in the spectral library L at the discrete wavelength point p m The median of the corresponding spectral value, and l m [p m ] corresponds to the theoretical spectrum l mAs the topmost node of the spectrum library index tree, the spectrum value includes reflectance. m If these spectra are at discrete wavelengths p m When the corresponding spectral value is less than or equal to l m [p m ], then it is divided into the theoretical spectrum l of the mth layer node m The left subtree theoretical spectrum is divided into the right subtree. Then repeat the above operation for the left and right subtrees respectively to establish the spectrum library index tree. The spectrum library index tree established in this way has the characteristic of binary division, and the number of spectra of the left and right subtrees of each node is basically the same. Figure 2 To illustrate, assume that there are 9 spectra in the spectrum library L, randomly select a discrete wavelength point P1 (select one from k discrete wavelength points), use the median of the spectral values corresponding to the 9 spectra in the spectrum library L at the discrete wavelength point P1 as the top-level node of the spectrum library index tree, and record the median of the spectral values corresponding to the spectrum at the discrete wavelength point P1 as node A. There are 5 spectra with smaller medians than the spectral values corresponding to the discrete wavelength point P1, and these 5 spectra are divided into the theoretical spectra of the left subtree of node A, and the other 3 spectra are divided into the theoretical spectra of the right subtree of node A. Then randomly select a discrete wavelength point P2 (select one from k discrete wavelength points), use the median of the spectral values corresponding to the 5 spectra contained in the theoretical spectrum of the left subtree of node A as the top-level node of the left subtree of node A, and record the median of the spectral values corresponding to these 5 spectra as node B. There are two spectra with a smaller median than the spectral value corresponding to the node B at the discrete wavelength point P2. These two spectra are divided into the theoretical spectrum of the left subtree of node B, and the other two spectra are divided into the theoretical spectrum of the right subtree of node B. This is repeated until all spectra in the spectral library are divided, and finally the following is formed: Figure 2 The spectral library index tree is shown.
[0061] In a possible embodiment, a discrete wavelength point p is randomly selected in each round of division. m is any one of the k discrete wavelength points. In another possible embodiment, the theoretical spectrum of the m-th node is m The absolute value of the difference between the theoretical spectrum number of the left subtree and the theoretical spectrum number of the right subtree is not greater than 10.
[0062] In a possible embodiment, any one of the theoretical spectra is selected as the mth level node theoretical spectrum l of the spectrum library index tree. m , the theoretical spectrum of the m-th layer node is l m At the discrete wavelength point p m The spectral value l m [p m] satisfies the following conditions: when m=1, the spectral value l m [p m ] is all the spectra in the spectral library L at the discrete wavelength point p m The median of the spectral value; when m≠1, the spectral value l m [p m ] is the theoretical spectrum l of the m-1th layer node m-1 The left subtree of the theoretical spectrum is all spectra at the discrete wavelength point p m The median of the spectrum values, or the theoretical spectrum l of the m-1th layer node m-1 The right subtree of the theoretical spectrum is all spectra at the discrete wavelength point p m In this embodiment, the number of theoretical spectra of the left subtree and the number of theoretical spectra of the right subtree of any node of the spectral index tree are substantially the same or the number is very small, so that when searching the spectral library, the search efficiency can be improved and the search accuracy can be guaranteed.
[0063] Optionally, the method for creating the spectral library index tree further includes adding sequence labels to the spectral library index tree: adding a left sequence label and a right sequence label to each node of the spectral library index tree; wherein the left sequence label of the m-th layer node is less than the left sequence label of the m+1-th layer node directly connected to the m-th layer node, and the right sequence label of the m-th layer node is greater than the right sequence label of the child node of the m+1-th layer node directly connected to the m-th layer node; or, the left sequence label of the m-th layer node is greater than the left sequence label of the m+1-th layer node directly connected to the m-th layer node, and the right sequence label of the m-th layer node is less than the right sequence label of the m+1-th layer node directly connected to the m-th layer node. In this embodiment, by adding sequence labels to the spectral library index tree, the nodes of the spectral library index tree can be quickly determined when searching the spectral library, thereby improving the search efficiency.
[0064] Further optionally, the method for creating the spectrum library index tree further includes adding a depth label to the spectrum library index tree: adding a depth label to each node of the spectrum library index tree, wherein the depth labels of nodes at the same level are the same, and the depth label of the mth level node is less than the depth label of the m+1th level node. In this embodiment, when searching the spectrum library, all child nodes of the current node can be determined based on the depth label of the node of the search spectrum library index tree, that is, the number of theoretical spectra that have not been searched can be determined.
[0065] Exemplarily, tags are added to the nodes of the spectrum library index tree to create a spectrum library index tree, and the spectrum corresponding to any node in the spectrum library index tree is saved, which can be saved in a local memory or in a terminal or server that has information interaction with the device where the spectrum library index tree is located. Then, the tree building process can be omitted in the subsequent use process. Figure 2 The traversal process indicated by the arrow in the spectral library index tree algorithm principle. This method traverses the spectral library index tree in order once, and adds three labels to each node of the spectral library index tree, which are recorded as the depth (Level) label, left sequence label, and right sequence label of the node respectively. The depth label on each node can well characterize the number of child nodes on this node. The smaller the depth label, the more child nodes it has; the left and right sequence labels can be used to quickly collect all child node data of the current node. Exemplarily, for a node K, its left sequence label is greater than the left sequence label of node M, and its right sequence label is less than the right sequence label of node M, then node K is called the child node of node M. The spectral library index tree can be regarded as an optimization of the spectral library index tree, and the spectral library index tree is stored. Then when the spectral library index tree is used again, the above tree building process will be omitted, and the library search operation will be performed directly. The spectral library index tree can quickly obtain the child nodes of each node according to the designed labels, which can greatly improve the search efficiency in practical applications.
[0066] Specifically, Figure 2As an example, the method of adding left sequence labels and right sequence labels to nodes is introduced. The spectral library index tree will be traversed once. You can first traverse the left child node of each node or the right child node of each node, and then label the nodes passed during the traversal. Take the left node first traversal as an example, that is, when passing a node for the first time, the node is marked with a left sequence label. Assuming that the first time starts from the top-level node A, the node A is marked with a left sequence label of 1, and then the left child node of node A is searched, that is, node B. Then, node B is marked with a left sequence label of 2, and then the left child node of node B is searched, and so on. If the left child node cannot be found during the traversal process, backtracking begins. During the backtracking process, the right sequence label is marked on the passed nodes. For example, node D is the last left node in the traversal process and before backtracking, and the left sequence label of node D is 4, then when backtracking, node D will be passed first, and the right sequence label of node D will be marked with 5. Then, the right sequence label is marked on each node in the backtracking process in turn. Among them, the left sequence label of node B is 2, so after searching all the child nodes of B, B is labeled with the right sequence label 11. During the entire traversal process, a Level (depth) label is added to each node according to the number of child nodes. The larger the depth label, the fewer the number of child nodes of this node. For example, the depth labels of node B and node G are both 2, which means that the number of child nodes of these two nodes is basically the same; the depth label of the top-level node A is 1, so it can be inferred that the number of child nodes of node A is about twice that of the node with a depth label of 2. Therefore, a depth threshold can be preset. When the search depth reaches the threshold, the search method is changed, for example, it is changed to a linear search to search all the child nodes of the current node. Because when the number of spectra is small, linear search is more efficient.
[0067] The left sequence label and right sequence label obtained by the spectral library index tree can be used to quickly search for nodes and greatly improve the efficiency of searching for nodes in the library. For example, the left sequence label of node A is 1, and the right sequence label is 18. The left sequence labels of its child nodes are all greater than 1, and the right sequence labels are all less than 18. Therefore, it is known that A has (18-1-1) / 2=8 child nodes; for another example, to find all the left child nodes of A, first find the left child node B of A, and then find all the child nodes of node B, which are all the left child nodes of A; the same is true for finding the right child nodes of A. The traditional method of searching nodes in the index tree during the library search process is to iteratively traverse and search for its child nodes, but the spectral library index tree provided by the present invention sets the process of adding labels before the library search, and regards it as an offline process, and uses a linear traversal to record labels to avoid the problem of repeated traversal of nodes in the traditional method, thereby improving the efficiency of searching nodes during the library search process, and the more spectra in the spectral library index tree, the more obvious the efficiency improvement compared with the prior art.
[0068] Based on the method for creating a spectral library index tree provided in any of the above embodiments, the present invention provides a spectral library search method, the process of which is as follows: Figure 3 As shown, including:
[0069] S301, creating a spectrum library index tree by using any of the above-mentioned methods for creating a spectrum library index tree.
[0070] S302, obtaining a measurement spectrum y of the sample to be tested. Optionally, the measurement spectrum y of the sample to be tested is obtained using an optical measuring instrument, and the optical measuring instrument includes: a reflectometer, an ellipsometer. Preferably, the measurement spectrum y is interpolated to obtain a measurement spectrum y corresponding to the discrete wavelengths of the theoretical spectrum. Since the points of the measurement spectrum y and the discrete wavelengths of the theoretical spectrum are not necessarily one-to-one corresponding, it is necessary to interpolate the data in the measurement spectrum y. Preferably, the interpolation method includes: a Lagrange interpolation method, a Newton interpolation method, a Hermite interpolation method, and a cubic spline interpolation method.
[0071] S303, perform the first search to obtain the theoretical spectrum l of the m-th layer node m , obtain the measured spectrum y at the discrete wavelength point p m The spectral value y[p m ], compare the spectral value y[p m ] and the spectral value l m [p m ] size: If the spectral library index tree satisfies the partition one, when y[p m ]≤l m [p m ], then search the left child node of the m-th layer node, otherwise, search the right child node of the m-th layer node until the node of the last layer is searched; if the spectral library index tree satisfies the second division, when y[p m ]≤l m [p m ], then search the right child node of the m-th layer node, otherwise, search the left child node of the m-th layer node until the node of the last layer is searched; wherein, the first search starts from m=1.
[0072] Exemplarily, the spectrum library index tree satisfies the first division. When the spectrum library index tree is first searched using the measured spectrum y, the measured spectrum y is searched at discrete wavelengths p. mThe relationship between the spectrum value at the time and the spectrum value of each node in the spectrum library index tree determines the search path of the measured spectrum y. The search starts from the topmost node of the spectrum library index tree. When the spectrum value of the measured spectrum corresponding to the same discrete wavelength point is less than the spectrum value at the topmost node, the left child node of the current node is searched; otherwise, the right child node of the current node is searched; and so on, until the last node is searched in sequence, the first search is completed.
[0073] S304, recording the first search path, and obtaining the spectral distance between each node on the first search path and the measured spectrum;
[0074] (y[p m ]-l[p m ]) 2 ,
[0075] Among them, l[p m ] is the theoretical spectrum corresponding to any node on the first search path at a randomly selected discrete wavelength point p m The corresponding spectral value, y[p m ] is the measured spectrum y at the discrete wavelength point p m The corresponding spectral values;
[0076] Based on the spectral distance sorting, the minimum spectral distance and the corresponding minimum spectral distance node are obtained, and the Euclidean distance between the theoretical spectrum corresponding to the minimum spectral distance node and the measured spectrum y is obtained, and is used as the Euclidean distance threshold ε0:
[0077]
[0078] S305, perform backtracking search, take the minimum spectral distance node as the backtracking starting point, obtain the theoretical spectrum corresponding to the backtracking starting point, repeat the steps of the first search, record the backtracking search path, and reorder to obtain the minimum spectral distance and the minimum spectral distance node; if the minimum spectral distance obtained by the reordering is less than the Euclidean distance threshold, take the minimum spectral distance node obtained by the reordering as the new backtracking starting point, continue to perform backtracking search, if the Euclidean distance between the theoretical spectrum corresponding to the new backtracking starting point and the measured spectrum is less than the Euclidean distance threshold, then update the Euclidean distance threshold, otherwise, do not update the Euclidean distance threshold; if the minimum spectral distance obtained by the reordering is greater than or equal to the Euclidean distance threshold, end the search, obtain the current Euclidean distance threshold, and its corresponding threshold node, the theoretical spectrum corresponding to the threshold node is the spectrum that best matches the measured spectrum.
[0079] Since the spectrum obtained by the first search of the spectral library index tree is not necessarily the best match for the measured spectrum y, all possibilities need to be verified to ensure the accuracy of the result, and a backtracking search is performed at this time.
[0080] The node closest to the spectral value of the measured spectrum is taken as the backtracking starting point. The backtracking search includes: starting from the backtracking starting point, searching the branch nodes of the spectral library index tree that were not searched in the first search, and the search method is the same as the above search method. Record the search node, and calculate the spectral value corresponding to the search node and the measured spectrum at the discrete wavelength point p m is the spectral distance of the corresponding spectral value, reorder the nodes of this backtracking search record and the nodes of the last search record, compare the spectral distance of each node with the measured spectrum, and obtain the node closest to the spectral value of the measured spectrum among these nodes. After reordering, obtain the spectral distance between the theoretical spectrum corresponding to the minimum spectral distance node and the measured spectrum y, and compare the calculated spectral distance with the Euclidean distance threshold ε0. If the spectral distance is greater than or equal to the Euclidean distance threshold ε0, the backtracking search stops; otherwise, the node closest to the measured spectrum obtained after reordering is used as the backtracking starting point, and the backtracking search is performed again. In addition, when performing a backtracking search, the Euclidean distance between the backtracking starting point and the measured spectrum is calculated, and the Euclidean distance is compared with the Euclidean distance threshold ε0. If it is less than the Euclidean distance threshold, the Euclidean distance threshold ε0 is updated. The updated Euclidean distance threshold is to replace the original Euclidean distance threshold ε0 with the smaller of the two Euclidean distances, otherwise, it is not updated.
[0081] Repeat the above steps until the spectral distance between the node closest to the measured spectrum after reordering and the measured spectrum is not less than the Euclidean distance threshold ε0. At this time, the search ends, and the theoretical spectrum of the node in the spectral library index tree corresponding to the Euclidean distance threshold ε0 is the spectrum in the spectral library that best matches the measured spectrum y. The structural parameters corresponding to the theoretical spectrum are the structural parameters of the sample to be tested.
[0082] In addition, when searching back, the node and its child nodes corresponding to the measured spectrum in the spectral library index tree can be quickly determined by tracing back the label of the starting point. Optionally, a depth threshold can be preset. When the depth of the backtracking search node reaches the depth threshold, the search method is changed to search all child nodes of the current node in a linear search. Because the number of spectra is small at this time, the linear search efficiency is the highest.
[0083] During the backtracking search process, each node on the search path is recorded at the same time. Each time the backtracking search is performed, the node with the smallest distance to the measured spectrum is used as the starting point of the backtracking search. The closer the distance to the measured spectrum, the greater the possibility that all the child nodes representing this node have the maximum value. Therefore, always starting the backtracking search from the node with the smallest spectral distance will avoid searching too many invalid paths. After each backtracking search, the recorded search paths are increasing. The present invention reorders after each backtracking search, adopts a dynamic sorting strategy, and the sorting is efficient and stable, so that each time the backtracking search is performed, the backtracking starting point is the node with the greatest possibility. That is, after each backtracking search, the nodes on the recorded search path are dynamically sorted to obtain the node closest to the measured spectrum.
[0084] Optionally, the sorting is dynamic sorting, and the dynamic sorting includes any one of quick sorting, linked list sorting, minimum heap sorting and binary sorting.
[0085] Optionally, the spectrum library search method further includes: setting a search depth threshold, obtaining the sum of the number of theoretical spectra of the left subtree and the number of theoretical spectra of the right subtree of the current search node, and when the sum of the number is not greater than the search depth threshold, searching all spectra of the theoretical spectra of the left subtree and the right subtree of the current search node. In this embodiment, when performing a spectrum library search, all child nodes of the current node can be determined based on the depth label of the node of the search spectrum library index tree, that is, the number of theoretical spectra that have not been searched can be determined.
[0086] In order to introduce the content of the present invention in more detail, a specific case is shown again:
[0087] The scale of the spectral library established in this case is 30000×280, that is, there are 30000 spectra in this spectral library, and the number of discrete wavelength points in each spectrum is 280. 100 spectra to be tested are selected from them, and the search efficiency is tested by linear search, KD tree search, and the library search method provided by the present invention. The total time spent on the 100 spectra is averaged. The algorithms are all run based on Python code and no additional acceleration methods such as GPU acceleration are used. The test results are as follows:
[0088]
[0089] As can be seen from the table above, the linear search method searched 30,000 theoretical spectra, that is, all theoretical spectra in the spectral library; the traditional tree-based method searched 29,804 theoretical spectra, which is close to the linear search method; the method disclosed in the present invention only searched 11,577 theoretical spectra, and the number of backtracking times was reduced by more than half. In terms of search efficiency, the efficiency of the method disclosed in the present invention is 6 times that of the linear search method and 4.3 times that of the traditional tree-based search method. Under the premise of ensuring high search accuracy, the library search efficiency has been significantly improved.
[0090] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims
1. A method for creating a spectral library index tree, characterized in that: include: S1. Establish a spectrum library L, wherein the spectrum library L includes N theoretical spectra, and the theoretical spectra include k discrete wavelength points, wherein N and k are both integers greater than 1; S2. Perform multiple rounds of division on the N theoretical spectra to create the spectrum library index tree, wherein the index tree includes a plurality of nodes, each of which corresponds to one of the theoretical spectra, and the multiple rounds of division include: S2-1. Select any one of the theoretical spectra as the theoretical spectrum l of the mth node of the spectrum library index tree. m , m is a positive integer; S2-2. Randomly select a discrete wavelength point p m , obtain the theoretical spectrum l of the mth layer node m At the discrete wavelength point p m The spectral value l m [p m ]; S2-3, Division 1: If the remaining theoretical spectrum is at the discrete wavelength point p m The corresponding spectral value is not greater than the spectral value l m [p m ], then it is divided into the theoretical spectrum l of the mth layer node m The theoretical spectrum of the left subtree, otherwise, it is divided into the theoretical spectrum l of the m-th layer node m The right subtree theoretical spectrum of ; or, Division 2: If the remaining theoretical spectrum is at the discrete wavelength point p m The corresponding spectral value is not greater than the spectral value l m [p m ], then it is divided into the theoretical spectrum l of the mth layer node m The theoretical spectrum of the right subtree, otherwise, it is divided into the theoretical spectrum l of the m-th layer node m The left subtree theoretical spectrum of ; The multiple rounds of division start from m=1, and when m=1, any one of the theoretical spectra in the spectral library L is selected as the theoretical spectrum l of the mth layer node of the spectral library index tree. m ; When m≠1, the theoretical spectrum l from the m-1th layer node m-1 In the left subtree theoretical spectrum of , any one of the theoretical spectra is selected as the theoretical spectrum l of the mth layer node of the spectrum library index tree m , and repeat S2-2 to S2-3 until the theoretical spectrum of the m-th node is l m The number of theoretical spectra of the left subtree and the theoretical spectrum of the m-th layer node l m The number of theoretical spectra of the right subtree is zero; from the theoretical spectrum of the m-1th layer node l m-1 In the right subtree theoretical spectrum of , any one of the theoretical spectra is selected as the theoretical spectrum l of the mth layer node of the spectrum library index tree m , and repeat S2-2 to S2-3 until the theoretical spectrum of the m-th node is l m The number of theoretical spectra of the left subtree and the theoretical spectrum of the m-th layer node l m Until the number of theoretical spectra of the right subtree is zero; wherein the m-th layer node is the left child node or the right child node of the m-1-th layer node directly connected to the m-th layer node.
2. The method for creating a spectral library index tree according to claim 1, characterized in that: A discrete wavelength point p is randomly selected in each round of division m is any one of the k discrete wavelength points.
3. The method for creating a spectral library index tree according to claim 1, characterized in that: The theoretical spectrum of the mth layer node is l m The absolute value of the difference between the theoretical spectrum number of the left subtree and the theoretical spectrum number of the right subtree is not greater than 10.
4. A method for creating a spectral library index tree according to claim 1 or 3, characterized in that: Select any one of the theoretical spectra as the mth node theoretical spectrum l of the spectrum library index tree m , the theoretical spectrum of the m-th layer node is l m At the discrete wavelength point p m The spectral value l m [p m ]The following conditions are met: When m=1, the spectrum value l m [p m ] is all the spectra in the spectral library L at the discrete wavelength point p m The median of the spectral values; When m≠1, the spectrum value l m [p m ] is the theoretical spectrum l of the m-1th layer node m-1 The left subtree of the theoretical spectrum is all spectra at the discrete wavelength point p m The median of the spectrum values, or the theoretical spectrum l of the m-1th layer node m-1 The right subtree of the theoretical spectrum is all spectra at the discrete wavelength point p m The median of the spectral values.
5. The method for creating a spectral library index tree according to claim 1, characterized in that: It also includes adding sequence tags to the spectral library index tree: Adding a left sequence label and a right sequence label to each node of the spectral library index tree; The left sequence label of the m-th layer node is smaller than the left sequence label of the m+1-th layer node directly connected to the m-th layer node, and the right sequence label of the m-th layer node is larger than the right sequence label of the child node of the m+1-th layer node directly connected to the m-th layer node; Alternatively, the left sequence label of the m-th layer node is greater than the left sequence label of the m+1-th layer node directly connected to the m-th layer node, and the right sequence label of the m-th layer node is less than the right sequence label of the m+1-th layer node directly connected to the m-th layer node.
6. The method for creating a spectral library index tree according to claim 1, characterized in that: It also includes adding depth tags to the spectral library index tree: A depth label is added to each node of the spectral library index tree, wherein the depth labels of nodes in the same layer are the same, and the depth label of the mth layer node is less than the depth label of the m+1th layer node.
7. The method for creating a spectrum library index tree according to claim 1, characterized in that: Establishing the spectral library L also includes: Obtain the variation range of each structural parameter of the sample to be tested; The theoretical spectrum is obtained by simulation calculation using any of the rigorous coupled wave analysis, finite element, and boundary element methods; The theoretical spectrum includes one or a combination of reflectivity, transmittance, ellipsometric parameters, and Mueller matrix.
8. A spectrum library search method, characterized in that: include: S1. Using a method for creating a spectrum library index tree according to any one of claims 1 to 7 to create a spectrum library index tree; S2, obtaining the measurement spectrum y of the sample to be tested; S3. Perform the first search to obtain the theoretical spectrum l of the m-th layer node m , obtain the measured spectrum y at the discrete wavelength point p m The spectral value y[p m ], compare the spectral value y[p m ] and the spectral value l m [p m Size: If the spectral library index tree satisfies the partition one, when y[p m ]≤l m [p m ], then search the left child node of the m-th layer node, otherwise, search the right child node of the m-th layer node until the node of the last layer is searched; If the spectral library index tree satisfies the second partition, when y[p m ]≤l m [p m ], then search the right child node of the m-th layer node, otherwise, search the left child node of the m-th layer node until the node of the last layer is searched; Wherein, the first search starts from m=1; S4. Record the first search path, and obtain the spectral distance between each node on the first search path and the measured spectrum: (y[p m ]-l[p m ]) 2 , Among them, l[p m ] is the theoretical spectrum corresponding to any node on the first search path at a randomly selected discrete wavelength point p m The corresponding spectral value, y[p m ] is the measured spectrum y at the discrete wavelength point p m The corresponding spectral values; Based on the spectral distance sorting, the minimum spectral distance and the corresponding minimum spectral distance node are obtained, and the Euclidean distance between the theoretical spectrum corresponding to the minimum spectral distance node and the measured spectrum y is obtained, and is used as the Euclidean distance threshold ε0: S5, performing a backtracking search, taking the minimum spectral distance node as the backtracking starting point, obtaining the theoretical spectrum corresponding to the backtracking starting point, repeating the steps of the first search, recording the backtracking search path, and re-ordering to obtain the minimum spectral distance and the minimum spectral distance node; If the minimum spectral distance obtained by reordering is less than the Euclidean distance threshold, the node with the minimum spectral distance obtained by reordering is used as a new backtracking starting point, and the backtracking search is continued. If the Euclidean distance between the theoretical spectrum corresponding to the new backtracking starting point and the measured spectrum is less than the Euclidean distance threshold, the Euclidean distance threshold is updated; otherwise, the Euclidean distance threshold is not updated; If the minimum spectral distance obtained by reordering is greater than or equal to the Euclidean distance threshold, the search is terminated, and the current Euclidean distance threshold and its corresponding threshold node are obtained. The theoretical spectrum corresponding to the threshold node is the spectrum that best matches the measured spectrum.
9. A spectrum library search method according to claim 8, characterized in that: The sorting is a dynamic sorting, which includes any one of the sorting methods of quick sorting, linked list sorting, minimum heap sorting and binary sorting.
10. A spectrum library search method according to claim 8, characterized in that: Also includes: A search depth threshold is set to obtain the sum of the number of theoretical spectra of the left subtree and the number of theoretical spectra of the right subtree of the current search node. When the sum is not greater than the search depth threshold, all spectra of the theoretical spectra of the left subtree and the right subtree of the current search node are searched.
Citation Information
Patent Citations
Hyperspectral image supervised classification method
CN102024153A
Index tree establishment method and image retrieval method
CN108664583A
