Fluid inclusion analysis method and system based on target detection and semantic segmentation

By combining target detection and semantic segmentation technology, combined with optical character recognition and improved network structure, the problems of category, aspect ratio and gas-liquid ratio analysis in fluid inclusion analysis are solved, and high-precision and robust fluid inclusions are achieved. Analysis, suitable for complex microscopic images.

CN117789205BActive Publication Date: 2024-10-29CHINA UNIV OF MINING & TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410015923.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-05
Publication Date
2024-10-29
Estimated Expiration
2044-01-05

AI Technical Summary

Technical Problem

The existing technology is difficult to analyze in depth the categories, aspect ratios of single- and two-phase fluid inclusions, and the gas-liquid ratio of two-phase fluid inclusions in the analysis of fluid inclusions, and is not robust enough, especially for the analysis of multiple fluid inclusions. The micro-image target detection accuracy is not high and the inference speed is slow.

Method used

A method based on target detection and semantic segmentation is used, combined with optical character recognition, image processing, improved YOLOX-m target detection network and UNet2+ semantic segmentation network, and by introducing the CBAM attention mechanism and SIoU loss function to identify and analyze fluid inclusions. Number, category, aspect ratio and gas-to-liquid ratio.

Benefits of technology

It achieves high-precision and robust fluid inclusion analysis, can accurately identify and calculate parameter information of fluid inclusions, is suitable for complex microscopic images, improves analysis efficiency and accuracy, and reduces human interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117789205B_ABST
    Figure CN117789205B_ABST
Patent Text Reader

Abstract

The present invention discloses a fluid inclusion analysis method and system based on target detection and semantic segmentation, aiming to meet the needs of multiple fields such as earth science, resource exploration, and experimental geology. Traditional fluid inclusion analysis methods are labor-intensive, highly subjective, and inefficient, which limits their application in scientific research and industrial fields. The process of analyzing microscopic images containing fluid inclusions in the present invention is as follows: using OCR and image processing methods to analyze scale information; according to the characteristics of microscopic images containing fluid inclusions, the YOLOX‑m target detection algorithm is improved to make it suitable for identifying the location and category of fluid inclusions; according to the characteristics of a single fluid inclusion, the UNet2+ semantic segmentation algorithm is improved, and the image processing method is combined to realize the estimation of the aspect ratio of single-phase and two-phase fluid inclusions and the gas-liquid ratio of two-phase fluid inclusions. The present invention can simply and efficiently realize the rapid analysis and identification of fluid inclusion parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of automatic image recognition and oil and gas exploration, and more specifically, to a fluid inclusion analysis method and system based on target detection and semantic segmentation. Background Art

[0002] Fluid inclusions are key microscopic structures in the fields of geology and mineralogy. They record the process of Earth's evolution and traces of geological events. These tiny closed bodies contain information about the Earth's interior, such as temperature, pressure, composition, and geological history. Therefore, the analysis of fluid inclusion parameters spans multiple disciplines and has great scientific value in various aspects such as Earth science, resource exploration, environmental protection, and experimental geology. In traditional fluid inclusion analysis, manual observation and measurement are required, which is not only time-consuming and labor-intensive, but also susceptible to subjective factors and human errors. In addition, the number of fluid inclusions is usually large, so a lot of labor and time are required to complete the analysis.

[0003] The emergence of computer vision technology has provided a revolutionary solution for fluid inclusion analysis. By utilizing deep learning and image processing algorithms, automated detection, positioning, and analysis of fluid inclusions can be achieved. Specifically, computer vision technology can identify the location, category, and shape of each fluid inclusion, and measure the aspect ratio of single-phase and two-phase fluid inclusions and the gas-liquid ratio of two-phase fluid inclusions, which are key parameters for understanding geological history and mineral genesis. The benefits of using computer vision technology are not only to improve the speed and accuracy of the analysis of fluid inclusion parameters, but also to reduce analysis costs and eliminate interference from human factors. In addition, this method can also process large-scale data sets, making it possible to efficiently analyze large-scale geological samples. Therefore, computer vision technology has brought new opportunities and prospects to research in the fields of geology and mineralogy, and is expected to promote greater progress in scientific research.

[0004] The existing fluid inclusion analysis methods have the following main problems: manual analysis methods are time-consuming and highly subjective, and are not suitable for large-scale applications; traditional computer vision technology is not accurate enough in processing dense and small targets such as fluid inclusions; although existing deep learning methods have made some progress, they still face the problem of insufficient robustness and are difficult to accurately identify and analyze.

