A Traditional Chinese Medicine Qi and Blood System and Method for Facial Image Discrimination Based on Computer Vision

Through the facial image discrimination system based on computer vision, the problem of insufficient diagnostic accuracy and narrow application scope of the traditional Chinese medicine qi and blood judgment system is solved, and the rapid and objective judgment of the qi and blood status is achieved, which improves the efficiency and scientific level of traditional Chinese medicine diagnosis.

CN118942674BActive Publication Date: 2025-08-05SECOND AFFILIATED HOSPITAL OF XIAN MEDICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410980766.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2025-08-05
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

The existing traditional Chinese medicine qi and blood judgment system relies on the maturity of computer vision and image processing technology, lack of diagnostic accuracy, narrow coverage, limited scope of application, and poor image quality affects the analysis results.

Method used

A facial image discrimination system based on computer vision is adopted, including image acquisition, feature extraction and feature comparison modules, an image feature extraction model is constructed using OpenCV and simple SNN models, a qi and blood discrimination model is constructed in combination with the TCMSP database, and image enhancement and mean processing is performed through the CLAHE algorithm to achieve fast and objective qi and blood state judgment.

Benefits of technology

It improves the efficiency and accuracy of traditional Chinese medicine diagnosis, provides fast and objective judgment of qi and blood status, reduces interference from human factors, simplifies the operation process, and promotes the modernization and scientificization of traditional Chinese medicine diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118942674B_ABST
    Figure CN118942674B_ABST
Patent Text Reader

Abstract

The present invention provides a Chinese medicine qi and blood system and method for facial image discrimination based on computer vision, belonging to the field of traditional Chinese medicine; it solves the problem of low efficiency of traditional Chinese medicine diagnosis; specifically as follows: an image acquisition module acquires the name, mobile phone number and facial image of a patient to obtain a patient dataset; a feature extraction module constructs an image feature extraction model and extracts the image features in the patient dataset to obtain a facial feature set of the patient; a feature comparison module acquires a set of traditional Chinese medicine face pictures to construct a qi and blood discrimination model, and analyzes the facial feature set to obtain a diagnosis result of the patient; a patient interaction module: according to the name and mobile phone number of the patient, feedbacks the diagnosis result to the corresponding patient; the present invention judges the condition of the patient by acquiring, analyzing and processing the facial image of the patient, and improves the diagnosis efficiency of traditional Chinese medicine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] A traditional Chinese medicine qi and blood system and method for discriminating facial images based on computer vision according to the present invention relates to the field of traditional Chinese medicine. Background Art

[0002] In traditional Chinese medicine, the existing systems and methods for judging qi and blood have the following deficiencies:

[0003] Diagnostic accuracy depends on the maturity of technology: The diagnostic accuracy of the system highly depends on the maturity of computer vision and image processing technologies. Insufficient technology will lead to deviations in diagnostic results.

[0004] Narrow coverage: Although the system can provide certain auxiliary diagnostic information, it still cannot fully replace the comprehensive judgment and experience of professional traditional Chinese medicine doctors.

[0005] Limitations in the scope of application: Although the system has wide adaptability, for specific populations with abnormal facial features or certain diseases, the diagnostic accuracy of the system will be affected.

[0006] Image processing problems: When patients or medical staff take facial images, non-standard operations may lead to poor image quality, thus affecting the analysis results. Summary of the Invention

[0007] Aiming at the deficiencies of the existing technology, the purpose of the present invention is to provide a traditional Chinese medicine qi and blood system and method for discriminating facial images based on computer vision, aiming to solve the problem of low efficiency of traditional Chinese medicine diagnosis.

[0008] To achieve the above object, the present invention is implemented through the following technical solutions: A traditional Chinese medicine qi and blood system for discriminating facial images based on computer vision includes:

[0009] An image acquisition module: used to obtain the name, mobile phone number and facial image of a patient, obtaining patient data; establishing a patient data set in the format of patient name + patient mobile phone number - patient facial image;

