Three-dimensional pattern retrieval method based on style consistency grid flattening

Through the style consistent grid flattening technology and Transformer method, the three-dimensional pattern features are extracted, which solves the surface problem of three-dimensional pattern retrieval, achieves accurate retrieval of three-dimensional patterns, is independent of factors such as model format and lighting, and improves the accuracy of retrieval results. Accuracy and versatility.

CN118673170AActive Publication Date: 2024-09-20BEIJING UNIV OF POSTS & TELECOMM
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410685800.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-20
Estimated Expiration
2044-05-30

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively perform retrieval of three-dimensional patterns, especially since the surfaces of three-dimensional objects are mostly curved surfaces, resulting in three-dimensional pattern retrieval that has not been effectively solved.

Method used

Using a method based on style consistency grid flattening, the pattern data set is obtained through two-dimensional cultural relic images. Combined with three-dimensional reconstruction technology and pre-processing operations, Transformer and visual labeling methods are used to extract the features of the three-dimensional map, and the feature distance is calculated to realize the three-dimensional map. similarity ranking between them.

Benefits of technology

It achieves accurate retrieval of three-dimensional patterns of cultural relics of different configurations, has good versatility, and can be independent of the format, lighting, material and resolution of the three-dimensional model, improving the accuracy of the retrieval results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673170A
    Figure CN118673170A
Patent Text Reader

Abstract

The invention discloses a three-dimensional pattern retrieval method based on style consistency grid flattening, and the method comprises the following steps: S1, obtaining a pattern data set through a two-dimensional cultural relic image, S2, obtaining a three-dimensional model through a three-dimensional reconstruction technology, and then carrying out the preprocessing operation of the three-dimensional model, the method comprises the steps of S1, obtaining three-dimensional chartlets, S3, preprocessing the three-dimensional chartlets through a style consistency flattening technology to obtain completely-flattened two-dimensional images of the three-dimensional chartlets, S4, extracting features of the preprocessed three-dimensional flattened images by using Transform and a visual marking method, and S5, calculating feature distances among the three-dimensional chartlets through the extracted features, taking the feature distances as the similarity among the three-dimensional chartlets, and calculating the similarity among the three-dimensional chartlets according to the similarity among the three-dimensional chartlets. After sorting, selecting a topN three-dimensional model as a result for display; according to the method, the accuracy of retrieval results of the three-dimensional patterns of the cultural relics of different configurations reaches expectation, the method has good universality, the three-dimensional patterns of the cultural relics can be flattened and retrieved, and the method is irrelevant to the format, illumination, materials, resolution and the like of the three-dimensional model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of computer graphics, and in particular to a three-dimensional pattern retrieval method based on style-consistent grid flattening. Background Art

[0002] The country's cultural relics reserves are extremely rich and the distribution varies significantly among regions, covering pottery, porcelain, ancient buildings, bronzes, jades, paintings and other types. The total amount is on an upward trend. After entering the digital intelligent era, the standards and technical requirements for the digitization of cultural relics have been increasing. The research scope has expanded from the macroscopic overall form of cultural relics and image data to the microscopic details of patterns, color levels and craftsmanship. This provides solid data support for deepening the interpretation of cultural relics value and innovating their utilization methods. The digitization of cultural relics is combined with deep neural network technology to manage three-dimensional cultural relics, in order to promote the modernization of cultural relics information systems.

[0003] Deficiencies of existing technology:

[0004] Currently, when studying three-dimensional traditional patterns, it is necessary to segment and extract meaningful patterns from the three-dimensional model, and then promote the construction of the three databases in the cultural big data system. Different from image retrieval, three-dimensional pattern retrieval requires retrieval from three-dimensional to image to pattern sample, and the surface of three-dimensional objects is mostly curved, so how to retrieve three-dimensional patterns has not been solved. Summary of the invention

[0005] The purpose of the present invention is to provide a three-dimensional pattern retrieval method based on style consistency grid flattening to solve the problems raised in the above background technology.

