Classifier training method, image analysis method, apparatus, device, and storage medium

By preprocessing and calculating parameters of tongue images, a tongue image classifier is trained, which solves the problem of poor tongue image acquisition quality and improves the accuracy of tongue diagnosis.

CN116468944BActive Publication Date: 2026-05-29PING AN TECH (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2023-04-12
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Due to environmental factors and equipment performance limitations, the quality of tongue image acquisition is poor, resulting in blurry images and affecting the accuracy of tongue diagnosis.

Method used

By acquiring a training sample set of clear and blurry tongue images, image preprocessing is performed, and generalized Gaussian distribution, asymmetric generalized Gaussian distribution, and motion blur parameters are calculated. A support vector machine is then used to train a tongue image classifier to classify clear and blurry images.

Benefits of technology

It improves the accuracy of tongue diagnosis by classifying clear and blurry tongue images, thereby enhancing the accuracy of image analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116468944B_ABST
    Figure CN116468944B_ABST
Patent Text Reader

Abstract

The application provides a classifier training method, an image analysis method, a device, equipment and a storage medium, wherein the classifier training method is used for training of a tongue image classifier, and the classifier training method comprises the following steps: obtaining a training sample set, the training sample set comprising a first training sample set and a second training sample set, the first training sample set comprising a first preset number of clear tongue images, and the second training sample set comprising a second preset number of blurred tongue images; performing image preprocessing on the clear tongue images and the blurred tongue images respectively to obtain a first image and a second image, the pixels of the first image following a Gaussian distribution, and the pixels of the second image not following the Gaussian distribution; and calculating generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters and motion blur parameters of the first image and the second image to obtain a training data set. The tongue image classifier obtained through the classifier training method can classify clear tongue images and blurred tongue images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a classifier training method, image analysis method, apparatus, device, and storage medium. Technical Background

[0002] Tongue diagnosis is a key component of "inspection" in Traditional Chinese Medicine (TCM) and is a traditional diagnostic method with distinctive TCM characteristics, holding significant reference value in TCM diagnosis and treatment. Applying image processing technology to establish objective and quantifiable methods for tongue diagnosis is crucial for achieving objectivity and modernization in TCM tongue diagnosis. However, such products typically require capturing tongue images using a built-in camera under specific conditions.

[0003] During the acquisition of tongue images, environmental factors, the performance of the device's built-in camera, and the user's shooting method can all interfere with the acquired images. Poor-quality tongue images, being too blurry, lose a lot of image information, impacting subsequent image processing and analysis, as well as the quantitative analysis of indicators such as tongue color and coating, thus affecting the accuracy of the analysis. Summary of the Invention

[0004] Embodiments of this application provide a classifier training method, an image analysis method, an apparatus, a device, and a storage medium, aimed at classifying clear tongue images and blurry tongue images to improve the accuracy of tongue diagnosis.

[0005] In a first aspect, this application provides a classifier training method for training a tongue image classifier, the classifier training method comprising the following steps:

[0006] Obtain a training sample set, which includes a first training sample set and a second training sample set. The first training sample set includes a first preset number of clear tongue images, and the second training sample set includes a second preset number of blurred tongue images.

[0007] The clear tongue image and the blurred tongue image are preprocessed respectively to obtain a first image and a second image. The pixels of the first image follow a Gaussian distribution, while the pixels of the second image do not follow a Gaussian distribution.

[0008] Calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the training dataset;

[0009] A tongue image classifier is obtained by training the training dataset using a support vector machine.

[0010] In one possible implementation, the training dataset includes a first training dataset and a second training dataset, and the calculation of the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image includes:

[0011] Calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the first training dataset;

[0012] After adjusting the pixels of the first image and the second image to be the first pixel, the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image are calculated to obtain the second training dataset.

[0013] In one possible implementation, prior to image preprocessing of the clear tongue image and the blurred tongue image, the method further includes:

[0014] The tongue contours of the clear tongue image and the blurred tongue image are obtained using a tongue segmentation model.

[0015] The third image and the fourth image are obtained by cropping the inscribed rectangle of the tongue outline of the clear tongue image and the inscribed rectangle of the tongue outline of the blurred tongue image, respectively.

[0016] In one possible implementation, after cropping the inscribed rectangles of the tongue outlines of the clear tongue image and the blurred tongue image, the method further includes:

[0017] Adjust the pixels of the third image to the second pixel so that the second pixel is adapted to the acquisition scene of the clear tongue image;

[0018] Adjust the pixels of the fourth image to the third pixel so that the third pixel is adapted to the acquisition scene of the blurred tongue image.

[0019] In one possible implementation, the width of the second pixel is 468 pixels, and the aspect ratio of the second pixel is the same as that of the fourth pixel, wherein the fourth pixel is a pixel of the third image;

[0020] The width of the third pixel is 468 pixels, and the aspect ratio of the third pixel is the same as that of the fifth pixel. The fifth pixel is a pixel of the fourth image.

[0021] In one possible implementation, calculating the motion blur parameters of the first image and the second image includes:

[0022] Construct transformation matrices for different motion directions;

[0023] Motion fuzzy kernel matrices for different motion directions are constructed using the transformation matrices for the different motion directions;

[0024] The clear tongue image and the blurred tongue image are convolved using the motion blur kernel matrix to obtain the first motion-blurred tongue image and the second motion-blurred tongue image with different motion directions;

[0025] Calculate the structural similarity parameters SSIM1 and SSIM2 for the different motion directions, where SSIM1 is the structural similarity parameter between the clear tongue image and the first motion-blurred tongue image, and SSIM2 is the structural similarity parameter between the blurred tongue image and the second motion-blurred tongue image.

[0026] The minimum values ​​of SSIM1 and SSIM2 calculated from the different motion directions are selected as the motion blur parameters of the first image and the second image, respectively.

[0027] Secondly, this application also provides an image analysis method for classifying clear tongue images and blurry tongue images, the image analysis method comprising:

[0028] Obtain an image of the tongue to be diagnosed;

[0029] The tongue image to be diagnosed is input into a tongue image classifier for analysis to determine the category of the tongue image to be diagnosed, wherein the tongue image classifier is trained based on the aforementioned classifier training method.

[0030] Thirdly, this application also provides a classifier training device for training a tongue image classifier, the classifier training device comprising:

[0031] The acquisition module is used to acquire the training sample set;

[0032] The processing module is used to perform image preprocessing on the clear tongue image and the blurred tongue image to obtain a first image and a second image;

[0033] The calculation module calculates the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the training dataset.

[0034] The training module is used to train the training dataset based on a support vector machine to obtain a tongue image classifier.

[0035] Fourthly, this application also provides a computer device, the computer device including a processor, a memory and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements any of the classifier training methods or the image analysis methods described above.

[0036] Fourthly, this application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by the processor, it implements any of the classifier training methods or the image analysis methods described above.

[0037] This application discloses a classifier training method, image analysis method, apparatus, device, and storage medium. The classifier training method first preprocesses a clear tongue image and a blurred tongue image to obtain a first image and a second image, ensuring that the pixels of the first image follow a Gaussian distribution while the pixels of the second image do not. Then, it calculates the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first and second images to obtain a training dataset. Finally, it trains the training dataset using a support vector machine to obtain a tongue image classifier. The tongue image classifier obtained using this classifier training method can classify both clear and blurred tongue images, thereby improving the accuracy of tongue diagnosis. Attached Figure Description

[0038] To more clearly illustrate the processing scheme of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 A flowchart illustrating the classifier training method provided in this application embodiment;

[0040] Figure 2 A schematic block diagram of a classifier training apparatus provided in the embodiments of this application;

[0041] Figure 3 A schematic block diagram of yet another classifier training device provided in an embodiment of this application;

[0042] Figure 4 A schematic block diagram of another classifier training device provided in the embodiments of this application;

[0043] Figure 5 A schematic block diagram of another classifier training device provided in the embodiments of this application;

[0044] Figure 6 A schematic block diagram of an image analysis apparatus provided in an embodiment of this application;

[0045] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0046] The processing schemes in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0047] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0048] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0049] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0050] This application provides a classifier training method, an image analysis method, an apparatus, a device, and a storage medium. The classifier training method and the image analysis method can be applied to electronic devices, including but not limited to servers, smartphones, tablets, desktop computers, in-vehicle computers, smart TVs, and wearable devices.

