Method and system for generating a training set of face images, and electronic device

CN122888604APending Publication Date: 2026-10-09CHINA RAILWAY TUNNEL GROUP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611021986.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0004]本申请实施例提供了一种掌子面图像训练集的生成方法、系统及电子设备,以至少解决相关技术中因标注数据稀缺、源域与目标域地质图像存在显著域偏移,使得现有深度学习模型泛化能力不足,难以在实际工程场景中有效部署和应用的技术问题

Benefits of technology

[0016]在本申请实施例中,通过层次化聚类技术从源域标注数据中提取深层视觉特征,并构建地质语义原型库;将源域和目标域的掌子面图像共同输入特征提取器,利用地质语义原型库通过对比学习机制拉近同类围岩图像特征与对应语义原型的距离,实现特征空间上的对齐;基于对齐后的特征表示对目标域未标注图像进行分类预测,并根据预测结果确定图像的不确定性,选择信息量丰富的样本加入训练集,提高模型泛化能力,进而解决了相关技术中因标注数据稀缺、源域与目标域地质图像存在显著域偏移,使得现有深度学习模型泛化能力不足,难以在实际工程场景中有效部署和应用的技术问题,达到提升了掌子面图像分析的准确性和可靠性的技术效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122888604A_ABST
    Figure CN122888604A_ABST
Patent Text Reader

Abstract

The application relates to a method and system for generating a training set of a working face image and an electronic device. The method comprises the following steps: constructing a geological semantic prototype library; obtaining a feature representation, and using the geological semantic prototype library to narrow the distance between the image features of the same surrounding rock in two domains and the semantic prototype corresponding to the surrounding rock category through a comparison learning mechanism to obtain an aligned feature representation; predicting unlabelled working face images of a target domain to obtain a category probability distribution of the unlabelled working face images of the target domain; determining the prediction uncertainty of the working face images of the target domain based on the category probability distribution of the working face images of the target domain, and screening out candidate working face images with an information amount not lower than a preset threshold, and adding the candidate working face images to the training set, thereby solving the technical problem that, in related technologies, due to the scarcity of labeled data and the significant domain offset between source domain and target domain geological images, the generalization ability of an existing deep learning model is insufficient, and the model is difficult to effectively deploy and apply in an actual engineering scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of geological engineering and tunnel excavation technology, and in particular to a method, system and electronic device for generating a training set of tunnel face images. Background Technology

[0002] Traditional tunnel face image analysis relies on expert judgment, which is not only inefficient but also heavily influenced by subjective factors. With the development of computer vision technology, deep learning-based image recognition methods are increasingly being applied in this field. However, due to the significant differences in tunnel face image features under different geological conditions, effectively utilizing limited labeled data for model training has become a key issue hindering the widespread application of this technology. For example, in practical applications, acquiring a large number of precisely labeled tunnel face images is costly, limiting the effective training of deep learning models. Furthermore, significant differences in geological conditions across different projects or regions mean that models trained in one specific environment are difficult to directly apply to others.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides a method, system, and electronic device for generating a training set of tunnel face images, in order to at least solve the technical problem in related technologies that the lack of annotation data and the significant domain offset between source and target domain geological images make the generalization ability of existing deep learning models insufficient and difficult to effectively deploy and apply in practical engineering scenarios.

[0005] According to one aspect of the embodiments of this application, a method for generating a training set of working face images is provided, comprising: extracting deep visual features based on working face images labeled in the source domain, performing hierarchical clustering according to a multi-level geological classification system, generating semantic prototypes corresponding to various types of surrounding rocks, and constructing a geological semantic prototype library; inputting working face images from the source domain and unlabeled working face images from the target domain into a feature extractor to obtain feature representations, and using the geological semantic prototype library to narrow the distance between the image features of the same type of surrounding rock in the two domains and the semantic prototypes corresponding to the rock category through a contrastive learning mechanism to obtain aligned feature representations; predicting the unlabeled working face images from the target domain based on the aligned feature representations to obtain the category probability distribution of the unlabeled working face images from the target domain; determining the prediction uncertainty of the working face images from the target domain based on the category probability distribution of the working face images from the target domain, filtering out candidate working face images with information content not lower than a preset threshold, and adding the candidate working face images to the training set.

[0006] Optionally, the multi-level geological classification system includes three levels: lithology category, structural features, and hydrological status; the construction process of the geological semantic prototype library includes: performing hierarchical clustering on the feature vectors of the face images labeled in the source domain according to the three-level geological labels, first clustering according to the lithology category to obtain the first-level prototype, then clustering according to the structural features within each lithology cluster to obtain the second-level prototype, and finally clustering according to the hydrological status within each structural sub-cluster to obtain the third-level prototype, forming a tree-like prototype structure.

[0007] Optionally, the contrastive learning mechanism employs a prototype contrastive loss function, the expression of which is:

[0008] in, Indicates the first The feature vector output by the feature extractor of the image This represents the semantic prototype of the geological category corresponding to the image. The first in the geological semantic prototype library A prototype, The total number of prototypes, The cosine similarity function is used. For temperature coefficient, This represents the total number of images used in a single training batch.

