Pattern classification method and system based on region labels

By optimizing the pattern classification method through multi-dimensional feature fusion and dynamic judgment mechanism, the problem of inaccurate pattern classification in the existing technology is solved, and accurate classification and hierarchical analysis of complex patterns are achieved.

CN120808044AInactive Publication Date: 2025-10-17NALAI
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202511204409.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2025-10-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies lack a dynamic judgment mechanism for the interaction between pixel-level changes and spatial attributes in pattern classification, which makes label division susceptible to grayscale fluctuations and region overlap, making it difficult to achieve accurate classification of complex patterns.

Method used

By defining local label thresholds based on pixel grayscale range, analyzing the difference regions within the pattern image, and combining grayscale reference benchmarks, regional label attribution indices, and boundary anomaly distribution characteristics, multi-dimensional feature fusion is performed to optimize label attribution and hierarchical node recognition, thereby achieving hierarchical partitioning analysis of highly detailed and complex patterns.

Benefits of technology

It improves the accuracy and adaptability of pattern classification, enhances the responsiveness to subtle differences and hierarchical relationships within the pattern structure, and adapts to hierarchical classification requirements in multiple scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808044A_ABST
    Figure CN120808044A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of pattern classification, in particular to a pattern classification method and system based on a regional label, and the method comprises the following steps: extracting a local label threshold based on a pixel gray range, analyzing the regional difference of a pattern image, screening a change optimal group as a reference, analyzing a gradient direction and amplitude mutation, and screening layered breakpoints. And integrating the regional features, and judging category attribution to obtain a discriminant quantity. According to the method, detailed pixel relation analysis and regional structure feature extraction are executed step by step, label affiliation accurate adjustment is achieved based on local statistics and spatial attribute association synchronization, boundary anomaly is judged through gradient and label change multiple parameters, layering is carried out, nodes are automatically positioned according to attribute mutation, and category affiliation is decided by multi-dimensional attribute interaction. Layered and partitioned analysis of high-detail and complex patterns is realized, hierarchical attribution requirements under multiple scenes are adapted, the region classification accuracy is enhanced, and the response capability to the internal differential and hierarchical relationship of the pattern structure is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of pattern classification, in particular to a pattern classification method and system based on region labels. BACKGROUND

[0002] The field of pattern classification involves the identification, analysis and classification of patterns in various images, symbols or visual information. This technical field covers multi-dimensional information processing based on pixels, textures, geometric shapes and structured features. Through analysis of the internal structure, external contour and spatial distribution of patterns, automatic determination and attribution of pattern properties and categories are achieved. Traditional pattern classification methods involve labeling different regions in an image, assigning each region a unique label value, and combining the spatial information of the region with its corresponding label features to classify the pattern using statistical features, connected component analysis or boundary detection.

[0003] Existing technologies in pattern classification applications mainly focus on single assignment of region labels and simple spatial analysis. When faced with complex pattern environments with dense structures and intricate boundaries, there is a lack of dynamic judgment mechanism for pixel-level changes and spatial attribute linkage. Label division is easily affected by gray level fluctuations and region overlap, resulting in ambiguous attribution judgment, making it difficult for hierarchical nodes and category mapping to reflect complex relationships. In practical applications, the results of region classification are often rough, the internal structure is lost, and it is difficult to complete multi-layer fine-grained attribution, which affects the adaptability of complex pattern analysis and multi-scene visual tasks. SUMMARY

[0004] The purpose of the present application is to solve the problems existing in the prior art and to provide a pattern classification method and system based on region labels.

[0005] To achieve the above purpose, the application adopts the following technical scheme: a pattern classification method based on region labels, comprising the following steps,

[0006] S1: Based on the pixel gray scale range, the local label threshold is determined, the difference regions in the pattern image are analyzed, the gray scale changes of adjacent pixels in the sampling window are compared, the difference between the maximum and minimum gray scales is judged, the data group with the optimal change amplitude is selected as the gray scale reference standard, and the label gray scale reference benchmark is obtained;

[0007] S2: Based on the label gray scale reference benchmark, the applicability thereof under the contour distribution pattern is judged, the proximity of each pixel to the surrounding pixel gray scale is analyzed, the pixel-to-pixel gray scale distance is calculated, the pixel attribution is judged, the label mapping is adjusted, and the region label attribution index is obtained;

[0008] S3: Based on the region label attribution index, the gray level gradient direction of the label boundary pixel and the neighborhood pixel is compared, the gradient direction and amplitude change characteristics are analyzed, the mutation trend is judged, the mutation point position is determined combined with the label change, and the boundary abnormal distribution characteristics are obtained;

[0009] S4: Based on the boundary abnormal distribution characteristics, the pixel gray level distribution trend is analyzed, the local contrast change is judged, the texture orientation change is compared, the attribute mutation region is screened, and the hierarchical boundary is marked through continuous characteristic change, and the hierarchical structure breakpoint set is obtained.

[0010] The application improves that the label gray reference benchmark includes gray distribution uniformity, region contrast definition, and sample representative characteristics, the region label attribution index includes label aggregation degree, label continuity, and region segmentation stability, the boundary abnormal distribution characteristics include abnormal boundary density, boundary turning node, and structure mutation characteristics, and the hierarchical structure breakpoint set includes hierarchical node sequence, breakpoint interval rule, and hierarchical distribution attribute.

[0011] The application improves that the label gray reference benchmark acquisition step is specifically:

[0012] S111: Based on the pixel gray level range, the adjacent pixel gray level change of each sampling window region in the pattern image is analyzed, the difference between the maximum and minimum gray levels in each window is compared, the regional gray level distribution fluctuation is judged, the gray level difference amplitude of all windows is screened, and the window gray level range amplitude set is obtained.

[0013] S112: Based on the window gray level range amplitude set, the pixel data group most representative of region distribution is screened, the uniformity and continuity of pixel gray level distribution are analyzed, the fluctuation characteristic score of each group is calculated, the data group with low score is screened, and the gray representative sample group is obtained.

[0014] S113: Based on the gray representative sample group, the gray level distribution and region contrast characteristics are judged, the overall gray level structure is analyzed, the uniformity degree of each part in the distribution is calculated, the gray level distribution interval is identified, and the label gray reference benchmark is obtained.

[0015] The application improves that the region label attribution index acquisition step is specifically:

[0016] S211: Based on the label gray reference benchmark, the gray level distribution of the pixel neighborhood is analyzed, whether the gray level difference between pixels meets the classification standard is judged, the attribution relationship of each group of pixels is compared, the pixel set belonging to the same region is screened, and the initial label mapping interval is obtained.

[0017] S212: Based on the initial label mapping interval, the continuity of each label block and the aggregation density are compared, the label distribution under different spatial scales is analyzed, the stability of regional segmentation is judged, the label aggregation structure under multi-scale is optimized, and the multi-scale label distribution structure is obtained.

[0018] S213: Based on the multi-scale label distribution structure, the region with label attribution conflict is judged, the label distribution trend, attribution difference and connection characteristics of each conflict region are analyzed, the label attribution coordination amplitude is calculated, the label attribution result is adjusted combined with the label continuity of each region, and the regional label attribution index is obtained.

[0019] The application improves that the acquisition step of the boundary abnormal distribution feature is specifically:

[0020] S311: Based on the regional label attribution index, the gray gradient direction between the pixels at the label boundary of the region and their adjacent pixels is analyzed, the gray change rate in the horizontal and vertical directions is calculated by comparing the gray differences in each direction, the pixels with consistent change trend in the boundary region are screened, and the gray gradient distribution trend sequence is obtained.

[0021] S312: Based on the gray gradient distribution trend sequence, the gradient amplitude change of each label boundary pixel and its adjacent pixel is compared, the distribution rule of the mutation pixel is judged, the label switching feature is analyzed combined with the label attribution change, and the mutation label change distribution is obtained.