[0010] A feature extraction module: used to construct an image feature extraction model; using the image feature extraction model to extract the image features in the patient data set, obtaining the facial feature set of the patient;

[0011] A feature comparison module: used to obtain a set of traditional Chinese medicine facial pictures; using the set of traditional Chinese medicine facial pictures as a test set to construct a qi and blood discrimination model; using the qi and blood discrimination model to analyze the facial feature set, obtaining the diagnostic result of the patient;

[0012] A patient interaction module: according to the name and mobile phone number of the patient, feeding back the diagnostic result to the corresponding patient.

[0013] Further, the working process of the feature extraction module is as follows:

[0014] Process A1: Extract the facial image of the patient; use the OpenCV library function to process the facial image, convert the image data into vector data, and obtain the facial vector;

[0015] Process A2: Use a simple SNN model as the basic model to construct an image feature extraction model; define the constraint conditions for the first extraction and the second extraction of facial features;

[0016] Process A3: Backup the facial vector, and according to the constraint conditions for the first extraction and the second extraction of facial features, perform the second extraction and summarization on the facial vector to obtain the facial feature set of the patient, and send it to the feature comparison module.

[0017] Further, the specific working process of Process A2 is as follows:

[0018] Process A21: Define the constraint conditions for the first extraction of facial features:

[0019] Process A22: Define the constraint conditions for the second extraction of facial features.

[0020] Further, the specific working process of Process A22 is as follows:

[0021] Process A221: Assume that the secondary data set contains p facial images;

[0022] Process A222: Process the first facial image; use the image function in the OpenCV library to process the first facial image to obtain the gray value of each pixel in the facial image; record the number of pixels as n;

[0023] Define the set B1{y1, y2 ~ y n} to represent the gray values of the first facial image; where, y1 ~ y n , represents the gray values of the 1st to the nth pixels in the first facial image;

[0024] Process A223: Repeat the process of processing the first facial image to process the 2nd to pth facial images to obtain sets B2 to Bp;

[0025] Process A223: Redefine the BN operation of the simple CNN model, denoted as the BN' operation;

[0026] Process A2231: Assume that the output of the convolutional layer of the simple CNN model is the input picture B, and the gray value set of the input picture B is {x1, x2 ~ x m}; where, m represents the number of pixels in the input picture B, and x1 ~ x m , represents the gray values of the 1st to the mth pixels in the input picture B;

[0027] Furthermore, the working process of the feature comparison module is as follows:

[0028] Process B1: Import the TCMSP database; randomly extract facial images (of qi and blood deficiency) from the TCMSP database as the reference set;

[0029] Process B2: Construct a qi and blood discrimination model; use the CLAHE algorithm to perform image enhancement processing on the reference set, and then divide the reference set into a training set and a test set according to a ratio of 4:1;

[0030] Process B3: Define the mean processing formula for the training set and the test set:

[0031] Process B4: Use the facial feature set of the patient as the input of the qi and blood discrimination model, and determine whether there is an output result of the qi and blood discrimination model;

[0032] If there is, it means that the patient has qi and blood deficiency. Judge the condition according to the output result and enter Process B5;

[0033] If not, it means that the patient's qi and blood are normal, skip Process B5, and the diagnosis result is normal qi and blood;

[0034] Process B5: Use the output result as the query object, and use SQL statements to query the patient's disease name in the TCMSP database; use the disease name as the diagnosis result.

[0035] Process B32: Use the test set as the model input x of the qi and blood discrimination model, and the model output as y, and define the loss function J;

[0036] Process B33: Summarize the definitions and formulas in Processes B31 to B32 as the model constraint conditions of the basic model to obtain the original model;

[0037] Use the test set as the input of the original model and the training set as the training target; continuously iterate the original model until the loss function is minimized to obtain the qi and blood discrimination model.

[0038] A method for discriminating traditional Chinese medicine qi and blood based on computer vision for facial images includes:

[0039] Step S1: Used to obtain the patient's name, mobile phone number and facial image to obtain patient data; establish a patient data set in the format of patient name + patient mobile phone number - patient facial image;