[0009] Optionally, determining the prediction uncertainty of the target domain face image based on the category probability distribution of the target domain face image includes: performing multiple forward inferences on the target domain face image to obtain multiple category probability distributions, calculating the variance of the prediction probability of each category, and taking the average variance of all categories as the uncertainty score of the target domain face image.

[0010] Optionally, candidate face images with information content not lower than a preset threshold are selected, including: sorting all target domain face images from high to low uncertainty scores, and selecting the top... The image is used as a candidate face image, where, This is a preset ratio.

[0011] Optionally, before adding the candidate face images to the training set, the method further includes: obtaining the geological semantic labels of the candidate face images, and adding the labeled candidate face images to the training set.

[0012] Optionally, it further includes: training a generative model constrained by geological semantics based on real face images and their corresponding geological semantic labels, generating synthetic face images, and adding the synthetic face images to the training set.

[0013] Optionally, the geologically semantically constrained generation model is a conditional diffusion model. Differentiable geological rule constraints are embedded in the denoising process of the conditional diffusion model, including: generating a priori masks of fracture orientation based on the direction of the regional tectonic stress field, and weighting the gradient directionally through a spatial attention mechanism during the denoising process to guide the generated fracture edges to distribute along the direction of the stress field; determining whether the rock mass is permeable based on the lithology category in the input geological semantic label, and if it is determined to be an impermeable rock, forcibly setting the pixel values ​​of the seepage areas in the synthesized face image to zero during the denoising output stage; and dynamically adjusting the density parameters of fracture generation during the denoising process according to the preset interval corresponding to the Rock Quality Designation (RQD) value in the input geological semantic label, so as to control the number and connectivity of fractures in the synthesized face image.

[0014] According to another aspect of the embodiments of this application, a system for generating a training set of working face images is provided, comprising: a first processing module, configured to extract deep visual features based on working face images labeled in the source domain, and perform hierarchical clustering according to a multi-level geological classification system to generate semantic prototypes corresponding to various types of surrounding rocks, and construct a geological semantic prototype library; a second processing module, configured to input both the working face images in the source domain and unlabeled working face images in the target domain into a feature extractor to obtain feature representations, and use the geological semantic prototype library to narrow the distance between the image features of the same type of surrounding rock in the two domains and the semantic prototypes corresponding to the rock category through a contrastive learning mechanism to obtain aligned feature representations; a third processing module, configured to predict the unlabeled working face images in the target domain based on the aligned feature representations to obtain the category probability distribution of the unlabeled working face images in the target domain; and a fourth processing module, configured to determine the prediction uncertainty of the working face images in the target domain based on the category probability distribution of the working face images in the target domain, filter out candidate working face images with information content not lower than a preset threshold, and add the candidate working face images to the training set.

[0015] According to another aspect of the present application, an electronic device is provided, including: a processor, and a memory storing a program, the program including instructions that, when executed by the processor, cause the processor to perform the methods described above.

[0016] In this embodiment, deep visual features are extracted from the source domain labeled data using hierarchical clustering technology, and a geological semantic prototype library is constructed. The tunnel face images from both the source and target domains are input into a feature extractor. The geological semantic prototype library is used to narrow the distance between the features of similar surrounding rock images and their corresponding semantic prototypes through a comparative learning mechanism, achieving alignment in the feature space. Based on the aligned feature representations, unlabeled images in the target domain are classified and predicted. The uncertainty of the images is determined based on the prediction results, and information-rich samples are selected to be added to the training set to improve the model's generalization ability. This solves the technical problem in related technologies where the scarcity of labeled data and significant domain shifts between the source and target domain geological images result in insufficient generalization ability of existing deep learning models, making them difficult to effectively deploy and apply in practical engineering scenarios. This achieves the technical effect of improving the accuracy and reliability of tunnel face image analysis.

[0017] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating the method for generating a training set of face images provided in this application embodiment; Figure 2 A schematic diagram of a system for generating a training set of working face images provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0020] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that embodiments of this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the embodiments of this application. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of this application.