[0022] S313: Based on the mutation label change distribution, the gradient amplitude difference between each pixel and the adjacent pixel is compared, the discrete distribution of the gradient amplitude is judged, the region with inconsistent amplitude is screened, and the boundary abnormal distribution feature is obtained.

[0023] The application improves that the acquisition step of the hierarchical structure breakpoint set is specifically:

[0024] S411: Based on the boundary abnormal distribution feature, the difference and contrast of the pixel gray in the local region are compared, the continuity and change of the gray distribution between adjacent pixels are judged, the gray distribution trend of the continuous section is calculated, and the gray contrast change section is obtained.

[0025] S412: Based on the gray contrast change section, the region with synchronous texture direction and gray change in each section is screened, the collaborative feature of the texture distribution and gray difference of the region is analyzed, the pixel section capable of reflecting the texture mutation is judged, and the texture gray mutation region is obtained.

[0026] S413: Based on the texture gray mutation region, the gray trend and texture change direction of the continuous section are compared, the structure feature transition between adjacent sections is analyzed, the hierarchical structure association of the mutation position is judged, the key turning point between sections is screened, and the hierarchical structure breakpoint set is obtained.

[0027] The application improves that the step further comprises:

[0028] S5: judging each hierarchical region based on the hierarchical structure breakpoint set, analyzing regional label attribution, comparing texture directions, screening local contrast features, evaluating gray balance state, and determining categories according to label distribution to obtain a category attribution discriminant;

[0029] The category attribution discriminant comprises attribution category definition, hierarchical mapping feature, and label correlation ratio.

[0030] The application improves that the category attribution discriminant is obtained by the following steps:

[0031] S511: analyzing each hierarchical region divided based on the hierarchical structure breakpoint set, comparing gray variation trends of main texture directions and secondary texture directions in the region, calculating variation amplitudes of the main texture directions and the secondary texture directions, judging direction consistency and variation features of the main texture directions, and obtaining hierarchical texture direction features;

[0032] S512: screening feature key regions based on the hierarchical texture direction features, optimizing gray contrast performance in the regions, analyzing gray distribution between adjacent pixels, judging contrast feature variations of local regions in different texture directions, and obtaining a contrast feature distribution overview;

[0033] S513: analyzing label distribution in each hierarchical region based on the contrast feature distribution overview, comparing corresponding relationships between labels and texture features, judging label aggregation state and distribution level, optimizing attribution category judgment criteria, and obtaining a category attribution discriminant.

[0034] A pattern classification system based on regional labels, comprising:

[0035] A gray reference generation module divides local label thresholds based on pixel gray range, analyzes difference regions in a pattern image, compares gray variations of adjacent pixels in each sampling window, judges differences between maximum and minimum grays, analyzes all windows through gray difference, screens data groups with optimal variation amplitudes as gray reference standards, and obtains a label gray reference benchmark;

[0036] A regional label assignment module judges applicability of the label gray reference benchmark in a contour distribution pattern, analyzes gray proximity degrees of each pixel and surrounding pixels, judges whether the pixels belong to the same regional label through calculation of gray distances between the pixels, compares label mapping in multiple scales, adjusts attribution of overlapping regional labels, and obtains a regional label attribution index.

[0037] The boundary detection module compares the gray gradient directions of pixels at the region label boundary and their adjacent pixels based on the region label attribution index, analyzes the change characteristics of the gradient directions and amplitudes between the pixels, determines which pixels present mutation trends, determines the mutation point positions in combination with the label change information, and obtains boundary abnormal distribution characteristics;

[0038] The hierarchical recognition module analyzes the pixel gray distribution trends, judges the change of local contrast, compares the change range of texture orientation, filters the pixel regions with attribute mutations, marks the mutation positions as hierarchical boundaries by comparing the feature changes of continuous sections, and obtains a hierarchical structure breakpoint set;

[0039] The category determination module judges each hierarchical region, analyzes the attribution of the region label, compares the texture direction change, filters the contrast features of local regions, simultaneously evaluates the gray balance state, performs category determination according to the label distribution relationship, and obtains a category attribution discriminant.

[0040] Compared with the prior art, the advantages and positive effects of the present application are that:

[0041] In the present application, by adopting multi-dimensional feature fusion, focusing on the dynamic change of gray distribution, label attribution optimization, boundary attribute linkage, hierarchical node recognition and category mapping key links, step-by-step execution of detailed pixel relationship analysis and region structure feature extraction, relying on local statistics and spatial attribute correlation synchronous implementation of label attribution accurate adjustment, boundary abnormalities are determined by multiple parameters of gradient and label change, hierarchical nodes are automatically positioned according to attribute mutations, and category attribution is determined by multi-dimensional attribute interaction, realizing hierarchical and partition analysis of high-detail and complex patterns, adapting to hierarchical attribution requirements in multiple scenes, enhancing region classification accuracy, and improving the response capability to internal differences and hierarchical relationships of pattern structures. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 The present application is a main step flowchart;

[0043] Figure 2 The present application is a label gray reference benchmark acquisition flowchart;

[0044] Figure 3 The present application is a region label attribution index acquisition flowchart;

[0045] Figure 4 The present application is a boundary abnormal distribution characteristic acquisition flowchart;

[0046] Figure 5 The present application is a hierarchical structure breakpoint set acquisition flowchart;

[0047] Figure 6Flow chart for obtaining the category attribution discriminant quantity in the application. DETAILED DESCRIPTION

[0048] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.

[0049] In the description of the present application, it should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only used to facilitate the description of the present application and simplify the description, and therefore cannot be understood as indicating or implying that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, in the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly and specifically limited.

[0050] EMBODIMENT

[0051] Please refer to Figure 1 The present application provides a technical solution: a pattern classification method based on regional labels, comprising the following steps:

[0052] S1: Based on the pixel gray difference, the local label threshold is determined, the difference area in the pattern image is analyzed, the gray change of adjacent pixels in each sampling window is compared, the difference between the maximum and minimum gray is judged, all windows are analyzed through the gray difference, the data group with the optimal change amplitude is screened, and the group of data is called as the gray reference standard to obtain the label gray reference standard;

[0053] S2: Based on the label gray reference standard, the applicability thereof under the contour line distribution pattern is judged, the gray proximity of each pixel to the surrounding pixels is analyzed, whether the pixels belong to the same regional label is judged through calculating the gray distance between the pixels, the label mapping under multiple scales is compared, the attribution of the overlapping regional label is adjusted, and the regional label attribution index is obtained;

[0054] S3: Based on the regional label attribution index, the gray gradient direction of the pixels at the boundary of the regional label and the adjacent pixels thereof is compared, the change characteristics of the gradient direction and amplitude between the pixels are analyzed, it is judged which pixels present a mutation trend, the mutation point position is determined in combination with the label change information, and the boundary abnormal distribution characteristics are obtained;

[0055] S4: Based on the boundary abnormal distribution characteristics, analyze the pixel gray distribution trend, judge the change of local contrast, compare the change range of texture direction, screen the attribute mutation of pixel area, mark the mutation position as the hierarchical structure breakpoint set by comparing the feature change of continuous section, and get the hierarchical structure breakpoint set;

[0056] S5: Based on the hierarchical structure breakpoint set, judge each hierarchical region, analyze the attribution of region label, compare the texture direction change, screen the contrast features of local region, and evaluate the gray balance state at the same time, adjust the attribution category between region features, and make category judgment according to the label distribution relationship, and get the category attribution discriminant.

[0057] The label gray reference benchmark includes gray distribution balance, region contrast clarity and sample representative feature. The region label attribution index includes label aggregation degree, label continuity and region segmentation stability. The boundary abnormal distribution characteristics include abnormal boundary density, boundary turning node and structure mutation characteristics. The hierarchical structure breakpoint set includes hierarchical node sequence, breakpoint interval rule and hierarchical distribution attribute. The category attribution discriminant includes attribution category clarity, hierarchical mapping feature and label correlation ratio.