[0040] Step S2: Used to construct an image feature extraction model; use the image feature extraction model to extract the image features in the patient data set to obtain the patient's facial feature set;

[0041] Step S3: Obtain a set of traditional Chinese medicine (TCM) facial images; use the set of TCM facial images as a test set to construct a qi and blood discrimination model; use the qi and blood discrimination model to analyze the facial feature set and obtain the diagnosis result of the patient.

[0042] Step S4: According to the name and mobile phone number of the patient, feedback the diagnosis result to the corresponding patient.

[0043] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0044] Quick feedback: With the aid of computer vision technology, the system of the present invention can complete the processing and analysis of facial images in a short time and quickly give the judgment result of the qi and blood state.

[0045] Enhanced objectivity: Compared with the subjective judgment of traditional TCM face diagnosis, the data analysis results provided by the present invention are more objective, reducing the interference of human factors.

[0046] Improved convenience: Patients only need to take a facial image to conduct qi and blood analysis. The operation is simple and easy to popularize, which helps to promote the modernization and scientific process of TCM diagnosis technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] By reading the following detailed description of non-limiting embodiments with reference to the accompanying drawings, other features, objects, and advantages of the present invention will become more apparent:

[0048] Figure 1 It is a schematic diagram of the system of the present invention;

[0049] Figure 2 It is a schematic diagram of the method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0050] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0051] Embodiment 1

[0052] Please refer to Figure 1 , a TCM qi and blood discrimination system based on computer vision for facial images includes: an image acquisition module, a facial extraction module, a facial comparison module, a user interaction module, a database, and a server; among them, the image acquisition module, the facial extraction module, the facial comparison module, and the user interaction module are respectively connected to the database and the server.

[0053] Image acquisition module: used to obtain the name, mobile phone number, and facial image of the patient to obtain patient data; establish a patient data set in the format of patient name + patient mobile phone number - patient facial image.

[0054] Feature extraction module: used to construct an image feature extraction model; using the image feature extraction model, extract the image features in the patient dataset to obtain the facial feature set of the patient;

[0055] Process A: The working process of the feature extraction module is as follows:

[0056] Process A1: Extract the facial image of the patient; use the OpenCV library function to process the facial image and convert the image data into vector data to obtain the facial vector;

[0057] Process A2: Use the simple SNN model as the basic model to construct an image feature extraction model; define the constraint conditions for the first extraction and the second extraction of facial features;

[0058] Process A21: Define the constraint conditions for the first extraction of facial features:

[0059] Process A211: Assume that the (initial) first dataset contains N face images, represent all the face images in the form of vectors, denoted as {L1, L2 ∼ L N}; where, L1 ∼ L N represents the vector representation of all the face images in the (initial) first dataset; calculate the average value of L1 ∼ L N , denoted as ψ;

[0060] Process A212: Define the difference calculation formula:

[0061] φ i = L i - ψ; where, i represents 1 ∼ N; φ i represents the difference of the initial dataset in the i-th face image;

[0062] Substitute L1 ∼ L N into the difference calculation formula to calculate the corresponding differences φ1 ∼ φ N ; N ;

[0063] Process A213: Extract mutually orthogonal vectors from L1 ∼ L N , denoted as candidate vectors; count the number of candidate vectors, denoted as z, and denote the candidate vectors as λ1 ∼ λ z ;

[0064] Process A214: Define the unit vector discriminant:

[0065] where, i represents 1 ∼ z, λ i represents the i-th candidate vector; T represents the transpose, represents the transpose of λ i ;

[0066] Substitute φ1 to φ N into the unit vector discriminant, extract the candidate vectors that satisfy the unit vector discriminant as the eigenvalues of the initial dataset; count the number of eigenvalues, denoted as S; denote the eigenvalues as μ1 to μ S ;

[0067] Process A215: Define the weight calculation formula:

[0068] where i represents 1 to S, μ i represents the i-th eigenvalue, ω i represents the weight corresponding to the i-th eigenvalue; T represents the transpose, represents the transpose of μ i ;

[0069] Process A22: Define the constraints for secondary extraction of facial features;