[0021] According to one aspect of the embodiments of this application, a method for generating a training set of tunnel face images is provided, which can be deployed in the real-time geological sensing system of a tunnel boring machine or a drill-and-blast tunnel to update the geological interpretation model online and assist in construction decision-making. Figure 1 A flowchart of the method for generating a training set of face images provided in the embodiments of this application is shown below. Figure 1 As shown, the method includes the following steps: Step S102: Based on the source domain-annotated face images, deep visual features are extracted and hierarchically clustered according to a multi-level geological classification system to generate semantic prototypes corresponding to various types of surrounding rocks, thus constructing a geological semantic prototype library. The multi-level geological semantic prototypes are constructed in the deep feature space of the source domain-annotated data using a clustering algorithm. Each prototype level corresponds to a semantic level of a geological attribute, and higher-level prototypes are composed of lower-level prototypes. The geological semantic prototypes are dynamically updated after each active learning iteration to reflect the semantic distribution changes brought about by newly annotated data, thereby improving the accuracy of subsequent cross-domain alignment. The target domain is a collection of face images from geological work areas different from the source domain, using different imaging equipment, or under different lighting / humidity conditions. High-precision lithology identification and hydrological status assessment are achieved without requiring full annotation of the target domain. The geological semantic prototype library is updated through incremental clustering: features of newly annotated samples are added to the corresponding category clusters, and the mean vector of each level of prototype in that category is recalculated, avoiding the computational overhead of full re-clustering. The source domain images are derived from publicly available rock datasets, while the target domain images are obtained from cameras at the actual tunnel excavation face. There is a domain shift between the two due to differences in imaging conditions and lithological composition. The process also includes preprocessing the tunnel face images; for example, adaptive histogram equalization and dehazing are performed on the source and target domain images respectively to reduce the interference of differences in imaging conditions on feature extraction.

[0022] Step S104: Input the source domain face image and the unlabeled target domain face image into the feature extractor to obtain feature representations. Utilize a geological semantic prototype library and employ a contrastive learning mechanism to narrow the distance between the image features of similar surrounding rocks in both domains and the semantic prototypes corresponding to that rock category, resulting in aligned feature representations. Construct multi-level geological semantic prototypes in the feature space and align similar prototypes between the source and target domains through contrastive learning. This effectively alleviates the domain shift problem caused by differences in geological conditions in scenarios such as tunnels / underground engineering, improving the model's generalization ability. The feature extractor is a deep neural network based on Vision Transformer or convolutional neural networks. Based on the aligned feature representations, a semi-supervised learning framework is used to generate pseudo-labels for the unlabeled target domain face images. Consistency regularization constrains the model's prediction stability under different augmented views, improving the model's generalization ability in the target domain. Based on the model's prediction uncertainty for the target domain face images, high-value images with the highest information content are selected as candidate images to be prioritized for annotation. Obtain expert annotations for the high-value images and add these expert-annotated images to the training set to supplement scarce real supervision signals. The semi-supervised learning framework employs a teacher-student architecture, where teacher model parameters are updated using an exponential moving average of student model parameters. Prediction uncertainty is quantified by the prediction variance through multiple forward inferences using Monte Carlo Dropout, and samples with the highest uncertainty (5% to 10%) are selected as high-value samples (i.e., candidate face images). The feature extractor loads Vision Transformer (ViT-Base) weights pre-trained on large-scale geological images using a masked autoencoder task during initialization, and performs end-to-end fine-tuning in conjunction with prototype contrastive loss during subsequent training. Aligned feature representations are obtained through cross-domain semantic alignment (prototype contrastive learning), eliminating domain offset between the source and target domains. This ensures that the feature space distribution of the target domain image aligns with the geological semantic prototype of the source domain, thereby improving the model's prediction reliability and the effectiveness of uncertainty assessment in the target domain. The aligned feature representations effectively mitigate the impact of domain offset on prediction results by narrowing the distance between similar surrounding rock features and shared semantic prototypes in the two domains.

[0023] Step S106: Based on the aligned feature representation, predict the unlabeled face image in the target domain to obtain the class probability distribution of the unlabeled face image in the target domain.

[0024] Step S108: Based on the category probability distribution of the target domain face image, determine the prediction uncertainty of the target domain face image, filter out candidate face images with information content not lower than a preset threshold, and add the candidate face images to the training set.

[0025] In the embodiments of the present application, deep visual features are extracted from labeled source domain data through hierarchical clustering technology, and a geological semantic prototype library is constructed; the face images of the source domain and the target domain are input into a feature extractor together, and the geological semantic prototype library is used to reduce the distance between the features of the same type of surrounding rock images and the corresponding semantic prototypes through a contrast learning mechanism, so as to realize the alignment in the feature space; the aligned feature representation is used to perform classification prediction on unlabeled images in the target domain, the uncertainty of the images is determined according to the prediction results, and samples with rich information are selected to be added to the training set, which improves the generalization ability of the model, thereby solving the technical problem in related technologies that due to the scarcity of labeled data and the significant domain shift between geological images of the source domain and the target domain, the existing deep learning models have insufficient generalization ability and are difficult to be effectively deployed and applied in actual engineering scenarios, and achieving the technical effect of improving the accuracy and reliability of face image analysis.

[0026] It should be noted that, in the embodiments of the present application, by constructing a geological semantic prototype library and adopting a contrast learning mechanism, the generalization ability of the model can be effectively improved based on a small amount of labeled data, and the dependence on large-scale labeled datasets is reduced. The feature alignment process can effectively narrow the feature gap between the source domain and the target domain, so that the trained model has better cross-domain applicability. In addition, quantifying prediction uncertainty to screen high-value samples can improve the reliability of the model and reduce potential risks in the decision-making process.

