A method, system and related devices for automated identification of rock and mineral thin sections

By acquiring and processing thin section images of rocks and minerals, and utilizing feature point matching and multi-channel fusion technology, combined with a classification model to generate identification reports, the problems of low efficiency and inconsistent results in thin section identification of rocks and minerals have been solved, achieving fully automated and efficient identification.

CN123160948APending Publication Date: 2026-11-24SICHUAN NATURAL RESOURCES DIGITAL TECHNOLOGY CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611361862.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-03
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing thin section identification techniques for rocks and minerals lack full-process automation, resulting in low identification efficiency and poor consistency and repeatability of results. Independent operation of each step leads to data transmission errors and subjective judgment biases.

Method used

By acquiring single-polarized light and multiple orthogonally polarized light images, feature point matching and angle correction are performed to form a multi-channel fused image. Then, using coarse and fine classification models, combined with rock category labels, hierarchical classification is performed to finally generate an identification report.

Benefits of technology

It has achieved full automation of the process from thin section images of rocks and minerals to identification reports, which has improved identification efficiency, reduced data transmission errors and subjective biases, and ensured the consistency and repeatability of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160948A_ABST
    Figure CN123160948A_ABST
Patent Text Reader

Abstract

This application discloses a method, system, and related apparatus for automated identification of rock and mineral thin sections, which improves the efficiency of automated identification of rock and mineral particles. The method for automated identification of rock and mineral thin sections includes: obtaining rock category labels for an image group of the same rock and mineral thin section sample; performing feature point matching on the target image and calculating the rotation angle of the target image; performing angle correction and spatial registration on the target image, and stitching and recombining it along the channel axis to form a multi-channel fused image, which is then segmented and extracted to obtain rock and mineral particle objects; classifying mineral types to obtain mineral category labels corresponding to each rock and mineral particle object; based on the mineral category labels and the segmented regions of the rock and mineral particle objects, calculating the area percentage of each mineral corresponding to the mineral category label, and converting the area percentage into a content percentage based on the density parameter of each mineral; and performing multi-dimensional comprehensive reasoning identification based on the rock category labels, mineral category labels, and content percentages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of rock and mineral identification technology, and in particular to a method, system and related apparatus for automated identification of thin sections of rocks and minerals. Background Technology

[0002] Thin section identification of rocks and minerals is a fundamental task in geological research and mineral resource exploration. It involves observing the optical characteristics, morphology, structure, and content relationships of mineral grains in thin sections using a polarizing microscope to determine the type and name of the rock. Traditional thin section identification relies primarily on geologists manually observing the optical characteristics of minerals under a polarizing microscope, such as crystal form, cleavage, interference colors, and extinction positions. This is combined with professional experience to determine the mineral type and estimate the content of each mineral, ultimately leading to an identification report. This method is highly dependent on the professional experience of the identifyrs, has low efficiency, and the results are subjective, making it difficult to guarantee the consistency and repeatability of the identification conclusions. In recent years, with the development of deep learning and computer vision technologies, several automated technical solutions have emerged in the field of thin section identification. For example, some methods use convolutional neural networks to classify microscopic images of rock thin sections, achieving automatic identification of rock types; some methods use image segmentation technology to segment mineral grain regions, achieving separation of mineral grains from the background or pores; and some methods introduce large language models to generate descriptive text for rock thin section images.

[0003] However, existing rock and mineral thin section image analysis technologies are all designed independently for single steps in the identification process, lacking organic integration between processing steps. A complete automated identification process, from inputting raw rock and mineral thin section images to outputting standardized identification reports, has not yet been formed. In practical applications, steps such as image classification, mineral segmentation, mineral identification, content calculation, naming analysis, and report writing require manual operation of different tools or systems. Furthermore, the independent operation of each step means that the output of one step cannot serve as a constraint or input guide for the next. In other words, data transfer and result integration between steps heavily rely on manual intervention. This not only leads to low overall identification efficiency but also easily introduces data transfer errors and subjective judgment biases during manual integration, making it difficult to guarantee the consistency and repeatability of identification results. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a method, system, and related apparatus for automated identification of rock and mineral thin sections, which improves the efficiency of automated identification of rock and mineral particles.

[0005] The technical solution provided in this application is described below:

[0006] The first aspect of this application provides a method for automated identification of rock and mineral thin sections, comprising: An image set of a target rock mineral thin section sample is acquired. The image set includes at least one single-polarized image and multiple orthogonally polarized images with different rotation angles. The orthogonally polarized images include a reference image with the same rotation angle as the single-polarized image and at least one target image with a different rotation angle than the reference image. The image group is input into a preset coarse classification model for optical path condition recognition, and the image group is coarsely classified into the corresponding rock category according to the recognition result to obtain the rock category label; Based on the reference image, feature point matching is performed on at least one of the target images, and the rotation angle of at least one of the target images relative to the reference image is calculated; Based on the rotation angle, at least one of the target images is angle-corrected and spatially registered, and the corrected and registered target images are stitched and recombined with at least one single-polarized image along the channel axis to form a multi-channel fused image; The multi-channel fused image is segmented and extracted to obtain multiple rock and mineral particle objects; Multiple rock and mineral particle objects are input into a pre-selected fine classification model for mineral classification, and mineral type labels corresponding to each of the multiple rock and mineral particle objects are obtained. The fine classification model is pre-selected based on the rock category labels. Based on the mineral type label and the segmented regions of the multiple rock and mineral particle objects, the area percentage of each mineral corresponding to the mineral type label is calculated, and combined with the density parameter of each mineral, the area percentage is converted into the content percentage. The rock category label, the mineral type label, and the content percentage are input into a preset rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification, and an identification report is obtained.

[0007] Optionally, the step of performing feature point matching on at least one of the target images based on the reference image and calculating the rotation angle of at least one of the target images relative to the reference image includes: Initial feature points are extracted from the reference image and at least one of the target images, respectively; The correct feature points are obtained by screening from the initial feature points using a two-way cross-matching and random sampling consensus algorithm. Match the correct feature points of the reference image with the correct feature points of at least one of the target images to establish a mapping relationship between the correct feature points of the reference image and the correct feature points of at least one of the target images; Based on the mapping relationship, an affine transformation matrix between at least one target image and the reference image is calculated, and the rotation angle of at least one target image relative to the reference image is calculated based on the affine transformation matrix.

[0008] Optionally, the step of performing angle correction and spatial registration on at least one of the target images based on the rotation angle, and then stitching and recombining the corrected and registered target images with at least one single-polarized image along the channel axis to form a multi-channel fused image, includes: Based on the rotation angle, at least one of the target images is rotated and interpolated for resampling to obtain at least one angle-corrected target image. At least one angle-corrected target image is translated and spatially pixel-coordinate aligned with the reference image to obtain at least one spatially registered target image. At least one of the single-polarized images and at least one of the spatially registered target images are stacked sequentially along the channel axis according to the rotation angle to form the multi-channel fused image.

[0009] Optionally, the segmentation and extraction of the multi-channel fused image to obtain multiple rock and mineral particle objects includes: The multi-channel fused image is segmented according to a preset adaptive unsupervised segmentation algorithm to obtain multiple segmentation fragments; Extract the particle boundaries and pore regions of multiple fragments, and calculate the particle area of ​​multiple fragments based on the particle boundaries and pore regions; Based on a preset minimum area filtering threshold, fragments with a particle area smaller than the minimum area threshold are removed to obtain the remaining fragments. Extract the pixel mask data of the remaining segmented fragments to obtain multiple rock and mineral particle objects, wherein one pixel mask data corresponds to one rock and mineral particle object.

[0010] Optionally, the step of inputting multiple rock and mineral particle objects into a pre-selected fine classification model for mineral type classification to obtain mineral type labels corresponding to each of the multiple rock and mineral particle objects includes: Multiple sub-images corresponding to the rock and mineral particle objects are cropped from the multi-channel fused image, and each sub-image is scaled to a uniform standard size. Each scaled sub-image is input into a pre-selected fine classification model for analysis, and the output is the probability distribution of the mineral type corresponding to each scaled sub-image. Extract the maximum probability value from the probability distribution and obtain the mineral type label corresponding to the maximum probability value. The mineral type label has a one-to-one correspondence with the rock and mineral particle object.

[0011] Optionally, after obtaining the mineral type tags corresponding to each of the multiple rock and mineral particle objects, the method further includes: Based on the probability distribution, the confidence score of the maximum probability value is determined as the confidence score of the rock and mineral particle object; Based on the confidence score and a preset confidence threshold, each rock and mineral particle object is subjected to gating filtering to remove rock and mineral particle objects with a confidence score lower than the preset confidence threshold.

[0012] Optionally, the step of inputting the rock category label, the mineral type label, and the content percentage into a preset rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification to obtain an identification report includes: The mineral type labels and content percentages are normalized, and a pre-set rock and mineral identification knowledge base is retrieved based on the normalized data to obtain at least one candidate lithology. At least one of the candidate lithologies is scored using a multi-dimensional weighted score according to a preset weight matrix to obtain a scoring result. The weight matrix includes naming matching, mineral assemblage similarity, content matching, structure matching, and tectonic matching. According to the preset conflict diagnosis rules, at least one of the candidate lithologies is subjected to conflict analysis to obtain conflict analysis results. The scoring results and the conflict detection results are input into the large language model in the agent for controlled adjudication to determine the name of the rock. Based on the rock name, the mineral type label, and the content percentage, generate a mineral composition table containing mineral names and percentage contents; The mineral composition table is combined with the structural and tectonic feature data of the rock category labels to obtain identification and analysis data; Input the identification and analysis data into a preset identification report template, and output an identification report containing the sample number, the name of the rock, the mineral composition table, the structural description, and the identification basis.

[0013] A second aspect of this application provides a system for automated identification of rock and mineral thin sections, comprising: The acquisition unit is used to acquire an image set of a target rock and mineral thin section sample. The image set includes at least one single-polarized image and multiple orthogonal polarized images with different rotation angles. The orthogonal polarized images include a reference image with the same rotation angle as the single-polarized image and at least one target image with a different rotation angle than the reference image. The coarse classification unit is used to input the image group into a preset coarse classification model for optical path condition recognition, and to coarsely classify the image group into the corresponding rock category according to the recognition result to obtain the rock category label; A matching unit is configured to perform feature point matching on at least one of the target images based on the reference image, and calculate the rotation angle of at least one of the target images relative to the reference image; The correction and registration unit is used to perform angle correction and spatial registration on at least one of the target images based on the rotation angle, and to stitch and reassemble the corrected and registered target images with at least one single-polarized image along the channel axis to form a multi-channel fused image. The segmentation and extraction unit is used to segment and extract the multi-channel fused image to obtain multiple rock and mineral particle objects; The fine classification unit is used to input multiple rock and mineral particle objects into a pre-selected fine classification model to classify mineral types and obtain mineral type labels corresponding to each of the multiple rock and mineral particle objects. The fine classification model is pre-selected based on the rock category labels. The calculation unit is used to calculate the area percentage of each mineral corresponding to the mineral type label based on the segmented regions of the mineral type label and the plurality of rock and mineral particle objects, and convert the area percentage into the content percentage by combining the density parameter of each mineral. The identification unit is used to input the rock category label, the mineral type label, and the content percentage into a preset rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification, and to obtain an identification report.

[0014] A third aspect of this application provides an electronic device, the electronic device comprising: Processor, memory, input / output units, and bus; The processor is connected to the memory, the input / output unit, and the bus; The memory stores a program, which the processor invokes to execute the method for automated identification of rock and mineral thin sections, as described in the first aspect and any optional aspect of the first aspect.