[0005] The Chinese patent application, publication number CN 116229458 A, records a YOLOV5-based inclusion detection method, which improves the YOLOV5 model according to the characteristics of fluid inclusions, making it suitable for the detection of fluid inclusions. The technical core of the method includes: collecting and making a fluid inclusion data set; adding a CA attention mechanism to the model; replacing the PANet in the neck network of the YOLOV5 model with BIFPN; adding a small target detection layer to the model; training better weights for detection. The invention can perform real-time intelligent analysis of inclusion slices under a microscope to determine whether it is a fluid inclusion, and can achieve fast and effective identification of fluid inclusions. However, the method faces the problem of insufficient robustness and is difficult to accurately identify and analyze. In particular, for the task of detecting targets in microscopic images containing multiple fluid inclusions, the YOLOV5 target detection network used is not accurate and has a slow inference speed. In addition, this method is currently only used to identify the location and number of fluid inclusions, and does not focus deeply on the categories of fluid inclusions, nor does it conduct detailed analysis of the aspect ratio of single-phase and two-phase fluid inclusions and the gas-liquid ratio of two-phase fluid inclusions. The gas-liquid ratio parameter analysis of two-phase fluid inclusions is currently limited to the use of Photoshop, which requires manual operation and cannot quickly and autonomously calculate the gas-liquid ratio of two-phase fluid inclusions. Summary of the invention

[0006] 1. Technical issues to be solved

[0007] In the prior art, when applying deep learning methods to analyze fluid inclusions, there is a problem that parameters such as the type of fluid inclusions, the aspect ratio of single-phase and double-phase fluid inclusions, and the gas-liquid ratio of double-phase fluid inclusions cannot be deeply analyzed. The present invention provides a fluid inclusion analysis method and system based on target detection and semantic segmentation. The method recognizes fluid inclusion microscopic images and combines multiple technologies such as optical character recognition (OCR), image processing, target detection, and semantic segmentation. It can quickly obtain parameter information such as the number and type of fluid inclusions, the aspect ratio of single-phase and double-phase fluid inclusions, and the gas-liquid ratio of double-phase fluid inclusions with high accuracy and strong robustness.

[0008] 2. Technical solution

[0009] The purpose of the present invention is achieved through the following technical solutions.

[0010] One aspect of the present invention provides a fluid inclusion analysis method based on target detection and semantic segmentation, comprising the following steps:

[0011] S1: Collecting a microscopic image containing fluid inclusions as an image to be inspected;

[0012] S2: Identify the scale information in the image to be inspected, and obtain the mapping relationship between the image pixels and the actual physical size; the method for identifying the scale information in the image to be inspected is a method combining optical character recognition and image processing technology;

[0013] S3: annotate the image to be inspected to obtain the target detection frame position and category information label; the category information is single-phase fluid inclusion information and two-phase fluid inclusion information;

[0014] S4: inputting the image to be inspected, the position of the target detection frame in the image to be inspected, and the category information label into the improved YOLOX-m target detection network to identify the number, position, and category information of the fluid inclusions in the image to be inspected;

[0015] The improved YOLOX-m target detection network consists of four key parts: input, backbone, neck, and output. The Backbone component of YOLOX-m consists of multiple convolutional layers, CSP layers, batch normalization layers, activation function layers, etc. Three CBAM (Convolutional Block Attention Module) attention mechanism modules with the same structure are introduced between the connection from the last three CSP layers to the neck network to process the output of the above three layers of networks respectively.

[0016] A comprehensive loss function SIoU (SCYLLA- Intersection over Union) is constructed as a loss function, and the comprehensive loss function SIoU includes IoU (Intersection over Union) loss, angle loss, distance loss and shape loss.

[0017] The constructed comprehensive loss function is used to train the improved YOLOX-m target detection network. By guiding the network learning, the training effect of the network is significantly improved. The calculation method of the constructed comprehensive loss function and the comprehensive loss SIoU is as follows:

[0018]

[0019] (1) IoU is used to calculate the loss between the predicted box and the true box. The specific formula is as follows:

[0020]

[0021] b represents the anchor box, S represents area; superscript gt Represents the real box, superscript pr represents the prediction box;

[0022] Represents the area of ​​the intersection between the predicted box and the true box. Represents the area of ​​the predicted box and the true box;

[0023] (2) Used to calculate the distance loss between the predicted box and the real box. The specific formula is as follows:

[0024]

[0025] in, , and The calculation formula is:

[0026]

[0027]

[0028]

[0029] w and h Represents width and height respectively, subscript r Represents a rectangle; Represents the width and height of the minimum bounding rectangle of the real box and the predicted box respectively; x and y Represents the horizontal and vertical coordinates, respectively, and the subscript c Represents the center point of the anchor box; Respectively represent the horizontal and vertical coordinates of the center point of the real frame, Respectively represent the horizontal and vertical coordinates of the center point of the prediction box;

