An intelligent data set construction method for rock and mineral thin section images and related devices
Patent Information
- Application Number
- CN202611361864.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]然而,由于岩石薄片图像中通常包含数量较多且形态复杂的矿物颗粒,不同矿物颗粒之间可能存在边界不清晰、结构相似以及尺寸差异较大的情况,导致技术人员需要逐区域进行判断和描绘,标注过程耗时较长
通过获取岩矿薄片样本在显微镜下不同旋转角度下采集的多帧正交偏光图像,并基于基准图像对各非基准图像进行空间校正,使不同旋转角度下采集的正交偏光图像中的同一矿物颗粒在空间位置上保持对应关系,进而将基准图像与校正图像进行多通道重组,形成包含多角度光学信息且空间一致的多通道岩矿薄片图像;同时,通过对所述多通道岩矿薄片图像进行颗粒重合精度验证,能够在标注前筛除由于图像配准误差导致的颗粒位置偏移问题,保证输入标注模型的数据质量。
Smart Images

Figure CN123012203A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence image processing technology, and in particular to a method and related apparatus for constructing intelligent datasets of thin section images of rocks and minerals. Background Technology
[0002] Rock thin section images are image data acquired using microscopic imaging equipment after rock samples have been cut, ground, and prepared into thin sections. These images reflect the distribution, morphological characteristics, and spatial relationships of mineral grains within the rock. Analysis of rock thin section images can provide information such as rock composition and structure, offering a data foundation for geological research, mineral identification, and other applications.
[0003] To analyze different mineral grains in rock thin section images, it is usually necessary to pre-annotate the rock thin section images to determine the area and category information corresponding to each mineral grain in the image, thereby providing data samples for subsequent mineral identification. In existing technologies, rock thin section images are usually processed by manual annotation, that is, professionals mark the areas where different mineral grains are located by manually delineating based on the texture, boundary morphology and other features in the microscopic image.
[0004] However, because rock thin section images typically contain a large number of mineral grains with complex shapes, and different mineral grains may have unclear boundaries, similar structures, and large size differences, technicians need to judge and depict each region individually, making the annotation process time-consuming. Furthermore, as the number of rock thin section images to be annotated increases, a significant amount of time needs to be invested in completing the annotation work, resulting in low efficiency of the rock thin section image annotation process and making it difficult to meet the needs of rapid construction of large-scale rock thin section image data. Summary of the Invention
[0005] To address the aforementioned technical issues, this application provides a method and related apparatus for constructing an intelligent dataset of rock and mineral thin section images, which improves the annotation efficiency of rock thin section images.
[0006] The technical solution provided in this application is described below:
[0007] The first aspect of this application provides a method for constructing an intelligent dataset from thin section images of rocks and minerals, the method comprising: Multiple frames of orthogonally polarized light images of rock and mineral thin section samples were acquired under a microscope at different rotation angles, and a reference image was determined based on the multiple frames of orthogonally polarized light images; Based on the image correspondence between the reference image and each non-reference image, the spatial transformation parameters between each non-reference image and the reference image are determined respectively; Based on the spatial transformation parameters corresponding to each non-reference image, spatial correction is performed on each non-reference image to obtain a corrected image set. The reference image and the corrected image set are then recombined in multiple channels to obtain a multi-channel rock and mineral thin section image. The particle overlap accuracy of the multi-channel rock and mineral thin section image is verified. The rock and mineral thin section image to be labeled is determined from the multi-channel rock and mineral thin section image that has passed the particle overlap accuracy verification. The global segmentation inference operation is performed on the rock and mineral thin section image to be labeled through a pre-trained segmentation engine to obtain the initial global segmentation result of mineral particles in the rock and mineral thin section image to be labeled. The initial global segmentation result is manually corrected and guided. Local re-segmentation regions are determined based on the manual correction and guidance operation. Local segmentation inference operation is then performed on the local image corresponding to the local re-segmentation region through the pre-trained segmentation engine to obtain the local segmentation result. The initial global segmentation result is updated based on the local segmentation result to obtain the global segmentation result; A classification and labeling operation is performed on the mineral particle segmentation regions in the global segmentation result to add corresponding rock and mineral labels to the global segmentation result, thereby obtaining a rock and mineral dataset.
[0008] Optionally, determining the spatial transformation parameters between each non-reference image and the reference image based on the image correspondence between the reference image and each non-reference image includes: A local feature extraction algorithm is used to extract features from the reference image and each non-reference image to obtain the reference image feature points and reference image feature descriptors of the reference image, as well as the non-reference image feature points and non-reference image feature descriptors of each non-reference image. For each non-reference image, based on the feature similarity relationship between the non-reference image feature descriptor and the reference image feature descriptor, the feature points of the non-reference image are matched with the feature points of the reference image to obtain a corresponding set of candidate matching point pairs. A robust geometric estimation algorithm is used to perform anomaly matching point removal on the corresponding candidate matching point set, and the geometric transformation relationship between the non-reference image and the reference image is determined. Based on the geometric transformation relationship, the spatial transformation parameters of the non-reference image relative to the reference image are determined, and the spatial transformation parameters include rotation angle parameters and translation parameters.
[0009] Optionally, the step of spatially correcting each non-reference image based on the spatial transformation parameters corresponding to each non-reference image to obtain a corrected image set, and then performing multi-channel reconstruction of the reference image and the corrected image set to obtain a multi-channel rock and mineral thin section image, includes: Rotation correction is performed on each non-reference image according to the corresponding rotation angle parameter, and translation correction is performed on each non-reference image after rotation correction according to the corresponding translation parameter to obtain a corrected image set; According to the preset image channel order, the reference image and each correction image are stacked in the channel dimension to obtain a multi-channel rock and mineral thin section image.
[0010] Optionally, the step of verifying the grain overlap accuracy of the multi-channel rock and mineral thin section image includes: Several representative mineral grains are selected from the multi-channel rock and mineral thin section image, wherein the image channel corresponding to the reference image in the multi-channel rock and mineral thin section image is the reference channel, and the image channel corresponding to each correction image is the correction channel; For each representative mineral particle, the reference center coordinates of the representative mineral particle in the reference channel and the set of correction channel center coordinates in each correction channel are determined respectively, and the spatial distance between the center coordinates of each correction channel and the reference center coordinates is calculated respectively. The average deviation of particle overlap is calculated based on the spatial distance between each representative mineral particle, and the average deviation of particle overlap is compared with the preset alignment tolerance. When the average deviation of particle overlap is not greater than the preset alignment tolerance, the multi-channel rock and mineral thin section image is determined to have passed the particle overlap accuracy verification.
[0011] Optionally, after calculating the average particle overlap deviation based on the spatial distances corresponding to each of the representative mineral particles and comparing the average particle overlap deviation with a preset alignment tolerance, the intelligent dataset construction method further includes: When the average deviation of particle overlap is greater than the preset alignment tolerance, the feature extraction parameters in the local feature extraction algorithm and / or the test parameters in the robust geometric estimation algorithm are adjusted, and the spatial transformation parameters are re-determined based on the adjusted feature extraction parameters and / or the adjusted test parameters, so as to re-execute the spatial correction and the multi-channel reconstruction.
[0012] Optionally, the step of manually correcting and guiding the initial global segmentation result, determining local re-segmentation regions based on the manual correction and guidance operation, and performing local segmentation inference operations on the local images corresponding to the local re-segmentation regions through the pre-trained segmentation engine to obtain local segmentation results includes: A manual correction guidance operation is performed on the initial global segmentation result, and the manually corrected region in the rock and mineral thin section image to be labeled is determined based on the manual correction guidance operation. Based on the artificially corrected area, the area is expanded outward by a preset ratio along the periphery of the artificially corrected area to obtain a locally re-divided area; The local image corresponding to the re-segmented region is obtained, and the local segmentation inference operation is performed on the local image through the pre-trained segmentation engine to obtain the local segmentation result.
[0013] Optionally, after updating the initial global segmentation result based on the local segmentation result to obtain the global segmentation result, the method further includes: The global segmentation result is evaluated for quality, wherein the global segmentation result includes a global segmentation mask and mineral particle boundary contour information corresponding to the global segmentation mask, and the quality evaluation includes minimum particle area verification and boundary continuity verification. When the quality assessment meets the corresponding preset labeling quality conditions, the global segmentation result is saved according to the preset labeling format; When the quality assessment fails to meet the corresponding preset labeling quality conditions, a manual correction guidance operation is performed on the global segmentation result to re-execute the local segmentation inference operation.
[0014] A second aspect of this application provides an intelligent dataset construction system for rock and mineral thin section images, the intelligent dataset construction system comprising: The acquisition unit is used to acquire multiple frames of orthogonally polarized light images of rock and mineral thin section samples under different rotation angles under a microscope, and to determine a reference image based on the multiple frames of orthogonally polarized light images; The determining unit is used to determine the spatial transformation parameters of each non-reference image and the reference image according to the image correspondence between the reference image and each non-reference image; The correction unit is used to perform spatial correction on each non-reference image based on the spatial transformation parameters corresponding to each non-reference image to obtain a corrected image set, and to perform multi-channel reconstruction of the reference image and the corrected image set to obtain a multi-channel rock and mineral thin section image. The global annotation unit is used to verify the grain overlap accuracy of the multi-channel rock and mineral thin section image, determine the rock and mineral thin section image to be annotated from the multi-channel rock and mineral thin section image that has passed the grain overlap accuracy verification, and perform global segmentation inference operation on the rock and mineral thin section image to be annotated through a pre-trained segmentation engine to obtain the initial global segmentation result of mineral grains in the rock and mineral thin section image to be annotated. The local annotation unit is used to perform manual correction and guidance operations on the initial global segmentation result, determine the local re-segmentation region based on the manual correction and guidance operations, and perform local segmentation inference operations on the local image corresponding to the local re-segmentation region through the pre-trained segmentation engine to obtain the local segmentation result. An update unit is used to update the initial global segmentation result based on the local segmentation result to obtain a global segmentation result; The classification and labeling unit is used to perform classification and labeling operations on the mineral particle segmentation regions in the global segmentation result, so as to add corresponding rock and mineral labels to the global segmentation result and obtain a rock and mineral dataset.
[0015] Optionally, the determining unit is specifically used for: A local feature extraction algorithm is used to extract features from the reference image and each non-reference image to obtain the reference image feature points and reference image feature descriptors of the reference image, as well as the non-reference image feature points and non-reference image feature descriptors of each non-reference image. For each non-reference image, based on the feature similarity relationship between the non-reference image feature descriptor and the reference image feature descriptor, the feature points of the non-reference image are matched with the feature points of the reference image to obtain a corresponding set of candidate matching point pairs. A robust geometric estimation algorithm is used to perform anomaly matching point removal on the corresponding candidate matching point set, and the geometric transformation relationship between the non-reference image and the reference image is determined. Based on the geometric transformation relationship, the spatial transformation parameters of the non-reference image relative to the reference image are determined, and the spatial transformation parameters include rotation angle parameters and translation parameters.
[0016] Optionally, the correction unit is specifically used for: Rotation correction is performed on each non-reference image according to the corresponding rotation angle parameter, and translation correction is performed on each non-reference image after rotation correction according to the corresponding translation parameter to obtain a corrected image set; According to the preset image channel order, the reference image and each correction image are stacked in the channel dimension to obtain a multi-channel rock and mineral thin section image.
[0017] Optionally, the global annotation unit is specifically used for: Several representative mineral grains are selected from the multi-channel rock and mineral thin section image, wherein the image channel corresponding to the reference image in the multi-channel rock and mineral thin section image is the reference channel, and the image channel corresponding to each correction image is the correction channel; For each representative mineral particle, the reference center coordinates of the representative mineral particle in the reference channel and the set of correction channel center coordinates in each correction channel are determined respectively, and the spatial distance between the center coordinates of each correction channel and the reference center coordinates is calculated respectively. The average deviation of particle overlap is calculated based on the spatial distance between each representative mineral particle, and the average deviation of particle overlap is compared with the preset alignment tolerance. When the average deviation of particle overlap is not greater than the preset alignment tolerance, the multi-channel rock and mineral thin section image is determined to have passed the particle overlap accuracy verification.
[0018] Optionally, an adjustment unit may also be included, specifically for: When the average deviation of particle overlap is greater than the preset alignment tolerance, the feature extraction parameters in the local feature extraction algorithm and / or the test parameters in the robust geometric estimation algorithm are adjusted, and the spatial transformation parameters are re-determined based on the adjusted feature extraction parameters and / or the adjusted test parameters, so as to re-execute the spatial correction and the multi-channel reconstruction.
[0019] Optionally, the local annotation unit is specifically used for: A manual correction guidance operation is performed on the initial global segmentation result, and the manually corrected region in the rock and mineral thin section image to be labeled is determined based on the manual correction guidance operation. Based on the artificially corrected area, the area is expanded outward by a preset ratio along the periphery of the artificially corrected area to obtain a locally re-divided area; The local image corresponding to the re-segmented region is obtained, and the local segmentation inference operation is performed on the local image through the pre-trained segmentation engine to obtain the local segmentation result.
[0020] Optionally, a quality assessment unit may also be included, specifically for: The global segmentation result is evaluated for quality, wherein the global segmentation result includes a global segmentation mask and mineral particle boundary contour information corresponding to the global segmentation mask, and the quality evaluation includes minimum particle area verification and boundary continuity verification. When the quality assessment meets the corresponding preset labeling quality conditions, the global segmentation result is saved according to the preset labeling format; When the quality assessment fails to meet the corresponding preset labeling quality conditions, a manual correction guidance operation is performed on the global segmentation result to re-execute the local segmentation inference operation.
[0021] A third aspect of this application provides an intelligent dataset construction apparatus for rock and mineral thin section images, the intelligent dataset construction apparatus 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 first aspect and any one of the optional methods in the first aspect.
[0022] A fourth aspect of this application provides a computer-readable storage medium on which a program is stored, which, when executed on a computer, performs the methods of the first aspect and any one of the first aspects.
[0023] As can be seen from the above technical solutions, this application has the following beneficial effects: By acquiring multiple frames of orthogonally polarized light images of rock and mineral thin section samples under a microscope at different rotation angles, and performing spatial correction on each non-reference image based on the reference image, the same mineral particles in the orthogonally polarized light images acquired at different rotation angles maintain a spatial correspondence. Then, the reference image and the corrected image are recombined in multiple channels to form a multi-channel rock and mineral thin section image containing multi-angle optical information and spatial consistency. At the same time, by verifying the particle overlap accuracy of the multi-channel rock and mineral thin section image, particle position offset problems caused by image registration errors can be screened out before annotation, ensuring the data quality of the input annotation model.
[0024] Building upon this foundation, a pre-trained segmentation engine performs automatic segmentation inference on calibrated and validated thin-section rock and mineral images. Utilizing multi-angle fused image information, it automatically identifies mineral particles and generates initial global segmentation results, reducing the inefficiency and subjectivity inherent in traditional manual region-by-region labeling based on experience. Simultaneously, after obtaining the initial global segmentation results, a manual correction guidance operation is performed to locate local areas with labeling errors. Segmentation inference is then re-executed for these local areas, eliminating the need to re-label the entire thin-section image. This achieves collaborative optimization between human experience and the intelligent segmentation model, improving the accuracy of mineral particle identification and the reliability of the segmentation dataset while reducing the scope of manual correction and increasing the efficiency of thin-section image labeling. Attached Figure Description
[0025] 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.
[0026] Figure 1 A flowchart illustrating an embodiment of the intelligent dataset construction method for rock and mineral thin section images provided in this application; Figure 2 A schematic flowchart of an embodiment of the method for constructing an intelligent dataset of rock and mineral thin section images provided in this application, illustrating the determination of spatial transformation parameters; Figure 3A schematic flowchart illustrating an embodiment of the method for constructing an intelligent dataset of rock and mineral thin section images provided in this application, which performs spatial correction and multi-channel reconstruction. Figure 4 A schematic flowchart of an embodiment of the method for constructing intelligent datasets of rock and mineral thin section images provided in this application, for verifying the grain overlap accuracy; Figure 5 A schematic flowchart of an embodiment of the local segmentation reasoning in the intelligent dataset construction method for rock and mineral thin section images provided in this application; Figure 6 A schematic flowchart of an embodiment of the quality assessment in the intelligent dataset construction method for rock and mineral thin section images provided in this application; Figure 7 A schematic diagram of the structure of the intelligent dataset construction system for the rock and mineral thin section images provided in this application; Figure 8 A schematic diagram of the structure of the intelligent dataset construction device for rock and mineral thin section images provided in this application. Detailed Implementation
[0027] This application provides a method and related apparatus for constructing an intelligent dataset of rock and mineral thin section images, which improves the efficiency of rock thin section image annotation. It should be noted that the method for constructing an intelligent dataset of rock and mineral thin section images provided in this application can be applied to terminals with image annotation capabilities, or to systems with image annotation capabilities. For ease of explanation, this application uses a system as the implementing entity for illustrative purposes.
[0028] Please see Figure 1 This application first provides an embodiment of a method for constructing an intelligent dataset of rock and mineral thin section images, the embodiment including: S101. Obtain multiple frames of orthogonally polarized light images of rock and mineral thin section samples under different rotation angles under a microscope, and determine the reference image based on the multiple frames of orthogonally polarized light images. Thin section samples of rock and minerals can be thin sections formed by cutting, grinding, or other processing of the rock or ore to be analyzed. Microscopic images of these thin section samples can be acquired using polarized light microscopy. Crossed-light images refer to images obtained by imaging thin section samples under crossed-light observation conditions. Since the optical characteristics such as color and brightness of different mineral grains may change when the stage is rotated or the relative polarization direction of the sample is changed, images of the same thin section sample can be acquired at multiple rotation angles, resulting in multiple frames of crossed-light images. Subsequently, one frame of crossed-light images is selected as the reference image (e.g., the clearest image or one closest to the standard rock and mineral grain distribution), and the remaining crossed-light images are used as non-reference images. This allows for the correction of images acquired at different rotation angles by using the same image as a spatial reference.
[0029] S102. Based on the image correspondence between the reference image and each non-reference image, determine the spatial transformation parameters between each non-reference image and the reference image; Although multiple frames of orthogonally polarized images all correspond to the same rock and mineral thin section sample, the position and orientation of the same mineral grain may differ in different images due to the different rotation angles of the sample during image acquisition. For example, a mineral grain located at a certain position in the reference image may have a positional shift or orientation change in a non-reference image corresponding to another rotation angle. Therefore, each non-reference image can be compared with the reference image separately, and the spatial transformation relationship between the non-reference image and the reference image can be determined based on the corresponding image content in the two images. From this, the spatial transformation parameters of the non-reference image relative to the reference image can be obtained.
[0030] S103. Based on the spatial transformation parameters corresponding to each non-reference image, spatial correction is performed on each non-reference image to obtain a corrected image set. The reference image and the corrected image set are then recombined in multiple channels to obtain a multi-channel rock and mineral thin section image. After obtaining the spatial transformation parameters corresponding to each non-reference image, the non-reference images are adjusted according to the corresponding spatial transformation relationships to ensure that the positions of mineral particles in each non-reference image are as consistent as possible with the corresponding mineral particles in the reference image. For example, when the overall position or orientation of mineral particles in a non-reference image shifts relative to the reference image, the image can be adjusted accordingly based on the spatial transformation parameters of that non-reference image. The non-reference images after spatial correction form a corrected image set. Subsequently, the reference image and the corrected image set are recombined in multiple channels, so that the image information of the same rock and mineral thin section sample at different rotation angles is organized together according to their corresponding spatial positions, forming a multi-channel rock and mineral thin section image.
[0031] S104. Verify the grain overlap accuracy of the multi-channel rock and mineral thin section images. Determine the rock and mineral thin section images to be labeled from the multi-channel rock and mineral thin section images that have passed the grain overlap accuracy verification. Then, perform global segmentation inference operations on the rock and mineral thin section images to be labeled using the pre-trained segmentation engine to obtain the initial global segmentation results of mineral grains in the rock and mineral thin section images to be labeled. After spatial correction of the non-reference images, it is necessary to determine whether the corresponding mineral grains in different images have achieved the expected degree of spatial overlap. Therefore, it is necessary to verify the grain overlap accuracy of the multi-channel rock and mineral thin section images, such as verifying the grain center coordinate deviation, grain centroid distance, and grain contour overlap, to determine whether the spatially corrected images can meet the requirements of subsequent annotation processing, and to determine the rock and mineral thin section images to be annotated from the verified multi-channel rock and mineral thin section images. In this embodiment, the rock and mineral thin section images to be annotated can be loaded through an image annotation platform with image display and annotation interaction functions, so that technicians can view and correct the segmentation dataset. The image annotation platform can be implemented using a World Wide Web (Web) based annotation platform, such as Label Studio, CVAT, or VGG Image Annotator, or other software platforms that can realize image loading, segmentation dataset display, and manual interactive correction. After the annotation task begins, the annotation platform provides the thin section image of the rock and mineral to be annotated to a pre-trained segmentation engine deployed on the backend. The pre-trained segmentation engine performs segmentation inference on the entire thin section image. Segmentation inference involves determining the pixel regions corresponding to mineral particles based on the features of different areas in the image, and generating corresponding segmentation masks for the identified mineral particles. The segmentation mask represents the region occupied by the corresponding mineral particle in the thin section image, and the region range and boundaries of the mineral particles can be determined through the segmentation mask. After completing the segmentation inference for the entire image, the pre-trained segmentation engine returns the obtained global segmentation mask and particle boundary contours (i.e., the initial global segmentation result in this application) to the annotation platform for display. The pre-trained segmentation engine can use pre-trained models with image target segmentation capabilities such as FastSAM, SAM, and MobileSAM, or other models capable of pixel-level segmentation of mineral particles.
[0032] S105. Perform manual correction and guidance operations on the initial global segmentation results, determine the local re-segmentation regions based on the manual correction and guidance operations, and perform local segmentation inference operations on the local images corresponding to the local re-segmentation regions through the pre-trained segmentation engine to obtain the local segmentation results. Because thin-section images of rocks and minerals contain a large number of mineral grains, and different grains may have adjacent boundaries or local adhesion, the initial global segmentation results generated by the pre-trained segmentation engine may contain anomalies such as missing grains, incorrect segmentation, or inaccurate boundary positions, requiring further adjustments. After displaying the initial global segmentation results, a manual correction guidance function can be provided for the locations of anomalies. This allows technicians to select, define, or indicate the locations of anomalies to guide the reprocessing of mineral grain regions. Subsequently, the annotation platform determines the locally re-segmented regions that need reprocessing based on the image locations involved in the manual correction guidance. The local images corresponding to these re-segmented regions are then re-executed using the pre-trained segmentation engine to perform local segmentation inference operations, generating new segmentation results only for the corresponding local images. This results in a local segmentation result, eliminating the need to re-segment the entire thin-section image to be annotated.
[0033] S106. Update the initial global segmentation result based on the local segmentation result to obtain the global segmentation result.
[0034] After completing the local segmentation inference, the corresponding parts of the initial global segmentation result are updated based on the local segmentation results. This ensures that the mineral particle annotation information obtained through re-segmentation is reflected in the segmentation dataset of the entire image, ultimately forming the updated global segmentation result. The local segmentation result includes the newly determined local segmentation mask within the re-segmented region and the corresponding mineral particle boundary contour information. For example, based on the position of the re-segmented region in the image of the rock and mineral section to be labeled, the local segmentation mask is compared with the global segmentation mask in the initial global segmentation result. Within the re-segmented region, the local segmentation mask replaces the original segmentation mask, and the mineral particle boundary contour information corresponding to the re-segmented region is updated synchronously. The global segmentation mask and its corresponding particle boundary contours outside the re-segmented region remain unchanged. After the update, the updated local region and the remaining unmodified regions are combined to form a new global segmentation mask and corresponding mineral particle boundary contour information, which is the global segmentation result in this application.
[0035] In some specific embodiments, before outputting the global segmentation result, the segmentation size and boundary fineness of the mineral particles can be adjusted according to actual segmentation requirements. Specifically, a segmentation threshold adjustment signal input by a technician can be received, and the segmentation parameters corresponding to the pre-trained segmentation engine can be adjusted based on the segmentation threshold adjustment signal. These segmentation parameters include mineral particle segmentation size parameters and mineral particle segmentation boundary fineness parameters. Subsequently, based on the adjusted segmentation parameters, the pre-trained segmentation engine re-executes segmentation inference on the corresponding rock and mineral thin section image, and updates the current global segmentation result based on the re-obtained segmentation result. The technician can continue to adjust the corresponding thresholds based on the updated mineral particle segmentation size and boundary contour effect until the segmentation result meets the current annotation requirements, and then output the corresponding global segmentation result to adapt to annotation requirements with different particle sizes and boundary fineness levels.
[0036] S107. Perform classification and labeling operations on the mineral particle segmentation regions in the global segmentation results to add corresponding rock and mineral labels to the global segmentation results and obtain the rock and mineral dataset.
[0037] After obtaining the global segmentation results, the global segmentation mask and the corresponding mineral grain boundary contour information can characterize the region and boundary of each mineral grain in the thin section image to be labeled, but they do not yet characterize the corresponding rock and mineral category. Therefore, further classification and labeling operations are needed for each mineral grain segmentation region in the global segmentation results. Specifically, the corresponding rock and mineral category can be determined based on the image features corresponding to each mineral grain segmentation region, and the determined rock and mineral category can be added as a rock and mineral label to the corresponding mineral grain segmentation region, so that each mineral grain segmentation region has both corresponding segmentation information and category information. After completing the classification and labeling, the thin section image to be labeled, along with the corresponding global segmentation mask, mineral grain boundary contour information, and rock and mineral label information, is output as a rock and mineral dataset.
[0038] In this embodiment, multiple frames of orthogonally polarized light images of rock and mineral thin section samples are acquired under a microscope at different rotation angles. Based on the reference image, spatial correction is performed on each non-reference image to ensure that the same mineral particles in the orthogonally polarized light images acquired at different rotation angles maintain a spatial correspondence. Then, the reference image and the corrected image are recombined in multiple channels to form a multi-channel rock and mineral thin section image that contains multi-angle optical information and is spatially consistent. At the same time, by verifying the particle overlap accuracy of the multi-channel rock and mineral thin section image, particle position offset problems caused by image registration errors can be screened out before annotation, ensuring the data quality of the input annotation model.
[0039] Building upon this foundation, a pre-trained segmentation engine performs automatic segmentation inference on calibrated and validated thin-section rock and mineral images. Utilizing multi-angle fused image information, it automatically identifies mineral particles and generates initial global segmentation results, reducing the inefficiency and subjectivity inherent in traditional manual region-by-region labeling based on experience. Simultaneously, after obtaining the initial global segmentation results, a manual correction guidance operation is performed to locate local areas with labeling errors. Segmentation inference is then re-executed for these local areas, eliminating the need to re-label the entire thin-section image. This achieves collaborative optimization between human experience and the intelligent segmentation model, improving the accuracy of mineral particle identification and the reliability of the segmentation dataset while reducing the scope of manual correction and increasing the efficiency of thin-section image labeling.
[0040] In step S102 above, to determine the spatial transformation parameters of each non-reference image relative to the reference image, it is necessary to establish the feature correspondence between the non-reference image phases and the reference image. Please refer to [link to relevant documentation]. Figure 2 , Figure 2 An embodiment of the method for constructing an intelligent dataset of rock and mineral thin section images provided in this application, which determines spatial transformation parameters, includes: S201. Use a local feature extraction algorithm to extract features from the reference image and each non-reference image to obtain the reference image feature points and reference image feature descriptors of the reference image, as well as the non-reference image feature points and non-reference image feature descriptors of each non-reference image. To establish image correspondences between the reference image and each non-reference image that can be used for subsequent spatial transformation calculations, locations with obvious local features can first be extracted from each image. In this embodiment, local feature extraction is used to detect locations in the image with significant changes in grayscale, texture, or edge, and these locations are identified as feature points. Simultaneously, corresponding feature descriptors are generated based on the local image information surrounding the feature points. Feature points represent the location of local image features in the image, while feature descriptors describe the local image information surrounding the corresponding feature points in numerical form, facilitating subsequent comparison of the similarity of feature points between different images. Thus, the reference image feature points and their corresponding reference image feature descriptors for the reference image, as well as the non-reference image feature points and their corresponding non-reference image feature descriptors for each non-reference image, can be obtained. In one specific implementation, the local feature extraction algorithm can employ Scale-Invariant Feature Transform (SIFT) or ORB feature algorithms. For example, using the SIFT algorithm yields feature descriptors based on local gradient information; using the ORB feature algorithm yields corresponding binary feature descriptors.
[0041] It's important to note that each feature point is associated with a corresponding feature descriptor. For example, when a reference image feature point is detected at the edge of a mineral grain in a reference image, its location can be represented by its image coordinates. The feature descriptor corresponding to this reference image feature point then describes the local image features surrounding that location. This aligns with reality, meaning that even if the mineral grain is rotated and located in a different position in a non-reference image, its local structure may still exhibit similar feature descriptions.
[0042] S202. For each non-reference image, based on the feature similarity relationship between the feature descriptors of the non-reference image and the feature descriptors of the reference image, match the feature points of the non-reference image with the feature points of the reference image to obtain the corresponding set of candidate matching point pairs. After obtaining the feature points and their corresponding feature descriptors, feature matching is performed between each non-reference image and the reference image. Specifically, non-reference image feature descriptors can be selected sequentially and compared with each reference image feature descriptor in the reference image. Based on the similarity between different feature descriptors, feature points that may correspond to the same local image location are determined, and the matching non-reference image feature points and reference image feature points are combined to form candidate matching point pairs.
[0043] The appropriate feature similarity metric can be selected based on the local feature extraction algorithm used. For example, when using the SIFT algorithm, the Euclidean distance between feature descriptors reflects their similarity; the smaller the Euclidean distance, the more similar the two local features are. When using the ORB feature algorithm, the Hamming distance between binary feature descriptors can be compared; the smaller the Hamming distance, the higher the similarity between the two feature descriptors. Therefore, by matching multiple feature points in the current non-reference image, a set of candidate matching point pairs corresponding to the non-reference image is formed.
[0044] S203. Use a robust geometric estimation algorithm to perform anomaly matching point removal operation on the corresponding candidate matching point set, and determine the geometric transformation relationship between the non-reference image and the reference image. It should be noted that candidate matching point pairs only indicate that two feature points are relatively similar in local image features. There may still be mismatches due to different mineral grains having similar local textures or edges. Therefore, a robust geometric estimation algorithm is needed to further determine whether the spatial relationship between each candidate matching point pair is consistent and to remove abnormal matching points that significantly deviate from the spatial variation relationship. The robust geometric estimation algorithm can employ the Random Sample Consensus (RANSAC) algorithm. Specifically, a subset of candidate matching point pairs is extracted from the candidate matching point pair set. If the extracted candidate matching point pairs do indeed correspond to the same local location in the same rock and mineral thin section sample, then when these feature points are mapped from the non-reference image to the reference image, the positional change can usually be described by the same or similar geometric transformation relationship. These candidate matching points are then determined as inliers. Incorrectly matched feature points usually do not satisfy the geometric transformation relationship, so incorrectly matched point pairs can be removed from the candidate matching point pair set accordingly. By repeatedly sampling and verifying, a geometric transformation relationship supported by a large number of candidate matching point pairs is determined, and the matching point pairs supporting this geometric transformation relationship are used to form the inlier set corresponding to the current non-reference image. In one specific implementation, RANSAC can set a preset distance threshold (e.g., 3.0 pixels) when determining inliers to determine whether the positional deviation between a candidate matching point and its corresponding reference image feature point after the current spatial transformation is within an allowable range, in order to distinguish inliers from mismatched points.
[0045] S204. Determine the spatial transformation parameters of the non-reference image relative to the reference image based on the geometric transformation relationship. The spatial transformation parameters include rotation angle parameters and translation parameters.
[0046] After obtaining stable geometric transformation relationships through robust geometric estimation, the rotation angle and translation parameters of the current non-reference image relative to the reference image are determined based on the coordinate correspondence of the preserved matching point pairs in the non-reference image and the reference image. For different non-reference images, the spatial transformation parameters are calculated separately based on their corresponding matching point pairs to obtain the spatial transformation parameters for each non-reference image.
[0047] In one specific implementation, rigid body transformation estimation can be performed using RANSAC based on the preserved matching point pairs, where for the ... The coordinate relationship between each non-reference image and the reference image is represented as follows: ; in, For the first Coordinates of feature points in a non-reference image These are the coordinates of the corresponding feature points in the reference image; For the first The rotation angle parameters of a non-reference image relative to the reference image; For the first The translation parameters of each non-reference image relative to the reference image are given by the following formula: ; ; in, and They represent the first The translation of a non-reference image relative to the reference image in the horizontal and vertical directions.
[0048] In some specific implementations, the homography transformation matrix from the non-reference image to the reference image can also be determined based on the retained matching point pairs, and the corresponding rotation angle parameters and translation parameters can be determined according to the matrix components in the homography transformation matrix that characterize the changes in the image plane space.
[0049] In this embodiment, feature points and corresponding feature descriptors are extracted from the reference image and each non-reference image using a local feature extraction algorithm. Candidate matching point pairs are established based on the distance between the feature descriptors, which can determine the locations of similar local image features in different images. Simultaneously, a robust geometric estimation algorithm is used to remove mismatched point pairs from the candidate matching point pairs that do not satisfy the overall geometric transformation relationship, ensuring that the retained interior points accurately reflect the geometric transformation relationship between the non-reference image and the reference image. Furthermore, based on the geometric transformation relationship corresponding to the retained matching points, rotation angle parameters and translation parameters are determined, providing each non-reference image with independent correction parameters corresponding to its spatial changes, thus improving the accuracy of the correspondence between mineral grain positions in different images during subsequent spatial correction.
[0050] After determining the spatial transformation parameters for each non-reference image, spatial correction needs to be performed on each non-reference image based on the spatial transformation parameters, and then multi-channel reconstruction is performed with the reference image. Please refer to [link / reference]. Figure 3 , Figure 3 An embodiment of the method for constructing intelligent datasets of rock and mineral thin section images provided in this application, which performs spatial correction and multi-channel reconstruction, includes: S301. Perform rotation correction on each non-reference image according to the corresponding rotation angle parameter, and perform translation correction on each non-reference image after rotation correction according to the corresponding translation parameter to obtain a corrected image set. For each non-reference image frame, spatial correction is performed based on the corresponding rotation angle and translation parameters. First, the non-reference image is rotated in the opposite direction to its rotation relative to the reference image, adjusting its orientation to match the reference image and reducing the directional deviation between them. After rotation correction, positional compensation is performed horizontally and vertically based on the corresponding translation parameters, further aligning the image content in the non-reference image to its corresponding position in the reference image. After performing rotation and translation corrections on each non-reference image, a set of corrected images is obtained.
[0051] S302. Stack the reference image and each correction image in the channel dimension according to the preset image channel order to obtain a multi-channel rock and mineral thin section image.
[0052] In this embodiment, image channels are used to distinguish image data obtained from the same rock and mineral thin section sample at different rotation angles. Each image channel corresponds to an image at a specific rotation angle. The image channel corresponding to the reference image is the reference channel, and the image channels corresponding to each corrected image are the corrected channels. After obtaining the set of corrected images, a preset image channel order is determined based on the rotation angles corresponding to the reference image and each corrected image. For example, when the image corresponding to a zero-degree rotation angle is used as the reference image, the reference image can be arranged in the first image channel, and the corrected images can be arranged sequentially in ascending order of rotation angle, so that each image channel maintains a clear correspondence with its corresponding rotation angle. Subsequently, the reference image and each corrected image are stacked in the channel dimension according to the preset image channel order to obtain a multi-channel rock and mineral thin section image. Since the non-reference images have undergone spatial correction before channel stacking, the same spatial positions of different image channels in the multi-channel rock and mineral thin section image can correspond to the same regions in the rock and mineral thin section sample, thereby preserving image information at different rotation angles while maintaining the corresponding spatial positional correspondence between each image channel.
[0053] In this embodiment, by performing rotation and translation corrections using the rotation angle and translation parameters corresponding to each non-reference image, the directional and positional deviations between images with different rotation angles can be reduced, enabling each non-reference image to establish a relatively consistent spatial correspondence with the reference image. Subsequently, the reference image and each corrected image are stacked according to the preset image channel order, which can preserve the image information of different rotation angles while organizing the image content in each channel according to a unified spatial position, forming a multi-channel rock and mineral thin section image with a spatial correspondence.
[0054] After obtaining multi-channel thin section images of rocks and minerals, it is necessary to further verify the spatial overlap of corresponding mineral grains in different image channels. Please refer to [link / reference needed]. Figure 4 , Figure 4 An embodiment of the method for constructing intelligent datasets of rock and mineral thin section images provided in this application for verifying grain overlap accuracy includes: S401. Select several representative mineral grains from the multi-channel rock and mineral thin section image. Among them, the image channel corresponding to the reference image in the multi-channel rock and mineral thin section image is the reference channel, and the image channel corresponding to each correction image is the correction channel. To utilize the spatial location of some mineral grains to reflect the overall grain overlap in multi-channel rock and mineral thin section images, several representative mineral grains suitable for positional comparison can be selected from the multi-channel rock and mineral thin section images. The image channel containing the reference image is designated as the reference channel, and the image channels containing each calibration image are designated as calibration channels. The selected representative mineral grains must be able to be located in both the reference channel and each calibration channel, enabling subsequent cross-channel positional comparisons of the same mineral grain. For example, 5 to 10 mineral grains with different shapes and distributions in different image locations can be manually or automatically selected as representative mineral grains to reduce the possibility that selecting only a few local grains might result in verification results that do not fully reflect the overall spatial calibration situation.
[0055] S402. For each representative mineral particle, determine the reference center coordinates of the representative mineral particle in the reference channel and the set of center coordinates of the correction channel in each correction channel, and calculate the spatial distance between the center coordinates of each correction channel and the reference center coordinates. After selecting representative mineral particles, the center coordinates of each particle in different image channels are determined, forming a set of center coordinates for each correction channel. Then, using the reference center coordinates as a positional reference, the Euclidean distance between the center coordinates of each correction channel and the reference center coordinates is calculated, thus obtaining the spatial position deviation of the representative mineral particle in different correction channels. A smaller spatial distance indicates that the position of the mineral particle in the corresponding correction channel is closer to the position of the particle in the reference channel.
[0056] S403. Calculate the average deviation of particle overlap based on the spatial distance of each representative mineral particle, and compare the average deviation of particle overlap with the preset alignment tolerance. Since a representative mineral grain may correspond to multiple correction channels, and multiple representative mineral grains are selected in a multi-channel rock and mineral thin section image, the average grain overlap deviation, used to evaluate the overall grain overlap degree, can be calculated by combining the spatial distances of each representative mineral grain in each correction channel using the following formula: ; in, Indicates the average deviation of particle overlap; Indicates the number of representative mineral particles; This indicates the number of image channels in a multi-channel rock and mineral thin section image; Indicates the number of calibration channels; Indicates the first The reference center coordinates of a representative mineral particle in the reference channel; Indicates the first The representative mineral grain was in The center coordinates of the calibration channel in each calibration channel; This represents the Euclidean distance between the two center coordinates. After obtaining the average particle overlap deviation, the average particle overlap deviation is compared with a preset alignment tolerance (e.g., 2.0 pixels). The preset alignment tolerance is used to limit the average particle position deviation allowed between different channels after spatial correction, and can be set according to the spatial alignment accuracy requirements of subsequent image segmentation, annotation, or analysis tasks.
[0057] S404. When the average deviation of particle overlap is not greater than the preset alignment tolerance, the multi-channel rock and mineral thin section image is verified to pass the particle overlap accuracy test.
[0058] When the average deviation of particle overlap is not greater than the preset alignment tolerance, it indicates that the average deviation of the center position of the selected representative mineral particles in each correction channel relative to the reference channel is within the allowable range. Therefore, it can be determined that the current multi-channel rock and mineral thin section image has passed the particle overlap accuracy verification and can continue to be used for subsequent rock and mineral thin section image annotation processing. For example, when the average deviation of particle overlap is 1.3 pixels and the preset alignment tolerance is 2 pixels, it is determined that the current multi-channel rock and mineral thin section image meets the particle overlap accuracy requirements.
[0059] In some specific embodiments, when the average deviation of particle overlap is greater than the preset alignment tolerance, the feature extraction parameters in the local feature extraction algorithm and / or the test parameters in the robust geometric estimation algorithm are adjusted, and the spatial transformation parameters are re-determined based on the adjusted feature extraction parameters and / or the adjusted test parameters to re-perform spatial correction and multi-channel reconstruction. The details are as follows: When the average deviation of particle overlap exceeds the preset alignment tolerance, it indicates that there is still a spatial positional deviation exceeding the allowable range between the current image channels. Therefore, the current spatial correction result cannot be directly determined as passing the verification. Instead, at least one parameter in the feature extraction parameters of the local feature extraction algorithm and the verification parameters of the robust geometric estimation algorithm is adjusted. For example, the feature extraction parameters such as the feature point detection threshold and the number of feature points in the local feature extraction algorithm are adjusted to re-extract features and obtain feature points and their corresponding feature descriptors. The geometric estimation parameters in the robust geometric estimation algorithm are adjusted to change the screening results of abnormal matching points. After the parameter adjustment is completed, the adjusted feature extraction parameters are used to re-extract and match features on the reference image and each non-reference image, and the abnormal matching point removal operation is re-executed using the adjusted verification parameters to obtain the interior point set and spatial transformation parameters corresponding to each non-reference image. Subsequently, spatial correction is re-executed on each non-reference image according to the newly determined spatial transformation parameters, and multi-channel reconstruction is performed again to obtain a new multi-channel rock and mineral thin section image. Calculate the new average particle overlap deviation and compare it with the preset alignment tolerance until the average particle overlap deviation is no greater than the preset alignment tolerance, but stop adjusting the parameters when the maximum number of iterations is exceeded.
[0060] In this embodiment, representative mineral particles are selected from multi-channel rock and mineral thin section images, and the center position of the particles in the reference channel is used as a reference to calculate the spatial distance of each representative mineral particle in different correction channels and the average deviation of particle overlap. The average deviation of particle overlap is judged by the preset alignment tolerance to determine whether the requirements are met. If the requirements are not met, the feature extraction parameters and verification parameters are adjusted and the spatial transformation parameter determination, spatial correction and multi-channel reconstruction are re-executed. This allows the spatial correction results to be iteratively verified and corrected, thereby improving the spatial position consistency of multi-channel rock and mineral thin section images entering the annotation process between different channels.
[0061] In step S105 above, for local locations in the initial global segmentation result that require manual adjustment, the corresponding manual correction regions are determined according to the manual correction guidance operation. A certain range of image content is retained around the manually corrected regions to form local re-segmentation regions, so that the pre-trained segmentation engine can perform segmentation inference only for the local images that need reprocessing. Please refer to... Figure 5 , Figure 5 An embodiment of local segmentation reasoning in the intelligent dataset construction method for rock and mineral thin section images provided in this application includes: S501. Perform manual correction guidance operation on the initial global segmentation result, and determine the manual correction area in the rock and mineral thin section image to be labeled based on the manual correction guidance operation. After displaying the initial global segmentation results, manual correction guidance is provided through interactive methods such as clicking, selecting boxes, or using region indicators. This guides technicians on how to manually correct anomalies in the initial global segmentation results, such as missing mineral grains, missegmentation, or inaccurate boundary positions. Technicians are prompted to modify these areas, including adding mineral grain annotations or deleting missegmented grain boundaries. Subsequently, based on the modifications made by the technicians during the manual correction guidance process, the manually corrected areas are determined within the rock and mineral thin section image to be annotated.
[0062] S502. Using the manually corrected area as a reference, expand outwards along the periphery of the manually corrected area by a preset ratio to obtain a locally re-divided area. Since the pre-trained segmentation engine needs to utilize local image information surrounding the target particles when determining mineral particle regions and boundaries, after determining the manually corrected region, it is necessary to further expand it by a preset ratio to form a local re-segmentation region. If the cropping range is completely consistent with the manually corrected region, image information of particle structures or adjacent regions near the edge of the manually corrected region may not be completely preserved. Therefore, by adding a certain contextual image range around the manually corrected region, the local image can contain the manually corrected location and its surrounding related image information. The local re-segmentation region can be calculated using the following formula: ; ; ; in, This is a manually corrected area; This represents a locally re-segmented region; when the manually corrected region is represented by a rectangular region... and These are the x and y coordinates of the top left corner of the manually corrected area, respectively. and These represent the width and height of the manually corrected area, respectively. Indicates the preset expansion ratio, usually ; This indicates that the range is increased along the left and right directions of the manually corrected area, respectively. This indicates an increase in range along the vertical direction of the manually corrected area. For example, a preset expansion ratio. When set to 0.2, the width or height of the manually corrected region is expanded outward by 20% from each of its four sides. The width of the expanded region is 1.4 times that of the original manually corrected region, and the height is also 1.4 times that of the original manually corrected region. S503: Obtain the local image corresponding to the local re-segmented region, and perform local segmentation inference operation on the local image through the pre-trained segmentation engine to obtain the local segmentation result.
[0063] Based on the location of the locally re-segmented region in the thin section image to be labeled, a corresponding local image is cropped from the thin section image and sent to the pre-trained segmentation engine. At this point, the pre-trained segmentation engine no longer performs global segmentation on the entire thin section image; instead, it performs segmentation inference only on the image content of the local image. Based on the grain features in the local image, it redetermines the pixel regions corresponding to the mineral grains and generates a corresponding local re-segmentation mask. This local re-segmentation mask forms the local segmentation result. Since the locally re-segmented region is formed by expanding outwards from the manually corrected region, the local segmentation result retains not only the areas that need reprocessing but also a certain range of surrounding contextual image information. Therefore, the pre-trained segmentation engine can combine the mineral grain structure around the corrected location to redetermine the grain segmentation result in that local region.
[0064] In this embodiment, the manual correction region is determined based on the initial global segmentation result after manual correction guidance. The location requiring re-segmentation is limited to the local area in the initial global segmentation result where there is labeling deviation. Subsequently, a local re-segmentation region is formed by expanding the area outside the manual correction region by a preset ratio. This allows for control of the reprocessing range while preserving the contextual image information around the correction location, enabling the pre-trained segmentation engine to redetermine the segmentation result based on the local particle structure. Therefore, after manual correction, segmentation inference only needs to be performed on the corresponding local image, without reprocessing the entire unlabeled rock and mineral thin section image. This reduces the computational load caused by repeated segmentation and improves the efficiency of the interactive processing between manual correction and automatic re-segmentation.
[0065] Even after updating the initial global segmentation result based on the local segmentation results to obtain the global segmentation result, annotation anomalies may still exist. Therefore, a quality assessment of the global segmentation result is necessary to improve its reliability. Please refer to [link / reference]. Figure 6 , Figure 6 An embodiment of the quality assessment in the intelligent dataset construction method for rock and mineral thin section images provided in this application includes: S601. Perform a quality assessment on the global segmentation results, wherein the global segmentation results include the global segmentation mask and the mineral particle boundary contour information corresponding to the global segmentation mask, and the quality assessment includes minimum particle area verification and boundary continuity verification. After updating the local segmentation results with the original segmentation dataset, a quality assessment can be performed on the obtained global segmentation mask and the corresponding mineral particle boundary contour information. This checks whether there are still fragmented regions with abnormal areas or incomplete boundaries in the segmentation dataset after automatic segmentation and manual correction, avoiding the direct saving of results that do not meet the annotation requirements. The quality assessment includes minimum particle area verification and boundary continuity verification. Minimum particle area verification is used to determine whether the segmented regions of each mineral particle in the global segmentation mask meet the preset minimum area requirement. The number of pixels contained in the segmentation mask corresponding to each independent mineral particle is counted, and the particle area represented by the number of pixels is compared with the preset minimum particle area threshold. When the area of a segmented region is less than the preset minimum particle area threshold (e.g., 50 pixels), it is considered that the segmented region may belong to a fragmented or noisy region with an excessively small area formed during the segmentation process, and does not meet the corresponding minimum particle area verification requirement. When the area of the corresponding particle region reaches the preset minimum particle area threshold, it is determined that the segmented region meets the verification condition. Boundary continuity verification checks whether the boundary contour information of mineral particles corresponding to the global segmentation mask is complete and continuous. It examines whether the contour points constituting the boundary of each mineral particle can be continuously connected, and determines whether the boundary of the mineral particle forms a closed contour that completely encloses the segmented region of the corresponding mineral particle. If there are obvious breaks, incomplete closures, or missing parts in the boundary contour, the mineral particle is determined to have failed the boundary continuity verification requirement; otherwise, it is determined that the mineral particle meets the corresponding boundary continuity verification requirement.
[0066] S602. When the quality assessment meets the corresponding preset labeling quality conditions, save the global segmentation results according to the preset labeling format. When both the minimum particle area verification and boundary continuity verification meet the corresponding preset annotation quality conditions, it indicates that the mineral particle segmentation regions in the current global segmentation result do not contain any abnormal regions exceeding the allowable range, and the corresponding particle boundary contours have good continuity and integrity. Therefore, the current global segmentation result can be determined to have passed the quality assessment and saved according to the preset annotation format to unify the data format of the global segmentation result, facilitating subsequent dataset management, model training, or image analysis program reading. The preset annotation format can be set according to data usage requirements. For example, the JavaScript Object Notation (JSON) annotation format corresponding to the Common Objects in Context (COCO) dataset can be used to organize and save image information and mineral particle segmentation annotation information.
[0067] S603. When the quality assessment does not meet the corresponding preset annotation quality conditions, perform manual correction guidance on the global segmentation results to re-execute the local segmentation inference operation.
[0068] When the global segmentation result fails at least one of the minimum particle area verification or boundary continuity verification, it indicates that there are still mineral particle regions in the current global segmentation result that require further adjustment. Therefore, the global segmentation result needs to continue to be displayed on the Web annotation platform so that technicians can check and correct the locations that do not meet the quality requirements. After receiving a new manual correction guidance operation, the corresponding manual correction region and local re-segmentation region can be re-determined according to the aforementioned local re-segmentation processing method. The corresponding local image is obtained from the rock and mineral thin section image to be annotated, and the local segmentation inference operation is performed again on the local image through the pre-trained segmentation engine to obtain a new local segmentation result. Subsequently, the current global segmentation result is updated again using the new local segmentation result, and the quality assessment is re-performed on the updated global segmentation result. If the re-assessment meets the preset annotation quality conditions, the segmentation dataset is saved; if it still does not meet the conditions, the manual correction guidance operation continues to be received and the above local re-segmentation process is repeated until a global segmentation result that meets the preset annotation quality conditions is obtained. In practical applications, a maximum number of iterations is usually set. When the maximum number of iterations is reached and the preset annotation quality conditions are still not met, the segmentation dataset is marked as incorrect.
[0069] In this embodiment, after obtaining the global segmentation results, minimum particle area verification and boundary continuity verification are performed to conduct further quality control on the segmentation dataset obtained through automatic segmentation, manual correction, and local re-segmentation. This reduces the possibility of fragmented regions with abnormal areas and mineral particle annotations with incomplete boundaries entering the final dataset, thereby improving the accuracy and reliability of rock and mineral thin section image annotation. At the same time, based on the quality assessment results, the segmentation dataset is saved or re-manually corrected and re-performed local segmentation inference. This avoids repeatedly performing segmentation inference on the entire image while improving the integrity and reliability of the final rock and mineral thin section image segmentation dataset.
[0070] Please see Figure 7 This application also provides an intelligent dataset construction system for rock and mineral thin section images, including: The acquisition unit 701 is used to acquire multiple frames of orthogonally polarized light images of rock and mineral thin section samples under different rotation angles under a microscope, and to determine a reference image based on the multiple frames of orthogonally polarized light images. The determining unit 702 is used to determine the spatial transformation parameters between each non-reference image and the reference image based on the image correspondence between the reference image and each non-reference image; The correction unit 703 is used to perform spatial correction on each non-reference image based on the spatial transformation parameters corresponding to each non-reference image, to obtain a set of corrected images, and to perform multi-channel recombination of the reference image and the set of corrected images to obtain a multi-channel rock and mineral thin section image. The global annotation unit 704 is used to verify the grain overlap accuracy of multi-channel rock and mineral thin section images. It determines the rock and mineral thin section image to be annotated from the multi-channel rock and mineral thin section images that have passed the grain overlap accuracy verification. Then, it performs global segmentation inference operation on the rock and mineral thin section image to be annotated through the pre-trained segmentation engine to obtain the initial global segmentation result of mineral grains in the rock and mineral thin section image to be annotated. Local annotation unit 705 is used to perform manual correction and guidance operations on the initial global segmentation results. Based on the manual correction and guidance operations, local re-segmentation regions are determined, and local segmentation inference operations are performed on the local images corresponding to the local re-segmentation regions through the pre-trained segmentation engine to obtain local segmentation results. Update unit 706 is used to update the initial global segmentation result based on the local segmentation result to obtain the global segmentation result; The classification and labeling unit 707 is used to perform classification and labeling operations on the mineral particle segmentation regions in the global segmentation results, so as to add corresponding rock and mineral labels to the global segmentation results and obtain the rock and mineral dataset.
[0071] Optionally, the determining unit 702 is specifically used for: Local feature extraction algorithms are used to extract features from the reference image and each non-reference image, respectively, to obtain the reference image feature points and reference image feature descriptors of the reference image, as well as the non-reference image feature points and non-reference image feature descriptors of each non-reference image; For each non-reference image, based on the feature similarity relationship between the feature descriptors of the non-reference image and the feature descriptors of the reference image, the feature points of the non-reference image are matched with the feature points of the reference image to obtain the corresponding set of candidate matching point pairs. A robust geometric estimation algorithm is used to remove outlier matching points from the corresponding candidate matching point set and to determine the geometric transformation relationship between the non-reference image and the reference image. The spatial transformation parameters of the non-reference image relative to the reference image are determined based on the geometric transformation relationship. The spatial transformation parameters include rotation angle parameters and translation parameters.
[0072] Optionally, the correction unit 703 is specifically used for: Rotation correction is performed on each non-reference image according to the corresponding rotation angle parameter, and translation correction is performed on each non-reference image after rotation correction according to the corresponding translation parameter, to obtain the corrected image set; According to the preset image channel order, the reference image and each correction image are stacked in the channel dimension to obtain a multi-channel rock and mineral thin section image.
[0073] Optionally, global annotation unit 704 is specifically used for: Several representative mineral grains are selected from multi-channel rock and mineral thin section images. Among them, the image channel corresponding to the reference image in the multi-channel rock and mineral thin section image is the reference channel, and the image channel corresponding to each correction image is the correction channel. For each representative mineral particle, the reference center coordinates of the representative mineral particle in the reference channel and the set of center coordinates of the correction channel in each correction channel are determined, and the spatial distance between the center coordinates of each correction channel and the reference center coordinates is calculated. The average deviation of particle overlap is calculated based on the spatial distance between each representative mineral particle, and then compared with the preset alignment tolerance. When the average deviation of grain overlap is not greater than the preset alignment tolerance, the multi-channel rock and mineral thin section image is verified to pass the grain overlap accuracy test.
[0074] Optionally, an adjustment unit 708 is also included, specifically for: When the average deviation of particle overlap is greater than the preset alignment tolerance, the feature extraction parameters in the local feature extraction algorithm and / or the test parameters in the robust geometric estimation algorithm are adjusted, and the spatial transformation parameters are re-determined based on the adjusted feature extraction parameters and / or the adjusted test parameters, so as to re-perform spatial correction and multi-channel reconstruction.
[0075] Optionally, local annotation unit 705 is specifically used for: Manual correction guidance is performed on the initial global segmentation results, and the manually corrected areas in the rock and mineral thin section images to be labeled are determined based on the manual correction guidance. Based on the manually corrected area, expand outwards by a preset ratio along the periphery of the manually corrected area to obtain a locally re-segmented area; The local image corresponding to the re-segmented region is obtained, and the local segmentation inference operation is performed on the local image through a pre-trained segmentation engine to obtain the local segmentation result.
[0076] Optionally, a quality assessment unit 709 may also be included, specifically for: The global segmentation results are evaluated for quality. The global segmentation results include the global segmentation mask and the mineral particle boundary contour information corresponding to the global segmentation mask. The quality evaluation includes minimum particle area verification and boundary continuity verification. When the quality assessment meets the corresponding preset labeling quality conditions, the global segmentation results are saved according to the preset labeling format. If the quality assessment fails to meet the corresponding preset labeling quality conditions, a manual correction and guidance operation is performed on the global segmentation results to re-execute the local segmentation inference operation.
[0077] In the foregoing embodiments, the specific implementation process of the method provided in this application has been described in detail. It should be understood that, to implement the above method, this application also provides corresponding devices and computer-readable storage media, the technical concepts of which are consistent with the foregoing method embodiments, and both are used to implement all or part of the steps in the foregoing method. The technical solutions of the devices and computer-readable storage media involved in this application will be further described below in conjunction with specific embodiments.
[0078] Please see Figure 8 This application also provides an intelligent dataset construction device for rock and mineral thin section images, comprising: 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 any of the methods described above.
[0079] 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 any of the methods described above.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] 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 constructing an intelligent dataset of thin section images of rocks and minerals, characterized in that, The intelligent dataset construction method includes: Multiple frames of orthogonally polarized light images of rock and mineral thin section samples were acquired under a microscope at different rotation angles, and a reference image was determined based on the multiple frames of orthogonally polarized light images; Based on the image correspondence between the reference image and each non-reference image, the spatial transformation parameters between each non-reference image and the reference image are determined respectively; Based on the spatial transformation parameters corresponding to each non-reference image, spatial correction is performed on each non-reference image to obtain a corrected image set. The reference image and the corrected image set are then recombined in multiple channels to obtain a multi-channel rock and mineral thin section image. The particle overlap accuracy of the multi-channel rock and mineral thin section image is verified, and the rock and mineral thin section image to be labeled is determined from the multi-channel rock and mineral thin section image that has passed the particle overlap accuracy verification. The global segmentation inference operation is then performed on the rock and mineral thin section image to be labeled through a pre-trained segmentation engine to obtain the initial global segmentation result. The initial global segmentation result is manually corrected and guided. Local re-segmentation regions are determined based on the manual correction and guidance operation. Local segmentation inference operation is then performed on the local image corresponding to the local re-segmentation region through the pre-trained segmentation engine to obtain the local segmentation result. The initial global segmentation result is updated based on the local segmentation result, resulting in a global segmentation result. A classification and labeling operation is performed on the mineral particle segmentation regions in the global segmentation result to add corresponding rock and mineral labels to the global segmentation result, thereby obtaining a rock and mineral dataset.
2. The intelligent dataset construction method according to claim 1, characterized in that, The step of determining the spatial transformation parameters of each non-reference image and the reference image based on the image correspondence between the reference image and each non-reference image includes: A local feature extraction algorithm is used to extract features from the reference image and each non-reference image to obtain the reference image feature points and reference image feature descriptors of the reference image, as well as the non-reference image feature points and non-reference image feature descriptors of each non-reference image. For each non-reference image, based on the feature similarity relationship between the non-reference image feature descriptor and the reference image feature descriptor, the feature points of the non-reference image are matched with the feature points of the reference image to obtain a corresponding set of candidate matching point pairs. A robust geometric estimation algorithm is used to perform anomaly matching point removal on the corresponding candidate matching point set, and the geometric transformation relationship between the non-reference image and the reference image is determined. Based on the geometric transformation relationship, the spatial transformation parameters of the non-reference image relative to the reference image are determined, and the spatial transformation parameters include rotation angle parameters and translation parameters.
3. The intelligent dataset construction method according to claim 2, characterized in that, Based on the spatial transformation parameters corresponding to each non-reference image, spatial correction is performed on each non-reference image to obtain a corrected image set. Then, the reference image and the corrected image set are recombined in a multi-channel manner to obtain a multi-channel rock and mineral thin section image, including: Rotation correction is performed on each non-reference image according to the corresponding rotation angle parameter, and translation correction is performed on each non-reference image after rotation correction according to the corresponding translation parameter to obtain a corrected image set; According to the preset image channel order, the reference image and each correction image are stacked in the channel dimension to obtain a multi-channel rock and mineral thin section image.
4. The intelligent dataset construction method according to claim 1, characterized in that, The verification of grain overlap accuracy of the multi-channel rock and mineral thin section images includes: Several representative mineral grains are selected from the multi-channel rock and mineral thin section image, wherein the image channel corresponding to the reference image in the multi-channel rock and mineral thin section image is the reference channel, and the image channel corresponding to each correction image is the correction channel; For each representative mineral particle, the reference center coordinates of the representative mineral particle in the reference channel and the set of correction channel center coordinates in each correction channel are determined respectively, and the spatial distance between the center coordinates of each correction channel and the reference center coordinates is calculated respectively. The average deviation of particle overlap is calculated based on the spatial distance between each representative mineral particle, and the average deviation of particle overlap is compared with the preset alignment tolerance. When the average deviation of particle overlap is not greater than the preset alignment tolerance, the multi-channel rock and mineral thin section image is determined to have passed the particle overlap accuracy verification.
5. The intelligent dataset construction method according to claim 4, characterized in that, After calculating the average particle overlap deviation based on the spatial distances corresponding to each representative mineral particle, and comparing the average particle overlap deviation with a preset alignment tolerance, the intelligent dataset construction method for rock and mineral thin section images further includes: When the average deviation of particle overlap is greater than the preset alignment tolerance, the feature extraction parameters in the local feature extraction algorithm and / or the verification parameters in the robust geometric estimation algorithm are adjusted, and the spatial transformation parameters are re-determined based on the adjusted feature extraction parameters and / or the adjusted verification parameters, so as to re-execute the spatial correction and the multi-channel reconstruction.
6. The intelligent dataset construction method according to claim 1, characterized in that, The step of performing local segmentation inference on the local image corresponding to the locally re-segmented region to obtain the local segmentation result includes: A manual correction guidance operation is performed on the initial global segmentation result, and the manual correction region in the rock and mineral thin section image to be labeled is determined based on the manual correction guidance operation; Based on the artificially corrected area, the area is expanded outward by a preset ratio along the periphery of the artificially corrected area to obtain a locally re-divided area; The local image corresponding to the re-segmented region is obtained, and the local segmentation inference operation is performed on the local image through the pre-trained segmentation engine to obtain the local segmentation result.
7. The method for constructing an intelligent dataset according to any one of claims 1 to 6, characterized in that, After updating the initial global segmentation result based on the local segmentation result to obtain the global segmentation result, and before performing a classification and labeling operation on the mineral grain segmentation regions in the global segmentation result to add corresponding rock and mineral labels to the global segmentation result and obtain the rock and mineral dataset, the intelligent dataset construction method for rock and mineral thin section images further includes: The global segmentation result is evaluated for quality, wherein the global segmentation result includes a global segmentation mask and mineral particle boundary contour information corresponding to the global segmentation mask, and the quality evaluation includes minimum particle area verification and boundary continuity verification. When the quality assessment meets the corresponding preset labeling quality conditions, the global segmentation result is saved according to the preset labeling format; When the quality assessment fails to meet the corresponding preset labeling quality conditions, a manual correction guidance operation is performed on the global segmentation result to re-execute the local segmentation inference operation.
8. A smart dataset construction system for thin section images of rocks and minerals, characterized in that, The intelligent dataset construction system includes: The acquisition unit is used to acquire multiple frames of orthogonally polarized light images of rock and mineral thin section samples under different rotation angles under a microscope, and to determine a reference image based on the multiple frames of orthogonally polarized light images; The determining unit is used to determine the spatial transformation parameters of each non-reference image and the reference image according to the image correspondence between the reference image and each non-reference image; The correction unit is used to perform spatial correction on each non-reference image based on the spatial transformation parameters corresponding to each non-reference image to obtain a corrected image set, and to perform multi-channel reconstruction of the reference image and the corrected image set to obtain a multi-channel rock and mineral thin section image. The global annotation unit is used to verify the grain overlap accuracy of the multi-channel rock and mineral thin section image, determine the rock and mineral thin section image to be annotated from the multi-channel rock and mineral thin section image that has passed the grain overlap accuracy verification, and perform global segmentation inference operation on the rock and mineral thin section image to be annotated through a pre-trained segmentation engine to obtain the initial global segmentation result of mineral grains in the rock and mineral thin section image to be annotated. The local annotation unit is used to perform manual correction and guidance operations on the initial global segmentation result, determine the local re-segmentation region based on the manual correction and guidance operations, and perform local segmentation inference operations on the local image corresponding to the local re-segmentation region through the pre-trained segmentation engine to obtain the local segmentation result. An update unit is used to update the initial global segmentation result based on the local segmentation result to obtain a global segmentation result; The classification and labeling unit is used to perform classification and labeling operations on the mineral particle segmentation regions in the global segmentation result, so as to add corresponding rock and mineral labels to the global segmentation result and obtain a rock and mineral dataset.
9. An intelligent dataset construction device for thin section images of rocks and minerals, characterized in that, The intelligent dataset construction 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 perform the method 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 as described in any one of claims 1 to 7.
