A tea leaf sample photograph color card manufacturing method based on two-step clustering of DBSCAN and K-means
Patent Information
- Application Number
- CN202610978349.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-02
- Publication Date
- 2026-10-13
AI Technical Summary
同时,能够从人眼感知角度确保最终筛选出的色彩样本具有明确的区分度,避免视觉上难以辨别的冗余样本,以解决现有的技术缺陷和不能达到的技术要求
1、本申请通过结合对龙井茶高分辨率成像视觉分析仪所采集色块数据的DBSCAN与K-means算法聚类与利用CIELAB色彩空间中L*、a*、b*值对的计算筛选,可有效提升对于龙井茶色卡研制的标准性、客观性,减少传统茶叶色卡制作技术使用中对个人主观经验的依赖,从而有助于建立一套客观、精准、可量化的茶叶色彩标准体系。
Smart Images

Figure CN122906426A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tea, specifically to a method for creating color cards of tea samples based on two-step clustering using DBSCAN and K-means. Background Technology
[0002] As a traditional Chinese beverage, tea's quality evaluation system encompasses multiple dimensions, including appearance, liquor color, aroma, taste, and infused leaf color. Among these, the color of the dry tea leaves, the liquor color, and the infused leaf color are crucial visual indicators in sensory evaluation. These visual indicators not only directly influence consumers' purchasing decisions but also serve as key bases for tea quality grading and price assessment. In the tea production and trade process, establishing an objective, precise, and quantifiable tea color standard system is particularly important to ensure the stability and consistency of product quality. Currently, tea color standards primarily rely on manual sensory evaluation, judged by professional tea tasters through visual comparison. This method is heavily influenced by personal experience, lighting conditions, and visual fatigue, making it highly subjective and difficult to standardize, thus failing to meet the digital and precise development needs of the modern tea industry.
[0003] To address the need for objective evaluation of tea color, researchers have conducted various explorations. Chen et al. (2008) proposed a computer vision-based method for tea color recognition, achieving preliminary classification of five green tea varieties through RGB and HSI color space conversion and color feature variable extraction (Identification of tea varieties using computer vision [J]. American Society Agricultural & Biological Engineers, 2008). Ning et al. (2017) used hyperspectral imaging technology to obtain the spectral characteristics of tea leaves, combined with classification pattern recognition methods, to establish a tea classification model with a classification accuracy of 98.39% (Hyperspectral imaging for determination of tea quality: A review [J]. International Journal of Food Properties, 2017). Zou (2020) used the CIELAB color space to evaluate the color of tea liquor, measuring L... * a * b *This study established an MPL prediction model and a color index system for Sichuan dark tea liquor, providing a new approach for the quantitative evaluation of tea liquor color (Application of CIELAB color space in tea liquor color evaluation[J]. Journal of Food Process Engineering, 2020). However, existing research mainly focuses on tea classification and grade identification, and there is a lack of systematic research reports on how to systematically construct a standard color card covering tea, especially how to scientifically select representative color samples.
[0004] In terms of color chart production technology, traditional color chart design mainly relies on uniform sampling or manual experience-based selection, making it difficult to ensure that the color chart comprehensively covers mainstream color areas and unique color samples. This limitation results in significant deficiencies in the current color charts' ability to represent the diversity of tea colors, necessitating the exploration of more scientific color sample selection strategies.
[0005] Therefore, it is essential to propose a new method for creating color cards of tea samples based on two-step clustering using DBSCAN and K-means. Summary of the Invention
[0006] The purpose of this invention is to provide a method for creating color cards of tea samples based on a two-step clustering approach using DBSCAN and K-means, so as to achieve a complete and accurate characterization of the color space of tea. Simultaneously, it ensures that the final selected color samples have clear distinguishability from the perspective of human visual perception, avoiding visually indistinguishable redundant samples, thereby addressing the shortcomings and unmet technical requirements of existing technologies.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for creating a tea sample color card based on two-step clustering using DBSCAN and K-means, characterized by comprising the following steps: 1) Obtaining the dataset of color attributes of dry tea, tea soup, and tea leaves; 1.1) Use samples to prepare tea infusion and tea leaves; 1.2) Use a high-resolution imaging visual analyzer to acquire images of dry tea, tea liquor, tea leaves, and color calibration cards; 1.3) Use a high-resolution imaging visual analyzer to analyze the images acquired in 1.2) to perform color correction, background subtraction and color information analysis, and obtain the color attribute dataset of each sample of dry tea, tea soup and tea leaves; 2) The DBSCAN density clustering algorithm is used to screen for unique color samples in the tea color attribute dataset; 3. The K-means clustering algorithm was used to select the color samples of the category center in the tea color attribute dataset; 3.1) Based on the unique color samples determined in step 2), the K-means clustering algorithm is used to classify the remaining sample color data and determine the class center samples of each class. 3.2) Using the CIELAB color space L * a * b * The color difference between each pair of the above category center samples is calculated, the color difference is evaluated, and the number of categories is adjusted until the color difference between all category center samples meets the color difference threshold, thus obtaining the category center color sample. IV. Evaluate the color differences in the color difference data; 4.1) Summarize the special color samples in step 2) and the category center color samples in step 3.2), and use the L* (brightness-lightness variation), a* (red-green axis-red-green variation), and b* (yellow-blue axis-yellow-blue variation) values in the CIELAB color space to calculate the color difference between each pair of the above samples; 4.2) Based on the color difference calculation results in 4.1), characteristic color samples are selected from the samples obtained in 4.1).
[0008] In this application, "pairwise" refers to the color difference between all samples. For example, if there are three samples A, B, and C, then it is necessary to calculate the color difference between A and B, the color difference between A and B, and the color difference between C and B.
[0009] Preferably, in step 1.1), the preparation method of the sample tea soup and tea leaves refers to the "Sensory Evaluation Method of Tea" (GB / T 23776), and the photos are taken immediately after preparation to prevent discoloration; Before photographing, lay the dry tea leaves flat on a white background to ensure no background color is visible; use a filter to remove impurities from the tea soup; wipe the tea leaves dry with a paper towel and then lay them flat on the white background to reduce water stains and reflections.
[0010] Preferably, in step 1.3), the color attribute dataset includes three image color components (average L in CIELAB space). * a * b * (For color difference calculation only) and the area ratio of each color block (assuming the total number of color blocks is ). Then each sample contains (Area percentage data), using only the area percentage data of each color patch for DBSCAN density clustering and K-means clustering, i.e., color patch dataset. Each sample point in for Dimensional vector:
[0011] in, For the first In the nth sample The area percentage of each non-white back panel color block ( ,and The remaining area is a white background but was not included in the data.
[0012] Preferably, in step two), the specific method for screening specific color samples using the DBSCAN density clustering algorithm is as follows: DBSCAN algorithm clustering is performed using the color patch area ratio information, and a core point threshold for the DBSCAN algorithm is set. Dynamically adjust the neighborhood radius (i.e., EPS), until the number of outliers accounts for approximately 5% to 15% of the total sample size, and the resulting outliers are considered as unique color samples; the DBSCAN algorithm is implemented through the following formula and process: Let the color patch dataset to be clustered be (the color attribute dataset to be clustered obtained by a high-resolution imaging visual analyzer; after two-step clustering filtering, specific color samples + category center color samples are obtained; after color difference filtering, a feature color sample set is obtained. Clustering has not yet been performed here, therefore it is the color patch dataset to be clustered). ,Right now For any sample point ,That - Neighborhood is defined as:
[0013] in, For sample points of - Neighborhood set, For any sample point in the neighborhood, For the sample The Dimensional component (area ratio of color blocks). For the sample The dimensional components, (EPS) represents the radius of the domain; If sample points of - The number of samples in the neighborhood satisfies ,but As the core point; Density reachability is defined by the transitivity of core points; density-connected points form clusters; the cluster with the largest number of samples contains common color samples. The samples in the remaining clusters are samples with specific colors. ; The total number of samples, ; Iterative adjustment When performing DBSCAN, if the specific color samples account for 5%~15% of the total samples (i.e., Stop when ).
[0014] Preferably, in step 3.1), the specific method for determining the center samples of each classification category using the K-means clustering algorithm is as follows: Let the remaining sample set be , for 1D vector, structure same ; The K-means clustering algorithm based on the area ratio of color blocks is implemented through the following iterative process: Random selection 10 sample points were used as the initial cluster centers. ,in for dimensional vector; Sample Assign to the nearest cluster :
[0015] in, For the sample The Dimensional components ( (area percentage) For the first Sub-iteration clusters The center's first dimensional components, The total number of clusters is given, and the distance is calculated using the squared multidimensional Euclidean distance. For all other clusters ; Recalculate cluster centers (means of each dimension):
[0016] That is, for each dimension :
[0017] in, For the first +1 iteration cluster The center's first dimensional components, For the sample The Dimensional component (area proportion of color blocks); When the cluster center change Stop when (preset threshold) or when the maximum number of iterations is reached, and finally... Cluster center These are the category center samples for each category.
[0018] Preferably, in step 3.2), the formula for calculating the color difference between pairs of samples uses color difference... Formula, based solely on the CIELAB space of the samples , , The components, and the formula is:
[0019] in, This represents the total color difference between the two samples in the CIELAB color space. For two samples difference, For two samples difference, For two samples difference.
[0020] Based on the calculation Numerical values, in (in ) standard ( The threshold for significant color difference perceived by the human eye is used for judgment. When... At that time, adjust the number of categories in step 6). Repeat steps 6) and 7) until all the class center samples exactly match each other. The standard is used to obtain the color sample of the category center.
[0021] Preferably, in step 3.2), the method for obtaining the feature color sample set is as follows: based on the result calculated in step 3.1). Numerical values, in ) standard ( (The threshold for color difference that is significantly perceived by the human eye), without changing the color samples of the category center, based on the principle of maximizing the preservation of feature differences (i.e., ensuring the color difference between any two samples in the feature color sample set). (If the criteria are met and no new samples can be added), the samples with unique colors are screened to ultimately obtain those that meet the criteria. The characteristic color sample set of the threshold.
[0022] Preferably, in step 4.1), the specific method for summarizing and calculating the color difference between the specific color samples obtained in step 2) and the category center color samples obtained in step 3.2) is as follows: using the same color difference calculation method as in step 3.2), calculate the color difference between all pairs of samples after summarizing the specific color samples and the category center color samples. .
[0023] Compared with the prior art, the beneficial effects of the present invention are: 1. This application combines DBSCAN and K-means clustering algorithms on color patch data acquired by a high-resolution imaging visual analyzer for Longjing tea, and utilizes L in the CIELAB color space. * a * b * value pairs The calculation and screening can effectively improve the standardization and objectivity of the research and development of Longjing tea color cards, reduce the reliance on personal subjective experience in the use of traditional tea color card making techniques, and thus help to establish an objective, accurate and quantifiable tea color standard system.
[0024] 2. The density-based clustering algorithm DBSCAN in this application can effectively identify outliers in a dataset, making it suitable for screening unique color samples. K-means clustering, on the other hand, demonstrates high efficiency when processing large-scale datasets, making it suitable for determining the center points of mainstream color distributions. However, a single clustering algorithm often struggles to comprehensively cover both unique and mainstream samples. Combining these two algorithms organically—using DBSCAN to identify unique color samples and then using K-means to determine the mainstream color classification centers—can achieve a complete and accurate characterization of the tea color space. Simultaneously, color difference calculation and evaluation based on the CIELAB color space ensures that the final selected color samples have clear distinguishability from a human visual perception perspective, avoiding visually indistinguishable redundant samples. This has significant theoretical and applied value in achieving the standardization and objectification of tea color evaluation and is also one of the key technologies for promoting the digital transformation and upgrading of the tea industry. Attached Figure Description
[0025] Figure 1 This is a flowchart illustrating the method for producing tea sample color cards according to the present invention. Figure 2 Color difference in embodiments of the present invention Filtering results Figure 3 Feature color sample set in the embodiments of the present invention Detailed Implementation The following will refer to the appendices in the embodiments of the present invention. Figure 1-3The technical solutions in the embodiments of the present invention are clearly and completely described herein. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0026] Please see Figure 1-3 Embodiments of the present invention: Example: A method for creating a tea sample color card based on two-step clustering using DBSCAN and K-means, characterized by comprising the following steps: First, sample collection and numbering. According to GB / T 18650-2008, a total of 513 Longjing tea varieties from three Longjing tea producing areas in Zhejiang Province—West Lake, Qiantang, and Yuezhou—were collected as raw material samples for this embodiment. The sample quantity information is shown in Table 1. Each raw material sample was numbered.
[0027] Table 1. Information on the quantity of Longjing tea raw material samples
[0028] 1) Obtaining the dataset of color attributes of dry tea, tea soup, and tea leaves; 1.1) Use samples to prepare tea infusion and tea leaves; The preparation methods for the tea liquor and tea leaves should refer to the "Sensory Evaluation Methods for Tea" (GB / T 23776). The samples should be photographed immediately after preparation to prevent discoloration. Before photographing, lay the dry tea leaves flat on a white background to ensure no background color is visible; use a filter to remove impurities from the tea soup; wipe the tea leaves dry with a paper towel and then lay them flat on the white background to reduce water stains and reflections.
[0029] Specifically, place a 3g sample of dry tea into a 150mL standard tea tasting cup, pour in boiling water until it is level with the rim, cover and steep for 4 minutes. Then, quickly filter the tea into the tasting bowl using a strainer, avoiding any tea residue during the process, ensuring the tea is clear and free of impurities. Place the tasting bowl on a white background. When processing the tea leaves, transfer all the tea leaves from the tasting cup to the same white background and spread them evenly into a single layer for easy observation of the color and shape of the leaves.
[0030] 1.2) Use a high-resolution imaging visual analyzer to acquire images of the dry tea, tea liquor, and tea leaves. The dry tea samples should be laid flat on a white substrate, ensuring the sample completely covers the substrate surface without revealing its original color, thus showcasing the tea's color. The tea liquor should be served in an tasting bowl, which should be placed on the white substrate. All tea leaves should be transferred to the same white substrate and spread evenly into a single layer. Immediately after preparing the tea liquor and tea leaves, images should be captured using a high-resolution imaging visual analyzer to prevent discoloration. Each sample should be imaged three times.
[0031] 1.3) Use a high-resolution imaging visual analyzer to analyze the images acquired in 1.2) to perform color correction, background subtraction and color information analysis, and obtain the color attribute dataset of each sample of dry tea, tea soup and tea leaves; The color attribute dataset includes three image color components (average L in CIELAB space). * a * b * (For color difference calculation only) and the area ratio of each color block (assuming the total number of color blocks is ). Then each sample contains (Area percentage data), using only the area percentage data of each color patch for DBSCAN density clustering and K-means clustering, i.e., color patch dataset. Each sample point in for Dimensional vector:
[0032] in, For the first In the nth sample The area percentage of each non-white back panel color block ( ,and The remaining area is a white background but was not included in the data.
[0033] Specifically, a high-resolution imaging visual analyzer (Alpha MOS IRIS, France) was used to perform color correction, background subtraction (and further subtraction of the rim of the tasting bowl for tea images), and color information analysis on the acquired images, thereby obtaining the CIELAB color space L... * a * b * A dataset of color attributes showing the values and area proportions of each color patch. Color analysis results show that there are 118 color patches in the dry tea, 74 color patches in the tea soup, and 105 color patches in the tea leaves.
[0034] 2) The DBSCAN density clustering algorithm is used to screen for unique color samples in the tea color attribute dataset; The specific method for using the DBSCAN density clustering algorithm to screen for unique color samples is as follows: DBSCAN clustering is performed using the area ratio information of color patches, and a threshold for the core points of the DBSCAN algorithm is set. Dynamically adjust the neighborhood radius (i.e., EPS), until the number of outliers accounts for approximately 5% to 15% of the total sample size, and the resulting outliers are considered as unique color samples; the DBSCAN algorithm is implemented through the following formula and process: Let the dataset of color patches to be clustered be... ,Right now For any sample point ,That - Neighborhood is defined as:
[0035] in, For sample points of - Neighborhood set, For any sample point in the neighborhood, For the sample The Dimensional component (area ratio of color blocks). For the sample The dimensional components, (EPS) represents the radius of the domain; If sample points of - The number of samples in the neighborhood satisfies ,but As the core point; Density reachability is defined by the transitivity of core points; density-connected points form clusters; the cluster with the largest number of samples contains common color samples. The samples in the remaining clusters are samples with specific colors. ; The total number of samples, ; Iterative adjustment When performing DBSCAN, if the specific color samples account for 5%~15% of the total samples (i.e., Stop when ).
[0036] Specifically, the DBSCAN density clustering algorithm was used to filter out atypical color samples from the datasets of dry tea, tea soup, and leaf base color area proportions. Samples in the cluster with the largest number of samples were considered common color samples, while samples in the remaining clusters were considered atypical color samples. Dynamically adjust the neighborhood radius (i.e., EPS), the process stops when the number of unique color samples reaches 10% of the total samples. In this embodiment, The adjustment results are shown in Table 2.
[0037] Table 2 DBSCAN Density Clustering Algorithm Adjustment results
[0038] 3. The K-means clustering algorithm was used to select the color samples of the category center in the tea color attribute dataset; 3.1) Based on the unique color samples determined in step 2), the K-means clustering algorithm is used to classify the remaining sample color data and determine the class center samples of each class. The specific method for determining the center samples of each classification category using the K-means clustering algorithm is as follows: Let the remaining sample set be , for 1D vector, structure same ; The K-means clustering algorithm based on the area ratio of color blocks is implemented through the following iterative process: Random selection 10 sample points were used as the initial cluster centers. ,in for dimensional vector; Sample Assign to the nearest cluster :
[0039] in, For the sample The Dimensional components ( (area percentage) For the first Sub-iteration clusters The center's first dimensional components, The total number of clusters is given, and the distance is calculated using the squared multidimensional Euclidean distance. For all other clusters ; Recalculate cluster centers (means of each dimension):
[0040] That is, for each dimension :
[0041] in, For the first +1 iteration cluster The center's first dimensional components, For the sample The Dimensional component (area proportion of color blocks); When the cluster center change Stop when (preset threshold) or when the maximum number of iterations is reached, and finally... Cluster center These are the category center samples for each category.
[0042] 3.2) Using the CIELAB color space L * a * b * The color difference between each pair of the above category center samples is calculated, the color difference is evaluated, and the number of categories is adjusted until the color difference between all category center samples meets the color difference threshold, thus obtaining the category center color sample. The formula for calculating the color difference between two samples uses color difference. Formula, based solely on the CIELAB space of the samples , , The components, and the formula is:
[0043] in, This represents the total color difference between the two samples in the CIELAB color space. For two samples difference, For two samples difference, For two samples difference.
[0044] Based on the calculation Numerical values, in (in ) standard ( The threshold for significant color difference perceived by the human eye is used for judgment. When... At that time, adjust the number of categories in step 6). Repeat steps 6) and 7) until all the class center samples exactly match each other. The standard is used to obtain the color sample of the category center.
[0045] The method for obtaining the characteristic color sample set is as follows: based on the calculation in step 3.1). Numerical values, in ) standard ( (The threshold for color difference that is significantly perceived by the human eye), without changing the color samples of the category center, based on the principle of maximizing the preservation of feature differences (i.e., ensuring the color difference between any two samples in the feature color sample set). (If the criteria are met and no new samples can be added), the samples with unique colors are screened to ultimately obtain those that meet the criteria. The characteristic color sample set of the threshold.
[0046] Specifically, the remaining datasets of dry tea, tea soup, and leaf color area proportions after removing samples with distinctive colors are clustered using the K-means clustering algorithm to obtain the cluster centers, which are the classification center samples. The number of categories is then adjusted based on the pairwise color differences between the classification center samples. Until all the class center samples exactly match each other. (In this embodiment, the dry tea and the tea leaves) tea soup The standard is used to obtain the category center color sample. In this embodiment, the number of categories for dry tea is 3, the number of categories for tea soup is 4, and the number of categories for tea leaves is 3.
[0047] IV. Evaluate the color differences in the color difference data; 4.1) Summarize the special color samples in step 2) and the category center color samples in step 3.2), and calculate the color difference between each pair of the above samples using the L*, a*, and b* values in the CIELAB color space; The specific method for summarizing and calculating the color difference between the specific color samples obtained in step 2) and the category center color samples obtained in step 3.2) is as follows: using the same color difference calculation method as in step 3.2), calculate the color difference between all pairs of samples after summarizing the specific color samples and the category center color samples. .
[0048] 4.2) Based on the color difference calculation results in 4.1), characteristic color samples are selected from the samples obtained in 4.1).
[0049] Specifically, we summarize the distinctive color samples and the category center color samples, and perform pairwise color difference analysis. Calculation. Calculated Numerical values, in (In this embodiment, the dry tea and the tea leaves) tea soup According to the standard of ), based on the principle of maximizing the retention of feature differences (i.e., ensuring the color difference between any two samples in the feature color sample set), (If the criteria are met and no new samples can be added), the final result will be a sample that meets the criteria. The characteristic color sample set of the threshold. Color difference. The screening results are as follows Figure 2As shown. The filtered feature color sample set is as follows. Figure 3 As shown.
[0050] Model runtime environment The computer is configured with an AMD Ryzen 5 4600H CPU, an Intel Iris Xe Graphics card, and 512GB of RAM. The operating system is Windows 10. According to the design scheme, the algorithm is run using the R 4.4.1 and Rstudio 2024.09.01 integrated development environment.
[0051] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the scope of the invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0052] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for creating a tea sample color card based on two-step clustering using DBSCAN and K-means, characterized by comprising the following steps: 1) Obtaining the dataset of color attributes of dry tea, tea soup, and tea leaves; 1.1) Use samples to prepare tea infusion and tea leaves; 1.2) Use a high-resolution imaging visual analyzer to acquire images of the dry tea, tea liquor, and tea leaves. 1.3) Use a high-resolution imaging visual analyzer to analyze the images acquired in step 1.2) to perform color correction, background subtraction and color information analysis, and obtain the color attribute dataset of each sample of dry tea, tea soup and tea leaves; 2) The DBSCAN density clustering algorithm is used to screen for unique color samples in the tea color attribute dataset; (iii) Use the K-means clustering algorithm to select the color samples of the category center in the tea color attribute dataset; 3.1) Based on the unique color samples determined in step 2), the K-means clustering algorithm is used to classify the remaining sample color data and determine the class center samples of each class. 3.2) Using the CIELAB color space L * a * b * The color difference between each pair of the above category center samples is calculated, the color difference is evaluated, and the number of categories is adjusted until the color difference between all category center samples meets the color difference threshold, thus obtaining the category center color sample. 4) Evaluate the color differences in the color difference data; 4.1) Summarize the special color samples in step 2) and the category center color samples in step 3.2), and calculate the color difference between each pair of the above samples using the L*, a*, and b* values in the CIELAB color space; 4.2) Based on the color difference calculation results in 4.1), characteristic color samples are selected from the samples obtained in 4.1).
2. The method for creating a tea sample color card based on two-step clustering using DBSCAN and K-means as described in claim 1, characterized in that, In step 1.1), the image is taken immediately after preparation to prevent discoloration; Before photographing, lay the dry tea leaves flat on a white background to ensure no background color is visible; use a filter to remove impurities from the tea soup; wipe the tea leaves dry with a paper towel and then lay them flat on the white background to reduce water stains and reflections.
3. The method for creating a tea sample color card based on two-step clustering using DBSCAN and K-means, as described in claim 2, is characterized in that... In step 1.3), the color attribute dataset includes three image color components and the area percentage of each color patch, with a total number of color patches. Then each sample contains The dataset consists of area percentage data. Only the area percentage data of each color patch is used for DBSCAN density clustering and K-means clustering, i.e., the color patch dataset. Each sample point in for Dimensional vector: in, For the first In the nth sample The area percentage of each non-white background panel color block ,and The remaining area is a white background but was not included in the data.
4. A method for creating a tea sample color card based on two-step clustering using DBSCAN and K-means, as described in claim 1 or 3, characterized in that... In step two), the specific method for screening unique color samples using the DBSCAN density clustering algorithm is as follows: DBSCAN algorithm clustering is performed using the color patch area ratio information, and a core point threshold for the DBSCAN algorithm is set. Dynamically adjust the neighborhood radius The process continues until outlier samples comprise approximately 5% to 15% of the total sample size; these outlier samples are then considered as unique color samples. The DBSCAN algorithm is implemented using the following formula and process: Let the dataset of color patches to be clustered be... ,Right now For any sample point ,That - Neighborhood is defined as: in, For sample points of - Neighborhood set, For any sample point in the neighborhood, For the sample The dimensional components, For the sample The dimensional components, The radius of the domain; If sample points of - The number of samples in the neighborhood satisfies ,but As the core point; Density reachability is defined by the transitivity of core points; density-connected points form clusters; the cluster with the largest number of samples contains common color samples. The samples in the remaining clusters are samples with specific colors. ; The total number of samples, ; Iterative adjustment When performing DBSCAN, if the specific color samples account for 5% to 15% of the total samples, that is... Stop when the time comes.
5. The method for creating a tea sample color card based on DBSCAN and K-means two-step clustering according to claim 4, characterized in that, In step 3.1), the specific method for determining the center samples of each classification category using the K-means clustering algorithm is as follows: Let the remaining sample set be , for 1D vector, structure same ; The K-means clustering algorithm based on the area ratio of color blocks is implemented through the following iterative process: Random selection 10 sample points were used as the initial cluster centers. ,in for dimensional vector; Sample Assign to the nearest cluster : in, For the sample The dimensional components, For the first Sub-iteration clusters The center's first dimensional components, The total number of clusters is given, and the distance is calculated using the squared multidimensional Euclidean distance. For all other clusters ; Recalculate cluster centers: That is, for each dimension : in, For the first +1 iteration cluster The center's first dimensional components, For the sample The Dimensional components; When the cluster center change Stop when (preset threshold) or when the maximum number of iterations is reached, and finally... Cluster center These are the category center samples for each category.
6. The method for creating a tea sample color card based on two-step clustering using DBSCAN and K-means, as described in claim 5, is characterized in that... In step 3.2), the formula for calculating the color difference between pairs of samples uses color difference. Formula, based solely on the CIELAB space of the samples , , The components, and the formula is: in, This represents the total color difference between the two samples in the CIELAB color space. For two samples difference, For two samples difference, For two samples difference. Based on the calculation Numerical values, in ,in The standard judgment. When it occurs At that time, adjust the number of categories in step 6). Repeat steps 6) and 7) until all the class center samples exactly match each other. The standard is used to obtain the color sample of the category center.
7. The method for creating a tea sample color card based on two-step clustering using DBSCAN and K-means as described in claim 6, characterized in that, In step 3.2), the method for obtaining the feature color sample set is as follows: based on the calculation in step 3.1). Numerical values, in Based on the standard, without altering the category center color samples, and according to the principle of maximizing feature retention difference, specific color samples are screened to ultimately obtain those that meet the criteria. The characteristic color sample set of the threshold.
8. The method for creating a tea sample color card based on two-step clustering using DBSCAN and K-means, as described in claim 7, is characterized in that... In step 4.1), the specific method for summarizing and calculating the color difference between the special color samples obtained in step 2) and the category center color samples obtained in step 3.2) is as follows: using the same color difference calculation method as in step 3.2), calculate the color difference between all pairs of samples after summarizing the special color samples and the category center color samples. .