[0006] To achieve the above object, the present invention provides the following technical solution: a three-dimensional pattern retrieval method based on style consistency grid flattening, characterized in that the method comprises the following steps:

[0007] S1, obtaining a pattern dataset through two-dimensional cultural relic images;

[0008] S2, obtaining a three-dimensional model through three-dimensional reconstruction technology, and then performing preprocessing operations on the three-dimensional model;

[0009] S3, preprocessing the three-dimensional map by using a style consistency flattening technique to obtain a two-dimensional image of the three-dimensional map that is completely flattened;

[0010] S4, extracting features of the preprocessed 3D flattened image through Transformer and visual labeling method;

[0011] S5. Calculate the feature distance between the three-dimensional textures through the extracted features, use the feature distance as the similarity between the three-dimensional textures, and select the topN three-dimensional models as the result display after sorting.

[0012] Preferably, the two-dimensional cultural relic image in step S1 may be any image with Chinese cultural patterns.

[0013] Preferably, step S3 comprises the following steps:

[0014] a1. Flatten the three-dimensional mesh model using a boundary-first flattening algorithm, and extract the flattened three-dimensional model;

[0015] a2. Import the original 3D model and the 3D model obtained in step a1 through the blender tool, bake the original 3D model into the 3D model obtained in step a1 through the baking plug-in, and obtain a flattened 3D map through UV mapping;

[0016] a3. Use labeling software, such as labelme, to label the patterns in the flattened map for feature calculation.

[0017] Preferably, step S4 comprises the following steps:

[0018] b1. Use spatial attention to extract local information of the image. For the local feature set F c , generating L attention maps A = {a (1) ,a (2) ,…,a (L)}, which are implemented by L 1×1 convolutional layers; the parameters of the convolutional layer are W = [w1,w2,…,w L ]∈R L×C , the attention module can adaptively discover special areas in the image, which are represented as pattern areas in 3D pattern retrieval. The attention map is calculated as

[0019]

[0020] in That is, the i-th attention map, w and h are the width and height of the local image respectively;

[0021] b2. Visual labeling technology constructs visual labels by aggregating local features. The local visual labels are calculated as

[0022]

[0023] In the formula t (i) ∈R C ;

[0024] b3. Visual features T are used as input and mapped to queries Q with three C×C dimensional learnable matrices s ∈R L×C , key K s ∈R L×C Sum value V s ∈R L×C , the attention is calculated as

[0025]

[0026] The normalized similarity S i,j For different visual markers i and t j Model the correlation between

[0027] b4. Calculate the similarity S using MHA. In MHA, different projection matrices for queries, keys, and values ​​are used for different heads. These matrices map the visual tokens to different subspaces. MHA then uses F c The weight of the layer W M ∈R L×d The outputs of different heads are connected, fused and dimensionally reduced. In form,

[0028]

[0029] Where N is the number of heads, is the output of the i-th head.

[0030] Preferably, in step S5:

[0031] c1. Calculate the features of all patterns in the library and save them in npz files;

[0032] c2. Input the query 3D model and its texture, extract the query features according to the step S3 and the step S4, calculate the similarity with all the patterns in the library, sort the calculation results, and select the top 10 as the result display.

[0033] Preferably, the step b2 is equivalent to an abstract expression of a specific regional pattern in the image. In form,

[0034]

[0035] Where N is the Gaussian mixture number, f i is the local feature of the image with dimension c, z is the potential cluster assignment variable, c j and σ j are the mean vector and variance of the j-th Gaussian distribution respectively; iteratively, the probability of each point being generated by each component of the model, and the mean vector is updated:

[0036]

[0037] Where M is the total number of features. In GMM, p(z=j|f i ) represents the local feature f i ∈R C The posterior probability of being assigned to the jth cluster.

[0038] Preferably, in step c2, the similarity is calculated by the cosine similarity method, which estimates the similarity between two feature vectors by calculating the cosine value between them. The calculation method is:

[0039]

[0040] The more similar the directions of the two vectors are, the closer their values ​​are to 1, that is, the more similar the patterns are.