[0027] As an alternative embodiment, the multi-level geological classification system includes three levels: lithology category, structural feature and hydrological state; the construction process of the geological semantic prototype library includes: performing hierarchical clustering on the feature vectors of the labeled face images in the source domain according to three-level geological labels, firstly clustering according to lithology categories to obtain first-level prototypes, then clustering according to structural features within each lithology cluster to obtain second-level prototypes, and finally clustering according to hydrological states within each structural sub-cluster to obtain third-level prototypes, forming a tree-shaped prototype structure.

[0028] Alternatively, the multi-level geological classification system adopts a three-level structure, which is specifically defined as follows: First level: lithology category, including main rock types such as granite, sandstone, shale and limestone.

[0029] Second level: structural feature, characterized by rock mass quality index RQD grade or the number of groups of structural planes. For example, RQD is divided into: Grade I (RQD>90%), Grade II (75%<RQD≤90%), Grade III (50%<RQD≤75%), Grade IV (25%<RQD≤50%), Grade V (RQD≤25%).

[0030] Third level: hydrological state, divided into four grades of dry, damp, water seepage and water gushing according to the water seepage condition of the working face.

[0031] Furthermore, the construction process of the geological semantic prototype library is as follows: Using a pre-trained Vision Transformer (ViT-Base) as the feature extractor, forward inference is performed on the annotated face images in the source domain to extract the [CLS] token (a special marker used for classification tasks in the Transformer model, added to the beginning of the input sequence, aggregating the semantic information of the entire sequence through a self-attention mechanism, and whose final output vector represents the overall representation) of each image as its deep visual feature vector; hierarchical clustering is performed from top to bottom according to the three-level geological labels of each image: First-level clustering: Group all images by lithology category, and use K-means clustering within each group ( ) Calculate the average characteristics of the lithology to obtain the first-level semantic prototype (such as the granite prototype).

[0032] Second-level clustering: Within each lithological cluster, groups are formed according to RQD level, and the average characteristics of each group are calculated to obtain the second-level semantic prototype (e.g., granite – RQD II prototype).

[0033] Three-level clustering: Within each RQD sub-cluster, groups are further grouped according to hydrological status, and average features are calculated to form a three-level semantic prototype (e.g., granite – RQD II – seepage prototype).

[0034] All levels of prototypes are organized into a tree structure, with parent nodes representing coarse-grained semantics (such as lithology) and child nodes representing fine-grained semantics (such as hydrological status), supporting multi-granular semantic alignment and prototype comparison learning.

[0035] In the subsequent cross-domain alignment stage, the features of the target domain image can be used to calculate similarity with first-level, second-level, or third-level prototypes simultaneously, thereby achieving multi-level semantic constraints and improving the ability to model complex geological scenes.

[0036] In this embodiment, a three-level geological classification system and a tree-like semantic prototype structure are introduced to overcome the limitations of traditional single-label classification. The three-dimensional label system of "lithology-structure-hydrology" comprehensively describes the characteristics of the surrounding rock, making the semantic prototype closer to engineering practice. The tree-like prototype supports multi-granularity alignment (such as lithology alignment only, or joint alignment of lithology and structure). Even if the hydrological status of the target domain image is missing or there is a lot of noise, effective semantic transfer can still be achieved through high-level prototypes. When there are very few labeled samples, high-level prototypes (such as lithology) can be used to provide prior knowledge to avoid overfitting caused by sparse fine-grained labels. The trained model can simultaneously predict lithology, RQD level and hydrological status, meeting the multi-dimensional geological assessment needs in tunnel engineering.

[0037] As an optional implementation, the contrastive learning mechanism employs a prototype contrastive loss function, the expression of which is:

[0038] in, Indicates the first The feature vector output by the feature extractor of the image; The semantic prototype representing the geological category corresponding to the image (from the geological semantic prototype library). The first in the geological semantic prototype library One prototype; This represents the total number of prototypes (for example, if a three-level classification system is used and there are a total of 60 fine-grained surrounding rock categories, then...). ); The cosine similarity function; This is a temperature coefficient used to adjust the sharpness of the similarity distribution; This represents the total number of images involved in the computation in a single training batch (typically including source domain labeled images and target domain unlabeled images).

[0039] Optionally, using the annotated tunnel face images in the source domain, hierarchical clustering is performed according to the three-level labels of "lithology-structure-hydrology" to generate semantic prototypes for each surrounding rock category. These prototypes are then updated with fixed or momentum-based updates. Source and target domain face images from a training batch are input into a shared feature extractor to obtain feature vectors. For each Calculate its relationship with all Cosine similarity of each prototype. For source domain images (with known labels) Use its corresponding prototype directly. Calculate the similarity of positive samples; for target domain images (unlabeled), in the early stages of training, they can be used only as negative samples in the denominator calculation, or temporary pseudo-labels can be used in the later stages. By minimizing This causes the characteristics of similar surrounding rocks to converge toward their semantic prototypes, while dissimilar characteristics move away.