[0058] In S1, the pixel gray range refers to the difference between the maximum and minimum values of all pixel gray values in the sampling window, which is an index for measuring the size of the gray distribution fluctuation in the region. The local label threshold refers to the grouping basis set according to the gray range in the sampling window, which is used to judge whether the pixel belongs to the same local region (or label), and reflects the sensitivity of region segmentation. The difference region refers to the local region with obvious gray distribution change in the whole image, which often contains structure, texture or boundary, and is the key object of pattern segmentation and classification. The gray change refers to the degree of change between adjacent pixels, which is used to describe the ups and downs and detail levels of local structure, and is the basis for determining the homogeneity or heterogeneity of the region. The data group with optimal change amplitude refers to the group of pixel data with the most stable or most representative change after gray range analysis in all sampling windows, which is often used as a reference for subsequent threshold or standard. The gray reference standard refers to the baseline gray parameter or boundary line determined according to the "data group with optimal change amplitude", which is used for subsequent region label discrimination, hierarchical or feature analysis.

[0059] In S2, the applicability of the contour distribution pattern refers to whether the local label threshold segmentation rule is effective on patterns with similar contour structure or hierarchical distribution (such as maps, engineering drawings), reflecting the adaptability of the method to complex structure patterns; the gray level proximity refers to the difference between the gray level of a pixel and its surrounding pixels, which is a key basis for determining whether the pixels belong to the same region; the gray level distance refers to the absolute difference between the gray levels of two pixels, which is used to measure the similarity between pixels and is often used as a basic parameter for clustering, classification, label assignment, etc.; the same region label refers to the same label or identifier assigned to a number of pixels after analysis, which belong to the same partition, the same level or the same type, facilitating subsequent statistics and classification; the label mapping under multiple scales refers to the label distribution relationship obtained under different spatial resolutions (window size, image scaling, etc.), reflecting the regional attribution of the same image under different observation scales; the overlapping region label refers to the attribution conflict or overlap of some regions under multiple scales and different segmentation schemes, which are assigned multiple labels and need further determination of the final attribution.

[0060] In S3, the boundary pixel refers to the pixel point at the junction of a region (label area) and another region, which is a key position for judging the fine degree and accuracy of region segmentation; the gray level gradient direction refers to the change direction of a pixel point in the gray level distribution (such as horizontal, vertical, diagonal, etc.), which is usually obtained through gradient operation (such as Sobel, Prewitt operator) and is used for boundary detection and structure analysis; the change feature refers to the analysis result of the gradient direction and amplitude change of the boundary pixel and its neighborhood pixels, which is used to find the rules of boundary or structure mutation; the mutation trend refers to the phenomenon of large and sudden change in gradient direction or amplitude in a certain region or pixel set, which is commonly seen in boundaries, faults, structure switching, etc.; the label change information refers to the change trajectory or distribution of the pixel points or pixel sequence in the label assignment, which is used to assist in judging the boundary, regional attribution or layering point; the mutation point position refers to the position point where the structure, texture or gray level change is the largest (most conspicuous), which is usually a region boundary, feature point or layering reference.

[0061] In S4, the change of local contrast refers to the change of light and dark difference between different pixels within a region, which reflects the fine degree, level sense or texture density of local structure; the change range refers to the overall fluctuation interval of a feature (such as texture direction, gray level balance, etc.) within a region, which is a parameter for describing the uniformity or complexity of regional features; the attribute mutation pixel region refers to a pixel set that appears rapid and large amplitude jump in parameter in the attribute analysis process (such as gray level, contrast, texture, etc.), which is usually a boundary or layering point; the layering boundary refers to the position point determined as the separation line of two different structures or levels based on the above attribute mutation, which is an important basis for pattern hierarchicalization.

[0062] In S5, judging each hierarchical region refers to respectively performing attribute judgment and attribution analysis on all divided hierarchical regions, further improving the detailed degree of classification; texture direction change refers to analyzing the dominant direction of texture lines and structures in the region, and comparing the change of the direction with space, which is used to identify structures and determine categories; contrast feature refers to the distribution characteristics of light and dark contrast in the region, and through this feature, the structural complexity and the level of detail can be determined; gray balance state refers to the balance degree of the overall gray distribution in the region, reflecting whether there is light and dark bias, uneven lighting or structure density; attribution category refers to finally determining a category label for each hierarchical region according to a series of characteristic parameters, which is used for pattern classification and structure induction; label distribution relationship refers to the distribution, proportion and hierarchical structure of all region labels in the entire image, which is used to assist category attribution and global pattern analysis.

[0063] Referring to Figure 2 , the acquisition step of the label gray reference benchmark is specifically:

[0064] S111: Based on the pixel gray difference, the gray difference of each window is calculated, and the gray difference of each window is calculated.

[0065] Set each sampling window to be 16x16 pixels in size, and slide the window region in row and column order on the entire image. Extract the gray value of all pixels in each window, and traverse each group of pixels. By sequentially finding the maximum gray value and the minimum gray value in the group, the maximum gray difference in the window is directly calculated. It is judged whether the difference is greater than the set gray difference amplitude benchmark. The gray difference amplitude benchmark can be set to 50. The window region below this value is determined to have smaller gray fluctuations, and is in a relatively flat region of the image. The window region above this value indicates that the gray fluctuation is significant, and contains structure boundaries or texture boundaries. The gray value difference of each pair of adjacent pixels in each window is calculated, and the number of pixel pairs with a gray difference greater than 20 is counted. If the number of pixel pairs is greater than 16 in the window, the window is recorded as a "high change area", otherwise it is marked as a "low change area". The gray difference of each window and the high change mark form a group of data, which is saved in the image gray difference amplitude set. For example, the maximum gray value in the 35th window is 195, the minimum is 62, the difference is 133, and the number of pixel pairs with a gray difference greater than 20 is 24. The window is marked as a high change area. The 76th window has a difference of 45 and 7 pairs of change pixels, so it is marked as a low change area. The results are recorded in sequence to form a window gray amplitude table, which provides data support for subsequent representative sample selection and label benchmark construction, forming a window gray difference amplitude set.

[0066] S112: Based on the window gray scale range amplitude set, the most representative pixel data group of the region distribution is screened, the balance and continuity of the pixel gray scale distribution are analyzed, and the formula is adopted:

[0067]

[0068] The fluctuation characteristic score of each group is calculated, the data group with low score is screened, and the gray representative sample group is obtained, wherein, R i represents the fluctuation characteristic score of the i-th sampling window, G ij represents the gray scale of the j-th pixel in the i-th sampling window, represents the average of the gray scale of all pixels in the i-th sampling window, E i represents the difference amplitude of the maximum and minimum pixel gray scale in the i-th sampling window,

[0069] G i,j-1 represents the gray scale of the j-1-th pixel in the i-th sampling window, and n represents the number of pixels contained in a single sampling window;

[0070] The fluctuation characteristic score refers to the data measurement that comprehensively reflects the stability and representativeness of the pixel gray scale distribution in the region by comparing the dispersion degree of all pixel gray scales, the maximum gray scale fluctuation and the continuity of adjacent pixel gray scales in each sampling window region. The lower the value is, the more balanced the gray scale distribution in the region is, the more gentle the fluctuation is, and the more it can be used as a representative region of the overall gray scale distribution.

[0071] The spatial distribution of pixel gray scale in each sampling window is analyzed, the total pixel gray scale data G ij in the i-th window is obtained, the corresponding average gray scale E i is calculated, the absolute value of the deviation of all pixel gray scales from the average gray scale is processed and summed to obtain the overall dispersion degree of the pixel gray scale in the window, the difference between the absolute values of all adjacent pixel gray scales is calculated to measure the gray scale jump degree, and the jump term is normalized and combined with the range term to form the denominator part. The fluctuation characteristic score R i of the i-th window is obtained by calculation through the formula.