[0051] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features described herein can be combined with each other.

[0052] Please see Figure 1 , Figure 1 This is a flowchart illustrating the classifier training method provided in an embodiment of this application.

[0053] like Figure 1The classifier training method includes steps S100 to S400.

[0054] Step S100: Obtain a training sample set, which includes a first training sample set and a second training sample set. The first training sample set includes a first preset number of clear tongue images, and the second training sample set includes a second preset number of blurred tongue images.

[0055] The first and second sample sets were obtained by manually screening a large number of tongue images to classify them into clear and blurry tongue images.

[0056] Step S200: Perform image preprocessing on the clear tongue image and the blurred tongue image respectively to obtain a first image and a second image. The pixels of the first image follow a Gaussian distribution, while the pixels of the second image do not follow a Gaussian distribution.

[0057] Understandably, in step S200, all clear tongue images in the first sample set are preprocessed to obtain a first preset number of first images, and all blurred tongue images in the second sample set are preprocessed to obtain a second preset number of second images. The first image's pixels follow a Gaussian distribution, meaning that any pixel in the first image follows a Gaussian distribution. The second image's pixels do not follow a Gaussian distribution, meaning that any pixel in the second image does not follow a Gaussian distribution.

[0058] Specifically, the clear tongue image and the blurred tongue image are preprocessed to obtain a first image and a second image, respectively, including steps S210 to S220.

