Weakly supervised intraoral photo detection and segmentation method for early caries
By generating high-quality pseudo-label masks through weakly supervised learning, the problems of high cost and insufficient segmentation precision of manual annotation in early caries detection are solved, and accurate detection and segmentation under different conditions are achieved, which has the value of automation and reproducibility in clinical applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BARTZ (BEIJING) TECH CO LTD
- Filing Date
- 2025-12-29
- Publication Date
- 2026-06-05
AI Technical Summary
Existing methods for detecting and segmenting dental caries rely on human experience, resulting in low detection and accuracy rates. In particular, they are difficult to achieve efficient large-scale screening in early dental caries detection. Furthermore, fully supervised learning methods suffer from high annotation costs and insufficient segmentation precision.
We employ a weakly supervised learning strategy, combining a small number of pixel-level annotations with a large number of image-level labels. We utilize a collaborative mechanism of fused activation heatmaps, two-layer superpixel grid expansion, and edge response maps to generate high-quality pseudo-label masks. We then train a segmentation network using partial cross-entropy loss, boundary intersection-union ratio loss, and consistency constraints to automatically generate tooth surface region masks and lesion masks.
It effectively reduces the cost of manual annotation, decreases false positives and false negatives, improves boundary fit and cross-sample stability, and achieves accurate detection and segmentation under different lighting, equipment and individual differences, and has automated and reproducible clinical application value.
Smart Images

