A dual-granularity unsupervised domain migration and adaptive method for cross-well spill and leakage monitoring
Patent Information
- Application Number
- CN202611145736.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-30
AI Technical Summary
[0006]本发明提供一种面向跨井溢漏监测的双粒度无监督域迁移与自适应方法,用于解决深度学习溢漏监测模型在目标井无标签、源域与目标域分布不一致、以及域内不同工况类别局部分布差异明显时迁移性能下降的问题
提出面向跨井/跨工区溢漏监测的双粒度无监督域适应框架,在目标域无人工标签条件下同时处理域间整体分布偏移和域内类别级局部分布偏移。
Smart Images

Figure CN123012703A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent monitoring technology for well engineering, specifically to a method for migrating and adapting a monitoring model for overflow and leakage risks such as cross-well and cross-work area overflows and well leakage, when there is a lack of manually labeled data for the target well or target work area. Background Technology
[0002] As oil and gas exploration and development advances into deeper, ultra-deeper formations and areas with complex geological structures, the probability and difficulty of handling risks such as lost circulation and overflows during drilling have increased significantly. Loss of circulation typically manifests as an imbalance between wellbore and formation pressure, leading to the loss of drilling fluid into the formation, while overflow typically manifests as formation fluid intrusion into the wellbore. If these risks are not identified and addressed in a timely manner, they may result in well control risks, reservoir contamination, increased non-productive time, and higher drilling costs.
[0003] Existing drilling risk monitoring methods mainly include rule-based reasoning methods and artificial intelligence-based methods. Rule-based reasoning methods rely on expert experience, fixed thresholds, or fuzzy rules, and have low deployment costs, but they struggle to cover the diverse data distribution caused by different equipment configurations, geological formations, and operating procedures under complex conditions. Artificial intelligence-based methods can use multi-source real-time engineering parameters such as riser pressure, casing pressure, inlet flow rate, outlet flow rate, mud tank volume, drilling pressure, and hook load to train models for identifying overflows, leaks, and normal operating conditions.
[0004] However, existing AI models typically face two types of problems when applied across wells or work areas. First, differences in equipment configuration, geological conditions, drilling fluid properties, and operating procedures exist between different well locations, work areas, and formations, leading to a shift in the global data distribution between the source and target domains. Second, even within the same target well, local distribution differences may exist between different formations and operating condition categories, and simply aligning the overall distribution can easily cause category confusion. Third, target wells often lack reliable human labels in the initial stages of actual deployment, making it difficult to directly retrain the model using supervised training methods.
[0005] Existing unsupervised domain adaptation methods, such as the DAN method based on maximum mean difference, the CORAL method based on covariance alignment, and the BSP method based on feature spectrum structure constraints, can reduce the overall difference between the source and target domains to some extent. However, most methods mainly focus on global domain distribution alignment and do not fully utilize the class structure information of the target domain samples. When samples of different classes are locally offset within the target domain, global alignment may bring samples of different classes closer together, resulting in unclear feature boundaries between overflow, leakage, and normal operating conditions, thus affecting the accuracy and false alarm rate of cross-domain monitoring. Summary of the Invention
[0006] This invention provides a dual-granularity unsupervised domain transfer and adaptation method for cross-well overflow monitoring, which addresses the problem of decreased transfer performance of deep learning overflow monitoring models when the target well is unlabeled, the source and target domains are inconsistently distributed, and there are significant differences in the local distribution of different operating conditions within the domain.
[0007] This invention enables the model to learn feature representations that are both task-separable and domain-invariant without the need for manually labeled data from the target well, by fusing self-attention features of multi-source drilling engineering parameters, coarse-grained alignment of inter-domain adversarial factors, and fine-grained alignment of the maximum mean difference of similar parameters within the domain. This improves the model's ability to identify risk conditions such as overflow and leakage at new well locations or new work areas.
[0008] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A dual-granularity unsupervised domain migration and adaptation method for cross-well leakage monitoring includes: Obtain the labeled source domain multi-source drilling engineering parameter sequence and the unlabeled target domain multi-source drilling engineering parameter sequence; perform sliding window segmentation on the source domain and target domain multi-source drilling engineering parameter sequences respectively to obtain the source domain and target domain multi-source parameter windows; By using a shared self-attention deep feature extractor, the multi-source parameter windows of the source and target domains are mapped to deep features of the source domain and deep features of the target domain, respectively. A working condition classifier is used to perform supervised classification of deep features in the source domain, and a domain discriminator combined with a gradient inversion layer is used to perform adversarial inter-domain coarse-grained alignment of deep features in the source domain and deep features in the target domain. Based on the output probability of the classifier for the multi-source drilling engineering parameter sequence samples in the target domain, samples with confidence levels not lower than the threshold are selected and assigned pseudo-labels. Based on the source domain real labels and pseudo-labels, a subset of samples of the same type is constructed for each working condition category. The maximum mean difference loss in the regeneration kernel Hilbert space is calculated to achieve fine-grained alignment within the domain. The feature extractor, classifier, and domain discriminator are jointly optimized using a weighted sum of classification loss, adversarial loss, and maximum mean difference loss as the total loss until convergence. The trained feature extractor and classifier are deployed on the target well for real-time condition identification and leakage early warning.
[0009] In one embodiment, the multi-source drilling engineering parameters include one or more of the following: riser pressure, casing pressure, inlet flow rate, outlet flow rate, mud tank volume, drilling pressure, hook load, rotary table torque, mechanical drilling speed, pump flush, drill bit position, well depth, drilling fluid density, and drilling fluid viscosity.
[0010] In one embodiment, the step of mapping the multi-source parameter windows of the source and target domains to deep features of the source domain and deep features of the target domain respectively through a shared self-attention deep feature extractor specifically includes: After inputting a multi-source parameter window X, the hidden layer representation H is first obtained through linear mapping, convolutional mapping, or recurrent network mapping, and then the query matrix is constructed. Key matrix Value matrix And calculate the attention output according to the following formula. : ; in, , , For learnable parameters, The dimension of the key vector; Attention output is processed through pooling layers, fully connected layers, or normalization layers to obtain deep features. .
[0011] In one embodiment, the step of filtering samples with a confidence level not lower than a threshold and assigning pseudo-labels based on the output probability of the classifier for the multi-source drilling engineering parameter sequence samples in the target domain specifically includes: Using the current classifier to analyze multi-source drilling engineering parameter sequence samples in the target domain Output category probability Take confidence level ,when At that time, the multi-source drilling engineering parameter sequence samples of the target domain are used as high-confidence samples and assigned pseudo-labels. ;when At that time, the multi-source drilling engineering parameter sequence samples in the target domain do not participate in the calculation of the maximum mean difference loss but still participate in the inter-domain adversarial alignment; the pseudo-labels are dynamically updated in each training round or in several batches. Indicates the type of working condition index, Represents conditional probability. This is a label for the operating condition category.
[0012] In one embodiment, the step of constructing a subset of similar samples for each working condition category based on the source domain's true and false labels, and calculating the maximum mean difference loss in the regeneration kernel Hilbert space to achieve fine-grained alignment within the domain specifically includes: For each category c, construct a subset of similar samples from the source domain. High-confidence subset of similar samples in the target domain , Let i be the deep features of the source domain for the i-th multi-source drilling engineering parameter sequence sample. for Real working condition labels The deep features of the target domain for the i-th multi-source drilling engineering parameter sequence sample when and When neither is empty, calculate the maximum mean difference distance between the two subsets in the reproducing kernel Hilbert space. : ; for The samples in for The samples in Represents the regenerated nucleus Hilbert space Norms in Represents the feature mapping function; The average of the maximum mean difference loss for all non-empty categories yields the maximum mean difference loss for the same granularity within the domain. : ; This represents the set of categories for which both the high-confidence subset of similar samples in the target domain and the subset of similar samples in the source domain are non-empty.
[0013] In one embodiment, the maximum mean difference distance is estimated empirically using a kernel function, specifically calculated according to the following formula: ; , , Represents a subset of similar samples in the source domain. Any two deep feature samples, An index for similar samples in the source domain. Represents a high-confidence subset of similar samples in the target domain. Any two deep feature samples, An index for similar samples in the target domain. Let Hilbert be the positive definite kernel function corresponding to the regenerating kernel Hilbert space. The total number of samples in the same subset of samples from the source domain. This represents the total number of samples in the high-confidence subset of similar samples in the target domain.
[0014] In one embodiment, the step of jointly optimizing the feature extractor, classifier, and domain discriminator using a weighted sum of classification loss, adversarial loss, and maximum mean difference loss as the total loss until convergence specifically includes: The source domain condition classification task uses classification loss. : ; The total number of multi-source drilling engineering parameter sequence samples in the source domain. This represents the total number of operating condition categories. This is the true working condition label for the i-th multi-source drilling engineering parameter sequence sample. Operating condition category index, Let be the class probability output by the classifier for the i-th multi-source drilling engineering parameter sequence sample in the source domain; For indicator functions; Domain discrimination loss for: ; When using a gradient inversion layer, the inter-domain adversarial loss is denoted as... ; The total number of multi-source drilling engineering parameter sequence samples in the target domain. For domain discriminator; and The same formula is used, the difference is that The gradient direction differs for different network parameters: for domain discriminator parameters, the optimization direction is to minimize the domain discriminant loss; for feature extractor parameters, the gradient direction accepts the inter-domain adversarial loss. The update, specifically, involves the gradient reversal layer causing the gradient from the domain discriminator to backpropagate, which is equivalent to prompting the feature extractor to generate domain-indistinguishable features. ; Total loss for: ; and These are the weighting coefficients.
[0015] In one embodiment, the method for real-time operating condition identification and leakage early warning specifically includes: During the online deployment phase, only the trained feature extractor and operating condition classifier are used, without using the domain discriminator. The real-time engineering parameters of the target well are input into the feature extractor and classifier, and the probabilities of each operating condition category are output. When the overflow category probability or leakage category probability exceeds the preset warning threshold, overflow warning information is output.
[0016] In one embodiment, the operating condition categories include at least three categories: normal, overflow, and leakage; the target domain is a new well location, a new work area, a new layer of the same well location, or a new work area or different operating stages of the same well location; the operating condition identification output is a binary anomaly identification or a multi-class identification.
[0017] Compared with the prior art, the beneficial technical effects of the present invention are: A dual-granularity unsupervised domain adaptation framework for cross-well / cross-work area leakage monitoring is proposed, which simultaneously handles the overall distribution shift between domains and the category-level local distribution shift within the domain under the condition that there are no artificial labels in the target domain.
[0018] A self-attention depth feature extractor is introduced into the multi-source drilling engineering parameter sequence to automatically learn the contribution weights of different parameters and different time steps to the identification of overflow, leakage and other working conditions.
[0019] By using a gradient inversion layer and a domain discriminator, coarse-grained alignment between domains is achieved, making the features of the source domain and the target domain similar at the overall distribution level.
[0020] By using high-confidence pseudo-labels in the target domain to construct sample subsets of the same type in the source and target domains, and calculating the maximum mean difference of sample subsets of the same type, fine-grained alignment at the category level is achieved, reducing the risk of different working condition categories being incorrectly mixed.
[0021] By jointly optimizing the task classification loss, inter-domain adversarial loss, and intra-domain maximum mean difference loss, cross-domain leakage monitoring model migration is achieved without relying on target well labeled data.
[0022] Compared to methods that only perform supervised training in the source domain, this invention adds domain adaptation training involving unlabeled data from the target domain. Compared to unsupervised domain adaptation methods that only perform global maximum mean difference, covariance alignment, or feature spectrum constraints, this invention further utilizes high-confidence pseudo-labels from the target domain to partition similar sample subsets and performs fine-grained alignment of similar samples based on maximum mean difference. Therefore, the distinctive technical feature of this invention does not lie in using attention, adversarial training, or maximum mean difference alone, but rather in combining self-attention feature extraction, inter-domain adversarial coarse-grained alignment, and intra-domain similar maximum mean difference fine-grained alignment in multi-source drilling engineering parameter scenarios into a unified training process. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the dual-granularity domain adaptation feature alignment of the present invention; Figure 2 This is a structural diagram of the adversarial inter-domain granularity adaptive module of the present invention; Figure 3 This is a comparison chart of the ablation experiment results of the present invention; Figure 4 This is a flowchart of the method of the present invention. Detailed Implementation
[0024] A preferred embodiment of the present invention will now be described in detail with reference to the accompanying drawings.
[0025] like Figure 4As shown, a dual-granularity unsupervised domain migration and adaptation method for cross-well overflow monitoring in this invention includes the following steps: S1, obtain the labeled source domain multi-source drilling engineering parameter sequence and the unlabeled target domain multi-source drilling engineering parameter sequence; perform sliding window segmentation on the source domain and target domain multi-source drilling engineering parameter sequences respectively to obtain the source domain and target domain multi-source parameter windows; S2, through a shared self-attention deep feature extractor, maps the multi-source parameter windows of the source domain and the target domain to deep features of the source domain and the target domain, respectively. S3 utilizes a working condition classifier to perform supervised classification of deep features in the source domain, and employs a domain discriminator combined with a gradient inversion layer to perform adversarial inter-domain coarse-grained alignment of deep features in the source domain and deep features in the target domain. S4. Based on the output probability of the classifier for the multi-source drilling engineering parameter sequence samples in the target domain, samples with confidence levels not lower than the threshold are selected and assigned pseudo-labels. Based on the source domain real labels and pseudo-labels, a subset of samples of the same type is constructed for each working condition category. The maximum mean difference loss in the regeneration kernel Hilbert space is calculated to achieve fine-grained alignment within the domain. S5 uses the weighted sum of classification loss, adversarial loss, and maximum mean difference loss as the total loss to jointly optimize the feature extractor, classifier, and domain discriminator until convergence. S6 deploys the trained feature extractor and classifier on the target well for real-time condition identification and leakage early warning.
[0026] This invention uses real-time engineering parameters of multi-source drilling and their operating condition labels of labeled source wells / source work areas as source domain data, and real-time engineering parameters of multi-source drilling and unlabeled target wells / target work areas as target domain data. The engineering parameter sequences of the two domains are mapped into deep features through a shared deep feature extractor, and then jointly trained using an operating condition classifier, a domain discriminator, and an adaptive module for the maximum mean difference of similar types within the domain.
[0027] The inter-domain adversarial adaptive module is used to perform coarse-grained alignment at the overall distribution level of the source and target domains, making it difficult for the features output by the feature extractor to be distinguished as source or target domains by the domain discriminator. The intra-domain maximum mean difference adaptive module is used to perform fine-grained alignment at the category level between high-confidence pseudo-label samples in the target domain and similar samples in the source domain, so as to reduce the local distribution difference of the same working condition category in the two domains and maintain the separability between different working conditions.
[0028] 1. Data input and preprocessing.
[0029] Source domain data is denoted as , This refers to the sequence of multi-source drilling engineering parameters corresponding to the i-th sample in the source well or source work area. Label its operating conditions. The target domain data is denoted as... , This refers to the sequence of multi-source drilling engineering parameters corresponding to the j-th unlabeled sample in the target well or target work area. The set of working condition labels is denoted as... The categories can include normal, overflow, and leakage, and can be expanded to include stuck drill, kick, and leakage levels according to on-site monitoring needs. The types of engineering parameters can be added or removed based on the configuration of on-site sensors, and are not limited to the above parameters. The target domain can be a new well location, a new work area, a new formation at the same well location, or a different operational stage.
[0030] Each sample can consist of a sliding time window of length T and P engineering parameters, i.e. Engineering parameters may include, but are not limited to, riser pressure, casing pressure, inlet flow rate, outlet flow rate, mud tank volume, drilling pressure, and hook load; in other embodiments, parameters such as rotary table torque, mechanical drilling speed, pump flush, drill bit position, well depth, drilling fluid density, and drilling fluid viscosity may also be added.
[0031] Data preprocessing may include timestamp alignment, outlier removal, missing value imputation, resampling, unit unification, sliding window segmentation, and normalization. Normalization can use source domain statistics or joint statistics from the source and target domain training segments, but the actual target domain label information must not be used when deploying the target domain online.
[0032] 2. Model structure.
[0033] (1) Self-attention deep feature extractor: Feature extractor denoted as After inputting a multi-source parameter window X, the hidden layer representation H is first obtained through linear mapping, convolutional mapping, or recurrent network mapping. For the self-attention implementation, a query matrix Q=H can be constructed. Bond matrix K=H Value matrix V=H The attention output is calculated according to the following formula: ; in , , For learnable parameters, The key vector dimension is [value]. The self-attention mechanism can model the relationships between different time steps and different engineering parameters, assigning higher weights to parameters and time segments highly correlated with changes in operating conditions such as overflow and leakage. The attention output can be passed through pooling layers, fully connected layers, or normalization layers to obtain a deep feature vector z= [value]. (X).
[0034] In a preferred embodiment, Multi-head self-attention or Transformer encoder structures can be used; alternative implementations may also use CNN-attention, BiLSTM-attention, TCN-attention or other network structures that can output deep temporal features.
[0035] (2) Operating condition classifier: The working condition classifier is denoted as Its input is the deep feature z output by the feature extractor, and the output is the conditional probability p=softmax( for each working condition category). (z)). Source domain samples are trained with real labels under supervision, while target domain samples are not trained with real labels and are only used for fine-grained alignment of pseudo-labels when the confidence level meets the requirements.
[0036] (3) Domain discriminator and inter-domain coarse-grained alignment: Domain discriminator is denoted as The input is a deep feature z, and the output is the probability that the feature comes from the source domain or the target domain. The source domain label can be set to 1, and the target domain label can be set to 0. During training, the domain discriminator minimizes the domain classification loss according to the binary cross-entropy, so that it can distinguish the source domain from the target domain as much as possible; the feature extractor receives gradients in the opposite direction through the gradient inversion layer, so that it learns domain-invariant features that are difficult to distinguish the source domain.
[0037] The gradient inversion layer performs an identity mapping during forward propagation and multiplies the gradient from the domain discriminator by a negative coefficient during backpropagation to the feature extractor, thus achieving adversarial training within a unified backpropagation framework. This design avoids incorrectly treating target domain samples as labeled samples while keeping the overall feature distributions of the source and target domains close at a coarse-grained level. Besides the gradient inversion layer, inter-domain alignment can also be achieved using an alternating optimization approach, but the joint optimization relationship between the source domain classification task, domain-indistinguishable feature learning, and fine-grained alignment within the same domain should be maintained.
[0038] (4) Fine-grained alignment of the largest mean difference within the same domain: To avoid confusion of features across different operating conditions caused by only performing global domain alignment, this invention further includes an adaptive module for the maximum mean difference of similar samples within the domain. This module first uses the current classifier to perform the alignment on the target domain samples. Output category probability Take confidence level .when At that time, the target domain sample is treated as a high-confidence sample and assigned a pseudo-label. ;when At that time, the sample does not participate in the calculation of the maximum mean difference of the same type, but can still participate in the inter-domain adversarial alignment.
[0039] For each category c, construct a subset of similar samples from the source domain. High-confidence subset of similar samples in the target domain .like and If neither is empty, then the maximum mean difference distance between the two subsets is calculated in the regenerating kernel Hilbert space to make the feature mean of the same working condition category in the source domain and the target domain as close as possible.
[0040] .
[0041] In practical calculations, unbiased or biased empirical estimations in the form of kernel functions can be used. For example, for feature sets of the same source domain. and target domain feature set The maximum mean difference distance can be calculated by combining the kernel mean within two sets and the kernel mean across sets. This represents the feature mapping function, used to map the original deep features to a high-dimensional regenerating kernel Hilbert space. This transforms the nonlinear distribution alignment problem in the original space into the calculation of the mean distance in a high-dimensional space.
[0042] When using a biased estimate, it can be written as: .
[0043] in , belong , , belong , , The kernel function can be a Gaussian kernel. Alternatively, multi-kernel Gaussian kernels, Laplace kernels, or other positive definite kernel functions can be used.
[0044] The average of the maximum mean difference loss for all non-empty categories yields the maximum mean difference loss for the same granularity within the domain. : ; in, This represents the set of classes where both the target domain's high-confidence subset of similar samples and the source domain's non-empty subset of similar samples are not empty. The pseudo-labels can be dynamically updated in each training epoch or every few batches, with a confidence threshold. The value can be in the range of 0.5 to 0.95, and in the preferred embodiment it is [value missing]. .
[0045] 3. Loss function and joint optimization.
[0046] The source domain condition classification task employs multi-class cross-entropy loss: .
[0047] Domain discrimination loss can be written as: .
[0048] When using a gradient inversion layer, the inter-domain adversarial term can be denoted as... . and The same binary cross-entropy numerical form can be used, the difference being that the gradient direction differs for different network parameters: for the domain discriminator parameters, the optimization direction is to minimize the domain classification loss; for the feature extractor parameters, the gradient reversal layer causes the gradient from the domain discriminator to propagate backward, which is equivalent to causing the feature extractor to generate domain-indistinguishable features.
[0049] The total loss function of this invention is uniformly expressed as: .
[0050] in and , representing weighting coefficients used to balance source domain supervised classification, coarse-grained adversarial alignment between domains, and fine-grained maximum mean difference alignment within the same domain. In the embodiments... , In other embodiments, and It can be adjusted based on the degree of difference between the source and target domains, the sample size of the target domain, and training stability.
[0051] 4. Training process.
[0052] Data preparation: Collect source domain multi-source drilling engineering parameters and their operating condition labels that have been labeled, and collect target domain unlabeled multi-source drilling engineering parameters.
[0053] Data preprocessing: Time alignment, outlier handling, missing value handling, sliding window segmentation, and normalization are performed on the two domain data to obtain the source domain samples. and target domain samples .
[0054] Feature extraction: A self-attention deep feature extractor that shares input samples from both the source and target domains. to obtain deep features and .
[0055] Source domain supervised classification: Inputting deep features from the source domain into the classifier Calculate the cross-entropy loss for multi-class classification. .
[0056] Inter-domain coarse-grained alignment: Inputting deep features from the source and target domains into the domain discriminator The domain discrimination loss is calculated, and an inter-domain adversarial term is generated for the feature extractor through a gradient reversal layer. .
[0057] Target domain pseudo-label screening: Utilize the classifier's output of the target domain sample class probability to screen samples with a confidence level not lower than [value missing]. The samples are assigned pseudo-labels, and low-confidence samples are not included in the calculation of the maximum mean difference within the same class.
[0058] Intra-domain fine-grained alignment: Construct a subset of similar samples based on the true labels of the source domain and the high-confidence pseudo labels of the target domain, and calculate... .
[0059] Joint optimization: with Update the feature extractor, classifier, and domain discriminator for the target until the loss converges or the validation metric stabilizes.
[0060] Model Deployment: After training, the parameters of the feature extractor and classifier are fixed. During the online inference phase, the domain discriminator and maximum mean difference calculation module can be omitted. Only the real-time multi-source engineering parameters of the target well are input into the feature extractor and classifier, and the output predicts and warns of operating conditions such as normal, overflow, and leakage. The model output can be a binary anomaly identification or a multi-class identification such as normal, overflow, and leakage; the multi-class scenario is more conducive to distinguishing different risk types and on-site handling strategies.
[0061] 5. Online monitoring process.
[0062] During the online deployment phase of the target well, the system continuously receives drilling engineering parameters from multiple sources according to a fixed time window, and forms input samples through a preprocessing procedure consistent with the training phase. After training, the feature extractor extracts real-time deep features, and the classifier outputs the probability of each working condition category. When the probability of overflow or leakage exceeds the preset warning threshold, or when multiple consecutive windows determine it as an abnormal working condition, the system outputs overflow, leakage, or other risk condition warning information to the on-site engineers.
[0063] This invention can improve cross-domain monitoring capabilities: by coarse-grained alignment between domains and fine-grained alignment of the same type within a domain, the impact of data distribution offset between different well locations, different work areas and different layers on model performance is reduced.
[0064] This invention can reduce the cost of target well labeling: during the target domain training phase, no real labels are required; adaptation is performed using only unlabeled real-time engineering parameters and high-confidence pseudo-labels.
[0065] This invention enhances the separability of operating condition categories: compared to methods that only perform global distribution alignment, fine-grained alignment of the maximum mean difference within the same category helps maintain the feature boundaries between categories such as normal, overflow, and leakage.
[0066] This invention can improve engineering practicality: the method can quickly migrate existing models to new well locations or new work areas, providing auxiliary basis for on-site well control risk early warning and drilling parameter control.
[0067] In a cross-domain experiment at five well sites in an oilfield, the method of this invention achieved an average recall rate of 86.04% and an average false alarm rate of 9.73%, which is better than baseline methods such as SO, S+T, DAN, CORAL, and BSP.
[0068] Figure 1 It displays the original feature distribution, the feature distribution after inter-domain granularity alignment, and the feature distribution after intra-domain granularity alignment.
[0069] Figure 2 It demonstrates the relationship between the feature extractor, the condition classifier, the domain discriminator, the gradient inversion layer, and the backpropagation of the loss.
[0070] Example: Experimental data were collected from five wells in an oilfield in eastern China, denoted as A, B, C, D, and E. Multi-source drilling engineering parameters included seven categories of characteristic parameters: standpipe pressure, casing pressure, inlet flow rate, outlet flow rate, mud tank volume, drilling pressure, and hook load. One well was designated as the source domain, and the other as the target domain, to construct a cross-well migration task, verifying the migration effect of the method of this invention in a target well unlabeled scenario.
[0071] In the cross-well migration experiment, the labels of the target domain well locations are only used for recall and false alarm rate statistics after the experiment ends, and do not participate in model training, pseudo-label screening or parameter updates, so as to maintain the unsupervised setting of the target domain.
[0072] The evaluation metrics used are recall and false alarm rate (FA). Recall measures the proportion of samples that actually experienced spillover that were correctly identified, while FA measures the proportion of samples that actually did not experience spillover that were mistakenly identified as spillover.
[0073] ; ; Wherein, TP is the number of samples that actually leaked and were correctly identified, FN is the number of samples that actually leaked but were misclassified as not leaking, FP is the number of samples that actually did not leak but were misclassified as leaking, and TN is the number of samples that actually did not leak and were correctly identified.
[0074] In this embodiment, the false label confidence threshold Inter-domain adversarial loss weight Loss weights for the largest mean difference among similar types within the domain The method of this invention is compared with five benchmark methods: SO, S+T, DAN, CORAL, and BSP. SO represents training using only source domain samples; S+T represents training using both source domain samples and high-confidence pseudo-labeled samples from the target domain; DAN, CORAL, and BSP represent common unsupervised domain adaptation baseline methods.
[0075] The comparative experimental results are shown in Tables 1 and 2. The experimental results demonstrate that the method proposed in this invention has significant advantages over the aforementioned baseline methods. The method using domain adaptation achieves a significant performance improvement compared to other methods, with better recall and false alarm rates than the baseline methods. This, to some extent, proves the existence of domain differences and that the domain adaptation method can effectively bridge these differences. Compared to other unsupervised domain adaptation baseline methods, the method of this invention still shows a significant improvement.
[0076] To further verify the effectiveness of each module, ablation experiments were conducted on each module according to the settings in Table 3. The results are as follows: Figure 3 As shown. Figure 3 This paper demonstrates the performance differences between models without an adaptive module (V0), with only an inter-domain adversarial adaptive module (V1), and with both an inter-domain adversarial module and an intra-domain maximum mean difference adaptive module (V2). Experimental results show that the adversarial inter-domain granular adaptive module and the intra-domain maximum mean difference adaptive module play a crucial role in improving model performance. After introducing the inter-domain adversarial adaptive module (V1), the model performance improved by an average of 21.53%, demonstrating the existence of domain differences and the effectiveness of the domain adaptation method. After adding the intra-domain maximum mean difference adaptive module (V2), the model performance further improved by an average of 13.83%, indicating that fine-grained alignment can further bridge intra-domain distribution differences and improve model generalization performance.
[0077] Table 1. Comparison of recall rates for cross-domain spillover detection using different methods (%)
[0078] Table 2 Comparison of false alarm rates for cross-domain spillover monitoring by different methods (%)
[0079] Table 3 Ablation Experiment Module Combination Settings
[0080] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0081] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple steps or stages, which are not necessarily completed at the same time, but may be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but may be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0082] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0083] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention, and no reference numerals in the claims should be construed as limiting the scope of the claims.
[0084] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A dual-granularity unsupervised domain migration and adaptation method for cross-well leakage monitoring, characterized in that, include: Obtain the labeled source domain multi-source drilling engineering parameter sequence and the unlabeled target domain multi-source drilling engineering parameter sequence; perform sliding window segmentation on the source domain and target domain multi-source drilling engineering parameter sequences respectively to obtain the source domain and target domain multi-source parameter windows; By using a shared self-attention deep feature extractor, the multi-source parameter windows of the source and target domains are mapped to deep features of the source domain and deep features of the target domain, respectively. A working condition classifier is used to perform supervised classification of deep features in the source domain, and a domain discriminator combined with a gradient inversion layer is used to perform adversarial inter-domain coarse-grained alignment of deep features in the source domain and deep features in the target domain. Based on the output probability of the classifier for the multi-source drilling engineering parameter sequence samples in the target domain, samples with confidence levels not lower than the threshold are selected and assigned pseudo-labels. Based on the source domain real labels and pseudo-labels, a subset of samples of the same type is constructed for each working condition category. The maximum mean difference loss in the regeneration kernel Hilbert space is calculated to achieve fine-grained alignment within the domain. The feature extractor, classifier, and domain discriminator are jointly optimized using a weighted sum of classification loss, adversarial loss, and maximum mean difference loss as the total loss until convergence. The trained feature extractor and classifier are deployed on the target well for real-time condition identification and leakage early warning.
2. The dual-granularity unsupervised domain migration and adaptation method for cross-well leakage monitoring according to claim 1, characterized in that, The multi-source drilling engineering parameters include one or more of the following: riser pressure, casing pressure, inlet flow rate, outlet flow rate, mud tank volume, drilling pressure, hook load, rotary table torque, mechanical drilling speed, pump flush, drill bit position, well depth, drilling fluid density, and drilling fluid viscosity.
3. The dual-granularity unsupervised domain migration and adaptation method for cross-well overflow monitoring according to claim 1, characterized in that, The method of mapping multi-source parameter windows of the source and target domains to deep features of the source and target domains respectively through a shared self-attention deep feature extractor specifically includes: After inputting a multi-source parameter window X, the hidden layer representation H is first obtained through linear mapping, convolutional mapping, or recurrent network mapping, and then the query matrix is constructed. Key matrix Value matrix And calculate the attention output according to the following formula. : ; in, , , For learnable parameters, The dimension of the key vector; Attention output is processed through pooling layers, fully connected layers, or normalization layers to obtain deep features. .
4. The dual-granularity unsupervised domain migration and adaptation method for cross-well leakage monitoring according to claim 1, characterized in that, The step of selecting samples with a confidence level not lower than a threshold and assigning pseudo-labels based on the output probability of the classifier for the multi-source drilling engineering parameter sequence samples in the target domain specifically includes: Using the current classifier to analyze multi-source drilling engineering parameter sequence samples in the target domain Output category probability Take confidence level ,when At that time, the multi-source drilling engineering parameter sequence samples of the target domain are used as high-confidence samples and assigned pseudo-labels. ;when At that time, the multi-source drilling engineering parameter sequence samples in the target domain do not participate in the calculation of the maximum mean difference loss but still participate in the inter-domain adversarial alignment; the pseudo-labels are dynamically updated in each training round or in several batches. Indicates the type of working condition index, Represents conditional probability. This is a label for the operating condition category.
5. A dual-granularity unsupervised domain migration and adaptation method for cross-well leakage monitoring according to claim 4, characterized in that, The process involves constructing a subset of similar samples for each work condition category based on the source domain's true and pseudo labels, calculating the maximum mean difference loss in the regeneration kernel Hilbert space, and achieving fine-grained alignment within the domain. Specifically, this includes: For each category c, construct a subset of similar samples from the source domain. High-confidence subset of similar samples in the target domain , Let i be the deep features of the source domain for the i-th multi-source drilling engineering parameter sequence sample. for Real working condition labels The deep features of the target domain for the i-th multi-source drilling engineering parameter sequence sample when and When neither is empty, calculate the maximum mean difference distance between the two subsets in the reproducing kernel Hilbert space. : ; for The samples in for The samples in Represents the regenerated nucleus Hilbert space Norms in Represents the feature mapping function; The average of the maximum mean difference loss for all non-empty categories yields the maximum mean difference loss for the same granularity within the domain. : ; This represents the set of categories for which both the high-confidence subset of similar samples in the target domain and the subset of similar samples in the source domain are non-empty.
6. The dual-granularity unsupervised domain migration and adaptation method for cross-well leakage monitoring according to claim 5, characterized in that, The maximum mean difference distance is estimated empirically using a kernel function, specifically calculated according to the following formula: ; , , Represents a subset of similar samples in the source domain. Any two deep feature samples, An index for similar samples in the source domain. Represents a high-confidence subset of similar samples in the target domain. Any two deep feature samples, An index for similar samples in the target domain. Let Hilbert be the positive definite kernel function corresponding to the regenerating kernel Hilbert space. The total number of samples in the same subset of samples from the source domain. This represents the total number of samples in the high-confidence subset of similar samples in the target domain.
7. A dual-granularity unsupervised domain migration and adaptation method for cross-well leakage monitoring according to claim 1, characterized in that, The method of using a weighted sum of classification loss, adversarial loss, and maximum mean difference loss as the total loss to jointly optimize the feature extractor, classifier, and domain discriminator until convergence specifically includes: The source domain condition classification task uses classification loss. : ; The total number of multi-source drilling engineering parameter sequence samples in the source domain. This represents the total number of operating condition categories. This is the true working condition label for the i-th multi-source drilling engineering parameter sequence sample. Operating condition category index, Let be the class probability output by the classifier for the i-th multi-source drilling engineering parameter sequence sample in the source domain; For indicator functions; Domain discrimination loss for: ; When using a gradient inversion layer, the inter-domain adversarial loss is denoted as... ; The total number of multi-source drilling engineering parameter sequence samples in the target domain. For domain discriminator; and The same formula is used, the difference is that The gradient direction differs for different network parameters: for domain discriminator parameters, the optimization direction is to minimize the domain discriminant loss; for feature extractor parameters, the gradient direction accepts the inter-domain adversarial loss. The update, specifically, involves the gradient reversal layer causing the gradient from the domain discriminator to backpropagate, which is equivalent to prompting the feature extractor to generate domain-indistinguishable features. ; Total loss for: ; and These are the weighting coefficients.
8. A dual-granularity unsupervised domain migration and adaptation method for cross-well leakage monitoring according to claim 1, characterized in that, The method for real-time operating condition identification and leakage early warning specifically includes: During the online deployment phase, only the trained feature extractor and operating condition classifier are used, without using the domain discriminator. The real-time engineering parameters of the target well are input into the feature extractor and classifier, and the probabilities of each operating condition category are output. When the overflow category probability or leakage category probability exceeds the preset warning threshold, overflow warning information is output.
9. A dual-granularity unsupervised domain migration and adaptation method for cross-well leakage monitoring according to claim 1, characterized in that, The operating condition categories include at least three types: normal, overflow, and leakage; the target domain is a new well location, a new work area, a new layer of the same well location, or a new work area or different operating stages of the same well location; the operating condition identification output is a binary anomaly identification or a multi-class identification.
