Quantitative characterization and prediction of the microscopic dynamic behavior of droplets in crude oil emulsions
Through in-situ microscopic observation and video processing technology, the microkinetic behavior of liquid droplets in crude oil emulsion is quantitatively characterized and predicted, which solves the safety hazards of crude oil emulsion during storage and transportation, and improves flow safety and transportation efficiency.
Patent Information
- Application Number
- CN202211147407.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-09-20
AI Technical Summary
Crude oil emulsions have safety hazards in the storage, transportation, heating, temperature drop, etc., and the flow safety characteristics are difficult to ensure, and the prior art is difficult to effectively characterize and predict the microkinetic behavior of the droplets.
The microscopic motion and structural change video of the droplets were taken through in-situ microscopic observation device, and combined with microscopic video extraction, frame-by-frame processing, image optimization, pixel classification and threshold segmentation and other technologies, the microscopic motion, spatial distribution and dynamic changes of the droplets were quantitatively characterized and predicted.
Accurate quantitative characterization and prediction of the microkinetic behavior of droplets in crude oil emulsions is achieved, and microscopic mechanism analysis of the complex rheology formation of crude oil emulsions is provided, which improves flow safety and transportation efficiency.
Smart Images

Figure CN115508353B_ABST
Abstract
Description
Technical field:
[0001] The present invention relates to the technology of describing emulsions at a microscopic scale in the process of transporting, treating, separating and purifying emulsions formed during crude oil extraction, storage and gathering, and specifically to a method for quantitatively characterizing and predicting the microscopic dynamic behavior of droplets in crude oil emulsions. Background technology:
[0002] At present, my country's oil and gas development is gradually developing towards the deep sea, and one of the main ways of long-distance offshore oil and gas gathering and transportation is oil-water mixed transportation. During long-distance gathering and transportation, the fluid passes through the nozzle, pump station, valve and other components and is subject to high-speed shearing, which easily forms crude oil emulsion. In addition, some technical process products also contain crude oil emulsions. The properties of crude oil emulsions and crude oil are very different. Under shearing, the deformation and mutual collision of emulsified droplets will lead to an increase in the viscosity of the system, and the transportation cost will increase accordingly. The low temperature and high pressure environment during the gathering and transportation process will promote the formation and stability of the internal structure of the emulsion, and the system will gel, causing "coagulation pipe" accidents (Sun Guangyu; Li Chuanxian; Proceedings of the 13th National Rheology Academic Conference, 2016, 314-317.). There is a strong connection between the macroscopic rheological properties of crude oil emulsions and some behaviors of microscopic droplets. The study of the microstructure of emulsion droplets is of great significance for revealing the macroscopic rheological properties of emulsions and coping with the flow safety issues of gathering and transportation and pipeline transportation.
[0003] Scholars have conducted a lot of research on the microstructure and morphology of droplets. Different technical means and research methods have been used to conduct extensive research on the microstructure of droplets. These methods and techniques include optical microscope observation, X-ray diffraction, nuclear magnetic resonance, rheology, etc. Among them, optical microscope observation is widely used. Through this technology, static visualization images of microscopic droplets can be obtained, so as to study the effects of different shear conditions, different physical and chemical properties of crude oil and different electromagnetic fields on the microstructure and morphology of droplets. (Jiang Yanming, Li Chuanxian; Oil & Gas Transportation and Storage 2000(01): 10-12+19-61+4. Visintin R; Lockhart TP; Lapasin R; Journal of Non-Newtonian Fluid Mechanics, 2008, 149(1-3): 34-39. Haj-Shafiei S; Ghosh S; Rousseau D; J Colloid Interface, 2013, 410: 11-20. Sun Guangyu; Zhang Jinjun; Energy & Fuels, 2014, 28(6): 3718-3729. Wang Zhihua; Journal of Petroleum Science and Engineering, 2019, 181(7): 106230.). On this basis, with the development of image analysis technology, the observation and research of droplet microscopic images have risen from simple qualitative description to quantitative description, realizing the quantitative characterization of the droplet microscopic morphology, and quantitatively characterizing the complexity and morphological characteristics of droplets and their aggregates by fractal dimension, aspect ratio, particle size distribution histogram, etc. (Huang Qiyu; Wang Lei; Acta Petroleum 2013, 34(04): 765-774. Nowbahar A; Whitaker KA; Schmitt AK; Energy & Fuels, 2017, 31(10): 10555-10565. Tripathi S; Bhattacharya A, Singh R; Chemical Engineering Science, 2017: S0009250917305705. Shi Bohui; Oil & Gas Transportation and Storage 2018, 37(02): 183-189+203.).Despite this, most of the microscopic droplet images obtained by current studies are images of emulsions under static conditions, which fail to show the interaction between emulsified droplets, and cannot reflect the dynamic response of emulsified droplets under external shear and other effects and the dynamic changes in microstructure and arrangement. This has an adverse impact on the in-depth understanding of the nature and mode of interaction between droplets and the acquisition of real droplet structure and morphology information, and also restricts the understanding of the mechanism of complex rheological properties of crude oil emulsions. Summary of the invention:
[0004] The purpose of the present invention is to provide a method for quantitatively characterizing and predicting the microscopic dynamic behavior of droplets in crude oil emulsions. This method is used to solve the technical problem that there are safety hazards in the storage, transportation, heating, temperature reduction and other processes of crude oil emulsions, and the flow safety characteristics are difficult to ensure.
[0005] The technical solution adopted by the present invention to solve the technical problem is: the method for quantitatively characterizing and predicting the microscopic dynamic behavior of droplets in crude oil emulsion comprises the following steps:
[0006] Step 1: Microscopic video shooting: Under the premise of controlling the shear rate and temperature drop rate applied to the crude oil sample, shoot the video of the microscopic movement and structural changes of the droplets in the crude oil emulsion;
[0007] Step 2: Extraction of microscopic video: Select several key video segments that can reflect the microscopic morphology, aggregation movement and collision behavior of droplets and extract them from the original video;
[0008] Step 3: Process the microscopic video frame by frame to obtain a dynamic sequence image of the droplet;
[0009] Step 4: Preprocess the microscopic image to make the edge contour of the droplet clearer;
[0010] Step 5: Machine target recognition and tracking: Establish a machine recognition droplet algorithm model, perform target feature matching, recognize and track droplets in the entire field of view, establish multi-threshold Ostu segmentation for the global image, and use the particle swarm optimization algorithm to optimize the multi-threshold Ostu segmentation;
[0011] Step 6: Target feature matching results: Randomly sample the target features, randomly sample a number of microscopic droplets, record their feature points and find their corresponding microscopic droplets;
[0012] Step 7: Manually track the droplets sampled in step 6 and extract microscopic characteristic parameters to obtain a threshold sequence image;
[0013] Step 8: Extract characteristic parameters, quantitatively characterize the microscopic droplet characteristic parameters of the threshold sequence images obtained in steps 5 to 7: After processing, the threshold images of droplets and their aggregates are obtained, and based on the ratio of the observed field of view size to the threshold image resolution, the microscopic characteristic parameters of the droplets and their aggregates are analyzed to quantitatively characterize the dynamic changes of the microscopic motion, spatial distribution and structure of the droplets and their aggregates;
[0014] Step nine, comparing the microscopic droplet trajectory and extracted characteristic parameters tracked manually with the microscopic droplet trajectory and extracted characteristic parameters tracked by the machine, and using the difference method to check the error rate;
[0015] Step 10: Analyze the droplet microscopic dynamic parameters obtained by quantitative identification, and predict the dynamic behavior of the droplet by constructing a mathematical model;
[0016] Step 1: Predict the motion trajectory of the droplet:
[0017] Based on the captured trajectories of a large number of droplets, different proportions of the trajectories of different droplets at different times and different shear rates are taken as training sample sets, and a BP neural network model is constructed to train it to obtain a droplet trajectory prediction model. The droplet trajectory prediction model is continuously iterated and corrected until its prediction error is reduced to a certain value.
[0018] Step 2: Predict the uniformity of droplets in the entire emulsion system:
[0019] Apply a constant shear rate to the crude oil sample, fix the microscopic observation field, monitor the uniformity of the droplets in the field of view, and observe how the droplet uniformity changes with shear time;
[0020] The formula for calculating the uniformity of the droplets is as follows:
[0021]
[0022] In the formula, A i is the area ratio of the droplet in the i-th grid; is the average droplet area ratio; N is the number of grids;
[0023] The microscopic image is evenly divided into N grids, and the droplet area of each grid is analyzed;
[0024] Calculate the uniformity coefficient at different times under a fixed field of view, establish and train a BP neural network model, obtain the emulsion system droplet uniformity change model, and predict the uniformity change of the system; continuously iterate and correct the emulsion system droplet uniformity change model until the prediction error of the emulsion system droplet uniformity change model is reduced to a certain value.
[0025] In the above scheme, the microscopic video shooting of step 1 is carried out through an in-situ microscopic observation device, which includes a bracket structure, a sample carrying module, a driving and detection module; the driving and detection module, the sample carrying module and the temperature control module are all made of transparent quartz glass, the sample carrying module has a sample temperature control module, and the sample temperature control module is connected to a constant temperature water bath through a circulation pipeline; the torque sensing module is connected to the driving and detection module, and a shadowless cold light source is embedded inside the surface of the driving and detection module, and the driving and detection module moves up and down through a guide frame structure; the microscopic observation module has a polarization function, which switches between natural light and polarized light, and the microscopic observation module is located on the side of the sample carrying module, and the microscopic observation module is connected to a high-speed CCD camera , the CCD camera is connected to the computer; the microscopic observation module is arranged on the microscopic viewing angle moving module, which can adjust the position of the microscope head to make it close to or away from the sample, or move the microscope in the horizontal or vertical direction, so as to take microscopic structural images of different liquid layers and different positions in the sample; the microscopic observation module obtains the microscopic dynamic characteristics of the droplets by photographing the microscopic behavior changes of the droplets in the crude oil emulsion under the shearing action; the driving and detection module directly illuminates the sample, and is observed by the microscope in the form of projected light. The microscope itself is integrated with an LED light source, which illuminates the sample from another direction and is observed by the microscope in the form of reflected light, constructing a multi-angle composite light source to illuminate the crude oil sample, and integrating transmission microscopy and reflection microscopy observations.
[0026] The method of microscopic image preprocessing in step 4 of the above scheme is:
[0027] Step 1, color matching of microscopic images; performing color matching processing on the microscopic image of the droplet obtained in step 3 to obtain a microscopic image in which the background color and the droplet color have the same color mode;
[0028] Step 2: Adjust the overall image brightness and contrast:
[0029] g(i, j) = αf(i, j) + β
[0030] Where α is the contrast coefficient, which makes the pixel darker when it is less than 1 and brighter when it is greater than 1; β is the brightness gain variable;
[0031] Step 3: Remove image noise by using bilateral filtering. The template of the bilateral filter is:
[0032]
[0033] Where: (k, l) is the center coordinate of the template window; (i, j) is the coordinate of other coefficients of the template window; σ d The standard deviation of the Gaussian function used to generate the distance template coefficient; σ ris the standard deviation of the Gaussian function used to generate the range template system; d(i, j, k, l) is the distance template coefficient; r(i, j, k, l) is the range template coefficient;
[0034] Step 4: Enhance the image information and perform the following operations on the image:
[0035] For a two-dimensional image f(x, y), the second-order differential Laplace operator is defined as:
[0036]
[0037] In the smooth grayscale area, there is no response, that is, the sum of the template coefficients is 0;
[0038] Finally, the value of each pixel is calculated as follows:
[0039]
[0040] Where g is the output pixel value, f(x, y) is the original pixel value, and c is the coefficient mathematics.
[0041] The specific method of step 5 in the above scheme is:
[0042] Step 1: Target feature extraction: extracting the texture features, edge features, grayscale histogram and transformation coefficient features of the image. The selection of target features takes into account the type of target and the background in which the target is located.
[0043] Step 2: Target feature matching: match the target feature with the target droplet based on the absolute balance algorithm to obtain the matching relationship between the target feature and the droplet, which is implemented based on the following algorithm:
[0044]
[0045] Where T(m, n) is the grayscale value of the template image, m and n represent the size of the template image, and F(m, n) i,j is a window image with the same size as the template image, with point (i, j) as the reference point on the image to be matched, and T is the threshold;
[0046] Step 3: Perform multi-threshold Otsu segmentation on the global sequence image to perform droplet tracking. When performing multi-threshold Otsu segmentation on an image, multiple different thresholds are used to segment the image into multiple different regions or targets. Assuming that the image size is M×N, the image grayscale range is [0, L-1], n i is the number of pixels of gray level i in the image, and the probability of gray level i appearing is: p i =n i / (M×N). Assume there are n-1 thresholds T1, T2, ...T n-1The image is divided into n categories, represented by C0 = {0, 1, .... T1}, C n ={T n-1 +1, T n-1 +2,...L-1}, the probability of each category appearing is P0, P1,..., P n-1 , the variance is expressed as The mean is u0, u1, ...u n-1 ;
[0047] in, Where k = 0, 1, ..., n-1; T0 = 0, T n =L, then the inter-class variance of the image is expressed as:
[0048] Multi-level optimal segmentation threshold:
[0049] Step 4: Optimize the parameters of the Otsu multi-threshold segmentation method. The optimal threshold solution function is: The particle swarm optimization algorithm is used to optimize the multi-threshold Ostu segmentation;
[0050] v i =w×v i +c1×rand()×(pbest i -x i )+c2×rand()×(gbest i -x i )
[0051] Among them, w i is a non-negative value called the inertia factor.
[0052] Particle swarm algorithm update formula:
[0053] v i =v i +c1×rad()×(pbest i -x i )+c2×rand()×(gbest i -x i )
[0054] x i =x i +v i
[0055] Where i represents the total number of particles; v i Represents the speed of the particle; Rand(): a random number between 0 and 1; x i represents the current position of the particle; c1 and c2 refer to learning factors.
[0056] The specific method of step seven in the above scheme is:
[0057] Step 1: Classify the pixels of the microscopic image using random forest classification to establish a random forest classification model;
[0058] The random forest classification model (G(x)) is:
[0059]
[0060] Where I(x) is the indicative function; C is the classification label; {L i} is an independent and identically distributed random vector;
[0061] Step 2: Create a synthetic image of the droplet motion trajectory; based on the relative positions of the droplets and aggregates in the original image at different times, all the extracted images of droplets and aggregates at different times are integrated into one image to intuitively display the complete change process of the position and morphological structure of the droplets and aggregates over time;
[0062] Step 3: Binarize the image. Use the maximum entropy threshold segmentation algorithm to calculate the corresponding optimal threshold and perform threshold segmentation to obtain a binary image. Perform the following operations:
[0063] Assume that the size of the selected image or its sub-region I is M×N, the gray level is L, and the gray range is {0, 1, 2, ..., L-1}, then the probability of the gray level i (0<i<L-1) appearing in the image is as follows:
[0064]
[0065] Among them, h(i) represents the number of pixels with gray level i in the image;
[0066] Assuming that the image threshold is T (0<T<L-1), the pixels with grayscale less than T constitute the target area A, and the pixels with grayscale greater than T constitute the background area B. The probability of each grayscale in the two types of areas is shown as follows:
[0067]
[0068] in P A (T) and P B (T) represents the cumulative probability of pixels in area A and background area B when T is the threshold.
[0069] The entropy function corresponding to the target area and the background area under the threshold T is shown as follows:
[0070]
[0071] At this time, the total entropy of image I is H I (T) = H A (T)+H B (T);
[0072] T * = arg max[H I (T)];
[0073] The total entropy H of image I under all segmentation thresholds I The maximum value of (T) is the maximum entropy, and the threshold corresponding to the maximum entropy is the optimal threshold T * ;
[0074] Step 3: Threshold image stitching: stitch all the binarized images processed in step 3 according to their original positions to obtain the final threshold segmentation image.
[0075] The present invention has the following beneficial effects:
[0076] (i) The present invention realizes in-situ microscopic observation of crude oil emulsion under the action of shear flow field through an in-situ microscopic observation device, thereby providing the necessary conditions for in-depth study of the influence of shear rate on droplet morphology and dynamic behavior, forming a method for regulating the behavior of microscopic droplets by shear rate, and further optimizing the study of the dynamic behavior of microscopic droplets.
[0077] (ii) The present invention can obtain the microscopic images of droplets and droplet clusters in situ, accurately and effectively while applying external forces such as shear to the oil sample without changing the microscopic structure of the droplets, and intuitively obtain the real microscopic morphology, movement behavior, spatial distribution and structural dynamic changes of the droplets.
[0078] (III) The present invention proposes a method for clarifying the microscopic image of crude oil emulsion by reducing noise and optimizing contrast, which can greatly improve the clarity of the obtained droplet image, make the identified droplet edge contour more accurate, and make the differences between the droplet microstructures, the interactions between the droplets, the movement behavior, etc. more fully reflected.
[0079] (IV) The present invention proposes an optimization algorithm for global multi-level threshold segmentation of crude oil emulsions. Combined with manual re-inspection, the number of algorithm thresholds is continuously corrected to seek the optimal solution for threshold segmentation, which accelerates the quantitative characterization of the structural characteristic parameters and kinetic parameters of microscopic droplets and provides a new idea for the microscopic analysis of emulsion droplets.
[0080] (V) The present invention proposes a pixel classification and image segmentation method for droplet images, and through quantitative identification of threshold segmented images, scientifically and effectively proposes characteristic parameters that characterize the microscopic characteristics and dynamic behavior of the microscopic droplets and their aggregate structures, thereby achieving quantitative characterization of the microscopic motion, spatial distribution and structural dynamic changes of droplet particles.
[0081] (VI) The microscopic image processing and quantitative identification method proposed in the present invention can be used to analyze the microscopic mechanism of the complex rheological properties of crude oil emulsions from the perspective of the dynamic behavior of microscopic droplets, thereby providing new ideas and research and analysis methods for the study of complex rheological properties of crude oil emulsions.
[0082] (VII) The droplet motion trajectory and droplet uniformity BP neural network prediction model proposed in the present invention can make certain predictions on the complex rheological behavior of crude oil emulsions and guide actual production and life, thereby providing a new research and analysis method for the microscopic droplet behavior of crude oil emulsions.
[0083] (VIII) Based on the microscopic morphology video of droplets in crude oil emulsion under shearing action taken by the device, the present invention constructs a set of methods including video segmentation, frame-by-frame processing, image optimization processing, pixel classification and threshold segmentation, as well as quantitative characterization and prediction of the microscopic motion, spatial distribution and structural dynamic change behavior of droplets in the image, thereby achieving quantitative analysis of the microscopic motion behavior and structural dynamic change of droplets in crude oil emulsion under shearing action, and predicting the microscopic behavior of droplets by constructing a mathematical model of droplet dynamics neural network, providing microscopic data for revealing the generation mechanism of complex rheological properties of crude oil emulsion.
[0084] (IX) The observation device involved in the present invention applies a certain shear force to the experimental sample, and uses the microscopic observation device to perform in-situ microscopic photography of the experimental sample to obtain an in-situ microscopic video of the experimental sample. The actual application results show that the device can obtain the microscopic morphological changes and movement behaviors of the internal droplets of the crude oil emulsion when it is subjected to shear, and the evolution law of the microscopic behavior of the emulsion droplets under different conditions can be obtained through the sample temperature control module and torque sensing module equipped with the device. On this basis, an analysis method for image extraction, image optimization, image pixel classification, and quantitative identification of droplets from microscopic videos is proposed, and the quantitative parameters of the microscopic behavior of droplets under different shear conditions are obtained. A neural network model is established for it to predict the dynamic behavior of microscopic droplets, which can quantitatively analyze the microscopic mechanism of the complex rheological properties of crude oil emulsions.
[0085] (10) The present invention relates to the safety and economy of the process of transporting, processing, separating and purifying the emulsion formed in the process of crude oil extraction, storage and gathering. It describes the microscopic dynamic behavior of the emulsion droplets of crude oil emulsion under different shear rates and different temperatures from a microscopic scale, and solves the technical difficulties that the dynamic behavior of the emulsion droplets of crude oil emulsion under different shear rates is difficult to characterize and the structural characteristics are unclear, resulting in safety hazards in the storage, transportation, heating, temperature reduction and other processes of crude oil emulsion, and the flow safety characteristics are difficult to ensure. It provides theoretical guidance for ensuring the economic safety of crude oil pipeline transportation, heating, storage, etc. Description of the drawings:
[0086] Figure 1 : It is a schematic diagram of the in-situ microscopic observation device in the present invention.
[0087] Figure 2 : It is a schematic diagram of the structure of the driving and detection modules in the present invention.
[0088] Figure 3 : is a structural schematic diagram of the microscopic viewing angle moving module of the present invention.
[0089] Figure 4 : The original image of the experiment obtained through frame-by-frame processing.
[0090] Figure 5 : This is the effect picture after color matching of the original image.
[0091] Figure 6 :For Figure 5 The effect image after adjusting brightness and contrast.
[0092] Figure 7 :For Figure 6 The effect of bilateral filtering.
[0093] Figure 8 :For Figure 7 Effect diagram of image information enhancement.
[0094] Fig. 9 :for Figure 7 and Figure 8 The effect picture after superposition.
[0095] Fig.10 : This is the effect diagram obtained by random forest pixel classification.
[0096] Fig.11 : Rendering of the extracted microscopic droplets or aggregates.
[0097] Fig.12 : Motion sequence images of selected microscopic droplets and aggregates.
[0098] Fig.13 :For Fig.12 The effect after block threshold segmentation.
[0099] Fig.14 : To obtain the final threshold segmentation image by splicing all threshold segmentation images.
[0100] Fig.15 : It is the motion trajectory diagram of microscopic droplets and their aggregates.
[0101] Fig.16 : Quantitative characterization curve of fractal dimension of microscopic droplets and their aggregates.
[0102] Fig.17 : Schematic diagram for the definition of droplet microscopic characteristic parameters.
[0103] Fig.18 : Result diagram of droplet dynamics trajectory predicted by neural network model.
[0104] Fig.19 : The result graph of uniformity change predicted by the neural network model.
[0105] Fig. 20 :It is the flow chart of image sharpening processing.
[0106] Fig.21 : Flowchart of machine identification and tracking of droplets for manual re-inspection.
[0107] Fig. 22 : Flowchart for random forest classification of microscopic images.
[0108] Fig.23 : Flowchart for the neural network model predicting droplet dynamics behavior.
[0109] In the figure: 1 torque sensing module 2 driving and detection module 3 sample carrying module 4 sample container disassembly device 5 sample temperature control module 6 constant temperature water bath 7 circulation pipeline 8 microscopic viewing angle moving module 9 microscopic observation module 10 guide frame structure 11 bracket structure 12 shadowless cold light source. Specific implementation method:
[0110] The present invention will be further described below in conjunction with the accompanying drawings:
[0111] This quantitative characterization and prediction method for the microscopic dynamic behavior of droplets in crude oil emulsions is used for the initial cooling temperature of 70°C, the observation temperature of 40°C, and the shear rate of 1s -1 The video taken under the conditions is subjected to video segmentation, frame-by-frame processing, image optimization processing, image pixel classification and threshold segmentation, as well as quantitative characterization of the droplet microscopic motion, spatial distribution and structural dynamic change behavior in the image, as follows:
[0112] S1, oil sample pretreatment. In order to eliminate the influence of factors such as thermal history and shear history on the physical properties of oil samples and improve the accuracy of experimental results. First, the oil samples are packaged and pretreated. The oil samples are packaged into sealed ground-mouth bottles, and then placed in a constant temperature water bath, heated to 80°C, and kept at a constant temperature for 2 hours, so that the crude oil in the bottle can reach a uniform state by the thermal motion of molecules, and then left to stand, naturally cooled to room temperature, and stored in a place where the ambient temperature changes little for at least 48 hours.
[0113] S2, preparation of crude oil emulsion. Before preparing the emulsion, heat the oil sample to 70°C and keep it at a constant temperature for 2 hours. After the oil sample is fully heated and the wax crystals are completely melted, mix the oil sample with a corresponding volume of pure water prepared in advance at the preparation temperature and stir for 15 minutes, during which the stirring speed is controlled to be constant at 1000 rpm.
[0114] S3, experimental preparation. Before the experiment, the sample holding module of the in-situ microscopic observation device is heated to the initial cooling temperature of the experiment, and then the sample is transferred to the sample holding module of the in-situ microscopic observation device, the oil sample is kept at a constant temperature for 10 minutes, and then the oil sample is cooled to the predetermined experimental temperature at a cooling rate of 0.5°C / min.
[0115] S4, microscopic video shooting. With the help of the independently developed in-situ microscopic observation experimental device, the microscopic movement and structural changes of droplets in crude oil emulsion were filmed in situ.
[0116] S5, microscopic video extraction. According to the predetermined research plan and experimental purpose, the captured video is globally previewed. According to the measured system temperature change and rheological results, several key video segments that can reflect the microscopic motion and structural dynamic changes of the droplets are selected, and video processing software such as PR and VideoStudio are used to extract them from the original video for subsequent analysis.
[0117] S6, frame-by-frame processing of microscopic video. For the selected key video segments, manually select video clips with high shooting quality, clear droplet boundary outline, complete motion cycle, and obvious motion behavior characteristics as representative key analysis objects. For the video segments containing key analysis objects, frame-by-frame extraction is performed according to the minimum frame rate of the video to obtain the droplet dynamic sequence image. As shown in the attached figure Figure 1 shown.
[0118] S7, microscopic image preprocessing. Perform some preprocessing on the microscopic image to make the edge contour of the droplet clearer. Perform the following operations:
[0119] 1. Color matching of microscopic images. The droplet microscopic image obtained in S6 is color matched, and the original image is color matched. Through the processing, the background color and the droplet color are obtained, and the microscopic image with the same color mode is obtained. Figure 2 As shown:
[0120] 2. Adjust the overall image brightness and contrast. Perform the following operations on the image:
[0121] g(i, j) = αf(i, j) + β
[0122] Where α is the contrast coefficient, which makes the pixel darker when it is less than 1 and brighter when it is greater than 1; β is the brightness gain variable.
[0123] 3. Remove image noise. Perform the following operations on the image:
[0124] Bilateral filtering is a nonlinear filtering method that considers both spatial information and grayscale similarity to achieve edge-preserving denoising.
[0125] Bilateral filter, the filter kernel is generated by two functions: one function determines the coefficient of the filter template by the Euclidean distance of the pixels; the other function determines the coefficient of the filter by the grayscale difference of the pixels.
[0126] The bilateral filter uses a two-dimensional Gaussian function to generate a distance template and a one-dimensional Gaussian function to generate a range template. The formula for generating the distance template coefficient is as follows:
[0127]
[0128] Where (k, l) is the center coordinate of the template window; (i, j) is the coordinate of other coefficients of the template window; σ d The standard deviation of the Gaussian function used to generate the distance template coefficients.
[0129] The formula for generating the range template coefficient is as follows:
[0130]
[0131] Among them, the function f(x, y) represents the image to be processed, (k, l) is the center coordinate of the template window; (i, j) is the coordinate of other coefficients of the template window; σ r The standard deviation of the Gaussian function used to generate the range template system.
[0132] Multiplying the above two templates gives the template of the bilateral filter:
[0133]
[0134] 4. Image information enhancement: perform the following operations on the image:
[0135] For a two-dimensional image f(x, y), the second-order differential Laplace operator is defined as:
[0136]
[0137] Because we want to emphasize the details in the image, the smooth grayscale area has no response, that is, the sum of the template coefficients is 0.
[0138] Finally, the value of each pixel can be calculated as follows:
[0139]
[0140] Where g is the output pixel value, f(x, y) is the original pixel value, and c is the coefficient mathematics.
[0141] S8, machine target recognition and tracking. Establish a machine recognition droplet algorithm model:
[0142] 1. Target feature extraction. Extract image texture features, edge features, grayscale histogram, image transformation coefficients and other features. The selection of target features needs to consider the type of target and the background in which the target is located.
[0143] 2. Target feature matching. The target features and target droplets are matched based on the absolute balance algorithm to obtain the matching relationship between the target features and the droplets. This is achieved based on the following algorithm:
[0144]
[0145] Where T(m, n) is the grayscale value of the template image, m and n represent the size of the template image, and F(m, n) i,j is a window image with point (i, j) as the reference point on the image to be matched and the same size as the template image, and T is the threshold.
[0146] 3. Perform multi-threshold Otsu segmentation on the global sequence image to track the droplets. When Otsu threshold multi-threshold segmentation is used, multiple different thresholds are used to segment the image into multiple different regions or targets. The principle is as follows:
[0147] Assume that the image size is M×N, the image grayscale range is [0, L-1], n i is the number of pixels of gray level i in the image, and the probability of gray level i appearing is: p i =n i / (M×N). Assume there are n-1 thresholds T1, T2, ...T n-1 The image is divided into n categories, represented by C0 = {0, 1, .... T1}, C n ={T n-1 +1, T n-1 +2,...L-1}, the probability of each category appearing is P0, P1,..., P n-1 , the variance is expressed as The mean is u0, u1, ...u n-1 .
[0148] in, Where k = 0, 1, ..., n-1; T0 = 0, T n =L. Then the inter-class variance of the image is expressed as:
[0149] Multi-level optimal segmentation threshold:
[0150] Fourth, optimize the parameters of Otsu multi-threshold segmentation method. The optimal threshold solution function is:
[0151] According to the above scheme, the required number of thresholds is set and optimized by particle swarm algorithm. Particle swarm optimization algorithm (PSO) was first used to study bird predation. The core is that individuals in the group obtain information of the entire group, so that the motion solution evolves from disorder to order in the entire space, thus obtaining the optimal solution to the problem.
[0152] The standard form of the particle swarm optimization (PSO) is as follows:
[0153] v i =w×v i +c1×rand()×(pbest i -x i )+c2×rand()×(gbest i -x i )
[0154] Among them, w i is a non-negative value called the inertia factor.
[0155] Particle swarm algorithm update formula:
[0156] v i =v i +c1×rad()×(pbest i -x i )+c2×rand()×(gbest i -x i )
[0157] x i =x i +v i
[0158] Where i represents the total number of particles; v i Represents the speed of the particle; Rand(): a random number between 0 and 1;
[0159] x i represents the current position of the particle; c1 and c2 refer to learning factors.
[0160] The particle swarm optimization algorithm process is as follows:
[0161] Step 1: Define the problem and randomly initialize each particle; initialize the speed, position, learning factor, inertia weight and other parameters of each particle;
[0162] Step 2: Evaluate each particle and make it reach the global optimal solution;
[0163] Step 3: Determine whether the convergence condition is met. If converged, end the operation. If not converged, update the particle speed and position;
[0164] Step 4: Evaluate the function fitness of particle motion, update the historical optimal position of the particle, and update the global optimal position of the group;
[0165] Step 5: Repeat steps 2 and 3 until the results converge and the calculation is completed.
[0166] S9, randomly sampling the target features according to the result of the target feature matching of the above scheme, randomly sampling a number of micro droplets, recording their feature points and finding their corresponding micro droplets.
[0167] S10, manually track the droplets sampled in the above step and extract microscopic characteristic parameters. Perform the following operations:
[0168] 1. Microscopic image pixel classification. Due to the particularity of crude oil emulsion microscopic images: the water phase is transparent, the oil phase has a certain color, and it is difficult to capture the water phase alone. The oil-water interface will adsorb colloids, asphaltene and other substances, which have a darker color and are easy to identify. However, due to the unclear physical and chemical properties of the interface film, it is difficult to directly obtain droplets through threshold segmentation. The classification algorithm is used to classify the microscopic image pixels, which is convenient for subsequent droplet identification and threshold segmentation. As shown in the attached figure Figure 7 shown.
[0169] Random forest classification is a combined classifier algorithm. The model is composed of multiple weakly supervised models. The weakly supervised models are decision tree models. Each model performs well only in each direction. Each model randomly selects features to split the internal nodes according to a certain splitting criterion until the termination condition is reached. Therefore, the random forest algorithm has good classification performance and noise resistance.
[0170] The random forest classification algorithm used here can be expressed as follows:
[0171] (1) Microscopic image feature extraction:
[0172] Mean, Variance, Median, Minimum, and Maximum features refer to performing relevant operations (mean / minimum, etc.) on pixels within a radius of σ pixels from the target pixel and setting the target pixel to that value.
[0173] Gabor features can be used to reflect the texture information of images. The texture information of different droplet microscopic images is often different, and it is an important basis for image segmentation.
[0174] The Hessian feature is used to describe the edge information of the image, describing the change of gray gradient in each direction. The Hessian matrix is defined as:
[0175]
[0176] Where: I xx and I yy is the second-order partial derivative in the X and Y directions, I xy is the second-order partial derivative in the XY direction.
[0177] The Neighbors feature is to translate the image by a certain number of pixels in 8 directions, thus creating 8*n feature images.
[0178] Robert features provide edge information of the image.
[0179] (2) Microscopic image feature training:
[0180] The training process of random forest is to build a series of decision trees by learning a set of labeled data samples in a random form. The process of training each tree is to build a series of nodes, the purpose of which is to maximize a certain measurement index obtained after splitting. This measurement index can be information gain rate, entropy gain or Gini index. Entropy gain is selected as the measurement index here. The calculation formula of entropy is as follows:
[0181]
[0182] Where p represents the probability of different categories at the current node;
[0183] Entropy gain: (the sum of the entropy of the previous layer minus the entropy of the current layer) is mathematically expressed as the change in entropy; in the decision tree model, it is expressed as the entropy of the root node minus the sum of the entropies of all child nodes under the current conditions.
[0184] If the decision condition of a node leads to the maximum information gain, then it must be the most suitable decision condition for the current node.
[0185] The entropy gain is calculated as follows:
[0186]
[0187] Among them, G(D) represents the entropy gain; H(X) represents the entropy of the previous layer;
[0188] The random forest classification model is further established through the above model.
[0189] The formula of the random forest classification model (G(x)) is:
[0190]
[0191] Where I(x) is the indicative function; C is the classification label; {L i} are independent and identically distributed random vectors.
[0192] 2. Create a composite image of the droplet motion trajectory. After the above steps, the single image only contains the microscopic morphology of the droplets or aggregates at a certain moment. In order to fully reflect the motion trajectory of the droplets or aggregates and the change process of their microscopic morphology over time, according to the relative positions of the droplets and aggregates in the original images at different moments, all the images of the droplets and aggregates extracted at different moments are integrated into one picture, which intuitively shows the complete change process of the position and morphological structure of the droplets and aggregates over time.
[0193] 3. Image binarization. In order to ensure the accuracy of threshold segmentation, the entire image is divided into a certain number of sub-regions according to the distribution of light intensity on the image. According to the actual grayscale distribution of each sub-region, the maximum entropy threshold segmentation algorithm is used to calculate the corresponding optimal threshold and perform threshold segmentation to obtain a binary image. Perform the following operations:
[0194] Assume that the size of the selected image or its sub-region I is M×N, the gray level is L, and the gray range is {0, 1, 2, ..., L-1}, then the probability of the gray level i (0<i<L-1) appearing in the image is as follows:
[0195]
[0196] Among them, h(i) represents the number of pixels with gray level i in the image;
[0197] Assume that the image threshold is T (0<T<L-1), the pixels with grayscale less than T constitute the target area (area A), and the pixels with grayscale greater than T constitute the background area (area B). The probability of each grayscale in the two types of areas is shown as follows:
[0198]
[0199] in and P B(T) represents the cumulative probability of pixels in area A and B when T is the threshold.
[0200] According to the entropy solution formula The entropy function corresponding to the target area and the background area under the threshold T is shown as follows:
[0201]
[0202] At this time, the total entropy of image I is H I (T) = H A (T)+H B (T).
[0203] T * = arg max[H I (T)];
[0204] The total entropy H of image I under all segmentation thresholds I The maximum value of (T) is the maximum entropy, and the threshold corresponding to the maximum entropy is the optimal threshold T * .
[0205] 4. Threshold image stitching: All threshold images obtained by the above steps are stitched together according to their original positions to obtain the final threshold segmentation image.
[0206] S11, feature parameter extraction. The threshold sequence images obtained in S8 and S10 are quantitatively characterized by the microscopic droplet feature parameters: based on the ratio of the observed field of view size to the threshold image resolution, the microscopic feature parameters of the droplets and their aggregates are analyzed to quantitatively characterize the dynamic changes in the microscopic motion, spatial distribution and structure of the droplets and their aggregates.
[0207] Characteristic parameters of microscopic droplet motion:
[0208] (1) Droplet motion trajectory: A color map is used to establish a functional relationship between the coordinates of the droplet in the flow field and time, and the image of the droplet motion trajectory is obtained by visually displaying it in a rectangular coordinate system. The specific format is shown in the attached figure. Fig.15 The droplet motion trajectory diagram reflects the motion direction of the droplet and the coordination between the droplet motion and the flow field.
[0209] (2) Average droplet velocity: The droplet’s displacement in the corresponding time period is calculated by the change in its position at two adjacent moments. The average droplet velocity in this period is obtained by dividing this value by time. This value can characterize the droplet’s microscopic motion state and also reflects the droplet’s position in the flow field. Generally, the closer the droplet is to the rotation plane, the faster it moves.
[0210] (3) Average droplet motion acceleration: The droplet position change at two adjacent moments is used to calculate its motion displacement in the corresponding time period. The average velocity of the droplet in this period of time can be obtained by dividing this value by the square of time. This value can characterize the microscopic motion state of the droplet and also reflect the velocity of the droplet in the flow field.
[0211] (4) Angle θ between the velocity direction of the droplet cluster and the flow field direction: This parameter represents the direction and morphological characteristics of the droplet movement, and reflects the orientation of the droplet cluster movement to the flow field. The smaller the value, the more the droplet cluster adapts to the flow field, the more significant its orientation to the flow field, and the smaller its resistance to the flow field. The specific pattern is shown in the attached figure. Fig.17 (a) shown.
[0212] (5) Standard deviation of the angle θ between the droplet velocity direction and the flow field direction: The smaller the value, the more consistent the movement direction of the droplets in the image and the more regular the arrangement, which reflects the higher the synergy between the droplet movement and the flow field.
[0213] (6) Aspect ratio of droplet clusters: The larger the value, the more consistent the movement direction of the droplet cluster is with the flow field direction, which reflects the higher the coordination between the movement of the droplet cluster and the flow field.
[0214] Spatial distribution parameters include:
[0215] (1) Average edge spacing of droplets: When determining this parameter, first calculate the center distance of different droplet clusters based on the center coordinates of different droplet clusters, then calculate the average center distance of all droplet clusters in the image, and then subtract the average particle size of all droplets in the image from the center distance to approximate the average edge spacing of all droplets in the image. The definition of droplet center distance is as shown in the attached figure. Fig.17 (c) The average edge spacing of droplets reflects the overall distribution of droplets in the image. The smaller the value, the more compact the distribution of droplets, the stronger the interaction between droplets, and the more significant the influence between droplets.
[0216] (2) Approximate coordination number and average coordination number of droplets: For a droplet in the field of view, the total number of its adjacent microscopic droplets is the approximate coordination number of the microscopic droplet. The average of the approximate coordination numbers of all droplets in the image is the average coordination number of the droplets, which represents the frequency of mutual contact between droplets in the image. The larger the value, the more contact between droplets, and the more significant their interaction and influence.
[0217] (3) Uniformity of droplets and droplet clusters: For a certain field of view, the number and area ratio of droplets are limited and have certain regularities. The droplet uniformity U can be used to well represent the uniformity of droplet distribution in the observation field of view. The specific method is to divide the observation field of view into N grids evenly, measure the droplet area ratio of each grid, or observe N random fields of view for quantitative calculation. The larger the value, the greater the resistance of the droplets to the flow of the system and the stronger the interaction between the droplets.
[0218] The structural dynamic change parameters include:
[0219] (1) The gradient of the droplet aspect ratio over time; the definition of the droplet aspect ratio is as follows Fig.17 As shown in (b), the elliptical structure just surrounds the droplet cluster, and the ratio of the long axis to the horizontal axis of the elliptical structure is the aspect ratio of the droplet cluster. The larger the aspect ratio, the greater the possibility of the droplet cluster being stretched, and the smaller its resistance to the flow field. The gradient of the change of the aspect ratio of the droplet cluster over time can quantitatively characterize the degree of shape change of the droplet cluster under external conditions such as shear.
[0220] (2) The gradient of the change of the average center distance of microscopic droplets in the aggregate over time; droplet aggregates are easily affected by the flow field and change their structure. They may frequently decompose and reorganize, and the aggregates will also undergo changes in overall structure and morphology under the action of the flow field. These changes can be reflected by the change of the average center distance of droplets in the aggregate over time. If this value increases, it means that the droplet aggregate may decompose or gradually spread out. A decrease in this value indicates that the droplet aggregate structure has shrunk and become denser and more compact. The greater the gradient of the change of the average center distance of droplets in the aggregate over time, the more frequently the aggregate structure changes, the more unstable its structure is, and the weaker the connection strength between internal droplets, and vice versa.
[0221] (3) The gradient of the change of the number of droplets in the aggregate over time: When the droplet aggregate aggregates aggregate and decompose, the number of droplets inside it also changes. The gradient of the change of this number over time can represent the tendency of the droplet aggregate structure to change. The larger the value, the more unstable the droplet aggregate structure is and the more frequent the changes. The rolling motion of the droplet aggregate in the field of view may also cause the observed number of droplets in the aggregate to change. At this time, the gradient of this value can represent the significance of the droplet (cluster) rolling motion.
[0222] (4) The gradient of the fractal dimension of droplets and aggregates over time. Add the definition and diagram of fractal dimension. The fractal dimension of droplets and aggregates is calculated by box counting method. The calculation steps are as follows: for a given threshold image, fill the microscopic droplets and aggregates in the threshold image with small boxes with a side length of ε to obtain the number of small boxes N(ε). As the box size ε decreases, N(ε) gradually increases. In double logarithmic coordinates, a curve graph is obtained with Inε as the horizontal coordinate and InN(ε) as the vertical coordinate. The slope k of the curve graph is the fractal dimension of the droplets in the image. The fractal dimension can be used to characterize the nonlinearity and complexity of the morphology of droplets and their aggregates. The gradient of this value over time reflects the tendency and frequency of change of the shape of the droplet cluster over time. The larger the value, the easier it is for the droplet cluster to change its shape under the influence of various factors.
[0223] S12, compare the manually tracked microscopic droplet trajectory, extracted characteristic parameters and the machine tracked microscopic droplet trajectory, extracted characteristic parameters, use the difference method to check the error rate, if the error rate is greater than 10%, analyze the cause of the error, and modify the parameters such as the number of thresholds, particle swarm optimization algorithm learning factor, inertia factor, etc. according to the cause of the error, until the machine recognition effect and the manually extracted tracking error are kept within a smaller range. Then extract and produce the motion sequence image of the microscopic droplet. As shown in the attached figure Fig.15 shown.
[0224] S13, the droplet microscopic dynamic parameters obtained by quantitative identification in S11 are studied, and the droplet trajectory, droplet uniformity and other dynamic parameters of the droplet are predicted by constructing a neural network mathematical model.
[0225] 1. Predict the motion trajectory of the droplet:
[0226] According to the above scheme, a large number of droplet trajectories are captured, and different proportions of the trajectories of different droplets at different times and different shear rates are taken as training sample sets. A BP neural network model is constructed and trained to obtain a droplet trajectory prediction model, which is used to predict the trajectories of different droplets and compared with the trajectories of the droplets actually captured after being processed by the above scheme. The model obtained by the BP neural network is continuously iterated and corrected until its prediction error is reduced to a certain value.
[0227] The advantage of the BP neural network is that it can correct errors based on experimental values, perform error analysis based on the training results and actual results, and then correct the weights and thresholds of each hidden layer to minimize the sum of square errors of the network model, and gradually obtain a model consistent with the experimental results.
[0228] The neural network model is described as follows:
[0229] (1) Before data enters the network, it is first normalized to avoid gradient explosion and to converge to an accurate model better and faster;
[0230] (2) Forward propagation: The input sample enters the network, passes through the calculation of each layer in turn, and obtains the result of the final output layer. If the actual output of the output layer does not match the expected output, it will enter the error back propagation stage;
[0231] The matrix operation from the input layer to the hidden layer is as follows: H = X × W1 + b1;
[0232] The matrix operation from the hidden layer to the output layer is as follows: Y = H × W2 + b2;
[0233] Among them, the weight W is the proportion of each hidden unit participating in the calculation process, and the threshold b is a value of each node itself. This threshold is to make the network approach a real relationship faster and more realistically;
[0234] (3) Backward propagation: The error is propagated backwards. The error will be apportioned to each hidden layer unit. Each unit will make an adjustment signal to the error. This signal serves as the basis for correcting the weights and thresholds of each unit.
[0235] (4) Repeat forward propagation and backward propagation continuously, continuously update weights and thresholds, and monitor changes in the loss function until the error between the calculated result and the true result is less than a certain range; the loss function represents the error between the true result and the calculated result. The process of neural network model training is to continuously adjust the weights and thresholds to make the network calculation results as close to the true results as possible.
[0236] 2. Predict the uniformity of droplets in the entire emulsion system:
[0237] According to the above experimental scheme, a constant shear rate is applied to the experimental sample, the microscopic observation field is fixed, the uniformity of the droplets in the field of view is monitored, and the change of the droplet uniformity with shear time is observed.
[0238] The formula for calculating the uniformity of the droplets is as follows:
[0239]
[0240] In the formula, A i is the area ratio of the droplet in the i-th grid; is the average droplet area ratio; N is the number of grids.
[0241] The specific method is to evenly divide the microscopic image into N grids, and obtain the droplet area of each grid according to the above analysis method.
[0242] The uniformity coefficients at different times under a fixed field of view are calculated, and a BP neural network model is established and trained to obtain a model for the uniformity change of the emulsion droplets, and to predict the uniformity change of the system. The uniformity at different times is predicted using this model, and compared with the uniformity obtained by processing the actual microscopic images with the above scheme, and the model obtained by the BP neural network is continuously iterated and corrected until its prediction error is reduced to a certain value.
[0243] The in-situ microscopic observation device in the present invention includes a sample temperature control module 5, a driving and detection module 2, and a sample carrying module 3, all of which are made of transparent materials; the bottom of the sample carrying module 3 is detachably fastened to the sample container disassembly device 4 set on the support structure 11; the sample temperature control module 5 is connected to the constant temperature water bath 6 through a circulation pipeline 7 to ensure the accuracy of temperature control; the torque sensing module 1 is connected to the driving and detection module 2, the driving and detection module 2 enters the sample from above the experimental sample, and can rotate at a certain rate, thereby applying a certain shear force to the inside of the sample, so that a shear flow field is generated inside the sample; the driving and detection module 2 moves up and down through the guide frame structure 10; a shadowless cold light source 12 is embedded in the surface of the driving and detection module, which can strengthen the microscopic light source and improve the microscopic observation effect; the microscopic observation module 9 has a polarization function and can switch between natural light and polarized light. It is located on the side of the sample carrying module 3, and its built-in light source can observe the microscopic behavior changes of droplets inside the experimental sample in situ from the side. The microscopic observation module 9 is connected to a high-speed CCD camera, which is connected to a computer, and can take microscopic images and videos and display them on the computer; the microscopic observation module 9 is arranged on the microscopic viewing angle moving module 8, and can adjust the position of the microscope lens to make it close to or away from the sample, or move the microscope horizontally or vertically, so as to take microscopic structural images of different liquid layers and different positions in the sample; the microscopic observation module obtains the microscopic dynamic characteristics of the droplets by photographing the microscopic behavior changes of the droplets in the crude oil emulsion under shearing. The support structure 11 has a square groove, and the microscopic viewing angle moving module 8 is arranged in the square groove.
[0244] The driving and detection modules, sample holding module and sample temperature control module are all made of transparent quartz glass, which allows light to pass freely, facilitating microscopic observation of the microstructure inside the sample and the dynamic behavior of the droplets.
[0245] A shadowless cold light source 12 is embedded in the inner layer of the surface of the driving and detection module, which can directly illuminate the sample and be observed by the microscope in the form of projected light; the microscope itself is integrated with an LED light source, which can illuminate the sample in another direction and be observed by the microscope in the form of reflected light; therefore, since there are light sources on both sides of the sample, a multi-angle composite light source is constructed to illuminate the sample, and the transmission microscopy and reflection microscopy observations are integrated into one, which can significantly improve the shooting quality of the microscopic image, making the captured droplet microstructure more comprehensive, and the detailed information of its different structural parts, especially the three-dimensional structure information of the droplet can be better observed.
[0246] The torque sensing module applies a certain shear force to the inside of the fluid by transmitting torque to the driving and detection modules, and some macro data such as the flow resistance of the fluid system can be measured through the torque sensing module.
[0247] The in-situ microscopic observation device of the present invention is used to solve the existing problem that the dynamic microscopy of the test sample cannot be directly observed; quantitative identification and analysis of emulsion droplets are performed on the observed dynamic microscopic video; the microscopic dynamics of the droplets are studied, and the dynamic behavior of the droplets is predicted by constructing an algorithm model.
[0248] Experimental methods of this in situ microscopic observation device:
[0249] 1. Using the sample temperature control module to heat the sample holding device to a predetermined temperature;
[0250] 2. Take a small amount of experimental samples and place them on the sample holding module, and lower the driving and detection modules;
[0251] 3. Turn on the shadowless cold light source inside the microscopic observation device and the driving and detection modules;
[0252] Fourth, the experimental samples are sheared by the driving and detection modules, and at the same time, the microscopic observation device performs in-situ microscopic observation of the experimental samples to obtain microscopic dynamic videos.
[0253] The present invention proposes a microscopic video processing scheme based on the microscopic observation video captured by the device, the purpose of which is to quantitatively characterize the microscopic morphological changes and movement behaviors of emulsion droplets in crude oil emulsions, and provide quantitative analysis for the microscopic mechanism of the complex rheological properties of crude oil emulsions.
Claims
1. A method for quantitatively characterizing and predicting the microscopic dynamic behavior of droplets in crude oil emulsions, characterized in that The steps include: Step 1: Microscopic video shooting: Under the premise of controlling the shear rate and temperature drop rate applied to the crude oil sample, shoot the video of the microscopic movement and structural changes of the droplets in the crude oil emulsion; Step 2: Extraction of microscopic video: Select several key video segments that can reflect the microscopic morphology, aggregation movement and collision behavior of droplets and extract them from the original video; Step 3: Process the microscopic video frame by frame to obtain a dynamic sequence image of the droplet; Step 4: Preprocess the microscopic image to make the edge contour of the droplet clearer; Step 5: Machine target recognition and tracking: Establish a machine recognition droplet algorithm model, perform target feature matching, recognize and track droplets in the entire field of view, establish multi-threshold Ostu segmentation for the global image, and use the particle swarm optimization algorithm to optimize the multi-threshold Ostu segmentation; Step 6: Target feature matching results: Randomly sample the target features, randomly sample a number of microscopic droplets, record their feature points and find their corresponding microscopic droplets; Step 7: Manually track the droplets sampled in step 6 and extract microscopic characteristic parameters to obtain a threshold sequence image; Step 8: Extract characteristic parameters, quantitatively characterize the microscopic droplet characteristic parameters of the threshold sequence images obtained in steps 5 to 7: After processing, the threshold images of droplets and their aggregates are obtained, and based on the ratio of the observed field of view size to the threshold image resolution, the microscopic characteristic parameters of the droplets and their aggregates are analyzed to quantitatively characterize the dynamic changes of the microscopic motion, spatial distribution and structure of the droplets and their aggregates; Step nine, comparing the microscopic droplet trajectory and extracted characteristic parameters tracked manually with the microscopic droplet trajectory and extracted characteristic parameters tracked by the machine, and using the difference method to check the error rate; Step 10: Analyze the droplet microscopic dynamic parameters obtained by quantitative identification, and predict the dynamic behavior of the droplet by constructing a mathematical model; Step 1: Predict the motion trajectory of the droplet: Based on the captured trajectories of a large number of droplets, different proportions of the trajectories of different droplets at different times and different shear rates are taken as training sample sets, and a BP neural network model is constructed to train it to obtain a droplet trajectory prediction model. The droplet trajectory prediction model is continuously iterated and corrected until its prediction error is reduced to a certain value. Step 2: Predict the uniformity of droplets in the entire emulsion system: Apply a constant shear rate to the crude oil sample, fix the microscopic observation field, monitor the uniformity of the droplets in the field of view, and observe how the droplet uniformity changes with shear time; The formula for calculating the uniformity of the droplets is as follows: In the formula, A i is the area ratio of the droplet in the i-th grid; is the average droplet area ratio; N is the number of grids; The microscopic image is evenly divided into N grids, and the droplet area of each grid is analyzed; Calculate the uniformity coefficient at different times under a fixed field of view, establish and train a BP neural network model, obtain the droplet uniformity change model of the emulsion system, and predict the uniformity change of the system; The model of droplet uniformity change in the emulsion system is continuously iterated and corrected until the prediction error of the model of droplet uniformity change in the emulsion system is reduced to a certain value.
2. The method for quantitatively characterizing and predicting the microscopic dynamic behavior of droplets in crude oil emulsion according to claim 1, characterized in that: The microscopic video shooting of the step 1 is carried out by an in-situ microscopic observation device, which includes a support structure, a sample carrying module, and a driving and detection module; the driving and detection module, the sample carrying module and the temperature control module are all made of transparent quartz glass, the sample carrying module has a sample temperature control module, and the sample temperature control module is connected to a constant temperature water bath through a circulation pipeline; the torque sensing module is connected to the driving and detection module, and a shadowless cold light source is embedded inside the surface of the driving and detection module, and the driving and detection module moves up and down through the guide frame structure; the microscopic observation module has a polarization function, which switches between natural light and polarized light, the microscopic observation module is located on the side of the sample carrying module, the microscopic observation module is connected to a high-speed CCD camera, and the CCD camera is connected to a computer; the microscopic observation module is arranged on the microscopic viewing angle moving module, and the position of the microscope lens can be adjusted to make it close to or away from the sample, or the microscope can be moved in the horizontal or vertical direction, so as to take microscopic structural images of different liquid layers and different positions in the sample; the microscopic observation module obtains the microscopic dynamic characteristics of the droplets by shooting the microscopic behavior changes of the droplets in the crude oil emulsion under shearing; The driving and detection modules directly illuminate the sample and are observed by the microscope in the form of projected light. The microscope itself is integrated with an LED light source, which illuminates the sample from another direction and is observed by the microscope in the form of reflected light. A multi-angle composite light source is constructed to illuminate the crude oil sample, and transmission microscopy and reflection microscopy observations are integrated.
3. The method for quantitatively characterizing and predicting the microscopic dynamic behavior of droplets in crude oil emulsion according to claim 2, characterized in that: The method of microscopic image preprocessing in step 4 is as follows: Step 1, color matching of microscopic images; performing color matching processing on the microscopic image of the droplet obtained in step 3 to obtain a microscopic image in which the background color and the droplet color have the same color mode; Step 2: Adjust the overall image brightness and contrast: g(i,j)=αf(i,j)+β Where α is the contrast coefficient, which makes the pixel darker when it is less than 1 and brighter when it is greater than 1; β is the brightness gain variable; Step 3: Remove image noise by using bilateral filtering. The template of the bilateral filter is: Where: (k, l) is the center coordinate of the template window; (i, j) is the coordinate of other coefficients of the template window; σ d The standard deviation of the Gaussian function used to generate the distance template coefficient; σ r is the standard deviation of the Gaussian function used to generate the range template system; d(i,j,k,l) is the distance template coefficient; r(i,j,k,l) is the range template coefficient; Step 4: Enhance the image information and perform the following operations on the image: For a two-dimensional image f(x, y), the second-order differential Laplace operator is defined as: In the smooth grayscale area, there is no response, that is, the sum of the template coefficients is 0; Finally, the value of each pixel is calculated as follows: Where g is the output pixel value, f(x, y) is the original pixel value, and c is the coefficient mathematics.
4. The method for quantitatively characterizing and predicting the microscopic dynamic behavior of droplets in crude oil emulsion according to claim 3, characterized in that: The specific method of step five is as follows: Step 1: Target feature extraction: extracting the texture features, edge features, grayscale histogram and transformation coefficient features of the image. The selection of target features takes into account the type of target and the background in which the target is located. Step 2: Target feature matching: match the target feature with the target droplet based on the absolute balance algorithm to obtain the matching relationship between the target feature and the droplet, which is implemented based on the following algorithm: Where T(m, n) is the grayscale value of the template image, m and n represent the size of the template image, and F(m, n) i,j is a window image with the same size as the template image, with point (i, j) as the reference point on the image to be matched, and T is the threshold; Step 3: Perform multi-threshold Otsu segmentation on the global sequence image to perform droplet tracking. When performing multi-threshold Otsu segmentation on an image, multiple different thresholds are used to segment the image into multiple different regions or targets. Assuming that the image size is M×N, the image grayscale range is [0, L-1], n i is the number of pixels of gray level i in the image, and the probability of gray level i appearing is: p i =n i / (M×N), assuming there are n-1 thresholds T1, T2, ...T n-1 The image is divided into n categories, represented by C0 = {0, 1, .... T1}, C n ={T n-1 +1,T n-1 +2,...L-1}, the probability of each category appearing is P0, P1,..., P n-1 , the variance is expressed as The mean is u0,u1,...u n-1 ; in, Where k = 0, 1, .., n-1; T0 = 0, T n =L, then the inter-class variance of the image is expressed as: Multi-level optimal segmentation threshold: Step 4: Optimize the parameters of the Otsu multi-threshold segmentation method. The optimal threshold solution function is: The particle swarm optimization algorithm is used to optimize the multi-threshold Ostu segmentation; v i =w×v i +c i ×rand()×(pbest i -x i )+c2×rand()×(gbest i -x i ) Among them, w is a non-negative value, called the inertia factor; Particle swarm algorithm update formula: v i =v i +c i ×rand()×(pbest i -x i )+c2×rand()×(gbest i -x i ) x i =x i +v i Where i represents the total number of particles; v i Represents the speed of the particle; rand(): a random number between 0 and 1; x i represents the current position of the particle; c1 and c2 refer to learning factors.
5. The method for quantitatively characterizing and predicting the microscopic dynamic behavior of droplets in crude oil emulsion according to claim 4, characterized in that: The specific method of step seven is as follows: Step 1: Classify the pixels of the microscopic image using random forest classification to establish a random forest classification model; The random forest classification model (G(x)) is: Where I(x) is the indicative function; C is the classification label; {L i } is an independent and identically distributed random vector; Step 2: Create a synthetic image of the droplet motion trajectory; based on the relative positions of the droplets and aggregates in the original image at different times, all the extracted images of droplets and aggregates at different times are integrated into one image to intuitively display the complete change process of the position and morphological structure of the droplets and aggregates over time; Step 3: Binarize the image. Use the maximum entropy threshold segmentation algorithm to calculate the corresponding optimal threshold and perform threshold segmentation to obtain a binary image. Perform the following operations: Assume that the size of the selected image or its sub-region I is M×N, the gray level is L, and the gray range is {0, 1, 2, ..., L-1}, then the probability of the gray level i (0<i<L-1) appearing in the image is as follows: Among them, h(i) represents the number of pixels with gray level i in the image; Assuming that the image threshold is T (0<T<L-1), the pixels with grayscale less than T constitute the target area A, and the pixels with grayscale greater than T constitute the background area B. The probability of each grayscale in the two types of areas is shown as follows: in P A (T) and P B (T) represents the cumulative probability of pixels in area A and background area B when T is the threshold, respectively; The entropy function corresponding to the target area and the background area under the threshold T is shown as follows: At this time, the total entropy of image I is H I (T) = H A (T)+H B (T); T * =argmax[H I (T)]; The total entropy H of image I under all segmentation thresholds I The maximum value of (T) is the maximum entropy, and the threshold corresponding to the maximum entropy is the optimal threshold T * ; Step 3: Threshold image stitching: stitch all the binarized images processed in step 3 according to their original positions to obtain the final threshold segmentation image.
Citation Information
Patent Citations
Emulsion droplet recognition system and method, computer equipment and storage medium
CN114639101A
Convolutional neural network-based lens-free holographic microscopic particle characterization method
WO2021073335A1