[0070] Process A221: Assume that the (initial) secondary dataset contains p face images;

[0071] Process A222: Process the first face image; Use the image function in the OpenCV library to process the first face image to obtain the grayscale value of each pixel in the face image; Denote the number of pixels as n;

[0072] Define the set B1{y1, y2 to y n} to represent the grayscale values of the first face image; where, y1 to y n , represent the grayscale values of the 1st to the nth pixels in the first face image;

[0073] Process A223: Repeat the process of processing the first face image to process the 2nd to pth face images to obtain sets B2 to Bp;

[0074] Process A223: Redefine the BN operation of the simple CNN model, denoted as the BN' operation;

[0075] Process A2231: Assume that the output of the convolutional layer of the simple CNN model is the input image B, and the grayscale set of the input image B is {x1, x2 to x m}; where, m represents the number of pixels in the input image B, x1 to x m , represent the grayscale values of the 1st to the mth pixels in the input image B;

[0076] Process A2232: The process of performing the BN' operation on any input image B is as follows:

[0077] Calculate the mean μB of the elements in the set B,

[0078] Calculate the variance σB of the elements in set B 2 ,

[0079] Process A2233: Standardize the elements in set B to obtain set B'; the elements in set B' are

[0080] Calculate x1 to x m Obtain of The calculation formula is as follows:

[0081]

[0082] Process A3: Back up the facial vector, and according to the constraints of the first extraction and the second extraction of facial features, perform the second extraction and summary of the facial vector to obtain the facial feature set of the patient, and send it to the feature comparison module.

[0083] Feature comparison module: Used to obtain the set of traditional Chinese medicine human face pictures; use the set of traditional Chinese medicine human face pictures as the test set to construct a qi and blood discrimination model; use the qi and blood discrimination model to analyze the facial feature set to obtain the diagnosis result of the patient;

[0084] Process B: The working process of the feature comparison module is as follows:

[0085] Process B1: Import the TCMSP database (Traditional Chinese Medicine Systems Pharmacology Database and Analysis Platform, website: https: / / ol d.tcmsp-e.com / tcmsp.php); randomly extract the human face images in the TCMSP database (with qi and blood deficiency) as the reference set;

[0086] Process B2: Construct a qi and blood discrimination model; use the CLAHE algorithm to perform image enhancement processing on the reference set, and then divide the reference set into a training set and a test set according to a ratio of 4:1;

[0087] Process B3: Define the mean processing formula for the training set and the test set:

[0088] Process B31: Mean processing formula 1:

[0089]

[0090] Mean processing formula 2:

[0091]

[0092] The R, G, and B values are respectively: the RGB values corresponding to any random pixel point on any picture in the training set and the test set; R mij , G mij and B mijDenote: the RGB value of the pixel at the (i, j)-th position of any m-th image sample in the training set and the test set;

[0093] Process B32: Use the test set as the model input x of the qi and blood discrimination model, and the model output as y. Define the loss function J:

[0094]

[0095] where N represents the number of iterations (i.e., batch-size) for each model training;

[0096] x i and y i respectively represent the model input and model output when the initial model for medicinal material recognition is iterated i times; w represents the weight, and f(w, xi) represents the weight of the model input xi when the initial model for medicinal material recognition is iterated i times;

[0097] R represents the regularization term, and λ represents the weight controlling the proportion of the regularization term;

[0098] L represents the cross-entropy loss function, and the cross-entropy loss function L:

[0099] where p ij = f(w, x i );

[0100] The regularization term R:

[0101] where k is the number of weights, and wk represents the weight corresponding to the weight w;

[0102] Process B33: Summarize the definitions and formulas in Process B31 to Process B32 as the model constraint conditions of the basic model to obtain the original model;

[0103] Use the test set as the input of the original model and the training set as the training target; continuously iterate the original model until the loss function is minimized to obtain the qi and blood discrimination model;

[0104] Process B4: Use the facial feature set of the patient as the input of the qi and blood discrimination model, and determine whether there is an output result of the qi and blood discrimination model;