[0072] For example, it is assumed that the i=3-th sampling window contains n=64 pixels, the gray scale data of which is concentrated in the interval of 110-160, and the statistical parameters are as follows:

[0073] the average value of the pixel gray scale is

[0074] the gray scale range amplitude E3=50; the gray scale dispersion sum is

[0075] The sum of the adjacent pixel gray scale differences is

[0076] The normalized jump term is

[0077] The overall score is calculated as follows:

[0078]

[0079] The denominator part: 8x50+5=405;

[0080] The numerator part: 720;

[0081] The score obtained is:

[0082] Continue to take the i=4 sampling window as an example, and assume that the average gray scale thereof is The gray scale range amplitude E4 is 70, the dispersion term is 860, the jump term is 480, and the normalization is 7.5, so the score is calculated as follows:

[0083]

[0084] The denominator: 8x70+7.50=567.5;

[0085] The numerator: 860;

[0086] The score is:

[0087] The scores R of all windows are i After sorting, the window with the lowest score is selected, and the pixel data constituting the region gray scale structure of the window is stable and changes smoothly, which is used as a gray scale representative sample group. The sample group has the characteristics of concentrated spatial gray scale distribution and strong transition continuity, and is suitable for being used as a label division basis in subsequent pattern classification. The formula combines the overall gray scale dispersion and the local jump condition to construct the coupling measurement relationship between the numerator and the denominator, effectively avoids the judgment deviation caused by relying on a single statistical indicator, and makes the score result reflect the balance of the internal texture and the stability of the boundary transition of the region, thereby enhancing the applicability and resolution of the representative sample screening.

[0088] S113: Based on the gray scale representative sample group, the gray scale distribution and the region contrast feature are judged, the overall gray scale structure is analyzed, the balance degree of each part in the distribution is calculated, the gray scale distribution interval is identified, and a label gray scale reference benchmark is obtained;

[0089] The window groups with a range of 100-160 and 15-30 pairs of pixels with different gray scales are selected as representative sample groups. The gray scale values of all pixels in the sample groups are read in sequence. The gray scales of pixels in each sample group are divided into several gray scale sections with a fixed interval. The frequency of pixels in each section is counted. Whether there is a trend of concentrated distribution of gray scales is determined. The fluctuation range of gray scale frequency in all sections of each sample group is further measured. If the fluctuation range is less than 20% of the set threshold, the sample is determined as a group with balanced distribution of gray scales. The average gray scale value of groups meeting the balanced distribution characteristics in all samples is extracted. The groups are sorted according to the average gray scale value. The median and mode are selected as the reference gray scale values of labels. The average range of the groups and the average fluctuation of the gray scale frequency are combined to form a set of gray scale reference standards required for label determination of images. For example, the frequency of the section with the most concentrated gray scale values in the representative samples is 12%, the average range is 125, the average gray scale value is 142, and the median gray scale value is 139. The final label gray scale reference benchmark is determined as the average gray scale value 142, the median value 139, the reference range 125, and the distribution balance level about 12%. The benchmark will be an important basis for subsequent regional label determination and classification.

[0090] Referring to Figure 3 The acquisition steps of the regional label attribution index are as follows:

[0091] S211: Based on the label gray scale reference benchmark, the gray scale distribution of the pixel neighborhood is analyzed. Whether the gray scale difference between pixels meets the classification standard is determined. The attribution relationship of each group of pixels is compared. The pixel set belonging to the same region is screened. The initial label mapping interval is obtained.

[0092] The pixel gray scale information of the whole image is read, each pixel position is traversed in turn, the gray scale value of the center pixel is extracted, and the neighborhood gray scale set centered on the pixel is called. The neighborhood can be set as a 3x3 region. A comparison group is constructed by extracting the gray scale values of the 8 pixels in the neighborhood, the gray scale difference between the center pixel and each neighborhood pixel is calculated, and it is judged whether the difference values are all within the interval of the label gray scale reference value ± 20. If the gray scale value of a pixel is 135 and the label gray scale reference value is 140, the pixel group composed of the pixels with gray scale values between 120 and 160 in the neighborhood will meet the classification standard. If there are at least 5 pixels in the neighborhood that meet the range, the center pixel is preliminarily determined to belong to the local label range. The number of neighborhood pixels that meet the condition is counted, and the pixels with a number of pixels that meet the condition exceeding the set threshold value of 6 are marked as "strong label attribution pixels", otherwise they are marked as "weak label attribution pixels". For each pixel, the above judgment and counting process is repeated to form a pixel attribution relationship table of the whole image. On this basis, the pixel set marked as "strong label attribution" is connected for each group, and the spatial continuity of the pixels is judged. If the horizontal, vertical or diagonal distance between two pixels is less than or equal to 1 pixel, they are defined as directly adjacent. The region block formed by the directly adjacent pixels is counted, and the pixel set with an area greater than 5 pixels is extracted as the candidate set of the same region label. For example, the pixel points numbered 24, 25 and 26 in the image have gray scale values of 138, 141 and 136 respectively, and the difference values from the label gray scale reference value 140 are 2, 1 and 4 respectively. They are directly adjacent to each other, and are classified into a group of marked regions. The number interval of the pixel set is used as the initial label mapping interval.

[0093] S212: Based on the initial label mapping interval, the continuity and aggregation density of each label block are compared, the label distribution under the difference spatial scale is analyzed, the stability of the region segmentation is judged, the label aggregation structure under multiple scales is optimized, and the multi-scale label distribution structure is obtained.

[0094] The farthest distance between all pixels in each group of label blocks is calculated by calculating the maximum difference in X and Y directions of all pixel coordinates, and the adjacency index is obtained by counting the number of direct adjacent relationships between all pixels in the interior divided by the theoretical maximum number of adjacent pairs. If a label block contains 12 pixels, the theoretical maximum number of adjacent pairs is 22, and the actual number of adjacent pairs is 20, then the adjacency of this region is 0.91. Further, the aggregation density evaluation threshold is set to 0.85. If the region adjacency is higher than this value, it is classified as a high aggregation block, otherwise it is classified as a low aggregation block. Next, all the label blocks described above are re-labeled at different spatial scales. By setting different sampling window sizes for gray resampling, three scales of 8x8, 16x16 and 32x32 are set, and three gray scale label maps are generated. The initial label mapping results are projected onto these three scale images, and the pixel label distribution state in the corresponding region is extracted. The label consistency rate of a region at different scales is calculated, and the stability judgment threshold is set to 70%. If the label consistency rate is higher than this threshold, the region segmentation structure is stable at multiple scales. If the consistency rate is lower than 50%, the region is determined to be scale sensitive. The label attribution in the scale sensitive region is re-executed according to the label gray reference benchmark, and the label blocks with similar gray distribution in the adjacent stable region are merged. The label regions are adjusted at multiple scales to obtain the multi-scale label distribution structure of the whole image.

[0095] S213: Based on the multi-scale label distribution structure, the region with label attribution conflict is judged, the label distribution trend, attribution difference and connection characteristics of each conflict region are analyzed, and the formula is used:

[0096]

[0097] The label attribution coordination amplitude IY is calculated, and the label attribution result is adjusted combined with the label continuity degree of each region to obtain the region label attribution index, wherein n IY represents the total number of attribution conflict regions, GY b represents the label distribution trend of the bth region at the current scale, LY b represents the label attribution difference of the bth region at the previous scale, TY b represents the label connection characteristics of the bth region, SY b represents the label continuity degree of the bth region, RY b represents the label aggregation density of the bth region.

[0098] The label attribution coordination range refers to, under different spatial scales, after comprehensively analyzing the label distribution trend, attribution difference, connection characteristic, continuity degree and aggregation density of a region where there is a label attribution conflict, a data quantization result reflecting the consistency and coordination degree of the attribution relationship of each label in the region, used for measuring the coordination of label division and the clarity of label attribution in the region under the conditions of multi-scale and multi-attribution. The smaller the value is, the more consistent the label attribution relationship in the region is, and the clearer the label boundary is. The larger the value is, the more obvious the label attribution conflict or attribution ambiguity in the region is, and the label allocation needs to be further optimized.

