A drilling fluid cuttings segmentation and size estimation method based on color enhancement
Through the color-enhanced drilling fluid cuttings segmentation and size estimation method, the problem of insufficient quantification and objectivity in the estimation of cuttings particle size in the existing technology is solved, and accurate processing of complex scenes and diverse cuttings shapes is achieved. Improved estimation accuracy and efficiency.
Patent Information
- Application Number
- CN202411095198.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-12
AI Technical Summary
The existing technology lacks quantification and objectivity in estimating the particle size of drilling fluid cuttings. Traditional methods are limited by sample acquisition and laboratory processing time, and are insufficiently adaptable to complex scenarios and diverse cuttings shapes.
Design a color-enhanced drilling fluid cuttings segmentation and size estimation method. By constructing a real drilling fluid cuttings image data set, using color and intensity decoupling networks for brightness enhancement and denoising, a hierarchical encoder extracts multi-scale features, and perform semantic segmentation through the ALL-MLP decoder to calculate the size of the cuttings.
It achieves accurate size estimation of drilling fluid cuttings, improves the model's ability to capture image details and global information, is suitable for processing complex scenes and diverse cuttings shapes, and improves the accuracy and efficiency of estimation.
Smart Images

Figure CN118628485B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the dual fields of deep learning and drilling development technology, and in particular to a drilling fluid cuttings counting method combining a weak-light image enhancement network and group counting. Background Art
[0002] The estimation of drilling fluid cuttings particle size is of key significance in oil and gas exploration and downhole operations. The estimation can provide key geological information, help optimize downhole operation processes, improve drilling efficiency and ensure the safety of the downhole environment. The size estimation of cuttings particles is widely used, including downhole environment monitoring, downhole operation optimization, cuttings evaluation and geological exploration.
[0003] In the early days, people may rely mainly on the experience of engineers and geologists to estimate the size of rock cuttings particles in drilling fluid. This method is based on professionals' understanding of strata and rock types. Although it may be effective in some cases, it lacks quantification and objectivity. In the early 20th century, particle analysis using sieves became a common laboratory technique. This method estimates the particle size based on the deposition of particles on the sieve by screening drilling fluid samples through sieves. However, this method is sometimes limited by the time required to obtain samples and process them in the laboratory. With the development of science and technology, laser particle size analysis technology has become a common method. Through laser scattering, the size distribution of particles can be measured quickly and accurately, improving the accuracy and efficiency of measurement. In recent years, the development of digital image processing technology has made it possible to use cameras to capture images and estimate particle size through image processing methods. Summary of the invention
[0004] The purpose of the present invention is to solve the problem of accurate size estimation in drilling fluid cuttings images, and to design a drilling fluid cuttings segmentation and size estimation method based on color enhancement. First, a real drilling fluid cuttings image data set is constructed, and the corresponding intensity map, HV color map and HVI color map are calculated respectively; then, the image is brightness enhanced and denoised through a color and intensity decoupling network to obtain enhanced drilling fluid cuttings image data; the coarse-grained and fine-grained features of the enhanced drilling fluid cuttings image are extracted through a hierarchical encoder, and features of different scales are extracted and embedded in position coding to improve the effect of subsequent prediction of drilling fluid cuttings semantic segmentation mask images; an ALL-MLP decoder is used to directly fuse these multi-level features to predict the enhanced drilling fluid cuttings semantic segmentation mask image; finally, all cuttings sizes of the real drilling fluid cuttings image are calculated according to the size of the actual cuttings and the pixel size ratio of the cuttings in the image.
[0005] A method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement comprises the following steps:
[0006] S1: Process the drilling fluid and cuttings images and calculate the intensity maps corresponding to the drilling fluid and cuttings images respectively 、HV color map and HVI color map ;
[0007] S2: The intensity map and HV color map As the input of the color and intensity decoupling network, the intensity map after lighting is calculated And the denoised HV color image ;
[0008] S3: Intensity graph after the connection is lit And the denoised HV color image , after connection and HVI color map The result is recorded as I, and I is inversely transformed to obtain the enhanced drilling fluid cuttings image;
[0009] S4: Using a hierarchical encoder to extract the coarse and fine features M of the enhanced drilling fluid cuttings image;
[0010] S5: Use a lightweight ALL-MLP decoder to directly fuse multi-level feature predictions to obtain an enhanced drilling fluid cuttings image L, perform semantic segmentation on the image L through a convolutional neural network, and obtain the segmented mask image F through neural network training;
[0011] S6: Calculate the size of each rock fragment in the segmented mask image F.
[0012] Furthermore, a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, wherein step S1 comprises the following sub-steps:
[0013] S11: Calculate the intensity map of the drilling fluid cuttings image. The formula is:
[0014] ;
[0015] in, Intensity map representing the drilling fluid cuttings image, represents the input drilling fluid cuttings image, , represents real numbers, Represents the height of the drilling fluid cuttings image, represents the width of the drilling fluid cuttings image, represents the input three color channels of drilling fluid cuttings image data, represents the red color channel, represents the green color channel, represents the blue color channel, Represents the maximum drilling fluid cuttings data of three channels;
[0016] S12: Calculate HV color map of drilling fluid cuttings image and HVI color map ;
[0017] S121: Calculate color density , the formula is:
[0018] ;
[0019] in, Represents color density, Represents the parameters customized for training, and ; ;
[0020] S122: Calculate color saturation , the formula is:
[0021] ;
[0022] in, Represents color saturation, Represents the minimum drilling fluid cuttings data of three channels;
[0023] S123: Building an adaptive linear color perceptual mapping , to learn the sensitivity of the dataset to different color features, the formula is:
[0024] ;
[0025] ;
[0026] in, Represents the color hue, represents the input red channel drilling fluid cuttings image data, The green channel represents the input drilling fluid cuttings image data. The blue channel represents the input drilling fluid cuttings image data. , represents the remainder after division by 6;
[0027] in, represents a linear color perceptual mapping, , Represents the parameters customized for training, ;
[0028] S124: Calculate HV color map The plane formalization of is:
[0029] ;
[0030] in, represents the single prime function for training;
[0031] in, represents element-wise multiplication, A color map representing the horizontal component, Color map representing the vertical component;
[0032] S125: Connect to and , perform image processing operations to obtain HVI color images ;
[0033] in, .
[0034] Further, a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, wherein step S2 comprises the following sub-steps:
[0035] S21: Initialize the intensity map , , , the formula is:
[0036] ;
[0037] in, The query vector value representing the intensity map, represents the key vector value of the intensity map, A numeric vector representing the intensity map values, , C represents the color channel, Representative query, Represents health, Representative value;
[0038] in, Represents the query vector value for the intensity map Layered convolution matrix, Represents the key vector value of the intensity map Layered convolution matrix, Represents the value of the intensity map vector Layered convolution matrix, Represents the query vector value for the intensity map Layered convolution matrix, Represents the key vector value of the intensity map layer depthwise convolution matrix, Represents the value of the intensity map vector layer depth convolution matrix;
[0039] S22: Rearrange , , ;
[0040] S221: By flattening , Transform, get new , ;
[0041] The flattening operation is to convert the two-dimensional structure HxW into a one-dimensional structure HW;
[0042] S222: Based on the flattening operation, a transposition operation is performed Transform, get new ;
[0043] in, Represents the rearranged , Represents the rearranged , Represents the rearranged , , ;
[0044] S23: Computational intensity map and HV color map The cross attention result is:
[0045] ;
[0046] in, represents the long factor, Represents a 1*1 point convolution matrix, represents the dot product operation, A function representing the normalized attention weights, represents the query vector, represents the key vector, represents a numeric vector, Represents the cross-attention result of the intensity map, Represents the cross attention results of HV color map, ;
[0047] S24: Calculate the intensity map after lighting And the denoised HV color image , the formula is:
[0048] ;
[0049] in, Represents the intensity map after lighting, represents the HV color image after denoising, represents element-wise multiplication, represents the activation function, Represents a 1*1 depth convolution matrix, Represents a 3*3 layered convolution matrix;
[0050] in, Represents a 3*3 layered convolution matrix about color saturation, Represents a 1*1 depth convolution matrix about color saturation, Represents a 3*3 layered convolution matrix about color, Represents a 1*1 depth convolution matrix about color.
[0051] Further, a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, the step S3 comprises the following sub-steps:
[0052] S31: Decompose the intensity map I into , , , clip the three decomposition vectors in the range of [-1,1];
[0053] Said represents the intensity map of the horizontal component, represents the intensity graph of the vertical component, Intensity diagram representing the component perpendicular to the vertical phase;
[0054] S32: Calculate the color density of I using the formula of step S121 , using the formula in step S123 to calculate the adaptive linear color perception mapping of I , calculate the intermediate variable and , the formula is:
[0055] ;
[0056] in, represents the color density of I, , All represent intermediate variables;
[0057] S33: and Converted to HSV color space, the formula is:
[0058] ;
[0059] in, Represents a custom linear parameter, Represents a clipping operation, retaining only values in the range of -1 to 1. Represents color tone, Represents saturation, Represents the remainder after division by 1;
[0060] S34: Change the color tone , Saturation and brightness Combine into HSV image and convert to sRGB image;
[0061] The sRGB image represents the enhanced drilling fluid cuttings image.
[0062] Further, a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, the step S4 comprises the following sub-steps:
[0063] S41: By size The sliding window is set to S, and the sliding step is S. Set K=7, S=4 and K=3, S=2 to divide the enhanced drilling fluid cuttings image into small blocks, and merge the small blocks into a large feature map P;
[0064] S42: Calculate the hierarchical feature map of the large feature map P , the formula is:
[0065] ;
[0066] in, represents the hierarchical feature map, and represents the length and width of the large feature map P, Represents the number of network channels in the i-th layer;
[0067] S43: Calculate the self-attention result. The formula is:
[0068] ;
[0069] Among them, Softmax represents the normalized exponential function, and the query Q, key K and value V have the same shape as , represents the dimension of the network layer, Represents the input location information, represents the transpose of K;
[0070] S44: Introduce position information, the formula is:
[0071] ;
[0072] in, Represents the output position information, MLP represents multi-layer perceptron, and GELU represents the activation function based on Gaussian error function;
[0073] S45: Repeat steps S41, S42, S43, and S44 four times to extract the coarse-grained and fine-grained features M of the enhanced drilling fluid cuttings image.
[0074] Furthermore, in a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, the step S5 further includes the following sub-steps:
[0075] S51: Unify the channel dimension of the multi-layer feature M, the formula is:
[0076] ;
[0077] in, Represents a layer of features, Linear represents a fully connected network layer, and Represent the input and output dimensions of the linear layer, j represents the number of layers, represents the j-layer feature;
[0078] S52: Upsample features to And connected together, the formula is:
[0079] ;
[0080] in, represents the splicing feature, represents an upsampling operation;
[0081] S53: Splicing features The fusion formula is:
[0082] ;
[0083] in, represents the fusion feature, represents a linear mapping, Represents a connection operation;
[0084] S54: Use the fusion feature to predict the segmented drilling fluid cuttings image L, the formula is:
[0085] ;
[0086] Among them, L represents the segmented drilling fluid cuttings image, , Represents the number of categories.
[0087] Furthermore, in a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, the step S6 further includes the following sub-steps:
[0088] S61: Convert the segmented drilling fluid cuttings image L into a grayscale image and perform Gaussian blur processing to obtain a result G. The mathematical formula of Gaussian blur is:
[0089] ;
[0090] in, represents the Gaussian kernel, represents the weight of the convolution operation, x and y represent the position of the pixel in the image, represents the standard deviation of the Gaussian distribution;
[0091] S62: Use the Canny edge detection algorithm to detect the edge image E of the result Q of S61;
[0092] S63: extracting the outer contour of the edge image E, and selecting a contour of known actual size as a reference object;
[0093] S64: Calculate the minimum area rectangle box of the reference object and obtain the four vertices , , , , calculate the pixel distance between, calculate , The relationship between pixel distance and actual object size, resulting in a conversion ratio;
[0094] S65: traverse the remaining contours, repeat S64 operation for each contour to calculate the minimum area rectangle, and obtain four vertices;
[0095] S66: Draw rectangles corresponding to all contours on the drilling fluid cuttings image, and draw the distance obtained according to the conversion ratio into the image as the length and width of the cuttings to obtain the size of each cutting.
[0096] The beneficial effects of the present invention are as follows: through a color-enhanced drilling fluid cuttings segmentation and size estimation method, the cuttings in the drilling fluid are hierarchically processed and multi-scale feature fusion is realized, which not only enhances the model's ability in capturing image details and global information, but also improves its adaptability to the diversity of cuttings morphologies, and shows accuracy and superiority in the segmentation and size estimation of cuttings particles, and is suitable for processing complex scenes and diverse cuttings morphologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0098] The present invention is further described below, but the protection scope of the present invention is not limited to the following description.
[0099] As attached Figure 1 As shown, a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement includes the following steps:
[0100] S1: Process the drilling fluid and cuttings images and calculate the intensity maps corresponding to the drilling fluid and cuttings images respectively 、HV color map and HVI color map ;
[0101] S2: The intensity map and HV color map As the input of the color and intensity decoupling network, the intensity map after lighting is calculated And the denoised HV color image ;
[0102] S3: Intensity graph after the connection is lit And the denoised HV color image , after connection and HVI color map The result is recorded as I, and I is inversely transformed to obtain the enhanced drilling fluid cuttings image;
[0103] S4: Using a hierarchical encoder to extract the coarse and fine features M of the enhanced drilling fluid cuttings image;
[0104] S5: Use a lightweight ALL-MLP decoder to directly fuse multi-level feature predictions to obtain an enhanced drilling fluid cuttings image L, perform semantic segmentation on the image L through a convolutional neural network, and obtain the segmented mask image F through neural network training;
[0105] S6: Calculate the size of each rock fragment in the segmented mask image F.
[0106] Furthermore, a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, wherein step S1 comprises the following sub-steps:
[0107] S11: Calculate the intensity map of the drilling fluid cuttings image. The formula is:
[0108] ;
[0109] in, Intensity map representing the drilling fluid cuttings image, represents the input drilling fluid cuttings image, , represents real numbers, Represents the height of the drilling fluid cuttings image, represents the width of the drilling fluid cuttings image, represents the input three color channels of drilling fluid cuttings image data, represents the red color channel, represents the green color channel, represents the blue color channel, Represents the maximum drilling fluid cuttings data of three channels;
[0110] S12: Calculate HV color map of drilling fluid cuttings image and HVI color map ;
[0111] S121: Calculate color density , the formula is:
[0112] ;
[0113] in, Represents color density, Represents the parameters customized for training, and ; ;
[0114] S122: Calculate color saturation , the formula is:
[0115] ;
[0116] in, Represents color saturation, Represents the minimum drilling fluid cuttings data of three channels;
[0117] S123: Building an adaptive linear color perceptual mapping , to learn the sensitivity of the dataset to different color features, the formula is:
[0118] ;
[0119] ;
[0120] in, Represents the color hue, represents the input red channel drilling fluid cuttings image data, The green channel represents the input drilling fluid cuttings image data. The blue channel represents the input drilling fluid cuttings image data. , represents the remainder after division by 6;
[0121] in, represents a linear color perceptual mapping, , Represents the parameters customized for training, ;
[0122] S124: Calculate HV color map The plane formalization of is:
[0123] ;
[0124] in, represents the single prime function for training;
[0125] in, represents element-wise multiplication, A color map representing the horizontal component, Color map representing the vertical component;
[0126] S125: Connect to and , perform image processing operations to obtain HVI color images ;
[0127] in, .
[0128] Further, a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, wherein step S2 comprises the following sub-steps:
[0129] S21: Initialize the intensity map , , , the formula is:
[0130] ;
[0131] in, The query vector value representing the intensity map, represents the key vector value of the intensity map, A numeric vector representing the intensity map values, , C represents the color channel, Representative query, Represents health, Representative value;
[0132] in, Represents the query vector value for the intensity map Layered convolution matrix, Represents the key vector value of the intensity map Layered convolution matrix, Represents the value of the intensity map vector Layered convolution matrix, Represents the query vector value for the intensity map Layered convolution matrix, Represents the key vector value of the intensity map layer depthwise convolution matrix, Represents the value of the intensity map vector layer depth convolution matrix;
[0133] S22: Rearrange , , ;
[0134] S221: By flattening , Transform, get new , ;
[0135] The flattening operation is to convert the two-dimensional structure HxW into a one-dimensional structure HW;
[0136] S222: Based on the flattening operation, a transposition operation is performed Transform, get new ;
[0137] in, Represents the rearranged , Represents the rearranged , Represents the rearranged , , ;
[0138] S23: Computational intensity map and HV color map The cross attention result is:
[0139] ;
[0140] in, represents the long factor, Represents a 1*1 point convolution matrix, represents the dot product operation, A function representing the normalized attention weights, represents the query vector, represents the key vector, represents a numeric vector, Represents the cross-attention result of the intensity map, Represents the cross attention results of HV color map, ;
[0141] S24: Calculate the intensity map after lighting And the denoised HV color image , the formula is:
[0142] ;
[0143] in, Represents the intensity map after lighting, represents the HV color image after denoising, represents element-wise multiplication, represents the activation function, Represents a 1*1 depth convolution matrix, Represents a 3*3 layered convolution matrix;
[0144] in, Represents a 3*3 layered convolution matrix about color saturation, Represents a 1*1 depth convolution matrix about color saturation, Represents a 3*3 layered convolution matrix about color, Represents a 1*1 depth convolution matrix about color.
[0145] Further, a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, the step S3 comprises the following sub-steps:
[0146] S31: Decompose the intensity map I into , , , clip the three decomposition vectors in the range of [-1,1];
[0147] Said represents the intensity map of the horizontal component, represents the intensity graph of the vertical component, Intensity diagram representing the component perpendicular to the vertical phase;
[0148] S32: Calculate the color density of I using the formula of step S121 , using the formula in step S123 to calculate the adaptive linear color perception mapping of I , calculate the intermediate variable and , the formula is:
[0149] ;
[0150] in, represents the color density of I, , All represent intermediate variables;
[0151] S33: and Converted to HSV color space, the formula is:
[0152] ;
[0153] in, Represents a custom linear parameter, Represents a clipping operation, retaining only values in the range of -1 to 1. Represents color tone, Represents saturation, Represents the remainder after division by 1;
[0154] S34: Change the color tone , Saturation and brightness Combine into HSV image and convert to sRGB image;
[0155] The sRGB image represents the enhanced drilling fluid cuttings image.
[0156] Further, a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, the step S4 comprises the following sub-steps:
[0157] S41: By size The sliding window is set to S, and the sliding step is S. Set K=7, S=4 and K=3, S=2 to divide the enhanced drilling fluid cuttings image into small blocks, and merge the small blocks into a large feature map P;
[0158] S42: Calculate the hierarchical feature map of the large feature map P , the formula is:
[0159] ;
[0160] in, represents the hierarchical feature map, and represents the length and width of the large feature map P, Represents the number of network channels in the i-th layer;
[0161] S43: Calculate the self-attention result. The formula is:
[0162] ;
[0163] Among them, Softmax represents the normalized exponential function, and the query Q, key K and value V have the same shape as , represents the dimension of the network layer, Represents the input location information, represents the transpose of K;
[0164] S44: Introduce position information, the formula is:
[0165] ;
[0166] in, Represents the output position information, MLP represents multi-layer perceptron, and GELU represents the activation function based on Gaussian error function;
[0167] S45: Repeat steps S41, S42, S43, and S44 four times to extract the coarse-grained and fine-grained features M of the enhanced drilling fluid cuttings image.
[0168] Furthermore, in a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, the step S5 further includes the following sub-steps:
[0169] S51: Unify the channel dimension of the multi-layer feature M, the formula is:
[0170] ;
[0171] in, Represents a layer of features, Linear represents a fully connected network layer, and Represent the input and output dimensions of the linear layer, j represents the number of layers, represents the j-layer feature;
[0172] S52: Upsample features to And connected together, the formula is:
[0173] ;
[0174] in, represents the splicing feature, represents an upsampling operation;
[0175] S53: Splicing features The fusion formula is:
[0176] ;
[0177] in, represents the fusion feature, represents a linear mapping, Represents a connection operation;
[0178] S54: Use the fusion feature to predict the segmented drilling fluid cuttings image L, the formula is:
[0179] ;
[0180] Among them, L represents the segmented drilling fluid cuttings image, , Represents the number of categories.
[0181] Furthermore, in a method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement, the step S6 further includes the following sub-steps:
[0182] S61: Convert the segmented drilling fluid cuttings image L into a grayscale image and perform Gaussian blur processing to obtain a result G. The mathematical formula of Gaussian blur is:
[0183] ;
[0184] in, represents the Gaussian kernel, represents the weight of the convolution operation, x and y represent the position of the pixel in the image, represents the standard deviation of the Gaussian distribution;
[0185] S62: Use the Canny edge detection algorithm to detect the edge image E of the result Q of S61;
[0186] S63: extracting the outer contour of the edge image E, and selecting a contour of known actual size as a reference object;
[0187] S64: Calculate the minimum area rectangle box of the reference object and obtain the four vertices , , , , calculate the pixel distance between, calculate , The relationship between pixel distance and actual object size, resulting in a conversion ratio;
[0188] S65: traverse the remaining contours, repeat S64 operation for each contour to calculate the minimum area rectangle, and obtain four vertices;
[0189] S66: Draw rectangles corresponding to all contours on the drilling fluid cuttings image, and draw the distance obtained according to the conversion ratio into the image as the length and width of the cuttings to obtain the size of each cutting.
[0190] This scheme uses a color-enhanced drilling fluid cuttings segmentation and size estimation method to hierarchically process the cuttings in the drilling fluid and realize the fusion of multi-scale features. It not only enhances the model's ability to capture image details and global information, but also improves its adaptability to the diversity of cuttings morphology. It shows accuracy and superiority in the segmentation and size estimation of cuttings particles, and is suitable for processing complex scenes and diverse cuttings morphologies.
[0191] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A drilling fluid cuttings segmentation and size estimation method based on color enhancement, characterized in that: The following steps are involved: S1: Process the drilling fluid and cuttings images and calculate the intensity maps corresponding to the drilling fluid and cuttings images respectively 、HV color map and HVI color map ; S2: The intensity map and HV color map As the input of the color and intensity decoupling network, the intensity map after lighting is calculated And the denoised HV color image ; S3: Intensity graph after the connection is lit And the denoised HV color image , after connection and HVI color map The result is recorded as I, and I is inversely transformed to obtain the enhanced drilling fluid cuttings image; S4: Using a hierarchical encoder to extract the coarse and fine features M of the enhanced drilling fluid cuttings image; S5: Use a lightweight ALL-MLP decoder to directly fuse multi-level feature predictions to obtain an enhanced drilling fluid cuttings image L, perform semantic segmentation on the image L through a convolutional neural network, and obtain the segmented mask image F through neural network training; S6: Calculate the size of each rock fragment in the segmented mask image F; The step S1 comprises the following sub-steps: S11: Calculate the intensity map of the drilling fluid cuttings image. The formula is: ; in, Intensity map representing the drilling fluid cuttings image, represents the input drilling fluid cuttings image, , represents real numbers, Represents the height of the drilling fluid cuttings image, represents the width of the drilling fluid cuttings image, represents the input three color channels of drilling fluid cuttings image data, represents the red color channel, represents the green color channel, represents the blue color channel, Represents the maximum drilling fluid cuttings data of three channels; S12: Calculate HV color map of drilling fluid cuttings image and HVI color map ; S121: Calculate color density , the formula is: ; in, Represents color density, Represents the parameters customized for training, and ; ; S122: Calculate color saturation , the formula is: ; in, Represents color saturation, Represents the minimum drilling fluid cuttings data of three channels; S123: Building an adaptive linear color perceptual mapping , to learn the sensitivity of the dataset to different color features, the formula is: ; ; in, Represents the color hue, represents the input red channel drilling fluid cuttings image data, The green channel represents the input drilling fluid cuttings image data. The blue channel represents the input drilling fluid cuttings image data. , represents the remainder after division by 6; in, represents a linear color perceptual mapping, , Represents the parameters customized for training, ; S124: Calculate HV color map The plane formalization of is: ; in, represents the single prime function for training; in, represents element-wise multiplication, A color map representing the horizontal component, Color map representing the vertical component; S125: Connect as and , perform image processing operations to obtain HVI color images ; in, ; The step S2 comprises the following sub-steps: S21: Initialize the intensity map , , , the formula is: ; in, The query vector value representing the intensity map, represents the key vector value of the intensity map, A numeric vector representing the intensity map values, , C represents the color channel, Representative query, Represents health, Representative value; in, Represents the query vector value for the intensity map Layered convolution matrix, Represents the key vector value of the intensity map Layered convolution matrix, Represents the value of the intensity map vector Layered convolution matrix, Represents the query vector value for the intensity map Layered convolution matrix, Represents the key vector value of the intensity map layer depthwise convolution matrix, Represents the value of the intensity map vector layer depth convolution matrix; S22: Rearrange , , ; S221: By flattening , Transform, get new , ; The flattening operation is to convert the two-dimensional structure HxW into a one-dimensional structure HW; S222: Based on the flattening operation, a transposition operation is performed Transform, get new ; in, Represents the rearranged , Represents the rearranged , Represents the rearranged , , ; S23: Computational intensity map and HV color map The cross attention result is: ; in, represents the long factor, Represents a 1*1 point convolution matrix, represents the dot product operation, A function representing the normalized attention weights, represents the query vector, represents the key vector, represents a numeric vector, Represents the cross-attention result of the intensity map, Represents the cross attention results of HV color map, ; S24: Calculate the intensity map after lighting And the denoised HV color image , the formula is: ; in, Represents the intensity map after lighting, represents the HV color image after denoising, represents element-wise multiplication, represents the activation function, Represents a 1*1 depth convolution matrix, Represents a 3*3 layered convolution matrix; in, Represents a 3*3 layered convolution matrix about color saturation, Represents a 1*1 depth convolution matrix about color saturation, Represents a 3*3 layered convolution matrix about color, Represents a 1*1 depth convolution matrix about color; The step S4 comprises the following sub-steps: S41: By size The sliding window is set to S, and the sliding step is S. Set K=7, S=4 and K=3, S=2 to divide the enhanced drilling fluid cuttings image into small blocks, and merge the small blocks into a large feature map P; S42: Calculate the hierarchical feature map of the large feature map P , the formula is: ; in, represents the hierarchical feature map, and represents the length and width of the large feature map P, Represents the number of network channels in the i-th layer; S43: Calculate the self-attention result. The formula is: ; Among them, Softmax represents the normalized exponential function, and the query Q, key K and value V have the same shape as , represents the dimension of the network layer, Represents the input location information, represents the transpose of K; S44: Introduce position information, the formula is: ; in, Represents the output position information, MLP represents multi-layer perceptron, and GELU represents the activation function based on Gaussian error function; S45: Repeat steps S41, S42, S43, and S44 four times to extract the coarse-grained and fine-grained features M of the enhanced drilling fluid cuttings image.
2. The method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement according to claim 1, characterized in that: The step S3 comprises the following sub-steps: S31: Decompose the intensity map I into , , , clip the three decomposition vectors in the range of [-1,1]; Said represents the intensity map of the horizontal component, represents the intensity graph of the vertical component, Intensity diagram representing the component perpendicular to the vertical phase; S32: Calculate the color density of I using the formula of step S121 , using the formula in step S123 to calculate the adaptive linear color perception mapping of I , calculate the intermediate variable and , the formula is: ; in, represents the color density of I, , All represent intermediate variables; S33: and Converted to HSV color space, the formula is: ; in, Represents a custom linear parameter, Represents a clipping operation, retaining only values in the range of -1 to 1. Represents color tone, Represents saturation, Represents the remainder after division by 1; S34: Change the color tone , Saturation and brightness Combine into HSV image and convert to sRGB image; The sRGB image represents the enhanced drilling fluid cuttings image.
3. The method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement according to claim 1, characterized in that: The step S5 further comprises the following sub-steps: S51: Unify the channel dimension of the multi-layer feature M, the formula is: ; in, Represents a layer of features, Linear represents a fully connected network layer, and Represent the input and output dimensions of the linear layer, j represents the number of layers, represents the j-layer feature; S52: Upsample features to And connected together, the formula is: ; in, represents the splicing feature, represents an upsampling operation; S53: Splicing features The fusion formula is: ; in, represents the fusion feature, represents a linear mapping, Represents a connection operation; S54: Use the fusion feature to predict the segmented drilling fluid cuttings image L, the formula is: ; Among them, L represents the segmented drilling fluid cuttings image, , Represents the number of categories.
4. The method for segmenting and estimating the size of drilling fluid cuttings based on color enhancement according to claim 1, characterized in that: The step S6 also includes the following sub-steps: S61: Convert the segmented drilling fluid cuttings image L into a grayscale image and perform Gaussian blur processing to obtain a result G. The mathematical formula of Gaussian blur is: ; in, represents the Gaussian kernel, represents the weight of the convolution operation, x and y represent the position of the pixel in the image, represents the standard deviation of the Gaussian distribution; S62: Use the Canny edge detection algorithm to detect the edge image E of the result Q of S61; S63: extracting the outer contour of the edge image E, and selecting a contour of known actual size as a reference object; S64: Calculate the minimum area rectangle box of the reference object and obtain the four vertices , , , , calculate the pixel distance between, calculate , The relationship between pixel distance and actual object size, resulting in a conversion ratio; S65: traverse the remaining contours, repeat S64 operation for each contour to calculate the minimum area rectangle, and obtain four vertices; S66: Draw rectangles corresponding to all contours on the drilling fluid cuttings image, and draw the distance obtained according to the conversion ratio into the image as the length and width of the cuttings to obtain the size of each cutting.
