Tongue color and fur color classification method based on multi-color fusion and main color analysis
By analyzing the RGB and HSV channels of the tongue coating image, combined with bit plane decomposition and main color analysis, the complex problem of high-dimensional color feature processing in the existing technology is solved, and the rapid and accurate diagnosis of tongue coating color classification is achieved.
Patent Information
- Application Number
- CN202510215402.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When dealing with high-dimensional color characteristics, the existing tongue coating color classification method faces problems such as excessive data dimensions, high computational complexity, and slow processing speed, and fails to make full use of the changing characteristics of hue, saturation and brightness in the HSV color space.
By extracting and analyzing the color characteristics of RGB and HSV channels, using bit plane decomposition and main color analysis, redundant information is removed, data processing complexity is reduced, computing resource utilization is optimized, and the rapid and automatic classification of tongue coating colors is achieved.
It significantly improves the accuracy of color classification of tongue coating, shortens diagnosis time, improves diagnostic efficiency, reduces redundant information, and optimizes the efficiency of computing resources use.
Smart Images

Figure CN119722821A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing and analysis, and specifically relates to a tongue color and coating color classification method based on multi-color fusion and main color analysis. Background Art
[0002] Tongue diagnosis is one of the important methods of diagnosis in traditional Chinese medicine. It helps to judge the health status of the human body by observing the color, shape, moisture and other characteristics of the tongue coating. Traditional tongue diagnosis methods rely on the doctor's experience and subjective judgment, and are easily affected by factors such as visual fatigue and experience differences, resulting in certain uncertainties and errors in the diagnosis results.
[0003] With the rapid development of artificial intelligence technology, image processing and pattern recognition are increasingly widely used in the medical field. In recent years, computer vision and deep learning technologies have been widely used in medical image analysis, and significant progress has been made in the recognition and analysis of tongue coating color. Many studies have attempted to extract and classify the color features of tongue coating by automated means to assist doctors in making more objective and efficient diagnoses. However, most existing studies focus on simple color classification methods, lack of in-depth mining of image color information, especially in multi-channel color feature fusion and color change feature extraction. Most methods process the RGB color space, but do not make full use of the changing characteristics of hue, saturation and brightness in the HSV color space, and fail to effectively remove noise and redundant information through advanced image processing techniques. In addition, when processing high-dimensional color features, existing tongue coating color classification methods often face problems such as high data dimension, large computational complexity, and slow processing speed. Summary of the invention
[0004] The present invention aims to solve one of the technical problems existing in the related art at least to a certain extent.
[0005] One object of the present invention is to provide a tongue color and coating color classification method based on multi-color fusion and primary color analysis, by extracting and analyzing the color features of RGB and HSV channels, utilizing bit plane decomposition and primary color analysis, effectively removing redundant information, reducing data processing complexity, optimizing computing resource utilization, and accelerating the automatic classification of tongue coating color.
[0006] In order to achieve the above-mentioned object, the present invention provides a tongue color and coating color classification method based on multi-color fusion and main color analysis, comprising: S100, extracting the RGB channels of the tongue coating image and converting them into the HSV color space to obtain six channel images of R, G, B, H, S, and V; S200, performing bit plane decomposition on the six channel images to obtain a bit plane image of each channel; S300, weighting the bit plane images according to the principle that the weight of the higher bit plane is greater than that of the lower bit plane, to generate a weighted image; S400, extracting color features from the weighted image and performing standardization processing on the color features; S500, performing primary color analysis on the standardized color feature data; S600, process the labeled training set and test sample respectively using the method of step S100-step S500, and use the color classification method based on color-related divergence distance to determine the tongue coating color and complete the tongue coating color classification.
[0007] A further preferred technical solution of the present invention is that the bit plane decomposition of the six channel images in step S200 is performed to obtain a bit plane image of each channel, and the specific method is as follows: Convert the value of each pixel in the six channels into an 8-bit binary number, extract each bit plane value of the image in the RGB and HSV channels, and obtain an 8-bit array of the six channels; The obtained array is stored in the A1 array, expressed as: ; Among them, i and j represent the i-th row and j-th column of the A1 array respectively; q represents the q-th plane image; A1 is represented as a three-dimensional array, in which the value of each dimension starts from 0 and the third dimension takes the value q-1.
[0008] Preferably, in step S300, according to the principle that the weight of the higher bit plane is greater than that of the lower bit plane, the bit plane image is weighted to generate a weighted image, and the specific method is: Different weights are assigned to each bit plane according to its importance in the image. The principle followed is that higher bit planes represent the backbone information of the image and occupy a larger proportion in the weighted sum, while the information of lower bit planes is weighted as a secondary feature; The weight decreases with the number of the bit plane, and the specific weighted calculation formula is expressed as: ; in, The weight of each bit plane, It is the value after bit plane decomposition.
[0009] Preferably, the color features are standardized in step S400, and the specific method is as follows: The color feature data is linearly transformed so that the mean of each color feature is 0 and the standard deviation is 1; the standardized formula is expressed as: ; in: is the original data, is the mean of the feature, σ is the standard deviation of the feature, is the standardized data.
[0010] Preferably, the step S500 of performing primary color analysis on the standardized color feature data includes: S510, performing centralization processing on the standardized color feature data; S520, calculating the covariance matrix of the color feature data; S530, performing eigenvalue decomposition; S540, sorting the eigenvalues and selecting the first k main colors; S550: Project the color features of the image onto the selected main color direction.
[0011] Preferably, the specific method of step S500 is: Assume the color feature matrix is , where N is the number of samples and D is the dimension of the color feature; the centralized data matrix It is expressed as: ; in, is the mean vector of each feature, calculated as: ; The calculation formula for calculating the covariance matrix of the color feature data in step S520 is: ; in, is the transposition of centralized data, is the covariance matrix; After obtaining the covariance matrix, perform eigenvalue decomposition. The eigenvalue decomposition formula is: ; in, is the kth eigenvalue, indicating the variance in the kth main color direction, is the corresponding eigenvector, indicating the main direction of color change; Calculate the contribution of each primary color , the calculation formula is: ; in, is the eigenvalue of the kth primary color, is the sum of all eigenvalues; Select the top k main colors with the highest contribution value; Finally, the color features of the image are projected onto the selected main color direction, and the high-dimensional color features of the image are compressed into an n-dimensional space. The projection formula is: ; in, is the projected data matrix, which represents the projection of each sample in the first k main color directions. is a matrix consisting of the first k main color eigenvectors.
[0012] Preferably, the specific method of step S600 is: S610, firstly, the main color features of the training set and the test sample are centralized, and the feature matrix of the training set is set to , where each is the first k main color feature vectors of each training image, and the test sample feature matrix is , where each is the color feature vector of the test sample; the central processing is expressed as: ; in, and are the means of the color features of the training set and the test sample, respectively; S620, calculate the covariance matrix of the training set and the test sample, as well as the cross-covariance matrix between the training set and the test sample, the covariance matrix of the training set The calculation formula is: ; Covariance matrix of the test sample The calculation formula is: ; The cross-covariance matrix between the training set and the test samples The calculation formula is: ; S630, solve the principal axis projection direction by maximizing the canonical correlation coefficient and ,in is the principal axis projection direction of the training set, is the principal axis projection direction of the test sample, and the maximization criterion function is expressed as: ; Optimize the above criteria to obtain the first pair of typical correlation components ; S640, extracting typical correlation components by calculating projection, wherein the projection vector of the training set is expressed as: ; The projection vector of the test sample is expressed as: ; S650, calculate the typical correlation coefficient, that is, test sample The projection vector of each category in the training set The calculation method of the correlation is: ; in, It is a test sample and the projection vector of the yth class in the training set The dot product of and The test samples are And training set categories The length of the projection vector; S660, by comparing the correlation coefficients of each category, select the category with the largest correlation coefficient as the final prediction result, expressed as: ; Select training and test samples The category with the largest canonical correlation coefficient , predict a category for the test sample and get the predicted color label of the test sample.
[0013] Another aspect of the present invention provides a non-transitory computer-readable storage medium having computer instructions stored thereon, which enable a computer to execute the above-mentioned tongue color and coating color classification method based on multi-color fusion and primary color analysis.
[0014] Yet another aspect of the present invention provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, and the processor calls the logic instructions in the memory to execute the above-mentioned tongue color and coating color classification method based on multi-color fusion and main color analysis.
[0015] On the other hand, the present invention provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer executes the above-mentioned tongue color and coating color classification method based on multi-color fusion and main color analysis.
[0016] Beneficial effects: Through detailed analysis of RGB and HSV channels and combined with bit plane decomposition, the primary color analysis of the present invention can accurately extract key information of tongue coating color, remove redundancy and noise, significantly improve the accuracy of tongue coating color classification, and ensure that important color features are retained.
[0017] The primary color analysis of the present invention not only speeds up image recognition and analysis by reducing data dimensions and simplifying the calculation process, but also reduces redundant information, thereby effectively reducing the complexity of data processing and optimizing the use efficiency of computing resources.
[0018] The present invention provides a rapid and accurate analysis of tongue coating color, which can assist doctors in tongue diagnosis, help diagnose health conditions such as qi and blood, and organ functions, improve diagnostic efficiency and accuracy, and play an important supporting role in clinical diagnosis of traditional Chinese medicine.
[0019] In addition to being applied to tongue coating analysis, the main color analysis method of the present invention has a wide range of application potentials and can be extended to the automatic classification and diagnosis of other medical images. At the same time, due to its efficient data processing capabilities, it is suitable for application in embedded devices or resource-limited environments to achieve efficient automated analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a flow chart of the tongue color and coating color classification method based on multi-color fusion and main color analysis.
[0021] Figure 2 Flowchart for bit-plane decomposition and calculation of weighted images.
[0022] Figure 3 Flowchart for primary color analysis.
[0023] Figure 4 Flowchart of the color classification method for the color correlation divergence distance measure. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments, and they should not be understood as limitations on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In the description of the present invention, it should be understood that the terms used are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0025] In view of the problems existing in the background technology, in order to improve the accuracy and efficiency of tongue coating color recognition, it is necessary to combine a more sophisticated color feature extraction method and use primary color analysis to extract the most representative color features from a large amount of data. Therefore, how to use multi-channel color features, bit plane decomposition technology and primary color analysis methods to improve the accuracy of image recognition and optimize the use of computing resources has become a key direction for the development of tongue coating color classification and analysis technology.
[0026] The present invention improves the speed and accuracy of tongue coating image recognition through a TCM tongue coating classification method based on multi-color fusion and primary color analysis. By extracting and analyzing the color features of RGB and HSV channels, using bit plane decomposition and primary color analysis, redundant information is effectively removed, data processing complexity is reduced, and computing resource utilization is optimized, thereby accelerating the automatic classification of tongue coating color. This method can assist doctors in tongue diagnosis, shorten diagnosis time, improve diagnosis efficiency, and provide accurate auxiliary decision support.
[0027] Combine the following Figure 1-Figure 4 The present invention describes a tongue color and coating color classification method based on multi-color fusion and main color analysis.
[0028] Embodiment 1: This embodiment provides a tongue color and fur color classification method based on multi-color fusion and main color analysis. The processing flow is as follows: Figure 1 As shown, including: S100, extracting the RGB channels of the tongue coating image and converting them into the HSV color space to obtain six channel images of R, G, B, H, S, and V; S200, performing bit plane decomposition on the six channel images to obtain a bit plane image of each channel; like Figure 2 As shown in Figure 1, the process is applied to the six color channels (i.e., R, G, B, H, S, V) respectively, resulting in an 8-bit decomposed image for each channel, and a total of 8-bit arrays for 6 channels. This process involves decomposing each pixel value of the image bit by bit and extracting the value of each bit plane.
[0029] The obtained array is stored in the A1 array, expressed as: ; Among them, i and j represent the i-th row and j-th column of the A1 array respectively; q represents the q-th plane image; A1 is represented as a three-dimensional array, in which the value of each dimension starts from 0 and the third dimension takes the value q-1.
[0030] S300, weighting the bit plane images according to the principle that the weight of the higher bit plane is greater than that of the lower bit plane, to generate a weighted image; The importance of each bit plane is given different weights according to its role in the image. Higher bit planes represent the backbone information of the image and account for a larger proportion in the weighted sum, while the information of lower bit planes is weighted as a secondary feature. The weight decreases with the number of bit planes. This process makes the high-bit information of the image account for a larger proportion, thereby improving the clarity of the image contour and reducing the influence of low-bit planes, which usually contain noise and redundant information. This step will weight the image based on the weight of each bit plane, and the final image retains the main characteristics of color while removing redundancy and noise. The weighted image generated in this way can more accurately reflect the color characteristics of the tongue coating.
[0031] The specific weighted calculation formula is expressed as: ; in, The weight of each bit plane, It is the value after bit plane decomposition.
[0032] S400, extracting color features from the weighted image and performing standardization processing on the color features; Standardization refers to the linear transformation of data so that the color features of each feature image have zero mean and unit variance. The purpose of standardization is to unify the numerical range of all features to avoid unnecessary influence on the analysis results due to the large or small scale of some features.
[0033] This step performs a linear transformation on the color feature data so that the mean of each color feature is 0 and the standard deviation is 1; the standardized formula is expressed as: ; in: is the original data, is the mean of the feature, σ is the standard deviation of the feature, is the standardized data.
[0034] S500, performing primary color analysis on the standardized color feature data; After standardization, different color channels (RGB and HSV) in the color feature data may contain a lot of information, but not all features are equally important to the color expression of the image. In order to extract the most important color features in the image, primary color analysis is used. Through primary color analysis, the color features of the image are mapped to a new space composed of primary colors. Each primary color represents the direction in which the color changes most significantly in the image.
[0035] In order to perform primary color analysis, the extracted color feature data must first be centered. The purpose of centering is to move the mean of the data to zero to ensure that the analysis is not affected by the offset of the original position of the data. For each color feature, the mean of the feature is subtracted from each data point, so that the centered data will not affect the analysis results due to different means of different features.
[0036] Therefore, the specific process of this step is as follows Figure 3 As shown, including: S510, set the color feature matrix to , where N is the number of samples and D is the dimension of the color feature; the centralized data matrix It is expressed as: ; in, is the mean vector of each feature, calculated as: ; By centralizing the data, the deviation between the color channels is eliminated, making the contribution of each color feature to the main color analysis more balanced. Next, calculate the covariance matrix of the data , which is used to measure the correlation and variability between color features.
[0037] S520, the calculation formula for calculating the covariance matrix of the color feature data is: ; in, is the transposition of centralized data, is the covariance matrix; By calculating the covariance matrix, the most significant directions of the image color features can be identified, which will become the "dominant colors" in subsequent analysis.
[0038] S530, after obtaining the covariance matrix, perform eigenvalue decomposition, the eigenvalue decomposition formula is: ; in, is the kth eigenvalue, indicating the variance in the kth main color direction, is the corresponding eigenvector, which indicates the main direction of color change. The main color direction with a larger eigenvalue contributes more to the color change of the image. Therefore, selecting the main color direction with a larger eigenvalue helps to extract the most important color information.
[0039] S540, calculating the contribution value of each primary color , the calculation formula is: ; in, is the eigenvalue of the kth primary color, is the sum of all eigenvalues; this formula measures the contribution of each main color to the total variance of the data, reflecting the importance of the main color in capturing the color changes of the image.
[0040] Select the top k main colors with the highest contribution value; S550, finally, project the color features of the image into the selected main color direction. This process compresses the high-dimensional color features of the image into a lower-dimensional space in order to retain the main color information of the image. The projection formula is: ; in, is the projected data matrix, which represents the projection of each sample in the first k main color directions. is a matrix consisting of the first k main color eigenvectors.
[0041] In this way, the color information of the image is compressed into fewer dimensions while retaining most of the important color features.
[0042] S600, processing the labeled training set and test sample respectively by the method of step S100 to step S500, and using the color classification method based on color-related divergence distance to determine the tongue coating color, and complete the tongue coating color classification; The specific process of this step is as follows Figure 4 As shown, including: S610, firstly, the main color features of the training set and the test sample are centralized, and the feature matrix of the training set is set to , where each is the first k main color feature vectors of each training image, and the test sample feature matrix is , where each is the color feature vector of the test sample; the central processing is expressed as: ; in, and are the means of the color features of the training set and the test sample, respectively; S620, calculate the covariance matrix of the training set and the test sample, as well as the cross-covariance matrix between the training set and the test sample, the covariance matrix of the training set The calculation formula is: ; Covariance matrix of the test sample The calculation formula is: ; The mutual correlation between the training set and the test samples The calculation formula is: ; The covariance matrix represents the correlation between different color features. By calculating the covariance matrix, we can reveal the correlation between the tongue color training set and the tongue color test set, as well as the correlation within them. This matrix is the basis for canonical correlation analysis.
[0043] S630, solve the principal axis projection direction by maximizing the canonical correlation coefficient and ,in is the principal axis projection direction of the training set, is the principal axis projection direction of the test sample, and the maximization criterion function is expressed as: ; Optimize the above criteria to obtain the first pair of typical correlation components ; S640, extracting typical correlation components by calculating projection, wherein the projection vector of the training set is expressed as: ; The projection vector of the test sample is expressed as: ; S650, calculate the typical correlation coefficient, that is, test sample The projection vector of each category in the training set The calculation method of the correlation is: ; in, It is a test sample and the projection vector of the yth class in the training set The dot product of and The test samples are And training set categories The length of the projection vector; S660, by comparing the correlation coefficients of each category, select the category with the largest correlation coefficient as the final prediction result, expressed as:
[0044] Select training and test samples The category with the largest canonical correlation coefficient , predict a category for the test sample and get the predicted color label of the test sample.
[0045] The tongue color subdivision classification of the color label in this embodiment is shown in Table 1.
[0046] Table 1 Tongue color classification principles based on traditional Chinese medicine
[0047] Embodiment 2: This embodiment provides a non-transitory computer-readable storage medium, on which computer instructions are stored, the computer instructions causing the computer to execute a tongue color and coating color classification method based on multi-color fusion and primary color analysis, the method comprising the following steps: S100, extracting the RGB channels of the tongue coating image and converting them into the HSV color space to obtain six channel images of R, G, B, H, S, and V; S200, performing bit plane decomposition on the six channel images to obtain a bit plane image of each channel; S300, weighting the bit plane images according to the principle that the weight of the higher bit plane is greater than that of the lower bit plane, to generate a weighted image; S400, extracting color features from the weighted image and performing standardization processing on the color features; S500, performing primary color analysis on the standardized color feature data; S600, process the labeled training set and test sample respectively using the method of step S100-step S500, and use the color classification method based on color-related divergence distance to determine the tongue coating color and complete the tongue coating color classification.
[0048] Embodiment 3: This embodiment provides an electronic device, which may include: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus. The processor may call the logic instructions in the memory to execute a tongue color and fur color classification method based on multi-color fusion and primary color analysis, the method comprising the following steps: S100, extracting the RGB channels of the tongue coating image and converting them into the HSV color space to obtain six channel images of R, G, B, H, S, and V; S200, performing bit plane decomposition on the six channel images to obtain a bit plane image of each channel; S300, weighting the bit plane images according to the principle that the weight of the higher bit plane is greater than that of the lower bit plane, to generate a weighted image; S400, extracting color features from the weighted image and performing standardization processing on the color features; S500, performing primary color analysis on the standardized color feature data; S600, process the labeled training set and test sample respectively using the method of step S100-step S500, and use the color classification method based on color-related divergence distance to determine the tongue coating color and complete the tongue coating color classification.
[0049] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0050] Embodiment 4: This embodiment provides a computer program product, which includes a computer program. The computer program can be stored in a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a tongue color and coating color classification method based on multi-color fusion and main color analysis. The method includes the following steps: S100, extracting the RGB channels of the tongue coating image and converting them into the HSV color space to obtain six channel images of R, G, B, H, S, and V; S200, performing bit plane decomposition on the six channel images to obtain a bit plane image of each channel; S300, weighting the bit plane images according to the principle that the weight of the higher bit plane is greater than that of the lower bit plane, to generate a weighted image; S400, extracting color features from the weighted image and performing standardization processing on the color features; S500, performing primary color analysis on the standardized color feature data; S600, process the labeled training set and test sample respectively using the method of step S100-step S500, and use the color classification method based on color-related divergence distance to determine the tongue coating color and complete the tongue coating color classification.
[0051] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0052] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A tongue color and coating color classification method based on multi-color fusion and main color analysis, characterized in that: include: S100, extracting the RGB channels of the tongue coating image and converting them into the HSV color space to obtain six channel images of R, G, B, H, S, and V; S200, performing bit plane decomposition on the six channel images to obtain a bit plane image of each channel; S300, weighting the bit plane images according to the principle that the weight of the higher bit plane is greater than that of the lower bit plane, to generate a weighted image; S400, extracting color features from the weighted image and performing standardization processing on the color features; S500, performing primary color analysis on the standardized color feature data; S600, process the labeled training set and test sample respectively using the method of step S100-step S500, and use the color classification method based on color-related divergence distance to determine the tongue coating color and complete the tongue coating color classification.
2. The tongue color and coating color classification method based on multi-color fusion and main color analysis according to claim 1 is characterized in that: The step S200 performs bit plane decomposition on the six channel images to obtain a bit plane image of each channel. The specific method is: Convert the value of each pixel in the six channels into an 8-bit binary number, extract each bit plane value of the image in the RGB and HSV channels, and obtain an 8-bit array of the six channels; The obtained array is stored in the A1 array, expressed as: ; Among them, i and j represent the i-th row and j-th column of the A1 array respectively; q represents the q-th plane image; A1 is represented as a three-dimensional array, in which the value of each dimension starts from 0 and the third dimension takes the value q-1.
3. The tongue color and coating color classification method based on multi-color fusion and main color analysis according to claim 2 is characterized in that: In step S300, according to the principle that the weight of the higher bit plane is greater than that of the lower bit plane, the bit plane images are weighted to generate a weighted image. The specific method is: Different weights are assigned to each bit plane according to its importance in the image. The principle followed is that higher bit planes represent the backbone information of the image and occupy a larger proportion in the weighted sum, while the information of lower bit planes is weighted as a secondary feature; The weight decreases with the number of the bit plane, and the specific weighted calculation formula is expressed as: ; in, The weight of each bit plane, It is the value after bit plane decomposition.
4. The tongue color and coating color classification method based on multi-color fusion and main color analysis according to claim 1 is characterized in that: The color features are standardized in step S400, and the specific method is as follows: The color feature data is linearly transformed so that the mean of each color feature is 0 and the standard deviation is 1; the standardized formula is expressed as: ; in: is the original data, is the mean of the feature, σ is the standard deviation of the feature, is the standardized data.
5. The tongue color and coating color classification method based on multi-color fusion and main color analysis according to claim 1 is characterized in that: The step S500 of performing primary color analysis on the standardized color feature data includes: S510, performing centralization processing on the standardized color feature data; S520, calculating the covariance matrix of the color feature data; S530, performing eigenvalue decomposition; S540, sorting the eigenvalues and selecting the first k main colors; S550: Project the color features of the image onto the selected main color direction.
6. The tongue color and coating color classification method based on multi-color fusion and main color analysis according to claim 5 is characterized in that: The specific method of step S500 is: Assume the color feature matrix is , where N is the number of samples and D is the dimension of the color feature; the centralized data matrix It is expressed as: ; in, is the mean vector of each feature, calculated as: ; The calculation formula for calculating the covariance matrix of the color feature data in step S520 is: ; in, is the transposition of centralized data, is the covariance matrix; After obtaining the covariance matrix, perform eigenvalue decomposition. The eigenvalue decomposition formula is: ; in, is the kth eigenvalue, indicating the variance in the kth main color direction, is the corresponding eigenvector, indicating the main direction of color change; Calculate the contribution of each primary color , the calculation formula is: ; in, is the eigenvalue of the kth primary color, is the sum of all eigenvalues; Select the top k main colors with the highest contribution value; Finally, the color features of the image are projected onto the selected main color direction, and the high-dimensional color features of the image are compressed into an n-dimensional space. The projection formula is: ; in, is the projected data matrix, which represents the projection of each sample in the first k main color directions. is a matrix consisting of the first k main color eigenvectors.
7. The tongue color and coating color classification method based on multi-color fusion and main color analysis according to claim 1 is characterized in that: The specific method of step S600 is: S610, firstly, the main color features of the training set and the test sample are centralized, and the feature matrix of the training set is set to , where each is the first k main color feature vectors of each training image, and the test sample feature matrix is , where each is the color feature vector of the test sample; the central processing is expressed as: ; in, and are the means of the color features of the training set and the test sample, respectively; S620, calculate the covariance matrix of the training set and the test sample, as well as the cross-covariance matrix between the training set and the test sample, the covariance matrix of the training set The calculation formula is: ; Covariance matrix of the test sample The calculation formula is: ; The cross-covariance matrix between the training set and the test samples The calculation formula is: ; S630, solve the principal axis projection direction by maximizing the canonical correlation coefficient and ,in is the principal axis projection direction of the training set, is the principal axis projection direction of the test sample, and the maximization criterion function is expressed as: ; Optimize the above criteria to obtain the first pair of typical correlation components ; S640, extracting typical correlation components by calculating projection, wherein the projection vector of the training set is expressed as: ; The projection vector of the test sample is expressed as: ; S650, calculate the typical correlation coefficient, that is, test sample The projection vector of each category in the training set The calculation method of the correlation is: ; in, It is a test sample and the projection vector of the yth class in the training set The dot product of and The test samples are And training set categories The length of the projection vector; S660, by comparing the correlation coefficients of each category, select the category with the largest correlation coefficient as the final prediction result, expressed as: ; Select training and test samples The category with the largest canonical correlation coefficient , predict a category for the test sample and get the predicted color label of the test sample.
8. A non-transitory computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and the computer instructions enable the computer to execute the tongue color and coating color classification method based on multi-color fusion and main color analysis as described in any one of claims 1-7.
9. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, and the processor calls the logic instructions in the memory to execute the tongue color and coating color classification method based on multi-color fusion and main color analysis as described in any one of claims 1-7.
10. A computer program product, characterized in that The computer program product includes a computer program, which is stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer executes the tongue color and coating color classification method based on multi-color fusion and primary color analysis as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Single sample based face image virtual sample expanding method and system
CN108898547A
Iris activity detection method based on feature fusion and machine learning
CN110119695A
Image data processing for more efficient compression
US20120189215A1