[0030] In the formula, Used to calculate the angle loss between the predicted box and the real box. The specific formula is as follows:

[0031]

[0032] σ Represents the distance between the center point of the predicted box and the center point of the real box, d h Indicates the height difference between the center point of the predicted box and the center point of the real box. h Represents height;

[0033]

[0034]

[0035] x and y represent the horizontal and vertical coordinates respectively, Respectively represent the horizontal and vertical coordinates of the center point of the real frame, Respectively represent the horizontal and vertical coordinates of the center point of the prediction box;

[0036] (3) It is used to calculate the shape loss between the predicted box and the real box. The specific formula is as follows:

[0037]

[0038] in, Controls the degree of focus on shape loss, and its value range is [2, 6], and The calculation formula is:

[0039]

[0040]

[0041] Represents the width and height of the real box respectively , Represent the width and height of the prediction box respectively.

[0042] S5: cropping the image to be inspected according to the fluid inclusion position information obtained by the target detection in step S4 to obtain a microscopic image containing only a single fluid inclusion; annotating the microscopic image containing only a single fluid inclusion at the pixel level to obtain a corresponding semantic segmentation label;

[0043] S6: Inputting the microscopic image containing only a single fluid inclusion and its corresponding semantic segmentation label into the semantic segmentation network of the improved UNet2+ to obtain the segmentation image predicted by the network;

[0044] Furthermore, in view of the shape characteristics of a single fluid inclusion microscopic image, the improvements to the semantic segmentation network of the improved UNet2+ described in step S6 include: using ResNet34 as the encoder of the main network backbone to avoid gradient vanishing and explosion, so that the characteristic information of the fluid inclusions can be transferred to a deeper network structure; using the scSE module attention mechanism to process the input of the decoder, so that the network can automatically pay attention to channel and spatial features during training. The scSE (Concurrent Spatial and Channel Squeeze & Excitation) module includes a channel attention (Spatial Squeeze and Channel Excitation Block, cSE) module and a spatial attention (Channel Squeeze and Spatial Excitation Block, sSE) module.

[0045] S7: Use image processing technology to process the segmented image obtained in step S6, and estimate the aspect ratio information of the single-phase and two-phase fluid inclusions and the gas-liquid ratio information of the two-phase fluid inclusions based on the mapping relationship between the image pixels obtained in step S3 and the actual physical size.

[0046] Based on the above algorithm, fluid inclusion parameter analysis software can be developed. The software integrates OCR, image processing, target detection and semantic segmentation algorithms. Users can obtain parameter analysis results of fluid inclusions by submitting microscopic images containing fluid inclusions (including scale information).

[0047] Another aspect of the present invention further provides a fluid inclusion analysis system based on target detection and semantic segmentation, which applies a fluid inclusion analysis method based on target detection and semantic segmentation provided by the first aspect of the present invention.

[0048] 3. Beneficial effects

[0049] Compared with the prior art, the advantages of the present invention are:

[0050] The fluid inclusion analysis method based on target detection and semantic segmentation provided by the present invention can overcome the problems of high labor intensity, high subjectivity, low efficiency, etc. of the traditional manual identification method while maintaining high precision. The method can not only accurately identify the number, location information, and category of fluid inclusions, estimate the aspect ratio of single-phase and double-phase fluid inclusions and the gas-liquid ratio of double-phase fluid inclusions, but also has strong anti-interference ability and is suitable for various microscopic image recognition tasks of complex fluid inclusions.

[0051] In view of the characteristics of dense number and small objects in fluid inclusion microscopic images, the CBAM attention mechanism is introduced into the connection between the last three CSP layers of the backbone network CSPDarknet network architecture and the neck network to retain more detailed information and improve feature representation, so that the network pays more attention to the channel information and spatial information of the fusion input features.

[0052] The SIoU loss function includes IoU loss, angle loss, distance loss and shape loss, and assigns different weights to it. This solves the gradient vanishing problem that is prone to occur when only IoU loss is used to train the network. It enables the model to consider three different dimensional information, namely spatial positioning, angle prediction and aspect ratio accuracy, during the training process, thereby accelerating the convergence speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a flow chart of the fluid inclusion analysis method based on target detection and semantic segmentation;

[0054] Figure 2This is the improved YOLOX-m network structure diagram;

[0055] Figure 3 This is the CBAM network structure diagram;

[0056] Figure 4 This is a schematic diagram for comparing the detection results of the target detection task;