[0099] First, the label number change area of the same spatial position in the image under multiple scales is located, the label number sequence of each sub-region in the area under different scales is extracted, and the label number with the most occurrences is counted as the main trend parameter GY of the region b At the same time, the number of deviations between the label number under the current scale and the main trend number of its historical scale is counted to obtain the label attribution difference parameter LY b The connection characteristic TY of the label is calculated by calling the proportion of the connection number of the boundary pixels of each region to the total length of the boundary b The label continuity degree SY is further obtained by counting the proportion of the internal continuous chain length of the label to the total pixels of the label b The aggregation density RY is calculated according to the ratio of the number of pixels in the label to the number of pixels of the smallest circumscribed convex hull region b The above five indicators are normalized to the interval [0, 1] as input variables, and the following gives the actual parameters of three regions as an example, wherein the normalized participating parameters are:

[0100] The normalized parameters of region 1 are:

[0101] GY1=0.81, LY1=0.43, TY1=0.69, SY1=0.66, RY1=0.63;

[0102] The normalized parameters of region 2 are:

[0103] GY2=0.76, LY2=0.38, TY2=0.61, SY2=0.62, RY2=0.59;

[0104] The normalized parameters of region 3 are:

[0105] GY3=0.89, LY3=0.55, TY3=0.72, SY3=0.70, RY3=0.68;

[0106] The above parameters are substituted into the formula to calculate as follows:

[0107]

[0108] The three region attribution coordination amplitudes are averaged:

[0109]

[0110] The results show that the attribution coordination amplitude IY=0.2322 falls within the preset interval [0.2, 0.4], which belongs to a medium attribution conflict level, corresponding to a label attribution stability that is acceptable but has a certain degree of inter-scale shift. The adjustment mode of the attribution boundary needs to be further determined according to the label continuity and aggregation structure of the conflict region. The value indicates that there is a certain degree of attribution jump or structural fracture in some regions during the multi-scale label mapping process. By combining the coordination amplitude result with the label continuity degree of each region, the attribution ambiguity or frequent change region can be identified. The conflict regions are sequentially prioritized for label division, and the attribution adjustment operation is performed according to the order to derive the region label attribution index. The formula comprehensively calculates the relative deviation between the label main trend and the historical attribution difference, and simultaneously fuses the label structure connection characteristics, continuity, and aggregation features. The region label division maintains internal consistency while considering multi-scale stability, thereby realizing a label attribution adjustment strategy with more global rationality.

[0111] Please refer to Figure 4 The acquisition steps of the boundary abnormal distribution characteristics are as follows:

[0112] S311: Based on the region label attribution index, the gray level gradient direction between the pixels at the region label boundary and their adjacent pixels is analyzed. The gray level change rates in the horizontal and vertical directions are calculated by comparing the gray level differences in each direction. The pixels with consistent change trends in the boundary region are screened to obtain a gray level gradient distribution trend sequence.

[0113] Firstly, the obtained label partition boundary in the whole image is determined, the boundary pixel set is extracted by scanning the pixel value change in the label image, the gray value of each boundary pixel is extracted point by point and the gray values of the four adjacent pixels above, below, left and right of the pixel are extracted, the gray difference between the pixel and the pixel above and below is calculated respectively as the longitudinal gray change value, and the gray difference between the pixel and the pixel left and right is calculated as the transverse gray change value. The above process is repeated for each pixel point, and the transverse and longitudinal gray change results are recorded. It is judged whether the value exceeds the set gray difference reference value 20. If the gray difference is less than 10, it is defined as a slow change interval, and if the gray difference is greater than 30, it is defined as a sudden change interval. The gray difference in each direction is counted and the dominant direction is extracted from all boundary pixels. If the transverse gray difference is higher than the longitudinal difference by 15 or more, the pixel dominant direction is determined to be transverse. If the difference between the two is less than 5, the pixel is determined to be direction neutral. Further, the pixels with the same dominant direction of continuous pixels are combined to form a pixel group with consistent gradient direction. For example, there are 7 adjacent pixels with gray values of 144, 145, 150, 152, 154, 158 and 161 in a certain boundary segment. The transverse gray difference continuously rises, and it is determined that the segment is a consistent gray change region. The segment is recorded as "direction consistent segment". In this way, all boundary pixels are traversed in turn, and the direction consistent segments are classified and aggregated according to the dominant direction to form a sequence of image gray gradient change trend. Each element in the sequence represents a set of boundary pixels with consistent gray gradient direction and continuous change trend. The sequence is the source of input data for subsequent sudden point identification.

[0114] S312: Based on the gray gradient distribution trend sequence, the gradient amplitude change of each label boundary pixel and its adjacent pixel is compared, the distribution rule of the sudden pixel is judged, the label switching feature is analyzed combined with the label attribution change, and the sudden label change distribution is obtained.

[0115] The difference between the gray scale of each pixel in each sequence segment and the gray scale of the adjacent pixel is extracted, the absolute value of the gray scale change of the adjacent two points is recorded, the gray scale change amplitude sequence of each sequence is constructed, then the difference change value between the adjacent change amplitudes in the change sequence is calculated, the increase and decrease amplitudes of the adjacent change amplitudes are compared item by item, whether a mutation pixel appears is judged, and the mutation judgment standard is set as the increase of the gray scale amplitude in the continuous two changes, if the gray scale difference of the current pixel compared with the previous pixel is 18, and the gray scale difference of the previous pixel compared with the pixel before the previous pixel is 5, then the change increase is 13, which is lower than the mutation threshold 25, so it does not constitute a mutation, if it is found that there are two continuous gray scale changes of 4 and 35 in a segment, then the change increase is 31, which exceeds the threshold, and the point is marked as a mutation pixel, after locating all the mutation pixels in the image, the label value corresponding to the pixel is read, whether the label before and after the mutation changes is judged, if a pixel point belongs to the regions with label values of 2 and 4 in the previous and subsequent two pixel regions respectively, it is considered that the label changes, the label change trajectory of all the mutation pixels is counted, and the region with label switching frequency exceeding 3 times is marked as a label unstable boundary segment, if 6 of the 8 mutation pixels in a segment have label jump, the segment is classified as a label mutation segment, finally, all the label mutation segment information is integrated, the spatial distribution is coded, and the mutation label change distribution is formed.

[0116] S313: Based on the mutation label change distribution, the gradient amplitude difference between each pixel and the adjacent pixels is compared, and the formula is used:

[0117]

[0118] The discrete distribution of the gradient amplitude is judged, the region with inconsistent amplitudes is screened, and the boundary abnormal distribution feature BR is obtained, wherein RG z represents the gray scale gradient amplitude of the zth mutation pixel, RG j(z) represents the gray scale gradient amplitude of the adjacent pixel of the zth mutation pixel, n BR represents the number of mutation pixels in the boundary region.

[0119] The boundary abnormal distribution feature is a index used to describe the difference degree of the gray scale gradient mutation distribution between the boundary region pixels in the pattern segmentation and region label attribution analysis process, reflects the complexity and unevenness of the gray scale gradient change at the region boundary, and can measure the discreteness of the gray scale change amplitude between the boundary pixels and the adjacent pixels, so as to locate and depict the boundary region with complex structure and large gray scale fluctuation, and assist in identifying the region with structure fracture, heterogeneous boundary or abnormal boundary concentrated distribution in the pattern. The difference of the gray scale gradient amplitude is calculated and squared for each mutation pixel z and its corresponding adjacent pixel j(z) in the boundary region, and then all such pixel pairs are accumulated, which measures the overall amplitude and discreteness of the gray scale gradient mutation in the boundary neighborhood, and the larger the value is, the more dramatic and non-uniform the gray scale gradient change on the boundary is; The sum of the gray scale gradient amplitudes is calculated and accumulated for all mutation pixels and their adjacent pixels in the boundary region, reflecting the overall gray scale gradient scale in the boundary region. Add 1 as an adjustment term to prevent the denominator from being zero; by dividing the numerator (representing the gradient discreteness and mutation degree) by the denominator (representing the overall gradient level), the calculated BR value reflects the significance of the abnormal gray scale gradient distribution in the boundary region, and the larger the value is, the more prominent the gray scale change in the boundary region is, and the more complex the structure is, and the more likely the abnormal region attribution or layering phenomenon occurs;