[0015] The fourth aspect of this application provides a computer-readable storage medium storing a program that, when executed on a computer, performs the method for automated identification of rock and mineral thin sections as described in the first aspect and any optional method of the first aspect.

[0016] As can be seen from the above technical solutions, this application has the following beneficial effects: This application provides a method for automated identification of rock and mineral thin sections. First, an image group containing at least one single-polarized image and multiple orthogonally polarized images with different rotation angles is acquired. Using the orthogonally polarized image with the same rotation angle as the single-polarized image as the reference image, feature point matching is performed on the remaining target images to calculate the rotation angle. Then, based on the rotation angle, the target images are angle-corrected and spatially registered, and then stitched and recombined along the channel axis to form a multi-channel fused image. This achieves precise alignment and orderly encoding of the optical information of the same mineral grain under different rotation angles and different optical path conditions in spatial position, so that subsequent segmentation and classification can simultaneously utilize the mineral morphology and color information under single-polarized light and the interference color change information under orthogonally polarized light at multiple angles. Then, a coarse classification model is used to identify the optical path conditions of the image group and classify it into the corresponding rock categories to obtain rock category labels. A fine classification model is then pre-selected based on these rock category labels, achieving a hierarchical classification from rock category constraints to detailed mineral classification. This allows the fine classification stage to identify species only within the mineral subset corresponding to a specific rock category, effectively reducing the candidate mineral species space, lowering the classification difficulty of the fine classification model, and improving the accuracy and confidence of mineral species identification. Next, multiple independent rock and mineral particle objects are obtained by segmenting and extracting the multi-channel fused image. Each rock and mineral particle object is input into a pre-selected fine classification model for mineral species classification to obtain its corresponding mineral species label. Then, based on the mineral species label and the segmented regions of the rock and mineral particle objects, the area proportion of each mineral is calculated and converted into a content proportion by combining density parameters. This achieves automated mineral content analysis, transforming mineral content from manual estimation to objective quantitative calculation based on particle-level segmentation regions and classification results, improving the accuracy and repeatability of content statistics. Finally, by inputting rock category tags, mineral type tags, and content percentages into the rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification, and obtaining an identification report, the entire process from inputting the original rock and mineral thin section image set to outputting a standardized identification report is automated. Data transfer and result connection between each stage are completed automatically by the system. The output of the previous stage serves as the input or constraint guide for the next stage, which greatly improves the overall efficiency of rock and mineral thin section identification. At the same time, it reduces data transfer errors and subjective judgment biases introduced during manual connection, ensuring the consistency and repeatability of identification results. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1A schematic flowchart of an embodiment of the method for automated identification of rock and mineral thin sections provided in this application; Figure 2 A flowchart illustrating the first sub-implementation of the method for automated identification of rock and mineral thin sections provided in this application; Figure 3 A flowchart illustrating the second sub-implementation of the method for automated identification of rock and mineral thin sections provided in this application; Figure 4 A flowchart illustrating the third sub-implementation of the method for automated identification of rock and mineral thin sections provided in this application; Figure 5 A flowchart illustrating the fourth sub-implementation of the method for automated identification of rock and mineral thin sections provided in this application; Figure 6 A flowchart illustrating the fifth sub-implementation of the method for automated identification of rock and mineral thin sections provided in this application; Figure 7 A schematic diagram of an embodiment of the automated identification system for thin sections of rocks and minerals provided in this application; Figure 8 A schematic diagram of an embodiment of the electronic device provided in this application. Detailed Implementation

[0019] This application provides a method, system, and related apparatus for automated identification of rock and mineral thin sections, which can improve the efficiency of automated identification of rock and mineral particles.

[0020] It should be noted that the automated identification method for rock and mineral thin sections provided in this application can be applied to a terminal, a system, or a server. For example, the terminal can be a smartphone, computer, tablet, portable computer, or a desktop computer, etc. For the sake of convenience in describing the embodiments, a system will be used as the execution subject of the embodiments of the following methods.

[0021] Please see Figure 1 This application first provides an embodiment of a method for automated identification of rock and mineral thin sections, the method comprising: Step S101: Acquire an image set of the target rock mineral thin section sample. The image set includes at least one single-polarized light image and multiple orthogonal polarized light images with different rotation angles. The orthogonal polarized light images include a reference image with the same rotation angle as the single-polarized light image and at least one target image with a different rotation angle than the reference image. Step S102: Input the image group into the preset coarse classification model for optical path condition recognition, and coarsely classify the image group into the corresponding rock category according to the recognition result to obtain the rock category label; Step S103: Based on the reference image, perform feature point matching on at least one target image and calculate the rotation angle of at least one target image relative to the reference image. Step S104: Based on the rotation angle, perform angle correction and spatial registration on at least one target image, and stitch and reassemble the corrected and registered target image with at least one single-polarized image along the channel axis to form a multi-channel fused image; Step S105: Segment and extract the multi-channel fused image to obtain multiple rock and mineral particle objects; Step S106: Input multiple rock and mineral particle objects into a pre-selected fine classification model to classify mineral types and obtain the mineral type labels corresponding to each of the multiple rock and mineral particle objects. The fine classification model is obtained in advance based on the rock category labels. Step S107: Based on the mineral type label and the segmented regions of multiple rock and mineral particle objects, calculate the area percentage of each mineral corresponding to the mineral type label, and convert the area percentage into the content percentage by combining the density parameter of each mineral. Step S108: Input the rock category label, mineral type label, and content percentage into the preset rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification, and obtain an identification report.

[0022] In step S101 of the embodiment, the target rock and mineral thin section sample is first imaged under single-polarized light path conditions to obtain at least one single-polarized light image. The single-polarized light image can reflect the morphological characteristics of mineral particles under natural light, such as color, crystal shape, cleavage, and protrusions, and is an important basis for identifying mineral types. Then, the image is switched to orthogonal polarized light path conditions. The position of the target rock and mineral thin section sample on the microscope stage is kept fixed. The relative angle of the orthogonal polarization is changed by rotating the stage or polarizing lens. Orthogonal polarized light images are acquired at multiple different rotation angles. The orthogonal polarized light images can reflect the optical characteristics of mineral particles under orthogonal polarization, such as interference colors, extinction positions, and twinning. These optical characteristics change regularly with the rotation angle and are key information for identifying mineral types.

[0023] Among the acquired orthogonally polarized images, one with the same rotation angle as the single-polarized image is designated as the reference image. This reference image serves as the spatial reference standard for subsequent feature point matching and rotation angle calculation; its rotation angle is typically set to 0°. The remaining orthogonally polarized images with different rotation angles are designated as target images. The number of target images can be set according to the complexity of the mineral composition and the required identification accuracy of the target rock / mineral thin section sample, typically covering a rotation angle range from 0° to 90° and sampled at equal intervals. At least one single-polarized image and multiple orthogonally polarized images with different rotation angles are combined into an image group for the same target rock / mineral thin section sample. Each image in the image group is labeled with its corresponding optical path condition type and rotation angle information, while acquisition parameters such as image resolution, pixel size, and magnification are recorded.

[0024] In step S102 of this embodiment, the image set of the acquired target rock and mineral thin section sample is input into a preset coarse classification model. The coarse classification model first performs optical path condition identification on each image in the image set. The purpose of optical path condition identification is to determine the type of optical path condition to which each image belongs. It makes a distinction based on the differences in overall brightness distribution, color saturation, texture complexity, and optical performance of mineral grains under different optical path conditions. For example, single-polarized images usually have richer original color information, while orthogonally polarized images may show a completely extinct dark field at certain angles. After completing the optical path condition identification of each image, the optical path condition combination type of the entire image set is determined based on the identification results, and the entire image set is input into the rock category classification branch of the coarse classification model to perform coarse-grained classification of the rock category to which the target rock and mineral thin section sample belongs.

[0025] The coarse classification model roughly classifies the target rock and mineral thin section sample into a pre-defined rock category. These categories can include sandstone, carbonate rocks, volcanic rocks, metamorphic rocks, and other rock types that differ significantly in mineral composition and structural characteristics. The coarse classification model outputs the classification result of the target rock and mineral thin section sample into its corresponding rock category and the corresponding classification confidence score, and this classification result is designated as the rock category label. The core function of the rock category label is to provide category constraints for subsequent image correction parameter selection, mineral grain segmentation strategies, and routing of subdivided mineral classification models. This allows subsequent processing steps to adopt targeted processing strategies based on the mineralogical characteristics of different rock categories, thereby avoiding unconstrained classification within a global space of hundreds of mineral species and effectively narrowing down the range of candidate mineral species.

[0026] In step S103 of the embodiment, key points with significant visual features are detected in both the reference image and the target image. These key points typically correspond to unique and distinguishable locations in the image, such as corners, edge intersections, texture abrupt changes, and cleavage line intersections of mineral grains. Subsequently, feature description is performed on the local image region surrounding each detected key point, generating a feature vector that characterizes the local visual features of that key point. Finally, by calculating the similarity between the feature vectors of the key points in the reference image and the feature vectors of the key points in the target image, the key points with the highest similarity are paired as matching point pairs, thereby establishing a feature point mapping relationship between the reference image and the target image. Various feature point detection and description algorithms can be used to implement the above process. Alternatively, the initial matching results can be filtered and optimized according to image quality and matching accuracy requirements to eliminate mismatched point pairs and improve the reliability of the matching results.

[0027] After obtaining the feature point matching results between the reference image and the target image, the rotation angle of the target image relative to the reference image is calculated based on the matching point pairs. Since the target image is an orthogonally polarized image acquired at a different rotation angle than the reference image, it undergoes an overall rotation transformation relative to the reference image. By analyzing the differences between the coordinate positions of the matching point pairs in the reference image and their corresponding coordinate positions in the target image, geometric transformation parameters that describe the spatial transformation relationship between the two images are solved. The rotation angle of the target image relative to the reference image is then decomposed from these geometric transformation parameters. The above feature point matching and rotation angle calculation process is performed independently for each target image to obtain the rotation angle parameters of each target image relative to the reference image. These rotation angle parameters will serve as the quantitative basis for subsequent angle correction and spatial registration. When the feature point matching results of a target image are insufficient to reliably calculate the rotation angle, the rotation angle of the target image can be obtained by recursively matching adjacent angle images or by estimation based on known sampling angle intervals.

[0028] In step S104 of the embodiment, a rotation transformation is performed on the target image according to the rotation angle of the target image relative to the reference image, so that the mineral particle arrangement direction in the target image is consistent with the mineral particle arrangement direction in the reference image. During the rotation transformation, since the pixel coordinates of the rotated image are no longer perfectly aligned with the original pixel grid, an interpolation resampling method is used to resample the pixels of the rotated image to obtain the image pixel values ​​on the regular grid, avoiding image distortion and jagged effects caused by rotation. The specific process of spatial registration is to further perform translation compensation on the target image based on angle correction, so that the mineral particles in the target image are precisely aligned with the corresponding mineral particles in the reference image in spatial pixel coordinates, eliminating spatial position offsets caused by small sample displacements, optical distortions, or stage rotation center deviations during the acquisition process, thereby ensuring that the pixel positions of the same mineral particle in different images correspond one-to-one.