[0057] Figure 5 This is the Unet2+ network structure diagram;

[0058] Figure 6 This is the structure diagram of the scSE attention module;

[0059] Figure 7 Flowchart for training object detection and semantic segmentation networks;

[0060] Figure 8 Schematic diagram of the semantic segmentation results of fluid inclusions and their contours and fitted rectangular frames. DETAILED DESCRIPTION

[0061] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0062] Example 1

[0063] Figure 1 Flowchart of the fluid inclusion analysis method based on target detection and semantic segmentation.

[0064] The present invention provides a fluid inclusion analysis method and software system based on target detection and semantic segmentation, which can quickly analyze fluid inclusion parameters, and specifically includes the following steps:

[0065] S1: Collecting a microscopic image containing fluid inclusions as an image to be inspected, wherein the image to be inspected includes scale information, and the scale information includes a mapping relationship between image pixels and actual physical sizes.

[0066] S2: Identify the scale information in the image to be inspected, and obtain the mapping relationship between the image pixels and the actual physical size. Specifically, a method based on optical character recognition (OCR) and image processing technology is used to identify the scale information in the microscopic image containing multiple fluid inclusions, and obtain the mapping relationship between the image pixels and the actual physical size.

[0067] S3: Annotate the image to be inspected to obtain the target detection frame position and category information label; the classification of fluid inclusions includes single-phase fluid inclusion information and two-phase fluid inclusion information.

[0068] First, OCR technology is used to locate the position of the scale in a microscopic image containing multiple fluid inclusions and identify the numbers and units above the scale. According to the position information, the scale of the microscopic image is cropped 1.5 times to obtain a scale image. According to the characteristics of the fluid inclusion scale, the scale image is processed using image processing technology, only the horizontal and vertical line information in the image is retained, and the intersection position of the horizontal and vertical lines is identified. The scale of fluid inclusions generally has two intersections. Image recognition is performed on the scale image to identify the number of pixels between the two intersections. Based on the numbers and unit information above the scale, the mapping relationship between the image pixels and the actual physical size is obtained.

[0069] S4: Input the image to be inspected, the position of the target detection box in the image to be inspected, and the category information label into the improved YOLOX-m target detection network to identify the number, position, and category information of the fluid inclusions in the image to be inspected.

[0070] The present invention is based on the improvement of the YOLOX-m target detection network in the YOLOX series. The network consists of four key parts: the input end, the backbone network Backbone, the neck network Neck and the output end. The input end is responsible for receiving the image to be detected and passing it to the Backbone after Mosaic data enhancement. The Backbone network adopts the CSPDarknet architecture. CSPDarknet is a deep convolutional neural network consisting of a series of convolutional layers and pooling layers. It adopts the idea of ​​Cross-Stage Partial Network to optimize the feature extraction and propagation of the network to improve the accuracy and robustness of target detection. The Neck part is located between the Backbone and the output end, and is used to further process the feature map and extract higher-level features. YOLOX-m uses the Feature Pyramid Networks (FPN) structure as the Neck, which is a multi-scale feature fusion network structure used to process feature maps from different network levels to better detect targets of different scales. The output end adopts a decoupled prediction head structure, which consists of multiple convolution modules. It combines dense prediction and cross-scale prediction, which can greatly improve the detection speed while maintaining high detection accuracy.

[0071] In view of the characteristics of dense number and small targets in fluid inclusion microscopic images, the improvements of the improved YOLOX-m target detection network described in step S4 include:

[0072] like Figure 2As shown in Figure 1, the CBAM attention module is introduced after the last three CSPLayer layers of the CSPDarknet network architecture to retain more detailed information and improve feature representation, so that the network pays more attention to the channel information and spatial information of the fused input features. The CBAM module consists of two sub-modules: the channel attention module and the spatial attention module. Figure 3 As shown in the figure: First, the input features pass through the channel attention module, which outputs the attention weights used to adjust the response of each channel feature. Then, the output of the channel attention module is multiplied with the original input features. Next, the result of the element-wise multiplication is used as the input of the spatial attention module, which calculates the attention weights for each position in the spatial dimension. The output of the spatial attention module is multiplied again with the result of the channel attention module to further extract key features.

[0073] Construct a comprehensive loss function. The fluid inclusions in the microscopic images of multiple fluid inclusions are characterized by large numbers and small targets, which puts high demands on the prediction of anchor boxes in target detection tasks. Construct a comprehensive loss function SIoU loss function. The SIoU loss function includes IoU loss, angle loss, distance loss, and shape loss, and assigns different weights to solve the gradient vanishing problem that is prone to occur when only IoU loss is used to train the network. The model considers three different dimensional information of spatial positioning, angle prediction, and aspect ratio accuracy during training, thereby accelerating convergence.