[0040] In this embodiment, a contrastive learning mechanism based on geological semantic prototypes is introduced. By drawing the image features of the source and target domains together towards the same set of geological semantic prototypes, the differences in feature distribution caused by different imaging conditions (lighting, angle, dust) are effectively eliminated, achieving cross-domain semantic space alignment. The prototypes, acting as category centers, guide features to form compact cluster structures, enhancing intra-class consistency and inter-class separability, enabling the model to accurately identify surrounding rock types even with small sample conditions. Even if the target domain image is unlabeled, its features can still be constrained within a reasonable semantic region through contrastive learning, avoiding feature drift and providing a reliable foundation for subsequent uncertainty estimation and active learning. Prototypes can be constructed at the first level (lithology), second level (structure), or third level (hydrology), and the loss function can be flexibly adapted to alignment requirements of different granularities, improving the engineering applicability of the method.

[0041] As an optional embodiment, the prediction uncertainty of the target domain face image is determined based on the category probability distribution of the target domain face image. This includes: performing multiple forward inferences on the target domain face image to obtain multiple category probability distributions, calculating the variance of the prediction probability of each category, and taking the average variance of all categories as the uncertainty score of the target domain face image. Candidate face images with information content not lower than a preset threshold are then selected, including: sorting all target domain face images from highest to lowest uncertainty score, and selecting the top... The image is used as a candidate face image, where, This is a preset ratio.

[0042] Optionally, the quantification of prediction uncertainty adopts a Bayesian approximation method based on Monte Carlo Dropout, and the specific steps are as follows: In the trained feature extractor and classification head (i.e., the student model), the Dropout layer is kept active (Dropout is usually disabled during inference, but enabled here to introduce randomness). This applies to the same unlabeled face image of the target domain. Independent execution Each forward inference iteration outputs one... dimensional softmax probability vector ,in This represents the total number of geological categories (e.g., 60 tertiary rock categories). For each geological category Calculate its in The sample variance of the predicted probability in this inference: ,in For category The average predicted probability. The arithmetic mean of the variances for all categories is taken to obtain the final uncertainty score for the image: The higher the score, the more unstable the model's predictions for that image, and the greater the amount of information it contains. All target domain images are then sorted... Sort in descending order and select the first few. (like or These high-value candidate images were labeled and added to the training set.

[0043] It should be noted that the feature extractor adopts the ViT-Base architecture, embedding Dropout in the MLP layer of the Transformer encoder; the classification head is a single-layer fully connected layer with softmax.

[0044] In this embodiment, an uncertainty quantification mechanism based on multiple inference variance is employed. Compared to simple metrics such as single prediction entropy or maximum confidence, variance more accurately reflects the model's cognitive uncertainty, effectively distinguishing difficult examples (such as ambiguous fractures or weak seepage) from easy examples and avoiding misclassifying noise as high-value samples. Only images that the model is unsure about need to be labeled, reducing manual labeling costs. Introducing high-quality labeled samples significantly improves the model's ability to identify long-tailed geological categories, alleviating the class imbalance problem. This uncertainty estimation is decoupled from semi-supervised pseudo-label generation; even if some pseudo-labels are incorrect, reliable uncertainty can still be calculated based on the original probability distribution, improving the robustness of active learning.

[0045] As an optional embodiment, before adding candidate face images to the training set, the method further includes: obtaining geological semantic labels for candidate face images and adding labeled candidate face images to the training set.

[0046] Optionally, before adding the selected candidate face images to the training set, a human expert annotation process is introduced to obtain high-quality geological semantic labels. The specific implementation process is as follows: The selected candidate face images with high uncertainty (as before) The images are sorted in descending order of uncertainty score, and a visualization interface is generated to display each image along with its predicted probability distribution, uncertainty heatmap, and other auxiliary information. Geological engineers or tunnel construction technicians with geotechnical engineering backgrounds interpret each candidate image through a human-computer interaction platform, assigning it a three-level geological semantic label. The labeling results are cross-validated by two people or reviewed by senior experts, forming structured labels (e.g., in JSON format), which are then bound to the original images and stored in the labeling database. Candidate tunnel face images with complete three-level geological semantic labels are used as new supervised samples and merged with the original source domain labeling data to form an enhanced training set for the next round of model fine-tuning or prototype library updates.

[0047] In this embodiment, an expert annotation closed-loop mechanism is introduced, which differs from purely pseudo-labeling or weakly supervised methods. High-value samples selected through active learning are annotated by domain experts, improving the quality of new training data and preventing model degradation caused by the accumulation of incorrect labels. Annotation is only performed on images with the most information, significantly reducing manual costs while improving the model's ability to recognize complex or boundary geological scenes. Three-level structured labels enable the model to simultaneously output lithology, structure, and hydrology information, meeting the multi-dimensional decision-making needs of tunnel engineering, such as surrounding rock classification, support design, and drainage planning.

[0048] As an optional embodiment, the method further includes: training a generative model constrained by geological semantics based on real tunnel face images and their corresponding geological semantic labels, generating synthetic tunnel face images, and adding the synthetic tunnel face images to the training set. The conditional inputs of the conditional diffusion model include real tunnel face images and their corresponding geological semantic labels, whereby the geological semantic labels are used to control the spatial distribution pattern of fractures, rock mass integrity index, and location of seepage areas in the generated images.

