BP neural network-based sedimentary microfacies identification method, apparatus and device, and medium
By combining genetic algorithms and BP neural networks, the training process of BP neural networks is optimized, and the problem of slow convergence speed of neural networks in the existing technology in the recognition of deposition microphase is solved, achieving more efficient training and recognition effects.
Patent Information
- Application Number
- CN202311686661.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-08
- Publication Date
- 2025-06-10
AI Technical Summary
When using neural networks to identify deposition microphase, the convergence speed is slow, the learning and training time is long, making it difficult to effectively combine neural network algorithms and geological phase judgments.
By combining genetic algorithms with BP neural networks, the initial connection weight and node threshold of the BP neural network are calculated using genetic algorithms, and the training process of the BP neural network is optimized, thereby improving the network's learning speed and convergence efficiency.
The faster convergence of the BP neural network is achieved, which improves the training efficiency by at least 40%, and can quickly and accurately identify new samples, verifying the correctness and reliability of the method.
Smart Images

Figure CN120124418A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of geophysical exploration technology, belonging to petroleum logging technology, and in particular to a sedimentary microfacies identification method, an identification device, an electronic device and a storage medium based on an optimized BP neural network. Background Art
[0002] Sedimentary facies is the sum of the formation environment, formation conditions and characteristics of sediments. Sedimentary facies research is an important basic geological work. By reshaping the sedimentary environment, we can understand the paleogeographic features of the geological period and the development history of the basin, find out the conditions and distribution laws of sediment formation, and thus guide the search for oil and gas. Different sedimentary environments often have different logging curve morphological characteristics; through the study of the morphological characteristics of logging curves, we can reflect the changes in sedimentary environment and facies, providing an effective means for sedimentary facies research.
[0003] An artificial neural network is an artificial network composed of a large number of simple processing units that are widely connected. In 1943, McCulloch and Pitts proposed the first neural computing model. In recent years, neural networks have been applied to various fields and have achieved many results. However, there are also certain problems, such as slow convergence and long learning and training time.
[0004] BP neural network is one of the most widely used neural network models. It is a multi-layer feedforward neural network trained according to the error back propagation algorithm. It contains an input layer, an output layer, and an intermediate layer between the input and output layers. Each layer has several nodes, and each node is only connected to the nodes of the previous and next layers. The calculation of BP neural network consists of forward propagation and error back propagation, and has strong nonlinear mapping capabilities.
[0005] Genetic Algorithm, proposed by John Holland of the United States in the 1970s, is a method for searching for optimal solutions by simulating the natural evolution process. The algorithm uses mathematical methods and computer simulation operations to convert the problem-solving process into a process similar to the crossover and mutation of chromosome genes in biological evolution. This method is widely used in various fields such as automatic control, production planning, and image processing.
[0006] Therefore, how to combine the neural network algorithm with geological phase identification, optimize the BP neural network using the genetic algorithm, and then propose a sedimentary microfacies identification method based on the optimized BP neural network has become the research object of the present invention. Summary of the invention
[0007] The present patent invents a method for identifying sedimentary microfacies based on an optimized BP neural network, which combines the neural network algorithm with geological facies discrimination. Taking the shapes of logging curves (such as shape, amplitude, etc.) as pattern features, typical samples are selected. Through the training and learning of the optimized BP neural network, a sedimentary microfacies model of the neural network is established, and then the microfacies types of other samples in this area are predicted using this model.
[0008] To achieve the above object, the present invention provides a method for identifying sedimentary microfacies based on a BP neural network, including:
[0009] Establishing a BP neural network, and using a genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network;
[0010] Training the BP neural network, and selecting training samples to input into the BP neural network for training;
[0011] Identifying sedimentary microfacies, and using the trained BP neural network to identify sedimentary microfacies.
[0012] Further, the BP neural network includes m layers, the input layer is the sample X, the output layer is the expectation Y, and the calculated output of node j is:
[0013] ο j =(1 + exp(-net j -θ j )) -1 (1)
[0014] The output of node j in the nth layer is denoted as
[0015] The input of node j is:
[0016]
[0017] The input of node j in the nth layer is denoted as
[0018] The number of input samples is N, and the samples are X1, X2, X3...XN; j represents the jth node in a certain layer, and i represents the ith node in its previous layer; ω ji represents the connection weight between node i and node j; θ j represents the threshold of node j.
[0019] Further, the error function of the sample X is:
[0020]
[0021] Further, training the BP neural network includes:
[0022] Add a sample to the input layer and pass it layer by layer to the output layer according to the rules of forward propagation, and finally obtain
[0023] Compare with the expected Y j If they are not equal, a learning error is generated. The learning error of the output layer is:
[0024]
[0025] The learning error of other layers is:
[0026] Then modify the weight coefficients by backpropagation according to the following formula:
[0027]
[0028] where η is the learning rate.
[0029] Furthermore, training the BP neural network includes:
[0030] According to the output result of the genetic algorithm, set the initial values of the weight coefficients ω ji and the threshold θ j ;
[0031] Input a sample X=(x1, x2,..., xn), and the corresponding expected output Y=(Y1, Y2,..., Yn);
[0032] Calculate the output of each layer and find the learning error of each layer
[0033] Backpropagate to correct the weight coefficients ω ji and the threshold θ j .
[0034] Furthermore, for any given sample Xp=(Xp1, Xp2,...Xpn) and expected output Yp=(Yp1, Yp2,...Ypn), the above steps of training the BP neural network should be executed until the input-output requirements of all samples are met.
[0035] Furthermore, using the genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network includes:
[0036] Randomly generate an initial population;
[0037] Establish subpopulations, calculate the fitness of individuals in the subpopulations through the selection operator, and determine whether the termination condition is met. If the termination condition is met, the initial settings of the connection weights and node thresholds are completed;
[0038] If the termination condition is not satisfied, calculate the survival probability of pattern H through the crossover operator and the mutation operator to obtain a new sub-population;
[0039] For the new sub-population, calculate the fitness of the individuals in the sub-population again, and determine whether the termination condition is satisfied. If the termination condition is not satisfied, repeat the calculation through the crossover and mutation operators until the termination condition is satisfied.
[0040] Furthermore, use the generated neural network model to automatically discriminate the sedimentary microfacies of the sandstone section to be identified. This model can be saved, deleted, and re-learned and trained, or multiple neural network models can be established for selection during identification.
[0041] Furthermore, for the neural network model created above, input a sample X to be learned, and obtain the model output Y, which is the microfacies recognition result; repeat the above operation to finally obtain the microfacies recognition results of all samples to be learned.
[0042] According to another aspect of the present invention, there is provided a sedimentary microfacies recognition device based on a BP neural network, including:
[0043] A network module that establishes a BP neural network and uses a genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network;
[0044] A training module that trains the BP neural network and selects training samples to input into the BP neural network for training;
[0045] An identification module that identifies sedimentary microfacies and uses the trained BP neural network to identify sedimentary microfacies.
[0046] According to another aspect of the present invention, there is provided an electronic device, which includes:
[0047] A memory that stores executable instructions;
[0048] A processor that runs the executable instructions in the memory to implement the sedimentary microfacies recognition method based on the BP neural network.
[0049] According to another aspect of the present invention, there is provided a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the sedimentary microfacies recognition method based on the BP neural network.
[0050] The present patent invention discloses a method for identifying sedimentary microfacies based on an optimized BP neural network, which combines the neural network algorithm with geological facies discrimination. Taking the shapes of logging curves (such as shape, amplitude, etc.) as pattern features, typical samples are selected, and through the training and learning of the optimized BP neural network, a sedimentary microfacies model of the neural network is established, and then the microfacies types of other samples in this area are predicted using this model.
[0051] The method of the present invention can conveniently configure the initial connection weights and node thresholds for the neural network model by using the genetic algorithm, and can converge faster when training the neural network model. Through comparison, it is found that the training efficiency is increased by at least 40%. In addition, the neural network model of the present invention can quickly and accurately identify new samples. Through testing and practical applications, the correctness and reliability of this method are verified. Brief Description of the Drawings
[0052] By describing the exemplary embodiments of the present invention in more detail in conjunction with the accompanying drawings, the above and other objects, features, and advantages of the present invention will become more apparent. Among them, in the exemplary embodiments of the present invention, the same reference numerals generally represent the same components.
[0053] Figure 1 It is a flowchart of the method for identifying sedimentary microfacies based on an optimized BP neural network according to the present invention.
[0054] Figure 2 It is a flowchart of the method for identifying sedimentary microfacies based on an optimized BP neural network according to an embodiment of the present invention.
[0055] Figure 3 It is a schematic diagram of a BP neural network according to an embodiment of the present invention.
[0056] Figure 4 It is a flowchart of the genetic algorithm according to an embodiment of the present invention.
[0057] Figure 5 It is a sample diagram selected according to an embodiment of the present invention. Detailed Description of the Embodiments
[0058] The preferred embodiments of the present invention will be described in more detail below. Although the preferred embodiments of the present invention are described below, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0059] This patent proposes a method for identifying sedimentary microfacies based on an optimized BP neural network, which combines the neural network algorithm with geological facies discrimination. Taking the log curve morphology (such as shape, amplitude, etc.) as the pattern feature, typical samples are selected, and through the training and learning of the optimized BP neural network, a sedimentary microfacies model of the neural network is established, and then the microfacies types of other samples in this area are predicted using this model.
[0060] This algorithm can easily establish a neural network model and quickly and accurately identify new samples through this model. Through testing and practical applications, the correctness and reliability of this method have been verified.
[0061] The following further illustrates the present invention in conjunction with the accompanying drawings and specific embodiments, but it is not a limitation of the present invention. It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0062] Embodiment 1
[0063] As Figure 1 shown, this embodiment provides a method for identifying sedimentary microfacies based on an optimized BP neural network, including:
[0064] Establish a BP neural network, and use a genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network;
[0065] Train the BP neural network, and select training samples to input into the BP neural network for training;
[0066] Identify sedimentary microfacies, and use the trained BP neural network to identify sedimentary microfacies.
[0067] Specifically, the BP neural network includes m layers, the input layer is the sample X, the output layer is the expectation Y, and the calculated output of node j is:
[0068] ο j =(1 + exp(-net j -θ j )) -1 (1)
[0069] The output of node j in the nth layer is denoted as
[0070] The input of node j is:
[0071]
[0072] The input of node j in the nth layer is denoted as
[0073] The number of input samples is N, and the samples are X1, X2, X3... XN; j represents the jth node in a certain layer, and i represents the ith node in its previous layer; ω ji represents the connection weight between node i and node j; θ j represents the threshold of node j.
[0074] The error function of sample X is:
[0075]
[0076] Training the BP neural network includes:
[0077] Adding a sample to the input layer and transmitting it layer by layer to the output layer according to the forward propagation rule, and finally obtaining
[0078] Compare with the expected Y j If the two are not equal, a learning error is generated. The learning error of the output layer is:
[0079]
[0080] The learning error of other layers is:
[0081] Then modify the weight coefficient by backpropagation according to the following formula:
[0082]
[0083] where η is the learning rate.
[0084] Specifically, training the BP neural network includes:
[0085] According to the output result of the genetic algorithm, initialize the weight coefficient ω ji and the threshold θ j to their initial values;
[0086] Input a sample X = (x1, x2,..., xn), and the corresponding expected output Y = (Y1, Y2,..., Yn);
[0087] Calculate the output of each layer and find the learning error of each layer
[0088] Backpropagate to correct the weight coefficient ω ji and the threshold θ j .
[0089] For any given sample Xp = (Xp1, Xp2,..., Xpn) and expected output Yp = (Yp1, Yp2,..., Ypn), the above steps of training the BP neural network shall be executed until the input-output requirements of all samples are met.
[0090] Calculating the initial connection weights and node thresholds of the BP neural network using the genetic algorithm includes:
[0091] Randomly generate an initial population;
[0092] Establish a sub-population, calculate the fitness of individuals in the sub-population through the selection operator, and determine whether the termination condition is met. If the termination condition is met, the initial setting of the connection weights and node thresholds is completed;
[0093] If the termination condition is not met, calculate the survival probability of pattern H through the crossover operator and mutation operator to obtain a new sub-population;
[0094] For the new sub-population, calculate the fitness of individuals in the sub-population again and determine whether the termination condition is met. If the termination condition is not met, repeat the calculation through the crossover and mutation operators until the termination condition is met.
[0095] Embodiment 2
[0096] As Figure 2 shown, this embodiment provides a sedimentary microfacies identification method based on an optimized BP neural network, including the following steps:
[0097] Step 1: Determine the pattern features and select samples
[0098] Study the relationship between sedimentary microfacies and the morphology of logging curves, determine the main pattern features, and select typical samples in this area.
[0099] Logging curves are a reflection of the comprehensive characteristics of sediments. Different sedimentary environments often have different logging curve morphological characteristics; through the study of the morphological characteristics of logging curves, the changes in sedimentary environments and facies can be reflected, providing an effective means for sedimentary facies research.
[0100] The morphology of logging curves can basically be divided into gradual change type, abrupt change type, oscillation type, massive type, interbedded type, and the above combined types. Its main features include shape (box shape, bell shape, funnel shape, diamond shape, etc.), amplitude, contact relationship (gradual change and abrupt change), secondary curve morphology, etc.
[0101] By studying the above change characteristics of logging curves and other logging interpretation conclusions, the mapping relationship from typical characteristics to facies is determined through statistics and reasoning, and finally the purpose of using logging information to describe and study sedimentary facies is achieved.
[0102] Step 2: Establish a BP neural network and optimize the neural network using the genetic algorithm
[0103] Establish a BP neural network and use the genetic algorithm to calculate the initial connection weights and node thresholds of the neural network to improve the network learning speed and accelerate convergence.
[0104] First, establish a BP neural network, as Figure 3 shown. The BP neural network has m layers, the input layer is the sample X, and the output layer is the expectation Y;
[0105] The number of typical samples input is N, and the samples are X1, X2, X3...XN respectively;
[0106] j represents the j-th node of a certain layer, i represents the i-th node of its previous layer, l represents the l-th node of its subsequent layer, and k represents the k-th node of the output layer;
[0107] ω ji represents the connection weight between node i and node j;
[0108] θ j represents the threshold of node j;
[0109] The calculated output of node j is:
[0110] ο j =(1 + exp(-net j -θ j )) -1 (1)
[0111] The output of the j-th node of the n-th layer is denoted as
[0112] The input of node j is:
[0113]
[0114] The input of the j-th node of the n-th layer is denoted as
[0115] Then, the error function of a sample X is:
[0116]
[0117] Then, use the genetic algorithm to calculate the initial connection weights and node thresholds of the neural network. The process is as Figure 4 shown.
[0118] First, set the population size to M and the number of generations to G.
[0119] Randomly select from population M to establish a sub - population. Calculate the fitness of individuals in the sub - population through the selection operator, and determine whether the termination condition is met. If the termination condition is met, complete the initial setting of connection weights and node thresholds;
[0120] If the termination condition is not met, calculate the survival probability of schema H through the crossover operator and mutation operator to obtain a new sub - population;
[0121] For the new sub - population, calculate the fitness of individuals in the sub - population again, and determine whether the termination condition is met. If the termination condition is not met, repeat the calculation through the crossover and mutation operators until the termination condition is met.
[0122] In this embodiment, mainly three operators: selection, crossover, and mutation are elaborated as follows:
[0123] 1. Selection operator
[0124] Use the proportional selection operator.
[0125] The fitness of individual pop i (i ∈ [1, m]) is:
[0126]
[0127] Then the total fitness of the current population is:
[0128]
[0129] Under the action of the selection operator, the individual pop that matches schema H i can copy M * F(pop i ) / F(t) individuals into the next - generation population. The growth equation of schema H is:
[0130]
[0131] where f(H, t) is the fitness of the individuals implied by schema H in the t - th generation population, is the average fitness of the t - th generation population.
[0132] 2. Crossover operator
[0133] Crossover may destroy some schemas in the population and at the same time generate new schemas. The individuals implied in schema H perform crossover operations with other individuals. When the randomly set crossover point is within the defining length of the schema, it may destroy the schema; while when the randomly set crossover point is outside the defining length of the schema, it will definitely not destroy the schema.
[0134] Adopt single - point crossover with a crossover probability of Pc. The survival probability of schema H:
[0135] P s ≥ 1 - P c ·δ(H) (7)
[0136] 3. Mutation Operator
[0137] The basic bit mutation operator changes the value of specific bits in the string with a mutation probability Pm. To enable the survival of schema H, all specific bits of H must survive. The survival probability of a specific bit is (1 – Pm), so the probability that the o(H) specific bits of schema H survive simultaneously is:
[0138] P s =(1 - P m ) o(H) (8)
[0139] Usually, the mutation probability Pm is very small (Pm << 1), and the survival probability of schema H can be approximated as:
[0140] P s ≈ 1 - o(H)·P m (9)
[0141] Combining equations (6), (7), and (9), under the continuous action of operators such as proportional selection, single-point crossover, and basic bit mutation, the number of offspring individuals of schema H in the population is:
[0142]
[0143] Step 3: Input the samples into the neural network to train the neural network
[0144] Input the samples into the neural network for training and learning. When the learning converges, the neural network model can be obtained. The main steps are:
[0145] 3 - 1. Set the initial values for the weight coefficients ω ji and the threshold θ j According to the output results of the previous genetic algorithm, set the initial values for the weight coefficients ω ji and the threshold θ j of each layer.
[0146] 3 - 2. Input a sample X = (x1, x2,..., xn), and the corresponding expected output Y = (Y1, Y2,..., Yn).
[0147] 3 - 3. Calculate the outputs of each layer.
[0148] 3 - 4. Calculate the learning errors of each layer
[0149] 3 - 5. Modify the weight coefficients ω ji and the threshold θ j .
[0150] 3-6. After obtaining the weight coefficients of each layer, it can be judged whether the requirements are met according to the given conditions: if the requirements are met, the algorithm ends; otherwise, return to (3-3) for execution.
[0151] 3-7. This learning process needs to be executed for any given sample Xp = (Xp1, Xp2,..., Xpn) and expected output Yp = (Yp1, Yp2,..., Ypn) until the input-output requirements of all samples are met.
[0152] The backpropagation algorithm includes forward propagation and backpropagation. These two processes are briefly described as follows:
[0153] 1. Forward Propagation
[0154] The sample is input from the input layer, passes through all hidden layers layer by layer, and then is transmitted to the output layer; during the process of layer-by-layer processing, the state of each neuron in each layer only affects the state of the neurons in the next layer. At the output layer, the current output is compared with the expected output. If the current output is not equal to the expected output, then enter the backpropagation process.
[0155] 2. Backpropagation
[0156] During backpropagation, the error signal is transmitted back along the original forward propagation path, and the weight coefficients of each neuron in each hidden layer are modified to make the expected error signal tend to be the smallest.
[0157] The essence of the BP algorithm is to find the minimum value of the error function. This algorithm uses the steepest descent method in nonlinear programming to modify the weight coefficients according to the negative gradient direction of the error function.
[0158] The training method of the multi-layer network is to add a sample to the input layer and transmit it layer by layer to the output layer according to the forward propagation rules, and finally obtain Compare it with the expected Y j If the two are not equal, an error signal e is generated, and then the weight coefficients are modified by backpropagation according to the following formula:
[0159]
[0160] where
[0161] Output layer
[0162] Other layers
[0163] Through repeated training of multiple samples, the weight coefficients are corrected in the direction of gradually decreasing error to ultimately eliminate the error. As can also be seen from the above formula, when the number of network layers is large, the amount of computation required is quite substantial, so the convergence speed is not fast.
[0164] To accelerate the convergence speed, generally consider the previous weight coefficients and use them as one of the bases for this correction. Therefore, there is the formula:
[0165]
[0166] where η is the learning rate and α is the inertia coefficient.
[0167] Step 4: Use the neural network model for sedimentary microfacies identification.
[0168] Use the generated neural network model to automatically discriminate the sedimentary microfacies of the sandstone section to be identified. This model can be saved, deleted, and re-learned and trained. Multiple neural network models can be established for selection during identification. For the above-created neural network model, input a sample X to be learned, and obtain the model output Y, which is the microfacies identification result; repeat the above operation to finally obtain the microfacies identification results of all samples to be learned.
[0169] Example 3
[0170] As Figure 5 shown, this example describes the application process of the sedimentary microfacies identification method of the present invention with a specific example.
[0171] Step 1: Determine the pattern features and select samples
[0172] Study the relationship between sedimentary microfacies and the morphology of logging curves, determine the main pattern features, and select typical samples in this area.
[0173] Logging curves are a reflection of the comprehensive characteristics of sediments. Different sedimentary environments often have different logging curve morphological characteristics; by studying the morphological characteristics of logging curves, the changes in sedimentary environments and facies can be reflected, providing an effective means for sedimentary facies research.
[0174] The morphology of logging curves can basically be divided into gradual change type, sudden change type, oscillation type, massive type, interbedded type, and the above combined types. Its main features include shape (box shape, bell shape, funnel shape, and diamond shape, etc.), amplitude, contact relationship (gradual change and sudden change), secondary curve morphology, etc.
[0175] By studying the above-mentioned change characteristics of logging curves and other logging interpretation conclusions, the mapping relationship from typical characteristics to facies is determined through statistics and reasoning, and finally the purpose of using logging information to describe and study sedimentary facies is achieved.
[0176] According to the actual geological analysis of the research work area, select appropriate logging curve types as the characteristic model. In this case, the shape of the SP curve is selected as the pattern feature, and 10 sampling points are selected for each curve segment according to the curve thickness and sampling rate.
[0177] Analyze the lithology sections in the work area and manually interpret several relatively standard sedimentary microfacies. After statistical analysis, determine the sample set of sedimentary microfacies. In this test, 5 sample segments are extracted, and the curve shapes are bell-shaped, oval-shaped, linear 1, linear 2, and box-shaped, respectively, to establish the sample set of the neural network model, as Figure 5 shown.
[0178] Step 2: Establish a BP neural network and optimize the neural network using the genetic algorithm
[0179] Establish a BP neural network and use the genetic algorithm to calculate the initial connection weights and node thresholds of the neural network to improve the network learning speed and accelerate convergence.
[0180] First, establish a BP neural network. The network has m layers, the input layer is the sample X, and the output layer is the expectation Y;
[0181] The number of typical samples input is N, and the samples are X1, X2, X3...XN;
[0182] j represents the j-th node of a certain layer, i represents the i-th node of its previous layer, l represents the l-th node of its subsequent layer, and k represents the k-th node of the output layer;
[0183] ω ji represents the connection weight between node i and node j;
[0184] θ j represents the threshold of node j;
[0185] The calculated output of node j
[0186] ο j =(1 + exp(-net j -θ j )) -1 (1)
[0187] The output of the j-th node of the n-th layer is denoted as
[0188] The input of node j
[0189]
[0190] The input of the j-th node of the n-th layer is denoted as
[0191] Then the error function of a sample X
[0192]
[0193] Then, use the genetic algorithm to calculate the initial connection weights and node thresholds of the neural network. The process is as Figure 4 shown. First, randomly generate the initial population; establish the sub-population, and judge whether the termination condition is satisfied. If the termination condition is satisfied, the initial settings of the connection weights and node thresholds are completed; if the termination condition is not satisfied, calculate the fitness of the individuals in the population through the selection operator, calculate the survival probability of pattern H through the crossover operator and mutation operator, and obtain the new sub-population; judge whether the termination condition is satisfied for the new sub-population. If the termination condition is not satisfied, repeat the calculation through the selection, crossover, and mutation operators until the termination condition is satisfied.
[0194] Specifically, let the population size be M and the number of generations be G.
[0195] Establish the sub-population, calculate the fitness of the individuals in the sub-population through the selection operator, and judge whether the termination condition is satisfied. If the termination condition is satisfied, the initial settings of the connection weights and node thresholds are completed;
[0196] If the termination condition is not satisfied, calculate the survival probability of pattern H through the crossover operator and mutation operator, and obtain the new sub-population;
[0197] For the new sub-population, calculate the fitness of the individuals in the sub-population again, and judge whether the termination condition is satisfied. If the termination condition is not satisfied, repeat the calculation through the crossover and mutation operators until the termination condition is satisfied.
[0198] The calculation process mainly involves three operators: selection, crossover, and mutation, which are described as follows:
[0199] 1. Selection
[0200] Use the proportional selection operator. The fitness of individual pop i (i ∈ [1, m]) is:
[0201]
[0202] Then the total fitness of the current population is:
[0203]
[0204] Under the action of the selection operator, the individual pop i matching pattern H can copy M * F(pop i ) / F(t) individuals into the next generation population. The growth equation of pattern H is:
[0205]
[0206] Among them, f(H, t) is the fitness of the individuals implied by the schema H in the t-th generation population,
[0207] and is the average fitness of the t-th generation population.
[0208] 2. Crossover
[0209] Crossover may destroy some schemas in the population and at the same time generate new schemas. When the individuals implied in the schema H perform crossover operations with other individuals, if the randomly set crossover point is within the defined length of the schema, it may destroy the schema; while if the randomly set crossover point is outside the defined length of the schema, it will definitely not destroy the schema.
[0210] Using single-point crossover with a crossover probability of Pc, the survival probability of the schema H:
[0211] P s ≥ 1 - P c ·δ(H) (7)
[0212] 3. Mutation
[0213] The basic bit mutation operator changes the values of specific bits in the string with a mutation probability of Pm. In order for the schema H to survive, all specific bits of H must survive. The survival probability of a specific bit is (1 – Pm), then the probability that the o(H) specific bits of the schema H survive simultaneously is:
[0214] P s =(1 - P m ) o(H) (8)
[0215] Usually, the mutation probability Pm is very small (Pm << 1), and the survival probability of the schema H can be approximated as:
[0216] P s ≈ 1 - o(H)·P m (9)
[0217] Combining equations (6), (7), and (9), under the continuous action of operators such as proportional selection, single-point crossover, and basic bit mutation, the number of offspring individuals of the schema H in the population is:
[0218]
[0219] Set the neural network parameters, including the number of nodes in hidden layer 1, the number of nodes in hidden layer 2, learning rate, learning inertia, number of learning times, and learning accuracy. Among them, the learning rate should take a relatively large value, and the learning inertia should take a relatively small value.
[0220] Set the parameters of the genetic algorithm, including the population size, the number of generations, the crossover probability, and the mutation probability. Among them, the crossover probability can take a relatively large value, and the mutation probability can take a relatively small value.
[0221] Step 3: Train and learn the samples to establish a neural network model
[0222] Input the samples into the neural network for training and learning. When the learning converges, the neural network model can be obtained. The main steps are as follows:
[0223] 3-1. Initialize the weight coefficients ω ji and the threshold θ j . According to the output results of the previous genetic algorithm, initialize the weight coefficients ω ji and the threshold θ j .
[0224] 3-2. Input a sample X = (x1, x2,..., xn), and the corresponding expected output Y = (Y1, Y2,..., Yn).
[0225] 3-3. Calculate the outputs of each layer.
[0226] 3-4. Calculate the learning errors of each layer
[0227] 3-5. Modify the weight coefficients ω ji and the threshold θ j .
[0228] 3-6. After calculating all the weight coefficients of each layer, check whether the given conditions are met: if they are met, the algorithm ends; otherwise, return to (3-3) for execution.
[0229] 3-7. This learning process needs to be executed for any given sample Xp = (Xp1, Xp2,... Xpn) and the expected output Yp = (Yp1, Yp2,... Ypn) until the input-output requirements of all samples are met.
[0230] The training method for a multi-layer network is to add a sample to the input layer and transfer it layer by layer to the output layer according to the forward propagation rule, and finally obtain Compare it with the expected Y j : If they are not equal, an error signal e is generated, and then the weight coefficients are modified by backpropagation according to the following formula:
[0231]
[0232] where
[0233] output layer
[0234] other layers
[0235] Through repeated training of multiple samples, the weight coefficients are corrected in the direction of gradually decreasing error to finally eliminate the error. It can also be known from the above formula that when the number of network layers is large, the amount of calculation used is quite considerable, so the convergence speed is not fast.
[0236] To accelerate the convergence speed, generally consider the previous weight coefficients and use them as one of the bases for this correction, so there is the formula:
[0237]
[0238] where η is the learning rate and α is the inertia coefficient.
[0239] Learn the selected samples. When the learning converges, the neural network model can be obtained.
[0240] Step Four: Use the neural network model for sedimentary microfacies identification
[0241] Use the generated neural network model to automatically discriminate the sedimentary microfacies of the sandstone section to be identified. This model can be saved, deleted, and re-learned and trained. Multiple neural network models can be established for selection during identification.
[0242] For the above-created neural network model, input a sample X to be learned, and obtain the model output Y, which is the microfacies identification result; repeat the above operation to finally obtain the microfacies identification results of all samples to be learned.
[0243] Example Four
[0244] This example provides a sedimentary microfacies identification device based on a BP neural network, including:
[0245] A network module that establishes a BP neural network and uses a genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network;
[0246] A training module that trains the BP neural network and selects training samples to input into the BP neural network for training;
[0247] An identification module that identifies sedimentary microfacies and uses the trained BP neural network to identify sedimentary microfacies.
[0248] Example Five
[0249] This example provides an electronic device, and the electronic device includes:
[0250] A memory that stores executable instructions;
[0251] A processor that runs the executable instructions in the memory to implement the sedimentary microfacies identification method based on a BP neural network, the method comprising:
[0252] Establish a BP neural network, and use a genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network;
[0253] Train the BP neural network, and select training samples to input into the BP neural network for training;
[0254] Identify sedimentary microfacies, and use the trained BP neural network to identify sedimentary microfacies.
[0255] Embodiment Six
[0256] This embodiment provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the sedimentary microfacies identification method based on a BP neural network, the method comprising:
[0257] Establish a BP neural network, and use a genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network;
[0258] Train the BP neural network, and select training samples to input into the BP neural network for training;
[0259] Identify sedimentary microfacies, and use the trained BP neural network to identify sedimentary microfacies.
[0260] The above computer-readable storage medium includes but is not limited to: optical storage media (such as CD-ROMs and DVDs), magneto-optical storage media (such as MOs), magnetic storage media (such as tapes or external hard drives), media with built-in rewritable non-volatile memories (such as memory cards), and media with built-in ROMs (such as ROM cartridges).
[0261] The various embodiments of the present invention have been described above. The above description is exemplary and not exhaustive, and is also not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments.
Claims
1. A method for identifying sedimentary microfacies based on BP neural network, characterized in that, it includes: Establish a BP neural network, and use the genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network; Train the BP neural network, select training samples and input them into the BP neural network for training; Identify sedimentary microfacies, and use the trained BP neural network to identify sedimentary microfacies.
2. The method for identifying sedimentary microfacies based on BP neural network according to claim 1, characterized in that, the BP neural network includes m layers, the input layer is the sample X, the output layer is the expectation Y, and the calculated output of node j is: ο j = (1 + exp(-net j -θ j )) -1 (1) The output of node j in the nth layer is denoted as the input of node j is: The input of node j in the nth layer is denoted as The number of input samples is N, and the samples are X1, X2, X3... XN respectively; j represents the j-th node of a certain layer, and i represents the i-th node of its previous layer; ω ji represents the connection weight between node i and node j; θ j represents the threshold of node j.
3. The method for identifying sedimentary microfacies based on BP neural network according to claim 2, characterized in that, the error function of sample X is:
4. The method for identifying sedimentary microfacies based on BP neural network according to claim 2, characterized in that, training the BP neural network includes: Add a sample to the input layer and transfer it layer by layer to the output layer according to the rules of forward propagation, and finally obtain it at the output layer Compare with the expected Y j and if they are not equal, a learning error is generated. The learning error of the output layer is: The learning error of other layers is: Then backpropagate and modify the weight coefficients according to the following formula: where η is the learning rate.
5. The method for identifying sedimentary microfacies based on BP neural network according to claim 2, characterized in that, training the BP neural network includes: According to the output results of the genetic algorithm, set the initial values for the weight coefficients ω ji of each layer and the threshold θ j ; Input a sample X = (x1, x2,..., xn), and the corresponding expected output Y = (Y1, Y2,..., Yn); Calculate the output of each layer and find the learning error of each layer Backpropagation correction weight coefficient ω ji and threshold θ j .
6. The method for identifying sedimentary microfacies based on BP neural network according to claim 5, characterized in that, For any given sample Xp = (Xp1, Xp2,... Xpn) and expected output Yp = (Yp1, Yp2,... Ypn), the above steps of training the BP neural network should be executed until the input-output requirements of all samples are met.
7. The method for identifying sedimentary microfacies based on BP neural network according to claim 1, characterized in that, using the genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network includes: Randomly generate an initial population; Establish a sub-population, calculate the fitness of individuals in the sub-population through the selection operator, and judge whether the termination condition is met. If the termination condition is met, the initial settings of the connection weights and node thresholds are completed; If the termination condition is not met, calculate the survival probability of pattern H through the crossover operator and mutation operator to obtain a new sub-population; For the new sub-population, calculate the fitness of individuals in the sub-population again, and judge whether the termination condition is met. If the termination condition is not met, repeat the calculation through the crossover and mutation operators until the termination condition is met.
8. A device for identifying sedimentary microfacies based on BP neural network, characterized in that, it includes: A network module that establishes a BP neural network and uses the genetic algorithm to calculate the initial connection weights and node thresholds of the BP neural network; A training module that trains the BP neural network, selects training samples and inputs them into the BP neural network for training; An identification module that identifies sedimentary microfacies and uses the trained BP neural network to identify sedimentary microfacies.
9. An electronic device, characterized in that, the electronic device includes: A memory that stores executable instructions; A processor that runs the executable instructions in the memory to implement the deposition microfacies identification method based on the BP neural network according to any one of claims 1-7.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, characterized in that when the computer program is executed by a processor, it implements the deposition microfacies identification method based on the BP neural network according to any one of claims 1-7.