[0074] The constructed comprehensive loss function SIou is used to train the improved YOLOX-m target detection network. By guiding the network learning, the training effect of the network is significantly improved. The calculation method of the constructed comprehensive loss function and the comprehensive loss SIoU is as follows:

[0075]

[0076] (1) IoU is used to calculate the loss between the predicted box and the true box. The specific formula is as follows:

[0077]

[0078] b represents the anchor box, S represents area; superscript gt Represents the real box, superscript pr represents the prediction box;

[0079] Represents the area of ​​the intersection between the predicted box and the true box. Represents the area of ​​the predicted box and the true box;

[0080] (2) Used to calculate the distance loss between the predicted box and the real box. The specific formula is as follows:

[0081]

[0082] in, , and The calculation formula is:

[0083]

[0084]

[0085]

[0086] w and h Represents width and height respectively, subscript r Represents a rectangle; Represents the width and height of the minimum bounding rectangle of the real box and the predicted box respectively; x and y Represents the horizontal and vertical coordinates, respectively, and the subscript c Represents the center point of the anchor box; Respectively represent the horizontal and vertical coordinates of the center point of the real frame, Respectively represent the horizontal and vertical coordinates of the center point of the prediction box;

[0087] In the formula, It is used to calculate the angle loss between the predicted box and the real box. The specific formula is as follows:

[0088]

[0089] σ Represents the distance between the center point of the predicted box and the center point of the real box, d h Indicates the height difference between the center point of the predicted box and the center point of the real box. h Represents height;

[0090]

[0091]

[0092] x and y represent the horizontal and vertical coordinates respectively, Respectively represent the horizontal and vertical coordinates of the center point of the real frame, Respectively represent the horizontal and vertical coordinates of the center point of the prediction box;

[0093] (3) It is used to calculate the shape loss between the predicted box and the real box. The specific formula is as follows:

[0094]

[0095] in, Controls the degree of focus on shape loss, and its value range is [2, 6], and The calculation formula is:

[0096]

[0097]

[0098] Represents the width and height of the real box respectively , Represent the width and height of the prediction box respectively.

[0099] Figure 4 The detection results of the original YOLOX-m model and the improved model are shown. Figure 4 The left image is the original image input to the object detection process. Figure 4 In the middle is the test result of YOLOX-m. Figure 4 The right figure shows the detection results of the proposed method. The detection results show that the improved model performs better, especially in detecting small objects. Compared with the original YOLOX-m model, the improved model increases the ability to detect small objects, thereby enhancing the overall detection effect.

[0100] S5: Crop the image to be inspected according to the fluid inclusion position information obtained by target detection in step S4 to obtain a microscopic image containing only a single fluid inclusion; perform pixel-level annotation on the microscopic image containing only a single fluid inclusion to obtain a corresponding semantic segmentation label.

[0101] S6: Input the microscopic image containing only a single fluid inclusion and its corresponding semantic segmentation label into the semantic segmentation network of the improved UNet2+ to obtain the segmentation image predicted by the network.

[0102] like Figure 5As shown in the figure, the network structure of UNet2+ includes an encoder, a decoder, a central multi-level aggregation structure and a deep supervision module. The encoder contains 5 encoder modules, which are composed of a series of convolutional layers and pooling layers, and are used to extract the features of the input image while downsampling. The decoder contains 4 decoder modules, which are used to upsample the features and generate segmented images. At the same time, in order to not only analyze deep semantic information but also retain shallow detail information as much as possible, UNet2+ adopts a central multi-level aggregation structure, which provides multi-level semantic information by integrating multiple resolution feature layers from different stages of the encoder. The deep supervision part deals with the gradient vanishing problem by introducing auxiliary segmentation outputs at multiple different levels of the network.

[0103] According to the shape characteristics of a single fluid inclusion microscopic image, the improvements of the semantic segmentation network of UNet2+ include:

[0104] ResNet34 is used as the encoder of the main network backbone to avoid gradient vanishing and explosion, so that the characteristic information of fluid inclusions can be passed into deeper network structures. ResNet-34 adopts a residual connection structure, in which each residual block contains a jump connection, that is, the input is directly added to the output of the residual block. Its network structure is relatively deep, but not as deep as some larger ResNet variants. It can better adapt to the image resolution of a single fluid inclusion microscopic image cropped at a ratio of 1.5 after the target detection task, and retain the contour information of the fluid inclusion to a greater extent.