[0105] If there is, it means that the patient has qi and blood deficiency. Judge the condition according to the output result and enter Process B5;

[0106] If not, it means that the patient's qi and blood are normal, skip Process B5, and the diagnosis result is normal qi and blood;

[0107] Process B5: Use the output result as the query object, and use SQL statements to query the patient's disease name in the TCMSP database; regard the disease name as the diagnosis result.

[0108] Patient interaction module: According to the patient's name and mobile phone number, feedback the diagnosis result to the corresponding patient.

[0109] Embodiment 2

[0110] Please refer to Figure 2 , a method for discriminating traditional Chinese medicine qi and blood based on computer vision of facial images includes

[0111] Step S1: Used to obtain the patient's name, mobile phone number and facial image to obtain patient data; establish a patient data set in the format of patient name + patient mobile phone number - patient facial image;

[0112] The working process of the feature extraction module is as follows:

[0113] Extract the patient's facial image; use the OpenCV library function to process the facial image, convert the image data into vector data, and obtain the facial vector;

[0114] Use a simple SNN model as the basic model to construct an image feature extraction model; define the constraint conditions for the first extraction and the second extraction of facial features;

[0115] Define the constraint conditions for the first extraction of facial features:

[0116] Suppose the first data set contains N face images, and all face images are represented in the form of vectors, denoted as {L1, L2~L N}; among them, L1~L N represents the vector representation of all face images in the (initial) first data set; calculate the average value of L1~L N , denoted as ψ;

[0117] Define the difference calculation formula:

[0118] φ i =L i -ψ; where, i represents 1~N; φ i represents the difference of the initial data set in the i-th face image;

[0119] Substitute L1~L N into the difference calculation formula, and calculate the corresponding differences φ1~φ N ; N ;

[0120] Among L1~L NExtract mutually orthogonal vectors, denoted as alternative vectors; count the number of alternative vectors, denoted as z, and denote the alternative vectors as λ1 to λ z ;

[0121] Define the unit vector discriminant:

[0122] where i represents 1 to z, and λ i represents the i-th alternative vector; T represents the transpose, represents the transpose of λ i ;

[0123] Substitute φ1 to φ N into the unit vector discriminant, and extract the alternative vectors that satisfy the unit vector discriminant as the eigenvalues of the initial data set; count the number of eigenvalues, denoted as S; denote the eigenvalues as μ1 to μ S ;

[0124] Define the weight calculation formula:

[0125] where i represents 1 to S, μ i represents the i-th eigenvalue, and ω i represents the weight corresponding to the i-th eigenvalue; T represents the transpose, represents the transpose of μ i ;

[0126] Define the constraint conditions for secondary extraction of facial features;

[0127] Suppose the secondary data set contains p face images;

[0128] Process the first face image; use the image function in the OpenCV library to process the first face image to obtain the gray values of each pixel in the face image; record the number of pixels as n;

[0129] Define the set B1{y1, y2 to y n} to represent the gray values of the first face image; where, y1 to y n , represent the gray values of the 1st to the nth pixels in the first face image;

[0130] Repeat the process of processing the first face image to process the 2nd to pth face images to obtain sets B2 to Bp;

[0131] Redefine the BN operation of the simple CNN model, denoted as the BN' operation;

[0132] Suppose the output of the convolutional layer of the simple CNN model is the input image B, and the gray value set of the input image B is {x1, x2 to x m}; where, m represents the number of pixels in the input image B, and x1 to xm representing the grayscale values of the 1st to the mth pixels in the input image B;

[0133] The process of performing the BN′ operation on any input image B is as follows:

[0134] Calculate the mean μB of the elements in set B,

[0135] Calculate the variance σB of the elements in set B 2 ,

[0136] Normalize the elements in set B to obtain set B′; the elements in set B′ are

[0137] Calculate x1 to x m Obtain of The calculation formula is as follows:

[0138]

[0139] Back up the facial vector, and according to the constraint conditions of the first extraction and the second extraction of facial features, perform the second extraction and summary of the facial vector to obtain the facial feature set of the patient, and send it to the feature comparison module.