[0041] Preferably, in step S4, an SGD training model is used, with an initial learning rate of 0.01, a weight decay coefficient of 0.0001, and a momentum of 0.9.

[0042] Preferably, a linear decay scheduler is used in step S4, and when the required number of steps is reached, the learning rate is gradually decayed to 0.

[0043] Preferably, the dimension d of the global feature in step S4 is set to 1024.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] The method for retrieval of three-dimensional patterns based on style-consistent grid flattening comprises the following steps: S1, obtaining a pattern data set through a two-dimensional cultural relic image, S2, obtaining a three-dimensional model through a three-dimensional reconstruction technology, and then performing a preprocessing operation on the three-dimensional model, S3, preprocessing the three-dimensional map through a style-consistent flattening technology to obtain a two-dimensional image of a three-dimensional map that is completely flattened, S4, extracting features of the preprocessed three-dimensional flattened image using a Transformer and a visual marking method, S5, calculating feature distances between three-dimensional maps through the extracted features, using feature distances as similarities between three-dimensional maps, and selecting topN three-dimensional models as results for display after sorting; the accuracy of the retrieval results of three-dimensional patterns of cultural relics of different configurations reaches the expected level, has good versatility, can realize the flattening and retrieval of three-dimensional patterns of cultural relics, and is independent of the format, lighting, material, resolution, etc. of the three-dimensional model. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a specific flow chart of the present invention;

[0047] Figure 2 It is a schematic diagram of a three-dimensional model of the present invention;

[0048] Figure 3 It is a schematic diagram of flattening the three-dimensional model of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] In the description of the present invention, it is necessary to understand that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicating orientations or positional relationships are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0051] In the description of this patent, it should be noted that, unless otherwise clearly specified and limited, the terms "installation", "connection" and "setting" should be understood in a broad sense, for example, it can be fixed connection, setting, or detachable connection, setting, or integrated connection, setting. For ordinary technicians in this field, the specific meanings of the above terms in this patent can be understood according to specific circumstances.

[0052] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "several" is two or more, unless otherwise clearly and specifically defined.

[0053] Example

[0054] See also Figure 1-3 As shown, the present invention provides a technical solution for a three-dimensional pattern retrieval method based on style consistent grid flattening: the method comprises the following steps:

[0055] S1. Obtain pattern datasets through two-dimensional cultural relic images. Two-dimensional images can be any pictures with Chinese cultural patterns, and the pictures can be obtained from museums or the Internet;

[0056] S2. Obtain a three-dimensional model through three-dimensional reconstruction technology, and then perform preprocessing operations on the three-dimensional model. Three-dimensional modeling can be obtained through three-dimensional reconstruction technologies such as photogrammetry and laser scanning, and mesh denoising, hole repairing and mesh simplification preprocessing operations are performed on the three-dimensional model;

[0057] S3, preprocessing the three-dimensional map by using a style consistency flattening technique to obtain a two-dimensional image of the three-dimensional map that is completely flattened;

[0058] a1. Flatten the three-dimensional mesh model using a boundary-first flattening algorithm, and extract the flattened three-dimensional model;

[0059] a2. Import the original 3D model and the 3D model obtained in step a1 through the blender tool, bake the original 3D model into the 3D model obtained in step a1 through the baking plug-in, and obtain the flattened 3D map through UV mapping;

[0060] a3. Use labelme and other labeling software to label the patterns in the flattened map for feature calculation;

[0061] S4, using Transformer and visual labeling methods to extract features of the preprocessed 3D flattened image;

[0062] b1. Use spatial attention to extract local information of the image. For the local feature set F c , generating L attention maps A = {a (1) ,a (2) ,…,a (L)}, which are implemented by L 1×1 convolutional layers; the parameters of the convolutional layer are W = [w1,w2,…,w L ]∈R L×C , the attention module can adaptively discover special areas in the image, which are represented as pattern areas in 3D pattern retrieval. The attention map is calculated as

[0063]