[0105] The scSE module attention mechanism is used to process the input of the decoder, so that the network can automatically focus on channel and spatial features during training. As shown in Figure 6, the scSE module consists of two parts: the channel attention module on the left and the spatial attention module on the right. In the channel attention module, adaptive average pooling is first used to process the input feature data. Next, a 1×1 convolution layer is applied to reduce the number of channels first, and nonlinear processing is performed through the ReLU activation function. Then, another 1×1 convolution layer is used to restore the number of channels, and the Sigmoid function is applied to map the feature data to the nonlinear output to improve data smoothness, training stability and convergence. Finally, the obtained feature matrix is ​​multiplied element-by-element with the input to obtain the output of the channel attention module. In the spatial attention module, a 1×1 convolution layer is first used to reduce the number of channels of the input features to 1, and a feature matrix representing the spatial attention weights is generated through the Sigmoid function. Then, this feature matrix is ​​multiplied element-by-element with the input feature matrix to obtain the output of the spatial attention module. The purpose of this operation is to weight the input features to emphasize important information in the spatial domain. In order to fuse channel and spatial attention, the corresponding elements of their outputs are added together to obtain the overall output. This process effectively combines the channel relevance and spatial importance of features, thereby enhancing the representation ability and performance of the model.

[0106] The network training process of step S4 and step S6 is as follows Figure 7 As shown in the figure, the training adopts a five-fold cross-validation strategy, selecting four copies as training sets each time and the remaining copy as test set, repeating five times, and averaging the evaluation indicators obtained from the five test sets to obtain the final test set evaluation indicators. The Adam optimizer is used in network training to achieve efficient feature learning and recognition.

[0107] The evaluation indicators for the test set in the network training of step S4 and step S6 include:

[0108] (1) Mean Average Precision (mAP) @.5 represents The average precision of the model when detecting objects when the threshold is set to 0.5. mAP@.5:.95 means The average precision of the model when the threshold ranges from 0.5 to 0.95 and the step size is 0.05. The specific calculation formula of mAP is as follows:

[0109]

[0110] in, is the number of sample categories, i Indicates i Class sample, It represents the AP value corresponding to the i-th class sample. The specific calculation formula of AP is as follows:

[0111]

[0112]

[0113]

[0114] in, Indicates the difference between the predicted box and the real box whose confidence is greater than the threshold in a single microscopic image containing multiple fluid inclusions. The number of predicted boxes greater than the threshold, Indicates the total number of prediction boxes in the microscopic image whose confidence level of the category is greater than the threshold minus The number of Indicates the number of true boxes of this category in the image that have not been predicted. represents the precision rate (also known as accuracy), Represents recall rate. Select multiple confidence thresholds, draw a PR curve with precision as the y-axis and recall as the x-axis. Under the PR curve, The recall rate is The interpolation precision is is the recall value corresponding to the first interpolation point of the precision interpolation segment arranged in ascending order, n Indicates n precision interpolation segments, N The total number of precision interpolation segments.

[0115] (2) Mean Intersection over Union (MIoU) The specific calculation formula is as follows:

[0116]

[0117] in, is the total number of samples, is the number of sample categories, It refers to Of the samples, The class is predicted to be The total number of pixels of the class, It refers to Of the samples, The class is predicted to be The total number of pixels of the class, It refers to Of the samples, The class is also predicted to be The total number of pixels of the class.

[0118] S7: Use image processing technology to process the segmented image obtained in step S6, and estimate the aspect ratio information of the single-phase and two-phase fluid inclusions and the gas-liquid ratio information of the two-phase fluid inclusions based on the mapping relationship between the image pixels obtained in step S2 and the actual physical size.

[0119] like Figure 8 The figure shows the result of semantic segmentation of fluid inclusions and its outline and fitted rectangular frame. The segmented image obtained in step S6 can be drawn by using image processing technology. Figure 8 The yellow outline box of the single-phase and two-phase fluid inclusions that fit the inner layer. By drawing the yellow outline box of the inner layer that fits the fluid inclusion, the cyan minimum circumscribed rectangular box that best fits the outline can be calculated. By calculating the number of image pixels occupied by the length and width of the cyan minimum circumscribed rectangular box, based on the mapping relationship between the image pixels obtained in step S2 and the actual size, the aspect ratio of the single-phase and two-phase fluid inclusions can be estimated. At the same time, based on the result of the target detection in step S4, only the segmented image of the two-phase fluid inclusion is retained, and image processing operations are performed on it. By calculating the number of pixels of gas and liquid, the gas-liquid ratio of the two-phase fluid inclusion can be estimated. Directly processing the segmented image can avoid the interference of other redundant information, and the accuracy of the obtained fluid inclusion parameters is also higher.