[0029] After completing the angle correction and spatial registration of at least one target image, the corrected and registered target image is stitched and recombined with at least one single-polarized image along the channel axis to form a multi-channel fused image. The channel axis is the dimension in the image tensor used to represent color channels or information channels. The color channels of a single image and images at different rotation angles are treated as independent information channels and stacked sequentially along the channel axis. This allows the multi-channel fused image to simultaneously contain the morphological and color information of the single-polarized image and the interference color change information of multiple orthogonally polarized images at different rotation angles at the same spatial pixel location. Through this stitching and recombining method along the channel axis, the optical information of the same mineral particle under different optical path conditions and rotation angles is precisely corresponding in spatial location, i.e., particle overlap. This enables subsequent mineral particle segmentation and mineral type classification to utilize multi-dimensional and multi-angle optical information simultaneously without repeatedly switching and aligning between multiple independent images.

[0030] In step S105 of the embodiment, based on the differences in color, texture, brightness, and multi-angle optical response modes of different regions in the multi-channel fused image, the boundary contours between mineral particles and the interface between mineral particles and pores are automatically detected. The multi-channel fused image is then divided into several connected regions with relatively consistent internal features, each connected region corresponding to a potential mineral particle or pore. During the segmentation process, the multi-angle optical information provided by the multi-channel fused image is fully utilized to comprehensively determine whether the optical behavior of adjacent regions is consistent at different rotation angles. This distinguishes regions belonging to the same mineral particle from regions belonging to different mineral particles, reducing the problems of over-segmentation (erroneously splitting a mineral particle into multiple regions) or under-segmentation (erroneously merging multiple mineral particles into one region) caused by insufficient information in a single image.

[0031] After segmenting the multi-channel fused image, the segmented connected regions are extracted and filtered to obtain multiple rock and mineral particle objects. First, a corresponding pixel mask is generated for each segmented connected region. The pixel mask is a binary matrix of the same size as the multi-channel fused image, used to accurately mark all pixel positions covered by the connected region. Then, based on the pixel mask data, geometric feature data for each connected region is calculated, including morphological parameters such as pixel area, perimeter, major and minor axis ratio, roundness, and boundary roughness, used to describe the geometric morphological characteristics of the mineral particles. The segmented connected regions are filtered according to preset selection criteria, removing fragments with excessively small pixel areas, dark areas that are clearly pores, and local areas that do not possess complete particle morphology. The remaining connected regions that conform to the morphological characteristics of mineral particles are identified as rock and mineral particle objects. Each rock and mineral particle object contains its corresponding pixel mask data and geometric feature data, serving as the basic processing unit for subsequent mineral type classification and mineral content calculation. The number of obtained rock and mineral particle objects depends on the actual density and grain size distribution of the mineral particles in the target rock and mineral thin section sample, as well as the segmentation accuracy of the algorithm.

[0032] In step S106 of this embodiment, multiple rock and mineral particle objects are input into a pre-selected fine classification model for mineral classification to determine the specific mineral type corresponding to each rock and mineral particle object. The fine classification model is pre-selected based on the rock category label. After completing the coarse classification in step S102 and obtaining the rock category label, a set of fine mineral classification models corresponding to the rock category is selected from a pre-trained set of multiple sets of fine mineral classification models based on the rock category label. The selected fine mineral classification model is only trained for the mineral types that may appear in the rock category, so its classification scope is limited to the mineral subset corresponding to the rock category, without needing to cover all mineral types globally. Each rock and mineral particle object is cropped from the multi-channel fused image to obtain a sub-image corresponding to the rock and mineral particle object. The sub-image contains the complete optical information of the mineral particle in all channels, and the sub-image is input into the pre-selected fine classification model for classification inference.

[0033] The fine-grained classification model performs multi-level feature extraction and classification inference on the sub-images of input rock and mineral particles, outputting the probability distribution of the rock and mineral particles belonging to each candidate mineral type. The specific range of candidate mineral types is determined by the rock category corresponding to the selected fine-grained classification model. For example, candidate mineral types for sandstone include quartz, feldspar, rock fragments, mica, calcite, and clay minerals, while candidate mineral types for carbonate rocks include calcite, dolomite, magnesite, clay minerals, quartz, and pyrite. The candidate mineral type with the highest probability value is selected from the probability distribution and identified as the mineral type label for that rock and mineral particle. In this way, each rock and mineral particle is assigned a corresponding mineral type label, and there is a one-to-one correspondence between the mineral type label and the rock and mineral particle. Since the classification range of the fine-grained classification model is constrained by the rock category label, the fine-grained classification model only needs to identify types within a specific subset of minerals in a particular rock category, thereby effectively reducing the classification difficulty and improving the accuracy of mineral type identification.

[0034] In step S107 of the embodiment, based on the pixel mask data of each rock and mineral particle object, the number of pixels covered by the rock and mineral particle object in the multi-channel fused image is counted, i.e., the pixel area of ​​the mineral particle. Then, based on the mineral type label corresponding to each rock and mineral particle object, the pixel areas of all rock and mineral particle objects with the same mineral type label are accumulated and summarized to obtain the total pixel area of ​​each mineral in the target rock and mineral thin section sample. The total pixel area of ​​each mineral is divided by the sum of the pixel areas of all rock and mineral particle objects to obtain the area ratio of that mineral in the target rock and mineral thin section sample. The area ratio reflects the proportion of area occupied by each mineral on the two-dimensional cross-section of the rock and mineral thin section, and is the basic data for calculating the relative content of minerals. Its value ranges from 0 to 1, and the sum of the area ratios of all minerals is 1.

[0035] After obtaining the area percentage of each mineral, the area percentage is converted into a content percentage by combining the density parameter of each mineral. Since different minerals have significantly different densities (e.g., quartz has a density of approximately 2.65 g / cm³ while calcite has a density of approximately 2.71 g / cm³), the area percentage cannot be directly equated to the mass or volume content of the mineral. A density-weighted correction is needed based on the mineral's density parameter. Specifically, the area percentage of each mineral is multiplied by its density parameter to obtain its density-weighted area value. Then, this density-weighted area value is divided by the sum of the density-weighted area values ​​of all minerals, and after normalization, the content percentage of that mineral is obtained. The content percentage reflects the relative abundance of each mineral in the target rock thin section sample and is the core quantitative basis for rock identification and identification reports. The density parameter of each mineral can be obtained from a pre-set mineralogical standard density data table based on the mineral type. For minerals with isomorphous substitution, the average density value of the mineral series can be used.

[0036] In step S108 of the embodiment, the rock and mineral naming analysis agent is an intelligent analysis proxy built based on a large language model. It integrates a rock and mineral identification knowledge base, which includes professional domain knowledge such as rock naming rules, mineral characteristic databases, common rock and mineral assemblage standards, and identification standard specifications. After receiving the rock category label, mineral type label, and content percentage, the rock and mineral naming analysis agent first standardizes the input data, unifying the expression of mineral type names and normalizing the format of content percentages. Then, based on the standardized data, it retrieves candidate rock names from the rock and mineral identification knowledge base that are similar to the mineral composition and content characteristics of the current target rock and mineral thin section sample. The number of candidate rock names can be controlled according to the retrieval similarity threshold.

[0037] The rock and mineral naming analysis agent performs multi-dimensional comprehensive reasoning on the retrieved candidate rock names. It evaluates and compares candidate rock names from multiple dimensions, including mineral composition, relative mineral content ratios, structural features, rock classification, and the presence of diagnostic minerals. Combining naming rules and diagnostic mineral knowledge from the rock and mineral identification knowledge base, it eliminates candidate rock names with conflicting mineral compositions, contradictory content ratios, or inconsistencies with naming rules, ultimately determining the accurate rock name of the target rock and mineral thin section sample. After completing the rock naming, a standardized identification report is generated based on the rock name, mineral type labels, content percentages, and the reasoning process of the rock and mineral naming analysis agent. The identification report includes the sample number, rock name, mineral composition table, structural description, and explanation of the identification basis. The mineral composition table lists the name and corresponding content percentage of each mineral in tabular form, and the explanation of the identification basis records the reasoning process of the rock naming and the specific identification rules used. Through multi-dimensional comprehensive reasoning of the rock and mineral identification analysis agent, the automatic conversion from mineral composition and content data to rock identification and identification reports is realized. The entire process of rock and mineral thin section identification, from image acquisition to report output, is completed automatically without the need for manual data transfer and result connection between each stage.

[0038] The method for automated identification of rock and mineral thin sections disclosed in this application firstly involves acquiring an image set containing at least one single-polarized image and multiple orthogonally polarized images with different rotation angles. Using the orthogonally polarized image with the same rotation angle as the single-polarized image as the reference image, feature point matching is performed on the remaining target images to calculate the rotation angle. Then, based on the rotation angle, the target images are angle-corrected and spatially registered, and then stitched and recombined along the channel axis to form a multi-channel fused image. This achieves precise alignment and orderly encoding of the optical information of the same mineral grain under different rotation angles and different optical path conditions in spatial position, enabling subsequent segmentation and classification to simultaneously utilize the mineral morphology and color information under single-polarized light as well as the interference color change information from multiple angles under orthogonally polarized light. Then, a coarse classification model is used to identify the optical path conditions of the image group and classify it into the corresponding rock categories to obtain rock category labels. A fine classification model is then pre-selected based on these rock category labels, achieving a hierarchical classification from rock category constraints to detailed mineral classification. This allows the fine classification stage to identify species only within the mineral subset corresponding to a specific rock category, effectively reducing the candidate mineral species space, lowering the classification difficulty of the fine classification model, and improving the accuracy and confidence of mineral species identification. Next, multiple independent rock and mineral particle objects are obtained by segmenting and extracting the multi-channel fused image. Each rock and mineral particle object is input into a pre-selected fine classification model for mineral species classification to obtain its corresponding mineral species label. Then, based on the mineral species label and the segmented regions of the rock and mineral particle objects, the area proportion of each mineral is calculated and converted into a content proportion by combining density parameters. This achieves automated mineral content analysis, transforming mineral content from manual estimation to objective quantitative calculation based on particle-level segmentation regions and classification results, improving the accuracy and repeatability of content statistics. Finally, by inputting rock category tags, mineral type tags, and content percentages into the rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification, and obtaining an identification report, the entire process from inputting the original rock and mineral thin section image set to outputting a standardized identification report is automated. Data transfer and result connection between each step are completed automatically, and the output of the previous step serves as the input or constraint guide for the next step, which greatly improves the overall efficiency of rock and mineral thin section identification. At the same time, it reduces data transfer errors and subjective judgment biases introduced during manual connection, ensuring the consistency and repeatability of identification results.

[0039] Reference Figure 2 According to some embodiments of this application, step S103, which involves performing feature point matching on at least one target image based on a reference image and calculating the rotation angle of at least one target image relative to the reference image, may specifically include, but is not limited to, the following: Step S201: Extract initial feature points from the reference image and at least one target image, respectively; Step S202: Use bidirectional cross-matching and random sampling consensus algorithm to select correct feature points from the initial feature points; Step S203: Match the correct feature points of the reference image with the correct feature points of at least one target image to establish a mapping relationship between the correct feature points of the reference image and the correct feature points of at least one target image. Step S204: Based on the mapping relationship, calculate the affine transformation matrix between at least one target image and the reference image, and calculate the rotation angle of at least one target image relative to the reference image based on the affine transformation matrix.

[0040] In steps S201 to S204 of the embodiment, the reference image or target image is first converted into a grayscale image, and a Gaussian difference pyramid is constructed. The Gaussian difference pyramid is obtained by performing Gaussian blurring on the original image at different scales and performing difference operations on the blurred images at adjacent scales, thereby detecting extreme points in the image at different scales. Extreme points are detected in the Gaussian difference pyramid by comparing pixel values ​​with their neighbors at the same scale and in neighbors at adjacent scales. If a pixel value is an extreme point, it is determined as a candidate feature point. Position refinement and edge response culling are performed on the candidate feature points to remove extreme points with low contrast and unstable extreme points located on edges, resulting in the final initial feature points. The above operations are performed on the reference image and each target image respectively, obtaining the initial feature point set corresponding to the reference image and the initial feature point set corresponding to each target image. For example, for a reference image, an initial set of feature points is extracted using the SIFT algorithm. Each initial feature point in this set contains its spatial coordinates (x, y) in the reference image, as well as its corresponding scale and orientation information. Similarly, for a target image, a corresponding initial set of feature points is extracted. Each initial feature point in this set contains its spatial coordinates (x, y) in the target image, as well as its corresponding scale and orientation information.