Figure CN121810635B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image detection technology, specifically relating to a weakly supervised intraoral photograph detection and segmentation method for early dental caries. Background Technology
[0002] In the current field of oral medical imaging analysis, the detection and segmentation of dental caries has long relied on the experience and judgment of clinicians. Doctors determine the presence and extent of early caries by visually examining intraoral photographs or oral microscopic imaging results, combined with observations of white spots, color changes, and anatomical features. However, because early caries, especially leukoplakia and occult caries, often lack obvious morphological characteristics, visual diagnosis is easily affected by ambient lighting, tooth surface reflection, and individual differences in enamel transparency, resulting in low detection rates and accuracy. This reliance on manual methods not only suffers from subjective bias but also cannot be efficiently applied in large-scale screening.
[0003] To reduce the workload of doctors, a class of automated detection methods based on computer vision and deep learning has emerged in recent years. A common approach is to use fully supervised learning, training the model on a large number of intraoral photographs with pixel-level annotations to obtain a model capable of segmenting carious areas. While these methods can theoretically achieve high segmentation accuracy, they suffer from significant annotation costs in practical applications. The boundaries of caries, especially early lesions, are often blurred, requiring doctors to meticulously draw each pixel, which is both time-consuming and difficult to maintain consistency. Furthermore, significant individual differences among patients, including variations in tooth morphology, lighting conditions, and imaging equipment, all affect the representativeness of the training data. Therefore, fully supervised detection and segmentation methods have encountered bottlenecks in large-scale deployment.
[0004] To reduce the need for annotation, researchers have proposed learning strategies based on weak supervision. For example, some methods use only image-level labels, marking only whether a photo contains cavities without precisely marking the location of the lesion, and then using the class activation map of the classification network to locate the suspected lesion area. While this method reduces the annotation workload, the resolution of the class activation map is low, usually only responding in a general area, making it difficult to obtain a mask consistent with the lesion boundary. As a result, although the detection rate is improved, the segmentation fineness is insufficient, making it difficult to support accurate clinical assessment of the extent and severity of lesions. Summary of the Invention
[0005] The main objective of this invention is to provide a weakly supervised intraoral photograph detection and segmentation method for early caries. Based on a small number of pixel-level annotations combined with a large number of image-level labels, it utilizes a collaborative mechanism of fused activation heatmaps, two-layer superpixel mesh expansion, and edge response maps to generate high-quality pseudo-label masks. The segmentation network is jointly trained using partial cross-entropy loss, boundary intersection-union loss, and consistency constraints. During the inference phase, only intraoral photographs are required as input to automatically generate tooth surface region masks and lesion masks, and output a list of lesion locations. This invention effectively reduces the cost of manual annotation, minimizes false positives and false negatives caused by specular reflection and noise, and improves boundary fit and cross-sample stability. Therefore, it achieves accurate detection and segmentation of leukoplakia and occult caries under different lighting, equipment, and individual differences, possessing automation, reproducibility, and clinical application value.
[0006] To solve the above problems, the technical solution of the present invention is implemented as follows:
[0007] A weakly supervised intraoral photographic detection and segmentation method for early dental caries, comprising:
[0008] Step 1: Perform color normalization on the intraoral photograph to obtain a color normalized intraoral photograph, detect specular reflection to generate a specular reflection mask, segment the tooth surface to obtain a tooth surface region mask, train a weakly supervised discriminant network to output a fused activation heatmap, and extract edge response maps;
[0009] Step 2: Within the tooth surface mask, determine the foreground seed set and background seed set based on the fused activation heatmap; construct a two-layer superpixel mesh and establish parent-child relationships; for seeds located within the specular reflection mask, replace their values with the median of the fused activation heatmap of the nearest non-reflective superpixel along the adjacent path; write the foreground seed set and background seed set into the foreground queue and background queue respectively; dequeue one from the foreground queue and one from the background queue in turn, and determine the priority and assign affiliation to unassigned adjacent superpixels in the following order; when the fine-grained assignment and the coarse-grained parent assignment are inconsistent, the parent assignment is used as the final decision and is synchronized back to the adjacent fine-grained superpixels; when foreground and background compete simultaneously, first compare the average edge response map of the shared edge, and then confirm by the adjacent majority; traverse until there are no new assignments in both queues, and output the pseudo-label mask;
[0010] Step 3: The segmentation network is trained under joint supervision using pseudo-label masks and a small number of pixel-level labeled samples, employing partial cross-entropy loss, boundary intersection-union ratio loss, and consistency constraints. During the inference phase, only intraoral photographs are input. First, a mask for the tooth surface region is generated, and then a lesion mask and a list of lesion locations are output for the detection and segmentation of leukoplakia and occult caries.
[0011] Furthermore, in step 1, within the mask of the tooth surface region, the gradient operator and non-maximum suppression are used to calculate the edge of the color-normalized intraoral photograph to obtain the edge response map; when training the weakly supervised discriminant network, the input is the color-normalized intraoral photograph and the image-level existence label, and the output is the target activation heatmap of two scales, which are fused into a fused activation heatmap by taking the larger value for each pixel.
[0012] Furthermore, in step 2, two layers of superpixel meshes, a fine-grained layer and a coarse-grained layer, are generated from the color-normalized intraoral photograph within the mask of the tooth surface region. The parent-child relationship between each fine-grained superpixel and its corresponding coarse-grained parent superpixel is established, and the adjacency relationship within the same layer is established.
[0013] Further, in step 2, an upper percentile threshold and a lower percentile threshold are calculated on the fused activation heatmap. The upper percentile threshold is used to generate the foreground seed set, and the lower percentile threshold is used to generate the background seed set. Seeds falling into the specular reflection mask are temporarily marked as seeds to be corrected. For each fine-grained superpixel containing a seed to be corrected, the median of the fused activation heatmap values of the first three non-reflective fine-grained superpixels along the shortest adjacent path to the nearest non-reflective region is selected as the alternative activation value of the fine-grained superpixel. If there are fewer than three available non-reflective fine-grained superpixels, all available ones are used. If the value is still lower than the upper percentile threshold after substitution, the fine-grained superpixel is transferred to the background candidate set; otherwise, it is retained in the foreground candidate set.
[0014] Furthermore, in step 2, the foreground seed set and the background seed set are written into the foreground queue and the background queue, respectively; the corresponding fine-grained superpixels are marked as belonging, and their coarse-grained parent superpixels are recorded as belonging parent nodes of the same type.
[0015] Furthermore, in step 2, for each unassigned adjacent fine-grained superpixels in the same layer that have been assigned to a fine-grained superpixel, a candidate priority is calculated. The candidate priority is determined by three factors and compared in order: whether the fused activation heatmap value of the candidate fine-grained superpixel is higher than the average of the fused activation heatmap values of all its assigned adjacent fine-grained superpixels; whether the average value of the edge response map on the shared edge between the candidate fine-grained superpixel and the assigned fine-grained superpixel that triggered the candidate relationship is lower than the median of the edge response map within the mask of the tooth surface region; and whether the candidate fine-grained superpixel is located within a specular reflection mask. If it is located within a specular reflection mask, it is recorded as the lowest priority, unless two or more non-reflective adjacent fine-grained superpixels of the candidate have been assigned to the foreground. The above factors are judged one by one in order, and the one that satisfies the higher factor first has priority.
[0016] Furthermore, in step 2, a fine-grained superpixel is dequeued from the foreground queue and the background queue in turn, and its unassigned adjacent fine-grained superpixels are marked with the same assignment as the current queue according to the candidate priority from high to low. When the assignment of the fine-grained superpixel is inconsistent with the assignment already recorded by its coarse-grained parent superpixel, the assignment of the coarse-grained parent superpixel is taken as the final decision, and the decision is synchronized back to the adjacent fine-grained superpixels to ensure consistency between the two layers.
[0017] Furthermore, in step 2, when the same candidate fine-grained superpixel is simultaneously contested by the foreground and background, the following rules are executed sequentially until an assignment is determined: compare the average edge response map value of the candidate fine-grained superpixel with the foreground queue triggerer and the average edge response map value of the candidate fine-grained superpixel with the background queue triggerer, and select the side with the lower average value as the assignment; if they are the same, compare whether the coarse-grained parent superpixel of each of the two triggerers is the same as the coarse-grained parent superpixel of the candidate fine-grained superpixel, and give priority to the same one; if they are still not distinguishable, the candidate fine-grained superpixel is temporarily stored as pending, and confirmed according to the adjacency majority principle after all its adjacent fine-grained superpixels in the same layer have completed their assignments; after the conflict resolution is completed, if it will result in crossing the high response band of the edge response map, the original assignment remains unchanged.
[0018] Furthermore, in step 2, if no new assignments are added to either the foreground or background queues after a complete traversal, or if the number of newly assigned fine-grained superpixels is less than 1% of the total number of assigned superpixels in two consecutive traversals, then expansion is stopped. After stopping, hole filling, small isolated area removal, and boundary smoothing are performed within the tooth surface region mask. When smoothing the boundary, the maximum displacement of each boundary point is limited to no more than 2 pixels. The union of the final foreground assigned fine-grained superpixels is used as a pseudo-label mask, and its intersection with the tooth surface region mask is used to obtain an effective pseudo-label mask for training.
[0019] The weakly supervised intraoral photograph detection and segmentation method for early dental caries of this invention has the following advantages: Firstly, this method requires only a small number of pixel-level labeled samples for training with a large number of image-level labels. It generates high-quality pseudo-label masks by fusing activation heatmaps and a seed expansion strategy using two layers of superpixel meshes, effectively reducing the workload of manual fine-grained annotation and solving the problem of traditional fully supervised methods relying on large amounts of labeled data. Secondly, the introduction of a collaborative decision mechanism involving the fusion of activation heatmaps, edge response maps, and specular reflection masks during pseudo-label generation not only ensures the stability of foreground and background expansion but also significantly reduces false positives and false negatives caused by highlights, noise, or blurred boundaries through cross-layer consistency adjudication and adjacent majority confirmation, giving pseudo-labels high credibility both within the contour and the region. Thirdly, during the segmentation network training process, the pseudo-label mask and a small number of pixel-level labeled samples are used for joint supervision. Combined with partial cross-entropy loss, boundary intersection-union ratio loss, and consistency constraints, the model can achieve a balance between region discrimination, boundary fitting, and cross-sample stability, thus maintaining strong generalization ability under different lighting, device, and individual differences. Finally, in the inference stage, the method can automatically generate tooth surface area masks and lesion masks based solely on the input intraoral photographs, and further output a list of lesion locations. This provides an automated, reproducible, and efficient solution for the detection, segmentation, and clinical severity assessment of early caries, which can be extended to large-scale oral health screening and long-term lesion monitoring. Attached Figure Description
[0020] Figure 1 A schematic diagram illustrating the thresholding, contour extraction, and polygon approximation results of the lesion probability map provided in an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram illustrating the pixel-by-pixel fusion principle of dual-scale path activation heatmaps provided in an embodiment of the present invention.
[0022] Figure 3 This is a schematic diagram of the gradient direction and non-maximum suppression principle of the edge response map provided in an embodiment of the present invention;
[0023] Figure 4 This provides a schematic diagram of the hierarchical mapping between coarse-grained parent superpixels and fine-grained superpixels for embodiments of the present invention. Detailed Implementation
[0024] The terms "first," "second," "third," and "fourth," etc. (if present), in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein.
[0025] A weakly supervised intraoral photographic detection and segmentation method for early dental caries, comprising:
[0026] Step 1: Perform color normalization on the intraoral photograph to obtain a color normalized intraoral photograph, detect specular reflection to generate a specular reflection mask, segment the tooth surface to obtain a tooth surface region mask, train a weakly supervised discriminant network to output a fused activation heatmap, and extract edge response maps.
[0027] During the process, the original intraoral photographs were first processed to approximate linearization, reducing the nonlinear mapping differences from different shooting devices and thus making the same physical brightness appear more consistent in intensity on the image. Next, channel gain balancing was performed: the average intensity of the three color channels across the entire image was calculated, and the three channels were scaled to the same average intensity to eliminate the overall color cast caused by camera white balance. To reduce the interference of local strong light on channel balancing, a percentile white reference method was introduced: the brightest 5% of pixels were selected as approximate white references, the average value of this set across the three channels was calculated, and a small-scale adjustment was made to the channel gain to make this approximate white area closer to neutral. Based on this, illuminance normalization was performed: a strongly smoothed version was generated as an approximate illuminance map, and the original image was normalized pixel-by-pixel to this approximate illuminance map, suppressing slow changes caused by light source position, oral moisture, and lip / buccal occlusion, making the reflection differences caused by enamel and lesions relatively prominent. After the above processing, a color-normalized intraoral photograph was obtained. The advantage of this approach is that the differences in brightness and color between the white spot area and healthy enamel are no longer masked by equipment differences and uneven lighting, which is beneficial for subsequent specular reflection detection, tooth surface segmentation, and weak supervision discrimination.
[0028] Color-normalized intraoral photographs are converted into a color representation that separately represents brightness, saturation, and hue. Specular reflection on tooth surfaces typically manifests as high brightness and low saturation because it primarily originates from the colorless reflection of the light source. Based on this phenomenon, the upper percentile of the overall brightness distribution is used as the candidate threshold for high brightness, while the lower percentile of the overall saturation distribution is used as the candidate threshold for low saturation. Initial candidate regions are formed where both conditions are met. Considering that metal restorations and wet plaque may also appear as high brightness, two quantities are calculated for the outer boundary of the initial candidate regions to eliminate false positives: first, whether the intensity drop within a short scale is significant and continuous; and second, whether the hue change at the boundary remains small. Specular reflection edges typically show continuous intensity drops with insignificant hue changes; metal and plaque edges often exhibit abrupt hue changes or complex textures. Only when both conditions are met simultaneously are the corresponding pixels retained in the specular reflection candidate. Subsequently, hole filling and small region removal are performed to ensure region coherence and eliminate noise. To avoid mistakenly including real white spots in the mask, a narrow band several pixels wide is selected along the inner side of the candidate area. The difference in hue between this narrow band and its adjacent tooth surfaces is compared: if the difference remains consistently small, the narrow band is retained as part of the specular reflection; if the difference significantly increases, the narrow band is removed from the candidates. This process yields the specular reflection mask. The specular reflection mask is used in two key operations in step 2: first, in the determination and correction of the foreground and background seed sets, seeds falling into the specular reflection mask are replaced or downweighted; second, when candidate priority and conflict resolution involve edge response maps, the confidence level of the inner edges of the mask is lowered to reduce the misleading effect of highlight edges on the growth front.
[0029] A segmentation network was trained on a small number of pixel-level annotated tooth surfaces and a large number of unannotated photographs. During training, specular reflection masks were ignored, and no forced supervision was applied to pixels within the masks to reduce the impact of artifacts. During inference, an initial tooth surface mask was first obtained. Then, purification was performed based on geometry and connectivity: isolated fragments that were too small and inconsistent with the tooth arch position were removed, and internal cavities were filled to create a continuous coronal region on the tooth surface. The result is the tooth surface region mask. The reason for obtaining the tooth surface region mask first and then performing subsequent processing is that restricting all subsequent decisions to within the tooth surface region mask significantly reduces the interference of lip, buccal, lingual, and instrument reflections on the computation, thereby improving the consistency of subsequent weakly supervised discrimination and edge extraction.
[0030] The weakly supervised discriminant network primarily uses image-level presence labels as the supervisory signal, supplemented by a small number of pixel-level lesion annotations for calibration. To balance the minute scale of early leukoplakia with the contextual features of occult caries, a dual-scale path is used to generate two activation heatmaps: one path uses a smaller receptive field to reinforce small, highly reflective areas; the other path uses a larger receptive field to suppress noise and preserve tooth surface structural associations. After training, the two activation heatmaps are interpolated to the same resolution as color-normalized intraoral photographs and fused using the larger value per pixel to obtain a fused activation heatmap. The reason for choosing the larger value per pixel is that early leukoplakia often appears as dots or small patches. If mean fusion is used, these small but strong responses are easily diluted by the smoothing effect of the large-scale path; the larger value per pixel can preserve strong local evidence without losing the stable background provided by the large-scale path. For high responses located within the specular reflection mask, the median of the adjacent non-reflective area is used as a substitute, or its weight is directly reduced to eliminate false hotspots caused by highlights. Finally, the fusion activation heatmap is normalized within the masked area of the tooth surface to make the response ranges comparable between different images. The fusion activation heatmap is directly used in step 2 to determine the foreground and background seed sets, and serves as a key basis for candidate priority and conflict resolution.
[0031] To obtain the edge response map, the color-normalized intraoral photograph is first lightly smoothed to reduce photosensitive noise and microtexture. Then, the first-order intensity changes in the horizontal and vertical directions are calculated to obtain the intensity change amplitude and direction for each pixel. Next, non-maximum suppression is performed, retaining only local peaks in the intensity change direction to make the edges fine and stable. Then, a dual-threshold linking method is used to directly retain high-confidence edges, include medium-confidence edges connected to high-confidence edges, and remove isolated low-confidence edges. Finally, a tooth surface region mask is used for cropping, retaining only the edge response within the tooth surface to obtain the edge response map. This process is used because the boundary between enamel and lesions usually corresponds to a continuous and uniformly oriented fine boundary. Non-maximum suppression can highlight this fine boundary, and dual-threshold linking can maintain connectivity when breaks exist, thus providing reliable constraints for candidate priority calculation and conflict resolution in step 2.
[0032] refer to Figure 3 , Figure 3This diagram illustrates the principle of gradient calculation and non-maximum suppression (NMS) for generating edge response maps in this invention. It provides a detailed analysis of how to extract a fine and stable enamel-lesion boundary from a color-normalized intraoral photograph, providing reliable boundary constraints for subsequent region growth. The vector field arrows in the background show the gradient changes in local intensity within the image; the length of the arrow represents the gradient magnitude, and the direction represents the gradient direction. In dental image processing, lesion edges are often accompanied by significant intensity drops. To capture this change, the first derivatives in the horizontal and vertical directions are first calculated to synthesize the gradient field. However, directly calculated gradients often exhibit a wide transition band near the edge, as shown by the area enclosed by the two dashed lines in the diagram, leading to blurred boundary localization. To address this issue, this invention introduces NMS technology, the core logic of which is shown by the solid path in the diagram. This algorithm compares the gradient magnitude of the current pixel with that of its neighboring pixels along its gradient direction (i.e., the direction of the most drastic intensity change). A pixel is retained as an edge candidate only if its gradient magnitude is greater than that of its two neighbors in the gradient direction; otherwise, its gradient value is suppressed to zero. This process effectively eliminates non-peak points on the edge transition zone, "refining" the originally broad edge response into lines of single-pixel width, as shown by the bold solid line in the figure, greatly improving the accuracy of boundary localization. Furthermore, the figure also illustrates the mechanism of dual-threshold linking. To distinguish between true anatomical boundaries and weak noise textures, the system sets two thresholds: high and low. The black solid dots in the figure represent strong edge nodes above the high threshold, which are considered definitive boundaries; the white hollow dots represent weak edge nodes between the high and low thresholds. The linking process stipulates that a weak edge is only retained if there is a connected path between a weak edge node and a strong edge node. This mechanism ensures edge continuity, allowing broken edges caused by uneven lighting or local blurring to be repaired, while effectively filtering out isolated noise edges. The resulting edge response map plays a crucial "hindrance" role in subsequent candidate priority determination and conflict resolution, preventing the region growing algorithm from crossing the boundaries of the real anatomical structure.
[0033] In another implementation, if the photograph contains a standard white reference or color chart, channel gain balancing can be performed directly using the three-channel average value of the reference, skipping the percentile white reference method to enhance cross-device consistency. The threshold for the specular reflection mask is determined adaptively: from a set of candidate threshold combinations, the combination that maximizes the retention rate of non-reflective pixels in the tooth surface area and minimizes the false detection rate is selected, thus adapting to different light intensities and oral humidity levels. The tooth surface area mask can be purified using positional priors: when a candidate area is far from the main axis of the dentition and has a fragmented shape, it is directly removed to reduce the probability of residue on the lips, cheeks, and tongue. The normalization range of the fusion activation heatmap can be adaptively set according to the intensity distribution within the tooth surface area mask, keeping the response density stable under different exposure conditions, facilitating the use of a unified upper and lower percentile threshold in step 2. The dual thresholds of the edge response map can be calculated from the intensity distribution within the tooth surface area mask, ensuring consistent edge density between low-exposure and high-exposure photographs and avoiding systematic bias in candidate priority.
[0034] Step 2: Within the tooth surface mask, determine the foreground seed set and background seed set based on the fused activation heatmap; construct a two-layer superpixel mesh and establish parent-child relationships; for seeds located within the specular reflection mask, replace their values with the median of the fused activation heatmap of the nearest non-reflective superpixel along the adjacent path; write the foreground seed set and background seed set into the foreground queue and background queue respectively; dequeue one from the foreground queue and one from the background queue in turn, and determine the priority and assign affiliation to unassigned adjacent superpixels in the following order; when the fine-grained assignment and the coarse-grained parent assignment are inconsistent, the parent assignment is used as the final decision and is synchronized back to the adjacent fine-grained superpixels; when foreground and background compete simultaneously, first compare the average edge response map of the shared edge, and then confirm by the adjacent majority; traverse until there are no new assignments in both queues, and output the pseudo-label mask;
[0035] In one implementation, the pixel intensity distribution of the activation heatmap is statistically fused within the tooth surface region mask, using only pixels covered by the mask and ignoring areas outside the tooth surface. This avoids changes in the threshold position due to lip, cheek, tongue, and instrument reflections, ensuring the threshold reflects the contrast of the tooth surface itself. A set of candidate percentiles is scanned within the tooth surface region mask as an alternative set for upper and lower percentile thresholds. For example, the upper percentile threshold is searched within the 85th to 95th percentiles, and the lower percentile threshold is searched within the 5th to 15th percentiles. For each pair of candidate thresholds, two interpretability metrics are calculated: whether the number of foreground candidate connected components falls within the range of 1 to 8, and whether the proportion of the foreground candidate area to the tooth surface region mask falls within the range of 0.1% to 10%. Choose the threshold pair that satisfies both conditions. If multiple pairs exist, prioritize the pair that minimizes the number of connected components in the foreground candidate to reduce false positives. If no threshold pair satisfies both conditions, fix the upper percentile threshold at 90 and the lower percentile threshold at 10. Percentiles are used instead of fixed intensity because different devices and exposure conditions alter absolute intensity, while percentiles align distribution positions, maintaining stability across devices. Within the tooth surface mask, pixels with fused activation heatmaps greater than or equal to the upper percentile threshold are added to the foreground candidate; pixels with fused activation heatmaps less than or equal to the lower percentile threshold are added to the background candidate; other pixels are not used as seeds. Connectivity contraction is performed on the foreground and background candidates, retaining a few central pixels in each connected component as seeds and removing edge single-pixel protrusions. This places the seeds in the most stable evidence positions, reducing false expansion due to boundary jitter during subsequent iterations. Foreground and background seed sets are formed, and their original intensities in the fused activation heatmap are recorded for reference during subsequent correction and adjudication.
[0036] refer to Figure 2 , Figure 2This diagram illustrates the principle of fusion activation heatmap generation in the dual-scale weakly supervised discriminant network constructed in this embodiment of the invention. The diagram visually demonstrates how combining feature paths with different receptive fields solves the problem of distinguishing between minute lesions and background noise in early caries detection. The horizontal axis represents a one-dimensional cross-section of the tooth surface space, and the vertical axis represents the intensity of the activation response. The diagram shows two curves of different shapes, corresponding to the small-scale path and the large-scale path in the network, respectively. The dotted dashed line represents the activation response of the small-scale path. Because this path uses a smaller convolutional kernel and receptive range, it is extremely sensitive to local high-frequency details in the image. As shown by the peak on the left, the small-scale path can generate a very strong response signal for tiny early white spots or punctate demineralization, accurately capturing the location of the lesion. However, this high sensitivity also brings side effects, namely the random fluctuations shown in the diagram, which are easily affected by tooth surface microtexture or photosensitive noise, producing artifacts. In contrast, the long dashed line in the diagram represents the activation response of the large-scale path. This path has a larger receptive range and can capture the overall structure and contextual information of the tooth. Its response curve is relatively smooth, effectively suppressing isolated noise and reflecting the macroscopic continuity of the tooth surface structure. However, when faced with minute lesions, its response is often diluted by the surrounding background, resulting in insufficient signal strength. To balance the advantages of both approaches, this invention adopts a pixel-wise maximum value fusion strategy as shown by the solid line in the figure. Unlike common mean fusion, maximum value fusion compares the outputs of the two paths at each pixel location and retains the stronger signal. As shown in the shaded area in the figure, at the location of minute lesions, the fusion curve follows the high response of the small-scale path, preserving the keen ability to capture early lesions; while in flat background areas, the fusion curve refers more to the smooth features of the large-scale path, avoiding false activation of noise. This design cleverly utilizes the characteristic that early caries usually manifests as a local strong signal, ensuring that the fused activation heatmap neither loses weak lesion evidence nor fails to maintain the purity of the background. In addition, the logic in the figure implicitly includes the processing of specular reflection, that is, removing outliers in the highlight area through a masking mechanism before fusion, ensuring that the heatmap reflects the true changes in enamel scattering. The resulting fusion activation heatmap provides high-confidence prior guidance for subsequent seed growth and pseudo-label generation.
[0037] Within a masked area of the tooth surface, color-normalized intraoral photographs are used to generate two layers of segmentation: fine-grained superpixels and coarse-grained parent superpixels. The target size of the fine-grained superpixels is set to include approximately 800 to 1500 fine-grained superpixels in the entire image, while the target size of the coarse-grained parent superpixels is set to 3 to 6 times that of the fine-grained superpixels, resulting in approximately 150 to 350 coarse-grained parent superpixels. This scale ratio is chosen because fine-grained superpixels can closely match the edge details of white spots, while coarse-grained parent superpixels provide stable, globally consistent anchor points. The combination ensures boundary fit while avoiding fragmented attribution in areas of weak evidence. Adjacent relationships are established between each fine-grained superpixel and its coarse-grained parent superpixel. Two coarse-grained superpixels are considered adjacent if they share a boundary length of at least 3 pixels. Setting a minimum shared length eliminates false adjacencies caused by noise or isolated pixels, ensuring that the adjacency paths more closely resemble the actual structure. A coarse-grained parent superpixel is assigned to each fine-grained superpixel as its coarse-grained parent superpixel. The specification method is as follows: calculate the overlap area between the fine-grained superpixel and all its intersecting coarse-grained parent superpixels, and select the one with the largest overlap area as the target of the parent-child relationship. This ensures that the parent-child relationship is most consistent with the spatial coverage, avoiding incorrect assignment across tooth surface boundaries. After specifying the parent-child relationship for all fine-grained superpixels, verify that each coarse-grained parent superpixel has at least one child; if an isolated coarse-grained parent superpixel is found, merge it with the adjacent coarse-grained parent superpixel with the longest shared boundary, and then update the corresponding parent-child relationship. This avoids the situation of having no parent anchor point during subsequent consistency determination.
[0038] In the foreground and background seed sets, locate all seeds falling within the specular mask and mark them as seeds to be corrected. Seeds within the specular mask are prone to false high or low responses due to specular highlights; directly participating in the recursion will create unrealistic expansion fronts near the boundaries, thus requiring prior correction. For each seed to be corrected, determine its corresponding fine-grained superpixel as the starting point. Perform a layer-by-layer outward search on the same-layer adjacency relationship, searching for the nearest non-reflective fine-grained superpixel along the adjacency path. The search starts from all adjacent fine-grained superpixels of the starting point and progresses in ascending order of the number of steps from the starting point until at least one fine-grained superpixel not within the specular mask is found. Record the average pixel intensity of the first three non-reflective fine-grained superpixels encountered during the search process on the fused activation heatmap. If fewer than three non-reflective fine-grained superpixels are available, record the total number of available ones. Use the median of these recorded values as the alternative activation value for the seed to be corrected. Selecting the nearest non-reflective fine-grained superpixel on the adjacent path maximizes the consistency of the local environment, preventing it from being affected by different reflection conditions on distant tooth surfaces. Using the median can suppress accidental outliers, such as abnormal responses caused by a non-reflective neighbor covering plaque or metal edges, resulting in a more robust alternative activation value. The alternative activation value replaces the original intensity of the seed to be corrected in the fused activation heatmap, and the seed is re-evaluated to determine whether it belongs to the foreground or background seed set: if the alternative activation value is greater than or equal to the percentile threshold, it is retained in the foreground seed set; if the alternative activation value is less than the percentile threshold, the seed is moved to the background candidate set. This directional determination is used because specular reflection is more likely to create artificially high signals; seeds that still reach the percentile threshold after replacement are more reliable, while those that do not are less likely to represent actual lesions. If no non-reflective fine-grained superpixels are found within the set number of steps, it indicates that the area is covered by a large area of highlight. At this point, the seed is removed from the foreground seed set and added to the background candidate set. Simultaneously, a marker is added at this position indicating that it will not participate in the recursion, prompting subsequent recursions to proceed cautiously in the vicinity of this position. This helps prevent the spread of erroneous foresights in situations where information is missing. After correcting all seeds with alternative activation values, the updated foreground and background seed sets are output. This result will then directly enter the subsequent queuing, candidate prioritization, and alternating expansion processes.
[0039] refer to Figure 4 , Figure 4This diagram illustrates the parent-child dual-layer superpixel mesh and its hierarchical mapping relationship constructed in this embodiment of the invention. It details how multi-scale spatial constraints are used to balance local detail fitting and global structural consistency during pseudo-label generation. The diagram shows two mesh systems with different granularities: a bottom-layer fine-grained superpixel mesh and an upper-layer coarse-grained parent superpixel mesh. The polygons formed by the thin gray lines represent fine-grained superpixels, obtained by over-segmenting a color-normalized intraocular photograph. The size of the fine-grained superpixels is designed to be small to closely fit the irregular and fragmented edge details of the early white spots. Each fine-grained superpixel has a high degree of consistency in color and texture, serving as the smallest unit for the algorithm to determine its classification. However, relying solely on fine-grained units is susceptible to interference from local noise or highlights, leading to fragmented segmentation results. Therefore, this invention introduces the coarse-grained parent superpixel mesh, shown by the thick black lines in the diagram. The size of the parent superpixel is several times that of the child superpixel, covering a larger physical area and providing more stable texture statistics and spatial anchors. The diagram emphasizes the classification mapping relationship between the parent and child superpixels. For each fine-grained superpixel, the system calculates its overlap area with all intersecting coarse-grained parent superpixels, and designates the parent with the largest overlap area as its unique parent node, as shown by the dashed lines in the figure. This hierarchical structure is not only a data organization method but also the foundation for subsequent consistency decision-making algorithms. During region growth, the assignment decision of the fine-grained superpixel is verified in real time with the assignment status of its parent. The "consistency priority" mechanism marked in the figure means that when local evidence is ambiguous or conflicting, the algorithm tends to accept the global judgment of the parent, using the stability of the parent to correct the local bias of the child. This design effectively prevents "salt and pepper noise" type classification errors in areas with complex tooth surface textures, ensuring that the generated pseudo-labels remain morphologically continuous and complete. At the same time, the implicit adjacency relationship in the figure defines the search path, enabling the seed-based growth algorithm to strictly follow the topological structure of the grid and avoid erroneous jumps across non-adjacent regions. Through the collaborative work of this two-layer grid, this invention can still generate high-quality lesion pseudo-labels without a fully supervised signal.
[0040] In another implementation, the search intervals for the upper and lower percentile thresholds can be automatically narrowed or expanded based on the response contrast within the tooth surface region mask. For example, when the response span of the fused activation heatmap within the tooth surface region mask is small, expanding the search intervals to 80 to 98 and 2 to 20 can improve recall of weak signal white spots; when the response span is large, narrowing the intervals to 88 to 92 and 8 to 12 can reduce excessive foreground debris. The target number of fine-grained superpixels can be automatically adjusted according to the image resolution, using 1200 to 2000 for higher resolutions and 600 to 1000 for lower resolutions, to keep the physical area covered by each fine-grained superpixel close, thereby achieving consistent boundary fitting capabilities across different devices. The search for adjacent paths can be limited to not crossing continuous high-response bands in the edge response map. When the average value of the shared edges crossed by a candidate path in the edge response map is higher than the median within the tooth surface region mask, alternative routes are preferred to avoid crossing the true boundary of the enamel. This reduces the influence of cross-structural regions on the alternative activation values. If a specular reflection mask persists in a localized area and consistently covers the same location, a small decrease can be applied to the alternative activation value in that area to create a conservative foreground assessment and reduce the risk of repeated false positives. The target range for the number and area percentage of foreground candidate connected regions can be adjusted based on the statistical characteristics of the training set. When the average area of real early white spots is significantly greater than 0.1% or significantly less than 10%, the upper and lower bounds of the target range should be appropriately moved to maintain a stable number of seeds.
[0041] In one implementation, within the tooth surface mask, the foreground seed set is sorted from high to low according to the fusion activation heatmap, and the sorted foreground seed set is sequentially written into the foreground queue; the background seed set is sorted from low to high according to the fusion activation heatmap, and the sorted background seed set is sequentially written into the background queue. This queuing order allows the recursion to start from the foreground position with the strongest evidence and the most reliable background position, enabling a stable establishment of the growth direction and avoiding being led by noise in the early stages. Each fine-grained superpixel written into the queue is immediately marked as assigned, and its coarse-grained parent superpixel is recorded as the parent node of the same class, which is used for tracing the source of cross-layer consistency adjudication and conflict handling later. To prevent duplicate processing, a one-time trigger flag is also set on the fine-grained superpixel to indicate that the fine-grained superpixel has participated in the expansion as a trigger.
[0042] Establish expansion rounds, starting with round 1. In odd-numbered rounds, a fine-grained superpixel is dequeued from the foreground queue as the current foreground trigger; in even-numbered rounds, a fine-grained superpixel is dequeued from the background queue as the current background trigger. This strict alternating strategy creates a tug-of-war between the foreground and background, reducing the bias caused by rapid expansion on one side. If a queue is empty when it should be dequeued, another queue continuously dequeues elements until the empty queue is re-enqueued. This avoids stagnation while ensuring that alternating progress can resume when new evidence appears.
[0043] Centered on the current trigger, enumerate its adjacent fine-grained superpixels at the same layer, and filter out unassigned fine-grained superpixels to form a candidate set. Only processing adjacent superpixels at the same layer is because they share the real boundary, allowing for the minimal step size to follow the natural transition between enamel and lesions. For each unassigned fine-grained superpixel in the candidate set, record the shared edge with the current trigger for subsequent calculation of the correlation quantity of the edge response map; simultaneously, record the coarse-grained parent superpixel identifier for subsequent cross-layer consistency determination.
[0044] For each candidate, the following three-stage judgment is performed sequentially to form candidate priorities, sorted from high to low, and then attempted to assign them to: Fusion Activation Heatmap Advantage Judgment: The candidate's fusion activation heatmap value is compared with the average of the fusion activation heatmap values of all its already assigned adjacent fine-grained superpixels. Candidates with values higher than or equal to the average are retained in the high-priority group; candidates with values lower than the average are moved to the low-priority group. This ensures that expansion initially proceeds along the direction of rising evidence, guaranteeing that the leading edge closely adheres to the strongest response area of the actual lesion. Edge Obstruction Judgment for Shared Edges: For each candidate, the average edge response map value shared with the current trigger is calculated and compared with the median edge response map value within the mask of the tooth surface region. Candidates with an average shared edge value lower than the median are retained in the current priority group; candidates with an average shared edge value higher than or equal to the median are downgraded by one priority level. This judgment ensures that expansion proceeds as far as possible along the direction of low resistance, avoiding frequent crossings of strong boundaries, thereby reducing the risk of encroaching on healthy enamel or soft tissue. Specular Reflection Mask Penalty Judgment. Candidates within the specular reflection mask have their priority reduced to the lowest; however, if two or more adjacent non-reflective fine-grained superpixels of a candidate have already been assigned to the foreground, the downgrade is cancelled. The specular reflection mask represents a highlight area, and direct expansion is easily led to false highlights; only when multiple surrounding non-reflective locations have been identified as foregrounds is it considered more likely to be a continuous lesion, allowing further progress. After completing the three-stage judgment, a candidate priority order from high to low is obtained. If a candidate is superior in both the first and second judgments and is not affected by the downgrade in the third judgment, it has the highest priority; if it is downgraded in one judgment, it has a lower priority; those that do not meet all the criteria have the lowest priority and are processed at the end of this round or temporarily left unprocessed.
[0045] Candidates are processed sequentially from highest to lowest priority based on the sorting results. For foreground triggers, candidates are marked as foreground-assigned; for background triggers, candidates are marked as background-assigned. Upon successful marking, the candidate is immediately added to the tail of the queue corresponding to its assigned position, making it a new trigger in subsequent rounds and driving continuous expansion in this direction. Whenever assignment is given, the candidate's coarse-grained parent superpixel is simultaneously recorded as the parent node of the same class. If the assignment of the fine-grained superpixel is subsequently found to be inconsistent with the existing assignment of its coarse-grained parent superpixel, the assignment of the coarse-grained parent superpixel will be used as the final decision in the cross-layer consistency step and synchronized back to adjacent fine-grained superpixels. Pre-recording parent-child relationships allows for rapid consistency correction without introducing backtracking calculations. If a candidate is determined to be of the lowest priority in this round, and the average value of its shared edge response map is significantly higher than the median edge response map within the tooth surface mask, it is temporarily left unassigned, awaiting competition from triggers on the other side or changes in evidence in subsequent rounds. This retention strategy avoids premature decisions at sharp boundaries, reducing the probability of erroneous expansion.
[0046] After completing the candidate processing for a trigger, the round number is incremented by one, and the process switches to the dequeue process of another queue. If, in a round, no candidate for the current trigger meets the assignment criteria, the round ends directly and the next round begins. This avoids repeated attempts in areas with insufficient evidence, improving overall efficiency. Throughout the process, already assigned fine-grained superpixels will not re-enter the candidate set. If some fine-grained superpixels have only one-sided adjacency due to image edges or mask boundaries on tooth surfaces, assignment is prioritized on the adjacent side, and the absence of the other side does not affect overall connectivity. When both queues consistently generate new assignments for several rounds, it indicates that the leading edge is effectively advancing; when there are no new assignments or very few new assignments for several rounds, it indicates insufficient evidence, triggering subsequent stopping and adjustment processes. This stopping and adjustment is handled uniformly by predetermined termination conditions and boundary smoothing steps.
[0047] The staggered dequeueing approach creates a balance between the foreground and background, preventing foreground expansion from becoming detached from the background for extended periods and preventing the background from unilaterally absorbing weak foreground evidence, thus gradually approaching the true boundary at the border. Using the relative advantage of the fused activation heatmap as the first priority criterion ensures that expansion prioritizes the upward direction of evidence, improving recall of small lesions in leukoplakia and occult caries. Using the average edge response map value of shared edges as the second priority criterion is equivalent to only crossing "soft boundaries" at each step, minimizing crossing "hard boundaries," thereby reducing jumps across anatomical structures. Degradation and exception rules for specular reflection masking delay the processing of highlight areas when lacking corroboration, only including them when continuous non-reflective foreground evidence exists, effectively suppressing false foregrounds caused by highlights. The enqueueing order and immediate labeling strategy ensure repeatability and prevent dead loops: identical inputs will produce the same expansion trajectory, already assigned areas will not be processed repeatedly, and the queue will not expand due to repeated enqueueing.
[0048] In another implementation, the number of candidates assigned in each trigger's processing round can be limited, for example, processing a maximum of three highest-priority candidates, to enhance fine-grained control of the frontier. When lesion boundaries are fragmented and low in contrast, this limitation can prevent crossing multiple boundary steps at once. The dequeue ratio between the foreground and background queues can be slightly adaptive. When the fusion activation heatmap is generally high within the masked area of the tooth surface, the dequeue frequency of the background queue is increased to offset the foreground bias caused by the global lift; when the fusion activation heatmap is generally low, the dequeue frequency of the foreground queue is increased to avoid excessive background encroachment. A maximum waiting round can be set for low-priority candidates that have not been processed for a long time. Candidates that have not been assigned by either side after this waiting round will be forced into the conflict resolution process the next time they appear, with the assignment jointly determined by cross-layer consistency and adjacent majority rules, avoiding cavities caused by long-term suspension. Stable order rules can be used to break up candidates with the same sorting, such as processing them from long to short according to the length of the shared edge with the trigger, and then processing them from near to far according to the distance from the centroid of the fine-grained superpixel to the centroid of the trigger, to ensure consistent results between different runs.
[0049] Whenever an unassigned fine-grained superpixel is assigned a foreground or background affix, its recorded affixation to its coarse-grained parent superpixel is immediately read. If the parent has not yet been assigned an affixed, it is recorded as having the same affixation as the child, and the check ends. If the parent has been assigned an affixed but the affixation is inconsistent with the child's, a consistency decision is made. The recorded affixation of the coarse-grained parent superpixel is used as the final decision, and the affixation of the fine-grained superpixel is rewritten to be consistent with the parent. If the fine-grained superpixel has previously been written into a queue consistent with its original affixation, it is removed from that queue and written into a queue consistent with the parent, preventing further erroneous expansion from propagating outwards. The reason for prioritizing the parent is that coarse-grained parent superpixels cover a larger area, are less sensitive to noise and local reflections, and can provide more stable anchor points in areas with unclear boundaries or conflicting evidence.
[0050] Centered on the rewritten fine-grained superpixel, enumerate all adjacent unassigned fine-grained superpixels that share the same coarse-grained parent superpixel. Mark these unassigned fine-grained superpixels as "parent consistency priority" and immediately write them into the parent-consistent queue with higher candidate priority. For adjacent fine-grained superpixels that have been assigned the opposite affiliation to their parent but have not yet participated in the next round of triggering, revoke their current affiliation and rewrite them to be consistent with their parent. Simultaneously, update their positions in the corresponding queue, ensuring that subsequent expansion proceeds along the parent-consistent direction. The advantage of this approach is that the impact of parent consistency is quickly propagated to the local neighborhood of the same parent, reducing jagged fragmentation and back-and-forth flipping. For the shared edges between the above-mentioned synchronization object and the current fine-grained superpixel, read the average value of the edge response map. When this average value is significantly higher than the median value of the edge response map within the tooth surface mask, skip the synchronization rewriting of that object, retain only the "parent consistency priority" mark, and wait for it to be triggered later by the side with more sufficient evidence. This suppression prevents parental consistency from rigidly crossing where there are clear, strong boundaries, thus preserving the true enamel boundary.
[0051] If an unassigned fine-grained superpixel is simultaneously marked as a candidate by both the foreground and background queues in the same round or two adjacent rounds, and both sides meet the most basic assignment conditions, a conflict is identified, and conflict resolution begins. The shared edges between the candidate and the foreground trigger, and between the candidate and the background trigger, are taken respectively, and their average values on the edge response map are calculated. The side with the lower average value wins, and the candidate is assigned the same assignment as the winning side, while also being added to the corresponding queue. The side with the lower average value is chosen because its boundary is smoother and has less crossing resistance, indicating that both belong to the same anatomical or reflective structure of a continuous region, making it more suitable as a consistent direction of extension. When the average values of the edge response maps of the two shared edges are the same or their differences are insufficient to clearly distinguish them, the number of fine-grained superpixels already assigned to the foreground and background within first-order and second-order adjacencies of the candidate is counted; the side with the larger number wins, and its assignment is determined accordingly. Using adjacency majority can suppress occasional noise by leveraging the overall trend of local connectivity, making the resolution closer to the consistency of the local structure. After the conflict resolution is completed, if assigning a candidate would cause it to cross a continuous high-response band on the edge response map with an average value significantly higher than the median within the mask of the tooth surface region, its status will remain unchanged, remaining unassigned and processing will be delayed until more similar assigned adjacent nodes are obtained from the other side of the high-response band as support. This prevents premature decisions on obvious structural cross-sections and reduces cross-structural errors. After the conflict resolution is completed, if a candidate is assigned a title, it is immediately written to the corresponding queue, and its coarse-grained parent superpixel is recorded as the parent node of the same type of assigned candidate; if the candidate remains unassigned, a "conflict pending" flag is added to its description to prevent it from being repeatedly submitted by the same pair of triggerers in a short period of time, and it will enter the next resolution after the surrounding evidence changes.
[0052] A complete traversal refers to the foreground and background queues each completing their dequeue attempts from the head to the tail, during which candidate priority calculation, cross-layer consistency adjudication, and conflict adjudication are performed on all visible unassigned candidates. If no new assigned fine-grained superpixels are generated in either the foreground or background queues during a complete traversal, the expansion is considered converged, and the traversal stops. This decision avoids invalid loops and terminates the traversal promptly when the evidence is stable. After stopping the traversal, all fine-grained superpixels assigned to the foreground are collected, their union is subjected to connectivity checks, isolated tiny fragments are removed, internal holes are filled, and the output is a pseudo-label mask. The pseudo-label mask is intersected with the tooth surface region mask to obtain the effective pseudo-label mask for training. The connectivity checks and hole handling are performed to repair the scattered gaps formed during the front advancement into clinically interpretable continuous lesion areas, while ensuring that the mask is strictly confined within the tooth surface region mask.
[0053] Parent-priority and synchronization with adjacent fine-grained superpixels constrain fine-grained decisions to more stable coarse-grained parent superpixels, suppressing local flipping caused by specular reflection mask edges, weak textures, and random noise, thus maintaining a continuous and interpretable lesion morphology globally. Average edge response maps of shared edges are compared first, allowing expansion to propagate preferentially along low-resistivity interfaces, reducing misclassification caused by crossing strong edges. Adjacent majoritys give greater weight to connectivity trends when evidence is comparable, ensuring consistent boundary orientation even in complex textures. Using "no new assignments" as the stopping criterion avoids overgrowth, and combined with final connectivity and hole handling, a more compact and effective pseudo-label mask suitable for supervised segmentation network training is obtained.
[0054] In another implementation, the range of synchronization back to adjacent fine-grained superpixels can be extended from first-order adjacency to second-order adjacency, but this extension is only performed when there is no continuous high-response band between these objects and the current fine-grained superpixel to prevent crossing potential true boundaries. Adjacency majority statistics can be prioritized: if a clear majority has been given for first-order adjacency, second-order adjacency is not counted; second-order adjacency is only introduced when first-order adjacency is equal to reduce the impact of far-end noise on local decisions. A maximum number of waiting rounds is set for fine-grained superpixels marked as "conflict pending"; if a majority is not obtained after this number, it is handed over to the coarse-grained parent superpixel for consistency priority processing, and foreground assignment is only allowed when the average edge response map of the shared edge is lower than the median within the tooth surface region mask, achieving more conservative convergence. An additional micro-expansion can be performed before termination, only within the low edge response region, with a radius limited to one fine-grained superpixel width, to fill small gaps within the boundary; this micro-expansion is still constrained by parent priority and conflict resolution to avoid overshooting.
[0055] Step 3: The segmentation network is trained under joint supervision using pseudo-label masks and a small number of pixel-level labeled samples, employing partial cross-entropy loss, boundary intersection-union ratio loss, and consistency constraints. During the inference phase, only intraoral photographs are input. First, a mask for the tooth surface region is generated, and then a lesion mask and a list of lesion locations are output for the detection and segmentation of leukoplakia and occult caries.
[0056] During implementation, color-standardized intraoral photographs were used as input to the segmentation network. A tooth surface mask was used to crop and mask the input, setting all pixels outside the tooth surface to zero intensity to avoid interference from soft tissue and instruments. This approach focused the network's attention on the contrasting details between enamel and lesions. The effective pseudo-label mask and a small number of pixel-level labeled samples were unified to the same coordinate system. The effective pseudo-label mask, derived from step 2, has a large coverage area but contains local uncertainties; the pixel-level labeled samples have a smaller coverage area but more reliable boundaries. During training, pixels covered by the pixel-level labeled samples were prioritized. When the two overlapped, the pixel-level labeled samples were used as the standard, and the area outside the overlap was supplemented by the effective pseudo-label mask. This combination maintained scale while calibrating boundary errors. Pixels within the specular reflection mask were designated as invalid regions not involved in supervision. Specular reflection masks often correspond to highlights or metallic reflections; direct participation in supervision could misinterpret specular bright spots as lesions or healthy areas. Masking reduces bias. For the same color-standardized intraoral photograph, a pair of augmented versions are generated: one is a weak augmentation, maintaining the basic color and geometry unchanged; the other is a strong augmentation, introducing color perturbation, slight blurring, and minor geometric transformations. The two augmented tooth surface region masks, effective pseudo-label masks, and pixel-level labeled samples are synchronously transformed to ensure alignment between supervision and input, providing paired data for consistency constraints.
[0057] Loss is calculated only on supervised pixels, which include pixels covered by pixel-level labeled samples and pixels covered by effective pseudo-label masks but not within specular reflection masks. For each supervised pixel, its true classification is compared with the corresponding prediction of the segmentation network, and the classification error is calculated and accumulated. Uncovered pixels are not included in the calculation. This strategy can strengthen learning in low-noise areas and avoid misleading in uncertain areas. First, a one-pixel-wide boundary is extracted from the prediction mask of the segmentation network, and then the corresponding boundary is extracted from the reference mask. The reference mask uses pixel-level boundaries where pixel-level labeled samples are covered, and boundaries of the effective pseudo-label mask are used elsewhere. The intersection and union of the two boundaries are counted at the pixel level; the larger the intersection and the smaller the union, the better the boundary fit. To avoid the influence of strong noise, the edge response map is referenced within the tooth surface area mask, and boundary pixels with higher edge responses are counted first, while boundary pixels with lower edge responses are counted with less weight. This allows the learning focus to be placed on areas with clearer anatomical boundaries, improving contour fit. Weak and strong augmentation predictions from the same color-normalized intraoral photograph are aligned to the same resolution, and their pixel-by-pixel differences are compared within a mask on the tooth surface, encouraging consistent judgments in lesion and healthy areas. Pixels within a specular reflection mask are not compared. This constraint ensures stable output under exposure, color cast, and slight geometric changes, enhancing generalization ability. Early white spots and occult caries have a very small pixel proportion. To avoid excessive background bias, the sampling probability of lesion pixels can be increased in supervised pixels, or lesion pixels with larger prediction errors can be preferentially included in the loss calculation in each iteration, thereby improving the visibility of small targets. The partial cross-entropy loss, boundary intersection-union (BIU) loss, and consistency constraint are added as the total loss. Each of these components has its own function: partial cross-entropy loss handles intra-region discrimination, boundary BIU loss handles contour alignment, and consistency constraint handles stability and robustness. The sum of the total loss allows the network to consider both regions and boundaries, maintaining consistent judgments under different imaging conditions.
[0058] Each batch selects a mix of samples containing effective pseudo-label masks and samples containing pixel-level labeled samples as input, with a ratio of approximately 3:1. This allows the network to absorb a wide range of weakly supervised information most of the time, while continuously calibrating with high-quality annotations. In the early stages of training, the weight of consistency constraints is increased to help the network learn to remain stable under different augmentations. In the mid-stage, the weight of boundary intersection-union loss is increased to gradually sharpen the contours. In the later stages, the sampling frequency of pixel-level labeled samples is increased to further correct boundaries and details. This phased approach avoids the network prematurely fitting boundaries when noise is high and also allows for clear contours to be obtained in the later stages. As the network's capabilities improve, the effective pseudo-label masks of some samples can be refreshed in the middle or late stages of training: using the current segmentation network prediction and edge response map to screen for obviously erroneous small segments, deleting pseudo-foregrounds that conflict with the edges of the tooth surface mask, and retaining areas with good continuity. The number of refreshes should not be excessive to avoid introducing feedback bias. When the regional consistency and boundary consistency of the lesion mask no longer significantly improve in several consecutive validation set evaluations, training is stopped and the parameters are fixed.
[0059] Input only intraoral photographs and obtain color-normalized intraoral photographs following the same process as in step 1. Generate tooth surface region masks using the same method as during training, and set the intensity of pixels outside the tooth surface to zero. This ensures that the input distribution for training and inference is consistent. The segmentation network outputs a lesion probability map within the tooth surface region mask for the color-normalized intraoral photographs. Compare the lesion probability map with a threshold determined on the validation set during training to obtain a binarized lesion mask. The threshold is determined with robustness as the goal: to select a point that maintains high recall for small lesions under multiple devices and various exposure conditions while controlling the false positive rate. Perform small region culling and cavity filling on the lesion mask, and delete isolated noise points that obviously do not conform to the tooth surface geometry; perform slight smoothing in narrow bands with high edge response so that the boundary direction conforms to the enamel boundary without excessive outward expansion. Perform connected component analysis on the lesion mask, extract the outer contour by connected components, obtain the vertex sequence using iso-contour tracing, and then reduce redundant points and maintain the shape using a polygon approximation method with fixed tolerance. For each connected component, generate a sequence of polygon vertices, arranged clockwise, to form a list of lesion locations. To facilitate subsequent sorting and screening, three additional parameters can be recorded for each polygon: the area percentage of the lesion within the tooth surface mask, the average value of the lesion probability map within that region, and the lowest value of the lesion probability map within that region. The average value provides an overall picture, while the lowest value indicates the reliability of the weakest point within that region; combining these two parameters aids in clinical review. Output the lesion mask and the list of lesion locations. The list of lesion locations can be directly used for visualization overlay and subsequent statistical analysis, while the lesion mask can be used for further severity calculation and progression comparison.
[0060] refer to Figure 1 , Figure 1This diagram illustrates the process of lesion mask polygon approximation and lesion location list generation provided in this embodiment of the invention. The diagram details the transformation logic from the original lesion probability map output by the segmentation network to the final clinically readable structured data. The background on the left side of the diagram shows the continuous probability distribution field output by the segmentation network, where different shades of gray represent the varying confidence levels of the neural network in the presence of carious lesions at different locations within the tooth surface area. In the actual processing flow, the original output of the color-normalized intraoral photograph after inference by the segmentation network is first obtained, i.e., the lesion probability map. Since the neural network outputs floating-point values between 0 and 1, a truncation threshold needs to be set to convert it into a binary lesion mask. As shown by the dotted line in the diagram, this threshold is not arbitrarily selected but is the optimal operating point determined on the validation set by balancing recall and false positive rates, aiming to adapt to the response characteristics under different shooting devices and exposure conditions. When the probability value exceeds this threshold, the corresponding pixel is determined as a lesion region, forming a closed contour enclosed by the solid line in the diagram. After obtaining the initial binarized mask, the process does not end. The figure shows the geometric cleanup operation performed on the binarized region, including removing isolated noise points with too small an area and filling tiny pores inside the lesion. This step ensures that the lesion conforms to the physical continuity characteristics of enamel demineralization in terms of morphology. Next, the figure focuses on describing the polygon approximation process. Since the original pixel-level contour contains a large number of jagged redundant vertices, which is not conducive to subsequent storage and front-end rendering, this invention adopts a polygon fitting algorithm to resample the contour while keeping the shape deviation within the allowable tolerance range. The figure clearly marks key vertices such as P0 to P5. These vertices constitute the simplified polygon boundary, which not only preserves the overall geometric features of the lesion but also significantly reduces the data dimensionality. Finally, as shown in the figure below, this geometric information is encapsulated into a lesion location list. This list not only contains the coordinate sequence of the vertices but also associates multi-dimensional quantitative attributes, including the area ratio of the lesion within the tooth surface region, the average probability value within the region, and the minimum probability value. The average probability value reflects the model's overall confidence in the lesion, while the lowest probability value indicates the weakest point of judgment within the area, providing important reference for doctors to conduct manual review. This transformation from a probability field to a structured list allows the test results to be directly used for subsequent disease severity grading and longitudinal follow-up comparisons.
[0061] By employing a widely coverible pseudo-label mask and using pixel-level labeled samples to calibrate boundaries, the network achieves both scale and accuracy. This allows it to learn the overall tooth surface distribution with limited annotation costs while aligning clinical boundaries at key edges. Partial cross-entropy loss is calculated only on supervised pixels to prevent the network from being misled in areas with insufficient evidence; simultaneously, consistency constraints ensure stable output across the entire image, indirectly constraining unsupervised areas as well. Combining boundary intersection-union loss with edge response maps prioritizes learning in areas with clearer true boundaries, enabling the network to learn fine boundaries consistent with the enamel-lesion interface, rather than being led by random textures. During the inference phase, a tooth surface region mask is generated first, followed by lesion segmentation within it, significantly reducing false detections caused by soft tissue and instrument highlights; results are presented as a list of polygonal lesion locations, facilitating area quantification and case follow-up.
[0062] Within the effective pseudo-label mask, three confidence levels (high, medium, and low) are defined based on the response of the fused activation heatmap. High-confidence pixels consistently participate in partial cross-entropy loss, medium-confidence pixels are added in the latter half of training, and low-confidence pixels only participate in consistency constraints. This hierarchical approach reduces the impact of early noise. The calculation of the boundary intersection-union loss is restricted to a narrow band of 3 to 5 pixels on each side of the lesion boundary, highlighting contour learning while avoiding the influence of class imbalance within the region on boundary discrimination. After each iteration, image patches with large prediction errors are statistically analyzed, and their sampling probability is increased proportionally in the next iteration, continuously strengthening the network's ability to identify easily confused areas. During the inference phase, horizontal flipping and slight scaling are performed on intraoral photos of the same color standardization, resulting in multiple predictions. The pixel-wise maximum value is then used to generate the lesion mask. Maximum value aggregation better preserves the weak signal of small white spots, improving recall. A one-dimensional monotonic function calibration is performed on the lesion probability map and the final threshold using an independent validation set, ensuring that the same value has consistent meaning under different devices and lighting conditions. Calibration improves the sorting stability of the lesion location list, facilitating batch screening. In scenarios where the amount of data gradually increases, step 2 can be repeated periodically to generate new effective pseudo-label masks and calibrate them with a small number of new pixel-level labeled samples to maintain the performance of the segmentation network on new devices and new populations.
[0063] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for weakly supervised intraoral photographic detection and segmentation for early dental caries, characterized in that, The method includes: Step 1: Perform color normalization on the intraoral photograph to obtain a color normalized intraoral photograph, detect specular reflection to generate a specular reflection mask, segment the tooth surface to obtain a tooth surface region mask, train a weakly supervised discriminant network to output a fused activation heatmap, and extract edge response maps; Step 2: Within the tooth surface mask, determine the foreground and background seed sets based on the fused activation heatmap; construct a two-layer superpixel mesh and establish parent-child relationships; for seeds located within the specular reflection mask, replace their values with the median of the fused activation heatmap of the nearest non-reflective superpixel along the adjacent path; write the foreground and background seed sets into the foreground and background queues respectively; dequeue one from each queue in turn to determine the priority and assign a class to unassigned adjacent superpixels; when the fine-grained assignment is inconsistent with the coarse-grained parent assignment, the parent assignment is used as the final decision and the process is synchronized back to the adjacent fine-grained superpixels; when foreground and background compete simultaneously, first compare the average edge response map of the shared edge, and then confirm by the majority of adjacent pixels; traverse until neither queue has a new class, and output the pseudo-label mask; Step 3: The segmentation network is trained under joint supervision using pseudo-label masks and a small number of pixel-level labeled samples, employing partial cross-entropy loss, boundary intersection-union ratio loss, and consistency constraints. During the inference phase, only intraoral photographs are input. First, a mask for the tooth surface region is generated, and then a lesion mask and a list of lesion locations are output for the detection and segmentation of leukoplakia and occult caries. In step 1, within the mask of the tooth surface region, the gradient operator and non-maximum suppression are used to calculate the edge of the color-normalized intraoral photograph to obtain the edge response map; when training the weakly supervised discriminant network, the input is the color-normalized intraoral photograph and the image-level existence label, and the output is the target activation heatmap of two scales, which are fused into a fused activation heatmap by taking the larger value for each pixel. In step 2, two superpixel meshes, a fine-grained layer and a coarse-grained layer, are generated from the color-normalized intraoral photograph within the mask of the tooth surface region. The parent-child relationship between each fine-grained superpixel and its corresponding coarse-grained parent superpixel is established, and the adjacency relationship within the same layer is also established.
2. The method for weakly supervised intraoral photograph detection and segmentation for early dental caries as described in claim 1, characterized in that, In step 2, the upper percentile threshold and the lower percentile threshold are calculated on the fused activation heatmap. The upper percentile threshold is used to generate the foreground seed set, and the lower percentile threshold is used to generate the background seed set. Seeds falling into the specular reflection mask are temporarily marked as seeds to be corrected. For each fine-grained superpixel containing a seed to be corrected, the median of the fused activation heatmap values of the first three non-reflective fine-grained superpixels along the shortest adjacent path to the nearest non-reflective region is selected as the replacement activation value of the fine-grained superpixel. If there are fewer than three available non-reflective fine-grained superpixels, all available ones are used. If the value is still lower than the upper percentile threshold after replacement, the fine-grained superpixel is transferred to the background candidate set; otherwise, it is retained in the foreground candidate set.
3. The method for weakly supervised intraoral photograph detection and segmentation for early dental caries as described in claim 2, characterized in that, In step 2, the foreground seed set and the background seed set are written into the foreground queue and the background queue, respectively; the corresponding fine-grained superpixels are marked as belonging, and their coarse-grained parent superpixels are recorded as the parent nodes belonging to the same class.
4. The method for weakly supervised intraoral photograph detection and segmentation for early dental caries as described in claim 3, characterized in that, In step 2, for each assigned fine-grained superpixel and its unassigned adjacent fine-grained superpixels in the same layer, a candidate priority is calculated. The candidate priority is determined by three factors and compared in order: whether the fused activation heatmap value of the candidate fine-grained superpixel is higher than the average of the fused activation heatmap values of all its assigned adjacent fine-grained superpixels; whether the average value of the edge response map on the shared edge between the candidate fine-grained superpixel and the assigned adjacent fine-grained superpixel that made it a candidate is lower than the median of the edge response map within the mask of the tooth surface region; and whether the candidate fine-grained superpixel is located within a specular reflection mask. If it is located within a specular reflection mask, it is recorded as the lowest priority, unless two or more non-reflective adjacent fine-grained superpixels of the candidate have been assigned to the foreground. The above factors are evaluated one by one in order, with the one that satisfies the higher priority first taking precedence.
5. The method for weakly supervised intraoral photograph detection and segmentation for early dental caries as described in claim 4, characterized in that, In step 2, a fine-grained superpixel is dequeued from the foreground queue and the background queue in turn. The unassigned adjacent fine-grained superpixels are marked with the same assignment as the current queue according to the candidate priority from high to low. When the assignment of the fine-grained superpixel is inconsistent with the assignment recorded by its coarse-grained parent superpixel, the assignment of the coarse-grained parent superpixel is the final decision, and the decision is synchronized back to the adjacent fine-grained superpixels to ensure consistency between the two layers.
6. The method for weakly supervised intraoral photograph detection and segmentation for early dental caries as described in claim 5, characterized in that, In step 2, when the same candidate fine-grained superpixel is simultaneously contested by the foreground and background, the following rules are executed sequentially until an assignment is determined: compare the average edge response map value of the candidate fine-grained superpixel with the foreground queue triggerer and the average edge response map value of the candidate fine-grained superpixel with the background queue triggerer, and select the side with the lower average value as the assignment; if they are the same, compare whether the coarse-grained parent superpixel of each of the two triggerers is the same as the coarse-grained parent superpixel of the candidate fine-grained superpixel, and give priority to the same one; if they are still not distinguishable, the candidate fine-grained superpixel is temporarily stored as pending, and confirmed according to the adjacency majority principle after all its adjacent fine-grained superpixels in the same layer have completed their assignments; after the conflict resolution is completed, if it will result in crossing the high response band of the edge response map, the original assignment remains unchanged.
7. The method for weakly supervised intraoral photograph detection and segmentation for early dental caries as described in claim 6, characterized in that, In step 2, if no new assignments are added to the foreground queue and background queue after a complete traversal, or if the number of newly assigned fine-grained superpixels is less than 1% of the total number of assigned superpixels in two consecutive traversals, then the expansion is stopped. After stopping, hole filling, small isolated area removal and boundary smoothing are performed in the tooth surface area mask. When smoothing the boundary, the maximum displacement of each boundary point is limited to no more than 2 pixels. The final foreground is assigned to the union of fine-grained superpixels as a pseudo-label mask, which is then intersected with the tooth surface region mask to obtain an effective pseudo-label mask for training.
Citation Information
Patent Citations
Weak supervision semantic segmentation method based on attention mechanism image block metric learning
CN114359559A
Deep learning-based color image early caries diagnosis model
CN119153069A