[0120] Based on the above algorithm, fluid inclusion parameter analysis software was developed. The software integrates OCR, image processing, target detection and semantic segmentation algorithms. Users can obtain parameter analysis results of fluid inclusions by submitting microscopic images (including scale information) containing multiple fluid inclusions.

[0121] To verify its performance in fluid inclusion parameter analysis, the proposed method was extensively evaluated experimentally. The experimental data were microscopic images containing multiple fluid inclusions.

[0122] As shown in Table 1, the model is compared with several advanced object detection and recognition methods, including SSD and YOLOV5-m. The manually calibrated anchor boxes and categories are used as reference objects, and the mean average precision mAP@.5 and mAP@.5:.95 are selected as evaluation criteria. In Table 1, the improved YOLOX-m shows the best mAP@.5 and mAP@.5:.95 values. Compared with SSD, YOLOV5-m and YOLOX-m, the mAP@.5 of the improved YOLOX-m algorithm is improved by 3.6%, 2.5% and 1.8%, respectively. In addition, mAP@.5:.95 is also improved by 5.3%, 2% and 1.9%, respectively. This shows that the improved model significantly improves the detection accuracy of fluid inclusions, thereby improving the overall detection performance. The research data clearly shows the success of the proposed improvement method. Compared with other object detection models, these improvements significantly enhance the model's ability to detect fluid inclusions with higher accuracy and improve the quality of the detection results.

[0123] In addition, in Table 2, the present invention systematically evaluates the impact of different improvement methods on the detection performance of the YOLOX-m model through a series of ablation experiments. The results in Table 2 show that both improvement methods have a positive impact on enhancing the detection ability of fluid inclusions. Specifically, when the CBAM attention mechanism is introduced (as shown in N1 and N2), mAP@.5 is improved by 1.1% and mAP@.5:.95 is improved by 0.6%. This attention mechanism enhances the feature extraction ability of the network, enabling it to focus on target information more effectively, thereby significantly improving the detection performance of fluid inclusions. In addition, the N3 method uses SIoU instead of the traditional IoU as the regression loss function, resulting in an increase of 1.3% in mAP@.5 and 0.5% in mAP@.5:.95. These experiments demonstrate the effectiveness of the proposed improvement methods, which significantly improve the detection performance of the model for fluid inclusions, and are of great significance to the study of mineralogy and geology.

[0124] In order to verify the results of semantic segmentation, the present invention is compared with other semantic segmentation methods, including DeepLabV3+ and Unet, based on manual calibration as the reference object and Mean Intersection over Union (MIoU) as the evaluation criterion. The comparison results are shown in Table 3. In Table 3, except for DeepLabV3+, the mIoU index of the remaining models exceeds 0.9, among which the improved Unet2+ model has the best mIoU index, reaching 0.930. Compared with the original Unet2+ model, the semantic segmentation quality is significantly improved. This shows that the improved model significantly improves the segmentation accuracy of fluid inclusions, thereby improving the overall segmentation performance.

[0125] Finally, based on the above algorithm, a fluid inclusion parameter analysis software can be developed, which integrates multiple algorithms. Users can obtain the parameter analysis results of fluid inclusions by submitting fluid inclusion microscopic images (including scales), including the number, type, aspect ratio and gas-liquid ratio of fluid inclusions. The target detection results of fluid inclusions will be marked in the original image, and the parameter analysis results will be displayed in the status bar.

[0126] Table 1 Comparative experimental results of different target detection algorithms

[0127]

[0128] Table 2. Results of YOLOX-m ablation experiments on target detection

[0129]

[0130] Table 3 Comparative experimental results of different semantic segmentation algorithms

[0131]

[0132] The above schematically describes the invention and its implementation methods, which is not restrictive. Without departing from the spirit or basic features of the invention, the invention can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention. The actual structure is not limited to this, and any figure mark in the claims should not limit the claims involved. Therefore, if a person of ordinary skill in the art is inspired by it, without departing from the purpose of the invention, a structural method and an embodiment similar to the technical solution are designed without creativity, which should all fall within the scope of protection of this patent. In addition, the word "including" does not exclude other elements or steps, and the word "one" before the element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.

Claims