[0049] Optionally, to alleviate the scarcity of real-world labeled data, especially the insufficient samples for long-tailed geological categories (such as shale-RQD IV-water inrush), a generative model constrained by geological semantics is further introduced to synthesize face images that conform to geophysical laws, and to expand the training set. The specific implementation steps are as follows: A Conditional Diffusion Model is used as the backbone for generation. Its inputs include random noise and geological semantic labels encoded using a three-level structure (e.g., one-hot vector concatenation or embedding), encompassing lithology, structural features (RQD level), and hydrological status. Differentiable geological rule constraint units are integrated into the denoising network (U-Net) of the diffusion model to ensure that the generated content conforms to engineering geological principles, as detailed below: Fracture orientation constraint: A directional prior map is generated based on the direction of the regional tectonic stress field (provided by the geological survey report), and the fracture is guided to extend along the principal stress direction through a spatial attention mechanism.

[0050] Water seepage rationality control: If the lithology in the input label is non-permeable rock (such as intact granite), then the pixel value of the forced seepage area in the output layer will be set to zero.

[0051] Crack density control: The number and connectivity of cracks in the generated image are dynamically adjusted according to the RQD level (e.g., RQD level V corresponds to high-density network cracks, and RQD level I corresponds to very few cracks).

[0052] End-to-end training is performed using real face images labeled in the source domain and their corresponding third-level geological semantic labels. Loss functions include: diffusion reconstruction loss (L2 or LPIPS); geological rule consistency loss (e.g., orientation alignment loss, seepage masking loss); and adversarial loss (optional, if combined with a discriminator to improve texture realism). After training, multiple synthetic face images can be generated for any target geological category. The synthetic images are then posteriorly validated using a pre-trained geological plausibility checker (e.g., orientation detection CNN, seepage classifier); images that pass all rule checks (e.g., the angle between the principal direction of the fracture and the stress field) are retained. (Water seepage only occurs in permeable rock areas). Validated synthetic face images are paired with their corresponding geological semantic labels, added to the training set, and mixed with ground-labeled images for subsequent model training (such as feature extractor fine-tuning and prototype library updates).

[0053] In this embodiment, a controllable image generation technology integrating prior geological knowledge is used to generate a large number of physically consistent samples for rare but engineering-critical surrounding rock types (such as soft surrounding rock with high-pressure water inflow), improving the model's recall rate for long-tail categories. Synthetic images can simulate variations in lighting, angles, and fracture combinations, enhancing the model's robustness to complex conditions without increasing field data collection costs. Domain knowledge is embedded into the generation process through a differentiable geological rule module, avoiding the generation of visually realistic but geologically absurd images (such as generating water inflow on intact rock masses) produced by traditional GAN / diffusion models, thus ensuring the synthetic data's engineering usability. Active learning acquires a small number of high-value real-world annotations, which, combined with geological constraints, generate a large-scale, reasonably expanded training sample set; these two elements work together to construct an efficient training paradigm.

[0054] As an optional embodiment, the generative model constrained by geological semantics is a conditional diffusion model. Differentiable geological rule constraints are embedded in the denoising process of the conditional diffusion model, including: generating a priori masks of fracture orientation based on the direction of the regional tectonic stress field, and using a spatial attention mechanism to directionally weight the gradient during denoising to guide the generated fracture edges to distribute along the stress field direction; determining whether the rock mass is permeable based on the lithology category in the input geological semantic labels, and if it is determined to be an impermeable rock type, forcing the pixel values ​​of the seepage areas in the synthesized face image to zero during the denoising output stage; and dynamically adjusting the density parameters of fracture generation during denoising based on the preset interval corresponding to the rock mass quality index RQD value in the input geological semantic labels to control the number and connectivity of fractures in the synthesized face image.

[0055] Optionally, the generative model constrained by geological semantics adopts a conditional diffusion model, and a differentiable geological rule constraint module is embedded in the forward denoising process of its denoising network (U-Net) to ensure that the generated synthetic face image strictly conforms to the engineering geological and physical laws. The specific implementation steps are as follows: A U-Net-based conditional diffusion model is employed, with time-step noise control. The conditional input consists of three levels of geological semantic labels, representing lithology, structural features (RQD level), and hydrological status. These labels are injected into the intermediate layers of U-Net via a cross-attention mechanism to guide image content generation. A global directional prior mask is generated based on the principal direction of the tectonic stress field in the project area, with its gradient direction along the principal stress field direction. During the upsampling stage of U-Net, a direction-aware spatial attention module is introduced to weight the gradient flow of the feature map, ensuring that the generated fracture edges primarily extend along the principal stress direction, avoiding random or vertical fractures that do not conform to geomechanical principles. A preset permeability table is queried based on the input lithology label. If the rock is determined to be impermeable, a permeability mask gating operation is added after the denoising output layer, ensuring that no permeability texture appears in the impermeable rock mass image, consistent with hydrogeological common sense. The input RQD level (Level I-V) is mapped to the fracture density coefficient. In the edge enhancement branch of U-Net, the fracture density coefficient is used as a scaling factor to control the intensity of high-frequency detail generation. The lower the RQD (the more fractured the rock mass), the more fractures are generated and the stronger the connectivity, which truly reflects the differences in rock mass integrity.