[0059] Step S210: Perform grayscale processing on the clear tongue image and the blurred tongue image respectively to obtain the fifth image and the sixth image.

[0060] Understandably, in step S210, all clear tongue images in the first sample set are processed in grayscale to obtain a first preset number of fifth images, and all blurred tongue images in the second sample set are processed in grayscale to obtain a second preset number of sixth images.

[0061] Step S220: Perform mean contrast normalization (MSCN) on the fifth image and the sixth image respectively using formula (1) to obtain the first image and the second image.

[0062] (1)

[0063] Where i and j are pixel coordinates, i∈1,2,3,…,N, j∈1,2,3,…,M; M and N are the length and width of the image, respectively;

[0064] C=1 to prevent the denominator from being zero;

[0065] It is the original image;

[0066] It is the image after mean contrast normalization, i.e., the MSCN image;

[0067] To The result of Gaussian filtering of the pixels is calculated by formula (2);

[0068] (2)

[0069] for The standard deviation of the pixels is calculated using formula (3):

[0070] (3)

[0071] Where W is the Gaussian convolution kernel.

[0072] Understandably, in this application In step S220, the fifth image is processed by MSCN to obtain the first image, and the sixth image is processed by MSCN to obtain the second image. Both the first image and the second image are MSCN images.

[0073] In some embodiments, steps S10 to S20 are included before step S200. This embodiment further improves the accuracy of the tongue image classifier in classifying clear and blurry tongue images.

[0074] Step S10: Obtain the tongue outline of the clear tongue image and the tongue outline of the blurred tongue image through the tongue segmentation model.

[0075] Understandably, because the acquisition of tongue images may also capture images of lips, teeth, face, clothing, and accessories, the acquired tongue images contain a lot of texture. These textures can significantly affect the judgment of the blurriness of the tongue image, resulting in inaccurate classification of clear and blurry tongue images by the tongue image classifier. To solve this problem, a tongue segmentation model can be used before step S200 to obtain the tongue contours of the clear tongue image and the blurry tongue image.

[0076] Step S20: Extract the inscribed rectangle of the tongue outline of the clear tongue image and the inscribed rectangle of the tongue outline of the blurred tongue image respectively to obtain the third image and the fourth image.

[0077] Understandably, in step S20, the third image is obtained by cropping the inscribed rectangle of the tongue outline of the clear tongue image, and the fourth image is obtained by cropping the inscribed rectangle of the tongue outline of the blurred tongue image.

[0078] In some embodiments, step S30 is included after step S20. This embodiment further improves the accuracy of the tongue image classifier in classifying clear and blurry tongue images.

[0079] Step S30: Adjust the pixels of the third image to the second pixel so that the second pixel is adapted to the acquisition device of the clear tongue image, and adjust the pixels of the fourth image to the third pixel so that the third pixel is adapted to the acquisition device of the blurry tongue image.

[0080] It should be noted that the device used to capture images of the tongue can be any electronic device with a camera, such as a mobile phone, tablet, laptop, or desktop computer.

[0081] Understandably, due to the processing in steps S10 to S30, the pixels of the third image may differ from those of the clear tongue image, and the pixels of the fourth image may differ from those of the blurred tongue image. In other words, the pixels of the third image may be mismatched with the acquisition device for the clear tongue image, and the pixels of the fourth image may be mismatched with the acquisition device for the blurred tongue image, resulting in inaccurate classification of the clear and blurred tongue images by the tongue image classifier. To solve this problem, the pixels of the third image can be adjusted to be second pixels, making the second pixels compatible with the acquisition device for the clear tongue image, and the pixels of the fourth image can be adjusted to be third pixels, making the third pixels compatible with the acquisition device for the blurred tongue image.

