A method for identifying and calculating area proportion of inclusions in high-purity quartz sand particles
Patent Information
- Application Number
- CN202611502281.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
[0010]针对背景技术的不足,本发明提供了一种高纯石英砂颗粒内包裹体识别与面积占比计算方法,所述方法解决了如何在高纯石英砂显微图像中准确识别尺寸极小且易漏检的包裹体,并将包裹体实例唯一关联至对应石英颗粒的技术问题,从而实现单个石英颗粒及整图石英区域层面的包裹体数量、面积和面积占比的定量计算
[0022]本发明提供了一种高纯石英砂颗粒内包裹体识别与面积占比计算方法,所述方法通过全图实例分割获得石英颗粒实例,再依据石英颗粒从原始高分辨率显微图像中裁剪并放大局部区域,利用与全图分支共用特征提取主干网络和像素解码器的局部分支识别包裹体,有效解决了微小包裹体经多次下采样后易漏检、边界分割不完整的问题;同时,通过将局部包裹体实例映射回原图并依据包含度归属、按交并比去重,建立了包裹体与石英颗粒的唯一对应关系,从而能够输出单个石英颗粒的包裹体数量、面积和面积占比以及整图石英区域内的包裹体面积占比,为高纯石英砂以单个颗粒为对象的定量质量评价提供了可靠依据。
Smart Images