[0056] In this embodiment, by deeply embedding differentiable geological rules during the denoising process of the conditional diffusion model, fracture orientation, seepage distribution, and fracture density are all controlled by real geological parameters (stress field, lithology, RQD), avoiding the generation of visually plausible but geologically absurd images and improving the engineering credibility of the synthetic data. Any three-level geological combination (e.g., limestone-RQD III-seepage) can be specified as needed to automatically generate corresponding working face images, providing training samples for rare working conditions and solving the problem of missing long-tail category data. All geological rules (direction weighting, seepage gating, density adjustment) are designed as differentiable operations and can be jointly trained with diffusion loss, enabling the model to internalize geological knowledge while maintaining generation quality.

[0057] According to another aspect of the embodiments of this application, a system for generating a training set of working face images is provided. Figure 2 This is a schematic diagram of the system for generating a training set of working face images provided in an embodiment of this application, as shown below. Figure 2 As shown, the system for generating the training set of tunnel face images includes: a first processing module 202, a second processing module 204, a third processing module 206, and a fourth processing module 208. The system for generating the training set of tunnel face images will be described in detail below.

[0058] The first processing module 202 is used to extract deep visual features from the face image based on the source domain annotation, and perform hierarchical clustering according to the multi-level geological classification system to generate semantic prototypes of various types of surrounding rocks and build a geological semantic prototype library. The second processing module 204 is used to input the source domain face image and the target domain unlabeled face image into the feature extractor to obtain feature representations. It also uses a geological semantic prototype library to narrow the distance between the image features of the same type of surrounding rock in the two domains and the semantic prototypes corresponding to the surrounding rock category through a contrastive learning mechanism, thereby obtaining aligned feature representations. The third processing module 206 is used to predict the unlabeled face image of the target domain based on the aligned feature representation, and obtain the class probability distribution of the unlabeled face image of the target domain. The fourth processing module 208 is used to determine the prediction uncertainty of the target domain face image based on the category probability distribution of the target domain face image, filter out candidate face images with information content not lower than a preset threshold, and add the candidate face images to the training set.

[0059] It should be noted that the first processing module 202, the second processing module 204, the third processing module 206 and the fourth processing module 208 mentioned above correspond to steps S102 to S108 in the method embodiment. The examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in the above method embodiment.

[0060] In this embodiment, the system extracts deep visual features from source domain labeled data using hierarchical clustering technology and constructs a geological semantic prototype library. It inputs both source and target domain face images into a feature extractor, using the geological semantic prototype library to narrow the distance between similar surrounding rock image features and corresponding semantic prototypes through a contrastive learning mechanism, achieving alignment in the feature space. Based on the aligned feature representation, it performs classification prediction on unlabeled images in the target domain, determines the image uncertainty based on the prediction results, and selects information-rich samples to add to the training set, improving the model's generalization ability. This solves the technical problem in related technologies where scarce labeled data and significant domain shifts between source and target domain geological images result in insufficient generalization ability of existing deep learning models, making them difficult to effectively deploy and apply in practical engineering scenarios. This achieves the technical effect of improving the accuracy and reliability of face image analysis.

[0061] According to another aspect of the embodiments of this application, an electronic device is provided, including: a processor, and a memory storing a program, the program including instructions that, when executed by the processor, cause the processor to perform the methods described above.

[0062] refer to Figure 3The present invention describes a structural block diagram of an electronic device that can serve as a server or client in embodiments of this application, which is an example of a hardware device that can be applied to various aspects of this application. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the application described and / or claimed herein.

[0063] like Figure 3 As shown, the electronic device includes a computing unit 301, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. The RAM 303 may also store various programs and data required for the operation of the electronic device. The computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0064] Multiple components in the electronic device are connected to I / O interface 305, including: input unit 306, output unit 307, storage unit 308, and communication unit 309. Input unit 306 can be any type of device capable of inputting information into the electronic device. Input unit 306 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 307 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 308 may include, but is not limited to, disks and optical discs. Communication unit 309 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, and wireless communication transceivers, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0065] The computing unit 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processors, controllers, microcontrollers, etc. The computing unit 301 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of this application can be implemented as computer programs tangibly contained in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 302 and / or communication unit 309. In some embodiments, the computing unit 301 can be configured to perform the methods described above by any other suitable means (e.g., by means of firmware).

[0066] It should be noted that the term "comprising" and its variations used in the embodiments of this application are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; and the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of this application are illustrative and not restrictive. Those skilled in the art should understand that, unless explicitly indicated otherwise in the context, they should be understood as "one or more".

[0067] The steps described in the method embodiments provided in this application can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of this application is not limited in this respect.