[0082] Since mobile phones are the most commonly used devices for capturing tongue images in real life, in some embodiments, the second pixel is 468 pixels wide, and its aspect ratio is the same as that of the fourth pixel, which is a pixel of the third image; the third pixel is 468 pixels wide, and its aspect ratio is the same as that of the fifth pixel, which is a pixel of the fourth image. This embodiment adapts the second and third pixels to the mobile phone.

[0083] Understandably, the height of the second pixel or the height of the third pixel in this embodiment can be calculated using formula (4).

[0084] (4)

[0085] in, The aspect ratio of the fourth pixel or the aspect ratio of the fifth pixel. The height of the second pixel or the third pixel.

[0086] Step S300: Calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the training dataset.

[0087] It should be noted that this application does not limit the calculation order of the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion fuzzy parameters.

[0088] The specific calculation methods for the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters are as follows:

[0089] 1. Calculation of parameters of the generalized Gaussian distribution:

[0090] The parameters of the generalized Gaussian distribution (GGD) are defined as follows:

[0091] (5)

[0092] in,

[0093] (6)

[0094] For the gamma function:

[0095] (7)

[0096] GGD consists of two parameters, α and σ. Control the decay rate, parameters To control for variance, the methods for calculating α and σ are as follows:

[0097] a. Calculate the estimated values ​​of the mean and variance:

[0098] (8)

[0099] (9)

[0100] The value of is the value of σ;

[0101] b. Calculate the estimated value of the corrected average of the absolute values ​​using formula (10):

[0102] (10)

[0103] c. Let The estimated value is :

[0104] (11)

[0105] d. Determine α using a search and matching method. The specific method is as follows:

[0106] Given a candidate α, define the search interval for α, such as letting It takes values ​​in increments of 0.001 within the range of 0.2-10;

[0107] Calculate the value corresponding to each α value using formula (12). ;

[0108] (12)

[0109] Calculate each Value and estimated value The distance is such that the minimum distance is selected as the value of α.

[0110] 2. Calculation of parameters for the asymmetric generalized Gaussian distribution:

[0111] The image processed by MSCN is shifted by one pixel in each of the four directions: left, right, lower left, and lower right. The four shifted images are then multiplied by the MSCN-processed image to obtain the following four image matrices: H, V, D1, and D2.

[0112]

[0113]

[0114]

[0115]

[0116] Understandably, the image processed by the MSCN includes the first image and the second image.

[0117] Asymmetric generalized Gaussian distribution parameter estimation is performed on H, V, D1, and D2.

[0118] The parameters of the asymmetric generalized Gaussian distribution (AGGD) are defined as follows:

[0119] (13)

[0120] in,

[0121] , (14)

[0122] AGGD includes , , and Three parameters, among which, parameter Control the shape of the distribution. Control the degree of diffusion on the left. Control the degree of diffusion on the right. For the defined feature parameters, calculate , , and The method is as follows:

[0123] a. Calculation , The estimated value:

[0124] (15)

[0125] (16)

[0126] , That is, the image corresponding to AGGD , parameter;

[0127] b. Calculation The estimated value:

[0128] (17)

[0129] c. Calculation The estimated value:

[0130] (18)

[0131] d. Let The estimated value is :

[0132] (19)

[0133] e. Determine using search and matching methods The specific method is as follows:

[0134] Give candidates ,set up The search interval, such as let It takes values ​​in increments of 0.001 within the range of 0.2-10;

[0135] Calculate each using formula (20) value corresponding ;

[0136] Calculate each Value and estimated value The distance, select the minimum distance corresponding to The value is... The value;

[0137]

[0138] f. Calculate the parameters using formula (21) :

[0139] (twenty one)

[0140] By calculating H, V, D1, and D2 respectively... , , ]4 parameters, resulting in a total of 16 parameters.

[0141] 3. Calculation of motion fuzzy parameters:

[0142] a. Construct transformation matrices for different motion directions;

[0143] (twenty two)

[0144] Wherein, θ represents different directions of motion, and preferably, θ takes the values ​​of 0°, 15°, 30°, 45°, 60°, 75°, 90°, 105°, 120°, 135°, 150°, and 165° respectively;

[0145] b. Construct motion fuzzy kernel matrices for different motion directions using the transformation matrices for the different motion directions;

[0146] Specifically, a 12*12 identity matrix is ​​first generated, and then the identity matrix is ​​subjected to affine transformation using the transformation matrix M of the different motion directions, followed by normalization, to obtain the motion fuzzy kernel matrix of the different motion directions.