[0064] in That is, the i-th attention map, w and h are the width and height of the local image respectively;

[0065] b2. Visual labeling technology constructs visual labels by aggregating local features. The local visual labels are calculated as:

[0066]

[0067] In the formula t (i) ∈R C, and visual labeling techniques help capture more recognizable visual patterns, thereby generating more general and robust image representations and equivalent to abstract expressions of patterns in specific regions within the image, in the form of:

[0068]

[0069] Where N is the Gaussian mixture number, f i is the local feature of the image with dimension c, z is the potential cluster assignment variable, c j and σ j are the mean vector and variance of the j-th Gaussian distribution respectively; iteratively, the probability of each point being generated by each component of the model, and the mean vector is updated:

[0070]

[0071] Where M is the total number of features. In GMM, p(z=j|f i ) represents the local feature f i ∈R C The posterior probability of being assigned to the jth cluster, and in this method, considering

[0072]

[0073] Re-expressed as

[0074]

[0075] in,

[0076]

[0077] Where σ is set to 1 and p(z=j) is Can be interpreted as local features to the soft cluster assignment of the i-th visual pattern, which is consistent with p(z=j|f i ) has the same meaning, w i is the average vector corresponding to the i-th visual pattern, and its L2 norm is proportional to the probability of occurrence of the visual pattern; the model is trained by using SGD, with an initial learning rate of 0.01, a weight decay coefficient of 0.0001, and a momentum of 0.9; by adopting a linear decay scheduler, when the required number of steps is reached, the learning rate is gradually decayed to 0; the dimension d of the global feature is set to 1024;

[0078] b3. Visual features T are used as input and mapped to queries Q with three C×C dimensional learnable matrices s ∈R L×C , key K s ∈R L×C Sum value V s ∈RL×C , the attention is calculated as

[0079]

[0080] The normalized similarity S i,j For different visual markers i and t j Model the correlation between

[0081] b4. Calculate the similarity S using MHA. In MHA, different projection matrices for queries, keys, and values ​​are used for different heads. These matrices map the visual tokens to different subspaces. MHA then uses F c The weight of the layer W M ∈R L×d The outputs of different heads are connected, fused and dimensionally reduced. In form,

[0082]

[0083] Where N is the number of heads, is the output of the i-th head

[0084] S5, calculating the feature distance between the three-dimensional textures through the extracted features, taking the feature distance as the similarity between the three-dimensional textures, and selecting the topN three-dimensional models as the result display after sorting;

[0085] c1. Calculate the features of all patterns in the library and save them in npz files;

[0086] c2. Input the query 3D model and its texture, extract the query features according to step S3 and step S4, and calculate the similarity with all the patterns in the library, sort the calculation results, select the top 10 as the result display, and calculate the similarity using the cosine similarity method. The cosine value between two feature vectors is calculated to estimate their similarity. The calculation method is:

[0087]

[0088] The more similar the directions of the two vectors are, the closer their values ​​are to 1, that is, the more similar the patterns are.

[0089] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A three-dimensional pattern retrieval method based on style consistency grid flattening, characterized by: The method comprises the following steps: S1, obtaining a pattern dataset through two-dimensional cultural relic images; S2, obtaining a three-dimensional model through three-dimensional reconstruction technology, and then performing preprocessing operations on the three-dimensional model; S3, preprocessing the three-dimensional map by using a style consistency flattening technique to obtain a two-dimensional image of the three-dimensional map that is completely flattened; S4, extracting features of the preprocessed 3D flattened image through Transformer and visual labeling method; S5. Calculate the feature distance between the three-dimensional textures through the extracted features, use the feature distance as the similarity between the three-dimensional textures, and select the topN three-dimensional models as the result display after sorting.

2. The three-dimensional pattern retrieval method based on style consistency grid flattening according to claim 1, characterized in that: The two-dimensional cultural relic image in step S1 may be any image with Chinese cultural patterns.