[0140] Step S2: Used to construct an image feature extraction model; use the image feature extraction model to extract the image features in the patient dataset to obtain the facial feature set of the patient;

[0141] The working process of the feature comparison module is as follows:

[0142] Import the TCMSP database; randomly extract the face images in the TCMSP database as the reference set;

[0143] Construct a qi and blood discrimination model; use the CLAHE algorithm to perform image enhancement processing on the reference set, and then divide the reference set into a training set and a test set according to a ratio of 4:1;

[0144] Define the mean processing formula for the training set and the test set:

[0145] Mean processing formula 1:

[0146]

[0147] Mean processing formula 2:

[0148]

[0149] The R, G, and B values are respectively the RGB values corresponding to randomly selected pixels on any picture in the training set and the test set; R mij , G mij and B mij represent the RGB values of the (i, j)-th pixel of the m-th picture sample in the training set and the test set;

[0150] Take the test set as the model input x of the qi and blood discrimination model, and the model output as y, and define the loss function J:

[0151]

[0152] where N represents the number of iterations (for each model training), that is, batch-size;

[0153] x i and y i respectively represent the model input and model output when the initial model for medicinal material recognition is iterated i times; w represents the weight, and f(w, xi) represents the weight of the model input xi when the initial model for medicinal material recognition is iterated i times;

[0154] R represents the regularization term, and λ represents the weight controlling the proportion of the regularization term;

[0155] L represents the cross-entropy loss function, and the cross-entropy loss function L:

[0156] where p ij = f(w, x i );

[0157] The regularization term R:

[0158] where k is the number of weights, and wk represents the weight corresponding to the weight w;

[0159] Summarize the data as the model constraint conditions of the basic model to obtain the original model;

[0160] Take the test set as the input of the original model and the training set as the training target; continuously iterate the original model until the loss function is minimized to obtain the qi and blood discrimination model;

[0161] Take the facial feature set of the patient as the input of the qi and blood discrimination model, and determine whether there is an output result of the qi and blood discrimination model;

[0162] If there is, it means that the patient has qi and blood deficiency, and judge the condition according to the output result;

[0163] If not, it means that the patient's qi and blood are normal, and the diagnosis result is qi and blood normal;

[0164] Use the output result as the query object and use SQL statements to query the patient's disease name in the TCMSP database; take the disease name as the diagnosis result.

[0165] Step S3: Used to obtain a set of traditional Chinese medicine facial images; use the set of traditional Chinese medicine facial images as the test set to construct a qi and blood discrimination model; use the qi and blood discrimination model to analyze the facial feature set to obtain the diagnosis result of the patient.

[0166] Step S4: Feed back the diagnosis result to the corresponding patient according to the patient's name and mobile phone number.

[0167] The above formulas are all dimensionless and take their numerical calculations. The formulas are obtained by collecting a large amount of data for software simulation to get a formula closest to the actual situation. The preset parameters in the formulas are set by those skilled in the art according to the actual situation. For example, if there are weight coefficients and proportionality coefficients, the set values are for quantifying each parameter to obtain a specific numerical value for subsequent comparison. Regarding the magnitudes of the weight coefficients and proportionality coefficients, as long as they do not affect the proportional relationship between the parameters and the quantified values, it is fine.