1. A fluid inclusion analysis method based on target detection and semantic segmentation, characterized in that: The steps include: S1: Collecting a microscopic image containing fluid inclusions as an image to be inspected; S2: Identify the scale information in the image to be inspected and obtain the mapping relationship between the image pixels and the actual physical size; S3: Annotate the image to be inspected to obtain the target detection frame position and category information label; S4: Inputting the image to be inspected, the position of the target detection frame in the image to be inspected, and the category information label into the improved YOLOX-m target detection network to identify the number, position, and category information of the fluid inclusions in the image to be inspected; the improved YOLOX-m target detection network includes four key parts: an input end, a backbone network, a neck network, and an output end; Among them, the backbone network of YOLOX-m adopts the CSPDarknet network architecture, including multiple convolutional layers, CSP layers, batch normalization layers and activation function layers; Introduce the CBAM attention mechanism module; The specific method of introducing the CBAM attention mechanism module in the YOLOX-m network architecture is as follows: between the connections from the last three CSP layers of the backbone network CSPDarknet network architecture to the neck network, three CBAM attention modules with the same structure are introduced, and the CBAM module includes two sub-modules: a channel attention module and a spatial attention module; The comprehensive loss function SIoU is constructed as a loss function, and the comprehensive loss function SIoU includes IoU loss, angle loss, distance loss and shape loss; the calculation method of the comprehensive loss SIoU is as follows: (1) IoU is used to calculate the loss between the predicted box and the true box. The specific formula is as follows: b represents the anchor box, S represents area; superscript gt Represents the real box, superscript pr represents the prediction box; Represents the area of ​​the intersection between the predicted box and the true box. Represents the area of ​​the predicted box and the true box; (2) Used to calculate the distance loss between the predicted box and the real box. The specific formula is as follows: in, , and The calculation formula is: w and h Represents width and height respectively, subscript r Represents a rectangle; Represents the width and height of the minimum bounding rectangle of the real box and the predicted box respectively; x and y Represents the horizontal and vertical coordinates, respectively, and the subscript c Represents the center point of the anchor box; Respectively represent the horizontal and vertical coordinates of the center point of the real frame, Respectively represent the horizontal and vertical coordinates of the center point of the prediction box; In the formula, Used to calculate the angle loss between the predicted box and the real box. The specific formula is as follows: σ Represents the distance between the center point of the predicted box and the center point of the real box, dh Indicates the height difference between the center point of the predicted box and the center point of the real box. h Represents height; x and y represent the horizontal and vertical coordinates respectively, Respectively represent the horizontal and vertical coordinates of the center point of the real frame, Respectively represent the horizontal and vertical coordinates of the center point of the prediction box; (3) It is used to calculate the shape loss between the predicted box and the real box. The specific formula is as follows: in, Controls the degree of focus on shape loss, and its value range is [2, 6], and The calculation formula is: Represents the width and height of the real box respectively , Respectively represent the width and height of the prediction box; S5: cropping the image to be inspected according to the fluid inclusion position information obtained by the target detection in step S4 to obtain a microscopic image containing only a single fluid inclusion; annotating the microscopic image containing only a single fluid inclusion at the pixel level to obtain a corresponding semantic segmentation label; S6: Inputting only a single fluid inclusion microscopic image and its corresponding semantic segmentation label into the improved UNet2+ semantic segmentation network to obtain the segmentation image predicted by the network; the improved UNet2+ semantic segmentation network, the main network backbone of the encoder part adopts the ResNet34 architecture; the input of the decoder part uses the scSE attention module to process features; S7: Use image processing technology to process the segmented image obtained in step S6, and estimate the aspect ratio information of the single-phase and two-phase fluid inclusions and the gas-liquid ratio information of the two-phase fluid inclusions based on the mapping relationship between the image pixels obtained in step S2 and the actual physical size.

2. The fluid inclusion analysis method based on target detection and semantic segmentation according to claim 1, characterized in that: In step S2, the method for identifying the scale information in the image to be inspected is a method combining optical character recognition and image processing technology.

3. The fluid inclusion analysis method based on target detection and semantic segmentation according to claim 1, characterized in that: The category information described in step S3 is single-phase fluid inclusion information and two-phase fluid inclusion information.

4. The fluid inclusion analysis method based on target detection and semantic segmentation according to claim 3, characterized in that: ResNet-34 consists of 34 parameter layers and adopts a residual connection structure, in which each residual block structure directly passes the information of the previous layer to the subsequent layer through a skip connection.

5. The fluid inclusion analysis method based on target detection and semantic segmentation according to claim 4, characterized in that: The scSE module consists of a channel attention module and a spatial attention module.

6. A fluid inclusion analysis system based on target detection and semantic segmentation, characterized in that: Use the fluid inclusion analysis method based on target detection and semantic segmentation as described in any one of claims 1-5.

Citation Information

Patent Citations

  • YOLOV5-based inclusion detection method

    CN116229458A

  • Method of precisely measuring volume of hydrocarbon inclusion

    CN106705835A

  • Method and system for accurately identifying and segmenting target under microscopic image

    CN113312978A