[0120] Set n BR = 5, and collect the following five groups of mutation pixel data and perform normalization processing, and the gradient amplitudes are respectively:

[0121] The first group RG z = 140, RG j(z) = 120, and after normalization, they are 0.549 and 0.471, respectively;

[0122] The second group RG z = 130, RG j(z) = 160, and after normalization, they are 0.510 and 0.627, respectively;

[0123] The third group RG z = 125, RG j(z) = 100, and after normalization, they are 0.490 and 0.392, respectively;

[0124] The fourth group RG z = 110, RG j(z) = 115, and after normalization, they are 0.431 and 0.451, respectively;

[0125] The fifth group RG z = 150, RG j(z) = 140, and after normalization, they are 0.588 and 0.549, respectively,

[0126] Based on the above normalized data, the calculation formula is as follows:

[0127] Numerator:

[0128] (0.549-0.471) 2 +(0.510-0.627) 2 +(0.490-0.392) 2+ (0.431-0.451) 2

[0129] (0.588-0.549) 2

[0130] = 0.0061 + 0.0137 + 0.0096 + 0.0004 + 0.0015 = 0.0313

[0131] Denominator:

[0132] (0.549 + 0.471) + (0.510 + 0.627) + (0.490 + 0.392) + (0.431 + 0.451) +

[0133] (0.588 + 0.549) + 1

[0134] = 1.020 + 1.137 + 0.882 + 0.882 + 1.137 + 1 = 6.058

[0135] Result:

[0136]

[0137] The result shows that the boundary abnormal distribution feature BR = 0.0052 is obviously lower than the lower limit of the determination reference interval (set as 0.015-0.035), indicating that the difference distribution of the gray scale gradient amplitude between the mutant pixels and the adjacent pixels in the region is relatively concentrated, and does not present a significant mutation trend or a large dispersion phenomenon. This result directly reflects that the current boundary segment has high consistency in the level of gray scale gradient change, indicating that the region does not constitute a structural fault basis, and therefore will not be included in the key structure recognition set in the subsequent boundary clustering and breakpoint set extraction link, but will be reserved as a continuous texture or stable label transition region.

[0138] Please refer to Figure 5 , the acquisition steps of the hierarchical structure breakpoint set are as follows:

[0139] S411: Based on the boundary abnormal distribution feature, the difference and contrast of the pixel gray scale in the local region are compared, the continuity and change of the gray scale distribution between adjacent pixels are judged, the gray scale distribution trend of the continuous section is calculated, and the gray scale contrast change section is obtained.

[0140] ​​Firstly, the boundary candidate region in the image is determined, the image is locally divided relying on the gradient mutation region obtained in the previous stage, the whole image is segmented into multiple local block regions, each region can be set to 32*32 pixels, all regions in the image are traversed through the sliding window mode, the gray value of each pixel in each local region is extracted, the gray difference of each pixel in the region and its adjacent pixels in the four directions is compared, the number of pixel pairs whose difference value exceeds 15 is counted, if the number accounts for more than 40% in the total pixel pairs in the region, it is determined that the region has large gray difference, then the average gray of all pixels in the region is calculated, the center value and the maximum and minimum gray difference of the gray distribution are extracted, the contrast value is calculated, if the contrast value is above 60, it is classified as a region with high contrast, if the contrast is less than 30, it is classified as a low contrast region, the gray difference of adjacent pixels is judged whether it presents linear growth or contraction trend, for example, the gray values of five consecutive pixels from left to right are 95, 101, 106, 112 and 118, it is determined that it has a positive continuous growth trend, if there is a gray fluctuation mode such as 108, 92, 119, 91 and 115, it is determined that there is no obvious trend, the gray trend of each block region is marked, the trend direction, change amplitude and continuous length are recorded, the regions with the same trend type and change continuous length more than 8 pixels are marked as effective contrast trend segments, and the complete gray contrast change segment set is constructed after all the marked trend segments are collected.

[0141] S412: Based on the gray contrast change segment, the region with synchronized texture direction and gray change in each segment is screened, the collaborative features of texture distribution and gray difference of the region are analyzed, the pixel segment that can reflect the texture mutation is judged, and the texture gray mutation region is obtained;

[0142] Extract all pixel positions in each section, and sequentially extract the 3x3 neighborhood gray value, calculate the gray difference value of adjacent pixel pairs in the main direction (horizontal, vertical), and combine the difference value change of each pixel and the neighborhood pixel in the horizontal, vertical and diagonal direction to judge whether the local structure has gray synchronous change characteristics in a certain direction, for example, if the horizontal gray difference of the continuous 5 pixels is 6, 7, 8, 6, 9, and the vertical difference is 2, 3, 4, 3, 2, then the main texture direction is horizontal, and the direction is taken as the texture reference axis, and the gray change of the main direction pixels in the section is analyzed whether it is consistent with the change direction of the adjacent pixels, if the gray change of the adjacent two rows in the same direction presents similar difference value distribution, then it is judged as texture direction synchronous area, otherwise it is judged as different direction change area, the area with consistent change trend direction and texture dominant direction is marked as direction coordination section, and whether there is a position with gray sudden increase or sudden decrease in the coordination section is further detected, the mutation threshold is set to be more than 30, if a pixel gray value is 132, and the gray values on the left and right sides are 94 and 96, then the point is recorded as a mutation point, the number of mutation points in each section is counted, if it is more than 10% of the total number of pixels, then it is judged as a texture gray mutation section, the area with consistent gray fluctuation direction and main texture direction in the section is marked as a texture gray mutation area.

[0143] S413: Based on the texture gray mutation area, compare the gray trend of the continuous section with the texture change direction, analyze the structure feature transition between adjacent sections, judge the hierarchical structure correlation of the mutation position, screen the key turning points between sections, and obtain the hierarchical structure breakpoint set;

[0144] Read the gray change trajectory of all pixels in the continuous mutation section, encode it into a gray trend curve in the horizontal and vertical directions respectively, extract the texture direction information of the adjacent pixel group in the mutation section, and convert the change direction into an angle mark form, for example, set the horizontal direction as 0 degrees, the vertical direction as 90 degrees, and the diagonal direction as 45 degrees and 135 degrees in turn, sample and record the texture direction change value of the continuous area, generate distribution graphs of the gray trend change trend and the texture direction fluctuation trend in the continuous area respectively, judge whether the direction transition occurs synchronously between the two trends, if it is found that the gray trend suddenly changes from rising to falling, and the texture direction changes from 0 degrees to 135 degrees, then the position is recorded as a structure transition point, it is judged whether the point is at the junction between two texture gray mutation sections, if the point on both sides corresponds to different texture dominant directions and the gray trend changes, then the point is determined as a structure hierarchical transition point, further statistics of all continuous sections are carried out, and the pixel point set that appears similar structure change and meets the conditions of gray mutation and direction transition are screened out, and redundant nodes are removed, to obtain the hierarchical structure breakpoint set.

[0145] Please refer to Figure 6 The acquisition step of the category attribution discriminant is specifically as follows:

[0146] S511: Based on the hierarchical structure breakpoint set, analyze each hierarchical region divided, compare the gray level change trend of the main texture direction and the secondary texture direction in the region, calculate the change amplitude of each, judge the direction consistency and change characteristics of the main texture of the region, and obtain the hierarchical texture direction characteristics;