[0147] c. Convolve the clear tongue image and the blurred tongue image using the motion blur kernel matrix to obtain the first motion-blurred tongue image and the second motion-blurred tongue image with different motion directions;

[0148] Understandably, the first blurred tongue image is obtained by convolving the clear tongue image, and the second motion-blurred image is obtained by convolving the blurred tongue image.

[0149] d. Calculate the structural similarity parameters SSIM1 and SSIM2 for the different motion directions, where SSIM1 is the structural similarity parameter between the clear tongue image and the first motion-blurred tongue image, and SSIM2 is the structural similarity parameter between the blurred tongue image and the second motion-blurred tongue image.

[0150] Specifically, SSIM1 and SSIM2 are calculated using formula (23);

[0151] (twenty three)

[0152] in, , These are the mean and variance of the original tongue input region, respectively. , These are the mean and variance of the motion-blurred tongue region, respectively. The covariance is the original tongue input region and the motion-blurred tongue region. for , for ;

[0153] e. Determine the motion blur parameters of the first image and the second image based on the first structural similarity parameter and the second structural similarity parameter. Preferably, the first minimum value of the first structural similarity parameter and the second minimum value of the second structural similarity parameter calculated from different motion directions are selected as the motion blur parameters of the first image and the second image, respectively.

[0154] Understandably, calculating the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image refers to calculating the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of each of the first image and each of the second image, that is, the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of each of the clear tongue images and each of the blurred tongue images. Each tongue image (including clear tongue images and blurred tongue images) includes 19 parameters.

[0155] In some embodiments, the training dataset includes a first training dataset and a second training dataset. The calculation of the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image includes steps S310 to S320. This embodiment further improves the accuracy of the tongue image classifier in classifying clear and blurred tongue images.

[0156] Step S310: Calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the first training dataset.

[0157] Step S320: After adjusting the pixels of the first image and the second image to be the first pixel, calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the second training dataset. Preferably, the second pixel is 200*200 pixels.

[0158] Understandably, in this implementation, each tongue image (including clear tongue images and blurred tongue images) includes 38 parameters. The calculation methods for the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters have been described in detail above and will not be repeated here.

[0159] Step S400: Train the training dataset based on the support vector machine to obtain a tongue image classifier.

[0160] Understandably, the training dataset includes the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters of the clear tongue image, as well as the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters of the blurred tongue image. The tongue image classifier obtained by training the training dataset using a support vector machine can classify clear and blurred tongue images. The tongue image classifier includes a parameter set for the clear tongue image and a parameter set for the blurred tongue image.

[0161] Understandably, the parameter set of the clear tongue image includes a first preset number of the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters of the clear tongue image, and the parameter set of the blurred tongue image includes a second preset number of the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters of the blurred tongue image.

[0162] This application also provides an image analysis method for classifying clear tongue images and blurry tongue images, the image analysis method including steps S11 to S12.

[0163] Step S11: Obtain an image of the tongue to be diagnosed.

[0164] Step S12: Input the tongue image to be diagnosed into a tongue image classifier for analysis to determine the category of the tongue image to be diagnosed, wherein the tongue image classifier is trained by any of the classifier training methods described above.

[0165] Understandably, the categories of tongue images include clear tongue images and blurry tongue images.

[0166] Specifically, step S12 includes steps S121 to S122.

[0167] Step S121: Calculate the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters of the tongue image to be diagnosed.

[0168] The calculation methods for the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion fuzzy parameters have been described in detail previously and will not be repeated here.

[0169] Step S122: Determine the category of the tongue image to be diagnosed based on the clear tongue image parameter set and the blurred tongue image parameter set.

[0170] Understandably, if the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters of the tongue image to be diagnosed belong to the set of parameters for a clear tongue image, the tongue image to be diagnosed is a clear tongue image; if the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters of the tongue image to be diagnosed belong to the set of parameters for a blurred tongue image, the tongue image to be diagnosed is a blurred tongue image.

[0171] Please see Figure 2 , Figure 2 This is a schematic block diagram of a classifier training device 100 provided in an embodiment of this application. The classifier training device 100 is used for training a tongue image classifier, such as... Figure 2 The classifier training device 100 includes an acquisition module 110, a processing module 120, a calculation module 130, and a training module 140.

[0172] Module 110 is used to acquire the training sample set;

[0173] Processing module 120 is used to perform image preprocessing on the clear tongue image and the blurred tongue image to obtain a first image and a second image;

[0174] The calculation module 130 is used to calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the training dataset.