[0041] Then, coarse matching is performed on the initial feature points of the reference image and the initial feature points of the target image. Coarse matching is based on the Euclidean distance between feature point descriptors. The Euclidean distance between the descriptors of each initial feature point in the reference image and the descriptors of each initial feature point in the target image is calculated, and the feature point pair with the smallest Euclidean distance is selected as the coarse matching feature point pair. To eliminate possible erroneous matching point pairs during coarse matching, a bidirectional cross-matching method is used to filter the coarse matching results. Specifically, in the forward matching process, starting from the initial feature point set of the reference image, the nearest feature point in the initial feature point set of the target image is searched as the forward matching point; in the reverse matching process, starting from the initial feature point set of the target image, the nearest feature point in the initial feature point set of the reference image is searched as the reverse matching point. If the results of the forward and reverse matching point pair point to the same pair, i.e., they are mutually optimal matches, then the feature point pair is a correct matching point pair and is retained; if the results of the forward and reverse matching point pair are inconsistent, i.e., they are not mutually optimal matches, then the feature point pair is determined to be an erroneous matching point pair and is discarded. After bidirectional cross-matching, a set of coarsely matched feature point pairs with bidirectional consistency is obtained. The Random Sample Consensus (RANSAC) algorithm is then used to verify the geometric consistency of the feature point pairs after bidirectional cross-matching. Specifically, a minimum sample set is randomly selected from the feature point pairs after bidirectional cross-matching, and an initial geometric transformation model is calculated based on this minimum sample set. The projection error of all bidirectional cross-matched feature point pairs under this geometric transformation model is calculated, and feature point pairs with projection errors less than a preset error threshold are marked as inliers. This random sampling and model verification process is repeated. After multiple iterations, the geometric transformation model containing the most inliers and its corresponding inlier set are retained. The inlier set is the final set of correct feature points selected. For example, after coarse matching of a reference image and a target image, 200 coarsely matched feature point pairs are obtained. After bidirectional cross-matching, 120 feature point pairs remain. After further selection using the RANSAC algorithm, 105 correct feature points are obtained, and these 105 correct feature points are taken as the correct feature points corresponding to the target image. For each target image, the above bidirectional cross-matching and RANSAC filtering process is performed to select the correct feature points from the initial feature points.

[0042] Next, the set of correct feature points in the reference image is used as the reference set, and the set of correct feature points in each target image is used as the set to be matched. Each correct feature point in the reference image is paired with each correct feature point in the target image. When a correct feature point in the reference image and a correct feature point in the target image have the same descriptor vector features, they are determined to be a corresponding matching feature point pair. Specifically, nearest neighbor matching can be used. For each correct feature point in the reference image, the Euclidean distance between its descriptor and the descriptors of all correct feature points in the target image is calculated. The correct feature point in the target image with the smallest Euclidean distance that is less than a preset matching distance threshold is determined as the matching point of the correct feature point in the reference image. By finding the corresponding correct feature points in the target image for the correct feature points in the reference image in the above manner, a sequence of feature point pairs is formed. All correct feature points in the reference image are traversed, thereby establishing a one-to-one mapping relationship between the correct feature points in the reference image and the correct feature points in the target image. For example, after screening, the set of correct feature points in the reference image contains 105 feature points, and the set of correct feature points in the target image contains 98 feature points. After matching, 80 pairs of feature points are identified as one-to-one matching feature point pairs. The coordinate correspondence of these 80 pairs of feature points is stored as a mapping relationship between the reference image and the target image, i.e., the set {(x_b1, y_b1) → (x_t1, y_t1), (x_b2, y_b2) → (x_t2, y_t2), ...,}, where (x_bi, y_bi) are the coordinates of the correct feature points in the reference image, (x_ti, y_ti) are the coordinates of the matching correct feature points in the target image, and "→" indicates the mapping relationship. For each target image, the above correct feature point matching operation is performed to establish a mapping relationship between the reference image and each target image.

[0043] Based on the mapping relationship between the correct feature points of the reference image and the correct feature points of the target image established in step S203, an affine transformation matrix is ​​constructed. The affine transformation matrix describes the geometric transformation relationship of the target image relative to the reference image in a two-dimensional plane. It is a 2×3 matrix containing transformation parameters such as rotation, translation, and scaling. The affine transformation matrix is ​​solved using the coordinate information of at least three pairs of matching feature points in the mapping relationship through the least squares method. For example, three pairs of matching feature points are selected from the mapping relationship. The coordinates of the three feature points in the reference image are (x_b1, y_b1), (x_b2, y_b2), and (x_b3, y_b3), and the coordinates of the corresponding three feature points in the target image are (x_t1, y_t1), (x_t2, y_t2), and (x_t3, y_t3). Substituting these three pairs of coordinates into the equation of the affine transformation model, the affine transformation matrix is ​​obtained. During the solution process, the least squares method or random sampling consensus algorithm can be used to further optimize the solution results, thereby obtaining a more accurate affine transformation matrix. After obtaining the affine transformation matrix, the rotation angle parameter is decomposed from it. Specifically, the submatrices representing the linear transformation in the affine transformation matrix are [[a11, a12], [a21, a22]]. According to the properties of the rotation matrix, the rotation angle θ can be calculated using the following formula: θ = arctan2(a21, a11), where arctan2 is the two-parameter arctangent function. The rotation angle of the target image relative to the reference image is obtained from the affine transformation matrix using this formula. For example, if the linear transformation submatrices in the affine transformation matrix of the target image relative to the reference image are [[0.866, -0.5], [0.5, 0.866]], then the rotation angle θ≈30° can be calculated using θ = arctan2(0.5, 0.866). For each target image, the corresponding affine transformation matrix is ​​calculated based on the mapping relationship between it and the reference image, and the rotation angle of the target image relative to the reference image is obtained from the affine transformation matrix, thereby completing the calculation of the rotation angle of at least one target image.

[0044] In steps S201 to S204, initial feature points are extracted from the reference image and at least one target image to obtain local feature descriptions with scale invariance and rotation invariance. Correct feature points are obtained by screening from the initial feature points using a bidirectional cross-matching and random sampling consensus algorithm, effectively eliminating mismatched points caused by image noise, duplicate textures, or occlusion, thus improving the accuracy and robustness of feature point matching. A mapping relationship is established between the correct feature points of the reference image and the correct feature points of the target image, achieving precise correspondence between feature points. The rotation angle is obtained by calculating the affine transformation matrix based on the mapping relationship and decomposing it, thus achieving precise quantification of the rotation angle of each target image relative to the reference image.

[0045] Reference Figure 3 According to some embodiments of this application, step S104 involves performing angle correction and spatial registration on at least one target image based on the rotation angle, and then stitching and recombining the corrected and registered target image with at least one single-polarized image along the channel axis to form a multi-channel fused image. This may specifically include, but is not limited to, the following: Step S301: Perform rotation interpolation resampling on at least one target image based on the rotation angle to obtain at least one angle-corrected target image; Step S302: Perform translation compensation and spatial pixel coordinate alignment between at least one angle-corrected target image and the reference image to obtain at least one spatially registered target image; Step S303: Stack at least one single-polarized image and at least one spatially registered target image along the channel axis in rotational order to form a multi-channel fused image.

[0046] In steps S301 to S303 of the embodiment, the center point of the target image is used as the rotation center, and the target image is rotated in the opposite direction around its center point by a rotation angle to eliminate the rotation deviation of the target image relative to the reference image, so that the image orientation of the target image is consistent with the orientation of the reference image. Since the rotation operation will map the pixel coordinates in the image to non-integer coordinate positions, a bilinear interpolation method is used for resampling calculation during the rotation process to avoid spatial information loss and image artifacts caused by direct rounding. Specifically, for each target pixel in the target image, the corresponding position of the target pixel in the original image is calculated according to the rotation angle. If the corresponding position is a non-integer coordinate, the four nearest pixels around the position are selected, and a weighted average is calculated based on the gray values ​​of the four pixels and their distance from the target position to obtain the interpolation result of the target pixel. For example, if the rotation angle of a target image relative to a reference image is calculated to be 30°, the target image is rotated 30° in the opposite direction around its center point. During the rotation, for the pixel located at coordinates (100, 80) in the target image, the corresponding coordinates of this pixel in the original image before rotation are calculated as (98.6, 75.3) based on the rotation angle and rotation center. Since these coordinates are not integers, bilinear interpolation is performed on the gray values ​​of four adjacent pixels at coordinates (98, 75), (99, 75), (98, 76), and (99, 76) in the original image to obtain the rotated pixel gray value. This rotation interpolation resampling operation is performed on all pixels in the target image to obtain an angle-corrected target image with the same orientation as the reference image. This rotation interpolation resampling operation is performed on each target image to obtain at least one angle-corrected target image.

[0047] After completing the rotation angle correction, a translational deviation compensation operation is further performed on the angle-corrected target image. Based on the mapping relationship between the correct feature points of the reference image and the correct feature points of the target image established in step S203, feature point pairs that still match after rotation correction are selected, and the global translational offset between the angle-corrected target image and the reference image is calculated. Specifically, the coordinates (x_bi, y_bi) of the correct feature point in the reference image and the coordinates (x_ai, y_ai) of the corresponding correct feature point in the angle-corrected target image are selected, and the difference between their horizontal and vertical coordinates is calculated. The average of the differences of all matching feature point pairs is taken as the global translational offset, i.e., the translation Δx = average value (x_ai - x_bi), and the translation Δy = average value (y_ai - y_bi). For example, three pairs of matching feature points were selected, and the horizontal coordinate differences were calculated to be 2.1 pixels, 1.9 pixels, and 2.0 pixels, respectively, and the vertical coordinate differences were -0.8 pixels, -1.2 pixels, and -1.0 pixels, respectively. The calculated global translation offsets were then Δx = 2.0 pixels and Δy = -1.0 pixels. Based on these global translation offsets, the angle-corrected target image was translated as a whole. The coordinates of each pixel in the angle-corrected target image were added to the global translation offset, ensuring precise alignment between the angle-corrected target image and the reference image in spatial pixel coordinates. This means that the spatial position of the same mineral particle is completely consistent in both the angle-corrected target image and the reference image, resulting in a spatially registered target image. This translation compensation operation was performed on each angle-corrected target image to obtain at least one spatially registered target image.

[0048] Next, the single-polarized image is used as the first channel of the multi-channel fused image. At least one spatially registered target image is arranged in ascending order of rotation angle, forming subsequent channel groups. The single-polarized image and at least one spatially registered target image are then stacked along the channel axis. It should be noted that the single-polarized image is an RGB three-channel image with 3 channels; each spatially registered target image is also an RGB three-channel image with 3 channels. The single-polarized image and at least one spatially registered target image are stitched together along the channel dimension, resulting in a multi-channel fused image with the number of channels equal to 3 multiplied by the total number of images. For example, if an image set contains one single-polarized image and three spatially registered target images, the number of channels in the multi-channel fused image is 3 × (1 + 3) = 12, meaning the multi-channel fused image is a 12-channel image. Similarly, if an image set contains one single-polarized image and ten spatially registered target images, the number of channels in the multi-channel fused image is 3 × (1 + 10) = 33, meaning the multi-channel fused image is a 33-channel image. The multi-channel fused image maintains consistency with the reference image in spatial dimensions (height and width). That is, the same spatial location (the same pixel coordinate) corresponds to the pixel value in the single-polarized image and the spatially registered target image at different rotation angles in different channels. Since the images are precisely registered in space, the same spatial location in the multi-channel fused image contains complete optical feature information of the same rock / mineral particle under single-polarized light conditions and multiple orthogonal polarized rotation angles. The data structure of the multi-channel fused image is a tensor form of (number of channels, height, width).

