Encoder-based geometric element embedding generation method and system
Patent Information
- Application Number
- CN202610747118.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-28
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2046-05-28
AI Technical Summary
[0005]本申请的目的是提供基于编码器的几何要素嵌入生成方法及系统,用以解决现有技术中存在由于几何要素表示学习过程过度依赖静态监督标注,导致生成的几何嵌入表示难以准确反映复杂几何图像中的真实结构关系,进一步影响几何推理、语义对齐及下游智能应用场景中几何理解结果的可靠性与泛化能力的技术问题
[0017]本申请中提供的技术方案,至少具有如下技术效果或优点:通过实现基于自监督与几何规则约束协同驱动的几何要素嵌入自适应生成的技术目标,达到在无需大量人工标注的前提下,使几何嵌入表示能够稳定刻画复杂几何结构内在关系并具备良好鲁棒性和跨场景泛化能力的技术效果。
Smart Images

Figure CN122313229B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an encoder-based method and system for embedding and generating geometric features. Background Technology
[0002] With the continuous development of artificial intelligence technology in fields such as intelligent education, computer-aided design, engineering drawing understanding, and intelligent geometric reasoning, the demand for automatic understanding and representation of geometric elements and geometric relationships in geometric images is increasing.
[0003] Currently, most existing geometric representation learning techniques rely on supervised learning methods or single-modal feature modeling. They extract edge, corner, and local relationship features through manually labeled geometric elements or predefined rules, and directly map the extracted geometric features to a vector space for subsequent task processing. This type of technique is feasible in scenarios with simple geometric structures, clear elements, and complete annotations. However, in real-world application environments with occluded geometric elements, complex structures, intertwined multi-scale relationships, and differences between image semantics and text descriptions, it is often difficult to stably characterize the inherent constraint relationships between geometric elements.
[0004] In summary, existing technologies suffer from the technical problem that the geometric element representation learning process relies excessively on static supervised annotations, resulting in the generated geometric embedding representations failing to accurately reflect the real structural relationships in complex geometric images. This further affects the reliability and generalization ability of geometric reasoning, semantic alignment, and geometric understanding results in downstream intelligent application scenarios. Summary of the Invention
[0005] The purpose of this application is to provide an encoder-based method and system for generating geometric feature embeddings, in order to solve the technical problem in the prior art that the geometric feature representation learning process relies too much on static supervision annotation, which makes it difficult for the generated geometric embedding representation to accurately reflect the real structural relationships in complex geometric images, and further affects the reliability and generalization ability of geometric reasoning, semantic alignment and geometric understanding results in downstream intelligent application scenarios.
[0006] In view of the above problems, this application provides a method and system for generating geometric features based on encoder embedding.
[0007] Firstly, this application provides an encoder-based geometric feature embedding generation method, implemented through an encoder-based geometric feature embedding generation system, comprising: training a visual encoder through a self-supervised pre-training task, the self-supervised pre-training task including geometric occlusion completion and geometric relation adversarial reasoning, enabling the visual encoder to learn a general representation of geometric features; receiving a user-input geometric image to be processed and associated text annotations, and using the visual encoder to extract multi-level geometric features of the geometric image to be processed, the multi-level geometric features including local feature features and global topological relations, and simultaneously extracting text annotation features of the associated text annotations through a text encoder; dynamically allocating fusion weights of the multi-level geometric features and the text annotation features through a gating attention mechanism according to the complexity evaluation result of the geometric image to be processed, generating a fused feature vector; performing similarity matching between the fused feature vector and standard geometric relation features in a pre-constructed geometric knowledge base, and optimizing the feature space using a geometric semantic alignment loss function according to the similarity matching result, generating a structured geometric embedding representation.
[0008] Preferably, the encoder-based geometric feature embedding generation method further includes: performing geometric occlusion completion processing on the input sample geometric image to generate occluded training samples with missing geometric features; using a visual encoder to predict the missing geometric features of the occluded training samples to obtain predicted geometric feature representations; comparing the predicted geometric feature representations with the geometric feature representations of the complete geometric image to calculate the representation difference; and adjusting the parameters of the visual encoder according to the representation difference, so that the visual encoder gradually learns the general representation of geometric features.
[0009] Preferably, the encoder-based geometric feature embedding generation method further includes: constructing adversarial training samples containing contradictory geometric relationships; training the visual encoder to identify anomalous geometric relationships in the adversarial training samples; optimizing the parameter weights of the visual encoder based on the degree of difference between the anomalous geometric relationships and standard geometric relationships; and repeatedly performing geometric occlusion completion and geometric relationship adversarial reasoning until the visual encoder can stably output feature representations that conform to geometric rules.
[0010] Preferably, the encoder-based geometric feature embedding generation method further includes: extracting local geometric feature features of the geometric image to be processed through the first-level network of the visual encoder, including edge features, vertex features and angle features; extracting global topological relationship features of the geometric image to be processed through the second-level network of the visual encoder, including similar triangle relationships, parallel line relationships and perpendicular relationships; and hierarchically fusing the local geometric feature features and global topological relationship features to form the multi-level geometric features.
[0011] Preferably, the encoder-based geometric feature embedding generation method further includes: analyzing the feature distribution characteristics of the geometric image to be processed and evaluating the image complexity level, wherein the feature distribution characteristics include at least the number of geometric features, occlusion ratio, and annotation consistency; determining the initial weight allocation ratio of the multi-level geometric features and the text annotation features according to the image complexity level, including: a. increasing the fusion weight of the text annotation features when the image complexity level is in the low complexity range; b. increasing the fusion weight of the multi-level geometric features when the image complexity level is in the high complexity range; dynamically adjusting the initial weight allocation ratio through a gating attention mechanism to generate optimized fusion weights; and weightedly fusing the multi-level geometric features and text annotation features according to the fusion weights to output the fused feature vector.
[0012] Preferably, the encoder-based geometric feature embedding generation method further includes: using the text annotation features as query vectors and the multi-level geometric features as key vectors and value vectors; calculating the correlation matrix between the query vector and the key vector; dynamically weighting the correlation matrix according to the image complexity level to generate optimized fusion weights, and applying the fusion weights to the weighted aggregation of value vectors.
[0013] Preferably, the encoder-based geometric feature embedding generation method further includes: selecting a set of standard geometric relation features related to the current task from a pre-built geometric knowledge base; calculating the similarity metric between the fused feature vector and each feature in the set of standard geometric relation features; and filtering a subset of standard geometric relation features whose matching degree meets a threshold based on the similarity metric.
[0014] Preferably, the encoder-based geometric feature embedding generation method further includes: constructing a positive sample set containing matching feature pairs and a negative sample set containing non-matching feature pairs; calculating the positive sample feature distance of the positive sample set and the negative sample feature distance of the negative sample set using a geometric semantic alignment loss function; adjusting the parameters of the visual encoder and the text encoder to reduce the positive sample feature distance while increasing the negative sample feature distance; and continuously adjusting the parameters through an iterative optimization process until the structured geometric embedding representation reaches a preset quality standard.
[0015] Preferably, the encoder-based geometric feature embedding generation method further includes: employing a triplet loss function, with the anchor point being the fused feature vector, positive samples being matching standard geometric relation features, and negative samples being non-matching standard geometric relation features; establishing positive sample constraints between the fused feature vector and the matching standard geometric relation features; establishing negative sample constraints between the fused feature vector and the non-matching standard geometric relation features; dynamically balancing the optimization strength of the positive sample constraints and negative sample constraints according to the changes in the training loss of the visual encoder and the text encoder, and adaptively adjusting the constraint boundary conditions according to the convergence trend of the geometric semantic alignment loss function.
[0016] Secondly, this application also provides an encoder-based geometric feature embedding generation system for executing the encoder-based geometric feature embedding generation method as described in the first aspect, comprising: a visual encoder training module for training a visual encoder through a self-supervised pre-training task, the self-supervised pre-training task including geometric occlusion completion and geometric relation adversarial reasoning, enabling the visual encoder to learn a general representation of geometric features; a multi-level geometric feature extraction module for receiving a user-input geometric image to be processed and associated text annotations, and extracting multi-level geometric features of the geometric image to be processed using the visual encoder, the multi-level geometric features including local feature features and global topological relations, and simultaneously extracting text annotation features of the associated text annotations through a text encoder; a fusion feature vector generation module for dynamically allocating fusion weights of the multi-level geometric features and the text annotation features through a gating attention mechanism based on the complexity evaluation result of the geometric image to be processed, generating a fusion feature vector; and a structured geometric embedding representation generation module for performing similarity matching between the fusion feature vector and standard geometric relation features in a pre-constructed geometric knowledge base, and optimizing the feature space using a geometric semantic alignment loss function based on the similarity matching result, generating a structured geometric embedding representation.
[0017] The technical solution provided in this application has at least the following technical effects or advantages: by achieving the technical goal of adaptive generation of geometric element embedding based on self-supervision and geometric rule constraints, the technical effect is achieved that the geometric embedding representation can stably characterize the internal relationship of complex geometric structures and has good robustness and cross-scene generalization ability without the need for a large amount of manual annotation.
[0018] The above description is merely an overview of the technical solution of this application. To enable a clearer understanding of the technical means of this application and to facilitate its implementation according to the description, and to make the above and other objects, features, and advantages of this application more apparent, specific embodiments of this application are described below. It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent through the following description. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the encoder-based geometric feature embedding generation method of this application.
[0021] Figure 2 This is a schematic diagram of the encoder-based geometric feature embedding generation system of this application.
[0022] Figure labeling: Visual encoder training module 1, multi-level geometric feature extraction module 2, fusion feature vector generation module 3, structured geometric embedding representation generation module 4. Detailed Implementation
[0023] This application provides an encoder-based method and system for generating geometric feature embeddings, addressing the technical problem in existing technologies where the excessive reliance on static supervised annotation during the geometric feature representation learning process leads to inaccurate reflection of the true structural relationships in complex geometric images. This, in turn, affects the reliability and generalization ability of geometric reasoning, semantic alignment, and downstream intelligent application results. The application achieves the technical goal of adaptive generation of geometric feature embeddings driven by self-supervision and geometric rule constraints. This results in geometric embeddings that stably characterize the intrinsic relationships of complex geometric structures and possess good robustness and cross-scene generalization ability without requiring extensive manual annotation.
[0024] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. It should be understood that this application is not limited to the exemplary embodiments described herein. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application. It should also be noted that, for ease of description, only the parts related to this application are shown in the accompanying drawings, not all of them.
[0025] Example 1, please refer to the appendix. Figure 1 This application provides an encoder-based geometric feature embedding and generation method, which is applied to an encoder-based geometric feature embedding and generation system, and specifically includes the following steps: The visual encoder is trained through self-supervised pre-training tasks, including geometric occlusion completion and adversarial reasoning of geometric relationships, so that the visual encoder learns a general representation of geometric elements.
[0026] Furthermore, this application also includes: performing geometric occlusion completion processing on the input sample geometric image to generate occluded training samples with missing geometric elements; using a visual encoder to predict the missing geometric elements of the occluded training samples to obtain predicted geometric element representations; comparing the predicted geometric element representations with the geometric element representations of the complete geometric image to calculate the representation difference; and adjusting the parameters of the visual encoder according to the representation difference, so that the visual encoder gradually learns the general representation of geometric elements.
[0027] Furthermore, this application also includes: constructing adversarial training samples containing contradictory geometric relationships; training the visual encoder to identify abnormal geometric relationships in the adversarial training samples; optimizing the parameter weights of the visual encoder based on the degree of difference between the abnormal geometric relationships and standard geometric relationships; and repeatedly performing geometric occlusion completion and geometric relationship adversarial reasoning until the visual encoder can stably output element representations that conform to geometric rules.
[0028] Specifically, geometric occlusion completion processing is performed on the input sample geometric image to generate occluded training samples with missing geometric elements. This involves artificially removing or masking some geometric elements in the sample geometric image without changing the overall structure and semantic constraints of the original geometric image. These geometric elements include at least basic building blocks such as edges, vertices, angles, side lengths, or shape types. This creates training samples with missing geometric information but still retaining reasonability, used to guide the model in modeling geometric relationships under incomplete input conditions. Furthermore, the geometric occlusion completion processing combines random rectangular occlusion with directional geometric element occlusion. The number of random rectangular occlusion blocks is 1–5, with each block occupying 5%–15% of the original image area, and the total occlusion area not exceeding 25% of the total image area. The width and height of a single occlusion block range from 20–80 pixels. When using directional geometric element occlusion, edge intersection areas, angle annotation areas, and key parallel relationship areas are preferentially selected as occlusion target areas. Geometric feature occlusion involves local masking of edges, vertices, and angle regions, prioritizing the occlusion of key geometric regions to enhance the visual encoder's learning ability to complete geometric structures. The generation of occluded training samples involves: first, randomly selecting regions to be occluded; then generating corresponding occlusion masks; and finally, using the occlusion masks to perform pixel-covering operations on the original geometric image to generate occluded training samples with missing geometric features. Furthermore, the visual encoder's prediction targets include: the edge category, vertex coordinates, edge length, and angle values of the occluded region. Edge length prediction is optimized using a mean squared error loss function, and angle prediction is optimized using a cosine distance loss function. Furthermore, adversarial training samples are generated by artificially modifying geometric constraints, including: constructing edge combinations that violate parallel relationships, constructing triangle structures where the sum of interior angles is not equal to 180°, and constructing intersecting edge structures that violate perpendicularity constraints, thus forming adversarial training samples containing contradictory geometric relationships.
[0029] Furthermore, using a visual encoder to predict missing geometric features from occluded training samples and obtain predicted geometric feature representations means that the occluded training samples are input into a parameterized visual encoder network, and the visual encoder infers and reconstructs the occluded or missing geometric features based on the learned spatial structural features and geometric constraints, and outputs the corresponding predicted geometric feature representations. The predicted geometric feature representations include at least numerical or categorical information that can characterize geometric attributes, such as side length values, angle values, or shape types.
[0030] A visual encoder is a deep neural network model used for feature extraction and representation learning of geometric images. Its network structure consists of multiple convolutional layers, feature mapping layers, and nonlinear transformation units. It maps the input geometric image to a feature space that represents geometric elements and their spatial relationships. The visual encoder is initialized through a pre-constructed self-supervised pre-training task to obtain initial parameter configurations with basic perceptual capabilities of the geometric structure. Furthermore, the visual encoder adopts a hybrid encoding structure based on the fusion of Vision Transformer and convolutional neural networks. The input image size is 224×224 pixels. Initial feature extraction is first performed through convolutional layers with a kernel size of 7×7 and a stride of 2, followed by feature mapping through batch normalization layers and the ReLU activation function. Subsequently, the feature map is divided into 16×16 image blocks and input into the Vision Transformer backbone network for global relationship modeling. The VisionTransformer backbone network consists of 12 Transformer encoding layers. Each Transformer encoding layer includes a multi-head self-attention sub-layer and a feedforward neural network sub-layer. The number of attention heads is 12, the hidden layer feature dimension is 768, and the feedforward neural network dimension is 3072. GELU activation and Layer Normalization are used. The first layer of the visual encoder consists of the first four Transformer encoding layers and a convolutional feature extraction layer, used to extract edge features, vertex features, and angle features. The second layer of the visual encoder consists of the last eight Transformer encoding layers, used to establish topological relationships between different geometric regions to extract similar triangle relationships, parallel line relationships, and perpendicular relationships. Furthermore, the input tensor dimension of the visual encoder is 224×224×3, and the output global geometric feature vector dimension is 1×1024, with local geometric feature output dimensions of 1×512 and global topological relationship feature output dimensions of 1×512. The visual encoder uses the AdamW optimizer during training, with an initial learning rate set to 1×10. -4 The weight decay coefficient is set to 0.01, and the batch size is set to 32. Furthermore, a cosine annealing learning rate decay strategy is adopted during the training of the visual encoder. When the training epochs reach 50% of the preset epochs, the learning rate decreases according to the cosine function.
[0031] Subsequently, the predicted geometric feature representation is compared with the geometric feature representation of the complete geometric image, and the representation difference is calculated. This means that, in the case of a corresponding complete geometric image as a reference sample, the predicted geometric feature representation is aligned and matched with the real geometric feature representation extracted from the unoccluded complete geometric image, and the degree of deviation between the two in the numerical space or semantic space is quantified by a preset distance metric function or similarity calculation method to obtain the representation difference that reflects the prediction accuracy.
[0032] Furthermore, adjusting the parameters of the visual encoder based on the representation difference allows the visual encoder to gradually learn a general representation of geometric elements. This means using the representation difference as a feedback signal during the training process and introducing it into the loss function to update the network parameters of the visual encoder in reverse. Through multiple rounds of iterative optimization, the visual encoder can stably extract and infer geometric elements under different occlusion modes and different geometric structure samples, thereby gradually forming a general representation capability that has a consistent ability to represent geometric elements such as side length, angle, and shape type.
[0033] Furthermore, constructing adversarial training samples containing contradictory geometric relationships refers to, while keeping the basic elements of the geometric image unchanged, artificially introducing relational configurations that do not conform to geometric axioms or conventional geometric constraints to disturb or reorganize the original geometric relationships, thereby generating training samples that are reasonable on the surface of the structure but conflicting in geometric logic. The contradictory geometric relationships include at least the combination of relationships that violate geometric rules such as parallelism, perpendicularity, angle conservation, or proportional consistency, in order to simulate abnormal or erroneous geometric representations that may occur in real-world scenarios.
[0034] Furthermore, training the visual encoder to recognize abnormal geometric relationships in adversarial training samples means inputting adversarial training samples containing contradictory geometric relationships into the visual encoder, and analyzing the geometric elements and their interrelationships in the samples through the feature extraction and relation reasoning modules. This enables the visual encoder to distinguish between normal relationships that conform to geometric rules and abnormal relationships that violate geometric constraints, thereby forming a representation pattern in the feature space that has the ability to discriminate abnormal geometric structures.
[0035] Subsequently, based on the degree of difference between abnormal geometric relations and standard geometric relations, the parameter weights of the visual encoder are optimized. This means that during the training process, the visual encoder's recognition results of abnormal geometric relations are compared with predefined or standard geometric relations obtained from a geometric knowledge base. By quantifying the degree of deviation between the two in feature representation or relation determination results, an optimization objective is constructed to guide parameter updates. Based on this objective, the parameter weights inside the visual encoder are adjusted to enhance its ability to model the consistency and logical rationality of geometric rules.
[0036] Furthermore, repeatedly executing geometric occlusion completion and adversarial reasoning on geometric relationships until the visual encoder can stably output feature representations that conform to geometric rules means alternately or cyclically applying geometric occlusion completion tasks and adversarial reasoning tasks containing contradictory geometric relationships to the visual encoder during the training process. Through multiple iterations, the model's capabilities in inferring missing information and identifying abnormal relationships are continuously strengthened, enabling the visual encoder to stably generate feature representations that satisfy geometric constraints when faced with geometric images of different structural complexities and perturbation conditions. Further, when the fluctuation range of geometric feature prediction accuracy is less than 0.5% and the rate of change of the triplet loss function is less than 0.005 during 10 consecutive training rounds, the model is deemed to have reached a stable convergence state, and the visual encoder training process is terminated.
[0037] The system receives a user-input geometric image to be processed and associated text annotations, and uses the visual encoder to extract multi-level geometric features of the geometric image to be processed, including local feature features and global topological relationships. At the same time, the text annotation features of the associated text annotations are extracted by the text encoder.
[0038] Furthermore, this application also includes: extracting local geometric feature characteristics of the geometric image to be processed through the first-level network of the visual encoder, including edge features, vertex features and angle features; extracting global topological relationship features of the geometric image to be processed through the second-level network of the visual encoder, including similar triangle relationships, parallel line relationships and perpendicular relationships; and hierarchically fusing the local geometric feature characteristics and global topological relationship features to form the multi-level geometric features.
[0039] Specifically, extracting local geometric features of the geometric image to be processed through the first-level network of the visual encoder means inputting the geometric image to be processed into the network layer of the visual encoder used for low-level feature perception. By analyzing pixel distribution, edge changes and local structural responses, the basic geometric units that constitute the geometric image are identified and encoded. The local geometric features are used to characterize the direction and length changes of the edges, the positional relationships of vertices, and the numerical attributes and relative magnitudes of angles in the geometric image, thereby forming a refined expression of the local geometric structure.
[0040] Furthermore, extracting global topological relationship features of the geometric image to be processed through the second-level network of the visual encoder means that, based on the extraction of local geometric feature features, the network layer in the visual encoder used for high-level relationship modeling is used to model the combination relationship and spatial constraints between multiple geometric elements in the geometric image as a whole. The global topological relationship features are used to describe cross-regional geometric relationships such as similar triangle relationships, parallel line relationships, and perpendicular relationships in the geometric image, thereby reflecting the topological consistency and logical constraint characteristics of the geometric structure at the overall scale.
[0041] Subsequently, local geometric feature features and global topological relationship features are hierarchically fused to form multi-level geometric features. This refers to combining and aligning local feature information and global relationship information from different network levels within the visual encoder according to a preset hierarchical fusion strategy. Through feature concatenation, weighted mapping, or nonlinear transformation, a multi-level geometric feature representation that simultaneously contains fine-grained geometric attributes and macroscopic topological relationships is constructed, thereby improving the integrity and structural consistency of the geometric image representation. Specifically, firstly, linear mapping is performed on the output features of the first-level network to obtain a local feature vector with a dimension of 512; then, global average pooling is performed on the output features of the second-level network to obtain a global topological feature vector with a dimension of 512; finally, a multi-level geometric feature vector with a dimension of 1024 is generated through feature concatenation and fully connected mapping. Simultaneously, text annotation features of the associated text annotations are extracted through the text encoder. This means inputting the text annotations corresponding to the geometric image to be processed into the text encoder, and obtaining text annotation features used to represent geometric feature names, relationship descriptions, or constraints through semantic parsing and vectorization encoding of the text sequence, providing a semantic information foundation for subsequent cross-modal feature fusion. Furthermore, the text encoder employs the BERT-based text encoding model, including 12 Transformer text encoding layers, a hidden layer dimension of 768, 12 attention heads, and a word vector dimension of 768. It uses WordPiece word segmentation to encode text annotations, and uses [CLS] to label the corresponding output vectors as text annotation features. Further, the text annotation feature vector output by the text encoder has a dimension of 1×768, and is projected onto a 1×512 semantic feature space through a fully connected mapping layer to achieve dimensional alignment with multi-level geometric features. The fully connected mapping layer uses a linear mapping method: F... t =W t X t +b t Among them, F t X represents the mapped text feature vector. t W represents the original text encoding features. t Let b represent the mapping weight matrix. t This represents the bias parameter.
[0042] Based on the complexity assessment results of the geometric image to be processed, the fusion weights of the multi-level geometric features and the text annotation features are dynamically allocated through a gating attention mechanism to generate a fused feature vector.
[0043] Furthermore, this application also includes: analyzing the feature distribution characteristics of the geometric image to be processed and evaluating the image complexity level, wherein the feature distribution characteristics include at least the number of geometric features, occlusion ratio, and annotation consistency; determining the initial weight allocation ratio of the multi-level geometric features and the text annotation features according to the image complexity level, including: a. increasing the fusion weight of the text annotation features when the image complexity level is in the low complexity range; b. increasing the fusion weight of the multi-level geometric features when the image complexity level is in the high complexity range; dynamically adjusting the initial weight allocation ratio through a gating attention mechanism to generate optimized fusion weights; and weightedly fusing the multi-level geometric features and text annotation features according to the fusion weights to output the fusion feature vector.
[0044] Furthermore, this application also includes: using the text annotation features as a query vector and the multi-level geometric features as a key vector and a value vector; calculating the correlation matrix between the query vector and the key vector; dynamically weighting the correlation matrix according to the image complexity level to generate optimized fusion weights, and applying the fusion weights to the weighted aggregation of the value vectors.
[0045] Specifically, analyzing the feature distribution characteristics of the geometric image to be processed and evaluating the image complexity level refers to statistically analyzing the various elements that constitute the geometric structure in the geometric image to be processed. By comprehensively analyzing indicators such as the distribution of the number of geometric elements, the spatial density of geometric elements in the image, the proportion of occluded areas, and the consistency between geometric elements and text annotations, a quantitative evaluation result is established to characterize the structural complexity of the geometric image. Among them, the feature distribution characteristics are used to reflect the overall state of the geometric image in terms of structural integrity, information density, and annotation reliability.
[0046] Furthermore, the number of geometric features is obtained through joint statistics of edge detection and corner detection. Specifically, the Canny edge detection algorithm is used to extract the number of edges, and the Harris corner detection algorithm is used to extract the number of vertices. The geometric feature quantity index N is then calculated according to the following formula. e :N e =N l +0.5N p Among them, N l N represents the number of edges. p This represents the number of vertices. The occlusion ratio is calculated using pixel-level masks, and its expression is as follows: R o= Among them, S o S represents the area of the obstructed region. t This represents the total area of the image. Annotation consistency is obtained by calculating the Jaccard similarity between the text annotation set and the geometric detection result set: J = Where A represents the text annotation set, and B represents the visual detection result set. Furthermore, the image complexity level C is calculated according to the following formula: C=min(10,max(0,αN) e +βR o -γJ)). Where α takes the value of 0.15, β takes the value of 4.2, and γ takes the value of 2.5. Further, when 0≤C<3, it is determined to be a low complexity interval; when 3≤C<7, it is determined to be a medium complexity interval; when 7≤C≤10, it is determined to be a high complexity interval. Further, the generation steps of standard geometric relation features include: geometric objects and relation constraints in the analytic geometric axiom rules; extracting the direction, length, included angle, proportion, and topological adjacency attributes of the corresponding geometric objects; performing normalization processing on the extracted attributes; generating fixed-dimensional relation feature vectors according to the preset feature encoding order; writing the generated relation feature vectors into the vector database and establishing corresponding relation type indexes. Among them, the normalization processing adopts the minimum-maximum normalization method: x′= .
[0047] Furthermore, determining the initial weight allocation ratio of multi-level geometric features and text annotation features based on the image complexity level means setting initial fusion weights between multi-level geometric features and text annotation features based on the aforementioned image complexity assessment results. This controls the contribution of different modal features in the fusion process, where the initial weight allocation ratio reflects the relative importance of structural and semantic information in the current geometric image analysis task. Further, when the image complexity level is in the low complexity range, increasing the fusion weight of text annotation features means increasing the weight ratio of text annotation features in the fusion process when the number of geometric elements is small, the occlusion ratio is low, and the annotation consistency is high. This fully utilizes the geometric relationship descriptions, element attribute descriptions, or semantic constraint information contained in the text annotations, thereby improving the semantic clarity of the overall feature representation. When the image complexity level is in the high complexity range, increasing the fusion weight of multi-level geometric features means increasing the weight ratio of multi-level geometric features extracted by the visual encoder in the fusion process when there are many geometric elements, a high occlusion ratio, or low annotation consistency. This enhances the feature representation's ability to characterize complex structural relationships and implicit geometric constraints, thereby reducing the dependence on external text annotation information.
[0048] Using text annotation features as query vectors and multi-level geometric features as key and value vectors refers to introducing an attention-based vector role partitioning method during feature fusion. The text annotation features generated by the text encoder are mapped to query vectors used to initiate semantic matching requests. Simultaneously, the multi-level geometric features extracted and fused by the visual encoder are mapped to key and value vectors used to respond to semantic queries. The query vector expresses the semantic focus of the text, the key vector characterizes the index information of the geometric features, and the value vector carries the corresponding geometric feature content representation. Further, in the gated attention mechanism, the text annotation features are mapped through a linear mapping matrix W... Q The query vector Q is then generated, and the multi-level geometric features are mapped by the linear mapping matrix W. K and W V Then, the key vector K and value vector V are generated respectively, and their expressions are as follows: Q=X t W Q K=X g W K V=X g W V Among them, X t X represents the text annotation feature matrix. g W represents a multi-level geometric feature matrix. Q W K and W V All are learnable parameter matrices. The correlation matrix A is calculated using a scaled dot product attention method: A = Softmax( ), where the query mapping matrix W Q The dimension is 512×256, and the key mapping matrix W K The dimension is 1024×256, and the value mapping matrix W V The dimension is 1024×256. The output dimensions of the query vector Q, key vector K, and value vector V are all 1×256. Here, dk represents the key vector dimension. Further, the image complexity level is denoted as C, with a value ranging from 0 to 10, and the attention weights are dynamically adjusted using a gating function G(C): G(C) = σ(αC + β). Here, σ represents the Sigmoid activation function, α takes a value of 0.35, and β takes a value of -1.2. The final fusion weight expression is as follows: A′ = G(C)⋅A + (1−G(C))⋅A t Where At represents the initial text semantic weight matrix, and A′ represents the optimized fusion weight matrix. Furthermore, the geometric feature quantity index N... e Occlusion ratio R o Both the annotation consistency J and the geometric feature quantity J are normalized before the fusion calculation. The expression for the normalized value of the geometric feature quantity is as follows: N e ′= The occlusion ratio R o The value range of is 0 to 1, and the value range of annotation consistency J is 0 to 1. The normalized N is used in the complexity level calculation. e It participates in complexity calculation.
[0049] Furthermore, the gated attention mechanism employs an 8-head multi-head attention structure, with each attention head corresponding to a 32-dimensional feature subspace. Next, calculating the correlation matrix between the query vector and key vectors involves calculating the matching degree between the query vector and each key vector individually using vector inner product, cosine similarity, or a learnable mapping function. This forms a correlation matrix that reflects the strength of the correlation between text semantics and geometric structure. The values in the correlation matrix characterize the importance distribution of different geometric features under the current text semantic conditions.
[0050] Subsequently, the correlation matrix is dynamically weighted according to the image complexity level to generate optimized fusion weights. These fusion weights are then applied to the weighted aggregation of value vectors. This means that, based on the obtained correlation matrix, an adjustment factor driven by the image complexity level is introduced to adaptively scale each correlation value in the correlation matrix, thereby generating fusion weights that reflect the degree of geometric structural complexity and semantic dependence. The fusion weights are then used to perform weighted summation or aggregation operations on the corresponding value vectors to obtain a fusion representation that takes into account both geometric structural information and textual semantic information.
[0051] Furthermore, the multi-level geometric features and text annotation features are weighted and fused according to the fusion weights to output a fused feature vector. This means that based on the dynamically optimized fusion weights, weighted summation, feature mapping, or nonlinear combination operations are performed on the multi-level geometric features and text annotation features to form a fused feature vector that simultaneously contains geometric structure information and semantic annotation information. This fused feature vector is used as a unified feature input for subsequent similarity matching and embedding generation processing.
[0052] The fused feature vector is matched with the standard geometric relationship features in the pre-built geometric knowledge base for similarity. Based on the similarity matching results, the feature space is optimized using the geometric semantic alignment loss function to generate a structured geometric embedding representation.
[0053] Furthermore, this application also includes: selecting a set of standard geometric relation features related to the current task from a pre-constructed geometric knowledge base; calculating the similarity metric between the fused feature vector and each feature in the set of standard geometric relation features; and filtering a subset of standard geometric relation features whose matching degree meets the threshold based on the similarity metric.
[0054] Furthermore, this application also includes: constructing a positive sample set containing matching feature pairs and a negative sample set containing non-matching feature pairs; calculating the positive sample feature distance of the positive sample set and the negative sample feature distance of the negative sample set through a geometric semantic alignment loss function; adjusting the parameters of the visual encoder and the text encoder to reduce the positive sample feature distance while increasing the negative sample feature distance; and continuously adjusting the parameters through an iterative optimization process until the structured geometric embedding representation reaches a preset quality standard.
[0055] Furthermore, this application also includes: employing a triplet loss function, with the anchor point being the fused feature vector, positive samples being matching standard geometric relationship features, and negative samples being non-matching standard geometric relationship features; establishing positive sample constraints between the fused feature vector and the matching standard geometric relationship features; establishing negative sample constraints between the fused feature vector and the non-matching standard geometric relationship features; dynamically balancing the optimization strength of the positive sample constraints and negative sample constraints according to the changes in the training loss of the visual encoder and the text encoder, and adaptively adjusting the constraint boundary conditions according to the convergence trend of the geometric semantic alignment loss function.
[0056] Specifically, selecting a set of standard geometric relation features relevant to the current task from a pre-built geometric knowledge base means establishing a geometric knowledge base containing multiple types of geometric relation representations before or during system operation, and retrieving and extracting standard geometric relation features that match the semantic and structural requirements of the task from the geometric knowledge base when performing the geometric element embedding and generation task, based on the target type, geometric object category, or relation reasoning requirements of the current task. The standard geometric relation features are used to describe typical relation patterns that conform to geometric rules and their corresponding feature expressions.
[0057] Furthermore, the geometric knowledge base adopts a hybrid storage structure of attribute graph database and vector database. The attribute graph database stores the topological relationships between geometric objects, while the vector database stores standard geometric relationship feature vectors. Standard geometric relationship features are represented by fixed-dimensional floating-point feature vectors. Each standard geometric relationship feature vector has 256 dimensions, with the first 128 dimensions describing geometric topological relationship features and the last 128 dimensions describing geometric semantic constraint features. Standard geometric relationship features are generated by encoding predefined geometric axiom rules, including parallel relationships, perpendicular relationships, similar triangle relationships, and triangle interior angle sum relationships. For example, for parallel relationships, two side direction vectors are defined as v1 and v2. When the included angle between the directions is less than 3°, a parallel relationship feature vector is generated: F parallel=[cos(θ),sin(θ),d,l1,l2]. Where θ represents the angle between two sides, d represents the distance between the sides, and l1 and l2 represent the corresponding side lengths. Standard geometric relationship features in the geometric knowledge base are generated through offline pre-training and indexed and stored according to relationship categories. During system operation, when a newly added geometric relationship sample meets a preset consistency threshold, the new feature vector is written to the vector database to complete the knowledge base update.
[0058] Furthermore, calculating the similarity metric between the fused feature vector and each feature in the standard geometric relationship feature set refers to aligning the fused feature vector, obtained by fusing multi-level geometric features and text annotation features, with the selected standard geometric relationship features one by one in the feature space, and quantifying the degree of matching between the two through a preset similarity metric function, thereby obtaining a similarity metric that reflects the semantic consistency and structural similarity between the fused feature vector and each standard geometric relationship feature.
[0059] Subsequently, the standard geometric relationship feature subset that meets the matching degree threshold is selected based on the similarity metric value. This means comparing the calculated similarity metric value with the pre-set matching threshold, selecting standard geometric relationship features with a similarity not lower than the threshold requirement, and organizing the standard geometric relationship features that meet the conditions into a standard geometric relationship feature subset for subsequent semantic alignment, relationship confirmation, or embedding optimization processing.
[0060] Constructing a positive sample set containing matching feature pairs and a negative sample set containing non-matching feature pairs means that after completing the similarity matching between the fused feature vector and the standard geometric relationship features, feature pairs that meet the preset matching conditions of semantic consistency and geometric relationship consistency are grouped into a positive sample set, while feature pairs that do not meet the matching conditions or have geometric semantic conflicts are grouped into a negative sample set. Matching feature pairs are used to represent the relationship expression with high consistency between the fused feature vector and the standard geometric relationship features, while non-matching feature pairs are used to represent the relationship expression with significant differences between the fused feature vector and the standard geometric relationship features.
[0061] Furthermore, calculating the positive sample feature distance of the positive sample set and the negative sample feature distance of the negative sample set through the geometric semantic alignment loss function means introducing a loss function form in the feature space to constrain the semantic consistency of the geometric structure. The feature distance between each matching feature pair in the positive sample set is calculated, and the feature distance between each non-matching feature pair in the negative sample set is calculated, thereby obtaining distance measurement results for measuring the degree of geometric semantic consistency and the degree of geometric semantic distinction, respectively.
[0062] Subsequently, the parameters of the visual encoder and text encoder are adjusted to reduce the positive sample feature distance while increasing the negative sample feature distance. This means taking the positive and negative sample feature distances as optimization targets during the training process, and updating the trainable parameters in the visual encoder and text encoder synchronously through the backpropagation mechanism. This gradually reduces the distance between matching feature pairs in the feature space, while gradually increasing the distance between non-matching feature pairs in the feature space, thereby enhancing the ability of geometric embedding representation to distinguish between semantically consistent and semantically different relationships.
[0063] Furthermore, continuously adjusting parameters through an iterative optimization process until the structured geometric embedding representation meets the preset quality standards means repeatedly executing sample construction, loss calculation, and parameter update steps during training, and continuously optimizing the parameters of the visual encoder and text encoder based on evaluation metrics such as the stability, convergence, or matching accuracy of the embedding representation until the generated structured geometric embedding representation meets the preset quality requirements in terms of geometric semantic consistency, discriminability, and robustness.
[0064] The geometric semantic alignment loss function is implemented through contrastive learning, employing a triplet loss function. The anchor point is the fused feature vector, positive samples are matching standard geometric relationship features, and negative samples are non-matching standard geometric relationship features. This refers to introducing a loss function based on relative distance constraints during the geometric semantic alignment optimization process. By constructing a training unit composed of three feature vectors, the fused feature vector obtained by fusing multi-level geometric features and text annotation features is set as the distance reference center. At the same time, standard geometric relationship features that are consistent with the fused feature vector in geometric semantics are selected as positive samples, and standard geometric relationship features that deviate in geometric semantics or structural relationships are selected as negative samples, which are used to characterize the relative similarity relationships in the feature space.
[0065] Furthermore, the triplet loss function uses cosine distance as the feature distance metric, and its expression is as follows: L=max(0,D(a,p)−D(a,n)+m). Where a represents the anchor point fused feature vector, p represents the positive sample feature vector, n represents the negative sample feature vector, and m represents the boundary distance parameter. The cosine distance D(x,y) is expressed as follows: D(x,y)=1− Furthermore, the initial value of the boundary distance parameter *m* is set to 0.3, and dynamically adjusted according to the rate of decrease of the loss function. When the loss decrease is less than 0.01 for five consecutive training rounds, the boundary distance parameter *m* is increased by 0.02; when the training loss fluctuation exceeds 0.05, the boundary distance parameter *m* is decreased by 0.01. Furthermore, the convergence conditions for visual encoder training include: geometric feature prediction accuracy not less than 92%, geometric relationship consistency score not less than 0.90, and the rate of change of the triplet loss function for ten consecutive iterations not less than 0.005. The geometric relationship consistency score is calculated by the matching ratio between the predicted geometric relationship and the standard geometric relationship. Furthermore, the geometric relationship consistency score G... c The expression is as follows: G c = Where, N m N represents the number of correctly predicted geometric relationships. t This represents the total number of geometric relations to be verified. When G... c When the value is ≥0.90, the current visual encoder is determined to meet the geometric consistency requirement.
[0066] Furthermore, establishing positive sample constraints between the fused feature vector and the matching standard geometric relationship features refers to imposing convergence restrictions on the distance relationship between the fused feature vector and the corresponding positive sample in the feature space. By setting distance reduction targets or similarity improvement targets, the model is guided to continuously enhance the aggregation degree between the fused feature vector and the semantically consistent standard geometric relationship features during the training process, thereby strengthening the ability of the geometric embedding representation to express the correct geometric relationship.
[0067] Subsequently, establishing negative sample constraints between the fused feature vector and the mismatched standard geometric relationship features refers to imposing a separation constraint on the distance relationship between the fused feature vector and the negative samples in the feature space. By setting a minimum margin or a lower bound requirement for distance, the model is prompted to actively increase the distance between the fused feature vector and the semantically inconsistent standard geometric relationship features during the training process, thereby improving the discriminative ability and distinguishability of the geometric embedding representation for different geometric relationships.
[0068] Furthermore, based on the changes in the training loss of the visual encoder and the text encoder, the optimization strength of positive and negative sample constraints is dynamically balanced, and the constraint boundary conditions are adaptively adjusted according to the convergence trend of the geometric semantic alignment loss function. This means that during the model training process, the magnitude of the training loss change and the convergence status of the visual encoder and the text encoder are continuously monitored, and the weight ratio of positive and negative sample constraints in the overall loss function is dynamically adjusted according to the rate of loss decrease or fluctuation. At the same time, the distance boundary setting between positive and negative samples is adjusted to ensure that the geometric semantic alignment process maintains stable convergence in different training stages and avoids over-constraint or under-constraint problems.
[0069] In summary, the encoder-based geometric feature embedding generation method provided in this application has the following technical effects: by achieving the technical goal of adaptive generation of geometric feature embedding driven by self-supervision and geometric rule constraints, the geometric embedding representation can stably depict the internal relationships of complex geometric structures and has good robustness and cross-scene generalization ability without the need for a large amount of manual annotation.
[0070] Example 2: Based on the same inventive concept as the encoder-based geometric feature embedding generation method in the foregoing examples, this application also provides an encoder-based geometric feature embedding generation system. Please refer to the appendix. Figure 2 The system includes: a visual encoder training module 1, used to train a visual encoder through a self-supervised pre-training task, the self-supervised pre-training task including geometric occlusion completion and geometric relation adversarial reasoning, so that the visual encoder learns a general representation of geometric elements; a multi-level geometric feature extraction module 2, used to receive a user-input geometric image to be processed and associated text annotations, and use the visual encoder to extract multi-level geometric features of the geometric image to be processed, the multi-level geometric features including local feature features and global topological relations, and simultaneously, use a text encoder to extract text annotation features of the associated text annotations; a fusion feature vector generation module 3, used to dynamically allocate fusion weights of the multi-level geometric features and the text annotation features through a gating attention mechanism based on the complexity evaluation result of the geometric image to be processed, and generate a fusion feature vector; and a structured geometric embedding representation generation module 4, used to perform similarity matching between the fusion feature vector and standard geometric relation features in a pre-built geometric knowledge base, and optimize the feature space using a geometric semantic alignment loss function based on the similarity matching result, and generate a structured geometric embedding representation.
[0071] Furthermore, the encoder-based geometric feature embedding generation system is also used for: performing geometric occlusion completion processing on the input sample geometric image to generate occluded training samples with missing geometric features; using a visual encoder to predict the missing geometric features of the occluded training samples to obtain predicted geometric feature representations; comparing the predicted geometric feature representations with the geometric feature representations of the complete geometric image to calculate the representation difference; and adjusting the parameters of the visual encoder according to the representation difference, so that the visual encoder gradually learns the general representation of geometric features.
[0072] Furthermore, the encoder-based geometric feature embedding generation system is also used to: construct adversarial training samples containing contradictory geometric relationships; train the visual encoder to identify anomalous geometric relationships in the adversarial training samples; optimize the parameter weights of the visual encoder according to the degree of difference between the anomalous geometric relationships and standard geometric relationships; and repeatedly perform geometric occlusion completion and geometric relationship adversarial reasoning until the visual encoder can stably output feature representations that conform to geometric rules.
[0073] Furthermore, the encoder-based geometric feature embedding generation system is also used to: extract local geometric feature features of the geometric image to be processed through the first-level network of the visual encoder, including edge features, vertex features and angle features; extract global topological relationship features of the geometric image to be processed through the second-level network of the visual encoder, including similar triangle relationships, parallel line relationships and perpendicular relationships; and perform hierarchical fusion of the local geometric feature features and global topological relationship features to form the multi-level geometric features.
[0074] Furthermore, the encoder-based geometric feature embedding generation system is also used to: analyze the feature distribution characteristics of the geometric image to be processed and evaluate the image complexity level, wherein the feature distribution characteristics include at least the number of geometric features, occlusion ratio, and annotation consistency; determine the initial weight allocation ratio of the multi-level geometric features and the text annotation features according to the image complexity level, including: a. increasing the fusion weight of the text annotation features when the image complexity level is in the low complexity range; b. increasing the fusion weight of the multi-level geometric features when the image complexity level is in the high complexity range; dynamically adjusting the initial weight allocation ratio through a gating attention mechanism to generate optimized fusion weights; and weightedly fusing the multi-level geometric features and text annotation features according to the fusion weights to output the fusion feature vector.
[0075] Furthermore, the encoder-based geometric feature embedding generation system is also used to: use the text annotation features as query vectors and the multi-level geometric features as key vectors and value vectors; calculate the correlation matrix between the query vector and the key vector; dynamically weight the correlation matrix according to the image complexity level to generate optimized fusion weights, and apply the fusion weights to the weighted aggregation of value vectors.
[0076] Furthermore, the encoder-based geometric feature embedding generation system is also used to: select a set of standard geometric relation features related to the current task from a pre-built geometric knowledge base; calculate the similarity metric between the fused feature vector and each feature in the set of standard geometric relation features; and filter a subset of standard geometric relation features whose matching degree meets the threshold based on the similarity metric.
[0077] Furthermore, the encoder-based geometric feature embedding generation system is also used to: construct a positive sample set containing matching feature pairs and a negative sample set containing non-matching feature pairs; calculate the positive sample feature distance of the positive sample set and the negative sample feature distance of the negative sample set through a geometric semantic alignment loss function; adjust the parameters of the visual encoder and the text encoder to reduce the positive sample feature distance while increasing the negative sample feature distance; and continuously adjust the parameters through an iterative optimization process until the structured geometric embedding representation reaches a preset quality standard.
[0078] Furthermore, the encoder-based geometric feature embedding generation system is also used to: employ a triplet loss function, with the anchor point being the fused feature vector, positive samples being matching standard geometric relation features, and negative samples being non-matching standard geometric relation features; establish positive sample constraints between the fused feature vector and the matching standard geometric relation features; establish negative sample constraints between the fused feature vector and the non-matching standard geometric relation features; dynamically balance the optimization strength of the positive sample constraints and negative sample constraints according to the changes in the training loss of the visual encoder and the text encoder, and adaptively adjust the constraint boundary conditions according to the convergence trend of the geometric semantic alignment loss function.
[0079] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The encoder-based geometric feature embedding generation method and specific examples in the foregoing embodiment one are also applicable to the encoder-based geometric feature embedding generation system of this embodiment. Through the foregoing detailed description of the encoder-based geometric feature embedding generation method, those skilled in the art can clearly understand the encoder-based geometric feature embedding generation system of this embodiment. Therefore, for the sake of brevity, it will not be described in detail here.
[0080] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0081] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of this application and its equivalents, this application also intends to include such modifications and variations.
Claims
1. A geometric feature embedding and generation method based on an encoder, characterized in that, The method includes: The visual encoder is trained through a self-supervised pre-training task, which includes performing geometric occlusion completion and adversarial reasoning of geometric relationships, so that the visual encoder learns a general representation of geometric elements. The system receives a user-input geometric image to be processed and associated text annotations, and uses the visual encoder to extract multi-level geometric features of the geometric image to be processed, including local feature features and global topological relationships. At the same time, the text annotation features of the associated text annotations are extracted through the text encoder. Based on the complexity evaluation result of the geometric image to be processed, the fusion weights of the multi-level geometric features and the text annotation features are dynamically allocated through a gating attention mechanism to generate a fusion feature vector; The fused feature vector is matched with the standard geometric relationship features in the pre-built geometric knowledge base for similarity, and the feature space is optimized using the geometric semantic alignment loss function based on the similarity matching results to generate a structured geometric embedding representation. A visual encoder is trained through a self-supervised pre-training task, which includes performing geometric occlusion completion and adversarial reasoning of geometric relationships, enabling the visual encoder to learn a general representation of geometric elements, including: Perform geometric occlusion completion processing on the input sample geometric image to generate occluded training samples with missing geometric elements; The occluded training samples are used to predict missing geometric features to obtain a predicted geometric feature representation. The predicted geometric feature representation is compared with the geometric feature representation of the complete geometric image, and the representation difference is calculated. The parameters of the visual encoder are adjusted according to the representation difference, so that the visual encoder gradually learns the general representation of geometric elements; The step of training the visual encoder through a self-supervised pre-training task also includes: Construct adversarial training samples containing contradictory geometric relationships; Train the visual encoder to recognize anomalous geometric relationships in the adversarial training samples; The parameter weights of the visual encoder are optimized based on the degree of difference between the abnormal geometric relationship and the standard geometric relationship. Repeatedly perform geometric occlusion completion and geometric relation adversarial reasoning until the visual encoder can stably output element representations that conform to geometric rules.
2. The encoder-based geometric feature embedding generation method as described in claim 1, characterized in that, The system receives a user-input geometric image to be processed and associated text annotations, and uses the visual encoder to extract multi-level geometric features from the geometric image to be processed. These multi-level geometric features include local feature characteristics and global topological relationships, including: The first-level network of the visual encoder extracts local geometric feature characteristics of the geometric image to be processed, including edge features, vertex features and angle features; The second-level network of the visual encoder extracts global topological relationship features of the geometric image to be processed, including similar triangle relationships, parallel line relationships, and perpendicular relationships; The local geometric features and global topological relationship features are hierarchically fused to form the multi-level geometric features.
3. The encoder-based geometric feature embedding generation method as described in claim 1, characterized in that, Based on the complexity evaluation result of the geometric image to be processed, the fusion weights of the multi-level geometric features and the text annotation features are dynamically allocated through a gating attention mechanism to generate a fused feature vector, including: Analyze the feature distribution characteristics of the geometric image to be processed, and evaluate the image complexity level. The feature distribution characteristics include at least the number of geometric features, occlusion ratio, and annotation consistency. Determine the initial weight allocation ratio between the multi-level geometric features and the text annotation features based on the image complexity level, including: a. When the image complexity level is in the low complexity range, increase the fusion weight of the text annotation features; b. When the image complexity level is in the high complexity range, increase the fusion weight of the multi-level geometric features; The initial weight allocation ratio is dynamically adjusted using a gating attention mechanism to generate optimized fusion weights; The multi-level geometric features and text annotation features are weighted and fused according to the fusion weights to output the fused feature vector.
4. The encoder-based geometric feature embedding generation method as described in claim 3, characterized in that, The initial weight allocation ratio is dynamically adjusted through a gating attention mechanism, including: The text annotation features are used as query vectors, and the multi-level geometric features are used as key vectors and value vectors; Calculate the correlation matrix between the query vector and the key vector; The correlation matrix is dynamically weighted according to the image complexity level to generate optimized fusion weights, and the fusion weights are applied to the weighted aggregation of value vectors.
5. The encoder-based geometric feature embedding generation method as described in claim 1, characterized in that, The fused feature vector is matched with standard geometric relation features in a pre-built geometric knowledge base based on similarity, including: Select a set of standard geometric relation features relevant to the current task from a pre-built geometric knowledge base; Calculate the similarity metric between the fused feature vector and each feature in the standard geometric relationship feature set; Based on the similarity metric, a subset of standard geometric relationship features that meet the matching threshold is selected.
6. The encoder-based geometric feature embedding generation method as described in claim 5, characterized in that, Based on the similarity matching results, the feature space is optimized using a geometric semantic alignment loss function to generate a structured geometric embedding representation, including: Construct a set of positive samples containing matching feature pairs and a set of negative samples containing non-matching feature pairs; The positive sample feature distance of the positive sample set and the negative sample feature distance of the negative sample set are calculated using the geometric semantic alignment loss function. Adjust the parameters of the visual encoder and text encoder to reduce the feature distance of positive samples while increasing the feature distance of negative samples; The parameters are continuously adjusted through an iterative optimization process until the structured geometric embedding representation reaches the preset quality standard.
7. The encoder-based geometric feature embedding generation method as described in claim 1, characterized in that, The geometric semantic alignment loss function is implemented through contrastive learning, including: The triplet loss function is adopted, with the anchor point being the fused feature vector. Positive samples are the matching standard geometric relationship features, and negative samples are the non-matching standard geometric relationship features. Establish positive sample constraints between the fused feature vector and the matched standard geometric relationship features; Establish negative sample constraints between the fused feature vector and the mismatched standard geometric relationship features; Based on the changes in the training loss of the visual encoder and the text encoder, the optimization strength of the positive sample constraints and negative sample constraints is dynamically balanced, and the constraint boundary conditions are adaptively adjusted according to the convergence trend of the geometric semantic alignment loss function.
8. A geometric feature embedding and generation system based on an encoder, characterized in that, The steps for implementing the encoder-based geometric feature embedding generation method according to any one of claims 1 to 7 include: A visual encoder training module is used to train a visual encoder through self-supervised pre-training tasks, including geometric occlusion completion and geometric relation adversarial reasoning, so that the visual encoder learns a general representation of geometric elements. The multi-level geometric feature extraction module is used to receive the geometric image to be processed and the associated text annotations input by the user, and to extract the multi-level geometric features of the geometric image to be processed using the visual encoder. The multi-level geometric features include local feature features and global topological relationships. At the same time, the text annotation features of the associated text annotations are extracted by the text encoder. The fusion feature vector generation module is used to dynamically allocate the fusion weights of the multi-level geometric features and the text annotation features through a gating attention mechanism based on the complexity evaluation result of the geometric image to be processed, and generate a fusion feature vector. The structured geometric embedding representation generation module is used to perform similarity matching between the fused feature vector and the standard geometric relationship features in the pre-built geometric knowledge base, and optimize the feature space using the geometric semantic alignment loss function based on the similarity matching result to generate a structured geometric embedding representation.
Citation Information
Patent Citations
Multi-precision three-dimensional surveying and mapping data fusion method based on dynamic modeling
CN120563982A
Defect detection method and system for precision parts, product and medium
CN122089653A