[0147] Call all the located hierarchical breakpoint position information, logically cut the whole image according to the breakpoints, generate multiple independent hierarchical regions, extract the gray value and spatial coordinates of all pixels in each region, extract the local gradient value according to the 8-neighborhood direction of each region and calculate the gray difference change amount of each direction, count and sort the cumulative change amount of each direction, mark the direction with the largest change amount as the main texture direction, and mark the direction with the second largest change amount as the secondary texture direction. For example, in a certain region, the horizontal gray difference cumulative value is 760, the vertical gray difference cumulative value is 580, and the remaining diagonal directions are all lower than 400. Therefore, the main texture direction of the region is horizontal, and the secondary texture direction is vertical. Then, the gray difference values in the main and secondary texture directions are sampled respectively, the gray level fluctuation amplitude in each small section is calculated, and if the amplitude is stable in the interval of 15 to 25, it is marked as a stable section, and if the amplitude in a single section is higher than 40 or lower than 5, it is marked as a mutation section. Then, by comparing the spatial distribution positions of the fluctuation sections in the main direction and the secondary direction, it is judged whether they exist in the form of overlapping or mutual interference. If the main texture direction fluctuation is mainly concentrated in the left region, and the secondary texture direction is concentrated in the right region, it is determined that the internal direction structure of the region is separated, otherwise it is a high direction consistency region. Finally, the main and secondary directions, change amplitude sections, and direction coincidence degrees of all hierarchical regions are encoded in the form of marks to constitute the hierarchical texture direction characteristics of the region.

[0148] S512: Based on the hierarchical texture direction characteristics, filter the characteristic key regions, optimize the gray level contrast performance in the region, analyze the gray level distribution between adjacent pixels, judge the contrast feature change of the local region in the difference texture direction, and obtain the contrast feature distribution overview;

[0149] The region with the maximum value of the main texture direction fluctuation amplitude greater than 30 is extracted from all the processed regions as an initial feature key region candidate. The gray value of all pixels in the region is normalized and stretched in the main direction, so that the gray contrast value is standardized to the range of 0-255. Then, the gray difference between each pixel and its adjacent pixel is compared in turn according to the 8-neighbor relationship. Whether each pair of gray difference exceeds the local contrast threshold is judged. The threshold is set to 20. If the gray difference continuously appears more than 3 groups of gray difference greater than the threshold in the neighborhood direction, the local contrast in the region is a strong contrast region, otherwise it is a weak contrast region. The pixel set with the same main texture direction in the strong contrast region is counted. Whether more than 40% of the pixels in the region satisfy the strong contrast and the same direction conditions at the same time is judged. If it is satisfied, the region is screened as a real feature key region. Then, the gray contrast in the difference direction perpendicular to the main texture direction in the region is analyzed. The difference direction gray difference curve is extracted and compared with the main direction gray curve. If there are multiple intersection points between the fluctuation amplitude curves in the two directions, and the gray difference at the intersection point exceeds 25, it is marked as a difference direction gray structure mutation point. All the mutation points are segmented and classified to generate a contrast feature block diagram. The contrast feature structures in each region are combined to obtain a region contrast feature distribution overview.

[0150] S513: Based on the contrast feature distribution overview, the label distribution in each hierarchical region is analyzed. The corresponding relationship between the label and the texture feature is compared. The label aggregation state and the distribution level are judged. The attribution category judgment standard is optimized to obtain a category attribution discriminant.

[0151] In each region contrast feature map, read the corresponding label image of each pixel belonging to the label number, statistics of the same label number of pixels in each region and its proportion of the total area, if the label number in the region is more than 60%, it is marked as the label dominant region, if there are two label numbers in the region, respectively more than 40%, it is marked as the label split region, then read the main texture direction type and the gray fluctuation amplitude characteristics in the region, compare the label distribution and texture structure one by one, if a label dominant area and the main texture direction and strong contrast section have spatial overlap, it is recorded as the label and texture corresponding area, if the label dominant area and the weak contrast section and the texture direction change section overlap, it is recorded as the label non-structure matching area, then statistics of the label number in all label dominant areas, if the proportion is more than 70%, it is marked as the label structure correlation strong area, otherwise it is the structure correlation weak area, combined with the relationship between the number of region texture direction characteristics and the number of label numbers, the label aggregation state of the region is judged, if there are no more than 2 label numbers in a region, and there are 2 main texture directions, it is determined as clear aggregation, if there are more than 3 label numbers but only one texture direction, it is marked as redundant label distribution area, the label attribution of all regions, texture structure characteristics, label and texture matching proportion are used as the basis for judgment, and the category attribution judgment quantity is coded.

[0152] A pattern classification system based on regional labels, the system comprising:

[0153] The gray reference generation module determines the local label threshold based on the pixel gray difference, analyzes the difference area in the pattern image, compares the gray change of adjacent pixels in each sampling window, judges the difference between the maximum and minimum gray, analyzes all windows through the gray difference, selects the data group with the optimal change amplitude as the gray reference standard, and obtains the label gray reference benchmark;

[0154] The regional label assignment module judges the applicability of the label gray reference benchmark under the contour distribution pattern, analyzes the gray proximity of each pixel and its surrounding pixels, judges whether the pixels belong to the same regional label by calculating the gray distance between the pixels, compares the label mapping under multiple scales, adjusts the attribution of the overlapping regional labels, and obtains the regional label attribution index;

[0155] The boundary detection module compares the gray gradient direction of the pixels at the boundary of the regional label and their adjacent pixels based on the regional label attribution index, analyzes the change characteristics of the gradient direction and amplitude between the pixels, judges which pixels show a mutation trend, determines the mutation point position combined with the label change information, and obtains the boundary abnormal distribution characteristics;

[0156] The hierarchical identification module analyzes pixel gray distribution trend based on boundary abnormal distribution characteristics, judges local contrast change, compares texture orientation change range, filters pixel area with attribute mutation, marks mutation position as hierarchical boundary by comparing feature change of continuous section, and obtains hierarchical structure breakpoint set;

[0157] The category determination module judges each hierarchical region based on the hierarchical structure breakpoint set, analyzes region label attribution, compares texture direction change, filters local region contrast feature, simultaneously evaluates gray balance state, performs category determination according to label distribution relationship, and obtains category attribution discriminant.

[0158] The above is only a preferred embodiment of the present application, and does not limit the present application in other forms. Any person skilled in the art can use the disclosed technical content to make changes or modifications into equivalent embodiments applied to other fields, but any simple modification, equivalent change and modification made to the above embodiments without departing from the technical solution content of the present application, according to the technical essence of the present application, still belongs to the protection scope of the technical solution of the present application.

Claims

1. A pattern classification method based on region labels, characterized in that: The following steps are involved: S1: Based on the pixel grayscale extremes, the local label threshold is defined, the difference area in the pattern image is analyzed, the grayscale changes of adjacent pixels in the sampling window are compared, the difference between the maximum and minimum grayscales is determined, and the data group with the best change amplitude is selected as the grayscale reference standard to obtain the label grayscale reference benchmark; S2: Based on the label grayscale reference benchmark, determine its applicability under the contour distribution pattern, analyze the grayscale proximity of each pixel to the surrounding pixels, calculate the grayscale distance between pixels, determine the pixel ownership, adjust the label mapping, and obtain the regional label ownership index; S3: Based on the regional label attribution index, the grayscale gradient direction of the label boundary pixel and the neighboring pixel is compared, the gradient direction and amplitude change characteristics are analyzed, the mutation trend is judged, and the mutation point position is determined in combination with the label change to obtain the boundary abnormal distribution characteristics; S4: Based on the abnormal distribution characteristics of the boundaries, analyze the pixel grayscale distribution trend, determine the local contrast change, compare the texture orientation change, screen the attribute mutation area, mark the layer boundary through continuous feature changes, and obtain the layered structure breakpoint set.