[0049] In steps S301 to S303, rotational interpolation resampling is performed on at least one target image based on the rotation angle to eliminate the rotational deviation of the target image relative to the reference image, ensuring that the image orientation of each target image is consistent with the reference image. Furthermore, the bilinear interpolation method ensures the integrity and continuity of image spatial information during rotation, avoiding information loss and image artifacts caused by rotation rounding. By performing translation compensation and spatial pixel coordinate alignment between at least one angle-corrected target image and the reference image, any remaining translational deviation after rotation correction is further eliminated, ensuring that the angle-corrected target image... The target image and the reference image are precisely aligned at the pixel level, meaning that the spatial position of the same mineral particle is completely consistent in the two images, achieving "particle overlap" between the images. By stacking at least one single-polarized image and at least one spatially registered target image along the channel axis in order of rotation angle, image information under different optical path conditions and different rotation angles is integrated into the same multi-channel fused image on the basis of spatial alignment. This allows the same spatial position (i.e. the location of the same mineral particle) in the multi-channel fused image to simultaneously contain complete optical feature information under single-polarized conditions and multiple orthogonal polarized rotation angles.

[0050] Reference Figure 4 According to some embodiments of this application, step S105, which involves segmenting and extracting the multi-channel fused image to obtain multiple rock and mineral particle objects, may specifically include, but is not limited to, the following: Step S401: According to the preset adaptive unsupervised segmentation algorithm, the multi-channel fused image is segmented to obtain multiple segmentation fragments; Step S402: Extract the particle boundaries and pore regions of multiple fragments, and calculate the particle area of ​​multiple fragments based on the particle boundaries and pore regions. Step S403: Based on the preset minimum area filtering threshold, remove the fragments whose particle area is smaller than the minimum area threshold to obtain the remaining fragments. Step S404: Extract the pixel mask data of multiple remaining segmented fragments to obtain multiple rock and mineral particle objects, wherein one pixel mask data corresponds to one rock and mineral particle object.

[0051] In steps S401 to S404 of this embodiment, a preset adaptive unsupervised segmentation algorithm is first invoked to perform pixel-level segmentation processing on the multi-channel fused image. The adaptive unsupervised segmentation algorithm is a segmentation method that automatically divides an image into regions without requiring any manually labeled data. It utilizes the spatial alignment characteristics between different channels in the multi-channel fused image to make segmentation decisions by integrating the optical feature information of multiple channels. Specifically, each pixel in the multi-channel fused image is considered as a feature vector containing multi-channel features, and the dimension of the feature vector is equal to the number of channels in the multi-channel fused image. For example, when the multi-channel fused image is a 12-channel image, each pixel corresponds to a 12-dimensional feature vector, which contains the intensity values ​​of that pixel under single-polarization conditions and multiple orthogonal polarization rotation angles. By performing cluster analysis on the feature vectors of all pixels, pixels with similar features are divided into the same region, thereby achieving automatic segmentation of the multi-channel fused image. During the clustering process, the number of regions is preset or adaptively determined to ensure that the segmentation results can cover different region types such as mineral grains and pores. Adaptive unsupervised segmentation algorithms can be based on clustering methods (such as K-means clustering and superpixel segmentation) or graph theory methods (such as normalized segmentation algorithms). These algorithms iteratively optimize pixel features, making pixel features highly similar within the same region while significantly different between different regions, thus obtaining multiple initial segmentation fragments. Each segmentation fragment corresponds to a continuous pixel region in the multi-channel fused image, representing a potential independent regional unit in the image, which could be a mineral grain region or a pore region. For example, for a multi-channel fused image of a sandstone thin section, after segmentation using an adaptive unsupervised segmentation algorithm, multiple segmentation fragments are obtained, some corresponding to quartz grains, some to feldspar grains, and some to pores. All fragments are stored separately to form the segmentation result of the multi-channel fused image.

[0052] Then, boundary extraction is performed on each segmented fragment to obtain its contour information. Using edge detection or contour tracking algorithms, the pixel mask of each segmented fragment is traced to extract its boundary contour. The particle boundary is the contour line of the segmented fragment, outlining the outer edge of the pixel region it occupies. Simultaneously, porosity regions in the segmented fragments are identified. Porosity regions refer to background or void regions in the multi-channel fused image that do not belong to any mineral particles. By analyzing the pixel value characteristics of the segmented fragments, pixel regions with low brightness and no mineral optical characteristics are identified as porosity regions. After extracting the particle boundaries and porosity regions, the particle area of ​​each segmented fragment is calculated based on these boundaries and regions. Specifically, for each segmented fragment, the number of all pixels within its pixel mask region is counted to obtain the pixel area of ​​that fragment. If the segmented fragment contains porosity regions, the number of pixels within those regions is counted, and the pixel area of ​​the porosity regions is subtracted from the pixel area of ​​the segmented fragment to obtain its particle area. For example, if a pixel mask region of a segmented fragment contains 1500 pixels, of which 200 are identified as pore regions, then the particle area of ​​this segmented fragment is 1500 - 200 = 1300 pixels. The above-described particle boundary extraction, pore region identification, and particle area calculation operations are performed on each segmented fragment to obtain the particle area corresponding to each of the multiple segmented fragments. The particle area, expressed in pixels, reflects the effective area occupied by each segmented fragment in the multi-channel fused image.

[0053] Next, a preset minimum area filtering threshold is obtained. This threshold is used to distinguish between real rock and mineral particles and segmentation noise fragments. The particle area of ​​each segment is compared with the minimum area filtering threshold. If the particle area of ​​a segment is less than the threshold, it is determined to be a noise fragment or artifact region and is removed. If the particle area is greater than or equal to the threshold, it is determined to be a candidate region for real rock and mineral particles and is retained. The minimum area filtering threshold is preset based on the actual application scenario and rock type characteristics. Its default value is 50 pixels, but it can be adaptively adjusted according to different rock types. For example, for sandstone thin sections, if the minimum area filtering threshold is set to 50 pixels, a segment with a particle area of ​​35 pixels is removed, and a segment with a particle area of ​​78 pixels is retained. Similarly, for volcanic rock thin sections, since the mineral particles in volcanic rocks are generally finer, the minimum area filtering threshold can be adjusted to 25 pixels to accommodate the retention requirements of smaller particles in fine-grained structures. The area filtering operation described above is performed on each of the multiple segmented fragments one by one. After removing all segmented fragments with particle areas smaller than the minimum area filtering threshold, the remaining segmented fragments are obtained. The remaining segmented fragments are the effective segmented regions retained after area filtering. Their number is less than the original number of segmented fragments, and each remaining segmented fragment has a sufficient area to represent the real candidate region of rock and mineral particles. This provides purified input data for subsequent extraction of pixel mask data and obtaining rock and mineral particle objects, effectively avoiding interference from small noise fragments on subsequent classification and content statistics.

[0054] Finally, for each remaining segmented fragment retained after filtering by the minimum area threshold, its corresponding pixel mask data is extracted. The pixel mask data is a binary mask image, and its size is consistent with the spatial size of the multi-channel fused image; that is, the height and width of the pixel mask data are equal to the height and width of the multi-channel fused image, respectively. In the pixel mask data, pixels belonging to the pixel region occupied by the remaining segmented fragment are marked with a first value (e.g., 1), while pixels in other pixel regions not belonging to the remaining segmented fragment are marked with a second value (e.g., 0), thus forming a binary region identification image. By extracting the pixel mask data of each remaining segmented fragment, the specific spatial location and range of each remaining segmented fragment in the multi-channel fused image are accurately recorded and represented. Each extracted pixel mask data is identified as a corresponding rock / mineral particle object; that is, one pixel mask data uniquely corresponds to one rock / mineral particle object, which contains complete spatial region information and geometric position information of the particle in the multi-channel fused image. For example, after segmentation and filtering, 100 remaining fragments are retained. The pixel mask data of these 100 fragments is extracted to obtain 100 rock and mineral particle objects. Each rock and mineral particle object has its own pixel mask region, identifying its position and shape in the multi-channel fused image. These multiple rock and mineral particle objects are numbered and stored, with each object associated with its pixel mask data and geometric feature data, including particle area, perimeter, and centroid coordinates.

[0055] In steps S401 to S404, the multi-channel fused image is segmented according to a preset adaptive unsupervised segmentation algorithm. Without manual annotation, the rich multi-channel optical feature information in the multi-channel fused image is used to automatically separate the mineral particle region and the pore region in the image, realizing the automatic detection of mineral particles. By extracting the particle boundaries and pore regions of multiple segmented fragments, and calculating the particle area of ​​multiple segmented fragments based on the particle boundaries and pore regions, the effective area of ​​each segmented fragment is accurately calculated, eliminating the influence of pore regions and providing accurate quantitative data for subsequent area filtering. By removing segmented fragments with particle areas smaller than the preset minimum area filtering threshold, the minimum fragments and noise artifacts generated by the segmentation algorithm are effectively removed, and real rock and mineral particle candidate regions with sufficient area are retained, avoiding interference from small noise fragments on subsequent classification and content statistics. By extracting the pixel mask data of multiple remaining segmented fragments, multiple rock and mineral particle objects are obtained, where one pixel mask data corresponds to one rock and mineral particle object, so that each rock and mineral particle object has accurate spatial location information and geometric feature data.

[0056] Reference Figure 5According to some embodiments of this application, step S106, which involves inputting multiple rock and mineral particle objects into a pre-selected fine classification model for mineral type classification to obtain mineral type labels corresponding to each of the multiple rock and mineral particle objects, may specifically include, but is not limited to, the following: Step S501: Crops out multiple sub-images corresponding to rock and mineral particle objects from the multi-channel fused image, and scales each sub-image to a uniform standard size; Step S502: Input each scaled sub-image into the pre-selected fine classification model for analysis, and output the probability distribution of the mineral type corresponding to each scaled sub-image. Step S503: Extract the maximum probability value from the probability distribution and obtain the mineral type label corresponding to the maximum probability value. The mineral type label has a one-to-one correspondence with the rock and mineral particle object. Step S504: Based on the probability distribution, determine the confidence score of the rock and mineral particle object as the confidence score of the maximum probability value. Step S505: Based on the confidence score and the preset confidence threshold, perform gating filtering on each rock and mineral particle object, and remove rock and mineral particle objects with a confidence score lower than the preset confidence threshold.