[0175] The training module 140 is used to train the training dataset based on a support vector machine to obtain a tongue image classifier.

[0176] Please see Figure 3 , Figure 3 A schematic block diagram of another classifier training device 100 provided in the embodiments of this application, as shown below. Figure 3 As shown, in some embodiments, the classifier training device 100 further includes a pixel adjustment unit 150.

[0177] The pixel adjustment unit 150 is used to adjust the pixels of the first image and the second image to be the first pixel.

[0178] The pixel adjustment unit is also used to adjust the pixels of the third image to the second pixel.

[0179] The pixel adjustment unit is also used to adjust the pixels of the fourth image to the third pixel.

[0180] Please see Figure 4 , Figure 4 A schematic block diagram of the re-classifier training device 100 provided in the embodiments of this application, as shown below. Figure 4 As shown, in some embodiments, the classifier training device 100 further includes an acquisition module 160 and a capture module 170.

[0181] The acquisition module 160 is used to acquire the tongue outline of the clear tongue image and the tongue outline of the blurred tongue image through a tongue segmentation model.

[0182] The cropping module 170 is used to crop the inscribed rectangle of the tongue outline of the clear tongue image and the inscribed rectangle of the tongue outline of the blurred tongue image, respectively, to obtain the third image and the fourth image.

[0183] Please see Figure 5 , Figure 5 A schematic block diagram of the re-classifier training device 100 provided in the embodiments of this application, as shown below. Figure 5 As shown, in some embodiments, the calculation module 130 includes a construction unit 131, a calculation unit 132, and a selection unit 133.

[0184] The construction unit 131 is used to construct transformation matrices for different motion directions and to construct motion fuzzy kernel matrices for different motion directions using the transformation matrices for different motion directions.

[0185] The calculation unit 132 is used to perform convolution on the clear tongue image and the blurred tongue image using the motion blur kernel matrix, and to calculate the structural similarity parameters SSIM1 and SSIM2 for different motion directions. SSIM1 is the structural similarity parameter between the clear tongue image and the first motion-blurred tongue image, and SSIM2 is the structural similarity parameter between the blurred tongue image and the second motion-blurred tongue image.

[0186] The selection unit 133 is used to select the minimum value of SSIM1 and the minimum value of SSIM2 calculated in different motion directions as the motion blur parameters of the first image and the second image, respectively.

[0187] Please see Figure 6 , Figure 6 This is a schematic block diagram of the image analysis device 200 provided in this application, such as... Figure 6 As shown, the image analysis device 200 includes an acquisition module 210, an analysis module 220, and a determination module 230.

[0188] The acquisition module 210 is used to acquire an image of the tongue to be diagnosed.

[0189] The analysis module 220 is used to input the tongue image to be diagnosed into a tongue image classifier for analysis.

[0190] The determination module 230 is used to determine the category of the tongue image to be diagnosed.

[0191] The tongue image classifier is trained using any of the classifier training methods described in the above embodiments.

[0192] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described device and its various modules and units can be referred to the corresponding processes in the aforementioned classifier training method embodiments and image analysis method embodiments, and will not be repeated here.

[0193] The apparatus provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 7 The computer device 40 shown is running on it.

[0194] Please see Figure 7 , Figure 7The following is a schematic block diagram of the structure of a computer device 40 provided in an embodiment of this application. The computer device 40 includes a processor 41 and a memory 42, which are connected via a system bus 43. The memory 42 may include a non-volatile storage medium and internal memory.

[0195] The non-volatile storage medium can store a computer program. The computer program includes program instructions that, when executed by the processor 41, cause the processor 41 to perform any of the aforementioned classifier training methods and image analysis methods.

[0196] The processor 41 provides computing and control capabilities to support the operation of the entire electronic device.

[0197] The internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor 41, the processor 41 can execute any of the above-mentioned classifier training methods and image analysis methods.

[0198] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device involved in the present application. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0199] It should be understood that processor 41 can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, the general-purpose processor can be a microprocessor or any conventional processor.

[0200] In some embodiments, the processor 41 is used to run a computer program stored in memory to perform the following steps:

[0201] Obtain a training sample set, which includes a first training sample set and a second training sample set. The first training sample set includes a first preset number of clear tongue images, and the second training sample set includes a second preset number of blurred tongue images.

[0202] The clear tongue image and the blurred tongue image are preprocessed respectively to obtain a first image and a second image. The pixels of the first image follow a Gaussian distribution, while the pixels of the second image do not follow a Gaussian distribution.

[0203] Calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the training dataset;