2. The pattern classification method based on region labels according to claim 1, characterized in that: The label grayscale reference benchmark includes grayscale distribution balance, regional contrast clarity, and sample representative characteristics. The regional label attribution indicators include label aggregation degree, label continuity, and regional segmentation stability. The boundary anomaly distribution characteristics include abnormal boundary density, boundary turning nodes, and structural mutation characteristics. The hierarchical structure breakpoint set includes hierarchical node sequence, breakpoint interval law, and hierarchical distribution attributes.

3. The pattern classification method based on region labels according to claim 1, characterized in that: The steps for obtaining the label grayscale reference benchmark are specifically as follows: S111: Based on the pixel grayscale range, analyze the grayscale changes of adjacent pixels in each sampling window area in the pattern image, compare the difference between the maximum and minimum grayscale in each window, determine the grayscale distribution fluctuations in each area, and screen the grayscale difference amplitudes of all windows to obtain the window grayscale range amplitude set; S112: Based on the window grayscale range amplitude set, the pixel data group with the most representative regional distribution is screened, the balance and continuity of the pixel grayscale distribution are analyzed, the fluctuation characteristic score of each group is calculated, and the data group with low score is screened to obtain the grayscale representative sample group; S113: Based on the representative grayscale sample group, determine the grayscale distribution and regional contrast characteristics, analyze the overall grayscale structure, calculate the balance degree of each part in the distribution, identify the grayscale distribution range, and obtain the label grayscale reference benchmark.

4. The pattern classification method based on region labels according to claim 1, characterized in that: The steps for obtaining the regional label attribution indicator are specifically as follows: S211: Based on the label grayscale reference benchmark, analyze the grayscale distribution of the pixel neighborhood, determine whether the grayscale difference between pixels meets the classification standard, compare the belonging relationship of each group of pixels, filter the pixel sets belonging to the same area, and obtain the initial label mapping interval; S212: Based on the initial label mapping interval, compare the continuity and aggregation density of each label block, analyze the label distribution at different spatial scales, determine the stability of regional segmentation, optimize the label aggregation structure at multiple scales, and obtain a multi-scale label distribution structure; S213: Based on the multi-scale label distribution structure, determine the areas where label attribution conflicts exist, analyze the label distribution trends, attribution differences, and connectivity characteristics of each conflicting area, calculate the label attribution coordination range, and adjust the label attribution results based on the coordination range and the label continuity of each area to obtain the regional label attribution index.

5. The pattern classification method based on region labels according to claim 1, characterized in that: The steps for obtaining the abnormal distribution characteristics of the boundary are specifically as follows: S311: Based on the region label attribution indicator, analyze the grayscale gradient direction between the pixel at the region label boundary and its adjacent pixels, calculate the horizontal and vertical grayscale change rates by comparing the grayscale differences in each direction, and select pixels with consistent change trends in the boundary region to obtain a grayscale gradient distribution trend sequence; S312: Based on the grayscale gradient distribution trend sequence, compare the gradient amplitude changes of each label boundary pixel and its adjacent pixels to determine the distribution pattern of the sudden change pixels. Combined with the label attribution changes, analyze the label switching characteristics to obtain the sudden change distribution of the label. S313: Based on the mutation label change distribution, compare the gradient amplitude difference between each pixel and the neighboring pixels, determine the discrete distribution of the gradient amplitude, filter areas with inconsistent amplitudes, and obtain boundary abnormality distribution characteristics.

6. The pattern classification method based on region labels according to claim 1, characterized in that: The steps for obtaining the hierarchical structure breakpoint set are specifically as follows: S411: Based on the abnormal distribution characteristics of the boundary, compare the difference and contrast of the pixel grayscale in the local area, determine the continuity and change of the grayscale distribution between adjacent pixels, calculate the grayscale distribution trend of the continuous segment, and obtain the grayscale contrast change segment; S412: Based on the grayscale contrast change segments, screen the regions in each segment where the texture direction and grayscale change are synchronized, analyze the synergistic features of the texture distribution and grayscale difference in the region, determine the pixel segments that can reflect the texture mutation, and obtain the texture grayscale mutation region; S413: Based on the texture grayscale mutation area, compare the grayscale trend of continuous segments with the texture change direction, analyze the structural feature transitions between adjacent segments, determine the hierarchical structure association of the mutation position, screen the key turning points between segments, and obtain a hierarchical structure breakpoint set.

7. The pattern classification method based on region labels according to claim 1, characterized in that: The steps also include: S5: Based on the hierarchical structure breakpoint set, each hierarchical region is judged, regional label attribution is analyzed, texture directions are compared, local contrast features are screened, grayscale balance state is evaluated, and category is determined according to label distribution to obtain category attribution discrimination value; The category attribution discrimination metrics include attribution category clarity, hierarchical mapping features, and label association ratio.

8. The pattern classification method based on region labels according to claim 7, characterized in that: The steps for obtaining the category attribution discrimination amount are specifically as follows: S511: Based on the hierarchical structure breakpoint set, each divided hierarchical region is analyzed, the grayscale change trends of the main texture direction and the secondary texture direction in the region are compared, the respective change amplitudes are calculated, the directional consistency and change characteristics of the main texture of the region are determined, and the hierarchical texture directional characteristics are obtained; S512: Based on the hierarchical texture direction characteristics, key feature areas are screened, grayscale contrast performance within the area is optimized, grayscale distribution between adjacent pixels is analyzed, and contrast feature changes in the local area in the direction of the different textures are determined to obtain a contrast feature distribution overview; S513: Based on the comparison feature distribution overview, analyze the label distribution within each layered area, compare the correspondence between the label and the texture feature, determine the label aggregation state and distribution level, optimize the category determination standard, and obtain the category determination value.

9. A pattern classification system based on region labels, characterized in that: The system is used to implement the pattern classification method based on region labels according to any one of claims 1 to 8, and the system includes: The grayscale reference generation module defines the local label threshold based on the pixel grayscale extremes, analyzes the difference area in the pattern image, compares the grayscale changes of adjacent pixels in each sampling window, determines the difference between the maximum and minimum grayscales, analyzes all windows through grayscale differences, and selects the data group with the optimal change amplitude as the grayscale reference standard to obtain the label grayscale reference benchmark; The regional label assignment module determines the applicability of the label under the contour distribution pattern based on the label grayscale reference benchmark, analyzes the grayscale proximity of each pixel to the surrounding pixels, determines whether the pixels belong to the same regional label by calculating the grayscale distance between pixels, compares the label mapping under multiple scales, adjusts the attribution of overlapping regional labels, and obtains the regional label attribution index; The boundary detection module compares the grayscale gradient directions of pixels at the boundary of the regional label and its adjacent pixels based on the regional label attribution index, analyzes the change characteristics of the gradient direction and amplitude between pixels, determines which pixels show a mutation trend, and combines the label change information to determine the location of the mutation point to obtain the boundary anomaly distribution characteristics; The layered recognition module analyzes the pixel grayscale distribution trend based on the abnormal distribution characteristics of the boundary, determines the change of local contrast, compares the range of change of texture orientation, and screens pixel areas with sudden attribute changes. By comparing the feature changes of continuous segments, the sudden change position is marked as the layer boundary, and a set of layered structure breakpoints is obtained; The category determination module judges each hierarchical area based on the hierarchical structure breakpoint set, analyzes the attribution of regional labels, compares texture direction changes, screens the contrast characteristics of local areas, and evaluates the grayscale balance state. It makes category determination according to the label distribution relationship and obtains the category attribution discrimination value.

Citation Information

Cited By

  • Deep learning-based pathological section intelligent analysis method and system

    CN121170793A

  • Road disease identification method based on AI and multi-scale fusion

    CN121305505A

  • A road disease identification method based on AI and multi-scale fusion

    CN121305505B