[0057] In steps S501 to S505 of the embodiment, based on the pixel mask data of each rock and mineral particle object, the pixel region occupied by each rock and mineral particle object is located in the multi-channel fused image. The bounding box of the rock and mineral particle object is determined according to the coordinates of the valid pixels marked in the pixel mask data; that is, the smallest bounding rectangle containing all valid pixels of the rock and mineral particle object. Based on the position of the bounding box in the multi-channel fused image, a corresponding sub-image is cropped from the multi-channel fused image. The size of the sub-image is equal to the size of the bounding box; that is, the height of the sub-image is equal to the height of the bounding box, and the width of the sub-image is equal to the width of the bounding box. The sub-image contains the pixel information of the rock and mineral particle object in all channels of the multi-channel fused image; that is, the sub-image retains all the channels of the multi-channel fused image. For example, the sub-image cropped from a 12-channel image is a 12-channel sub-image. The above cropping operation is performed on each rock and mineral particle object to obtain multiple sub-images corresponding to multiple rock and mineral particle objects. Since the particle sizes of different rock and mineral particle objects are different, the sizes of the cropped sub-images are also inconsistent. Each sub-image is further scaled to a uniform standard size. Specifically, bilinear interpolation is used to scale each sub-image to a preset standard input size, such as 224 pixels × 224 pixels. This scaling process ensures that all sub-images have the same spatial dimensions, thus meeting the consistency requirement of the input image size for fine classification models.

[0058] Each scaled sub-image from step S501 is used as input data and fed into a pre-selected fine-grained classification model. The fine-grained classification model is a convolutional neural network model pre-trained for the rock category corresponding to the rock category label. The output category space of the fine-grained classification model consists of the mineral species that may appear in that rock category, and its output dimension is equal to the total number of mineral species under that rock category. For example, when the rock category label is "sandstone," the output category space of the fine-grained classification model includes 8 minerals: quartz, feldspar, rock fragments, mica, calcite, and clay minerals, with an output dimension of 8. After each scaled sub-image is input into the fine-grained classification model, the model performs convolutional feature extraction, pooling dimensionality reduction, and fully connected mapping on the sub-image. Finally, it outputs a probability distribution vector through a softmax activation function. The dimension of the probability distribution vector is equal to the total number of mineral species, and the sum of the probability values ​​of each dimension is 1. For example, when a scaled sub-image is input into a fine-grained classification model, the model outputs a probability distribution of {quartz: 0.72, feldspar: 0.15, rock fragments: 0.05, mica: 0.04, calcite: 0.03, clay minerals: 0.01}. This probability distribution indicates that the probability of the rock and mineral particles corresponding to this sub-image belonging to quartz is 72%, to feldspar is 15%, and to other minerals is 5%, 4%, 3%, and 1%, respectively. When each scaled sub-image is input into the fine-grained classification model, the model outputs the probability distribution of the mineral type corresponding to each scaled sub-image.

[0059] For each scaled sub-image, the maximum probability value is extracted from the output probability distribution. The probability values ​​corresponding to each mineral type in the probability distribution are compared, and the mineral type with the highest probability value is identified. The mineral type label corresponding to this maximum probability value is then obtained. For example, if the probability distribution of a scaled sub-image is {quartz: 0.72, feldspar: 0.15, rock fragments: 0.05, mica: 0.04, calcite: 0.03, clay minerals: 0.01}, the maximum probability value extracted is 0.72. This maximum probability value of 0.72 corresponds to the mineral type "quartz," and "quartz" is determined as the mineral type label for this scaled sub-image. Through this method, a corresponding mineral type label is determined for each scaled sub-image. A one-to-one correspondence is established between the mineral type label and the corresponding rock and mineral particle object for that scaled sub-image; that is, each rock and mineral particle object is assigned a unique mineral type label, which represents the mineral type to which the rock and mineral particle object belongs.

[0060] For each scaled sub-image output probability distribution, the value corresponding to the maximum probability extracted in step S503 is determined as the confidence score of the rock and mineral particle object. The confidence score reflects the degree of certainty of the classification model for its classification results, and its value ranges from 0 to 1. The larger the value, the higher the reliability of the classification result. For example, if the probability distribution of a scaled sub-image is {quartz: 0.72, feldspar: 0.15, rock fragments: 0.05, mica: 0.04, calcite: 0.03, clay minerals: 0.01}, and the maximum probability value extracted is 0.72, then the confidence score for that rock / mineral particle object is determined to be 0.72. Similarly, if the probability distribution of another scaled sub-image is {quartz: 0.45, feldspar: 0.32, rock fragments: 0.12, mica: 0.06, calcite: 0.03, clay minerals: 0.02}, and the maximum probability value extracted is 0.45, then the confidence score for that rock / mineral particle object is determined to be 0.45. The confidence score of each rock / mineral particle object is associated with and stored to form the classification result information for the rock / mineral particle object. This classification result information includes mineral type labels and confidence scores.

[0061] Finally, a preset confidence threshold is obtained. The confidence threshold is a standard boundary used to determine whether the classification result is reliable. The confidence score of each rock and mineral particle object is compared with the preset confidence threshold. If the confidence score of a rock and mineral particle object is greater than or equal to the preset confidence threshold, the classification result of the rock and mineral particle object is determined to be reliable and retained; if the confidence score of a rock and mineral particle object is less than the preset confidence threshold, the classification result of the rock and mineral particle object is determined to be unreliable and removed. The preset confidence threshold ranges from 0.5 to 0.95, with a default value of 0.7. For example, if the preset confidence threshold is set to 0.7 and gated filtering is applied to three rock and mineral particle objects, the first rock and mineral particle object has a confidence score of 0.85, which is greater than 0.7, so it is retained; the second rock and mineral particle object has a confidence score of 0.62, which is less than 0.7, so it is removed; and the third rock and mineral particle object has a confidence score of 0.91, which is greater than 0.7, so it is retained. After performing the above gating filtering operation on all rock and mineral particle objects, all rock and mineral particle objects with confidence scores lower than the preset confidence threshold are removed. Only rock and mineral particle objects with confidence scores greater than or equal to the preset confidence threshold are retained. These retained rock and mineral particle objects will enter the subsequent quantitative calculation stage to calculate the area and content proportions of each mineral. Through this gating filtering mechanism, the interference of low-confidence classification results on mineral content statistics is effectively eliminated, improving the reliability of the identification results.

[0062] In steps S501 to S505, multiple sub-images corresponding to rock and mineral particle objects are cropped from the multi-channel fused image, and each sub-image is scaled to a uniform standard size. This ensures that all multi-channel optical information of each rock and mineral particle object is completely extracted and standardized, providing the fine classification model with particle-level image data that meets the input requirements and has complete information. By inputting each scaled sub-image into the pre-selected fine classification model for analysis, the probability distribution of the mineral type corresponding to each scaled sub-image is obtained as the output, realizing automated mineral type identification for each rock and mineral particle object. By extracting the maximum probability value from the probability distribution... The system obtains the mineral type label corresponding to the maximum probability value, and there is a one-to-one correspondence between the mineral type label and the rock and mineral particle object, so that each rock and mineral particle object is assigned a clear mineral type classification. By determining the confidence score of the maximum probability value as the confidence score of the rock and mineral particle object according to the probability distribution, a quantitative assessment of the reliability of each classification result is achieved. By gating and filtering each rock and mineral particle object according to the confidence score and the preset confidence threshold, rock and mineral particle objects with confidence scores lower than the preset confidence threshold are removed, effectively eliminating the interference of erroneous classification results that may be caused by insufficient classification confidence on subsequent quantitative statistics.

[0063] Reference Figure 6 According to some embodiments of this application, step S108 involves inputting rock category tags, mineral type tags, and content percentages into a preset rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification to obtain an identification report. This may specifically include, but is not limited to, the following: Step S601: Normalize the mineral type labels and content percentages, and retrieve the pre-set rock and mineral identification knowledge base based on the normalized data to obtain at least one candidate lithology. Step S602: At least one candidate lithology is scored using a multi-dimensional weighted score according to a preset weight matrix to obtain the scoring results. The weight matrix includes naming matching, mineral assemblage similarity, content matching, structure matching, and tectonic matching. Step S603: Perform conflict analysis on at least one candidate lithology according to the preset conflict diagnosis rules to obtain conflict analysis results; Step S604: Input the scoring results and conflict detection results into the large language model in the intelligent agent for controlled adjudication to determine the name of the rock; Step S605: Generate a mineral composition table containing mineral names and percentage contents based on rock name, mineral type label and content percentage; Step S606: Combine the mineral composition table with the structural and tectonic feature data of the rock category label to obtain identification and analysis data; Step S607: Input the identification and analysis data into the preset identification report template, and output an identification report containing the sample number, rock name, mineral composition table, structural description and identification basis.

[0064] In steps S601 to S607 of the embodiment, the mineral type labels and content percentages calculated in step S107 are first obtained, and then normalized. The normalization process includes two dimensions: first, mineral name normalization, which unifies the mineral names in the mineral type labels to standard names, such as unifying "albite" to "plagioclase" and "biotite" to "biotite." For rare minerals whose standard names cannot be determined, the original names are retained without modification to avoid information loss due to incorrect normalization; second, content data normalization, which scales and rounds the content percentages to ensure that the sum of the content percentages of all minerals equals 100%, and rounds the content percentage of each mineral according to a preset step size, such as rounding in 5% increments. If the content percentage of a certain mineral is 72.3%, it is rounded to 70%; if it is 32.8%, it is rounded to 35%. For example, if the obtained mineral type labels are "quartz," "feldspar," and "rock fragments," with corresponding content percentages of 65%, 25%, and 10%, respectively, after normalization, the results are: Quartz: 65%, Feldspar: 25%, Rock Fragments: 10%, with a sum of 100% and all being multiples of 5%. After normalization, a pre-built rock and mineral identification knowledge base is retrieved based on the normalized data. This knowledge base stores numerous naming rules for rock types, a mineral characteristic database, and identification standards. A two-layer retrieval method combining vector retrieval and keyword retrieval is employed: In vector retrieval, the normalized mineral combination and content data are converted into vector representations, and similarity retrieval is performed in the feature vector space of the rock and mineral identification knowledge base; in keyword retrieval, the normalized mineral names and content information are extracted as keywords, and precise matching is performed in the knowledge base. The vector retrieval results and keyword retrieval results are merged and deduplicated, recalling at least one candidate lithology from the rock and mineral identification knowledge base that is most similar to the current normalized data. For example, based on normalized data of 65% quartz, 25% feldspar, and 10% rock fragments, three candidate lithologies, namely “quartz sandstone,” “rock fragment quartz sandstone,” and “feldspar quartz sandstone,” are recalled from the rock and mineral identification knowledge base for subsequent scoring and adjudication.

[0065] Next, a preset weight matrix is ​​obtained, which defines the weight values ​​of each evaluation dimension and the scoring rules for each dimension. The weight matrix contains five dimensions: naming matching (weight 25%), mineral assemblage similarity (weight 30%), content matching (weight 15%), structure matching (weight 10%), and tectonic matching (weight 10%). For each candidate lithology, scores are calculated for the five dimensions mentioned above: In the naming matching dimension, the current normalized mineral assemblage is matched with the standard mineral assemblage of the candidate lithology. If the mineral names are identical or synonymous, a score is awarded. In the mineral assemblage similarity dimension, the similarity between the current mineral assemblage and the standard mineral assemblage of the candidate lithology is calculated. For example, using the Jaccard similarity coefficient, if the current mineral assemblage is {quartz, feldspar, rock fragments}, and the standard mineral assemblage of the candidate lithology "rock fragment quartz sandstone" is {quartz, feldspar, rock fragments}, the similarity is 1.0. In the content adaptation dimension, the content percentage of each mineral is compared with the standard content range of each mineral in the candidate lithology. If the content percentage falls within the standard range, full marks are awarded; the greater the deviation, the lower the score. In the structure and tectonic matching dimensions, the pre-defined structure and tectonic types are matched with the standard structure and tectonic types of the candidate lithology. If they match, full marks are awarded. The scores of the five dimensions are multiplied by their corresponding weight values ​​and summed to obtain the weighted total score for the candidate lithology. For example, when scoring the candidate lithology "lithic quartz sandstone," the naming matching score is 0.25, the mineral assemblage similarity score is 0.30, the content fit score is 0.12, the structure matching score is 0.08, and the tectonic matching score is 0.10. Therefore, the weighted total score is 0.25 + 0.30 + 0.12 + 0.08 + 0.10 = 0.85. This multi-dimensional weighted scoring operation is performed on each candidate lithology to obtain a score for each candidate lithology. The score result, expressed as a weighted total score, represents the degree of matching between each candidate lithology and the current identification data.