[0204] A tongue image classifier is obtained by training the training dataset using a support vector machine.

[0205] In some implementations, the training dataset includes a first training dataset and a second training dataset. When the processor 41 calculates the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the training dataset, it is used to:

[0206] Calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the first training dataset;

[0207] After adjusting the pixels of the first image and the second image to be the first pixel, the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image are calculated to obtain the second training dataset.

[0208] In some embodiments, before performing image preprocessing on the clear tongue image and the blurred tongue image, the processor 41 is configured to perform the following:

[0209] The tongue contours of the clear tongue image and the blurred tongue image are obtained using a tongue segmentation model.

[0210] The third image and the fourth image are obtained by cropping the inscribed rectangle of the tongue outline of the clear tongue image and the inscribed rectangle of the tongue outline of the blurred tongue image, respectively.

[0211] In some implementations, after the processor 41 implements the inscribed rectangles for cropping the tongue outline of the clear tongue image and the inscribed rectangles for cropping the tongue outline of the blurred tongue image, it is configured to:

[0212] Adjust the pixels of the third image to the second pixel so that the second pixel is adapted to the acquisition device of the clear tongue image;

[0213] Adjust the pixels of the fourth image to the third pixel so that the third pixel is adapted to the acquisition device of the blurred tongue image.

[0214] In some implementations, the processor 41, when calculating the motion blur parameters of the first image and the second image, performs the following:

[0215] Construct transformation matrices for different motion directions;

[0216] Motion fuzzy kernel matrices for different motion directions are constructed using the transformation matrices for the different motion directions;

[0217] The clear tongue image and the blurred tongue image are convolved using the motion blur kernel matrix to obtain the first motion-blurred tongue image and the second motion-blurred tongue image with different motion directions;

[0218] Calculate the structural similarity parameters SSIM1 and SSIM2 for the different motion directions, where SSIM1 is the structural similarity parameter between the clear tongue image and the first motion-blurred tongue image, and SSIM2 is the structural similarity parameter between the blurred tongue image and the second motion-blurred tongue image.

[0219] The minimum values ​​of SSIM1 and SSIM2 calculated from the different motion directions are selected as the motion blur parameters of the first image and the second image, respectively.

[0220] In some implementations, processor 41 is used to run a computer program stored in memory to perform the following steps:

[0221] Obtain an image of the tongue to be diagnosed;

[0222] The tongue image to be diagnosed is input into a tongue image classifier for analysis to determine the category of the tongue image to be diagnosed, wherein the tongue image classifier is trained based on the aforementioned classifier training method.

[0223] In some implementations, when the processor 41 inputs the tongue image to be diagnosed into a tongue image classifier for analysis to determine the category of the tongue image to be diagnosed, it performs the following:

[0224] Calculate the generalized Gaussian distribution parameters, the asymmetric generalized Gaussian distribution parameters, and the motion blur parameters of the tongue image to be diagnosed;

[0225] The category of the tongue image to be diagnosed is determined based on the parameter set of the clear tongue image and the parameter set of the blurred tongue image.

[0226] This application also provides a computer-readable storage medium storing a computer program that, when executed by one or more processors, causes the one or more processors to implement the classifier training method and image analysis method provided in this application.

[0227] The computer-readable storage medium can be an internal storage unit of the electronic device described in the foregoing embodiments, such as a hard disk or memory of the electronic device. Alternatively, the computer-readable storage medium can be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc.

[0228] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A classifier training method for training a tongue image classifier, characterized in that, The classifier training method includes: Obtain a training sample set, which includes a first training sample set and a second training sample set. The first training sample set includes a first preset number of clear tongue images, and the second training sample set includes a second preset number of blurred tongue images. The clear tongue image and the blurred tongue image are preprocessed respectively to obtain a first image and a second image. The pixels of the first image follow a Gaussian distribution, while the pixels of the second image do not follow a Gaussian distribution. Calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the training dataset; A tongue image classifier is obtained by training the training dataset using a support vector machine. The training dataset includes a first training dataset and a second training dataset. The calculation of the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image includes: Calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the first training dataset; After adjusting the pixels of the first image and the second image to be the first pixel, calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters and motion blur parameters of the first image and the second image to obtain the second training dataset; The calculation of motion blur parameters for the first image and the second image includes: Construct transformation matrices for different motion directions; the different motion directions include 0°, 15°, 30°, 45°, 60°, 75°, 90°, 105°, 120°, 135°, 150°, and 165°; Motion fuzzy kernel matrices for different motion directions are constructed using the transformation matrices for the different motion directions; The clear tongue image and the blurred tongue image are convolved using the motion blur kernel matrix to obtain the first motion-blurred tongue image and the second motion-blurred tongue image with different motion directions; Calculate the structural similarity parameters for the different motion directions, the similarity parameters including the first structural similarity parameter between the clear tongue image and the first motion-blurred tongue image, and the second structural similarity parameter between the blurred tongue image and the second motion-blurred tongue image; Based on the first structural similarity parameter and the second structural similarity parameter, the motion blur parameters of the first image and the second image are determined.

