Oil well working condition diagnosis neural network model parameter optimization method
By using SqueezeNet and LSTM hybrid networks in the oil well condition diagnosis neural network and using the pattern search algorithm to optimize parameters, the problem of insufficient diagnostic accuracy of oil well condition in the existing technology is solved, and a higher diagnostic accuracy and more efficient tuning process is achieved.
Patent Information
- Application Number
- CN202311538022.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2025-05-20
AI Technical Summary
The accuracy of the existing neural network model for oil well condition diagnosis is insufficient, and it is impossible to effectively complete the accurate diagnosis of oil well condition type.
A deep neural network mixed with SqueezeNet and LSTM is used as the core of the oil well condition diagnosis neural network, and the model parameters are optimized through a pattern search algorithm (such as the GPS algorithm), including optimizer, learning rate, batch size and convolution kernel size.
The accuracy of the neural network model for oil well condition diagnosis is improved, so that it can more accurately diagnose oil well condition types in actual scenarios, reducing dependence on engineers and saving tuning time.
Smart Images

Figure CN120020766A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of oil exploration and oil well condition diagnosis, and particularly to a method for optimizing the parameters of an oil well condition diagnosis neural network model. Background Art
[0002] In the process of oil production, oil well condition diagnosis is a crucial link, but it has been facing huge challenges for a long time. There are numerous devices in the oil well production system, with a complex structure, and it operates under high temperature and high pressure for a long time, making it difficult to visually judge the working conditions. At the same time, the oil well production system may be affected by factors such as downhole corrosion, sand, wax, gas, and water, resulting in various different working condition types. The response relationship between the monitoring indicators and the working conditions is also complex and unclear. Although many new methods have been proposed by domestic and foreign scholars, most studies can only diagnose some common and single types of working conditions. This means that the actual application effect is not ideal enough, and we still rely on manual analysis to solve problems.
[0003] In the field of oil well condition diagnosis, the emergence of various new image processing algorithms and the evolution of neural networks have provided a more convenient solution for oil well condition diagnosis - the oil well condition diagnosis neural network, enabling the transformation of oil well condition diagnosis from manual analysis to automated classification. However, due to various influences such as insufficient or unbalanced data sets and improper parameter settings, the accuracy of the established oil well condition diagnosis neural network still cannot meet the needs of researchers and cannot effectively complete the accurate diagnosis of oil well condition types.
[0004] Nowadays, with the increasingly in-depth integration of the deep learning technology field and the petroleum engineering field, many researchers in the petroleum field at home and abroad have applied it to problems such as logging evaluation and recommended working systems, and have achieved many achievements. However, the initially established oil well condition diagnosis neural network usually requires a large amount of debugging and optimization to reach a high accuracy before it can be used for diagnosing oil well condition types in a real environment.
[0005] In the Chinese patent application with the application number: CN202110540881.6, it involves an intelligent diagnosis method for oil well working conditions combining numbers and shapes, including: Step 1, establishing a sample library of oil well working conditions with large-scale dynamometer cards + multi-dimensional time series data; Step 2, aiming at the characteristics of oil well working condition diagnosis problems, proposing and establishing a neural network for oil well working condition diagnosis based on CNN + DBN, completing the learning of the working condition sample library, and further improving the algorithm performance through repeated optimization; Step 3, establishing an intelligent monitoring system for oil well working conditions, realizing the real-time connection - analysis - push between the intelligent monitoring neural network and the oil well production database, and designing an intelligent monitoring client front-end web system for oil well working conditions. This intelligent diagnosis method for oil well working conditions combining numbers and shapes determines the intelligent diagnosis scheme of "dynamometer card image + other time series data + CNN + DBN" by organically integrating the intuitiveness, timeliness, and effectiveness of graphics through problem analysis and technical research, improving the coincidence rate of intelligent diagnosis of oil well production dynamics.
[0006] In the Chinese patent application with the application number: CN201811226477.6, it involves an intelligent diagnosis method for electric submersible pump well working conditions based on convolutional neural network, which has the following steps: a. Based on the convolutional neural network, building an intelligent diagnosis system for electric submersible pump well working conditions; b. Inputting the current cards collected at the production site of the electric submersible pump well into the intelligent diagnosis system for working conditions, and applying the established convolutional neural network to diagnose the working conditions; c. Reinforcement learning and update of the convolutional neural network for electric submersible pump well working condition diagnosis, and updating the convolutional neural network diagnosis method according to the diagnosis results. This invention constructs an intelligent diagnosis method for electric submersible pump well working conditions based on convolutional neural network in the current field of image intelligent recognition to solve the problems that the traditional current card analysis method is affected by subjective factors, prone to misjudgment, a large amount of effective information is lost in extracting fault features, and the judgment error is increased, so as to avoid the influence of a large amount of effective information lost in the feature extraction process and human subjective judgment on the diagnosis results.
[0007] In the Chinese patent application with the application number: CN201910964089.6, it involves an intelligent diagnostic analysis method and device for oil well working conditions based on the SVM model, belonging to the technical field of oilfield production technology. The intelligent diagnostic analysis method for oil well working conditions based on the SVM model provided by this invention includes: Step 1: Obtain multiple groups of normal dynamometer cards of oil wells, extract the HOG features of these multiple groups of normal dynamometer cards, and aggregate the HOG features of the normal dynamometer cards into a normal HOG feature set. Under the circumstances where different oil reservoirs, different wellbore structures, and physical property differences lead to complex and variable oil well working conditions, this invention provides a set of general and highly accurate dynamometer card recognition methods, overcoming the problem that the matrix features of the matrix feature recognition method do not adequately describe the subtle changes of the dynamometer card, and can accurately identify slight sand production, upper bump, and lower hang. It also overcomes the problem that the differential curve method removes useful features for diagnosis during the actual application process. This invention has more diagnostic types and can be quantitatively evaluated. Compared with the PSO-RBF neural network algorithm, this invention is also more accurate in identifying under complex working conditions.
[0008] In the Chinese patent application with the application number: CN202110839864.2, it involves an oil well working condition identification and diagnosis system, including a comprehensive diagnosis system and a data acquisition terminal. The data acquisition terminal collects working condition information and transmits it to the comprehensive diagnosis system, and the comprehensive diagnosis system visually displays it to the user after processing; the data acquisition terminal includes a surface dynamometer card and a surface data acquisition module. This invention establishes mechanical and mathematical models for the rod pumping system of directional wells. This model can calculate the pump dynamometer card response of a given system under different surface dynamometer card excitations, analyze this pump dynamometer card to determine the effective stroke of the pump, and then calculate the surface converted effective displacement. Using technologies such as big data and deep learning, it establishes the calculation of key variables during the artificial lift process of pumping wells with high precision and high computing speed, including the prediction of daily liquid production and the identification of 10 typical working conditions, reducing the large amount of manpower, material resources, and financial resources consumed by traditional manual judgment and measurement, thereby improving the oilfield exploitation efficiency and saving labor costs.
[0009] The above existing technologies are all quite different from this invention and fail to solve the technical problems we want to solve. Therefore, we have invented a new method for optimizing the parameters of the oil well working condition diagnosis neural network model. Summary of the Invention
[0010] The purpose of this invention is to provide a method for optimizing the parameters of the oil well working condition diagnosis neural network model, which is a method for optimizing the parameters of the oil well working condition diagnosis neural network model that improves the accuracy of the oil well working condition diagnosis neural network.
[0011] The purpose of this invention can be achieved through the following technical measures: A method for optimizing the parameters of the oil well working condition diagnosis neural network model, and this method for optimizing the parameters of the oil well working condition diagnosis neural network model includes:
[0012] Step 1: Select the parameters to be optimized according to the kernel of the oil well condition network neural network and the oil well condition diagnosis problem;
[0013] Step 2: Combine the preselected parameters to be optimized and limit the parameters within a determined range;
[0014] Step 3: Select the most optimal parameter optimization algorithm based on the oil well condition diagnosis neural network;
[0015] Step 4: Use the pattern search algorithm to complete the parameter optimization of the oil well condition diagnosis neural network;
[0016] Step 5: Compare the performance of the oil well condition diagnosis neural network model before and after optimization;
[0017] Step 6: Package a parameter optimization method for the oil well condition diagnosis neural network model that meets the requirements.
[0018] The object of the present invention can also be achieved by the following technical measures:
[0019] In Step 1, the kernel of the oil well condition diagnosis neural network to be optimized is a deep neural network that combines SqueezeNet and LSTM; its main goal is to output specific diagnosis conditions according to the input oil well condition data.
[0020] In Step 1, the oil well condition data includes ground equipment failures, formation composite problems, and pump composites, and the output specific diagnosis conditions include specific conditions such as overweight balance weights, insufficient liquid supply, and underweight balance weights, fixed valve blockage, and insufficient liquid supply.
[0021] In Step 1, when selecting the parameters to be optimized for the oil well condition diagnosis neural network, according to the petroleum engineering seepage mechanics theory and the known condition types, select the parameters to be optimized for the learning rate, optimizer, batch size, convolution kernel size, etc.
[0022] In Step 2, combine the parameters to be optimized selected in Step 1 into different parameter combinations, and limit them within specific optimization ranges according to the definitions, functions, and value ranges of each type of parameter.
[0023] In Step 2, there are different optimization ranges for different parameters. For the optimizer, an algorithm used to update the weights of each layer after each iteration, several optimizers suitable for oil well condition classification are selected in advance, including Stochastic Gradient Descent (SGD), Adaptive Moment Estimation Optimizer (Adam), and Root Mean Square Propagation (RMSprop); for the learning rate, which determines the step size of each iteration of the optimization method, set its size to fluctuate between 0 and 1. If it is too large, it is easy to oscillate, and if it is too small, the convergence speed will be too slow.
[0024] In step 3, the pattern search algorithm is selected as the optimization algorithm. This algorithm is a direct search algorithm that mainly extracts the objective function on a set of directions, and finds the descending direction by comparing the function values to solve the problem. The commonly used Generalized Pattern Search (GPS) algorithm is adopted to solve the non - linear constraint optimization problem involved in the parameter optimization of the oil well condition diagnosis neural network. During the parameter optimization process of the oil well condition diagnosis neural network, the input of each iteration is the parameter combination of the model, and the output is the parameter combination of the new model after one iteration.
[0025] In step 4, a mathematical model for the parameter optimization of the oil well diagnosis neural network is established, and the GPS pattern search algorithm is introduced for automatic iterative optimization to obtain the parameter combination with the best performance.
[0026] In step 5, the performance of the oil well condition diagnosis neural network is evaluated by multiple metrics, including training loss, validation loss, training accuracy, validation accuracy, ROC curve, and confusion matrix. Special attention is paid to the performance of the oil well condition diagnosis neural network on the test set and the diagnosis performance of the optimized model for abnormal conditions, and the model performance before and after parameter optimization is compared.
[0027] In step 6, after optimizing the parameters of the oil well condition diagnosis neural network model, when the model meets the actual field requirements, it is packaged into a complete parameter optimization method for the oil well condition diagnosis neural network model and applied to actual production.
[0028] The object of the present invention can also be achieved by the following technical measures: an oil well condition diagnosis neural network model parameter optimization method system, which uses the oil well condition diagnosis neural network model parameter optimization method for oil well condition diagnosis.
[0029] The oil well condition diagnosis neural network model parameter optimization method in the present invention improves the accuracy of the oil well condition diagnosis neural network model, enabling it to be applied to real - world scenarios. Based on the parameter optimization algorithm, the debugged oil well condition diagnosis neural network model can, compared with the non - optimized oil well condition diagnosis neural network, complete the diagnosis of the oil well condition type with higher accuracy according to the input dynamometer card and output the oil well condition type. Compared with traditional oil well condition diagnosis neural network model parameter optimization methods, such as the trial - and - error method, manual parameter tuning, and grid search, the present invention can reduce the dependence on engineers, save a large amount of tuning time, and can perform intelligent optimization on more parameter combinations with the same computing power to obtain an oil well condition diagnosis neural network model that is closest to the optimal parameter combination. Brief Description of the Drawings
[0030] Figure 1Schematic diagram of the parameter optimization process of the GPS algorithm in a specific embodiment of the present invention;
[0031] Figure 2 Comparison chart of the accuracy of the oil well condition diagnosis neural network model before and after parameter optimization in a specific embodiment of the present invention;
[0032] Figure 3 Comparison chart of the performance of the oil well condition diagnosis neural network before and after optimization in a specific embodiment of the present invention;
[0033] Figure 4 Flow chart of a specific embodiment of the method for optimizing the parameters of the oil well condition diagnosis neural network model of the present invention. Specific implementation mode
[0034] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0035] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, and / or combinations thereof.
[0036] According to the single-factor study of the parameters of the oil well condition diagnosis neural network, it is found that different combinations of parameters will have a great impact on the accuracy of the oil well diagnosis neural network model. In order to further scientifically and efficiently optimize the parameters of the oil well condition diagnosis neural network model and improve its accuracy. The present invention organically combines the GPS mode search algorithm with the parameter optimization for the oil well condition diagnosis neural network model, and finally generates an intelligent automatic generation of feasible parameter combinations, evaluates the performance of the oil well condition diagnosis neural network model under each combination of parameters, and iteratively generates new parameter combinations according to the performance, and gradually approaches the optimal parameter combination of the oil well condition diagnosis neural network model parameter optimization method.
[0037] As Figure 4 shown, Figure 4 Flow chart of the method for optimizing the parameters of the oil well condition diagnosis neural network model of the present invention. The steps of the method for optimizing the parameters of the oil well condition diagnosis neural network model are as follows:
[0038] Step 101: Select the parameters to be optimized according to the kernel of the oil well condition network neural network and the oil well condition diagnosis problem
[0039] The kernel of the oil well condition diagnosis neural network to be optimized is a deep neural network that combines SqueezeNet and LSTM. Its main objective is to output specific diagnosis conditions based on the input oil well condition data, including but not limited to surface equipment failures, formation composite problems, pump composites, etc., such as overweight balance weights, insufficient liquid supply, light balance weights, fixed valve blockage, and insufficient liquid supply. To further improve the accuracy of the oil well condition diagnosis neural network and perform better in the face of problems such as similar conditions or gradually changing conditions, when selecting the parameters to be optimized for the oil well condition diagnosis neural network, according to the theory of seepage mechanics in petroleum engineering and the known condition types, we finally select to optimize parameters such as the learning rate, optimizer, batch size, and convolution kernel size.
[0040] Step 102: Combine the preselected parameters to be optimized and limit the parameters within a determined range
[0041] Combine the parameters to be optimized selected in Step 101 into different parameter combinations, and limit them within specific optimization ranges according to the definitions, functions, and value ranges of each type of parameter. There are different optimization ranges for different parameters. For example, the optimizer, which is an algorithm used to update the weights of each layer after each iteration, several optimizers suitable for oil well condition classification can be selected in advance, such as Stochastic Gradient Descent (SGD), Adaptive Moment Estimation Optimizer (Adam), Root Mean Square Propagation (RMSprop), etc.; the learning rate determines the step size of each iteration of the optimization method, and its value is set to fluctuate between 0 and 1. If it is too large, it is easy to oscillate, and if it is too small, the convergence speed will be too slow.
[0042] Finally, establish the parameter combination in the oil well condition diagnosis neural network to be optimized according to the selected parameters and the limited range. By optimizing the parameter group, researchers can more scientifically train an efficient oil well condition diagnosis neural network model.
[0043] Step 103: Select the optimal parameter optimization algorithm based on the oil well condition diagnosis neural network
[0044] The optimization of the parameters of the oil well condition diagnosis neural network belongs to a non-linear programming problem. The difficulty lies in that the constraint conditions may be more complex and difficult to simplify, and researchers need to explore deeper constraint relationships. In this invention, the pattern search algorithm is selected as the optimization algorithm. This algorithm is a direct search algorithm that mainly extracts the objective function on a set of directions, and finds the descent direction by comparing the function values to solve the problem. This algorithm does not require calculating or approximating any derivatives and is widely used in the fields of non-linear programming and non-smooth optimization. For example Figure 1As shown, the GPS (Generalized Pattern Search) algorithm is a commonly used generalized pattern search algorithm, which will be used to solve the non-linear constraint optimization problem involved in the parameter optimization of the oil well condition diagnosis neural network. During the parameter optimization of the oil well condition diagnosis neural network, the input of each iteration is the parameter combination of the model, and the output is the parameter combination of the new model after one iteration.
[0045] Step 104: Use the pattern search algorithm to complete the parameter optimization of the oil well condition diagnosis neural network
[0046] The choice of parameters has an obvious impact on the model performance. Therefore, parameter optimization is an important task. To obtain the best model performance, the best combination of parameter values must be found. However, parameter optimization can be a challenging task because it requires exploring a vast search space and usually involves a large number of evaluation calculations. At the same time, through single-factor studies, it is found that the setting of each parameter has a significant impact on the performance of the oil well condition diagnosis neural network model, but the regularity is not strong. There are extremely many possible combination methods for each parameter. Therefore, we have established a mathematical model for the parameter optimization of the oil well diagnosis neural network and introduced the GPS pattern search algorithm for automatic iterative optimization to obtain the parameter combination with the optimal performance.
[0047] Step 105: Compare the performance of the oil well condition diagnosis neural network model before and after optimization
[0048] The performance of the oil well condition diagnosis neural network is generally evaluated by multiple indicators. These include training loss, validation loss, training accuracy, validation accuracy, ROC curve, confusion matrix, etc. In the present invention, we will mainly focus on the performance of the oil well condition diagnosis neural network on the test set and the diagnosis performance of the optimized model for abnormal conditions, and compare the model performance before and after parameter optimization.
[0049] From Figure 2 it can be seen that the diagnostic accuracy for pipe problems, rod problems, pump problems, and surface equipment problems in abnormal conditions has been greatly improved.
[0050] From Figure 3 it can be obtained that the accuracy of the model before and after parameter optimization on the training set and the validation set has been improved, proving that the optimization method is effective.
[0051] Step 106: Package a method for optimizing the parameters of an oil well condition diagnosis neural network model that meets the requirements of the invention
[0052] After optimizing the parameters of the oil well condition diagnosis neural network model, when the model meets the actual on-site requirements, it will be packaged into a complete method for optimizing the parameters of the oil well condition diagnosis neural network model and applied to actual production. In this way, it can help oilfield engineers diagnose the oil well conditions more efficiently, improve the oilfield exploitation efficiency, and provide more reliable technical support for oilfield production. At the same time, the method will continue to be improved and optimized to adapt to the changing oilfield engineering requirements.
[0053] The following are several specific embodiments of applying the present invention
[0054] Embodiment 1
[0055] In a specific Embodiment 1 of applying the present invention, the method for optimizing the parameters of the oil well condition diagnosis neural network model includes the following steps:
[0056] Step 101: The core of the oil well condition diagnosis neural network model mentioned in the present invention is a deep neural network hybrid of SqueezeNet and LSTM. According to its network characteristics and the theory of petroleum engineering seepage mechanics, the following parameters are selected, including the optimizer, learning rate, batch size, convolution kernel size, etc. Among them, the optimizer refers to optimizing the objective function in the training process, and common optimizers include SGD, Adam, etc.; the learning rate refers to the learning rate used to update the model parameters in each iteration, and the learning rate is limited to 0 - 1; the batch size refers to the size of the training data used for each parameter update, which can be 128, 256, 512, 1024; the convolution kernel size represents the matrix size for moving data, which can be set to 1, 3, 5, 7;
[0057] Step 201: Combine the parameters selected in Step 101 into a parameter combination, such as [SGD, 0.001, 128, 2], where SGD represents the optimizer, 0.001 is the learning rate, 128 is the training batch size, and 2 is the convolution kernel size. This parameter group will be used as the initial parameter group. The present invention optimizes the above initial parameter group to improve the performance of the oil well condition diagnosis neural network model.
[0058] Step 301: Through specific and in-depth research, it is found that when dealing with the problem of optimizing the parameters of the oil well condition diagnosis neural network model, there are already many methods to assist researchers in parameter optimization, such as the trial-and-error method, grid search algorithm, pattern search algorithm, etc. By analyzing the adaptability of the above algorithms to the oil well condition diagnosis neural network model, it is finally decided to introduce the GPS pattern search algorithm for automatic iterative optimization to complete a method for optimizing the parameters of the oil well condition diagnosis neural network model.
[0059] The GPS mode search algorithm is a direct search algorithm that can intelligently generate parameter combinations composed of selected parameters. By comparing it with the trial-and-error method and the grid search method, it has more advantages in terms of cost and search space. Therefore, it can use fewer resources to gradually generate a parameter combination that is closest to the optimal parameter group.
[0060] Step 401: The operation steps of the GPS algorithm in the parameter optimization of the oil well condition diagnosis neural network model are as follows. Given an initial point of a parameter combination, [SGD, 0.001, 128, 2]. And calculate the performance of the oil well diagnosis neural network model at this point, that is, the objective function value. Then determine multiple search directions for the next step according to the pre-set search mode, and substitute all the searched search points, such as [SGD, 0.02, 256, 3], [SGD, 0.1, 128, 1], etc., into the oil well condition diagnosis neural network model for performance calculation. The search mode of the GPS search algorithm is determined by the search direction set and the search span.
[0061] After completing the search along the provided search directions, compare the accuracy of the oil well condition diagnosis neural network model at each search point and its diagnostic ability for similar working conditions, and select the point with the highest performance index as the new reference point for the next iterative search.
[0062] If a new reference point is found in the next search, that is, the model performance index at this point is higher than the previously calculated search points, then the next search span will be multiplied by a multiplication factor. The multiplication factor means that in each round of search, the current search span is multiplied by a constant factor greater than 1 to expand the search space and quickly approach the search target or the optimal solution in the search space; conversely, if the search does not find a point with a smaller objective function value than the existing reference point, then the next search span will be multiplied by a halving factor. The halving factor means that each search step will be reduced by half or multiplied by a factor less than 1 to gradually approach the search target or the local optimal solution in the search space.
[0063] In a search iteration, scans will be performed along each search direction in turn. If a new reference point, that is, a better parameter combination, is selected after the scans in all directions are completed, it is called a complete iteration; if a better solution than the existing reference point is found during the scan, it is set as the new reference point and the search starts again, which is called an incomplete iteration. When the performance of the oil well condition diagnosis neural network can reach a certain threshold during an iteration process, stop the search and save the optimal parameter combination.
[0064] Step 402: When the oil well condition diagnosis neural network model uses the GPS algorithm, the selection of the search mode has an important impact on the effect of parameter optimization. The search mode determines the search direction adopted by the parameter optimization method of the oil well condition diagnosis neural network model from the set of the current search point to the next generation search point.
[0065] Generally, we use a series of orthogonal basis vectors to represent the search mode. These orthogonal basis vectors have the following characteristics: (1) Any vector can be represented by a linear combination of orthogonal basis vectors, and all coefficients are non-negative. (2) Any one vector cannot be represented by a linear combination of other vectors in the orthogonal basis vectors. Using orthogonal basis vectors as the search method can effectively reduce the number of search directions required in the search process. For an n-dimensional vector, the search basis vectors contain at most 2^n vectors and at least n + 1 vectors. In the GPS algorithm, the most commonly used orthogonal basis vector search modes are the maximum basis mode and the minimum basis mode. Taking a two-dimensional problem as an example, its maximum basis mode consists of two orthogonal basis vectors:
[0066]
[0067] The minimum basis mode is:
[0068]
[0069] In the GPS algorithm, the calculation formula for the set of the next generation search point is as follows:
[0070] u k+1 = u k + Δ k C
[0071] In the formula, u k+1 is the set of the (k + 1)-th generation search point; u k is the optimal search point of the k-th generation; Δ k is the search span of the k-th generation; C is the search mode.
[0072] The search span is updated according to the following formula for each generation
[0073]
[0074] In the above formula, Δ k+1 is the search span of the (k + 1)-th generation; τ ω is the multiplication factor; τ r is the division factor.
[0075] Considering the complexity of the oil well condition diagnosis problem, there are too many condition types and there are similar conditions, etc. In the present invention, the algorithm parameters used by GPS are as follows: the search mode uses the maximum basis mode, and the multiplication factor τ ω= 1, halving factor τ r = 0.5.
[0076] Step 501: The pattern search algorithm is an intelligent optimization algorithm that can automatically generate feasible parameter combinations, evaluate the performance of the model under each combination, and iteratively generate new parameter combinations according to the performance to gradually approach the optimal parameter combination. Before comparing the performance of the model before and after, we will train and test the unoptimized model and the optimized model on the same training set and test set respectively.
[0077] For the performance of the oil well condition diagnosis neural network model after parameter optimization, indicators such as training accuracy and validation accuracy have been significantly improved. Under the parameter combination obtained by pattern search, the accuracy of the oil well condition diagnosis neural network model reaches 95.5%, as Figure 2 shown. At the same time, compared with before using the algorithm, the abnormal condition diagnosis rate has been further improved. It can be seen that Figure 3 , parameter optimization has greatly improved the accuracy of the oil well condition diagnosis neural network model in diagnosing oil well conditions in actual scenarios.
[0078] Step 601: When the oil well condition diagnosis neural network model after parameter tuning using an oil well condition diagnosis neural network model parameter optimization method can meet the on-site requirements, package this oil well condition diagnosis neural network model parameter optimization method, and then it will specifically serve the oil well condition diagnosis neural network.
[0079] Embodiment 2
[0080] In a specific Embodiment 2 of applying the present invention, the oil well condition diagnosis neural network model parameter optimization method includes the following steps:
[0081] Step 101: The present invention uses a convolutional neural network (CNN) as the core of the oil well condition diagnosis neural network model. In model construction, we selected the following parameters according to network characteristics and petroleum engineering seepage mechanics theory: optimizers (such as Adagrad and Adam), learning rate (restricted between 0 and 1), batch size (optional 128, 256, 512, 1024), and convolutional kernel size (can be set to 1, 3, 5, 7), etc.
[0082] Step 201: Combine the parameters selected in Step 101 into an initial parameter group, for example, [Adam, 0.01, 256, 2], where Adam represents the optimizer, 0.01 is the learning rate, 256 is the training batch, and 2 is the convolutional kernel size. The present invention aims to optimize these initial parameters to improve the performance of the oil well condition diagnosis neural network model.
[0083] Step 301: By evaluating the adaptability of the optimization algorithm and the oil well condition diagnosis neural network model, we finally choose to introduce the GPS mode search algorithm for automatic iterative optimization to complete the optimization method of the parameters of the oil well condition diagnosis neural network model.
[0084] Step 401: Establish a mathematical model for optimizing the parameters of the oil well diagnosis neural network, and introduce the GPS mode search algorithm for automatic iterative optimization to obtain the parameter combination with the best performance.
[0085] Step 501: Before comparing the performance of the models before and after, we will use the same training set and test set to train and test the unoptimized model and the optimized model respectively. Usually, the optimized oil well condition diagnosis neural network model shows a higher accuracy rate in diagnosing oil well conditions in actual scenarios.
[0086] Step 601: Once the parameters are successfully adjusted using the optimization method for the parameters of the oil well condition diagnosis neural network model and can meet the on-site requirements, this optimization method can be encapsulated and specifically applied to optimize the oil well condition diagnosis neural network to further improve its performance and applicability.
[0087] Example 3
[0088] In a specific Example 3 of applying the present invention, the optimization method for the parameters of the oil well condition diagnosis neural network model includes the following steps:
[0089] Step 101: The present invention uses the BP neural network as the core of the oil well condition diagnosis neural network model. In model construction, we select the following parameters: optimizer (RMSprop and SGD are optional), learning rate (between 0 and 1), activation function (Sigmoid, ReLU, tanh are optional), and the number of iterations (100, 300, 500 can be set).
[0090] Step 201: Combine the parameters selected in Step 101 into an initial parameter group, such as [RMSprop, 0.05, Sigmoid, 500]. These parameters include the optimizer, learning rate, activation function, and the number of iterations. The goal of the present invention is to optimize these initial parameters to improve the performance of the oil well condition diagnosis neural network model.
[0091] Step 301: By evaluating the adaptability of the optimization algorithm and the oil well condition diagnosis neural network model, we finally choose to introduce the GPS mode search algorithm for automatic iterative optimization to complete the optimization method of the parameters of the oil well condition diagnosis neural network model.
[0092] Step 401: Establish a mathematical model for optimizing the parameters of the oil well diagnosis neural network, and introduce the GPS mode search algorithm for automatic iterative optimization to obtain the parameter combination with the best performance.
[0093] Step 501: Before comparing the performance of the models before and after, we will train and test the unoptimized model and the optimized model on the same training set and test set respectively. Generally, the optimized oil well condition diagnosis neural network model shows a higher accuracy rate of oil well condition diagnosis in the actual scenario.
[0094] Step 601: Once the parameter adjustment is successfully carried out using the parameter optimization method of the oil well condition diagnosis neural network model and meets the actual requirements, the optimization method can be encapsulated.
[0095] Finally, it should be noted that the above are only the preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
[0096] Except for the technical features described in the specification, the rest are the known technologies of those skilled in the art.
Claims
1. A method for optimizing parameters of a neural network model for oil well condition diagnosis, characterized in that: The oil well operating condition diagnosis neural network model parameter optimization method includes: Step 1: Select the parameters to be optimized according to the kernel of the oil well condition network neural network and the oil well condition diagnosis problem; Step 2: Combine the pre-selected parameters to be optimized and restrict the parameters within a certain range; Step 3: Select the most optimal parameter optimization algorithm based on the oil well condition diagnosis neural network; Step 4: Use the pattern search algorithm to optimize the parameters of the oil well condition diagnosis neural network; Step 5: Compare the performance of the oil well condition diagnosis neural network model before and after optimization; Step 6: Encapsulate a parameter optimization method for a neural network model for oil well condition diagnosis that meets the requirements.
2. The oil well operating condition diagnosis neural network model parameter optimization method according to claim 1, characterized in that: In step 1, the kernel of the oil well condition diagnosis neural network to be optimized is a deep neural network that is a mixture of SqueezeNet and LSTM; its main goal is to output specific diagnostic conditions based on the input oil well condition data.
3. The oil well operating condition diagnosis neural network model parameter optimization method according to claim 2, characterized in that: In step 1, the oil well operating data includes ground equipment failure, formation complex problems, and pump complexes, and outputs specific diagnostic conditions, including the balance block is too heavy, insufficient fluid supply, and the balance block is too light, fixed valve blockage, and insufficient fluid supply.
4. The method for optimizing parameters of a neural network model for oil well operating condition diagnosis according to claim 3, characterized in that: In step 1, when selecting the parameters to be optimized for the oil well condition diagnosis neural network, the learning rate, optimizer, batch size, and convolution kernel size are selected for parameter optimization based on the petroleum engineering seepage mechanics theory and known working conditions.
5. The oil well operating condition diagnosis neural network model parameter optimization method according to claim 1, characterized in that: In step 2, the parameters to be optimized selected in step 1 are combined into different parameter combinations, and each type of parameter is limited to a specific optimization range according to its definition, function, and value.
6. The oil well operating condition diagnosis neural network model parameter optimization method according to claim 5, characterized in that: In step 2, different parameters have different optimization ranges. For the optimizer, the algorithm used to update the weights of each layer after each iteration is used. Several optimizers suitable for oil well condition classification are selected in advance, including stochastic gradient descent SGD, adaptive moment estimation optimizer Adam, and root mean square propagation RMSprop. The learning rate determines the step size of each iteration of the optimization method. It is set to fluctuate between 0 and 1. If it is too large, oscillation may occur easily, and if it is too small, the convergence speed may be too slow.
7. The method for optimizing parameters of a neural network model for oil well operating condition diagnosis according to claim 1, characterized in that: In step 3, a pattern search algorithm is selected as the optimization algorithm. This algorithm is a direct search algorithm that mainly extracts the target function on a direction set, and finds the descending direction by comparing the function value size to solve the problem. The commonly used generalized pattern search algorithm GPS algorithm is used to solve the nonlinear constrained optimization problem involved in the optimization of the neural network parameters for oil well condition diagnosis. In the process of optimizing the neural network parameters for oil well condition diagnosis, the input of each iteration is the parameter combination of the model, and the output is the parameter combination of the new model after one iteration.
8. The method for optimizing parameters of a neural network model for oil well operating condition diagnosis according to claim 1, characterized in that: In step 4, a mathematical model for optimizing the parameters of the oil well diagnosis neural network is established, and a GPS pattern search algorithm is introduced to automatically iterate and optimize to obtain the parameter combination with the best performance.
9. The method for optimizing parameters of a neural network model for oil well operating condition diagnosis according to claim 1, characterized in that: In step 5, the performance of the oil well condition diagnosis neural network is evaluated through a variety of indicators, including training loss, validation loss, training accuracy, validation accuracy, ROC curve, and confusion matrix; the focus is on the performance of the oil well condition diagnosis neural network on the test set and the diagnostic performance of the optimized model for abnormal conditions, and the model performance before and after parameter optimization is compared.
10. The oil well operating condition diagnosis neural network model parameter optimization method according to claim 1, characterized in that: In step 6, after optimizing the parameters of the oil well condition diagnosis neural network model, when the model meets the actual field needs, it is encapsulated into a complete oil well condition diagnosis neural network model parameter optimization method and applied to actual production.
11. Oil well condition diagnosis neural network model parameter optimization method system, characterized in that: The oil well operating condition diagnosis neural network model parameter optimization method system adopts the oil well operating condition diagnosis neural network model parameter optimization method described in any one of claims 1-10 to perform oil well operating condition diagnosis.
Citation Information
Patent Citations
An electric submersible pump well working condition intelligent diagnosis method based on a convolution neural network
CN109360120A
Oil well working condition intelligent diagnosis analysis method and device based on SVM model
CN111144433A
Oil well working condition identification and diagnosis system
CN113553539A
Intelligent diagnosis method for oil well working condition based on combination of number and shape
CN115374687A