[0066] The system continues to retrieve pre-defined conflict diagnosis rules, stored in the rock and mineral identification knowledge base. These rules include diagnostic mineral tables for various rock types, incompatible mineral assemblage rules, and structural contradiction rules. The diagnostic mineral table defines the essential or non-essential minerals present in a particular rock type. The incompatible mineral assemblage rules determine whether geologically impossible minerals exist within the current mineral assemblage. The structural contradiction rules determine whether there is a contradiction between the structural type corresponding to the rock category label and the standard structure of the candidate lithology. For each candidate lithology, the current normalized mineral assemblage and content data are compared and checked against the conflict diagnosis rules. For example, when performing a conflict assessment on the candidate lithology "granite," according to the diagnostic mineral table in the conflict diagnosis rules, "granite" must contain quartz and potassium feldspar. However, the current normalized mineral assemblage is {olivine, pyroxene}, which does not contain quartz and potassium feldspar. Therefore, this candidate lithology is determined to have a serious mineral assemblage conflict, i.e., "serious conflict." Another example is that the current normalized mineral assemblage contains quartz, while the candidate lithology is "peridotite." According to the incompatible mineral assemblage rules, the presence of quartz in peridotite constitutes an incompatible mineral assemblage, thus determining that this candidate lithology has an incompatible mineral conflict. Yet another example is that the current rock category label is "sandstone," and the structural type is "sandstone structure," while the standard structure of the candidate lithology "granite" is "granite structure," thus determining that this candidate lithology has a structural contradiction. For each candidate lithology, the assessment result is marked with different levels such as "no conflict," "moderate conflict," "serious conflict," or "structural contradiction," and the assessment results of all candidate lithologies are summarized to obtain the conflict assessment result. The results of the conflict assessment are used to exclude candidate lithologies with serious conflicts in subsequent controlled adjudication, ensuring the rationality of the final naming result.

[0067] The scoring results obtained in step S602 and the conflict detection results obtained in step S603 are used as structured input data and input into the large language model in the rock and mineral naming analysis agent. After receiving the scoring results and conflict detection results, the large language model performs reasoning and decision-making under preset constraints. The constraints include: adjusting the scores of candidate lithologies is only allowed within a preset deviation range, for example, the score adjustment range of each candidate lithology cannot exceed ±0.15; minerals can only be selected from a preset mineral set, and minerals not appearing in the mineral type label cannot be introduced; new rock names cannot be generated freely, and names can only be selected or combined from at least one candidate lithology. Under constraints, the large language model makes a comprehensive judgment based on the scoring results and conflict check results: if a candidate lithology is marked as "severely conflicting" or "structurally contradictory" in the conflict check results, the large language model excludes that candidate lithology; if the score of a candidate lithology is significantly higher than other candidate lithologies and there is no conflict, the large language model determines that candidate lithology as the final rock name; if the two candidate lithologies with the highest scores are very close and there is some conflict, the large language model automatically expands the recall scope, re-searches the rock and mineral identification knowledge base, obtains more candidate lithologies, and then scores and checks them again, and performs a controlled decision again. For example, if three candidate lithologies "quartz sandstone" (score 0.85), "lithic quartz sandstone" (score 0.82), and "feldspathic quartz sandstone" (score 0.78) and their corresponding conflict check results are input into the large language model, the large language model determines that "quartz sandstone" has the highest score and no conflict within the constraints, and determines it as the final rock name. If the output of the large language model does not meet the preset constraints (e.g., the output does not include the name in the candidate lithology), it will automatically retry, up to two times. If it still does not comply after two retries, the rock name will be determined directly by pure code rule logic, that is, the candidate lithology with the highest score and no conflict will be selected as the rock name.

[0068] Obtain the rock name determined in step S604 and the mineral type labels and content percentages obtained in step S107. Match the mineral names in the mineral type labels with the values ​​in the content percentages, arranging them in descending order of content percentage to generate a structured mineral composition table. Each row in the mineral composition table contains a mineral name and its corresponding percentage content value. The percentage content value is displayed based on the normalized result of the content percentage; for example, a mineral with a content percentage of 65% is displayed as "65%" in the mineral composition table. When generating the mineral composition table, pre-set mineralogical standard data is also used to label each mineral name with its chemical formula or standard abbreviation to enhance the professionalism and standardization of the report. For example, if the rock is identified as "lithic quartz sandstone," and its mineral type labels are "quartz," "feldspar," and "lithic fragments," with corresponding content percentages of 65%, 25%, and 10% respectively, the generated mineral composition table would be: Quartz: 65%; Feldspar: 25%; Lithic fragments: 10%. The mineral composition table is one of the core contents of the identification report, characterizing the content composition of various minerals in the thin section sample of this rock and mineral.

[0069] Then, the structural and textural feature data corresponding to the rock category tags are obtained. The structural and textural feature data is pre-stored information on rock structure types and texture types associated with the rock category tags. Structure types include granular structure, porphyritic structure, granitic structure, etc.; texture types include massive texture, bedding texture, foliation texture, etc. Based on the rock category tags, the corresponding structural and textural feature data is retrieved from a pre-set rock and mineral identification knowledge base. For example, when the rock category tag is "sandstone," the knowledge base retrieves the corresponding structure type as "clastic granular structure" and the texture type as "massive texture." The mineral composition table generated in step S605 is combined with the retrieved structural and textural feature data. The mineral composition table is used as quantitative descriptive data, and the structural and textural feature data is used as qualitative descriptive data. The two are merged to form complete identification and analysis data. The identification and analysis data is a structured dataset containing a mineral composition table, structural and textural feature data, and rock category tags. This dataset characterizes the complete features of the rock and mineral thin section sample in terms of mineral composition, content distribution, and structure.

[0070] Finally, obtain the preset identification report template. This template is pre-set according to the industry standard format for rock and mineral identification reports and may include fixed fields such as sample number, rock name, mineral composition table, structural description, identification basis, and identification conclusion. Input the identification analysis data generated in step S606 into the identification report template and fill it in according to the template's structure: fill in the rock name in the rock name field; fill in the mineral composition table in the mineral composition table field; convert the structural features data into descriptive text and fill it in the structural description field; integrate the rock category labels and the classification basis information of the sub-classification model to generate identification basis text and fill it in the identification basis field; fill in the sample's unique identifier information in the sample number field. After filling in the information, format the identification report template to conform to industry standard layout requirements. For example, an identification report can be generated in the following format: Sample number "Sample-2026-001"; rock name "lithic quartz sandstone"; mineral composition table includes quartz (65%), feldspar (25%), and rock fragments (10%); structural description is "clastic granular texture, massive structure"; identification basis is "based on multi-channel fusion analysis of rock and mineral thin section microscopic images, combined with a coarse classification model to determine the rock category as sandstone, a fine classification model to identify mineral composition, and intelligent agent naming analysis conclusion as lithic quartz sandstone". The rendered identification report is used as the final output, completing the end-to-end automated identification process from input of rock and mineral thin section image sets to output of a standardized identification report. The identification report contains all the key information for rock and mineral thin section identification and can be directly used by geological researchers without the need for manual editing.

[0071] In steps S601 to S607, the mineral type labels and content percentages are normalized, unifying the expression standards of mineral names and standardizing and rounding the content data. This eliminates the differences in expression and inconsistencies in precision in the original data, providing a standardized data foundation for subsequent retrieval and reasoning. By retrieving a pre-set rock and mineral identification knowledge base based on the normalized data, at least one candidate lithology is obtained, ensuring that the naming analysis is based on a professional geological knowledge system and avoiding naming bias caused by relying solely on image features. At least one candidate lithology is weighted and scored in multiple dimensions according to a pre-set weight matrix, comprehensively and quantitatively evaluating it from multiple dimensions such as naming matching, mineral assemblage similarity, content suitability, structural matching, and tectonic matching, making the naming basis more scientific and comprehensive. By performing a conflict check on at least one candidate lithology according to pre-set conflict diagnosis rules, candidate lithologies with mineral assemblage conflicts or structural contradictions are effectively excluded, avoiding unreasonable naming. The identification results are generated through several steps. First, the scoring results and conflict assessment results are input into a large language model within the agent for controlled adjudication. Under pre-defined constraints, the logical reasoning capabilities of the large language model are utilized to make naming decisions. This leverages the comprehensive analytical advantages of the large language model while ensuring the professionalism and compliance of the adjudication results through constraints. Second, a mineral composition table containing mineral names and percentage contents is generated based on rock naming, mineral type labels, and content percentages. This transforms quantitative analysis results into intuitive data tables, enhancing the readability and practicality of the identification results. Third, by combining the mineral composition table with the structural and structural feature data of the rock category labels, identification analysis data is obtained, achieving the organic integration of quantitative and qualitative descriptive data, making the identification analysis data more complete. Finally, by inputting the identification analysis data into a pre-defined identification report template, an identification report containing sample number, rock naming, mineral composition table, structural and structural description, and identification basis is output, ensuring that the final delivered identification results conform to industry standards and specifications.

[0072] The above embodiments illustrate the method for automated identification of rock and mineral thin sections provided in this application. The system, electronic equipment, and storage medium for automated identification of rock and mineral thin sections provided in this application are described below: Please see Figure 7 This application provides an embodiment of a system for automated identification of rock and mineral thin sections, the system comprising: The acquisition unit 701 is used to acquire an image set of a target rock and mineral thin section sample. The image set includes at least one single-polarized light image and multiple orthogonal polarized light images with different rotation angles. The orthogonal polarized light images include a reference image with the same rotation angle as the single-polarized light image and at least one target image with a different rotation angle than the reference image. The coarse classification unit 702 is used to input the image group into a preset coarse classification model for optical path condition recognition, and to coarsely classify the image group into the corresponding rock category according to the recognition result to obtain the rock category label. The matching unit 703 is used to perform feature point matching on at least one target image based on the reference image, and to calculate the rotation angle of at least one target image relative to the reference image. The correction and registration unit 704 is used to perform angle correction and spatial registration on at least one target image based on the rotation angle, and to stitch and reassemble the corrected and registered target image with at least one single-polarized image along the channel axis to form a multi-channel fused image. The segmentation and extraction unit 705 is used to segment and extract the multi-channel fused image to obtain multiple rock and mineral particle objects; The fine classification unit 706 is used to input multiple rock and mineral particle objects into a pre-selected fine classification model for mineral classification, and obtain the mineral type labels corresponding to each of the multiple rock and mineral particle objects. The fine classification model is obtained in advance based on the rock category labels. The calculation unit 707 is used to calculate the area percentage of each mineral corresponding to the mineral type label based on the segmented regions of the mineral type label and multiple rock and mineral particle objects, and convert the area percentage into the content percentage by combining the density parameter of each mineral. The identification unit 708 is used to input rock category labels, mineral type labels, and content percentages into a preset rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification, and to obtain an identification report.

