Tongue diagnosis image color correction model training method, color correction method and device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ATHENAEYES CO LTD
- Filing Date
- 2023-01-18
- Publication Date
- 2026-08-07
AI Technical Summary
专业的舌诊仪器虽然精准但价格昂贵,而且必须挂号到医院去做;对于一些亚健康的小毛病,没必要往医院跑
[0039] This invention provides a method for training a color correction model for tongue diagnostic images, a method for color correction of tongue diagnostic images, a device, a computer, and a storage medium. The method involves acquiring a tongue image captured under flashing light with a preset color as an initial image, resulting in several initial images. The preset colors are N, where N is a positive integer greater than 3. For each initial image, a semantic segmentation network is used to identify the tongue region within the initial image, generating a first label for the tongue region and a second label for the region outside the tongue region, resulting in a training image containing both the first and second labels. Based on the training image and its corresponding preset colors, color cast information is determined for each preset color. The initial color correction model is trained based on the color cast information and the training image to obtain a trained color correction model for tongue diagnostic images. This allows the obtained color correction model to quickly identify the color cast caused by different lighting conditions on the real tongue, thus improving the accuracy of color correction.
Smart Images

Figure CN116187470B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and in particular to a method for training a color correction model for tongue diagnosis images, a color correction method, and a device. Background Technology
[0002] With the development of electronic information technology, online consultations are becoming increasingly convenient for people's lives. Tongue diagnosis is widely used in traditional Chinese medicine and is recognized by most people. Currently, professional tongue diagnosis instruments have been developed; users only need to stick out their tongue and take a picture on a professional machine to receive a professional test report. Some companies also provide tongue diagnosis apps to remotely assist users with tongue diagnosis. While professional tongue diagnosis instruments are accurate, they are expensive and require an appointment at a hospital; for minor health issues, there's no need to go to the hospital.
[0003] Tongue diagnosis instruments emit standard white light to illuminate the tongue and then take pictures for diagnosis, accurately determining the tongue's color. However, tongue diagnosis apps rely on natural light, and photos taken under different lighting conditions greatly affect the judgment of tongue color. Natural light conditions vary greatly, such as at sunset, under fluorescent lights, or in a room during the day. Therefore, many tongue diagnosis apps will produce different diagnostic results depending on the environment in which the photos are taken. People using tongue diagnosis apps may take photos of their tongues at sunset, under fluorescent lights, or in a room during the day, and the natural light conditions are varied and uncontrollable. This results in color errors in the captured images, and the quality of the tongue diagnosis images does not meet the requirements of the application. Summary of the Invention
[0004] This invention provides a method for training a color correction model for tongue diagnosis images, a color correction method, an apparatus, a computer device, and a storage medium to improve the quality of tongue diagnosis images.
[0005] To address the aforementioned technical problems, this application provides a method for training a color correction model for tongue diagnosis images, the method comprising:
[0006] A tongue image captured under a flash of a preset color is obtained as an initial image, and several such initial images are obtained. The preset colors are N, where N is a positive integer greater than 3.
[0007] For each of the initial images, a semantic segmentation network is used to identify the tongue region in the initial image, and a first label is generated for the tongue region, and a second label is generated for the region outside the tongue region, to obtain a training image containing the first label and the second label;
[0008] Based on the training image and the preset color corresponding to the training image, determine the color bias information corresponding to each preset color;
[0009] Based on the color cast information and the training image, an initial color correction model is trained to obtain a trained color correction model for the tongue diagnosis image.
[0010] Optionally, the preset colors include white, red, green, and blue, and the shooting parameters are the same when acquiring the initial image.
[0011] Optionally, determining the color cast information corresponding to each preset color based on the training image and the preset color corresponding to the training image includes:
[0012] A reference image is obtained by shooting under natural light conditions, and the shooting parameters of the reference image are the same as those of the initial image.
[0013] The image of the first marked region in the training image is used as the recognition region image, and the image of the region corresponding to the first marked region in the reference image is obtained as the reference region image;
[0014] By comparing the recognition region image with the reference region image, the color cast information corresponding to the preset color in the training image is determined.
[0015] Optionally, when the preset color is white, the step of acquiring the image of the tongue taken in the flash state of the preset color as the initial image includes: setting a white reference object within the field of view of the shooting;
[0016] The step of determining the color cast information corresponding to each preset color based on the training image and the preset color corresponding to the training image includes:
[0017] The image of the first marked region in the training image is compared with the white reference object to calculate the color cast, thereby obtaining the color cast information of the white object.
[0018] Optionally, the initial color correction model is trained as a machine learning model or a neural network model.
[0019] To address the aforementioned technical problems, this application also provides a color correction method for tongue diagnosis images, comprising:
[0020] Acquire the tongue diagnosis image to be calibrated;
[0021] The tongue diagnosis image to be calibrated is calibrated using a trained color correction model for the tongue diagnosis image to obtain a calibrated image.
[0022] To address the aforementioned technical problems, this application also provides a color correction model training device for tongue diagnosis images, comprising:
[0023] An initial image acquisition module is used to acquire a photograph of the tongue under a flashing state with a preset color as an initial image, and to obtain several initial images, wherein the preset color is N, and N is a positive integer greater than 3;
[0024] The training image generation module is used to identify the tongue region in each initial image using a semantic segmentation network, generate a first label for the tongue region, and generate a second label for the region outside the tongue region, so as to obtain a training image containing the first label and the second label.
[0025] The color cast information determination module is used to determine the color cast information corresponding to each preset color based on the training image and the preset color corresponding to the training image;
[0026] The calibration model training module is used to train an initial color calibration model based on the color cast information and the training image to obtain a trained color calibration model for the tongue diagnosis image.
[0027] Optionally, the color cast information determination module includes:
[0028] A reference image acquisition unit is used to capture a reference image under natural light conditions, wherein the capture parameters of the reference image are the same as those of the initial image.
[0029] The recognition region determination unit is used to take the image of the first marked region in the training image as the recognition region image, and to obtain the image of the region corresponding to the first marked region in the reference image as the reference region image;
[0030] The comparison calculation unit is used to compare the recognition region image with the reference region image to determine the color deviation information of the preset color corresponding to the training image.
[0031] Optionally, when the preset color is white, the initial image acquisition module includes setting a white reference object within the shooting field of view;
[0032] The color cast information determination module includes:
[0033] The color cast calculation unit is used to perform color cast calculation on the image of the first marked region in the training image and the white reference object to obtain the color cast information of the white object.
[0034] To address the aforementioned technical problems, this application also provides a color correction device for tongue diagnosis images, characterized in that it includes:
[0035] The image acquisition module is used to acquire the tongue diagnosis image to be calibrated.
[0036] The image calibration module is used to calibrate the tongue diagnosis image to be calibrated using a trained color correction model of the tongue diagnosis image, so as to obtain a calibrated image.
[0037] To address the aforementioned technical problems, this application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-mentioned tongue diagnosis image color correction model training method, or the processor executes the computer program to implement the steps of the above-mentioned tongue diagnosis image color correction method.
[0038] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the steps of the above-described tongue diagnosis image color correction model training method, or, when executed by a processor, the computer program implements the steps of the above-described tongue diagnosis image color correction method.
[0039] This invention provides a method for training a color correction model for tongue diagnostic images, a method for color correction of tongue diagnostic images, a device, a computer, and a storage medium. The method involves acquiring a tongue image captured under flashing light with a preset color as an initial image, resulting in several initial images. The preset colors are N, where N is a positive integer greater than 3. For each initial image, a semantic segmentation network is used to identify the tongue region within the initial image, generating a first label for the tongue region and a second label for the region outside the tongue region, resulting in a training image containing both the first and second labels. Based on the training image and its corresponding preset colors, color cast information is determined for each preset color. The initial color correction model is trained based on the color cast information and the training image to obtain a trained color correction model for tongue diagnostic images. This allows the obtained color correction model to quickly identify the color cast caused by different lighting conditions on the real tongue, thus improving the accuracy of color correction. Attached Figure Description
[0040] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0042] Figure 2 This is a flowchart of an embodiment of the color correction model training method for tongue diagnosis images in this application;
[0043] Figure 3 This is a flowchart of an embodiment of the color correction method for tongue diagnosis images in this application;
[0044] Figure 4 This is a schematic diagram of a structure of an embodiment of a color correction model training device for tongue diagnosis images according to this application;
[0045] Figure 5 This is a schematic diagram of a structure of an embodiment of the color correction device for tongue diagnosis images according to this application.
[0046] Figure 6 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0048] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] Please see Figure 1 ,like Figure 1As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0051] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc.
[0052] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture E interface displays Perts Group Audio Layer III, Dynamic Picture Experts Compression Standard Audio Layer 3), MP4 players (Moving Picture E interface displays Perts Group Audio Layer IV, Dynamic Picture Experts Compression Standard Audio Layer 4), laptops, and desktop computers, etc.
[0053] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0054] It should be noted that the color correction model training method for tongue diagnosis images provided in this application embodiment is executed by the server, and correspondingly, the color correction model training device for tongue diagnosis images is set in the server.
[0055] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included. The terminal devices 101, 102, and 103 in this embodiment can specifically correspond to application systems in actual production.
[0056] Please see Figure 2 , Figure 2 This invention illustrates a method for training a color correction model for tongue diagnosis images, as provided in an embodiment of the present invention, and applies this method to... Figure 1 Taking the server-side as an example, the details are as follows:
[0057] S201: Obtain a photograph of the tongue taken under flashing conditions with preset colors as the initial image, and obtain several initial images. There are N preset colors, where N is a positive integer greater than 3.
[0058] Optionally, preset colors include white, red, green, and blue, with the same shooting parameters when acquiring the initial image.
[0059] In one specific implementation, when capturing an image of the tongue, the phone screen is controlled to emit flashes of various colors such as white, red, green, and blue, with one photo of the tongue taken under each flash. It should be noted that the camera must use the same shooting parameters (e.g., exposure time, white balance) when taking each photo to ensure that different camera shooting parameters do not affect the photo quality.
[0060] S202: For each initial image, a semantic segmentation network is used to identify the tongue region in the initial image, and a first label is generated for the tongue region and a second label is generated for the region outside the tongue region, so as to obtain a training image containing the first label and the second label.
[0061] The semantic segmentation network is used to perform semantic segmentation on the image. In this embodiment, Unet is used as the semantic segmentation network. Specifically, several initial images containing the tongue are taken, and the tongue region is labeled to obtain the first label. Non-tongue regions (such as lips) are labeled a second label. A semantic segmentation model is trained so that "tongue label (first label) = Model (model photo)". In this way, the model has the ability to recognize the tongue region. When a new unlabeled image is given to the model, the tongue region can be recognized according to the semantic recognition model.
[0062] S203: Determine the color cast information corresponding to each preset color based on the training image and the preset color corresponding to the training image.
[0063] Optionally, based on the training image and the corresponding preset color, determine the color cast information for each preset color, including:
[0064] A reference image was obtained by shooting under natural light conditions, and the shooting parameters of the reference image were the same as those of the initial image.
[0065] The image of the first labeled region in the training image is used as the recognition region image, and the image of the region corresponding to the first labeled region in the reference image is obtained as the reference region image;
[0066] By comparing the recognition region image with the reference region image, the color cast information corresponding to the preset color in the training image is determined.
[0067] In one specific implementation, the image of the tongue taken by the front-facing camera when the mobile phone screen flashes red is the "red photo". The image of the tongue taken by the front-facing camera when the mobile phone screen does not flash is the reference image. After the tongue region is identified by the semantic segmentation model, the pixel value of the tongue region of the red photo (identification region image) is subtracted from the pixel value of the reference region image to obtain the color cast information corresponding to red, that is, F red.
[0068] Optionally, when the preset color is white, an image of the tongue taken under the flashing state of the preset color is acquired as the initial image, including: setting a white reference object within the field of view;
[0069] Based on the training images and their corresponding preset colors, the color cast information for each preset color is determined as follows:
[0070] The image of the first marked region in the training image is compared with the white reference object to calculate the color cast, thus obtaining the color cast information of the white object.
[0071] When a phone flashes white light, a photo of the tongue will appear as "Pic white." Due to the influence of ambient light, there may be a color cast (such as a reddish or purplish tint). If you place a small piece of white paper on the corner of the photographer's mouth, after taking the photo, you can accurately calculate the true color cast based on the color of the paper in the photo (for example, if the paper appears greenish, you know the ambient light was greenish). Set the true color cast information as "Color_Offset_True".
[0072] It's important to note that the color of the tongue is determined by the different reflectivities of its surface to red, green, and blue light. If the tongue has a high reflectivity to red light, it will appear redder, and its "F Red" value will be higher; that is, "F Red" is directly proportional to the tongue's reflectivity to red light! Therefore, we can use "F Red, F Green, and F Blue" to assess the true color of the tongue, unaffected by ambient light. However, it's also important to note that because mobile device screens have weak flash, calculations using flash for "F Red, F Green, and F Blue" will have some margin of error.
[0073] S204: Train the initial color correction model based on color cast information and training images to obtain a trained color correction model for tongue diagnosis images.
[0074] Optionally, the initial color correction model can be trained using a machine learning model or a neural network model. It should be noted that in this implementation, an auxiliary flash emitted from a mobile phone screen is used to assess the tongue's reflection intensity under different light conditions. However, since the reflection intensity has a certain margin of error (it cannot be completely equated to the tongue's color), the robustness of deep learning models is leveraged to input the reflection intensity information and a real photograph of the tongue into a model to predict and assess the actual color cast in the photograph, thereby determining the tongue's true color.
[0075] In one specific implementation, after obtaining "Pic White", "F Red, F Green, F Blue", and "Color_Offset_True", a model can be trained.
[0076] The specific model structure is: Color_Offset_True = Model(PicWhite, FRed, FGreen, FBlue)
[0077] Among them, Pic white is the photo of the tongue taken by the front camera when the mobile phone screen emits white light, F red, F green and F blue are the color bias information of red, green and blue respectively, and then the predicted natural light color bias = Model(Pic white, F red, F green, F blue) is obtained. The model is adjusted to minimize the mean square error of "the color bias of real natural light - the predicted natural light color bias".
[0078] In this embodiment, a tongue image captured under a flash of a preset color is obtained as the initial image. Several initial images are obtained, with N preset colors, where N is a positive integer greater than 3. For each initial image, a semantic segmentation network is used to identify the tongue region in the initial image, generating a first label for the tongue region and a second label for the region outside the tongue region, resulting in a training image containing the first and second labels. Based on the training image and its corresponding preset color, color cast information corresponding to each preset color is determined. Based on the color cast information and the training image, an initial color correction model is trained to obtain a trained color correction model for the tongue diagnosis image. This allows the obtained color correction model to quickly identify the color cast caused by different lighting conditions on the real tongue, which helps improve the accuracy of color correction.
[0079] Please see Figure 3 , Figure 3 This invention illustrates a color correction method for tongue diagnosis images provided by an embodiment of the present invention, which is applied to... Figure 1 Taking the server-side as an example, the details are as follows:
[0080] S205: Acquire the tongue diagnosis image to be calibrated.
[0081] S206: Use the trained color correction model of the tongue diagnosis image to calibrate the tongue diagnosis image to be calibrated, and obtain the calibration image.
[0082] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0083] Figure 4 This diagram illustrates the principle block diagram of a tongue diagnosis image color correction model training device, which corresponds one-to-one with the tongue diagnosis image color correction model training method described in the above embodiments. For example... Figure 4 As shown, the tongue diagnosis image color correction model training device includes an initial image acquisition module 31, a training image generation module, a color cast information determination module 33, and a correction model training module 34. Detailed descriptions of each functional module are as follows:
[0084] The initial image acquisition module 31 is used to acquire a photograph of the tongue under a flashing state with a preset color as the initial image, and to obtain several initial images. The preset colors are N, where N is a positive integer greater than 3.
[0085] The training image generation module 32 is used to identify the tongue region in each initial image using a semantic segmentation network, generate a first label for the tongue region, and generate a second label for the region outside the tongue region, so as to obtain a training image containing the first label and the second label.
[0086] The color cast information determination module 33 is used to determine the color cast information corresponding to each preset color based on the training image and the preset color corresponding to the training image;
[0087] The calibration model training module 34 is used to train the initial color calibration model based on the color bias information and the training image to obtain the trained color calibration model of the tongue diagnosis image.
[0088] Optionally, the color cast information determination module 33 includes:
[0089] The reference image acquisition unit is used to capture a reference image under natural light conditions. The capture parameters of the reference image are the same as those of the initial image.
[0090] The recognition region determination unit is used to take the image of the first marked region in the training image as the recognition region image, and to obtain the image of the region corresponding to the first marked region in the reference image as the reference region image;
[0091] The comparison calculation unit is used to compare the recognition region image with the reference region image to determine the color deviation information of the preset color corresponding to the training image.
[0092] Optionally, when the preset color is white, the initial image acquisition module includes setting a white reference object within the shooting field of view; the color cast information determination module 33 includes:
[0093] The color cast calculation unit is used to calculate the color cast of the first marked region in the training image and the white reference object to obtain the color cast information of the white object.
[0094] Specific limitations regarding the color correction model training device for tongue diagnosis images can be found in the limitations of the color correction model training method for tongue diagnosis images mentioned above, and will not be repeated here. Each module in the aforementioned color correction model training device for tongue diagnosis images can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0095] Figure 5 A schematic block diagram of a color correction device for tongue diagnosis images, corresponding one-to-one with the color correction method for tongue diagnosis images in the above embodiments, is shown. For example... Figure 5 As shown, the color correction device for the tongue diagnosis image includes an image acquisition module 35 and an image calibration module 36. Detailed descriptions of each functional module are as follows:
[0096] The image acquisition module 35 is used to acquire the tongue diagnosis image to be calibrated;
[0097] The image calibration module 36 is used to calibrate the tongue diagnosis image to be calibrated using a trained color correction model of the tongue diagnosis image, so as to obtain a calibration image.
[0098] Specific limitations regarding the color correction module for tongue diagnosis images can be found in the limitations of the color correction method for tongue diagnosis images mentioned above, and will not be repeated here. Each module in the aforementioned color correction device for tongue diagnosis images can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0099] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 6 , Figure 6 This is a basic structural block diagram of the computer device in this embodiment.
[0100] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components connected to the memory 41, processor 42, and network interface 43 is shown in the figure; however, it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0101] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0102] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or D-interface display memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as program code for controlling electronic documents. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
[0103] In some embodiments, the processor 42 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run program code stored in the memory 41 or process data, such as program code controlling electronic documents.
[0104] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.
[0105] This application also provides another embodiment, namely, a computer-readable storage medium storing an interface display program that can be executed by at least one processor to cause the at least one processor to perform the steps of the color correction model training method for tongue diagnosis images as described above.
[0106] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0107] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A method for training a color correction model for tongue diagnosis images, characterized in that, include: A tongue image captured under a flash of a preset color is obtained as an initial image, and several such initial images are obtained. The preset colors are N, where N is a positive integer greater than 3. For each initial image, a semantic segmentation network is used to identify the tongue region in the initial image, and a first label is generated for the tongue region, and a second label is generated for the region outside the tongue region, to obtain a training image containing the first label and the second label; Based on the training image and the preset color corresponding to the training image, determine the color bias information corresponding to each preset color; Based on the color cast information and the training image, an initial color correction model is trained to obtain a trained color correction model for the tongue diagnosis image. The preset colors include white, red, green, and blue, and the shooting parameters are the same when acquiring the initial image; The step of determining the color cast information corresponding to each preset color based on the training image and the preset color corresponding to the training image includes: A reference image is obtained by shooting under natural light conditions, and the shooting parameters of the reference image are the same as those of the initial image. The image of the first marked region in the training image is used as the recognition region image, and the image of the region corresponding to the first marked region in the reference image is obtained as the reference region image; Based on the recognition region image and the reference region image, the color cast information of the preset color corresponding to the training image is determined.
2. The color correction model training method for tongue diagnosis images as described in claim 1, characterized in that, When the preset color is white, the step of acquiring a photographed image of the tongue in the flashing state of the preset color as the initial image includes: setting a white reference object within the field of view of the photograph; The step of determining the color cast information corresponding to each preset color based on the training image and the preset color corresponding to the training image includes: The image of the first marked region in the training image is compared with the white reference object to calculate the color cast, thereby obtaining the color cast information of the white object.
3. The color correction model training method for tongue diagnosis images as described in claim 1 or 2, characterized in that, The initial color correction model is trained using a machine learning model or a neural network model.
4. A color correction method for tongue diagnosis images, characterized in that, include: Acquire the tongue diagnosis image to be calibrated; The tongue diagnosis image to be calibrated is calibrated using a trained color correction model for the tongue diagnosis image to obtain a calibrated image, wherein the trained color correction model for the tongue diagnosis image is trained according to any one of claims 1 to 3.
5. A color correction model training device for tongue diagnosis images, characterized in that, For performing the color correction model training method for tongue diagnosis images according to any one of claims 1 to 3, the color correction model training device for tongue diagnosis images comprises: An initial image acquisition module is used to acquire a photograph of the tongue under a flashing state with a preset color as an initial image, and to obtain several initial images, wherein the preset color is N, and N is a positive integer greater than 3; The training image generation module is used to identify the tongue region in each initial image using a semantic segmentation network, generate a first label for the tongue region, and generate a second label for the region outside the tongue region, so as to obtain a training image containing the first label and the second label. The color cast information determination module is used to determine the color cast information corresponding to each preset color based on the training image and the preset color corresponding to the training image; The calibration model training module is used to train an initial color calibration model based on the color cast information and the training image to obtain a trained color calibration model for the tongue diagnosis image.
6. A color correction device for tongue diagnosis images, characterized in that, include: The image acquisition module is used to acquire the tongue diagnosis image to be calibrated. An image calibration module is used to calibrate the tongue diagnosis image to be calibrated using a trained color correction model for the tongue diagnosis image, thereby obtaining a calibrated image, wherein the trained color correction model for the tongue diagnosis image is trained according to the method described in any one of claims 1 to 3.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the color correction model training method for tongue diagnosis images as described in any one of claims 1 to 3, or, when the processor executes the computer program, it implements the color correction method for tongue diagnosis images as described in claim 4.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the color correction model training method for tongue diagnosis images as described in any one of claims 1 to 3, or, when the computer program is executed by the processor, it implements the color correction method for tongue diagnosis images as described in claim 4.
Citation Information
Patent Citations
Image color correction method and device, storage medium and mobile terminal
CN109523485A
Tongue image processing method and device and electronic equipment
CN110060250A