3. The three-dimensional pattern retrieval method based on style consistency grid flattening according to claim 1, characterized in that: The step S3 comprises the following steps: a1. Flatten the three-dimensional mesh model using a boundary-first flattening algorithm, and extract the flattened three-dimensional model; a2. Import the original 3D model and the 3D model obtained in step a1 through the blender tool, bake the original 3D model into the 3D model obtained in step a1 through the baking plug-in, and obtain a flattened 3D map through UV mapping; a3. Use labeling software, such as labelme, to label the patterns in the flattened map for feature calculation.

4. The three-dimensional pattern retrieval method based on style consistency grid flattening according to claim 1, characterized in that: The step S4 comprises the following steps: b1. Use spatial attention to extract local information of the image. For the local feature set F c , generating L attention maps A = {a (1) ,a (2) ,…,a (L) }, which are implemented by L 1×1 convolutional layers; the parameters of the convolutional layer are W = [w1,w2,…,w L ]∈R L×C , the attention module can adaptively discover special areas in the image, which are represented as pattern areas in 3D pattern retrieval. The attention map is calculated as in That is, the i-th attention map, w and h are the width and height of the local image respectively; b2. Visual labeling technology constructs visual labels by aggregating local features. The local visual label is calculated as In the formula t (i) ∈R C ; b3. Visual features T are used as input and mapped to queries Q with three C×C dimensional learnable matrices s ∈R L×C , key K s ∈R L ×C Sum value V s ∈R L×C , the attention is calculated as The normalized similarity S i,j For different visual markers i and t j Model the correlation between b4. Calculate the similarity S using MHA. In MHA, different projection matrices for queries, keys, and values ​​are used for different heads. These matrices map the visual tokens to different subspaces. MHA then uses F c The weight of the layer W M ∈R L×d The outputs of different heads are connected, fused and dimensionally reduced. In form, Where N is the number of heads, is the output of the i-th head.

5. The three-dimensional pattern retrieval method based on style consistency grid flattening according to claim 1, characterized in that: In the step S5: c1. Calculate the features of all patterns in the library and save them in npz files; c2. Input the query 3D model and its texture, extract the query features according to the step S3 and the step S4, calculate the similarity with all the patterns in the library, sort the calculation results, and select the top 10 as the result display.

6. The three-dimensional pattern retrieval method based on style consistency grid flattening according to claim 4, characterized in that: The step b2 is equivalent to an abstract expression of the specific regional pattern in the image. In terms of form, Where N is the Gaussian mixture number, f i is the local feature of the image with dimension c, z is the potential cluster assignment variable, c j and σ j are the mean vector and variance of the j-th Gaussian distribution respectively; iteratively, the probability of each point being generated by each component of the model, and the mean vector is updated: Where M is the total number of features. In GMM, p(z=j|f i ) represents the local feature f i ∈R C The posterior probability of being assigned to the jth cluster.

7. The three-dimensional pattern retrieval method based on style consistency grid flattening according to claim 5, characterized in that: In step c2, the similarity is calculated using the cosine similarity method, which estimates the similarity between two feature vectors by calculating the cosine value between them. The calculation method is: The more similar the directions of the two vectors are, the closer their values ​​are to 1, that is, the more similar the patterns are.

8. The three-dimensional pattern retrieval method based on style consistency grid flattening according to claim 1, characterized in that: In step S4, the SGD training model is used, with an initial learning rate of 0.01, a weight decay coefficient of 0.0001, and a momentum of 0.

9.

9. The three-dimensional pattern retrieval method based on style consistency grid flattening according to claim 1, characterized in that: In step S4, a linear decay scheduler is used to gradually decay the learning rate to 0 when the required number of steps is reached.

10. The three-dimensional pattern retrieval method based on style consistency grid flattening according to claim 1, characterized in that: In step S4, the dimension d of the global feature is set to 1024.

Citation Information

Patent Citations

  • Retrieval method, device and equipment for cultural relic exhibits and storage medium

    CN109582813A

  • Method for flattening three-dimensional curved surface pattern of cultural relic

    CN114612538A

  • Three-dimensional model classification method based on double Transform branches

    CN114863186A