2. The classifier training method according to claim 1, characterized in that, Before performing image preprocessing on the clear tongue image and the blurred tongue image, the process also includes: The tongue contours of the clear tongue image and the blurred tongue image are obtained using a tongue segmentation model. The third image and the fourth image are obtained by cropping the inscribed rectangle of the tongue outline of the clear tongue image and the inscribed rectangle of the tongue outline of the blurred tongue image, respectively.

3. The classifier training method according to claim 1, characterized in that, The step of performing image preprocessing on the clear tongue image and the blurred tongue image respectively to obtain a first image and a second image includes: The clear tongue image and the blurred tongue image are respectively processed into grayscale to obtain the fifth image and the sixth image; The fifth image and the sixth image are respectively subjected to mean contrast normalization processing to obtain the first image and the second image.

4. The classifier training method according to claim 2, characterized in that, After extracting the inscribed rectangles of the tongue outlines from the clear tongue image and the blurred tongue image, the process further includes: Adjust the pixels of the third image to the second pixel so that the second pixel is adapted to the acquisition device of the clear tongue image; Adjust the pixels of the fourth image to the third pixel so that the third pixel is adapted to the acquisition device of the blurred tongue image.

5. The classifier training method according to claim 1, characterized in that, Determining the motion blur parameters of the first image and the second image based on the first structural similarity parameter and the second structural similarity parameter includes: The first minimum value of the first structural similarity parameter and the second minimum value of the second structural similarity parameter calculated from the different motion directions are selected as the motion blur parameters of the first image and the second image, respectively.

6. An image analysis method for classifying clear tongue images and blurry tongue images, characterized in that, The image analysis method includes: Obtain an image of the tongue to be diagnosed; The tongue image to be diagnosed is input into a tongue image classifier for analysis to determine the category of the tongue image to be diagnosed, wherein the tongue image classifier is trained by the classifier training method according to any one of claims 1 to 5.

7. A classifier training device for training a tongue image classifier, characterized in that, The classifier training device includes: The acquisition module is used to acquire a training sample set, which includes a first training sample set and a second training sample set. The first training sample set includes a first preset number of clear tongue images, and the second training sample set includes a second preset number of blurred tongue images. The processing module is used to perform image preprocessing on the clear tongue image and the blurred tongue image respectively to obtain a first image and a second image. The pixels of the first image follow a Gaussian distribution, while the pixels of the second image do not follow a Gaussian distribution. The calculation module calculates the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the training dataset; The training module is used to train the training dataset based on a support vector machine to obtain a tongue image classifier; The training dataset includes a first training dataset and a second training dataset. The calculation of the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image includes: Calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters, and motion blur parameters of the first image and the second image to obtain the first training dataset; After adjusting the pixels of the first image and the second image to be the first pixel, calculate the generalized Gaussian distribution parameters, asymmetric generalized Gaussian distribution parameters and motion blur parameters of the first image and the second image to obtain the second training dataset; The calculation of motion blur parameters for the first image and the second image includes: Construct transformation matrices for different motion directions; the different motion directions include 0°, 15°, 30°, 45°, 60°, 75°, 90°, 105°, 120°, 135°, 150°, and 165°; Motion fuzzy kernel matrices for different motion directions are constructed using the transformation matrices for the different motion directions; The clear tongue image and the blurred tongue image are convolved using the motion blur kernel matrix to obtain the first motion-blurred tongue image and the second motion-blurred tongue image with different motion directions; Calculate the structural similarity parameters for the different motion directions, the similarity parameters including the first structural similarity parameter between the clear tongue image and the first motion-blurred tongue image, and the second structural similarity parameter between the blurred tongue image and the second motion-blurred tongue image; Based on the first structural similarity parameter and the second structural similarity parameter, the motion blur parameters of the first image and the second image are determined.

8. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the classifier training method as described in any one of claims 1 to 5 or the image analysis method as described in claim 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the classifier training method as described in any one of claims 1 to 5 or the image analysis method as described in claim 6.