[0068] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily imply the same embodiment, nor does it imply independence from or alternative to other embodiments. The various embodiments in this specification are described in a related manner, with reference to each other for similar or identical parts. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.

[0069] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A method for generating a training set of working face images, characterized in that, include: Based on source domain labeled images of the tunnel face, deep visual features are extracted and hierarchically clustered according to a multi-level geological classification system to generate semantic prototypes of various types of surrounding rocks, and a geological semantic prototype library is constructed. The source domain face image and the target domain unlabeled face image are input into the feature extractor to obtain feature representations. The geological semantic prototype library is used to narrow the distance between the image features of the same type of surrounding rock in the two domains and the semantic prototypes corresponding to the surrounding rock category through a contrastive learning mechanism, so as to obtain aligned feature representations. Based on the aligned feature representation, the unlabeled face images in the target domain are predicted to obtain the class probability distribution of the unlabeled face images in the target domain. Based on the category probability distribution of the target domain face image, the prediction uncertainty of the target domain face image is determined, candidate face images with information content not lower than a preset threshold are selected, and the candidate face images are added to the training set.

2. The method according to claim 1, characterized in that, The multi-level geological classification system includes three levels: lithology category, structural features, and hydrological status. The construction process of the geological semantic prototype library includes: performing hierarchical clustering on the feature vectors of the face images labeled in the source domain according to the three-level geological labels; firstly, clustering according to the lithology category to obtain the first-level prototype; then, clustering according to the structural features within each lithology cluster to obtain the second-level prototype; and finally, clustering according to the hydrological status within each structural sub-cluster to obtain the third-level prototype, forming a tree-like prototype structure.

3. The method according to claim 1, characterized in that, The contrastive learning mechanism employs a prototype contrastive loss function, the expression of which is: in, Indicates the first The feature vector output by the feature extractor of the image This represents the semantic prototype of the geological category corresponding to the image. The first in the geological semantic prototype library A prototype, The total number of prototypes, The cosine similarity function is used. For temperature coefficient, This represents the total number of images used in a single training batch.

4. The method according to claim 1, characterized in that, Based on the category probability distribution of the target domain face image, the prediction uncertainty of the target domain face image is determined, including: Multiple forward inference operations are performed on the target domain face image to obtain multiple category probability distributions, and the variance of the predicted probability of each category is calculated. The average variance of all categories is taken as the uncertainty score of the target domain face image.

5. The method according to claim 1, characterized in that, Candidate working face images with information content not lower than a preset threshold are selected, including: sorting all target domain working face images from highest to lowest uncertainty score, and selecting the top... The image is used as a candidate face image, where, This is a preset ratio.

6. The method according to claim 1, characterized in that, Before adding the candidate face images to the training set, the method further includes: obtaining the geological semantic labels of the candidate face images, and adding the labeled candidate face images to the training set.

7. The method according to any one of claims 1 to 6, characterized in that, Also includes: Based on real tunnel face images and their corresponding geological semantic labels, a generative model constrained by geological semantics is trained to generate synthetic tunnel face images, and the synthetic tunnel face images are added to the training set.

8. The method according to claim 7, characterized in that, The generative model constrained by geological semantics is a conditional diffusion model. Differentiable geological rule constraints are embedded during the denoising process of this conditional diffusion model, including: A priori mask for crack orientation is generated based on the direction of the regional tectonic stress field, and the gradient is weighted by spatial attention mechanism during the denoising process to guide the generated crack edges to be distributed along the direction of the stress field. Based on the lithology category in the input geological semantic label, it is determined whether the rock mass is permeable. If it is determined to be an impermeable rock, the pixel value of the seepage area in the synthesized face image is forcibly set to zero during the noise reduction output stage. Based on the preset range corresponding to the rock mass quality index RQD value in the input geological semantic label, the density parameter of fracture generation during the denoising process is dynamically adjusted to control the number and connectivity of fractures in the synthesized face image.

9. A system for generating a training set of working face images, characterized in that, include: The first processing module is used to extract deep visual features from the face image based on the source domain annotation, and perform hierarchical clustering according to the multi-level geological classification system to generate semantic prototypes of various types of surrounding rocks and build a geological semantic prototype library. The second processing module is used to input the source domain face image and the unlabeled target domain face image into the feature extractor to obtain feature representations. Then, using the geological semantic prototype library, the module uses a contrastive learning mechanism to narrow the distance between the image features of the same type of surrounding rock in the two domains and the semantic prototypes corresponding to the rock category, thus obtaining aligned feature representations. The third processing module is used to predict the unlabeled face image of the target domain based on the aligned feature representation, and obtain the class probability distribution of the unlabeled face image of the target domain. The fourth processing module is used to determine the prediction uncertainty of the target domain face image based on the category probability distribution of the target domain face image, filter out candidate face images with information content not lower than a preset threshold, and add the candidate face images to the training set.

10. An electronic device, comprising: A processor and a memory storing a program, characterized in that the program includes instructions that, when executed by the processor, cause the processor to perform the method of any one of claims 1 to 8.