[0073] Optionally, the matching unit 703 is specifically used for: Extract initial feature points from the reference image and at least one target image respectively; A bidirectional cross-matching and random sampling consensus algorithm is used to select the correct feature points from the initial feature points; Match the correct feature points of the reference image with the correct feature points of at least one target image to establish a mapping relationship between the correct feature points of the reference image and the correct feature points of at least one target image. Based on the mapping relationship, calculate the affine transformation matrix between at least one target image and the reference image, and calculate the rotation angle of at least one target image relative to the reference image based on the affine transformation matrix.

[0074] Optionally, the correction and registration unit 704 is specifically used for: Based on the rotation angle, at least one target image is rotated and interpolated for resampling to obtain at least one angle-corrected target image. At least one angle-corrected target image is translated and spatially pixel coordinates aligned with a reference image to obtain at least one spatially registered target image. At least one single-polarized image and at least one spatially registered target image are stacked sequentially along the channel axis according to the rotation angle to form a multi-channel fused image.

[0075] Optionally, the segmentation and extraction unit 705 is specifically used for: Based on a preset adaptive unsupervised segmentation algorithm, the multi-channel fused image is segmented to obtain multiple segmentation fragments; Extract the particle boundaries and pore regions of multiple fragments, and calculate the particle area of ​​multiple fragments based on the particle boundaries and pore regions. Based on the preset minimum area filtering threshold, fragments with particle areas smaller than the minimum area threshold are removed to obtain the remaining fragments. Extract the pixel mask data of multiple remaining fragments to obtain multiple rock and mineral particle objects, where one pixel mask data corresponds to one rock and mineral particle object.

[0076] Optionally, the sub-classification unit 706 is specifically used for: Multiple sub-images corresponding to rock and mineral particle objects are cropped from the multi-channel fused image, and each sub-image is scaled to a uniform standard size. Each scaled sub-image is input into a pre-selected fine classification model for analysis, and the output is the probability distribution of the mineral type corresponding to each scaled sub-image. Extract the maximum probability value from the probability distribution and obtain the mineral type label corresponding to the maximum probability value. There is a one-to-one correspondence between the mineral type label and the rock and mineral particle object.

[0077] Optionally, the sub-classification unit 706 is specifically used for: Based on the probability distribution, the confidence score of the maximum probability value is determined as the confidence score of the rock and mineral particle object; Based on the confidence score and a preset confidence threshold, each rock and mineral particle object is gated and filtered to remove those with a confidence score lower than the preset confidence threshold.

[0078] Optionally, the identification unit 708 is specifically used for: The mineral type labels and content percentages are normalized, and the pre-set rock and mineral identification knowledge base is retrieved based on the normalized data to obtain at least one candidate lithology. At least one candidate lithology is scored using a multi-dimensional weighted score according to a preset weight matrix to obtain the scoring results. The weight matrix includes naming matching, mineral assemblage similarity, content matching, structure matching, and tectonic matching. According to the preset conflict diagnosis rules, at least one candidate lithology is subjected to conflict analysis to obtain conflict analysis results. The scoring results and conflict assessment results are input into the large language model in the agent for controlled adjudication to determine the name of the rock. Based on the rock name, mineral type label, and content percentage, generate a mineral composition table containing mineral names and percentage contents; The mineral composition table is combined with the structural and tectonic feature data of the rock category labels to obtain identification and analysis data; Input the identification and analysis data into the preset identification report template, and output an identification report that includes the sample number, rock name, mineral composition table, structural description and identification basis.

[0079] Please see Figure 8 This application also provides an electronic device, including: Processor 801, memory 802, input / output unit 803, bus 804; The processor 801 is connected to the memory 802, the input / output unit 803, and the bus 804; The memory 802 stores a program, and the processor 801 calls the program to execute it, such as... Figures 1 to 6 The method for automated identification of rock and mineral thin sections as shown in any of the embodiments.

[0080] This application also relates to a computer-readable storage medium on which a program is stored, which, when run on a computer, causes the computer to perform actions such as... Figures 1 to 6 The method for automated identification of rock and mineral thin sections as shown in any of the embodiments.

[0081] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0082] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0083] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0084] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0085] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for automated identification of thin sections of rocks and minerals, characterized in that, The method includes: An image set of a target rock mineral thin section sample is acquired. The image set includes at least one single-polarized image and multiple orthogonally polarized images with different rotation angles. The orthogonally polarized images include a reference image with the same rotation angle as the single-polarized image and at least one target image with a different rotation angle than the reference image. The image group is input into a preset coarse classification model for optical path condition recognition, and the image group is coarsely classified into the corresponding rock category according to the recognition result to obtain the rock category label; Based on the reference image, feature point matching is performed on at least one of the target images, and the rotation angle of at least one of the target images relative to the reference image is calculated; Based on the rotation angle, at least one of the target images is angle-corrected and spatially registered, and the corrected and registered target images are stitched and recombined with at least one single-polarized image along the channel axis to form a multi-channel fused image; The multi-channel fused image is segmented and extracted to obtain multiple rock and mineral particle objects; Multiple rock and mineral particle objects are input into a pre-selected fine classification model for mineral classification, and mineral type labels corresponding to each of the multiple rock and mineral particle objects are obtained. The fine classification model is pre-selected based on the rock category labels. Based on the mineral type label and the segmented regions of the multiple rock and mineral particle objects, the area percentage of each mineral corresponding to the mineral type label is calculated, and combined with the density parameter of each mineral, the area percentage is converted into the content percentage. The rock category label, the mineral type label, and the content percentage are input into a preset rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification, and an identification report is obtained.

2. The method according to claim 1, characterized in that, The step of performing feature point matching on at least one of the target images based on the reference image and calculating the rotation angle of at least one of the target images relative to the reference image includes: Initial feature points are extracted from the reference image and at least one of the target images, respectively; The correct feature points are obtained by screening from the initial feature points using a two-way cross-matching and random sampling consensus algorithm. Match the correct feature points of the reference image with the correct feature points of at least one of the target images to establish a mapping relationship between the correct feature points of the reference image and the correct feature points of at least one of the target images; Based on the mapping relationship, an affine transformation matrix between at least one target image and the reference image is calculated, and the rotation angle of at least one target image relative to the reference image is calculated based on the affine transformation matrix.

3. The method according to claim 1, characterized in that, Based on the rotation angle, at least one of the target images is angularly corrected and spatially registered, and the corrected and registered target images are stitched and recombined with at least one single-polarized image along the channel axis to form a multi-channel fused image, including: Based on the rotation angle, at least one of the target images is rotated and interpolated for resampling to obtain at least one angle-corrected target image. At least one angle-corrected target image is translated and spatially pixel-coordinate aligned with the reference image to obtain at least one spatially registered target image. At least one of the single-polarized images and at least one of the spatially registered target images are stacked sequentially along the channel axis according to the rotation angle to form the multi-channel fused image.

4. The method according to claim 1, characterized in that, The segmentation and extraction of the multi-channel fused image yields multiple rock and mineral particle objects, including: The multi-channel fused image is segmented according to a preset adaptive unsupervised segmentation algorithm to obtain multiple segmentation fragments; Extract the particle boundaries and pore regions of multiple fragments, and calculate the particle area of ​​multiple fragments based on the particle boundaries and pore regions; Based on a preset minimum area filtering threshold, fragments with a particle area smaller than the minimum area threshold are removed to obtain the remaining fragments. Extract the pixel mask data of the remaining segmented fragments to obtain multiple rock and mineral particle objects, wherein one pixel mask data corresponds to one rock and mineral particle object.

5. The method according to claim 1, characterized in that, The process involves inputting multiple rock and mineral particle objects into a pre-selected fine classification model for mineral type classification, obtaining mineral type labels corresponding to each of the multiple rock and mineral particle objects, including: Multiple sub-images corresponding to the rock and mineral particle objects are cropped from the multi-channel fused image, and each sub-image is scaled to a uniform standard size. Each scaled sub-image is input into a pre-selected fine classification model for analysis, and the output is the probability distribution of the mineral type corresponding to each scaled sub-image. Extract the maximum probability value from the probability distribution and obtain the mineral type label corresponding to the maximum probability value. The mineral type label has a one-to-one correspondence with the rock and mineral particle object.

6. The method according to claim 5, characterized in that, After obtaining the mineral type tags corresponding to each of the multiple rock and mineral particle objects, the method further includes: Based on the probability distribution, the confidence score of the maximum probability value is determined as the confidence score of the rock and mineral particle object; Based on the confidence score and a preset confidence threshold, each rock and mineral particle object is subjected to gating filtering to remove rock and mineral particle objects with a confidence score lower than the preset confidence threshold.

7. The method according to any one of claims 1-6, characterized in that, The process involves inputting the rock category label, the mineral type label, and the content percentage into a preset rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification, resulting in an identification report, including: The mineral type labels and content percentages are normalized, and a pre-set rock and mineral identification knowledge base is retrieved based on the normalized data to obtain at least one candidate lithology. At least one of the candidate lithologies is scored using a multi-dimensional weighted score according to a preset weight matrix to obtain a scoring result. The weight matrix includes naming matching, mineral assemblage similarity, content matching, structure matching, and tectonic matching. According to the preset conflict diagnosis rules, at least one of the candidate lithologies is subjected to conflict analysis to obtain conflict analysis results. The scoring results and the conflict detection results are input into the large language model in the agent for controlled adjudication to determine the name of the rock. Based on the rock name, the mineral type label, and the content percentage, generate a mineral composition table containing mineral names and percentage contents; The mineral composition table is combined with the structural and tectonic feature data of the rock category labels to obtain identification and analysis data; Input the identification and analysis data into a preset identification report template, and output an identification report containing the sample number, the name of the rock, the mineral composition table, the structural description, and the identification basis.

8. A system for automated identification of thin sections of rocks and minerals, characterized in that, The system includes: The acquisition unit is used to acquire an image set of a target rock and mineral thin section sample. The image set includes at least one single-polarized image and multiple orthogonal polarized images with different rotation angles. The orthogonal polarized images include a reference image with the same rotation angle as the single-polarized image and at least one target image with a different rotation angle than the reference image. The coarse classification unit is used to input the image group into a preset coarse classification model for optical path condition recognition, and to coarsely classify the image group into the corresponding rock category according to the recognition result to obtain the rock category label; A matching unit is configured to perform feature point matching on at least one of the target images based on the reference image, and calculate the rotation angle of at least one of the target images relative to the reference image; The correction and registration unit is used to perform angle correction and spatial registration on at least one of the target images based on the rotation angle, and to stitch and reassemble the corrected and registered target images with at least one single-polarized image along the channel axis to form a multi-channel fused image. The segmentation and extraction unit is used to segment and extract the multi-channel fused image to obtain multiple rock and mineral particle objects; The fine classification unit is used to input multiple rock and mineral particle objects into a pre-selected fine classification model to classify mineral types and obtain mineral type labels corresponding to each of the multiple rock and mineral particle objects. The fine classification model is pre-selected based on the rock category labels. The calculation unit is used to calculate the area percentage of each mineral corresponding to the mineral type label based on the segmented regions of the mineral type label and the plurality of rock and mineral particle objects, and convert the area percentage into the content percentage by combining the density parameter of each mineral. The identification unit is used to input the rock category label, the mineral type label, and the content percentage into a preset rock and mineral naming analysis agent for multi-dimensional comprehensive reasoning and identification, and to obtain an identification report.

9. An electronic device, characterized in that, The electronic device includes: Processor, memory, input / output units, and bus; The processor is connected to the memory, the input / output unit, and the bus; The memory stores a program, which the processor invokes to execute the method for automated identification of rock and mineral thin sections as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains a program that, when executed on a computer, performs the method for automated identification of rock and mineral thin sections as described in any one of claims 1 to 7.