[0168] Finally, it should be noted that: the above embodiments are only specific embodiments of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited to this. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the technical field of the present invention can still modify the technical solutions recorded in the foregoing embodiments or easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A facial image identification system for Traditional Chinese Medicine Qi and Blood based on computer vision, characterized by: The discrimination system includes: Image acquisition module: used to obtain the patient's name, mobile phone number and facial image to obtain patient data; Feature extraction module: used to build an image feature extraction model; use the image feature extraction model to extract image features from the patient dataset and obtain the patient's facial feature set; Feature comparison module: used to obtain a set of TCM facial images; using the TCM facial image set as a test set, construct a Qi and blood discrimination model; using the Qi and blood discrimination model, analyze the facial feature set to obtain the patient's diagnosis result; Patient interaction module: Feedback the diagnosis results to the corresponding patient based on the patient's name and mobile phone number; The feature extraction module works as follows: A1: Extract the patient's facial image; use OpenCV library functions to process the facial image, convert the image data into vector data, and obtain the facial vector; A2: Use a simple CNN model as the base model to build an image feature extraction model. Define the constraints for primary and secondary extraction of facial features. This includes: A21: Define the constraints for extracting facial features: A211: Assume that a dataset contains N face images, and all face images are represented in the form of vectors, denoted as {L1, L2 ~ L N }; Calculate L1~L N The average value of ; A212: Define the difference calculation formula: ; Wherein, i represents 1 to N; Represents the difference value of the initial data set in the i-th face image; L1~L N Substitute into the difference calculation formula to calculate L1~L N The corresponding difference φ1~φ N ; A213: between L1 and L N Extract mutually orthogonal vectors from the equation and record them as candidate vectors; count the number of candidate vectors and record them as z, and record the candidate vectors as λ1~λ z ; A214: Define the unit vector discriminant: ; Where i represents 1 to z, represents the i-th candidate vector; T represents transpose, express The transpose of φ1~φ N Substitute into the unit vector discriminant, extract the candidate vector that satisfies the unit vector discriminant, and use it as the eigenvalue of the initial data set; count the number of eigenvalues, denoted as S; denoted as μ1~μ S ; A215: Define the weight calculation formula: ; Where i represents 1~S, μ i represents the i-th eigenvalue, ω i represents the weight corresponding to the i-th eigenvalue; T represents transposition, represents μ i The transpose of A22: Define the constraints for secondary extraction of facial features; A221: Assume that the secondary dataset contains p face images; A222: Process the first face image; use the image function in the OpenCV library to process the first face image and obtain the grayscale value of each pixel in the face image; record the number of pixels as n; Define the set B1{y1, y2~y n } represents the grayscale value of the first face image; where y1~y n , represents the grayscale value of the 1st to nth pixels in the first face image; A223: Repeat the process of the first face image and process the second to p face images to obtain sets B2 to Bp; A224: Redefine the BN operation of the simple CNN model, denoted as BN´ operation; A3: Back up the facial vectors, perform secondary extraction and aggregation on the facial vectors according to the constraints of primary and secondary extraction of facial features, obtain the patient's facial feature set, and send it to the feature comparison module.

2. A computer vision-based facial image identification system for Traditional Chinese Medicine Qi and Blood according to claim 1, characterized in that: The feature comparison module works as follows: B1: Import the TCMSP database; randomly extract face images from the TCMSP database as a reference set; B2: Construct a Qi and blood discrimination model; use the CLAHE algorithm to perform image enhancement processing on the reference set, and then divide the reference set into a training set and a test set in a ratio of 4:1; B3: Define the averaging formula for the training set and test set: B4: Use the patient's facial feature set as the input of the Qi and Blood discrimination model to determine whether the Qi and Blood discrimination model has an output result; If yes, it means the patient has insufficient Qi and blood. Determine the condition based on the output results and proceed to B5. If not, it means the patient's Qi and blood are normal, skip B5, and the diagnosis result is normal Qi and blood; B5: Use the output result as the query object and use SQL statements to query the patient's disease name in the TCMSP database; use the disease name as the diagnosis result.

3. A computer vision-based facial image identification system for Traditional Chinese Medicine Qi and Blood according to claim 2, characterized in that: The follow-up work for B3 is as follows: The test set is used as the model input x of the Qi and blood discrimination model, the model output is used as y, and the loss function J is defined; B33: Summarize the model constraints of B31 to B32 as the basic model to obtain the original model; The test set is used as the original model input and the training set is used as the training target; the original model is continuously iterated until the loss function is minimized to obtain the Qi and blood discrimination model.

Citation Information

Patent Citations

  • Health state diagnosis system based on facial image

    CN110459304A

  • Qi and blood state analysis system and method based on facial recognition

    CN116530981A