Figure CN123015649A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mineral microscopic image analysis technology, and in particular to a method for identifying inclusions and calculating the area ratio within high-purity quartz sand particles. Background Technology
[0002] High-purity quartz sand is a crucial basic material in semiconductors, photovoltaics, fiber optic communications, specialty glasses, and high-end optical devices. The quality of high-purity quartz sand is not only related to the purity of silica but also closely related to the number, area, particle size, and spatial distribution of inclusions within the quartz sand particles. The area of the inclusions and their proportion of the particle's complete projected area reflect the degree to which the inclusions occupy space in a two-dimensional microscopic image of the particle. With the same number of inclusions, differences in inclusion area or area ratio indicate different degrees of occupancy of the inclusions within the particle's internal space. Therefore, the inclusion area and its proportion can serve as important indicators for quantitative evaluation of inclusions in individual quartz particles, used to compare the inclusion distribution of different particles or samples. From an industrial application perspective, for fluid-containing inclusions, under heated conditions such as high-temperature melting, the internal fluid may expand, potentially causing bubbles or fine cracks within the quartz product, adversely affecting the mechanical strength and optical homogeneity of quartz glass.
[0003] Current methods for detecting inclusions within high-purity quartz sand particles mainly rely on manual microscopic observation or traditional image processing methods. Manual observation is highly subjective and inefficient, with results significantly influenced by the operator's experience. Traditional image processing methods typically rely on threshold segmentation, edge detection, or simple morphological processing, which can easily lead to missed or false detections when quartz sand particles have complex textures, extremely small inclusion sizes, and low contrast. Existing evaluation methods usually focus on the presence or number of inclusions, making it difficult to distinguish particles with the same number but significantly different inclusion areas, and also difficult to obtain comparable area proportions through particle area normalization. Therefore, they are insufficient to meet the quantitative quality evaluation needs of individual quartz particles.
[0004] In recent years, deep learning methods have been increasingly used for mineral image recognition and segmentation. For example, some methods employ object detection, semantic segmentation, or instance segmentation to identify quartz regions or inclusion regions. However, existing methods still have the following shortcomings:
[0005] First, the inclusions are extremely small in the microscopic image, with some inclusions occupying only a few dozen pixels. After multiple downsamplings by the network, they are prone to degradation or even disappearance, resulting in insufficient recall rate for inclusion detection.
[0006] Second, existing methods mostly rely on direct reasoning from the whole image, failing to fully utilize the prior relationship that inclusions are usually located inside quartz sand particles, thus making it impossible to perform scale-enhanced detection of inclusions in local areas of quartz sand particles.
[0007] Third, existing methods focus on the total area or index of inclusions at the whole image level, making it difficult to uniquely associate inclusion instances with corresponding quartz sand particles. As a result, it is difficult to further obtain the number, area, and area ratio of inclusions inside a single quartz sand particle, which cannot meet the quality evaluation requirements for a single quartz sand particle.
[0008] Therefore, a method for identifying tiny inclusions in microscopic images is needed, which can detect inclusion instances and provide the area ratio of individual quartz sand particles and the entire image layer of inclusions.
[0009] The micro-inclusions mentioned in this article mainly refer to inclusion targets that are small in size in the input microscopic image, whose effective representation pixels are significantly reduced after multiple downsampling by the instance segmentation network, thus making them easy to miss or have incomplete boundary segmentation. Summary of the Invention
[0010] To address the shortcomings of the prior art, this invention provides a method for identifying inclusions and calculating their area ratio within high-purity quartz sand particles. This method solves the technical problem of accurately identifying extremely small and easily missed inclusions in microscopic images of high-purity quartz sand and uniquely associating each inclusion instance with its corresponding quartz particle, thereby enabling quantitative calculation of the number, area, and area ratio of inclusions in a single quartz particle and at the quartz region level of the entire image.
[0011] To achieve the above-mentioned technical objectives, the present invention provides the following technical solution: A method for identifying inclusions and calculating the area ratio within high-purity quartz sand particles, comprising: S1: Obtain the original microscopic image of high-purity quartz sand; S2: Process the original microscopic image through full-image instance segmentation branch to obtain quartz grain instance mask; S3: Based on the quartz particle example mask, discretize and crop local areas from the original microscopic image, and magnify the cropped local areas to obtain a magnified local image; S4: After the locally magnified image is independently encoded by the shared feature extraction backbone network and pixel decoder, the local instance segmentation branch outputs the wrapper instance; wherein, the local instance segmentation branch and the full-image instance segmentation branch share the feature extraction backbone network and pixel decoder; S5: Map the inclusion instances back to the coordinate system of the original microscopic image, and determine the quartz grain instance to which the inclusion instance belongs based on the spatial relationship between the inclusion instance and the quartz grain instance mask. Remove duplicate inclusion instances belonging to the same quartz grain instance. S6: Based on the deduplicated inclusion instances, count the number of inclusions, the area of inclusions, and the percentage of the area of inclusions for each quartz particle instance, as well as the percentage of the area of inclusions in the entire quartz region of the image. During the training phase, the full-image instance segmentation loss of the full-image instance segmentation branch and the local wrapper instance segmentation loss of the local instance segmentation branch jointly update the parameters of the shared feature extraction backbone network and the pixel decoder.
[0012] Furthermore, the shared feature extraction backbone network includes a hierarchical visual Transformer, a convolutional neural network, or a combination of both; the pixel decoder adopts a multi-scale feature fusion structure; and the full-image instance segmentation branch and the local instance segmentation branch adopt a query-based mask classification structure.
[0013] Furthermore, during the training phases of the full-image instance segmentation branch and the local instance segmentation branch: the local instance segmentation loss includes the local wrapper category loss, the local wrapper binary mask loss, and the local wrapper mask similarity loss; the full-image instance segmentation loss and the local instance segmentation loss are combined according to preset weights, and the joint training loss is: ; ; in, Losses due to joint training The loss is for full-image instance segmentation. For local instance segmentation loss, Weights for segmentation loss of local wrapper instances; For local inclusion category loss, For local inclusion binary mask loss, For local encapsulation mask similarity loss, , and The corresponding loss weights.
[0014] Furthermore, in step S3, based on the quartz particle instance mask or the outer bounding box of the quartz particle instance, the boundary expansion ratio is calculated according to a preset ratio. After boundary expansion and constraint based on the original image boundary, local regions are discretized and cropped from the original microscopic image. The cropped local regions are then magnified to the local recognition input size using bilinear interpolation to obtain a magnified local image.
[0015] Furthermore, if the magnification of a local region is less than a preset magnification threshold, the local region is divided into multiple local sub-regions with a preset overlap ratio; the sliding step size of adjacent local sub-regions... ,in Let the subregion's side length be 1. This represents the overlap ratio between adjacent sub-regions.
[0016] Further, in S4, the local instance segmentation branch outputs the category prediction value and the continuous mask prediction value of the local inclusion; after mapping the continuous mask prediction value to the corresponding original local region and thresholding it, the inclusion instance score is obtained by multiplying the category probability and the average probability of the positive mask region; the inclusion instance score is used for candidate filtering, duplicate result deduplication, and candidate merging sorting.
[0017] Further, in step S5, the top-left corner position, cropping size, and magnification of each local region in the original image coordinate system are recorded; based on the top-left corner position and magnification, the continuous mask prediction values of the local wrapper instances are mapped back to the original image coordinate system, and then thresholding is performed to obtain the wrapper instance mask in the original coordinate system.
[0018] Furthermore, the process of determining the quartz grain instance to which the inclusion instance belongs in S5 includes: calculating the inclusion instance mask. Instance mask with quartz particles Containment degree of pairs The quartz particle instance with the highest inclusion degree is selected as the candidate quartz particle instance; when the maximum inclusion degree is not less than the preset inclusion degree threshold, the inclusion of the inclusion body instance is completed.
[0019] Furthermore, in step S5, the cross-union ratio (CUNR) is calculated for the inclusion instance masks belonging to the same quartz particle instance; when the CUNR exceeds a preset overlap threshold, the inclusion instance with higher confidence is retained or the corresponding mask is merged to complete the deduplication.
[0020] Furthermore, in step S6, the process of obtaining the area ratio of inclusions within the entire quartz region includes: Based on the obtained attribution to the first A set of mask instances containing quartz particles and deduplicated inclusions. and the Instance mask of quartz particles Statistics Number of inclusions per quartz grain And calculate the area of the package. : ; in, Represents a set The number of encapsulated instance masks; To belong to the The first quartz grain Mask for each encapsulated object instance; Indicates an instance mask of an inclusion body With the corresponding quartz particle instance mask The intersection; Indicates a set All wrapper instances mask and Take the union of the intersections; This indicates taking the pixel area;
[0021] Calculate the first Percentage of the area of inclusions in individual quartz particles : ; in, For the first An example of a quartz particle mask and The pixel area; Calculate the percentage of the area of inclusions within the quartz region of the entire image. : .
[0022] This invention provides a method for identifying inclusions and calculating the area ratio within high-purity quartz sand particles. The method obtains quartz particle instances through full-image instance segmentation, then crops and magnifies local areas from the original high-resolution microscopic image based on the quartz particles. Inclusions are identified using a local branch of the feature extraction backbone network shared with the full-image branch and the pixel decoder. This effectively solves the problems of missed detection and incomplete boundary segmentation of small inclusions after multiple downsampling. Simultaneously, by mapping local inclusion instances back to the original image and assigning them based on inclusion degree and deduplicating by intersection-union ratio, a unique correspondence between inclusions and quartz particles is established. This allows for the output of the number, area, and area ratio of inclusions in a single quartz particle, as well as the area ratio of inclusions within the entire quartz region of the image. This provides a reliable basis for quantitative quality evaluation of high-purity quartz sand based on individual particles. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating the method for identifying inclusions and calculating the area ratio of high-purity quartz sand particles provided in an embodiment of the present invention. Figure 2 This is a schematic diagram showing the identification results of quartz particles and inclusions after the microscopic images provided in this embodiment of the invention have been processed by this method. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0026] Example 1
[0027] like Figure 1 As shown, this embodiment provides a method for identifying inclusions and calculating the area ratio within high-purity quartz sand particles, including:
[0028] S1: Obtain the original high-purity quartz sand microscopic image.
[0029] Specifically, the original microscopic images of high-purity quartz sand are obtained, and the original microscopic images are denoted as... Its height and width are respectively denoted as and The original microscopic image is a high-resolution microscopic image containing quartz grains and inclusions within the quartz grains. The original microscopic image is used as the input image for the full-image instance segmentation branch and as the reference image for subsequent local region cropping and magnification.
[0030] Optionally, the original microscopic image has pixel size calibration information, which is used to convert the pixel area into physical area.
[0031] In this embodiment, "area" refers to the pixel area covered by the instance mask; when the microscopic image already has pixel size calibration information, it can also be converted to square micrometers or other area units according to the physical size of the pixels. The "complete projected area" referred to in this embodiment is the two-dimensional projected area of the particle represented by the quartz particle instance mask, including the pixels occupied by the internal inclusion region, so that the area of the inclusion and the area of the particle to which it belongs are in the same coordinate system and under the same area reference.
[0032] S2: Process the original microscopic image through full-image instance segmentation branch to obtain quartz grain instance mask.
[0033] S2-1: Microscopic image of the original high-purity quartz sand Input shared feature coding network Shared feature coding network It consists of a feature extraction backbone network and a pixel decoder, and shares a feature encoding network. This is shared with subsequent local wrapper instance segmentation branches; the shared parameters are denoted as... ; Preferably, the feature extraction backbone network can be a hierarchical visual Transformer, a convolutional neural network, or a combination of both; the pixel decoder can be a multi-scale feature fusion structure.
[0034] S2-2: Extracting features from the backbone network of the original microscopic image Feature extraction is performed to obtain feature maps at multiple spatial scales; S2-3: Upsampling, fusing, and channel transformation are performed on feature maps at multiple spatial scales using a pixel decoder to obtain pixel-level features, which are represented as follows: ; S2-4: Branching by full graph instances pixel-level features The process is performed to obtain the full-graph branch prediction results. , is represented as: ; S2-5: Based on the branch prediction results of the whole graph The mask prediction values of instances belonging to the quartz particle category are obtained, and the mask prediction values are thresholded to obtain the quartz particle instance mask set. ;in Indicates the first A binary instance mask for a quartz particle. This indicates the number of quartz particle instances in the current image.
[0035] Set of quartz particle instance masks This serves as the basis for cropping and magnifying local areas from the original microscopic image in S3.
[0036] Preferably, full-graph instance segmentation branches Predict at least the type of quartz grain; full-graph instance segmentation branch. A query-based mask classification structure is used to output the category prediction value and mask prediction value of quartz particles.
[0037] S3: Based on the quartz particle instance mask, discretize and crop local areas from the original microscopic image, and enlarge the cropped local areas to obtain a magnified local image.
[0038] S3-1: Determine the set of quartz particle instance masks The first in Instance mask of quartz particles outer bounding box: ; in, , These represent the coordinates of the left and top boundaries of the quartz particle instance mask, respectively; , These represent the coordinates of its right and lower boundaries, respectively.
[0039] S3-2: Calculate the circumbound bounding box width and height : ; ; S3-3: Expand according to the preset boundary ratio Constraints are applied based on the boundaries of the original microscopic image (i.e., according to the boundary expansion ratio). The expanded local region coordinates are confined to the coordinate range of the original microscopic image to prevent the cropped region from exceeding the image boundary, resulting in the... The local area corresponding to each quartz grain : ; in, , These are the width and height of the original microscopic image, respectively; S3-4: Describe local regions The width is The height is Based on local recognition input size Determine the local area Magnification : ; S3-5: Determining Magnification Is it not less than the preset multiplier threshold? like If the magnification is not less than a preset threshold, then a local region is discretized and cropped from the original microscopic image. The cropped local area is then enlarged to the local recognition input size using bilinear interpolation. To obtain a magnified image of the local area ; like Less than the preset magnification threshold indicates a local area If the input size is relatively large compared to the local recognition size, then the local region will be... Divided into multiple local sub-regions with a preset overlap ratio. Sliding step size of adjacent local sub-regions ,in Let be the side length of the local sub-region. The overlap ratio of adjacent local sub-regions; for each local sub-region Discrete cropping from the original microscopic image and magnification to the local recognition input size using bilinear interpolation. To obtain a magnified image of the local area ,in This indicates the first quartz grain corresponding to the A local region or a local sub-region; In one specific implementation, the quartz particle instance mask's bounding box is expanded by 10% of its side length around its surrounding area; the local sub-region side length... Set to 256 pixels, the overlap ratio of adjacent local sub-regions Set to 0.25, local recognition input size Set to 1024 pixels, therefore the sliding step size of adjacent local sub-regions The resolution is 192 pixels. The local sub-region is cropped from the original high-resolution microscopic image, scaled to the local recognition input size using bilinear interpolation, and then input into the local inclusion instance segmentation branch.
[0040] S3-6: Record each local area or local subregion The top-left corner position, cropping size, and magnification in the original image coordinate system are used in S5 to map the inclusion instances back to the coordinate system of the original micrograph.
[0041] In this embodiment, the local inclusion instance segmentation branch only predicts the inclusion foreground and no-target categories, thereby reducing query competition related to quartz particle categories during local identification; the full-image instance segmentation branch predicts at least the quartz particle category. This setting does not require the local inclusion instance segmentation branch and the full-image quartz particle instance segmentation branch to use the exact same set of categories.
[0042] S4: After the locally magnified image is independently encoded by the shared feature extraction backbone network and pixel decoder, the local instance segmentation branch outputs the wrapper instance; wherein, the local instance segmentation branch and the full-image instance segmentation branch share the feature extraction backbone network and pixel decoder.
[0043] S4-1: Zoom in on a localized portion of the image Input shared feature coding network Independent encoding is performed, which involves extracting local feature maps at multiple spatial scales through a feature extraction backbone network, and then upsampling, fusing, and channel transforming these local feature maps using a pixel decoder to obtain local pixel-level features. ; Among them, shared feature coding network It consists of a feature extraction backbone network and a pixel decoder, and is shared with the full-image instance segmentation branch in S2; S4-2: Local pixel-level features Input local instance splitting branch The local path prediction results are obtained. ; ; in, This represents the predicted category value of a localized inclusion. This represents the mask prediction value of a local inclusion. S4-3: Results of Local Path Prediction Get the first Category scores of local inclusion candidates and continuous mask prediction value ;Predicted values for continuous masks Thresholding is performed to obtain the positive mask region. ; S4-4: Scoring by Category and positive mask area Calculate the first Instance scores of local wrapper candidates : ; in, Indicates activation; Indicates the positive mask area The number of pixels within the mask area; scores are calculated only for local candidate instances containing pixels within the mask area.
[0044] S4-5: Score based on example The local inclusion candidates are filtered, and those that meet the preset scoring criteria are designated as inclusion instances; instance scores are then calculated. It can be used as a sorting basis for local candidate screening, deduplication of duplicate results in S5, and candidate merging. S4-6: Output the wrapper instance and provide it to S5 for coordinate mapping, attribution, and deduplication.
[0045] S5: Map the inclusion instances back to the coordinate system of the original microscopic image, and determine the quartz grain instance to which the inclusion instance belongs based on the spatial relationship between the inclusion instance and the quartz grain instance mask. Remove duplicate inclusion instances belonging to the same quartz grain instance.
[0046] S5-1: The first The continuous mask predictions or binary masks of local wrapper instances are mapped back to the original image coordinate system according to the corresponding scaling relationship; Among them, local coordinates Compared with the original image coordinates The scaling relationship is expressed as: ; ; in, For the first The first quartz grain corresponds to the first The coordinates of the top left corner of a local region; and These are the horizontal and vertical magnifications, respectively. For continuous mask predictions, the original local region size is first restored according to the above coordinate system scaling relationship, and then thresholding is performed; for already binarized masks, geometric transformation is performed using the nearest neighbor method; after mapping and thresholding, the first value in the original image coordinate system is obtained. Mask of each encapsulation instance ; S5-2: Calculate the mask for inclusion instances Containment degree of pairs : ; in, Indicates an instance mask of an inclusion body pixel area Indicates an instance mask of an inclusion body Instance mask with quartz particles The area of their intersection; S5-3: Use the quartz grain instance with the highest inclusion density as the inclusion instance. Candidate quartz particle instances; when the maximum inclusion degree is not less than the preset inclusion degree threshold, the inclusion instance is completed. To determine the attribution of the quartz grains to which it belongs; S5-4: Calculate the mask for any two inclusion instances belonging to the same quartz grain instance. and intersection ratio : ; S5-5: When intersecting and comparing When the overlap threshold is exceeded, the two wrapper instances are identified as masks. and To ensure duplicate results, retain the wrapper instances with higher confidence levels, or merge the corresponding wrapper instance masks to complete deduplication. S5-6: Output the set of wrapped body instances after attribution and deduplication; where, let the instance attribution belong to the first... The mask set of quartz particle inclusion instances that have been deduplicated is as follows: , will set Provided to S6 for statistics on the number of packages, package area, and package area percentage.
[0047] S6: Based on the deduplicated inclusion instances, count the number of inclusions, the area of inclusions, and the percentage of the area of inclusions for each quartz particle instance, as well as the percentage of the area of inclusions in the entire quartz region of the image. During the training phase, the full-image instance segmentation loss of the full-image instance segmentation branch and the local wrapper instance segmentation loss of the local instance segmentation branch jointly update the parameters of the shared feature extraction backbone network and the pixel decoder.
[0048] Specifically, based on the obtained attribution to the first The mask set of quartz particle inclusion instances that have been deduplicated is as follows: and the Instance mask of quartz particles Statistics Number of inclusions per quartz grain And calculate the area of the package. : ; in, Represents a set The number of encapsulated instance masks; To belong to the The first quartz grain Mask for each encapsulated object instance; Indicates an instance mask of an inclusion body With the corresponding quartz particle instance mask The intersection; Indicates a set All wrapper instances mask and Take the union of the intersections; This indicates taking the pixel area; Calculate the first Percentage of the area of inclusions in individual quartz particles : ; in, For the first An example of a quartz particle mask and The pixel area, that is, the complete projected area of the quartz particle; Calculate the percentage of the area of inclusions within the quartz region of the entire image. : ; Wherein, the numerator represents the union area of the effective inclusion masks within all quartz particle regions, and the denominator represents the union area of the masks for all quartz particle instances. When a quartz particle does not belong to any inclusion instance that passes the preset inclusion threshold, the number of inclusions for that quartz particle is set to... Area of the package and the percentage of the package area All are zero.
[0049] Optionally, when the original high-purity quartz sand microscopic image has pixel size calibration information, the inclusion area is... Quartz particle area The area of the entire quartz region is converted into physical area units according to the pixel physical size.
[0050] Finally, output the number of inclusions for each quartz particle instance. Area of the package and the percentage of the package area And the percentage of the area of inclusions within the quartz region of the entire image. .
[0051] In this embodiment, the full-image quartz particle instance segmentation branch and the local inclusion instance segmentation branch share parameters at the feature extraction backbone network and pixel decoder levels. The locally magnified image is independently encoded by the shared feature encoding network, without directly extracting the entire image prediction feature map as local features. The query parameters, category prediction head parameters, and mask prediction head parameters of the full-image and local instance segmentation branches can be different, and are used for quartz particle recognition and inclusion recognition, respectively.
[0052] In one specific training configuration, the AdamW optimizer is used to update network parameters. The batch size is set to 2, the base learning rate is set to 0.0001, the learning rate of the feature extraction backbone is set to 0.1 times the base learning rate, the weight decay coefficient is set to 0.05, and the gradient clipping threshold is set to 0.01. The total number of training iterations is set to 12,000. The first 500 iterations are used for learning rate warm-up, and learning rate decay nodes are set at the 8,000th and 11,000th iterations. The weights of the class loss, binary mask loss, and mask similarity loss can be set to 6, 8, and 5, respectively, and the weight of the local wrapper instance segmentation loss relative to the global instance segmentation loss can be set to 1.0.
[0053] After clarifying the shared coding relationship between the full-image branch and the local branch, the training phase simultaneously constructs full-image samples and quartz particle local samples, so that the two types of supervision work together on the shared coding parameters.
[0054] Training data includes training microscopic images, quartz grain instance annotations, and inclusion instance annotations. For each training sample, a global training image and a local training image are constructed. The global training image may undergo scale jitter, flipping, or color perturbation. The local training image is obtained by selecting a base region from the labeled quartz grains, applying at least one of positional and scale perturbations, and performing boundary expansion and image boundary constraints. Local training regions can be preferentially selected from local sub-regions intersecting with inclusion annotations; if there are no valid inclusion annotations within the quartz grain region, targetless local training samples can still be constructed. The local training regions during the training phase are determined by the labeled quartz grains and are only used to construct local inclusion supervision; the local regions during the inference phase are determined by the quartz grain instances predicted by the global quartz grain instance segmentation branch. The local regions in both phases are generated using a discrete cropping method.
[0055] Let the full-image instance segmentation loss be... The segmentation loss for local encapsulation instances is The local loss weight is The joint training loss is : ; The shared encoding parameters are affected by both the full-image instance segmentation loss and the local inclusion instance segmentation loss. The full-image quartz grain instance segmentation branch parameters and the local inclusion instance segmentation branch parameters are updated according to their respective task losses.
[0056] The local encapsulation instance segmentation loss can be further expressed as: ; In the formula, For local inclusion category loss, For local inclusion binary mask loss, For local encapsulation mask similarity loss, , and The corresponding loss weights are used. During training, backpropagation can be performed first on the whole image samples, then on the local samples, and a parameter update is performed after the gradients of the two classes are accumulated, so as to reduce the memory usage caused by saving intermediate features of the whole image and the local image at the same time.
[0057] For shared feature extraction backbone network and pixel decoder parameters Its update direction is determined by both the global task and the local task, and can be written as: ; The proprietary parameter basis for the segmentation of quartz grain instances in the whole image Updated, proprietary parameters for splitting branches of local wrapper instances. Update. In one implementation, a full-image training sample and one or more local training samples can be used sequentially in one iteration, and the gradients can be accumulated sequentially before parameter updates are performed; alternatively, the full-image training samples and local training samples can be grouped into the same batch for parallel computation. Neither of the aforementioned organizational methods changes the relationship between the full-image instance segmentation loss and the local wrapper instance segmentation loss acting together on the shared parameters.
[0058] After training is completed, quartz particle instances are first obtained from the microscopic image to be detected, and then local regions are generated based on these quartz particle instances to perform inclusion recognition.
[0059] The identification result of quartz grains and inclusion instances after processing a microscopic image using the method of this embodiment is as follows: Figure 2 As shown in the figure, the green outline represents the boundary of the quartz particle instance mask, and the red area represents the inclusion instance mask. The number of inclusions, the area of inclusions, and the area ratio of each quartz particle are obtained based on the statistical results of the corresponding instance mask in the original image coordinate system.
[0060] In one alternative implementation, if the full-image instance segmentation branch also outputs wrapper candidates, the deduplicated local wrapper candidates can be sorted together with the full-image wrapper candidates according to their instance scores, and the final candidate can be retained within the upper limit of the number of candidates. A unified mask deduplication process can also be performed on candidates from different sources.
[0061] In another optional implementation, the boundary expansion ratio, local input size, and sub-block overlap ratio can be determined based on the area, aspect ratio, prediction confidence, spacing between neighboring quartz particles, and distribution density of candidate inclusions in the full-image. When adjusting parameters using local candidate distribution density, a first round of local regions is generated according to the initial parameters to obtain local candidates, and then a second round of local regions is generated or the sub-block overlap ratio is adjusted based on the distribution density of the first round of local candidates. The local region adjustment parameters can be obtained by rule calculation or by a trained parameter prediction unit; the output of the parameter prediction unit is only used to determine the discrete cropping region, and after the local region is determined, the local image is still cropped from the original microscopic image.
[0062] In another alternative implementation, candidate wrapper instances can be ranked by combining local wrapper instance scores, containment ratios, and consistency with the overall image candidate results. Then, instance count limits and mask deduplication are performed based on the ranking results. Consistency can be determined by the mask cross-union ratio, containment relationship, or center distance between local wrapper candidates and overall image wrapper candidates.
[0063] Under varying conditions of microscopic image resolution, quartz particle pixel size within the image, and computational resources, parameters for local region generation and candidate selection can be set. Local recognition input size. Used to determine the magnified size of a local image; boundary expansion ratio. Used to preserve adjacent areas around the outer boundary of quartz particles; when a local area needs to be processed in blocks, the side length of the sub-region is... Overlap ratio with adjacent sub-regions The scale of each individual sub-region and the degree of overlap between adjacent regions are determined separately. During training, local loss weights can be used. The weights of local inclusion supervision relative to full-image instance segmentation supervision are adjusted. During inference, the inclusion threshold is used to determine whether an inclusion instance can be assigned to a candidate quartz grain, and the overlap threshold is used to determine whether two inclusion instances within the same quartz grain are duplicate results. When it is necessary to limit the final number of candidates, an upper limit on the number of candidates can be set. The above parameters can be determined by the training set, validation set, or pre-set process requirements, and do not constitute a limitation on the scope of protection of this invention.
[0064] This embodiment proposes a method for identifying inclusions and calculating area proportions within high-purity quartz sand particles. The method first identifies quartz particle instances in the entire microscopic image, then crops and enlarges a local area from the original image based on these quartz particle instances. Both the full image and the local image are processed by the same feature extraction backbone network and pixel decoder, used for quartz particle identification and inclusion identification, respectively. After mapping the local inclusion results back to the original image, the quartz particles to which they belong are determined, and the number of inclusions, the area of the inclusions, and the area proportion of the inclusions for each quartz particle are calculated, as well as the area proportion of inclusions within the quartz region of the entire image. The original image is first processed by the feature extraction backbone network and pixel decoder, and quartz particle instances are obtained from the full image instance segmentation branch. Based on the predicted quartz particle instances, a local area is cropped and enlarged from the original image; the enlarged local image is then processed by the local inclusion instance segmentation branch, which shares the same backbone network and pixel decoder as the full image instance segmentation branch, to obtain inclusion instances. During training, the full-image instance segmentation loss and the local wrapper instance segmentation loss jointly update the shared encoding parameters; during inference, the local results are mapped back to the original image for attribution, deduplication, and statistical analysis. The determination of local regions is based on the predicted quartz grain instance mask or its bounding box, which involves discrete cropping and scaling operations. The local images are directly derived from the original high-resolution microscopic images, rather than being enlarged after local alignment of the global feature map; therefore, the local paths can re-extract and fuse multi-scale features from the enlarged original pixels.
[0065] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0066] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for identifying inclusions and calculating the area ratio within high-purity quartz sand particles, characterized in that, include: S1: Obtain the original microscopic image of high-purity quartz sand; S2: Process the original microscopic image through full-image instance segmentation branch to obtain quartz grain instance mask; S3: Based on the quartz particle example mask, discretize and crop local areas from the original microscopic image, and magnify the cropped local areas to obtain a magnified local image; S4: After the locally magnified image is independently encoded by the shared feature extraction backbone network and pixel decoder, the local instance segmentation branch outputs the wrapper instance; wherein, the local instance segmentation branch and the full-image instance segmentation branch share the feature extraction backbone network and pixel decoder; S5: Map the inclusion instances back to the coordinate system of the original microscopic image, and determine the quartz grain instance to which the inclusion instance belongs based on the spatial relationship between the inclusion instance and the quartz grain instance mask. Remove duplicate inclusion instances belonging to the same quartz grain instance. S6: Based on the deduplicated inclusion instances, count the number of inclusions, the area of inclusions, and the percentage of the area of inclusions for each quartz particle instance, as well as the percentage of the area of inclusions in the entire quartz region of the image. During the training phase, the full-image instance segmentation loss of the full-image instance segmentation branch and the local wrapper instance segmentation loss of the local instance segmentation branch jointly update the parameters of the shared feature extraction backbone network and the pixel decoder.
2. The method according to claim 1, characterized in that, The shared feature extraction backbone network includes a hierarchical visual Transformer, a convolutional neural network, or a combination of both; the pixel decoder adopts a multi-scale feature fusion structure; the full-image instance segmentation branch and the local instance segmentation branch adopt a query-based mask classification structure.
3. The method according to claim 1, characterized in that, During the training phases of the full-image instance segmentation branch and the local instance segmentation branch: the local instance segmentation loss includes the local wrapper category loss, the local wrapper binary mask loss, and the local wrapper mask similarity loss; the full-image instance segmentation loss and the local instance segmentation loss are combined according to preset weights, and the joint training loss is: ; ; in, Losses due to joint training The loss is for full-image instance segmentation. For local instance segmentation loss, Weights for segmentation loss of local wrapper instances; For local inclusion category loss, For local inclusion binary mask loss, For local encapsulation mask similarity loss, , and The corresponding loss weights.
4. The method according to claim 1, characterized in that, In step S3, based on the quartz particle instance mask or the outer bounding box of the quartz particle instance, the boundary expansion ratio is calculated according to a preset ratio. After boundary expansion and constraint based on the original image boundary, local regions are discretized and cropped from the original microscopic image. The cropped local regions are then magnified to the local recognition input size using bilinear interpolation to obtain a magnified local image.
5. The method according to claim 4, characterized in that, If the magnification of a local region is less than a preset magnification threshold, the local region is divided into multiple local sub-regions with a preset overlap ratio; the sliding step size of adjacent local sub-regions... ,in Let the subregion's side length be 1. This represents the overlap ratio between adjacent sub-regions.
6. The method according to claim 1, characterized in that, In step S4, the local instance segmentation branch outputs the category prediction value and the continuous mask prediction value of the local inclusion; after mapping the continuous mask prediction value to the corresponding original local region and thresholding it, the inclusion instance score is obtained by multiplying the category probability and the average probability of the positive mask region; the inclusion instance score is used for candidate filtering, duplicate result deduplication, and candidate merging sorting.
7. The method according to claim 1, characterized in that, In step S5, the top-left corner position, cropping size, and magnification of each local region in the original image coordinate system are recorded. Based on the top-left corner position and magnification, the continuous mask prediction values of the local wrapper instances are mapped back to the original image coordinate system, and then thresholding is performed to obtain the wrapper instance mask in the original coordinate system.
8. The method according to claim 1, characterized in that, The process of determining the quartz grain instance to which the inclusion instance belongs in S5 includes: calculating the inclusion instance mask. Instance mask with quartz particles Containment degree of pairs The quartz particle instance with the highest inclusion degree is selected as the candidate quartz particle instance; when the maximum inclusion degree is not less than the preset inclusion degree threshold, the inclusion of the inclusion body instance is completed.
9. The method according to claim 1, characterized in that, In step S5, the cross-union ratio (CUNR) is calculated for inclusion instance masks belonging to the same quartz particle instance; when the CUNR exceeds a preset overlap threshold, inclusion instances with higher confidence are retained or the corresponding masks are merged to complete deduplication.
10. The method according to claim 1, characterized in that, In step S6, the process of obtaining the area ratio of inclusions within the entire quartz region includes: Based on the obtained attribution to the first A set of mask instances containing quartz particles and deduplicated inclusions. and the Instance mask of quartz particles Statistics Number of inclusions per quartz grain And calculate the area of the package. : ; in, Represents a set The number of encapsulated instance masks; To belong to the The first quartz grain Mask for each encapsulated object instance; Indicates an instance mask of an inclusion body With the corresponding quartz particle instance mask The intersection; Indicates a set All wrapper instances mask and Take the union of the intersections; This indicates taking the pixel area; Calculate the first Percentage of the area of inclusions in individual quartz particles : ; in, For the first An example of a quartz particle mask and The pixel area; Calculate the percentage of the area of inclusions within the quartz region of the entire image. : 。
