A tongue image segmentation method and system based on hybrid deep neural network
Through the combination of hybrid deep neural network and Sobel operator, the problem of missing boundary information in tongue image segmentation is solved, high-precision tongue body segmentation is achieved, and the accuracy of tongue diagnosis is ensured.
Patent Information
- Application Number
- CN202410558188.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-08
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-08
AI Technical Summary
In the process of obtaining tongue images, non-standardized shooting conditions lead to interference information. When existing methods use classic deep neural networks, the boundary information of tongue body segmentation images is easily missed or missing, affecting the accuracy of tongue diagnosis in traditional Chinese medicine.
A method based on a hybrid deep neural network is used to segment the tongue image by constructing an HPA-UNet network structure and combining the residual unit, spatial attention mechanism and channel attention mechanism, and uses the Sobel operator to identify vertical and horizontal edges. Combined with the shallow neural network to obtain edge features, ensure the integrity of the boundary information of the tongue body segmentation image.
It effectively reduces the problem of missing or missing boundary information in tongue segmentation images, improves the accuracy of tongue image segmentation, and ensures the accuracy of tongue diagnosis.
Smart Images

Figure CN118135613B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a tongue image segmentation method and system based on a hybrid deep neural network. Background Art
[0002] Tongue diagnosis is a core method of traditional Chinese medicine. Practice has shown that the state of the tongue can directly reflect a person's health status. In order to automatically identify a person's potential diseases through computer vision technology, it is very important to segment the tongue part from the tongue image with high precision.
[0003] However, in the process of acquiring tongue images, it is difficult to standardize the shooting conditions of tongue images, such as lighting, characteristics of different cameras, and the posture of the patient when taking pictures, which will inevitably lead to interference information in the tongue images. In addition, in the process of segmenting tongue images, most existing methods use classic deep neural networks to obtain tongue segmentation images with low accuracy. The boundary information of the tongue segmentation image is usually omitted or missing, and the boundary information is very important for TCM tongue diagnosis. For example, the tooth marks on the edge of the tongue are potential symptoms of many diseases.
[0004] In summary, since interference information will be generated in the process of acquiring tongue images, and in the process of segmenting tongue images, the boundary information of the tongue segmentation image will be omitted or missing, which will inevitably lead to subsequent misjudgment of the tongue image. Summary of the invention
[0005] The present invention provides a tongue image segmentation method and system based on a hybrid deep neural network, which is used to solve the technical problems that interference information is generated in the process of acquiring tongue images, and the boundary information of the tongue segmentation image is omitted or missing in the process of segmenting the tongue images.
[0006] In a first aspect, the present invention provides a tongue image segmentation method based on a hybrid deep neural network, comprising:
[0007] Constructing an HPA-UNet network structure according to the residual unit, the spatial attention mechanism and the channel attention mechanism, wherein the HPA-UNet network structure includes an upsampling path composed of at least one upsampling module and a downsampling path composed of at least one downsampling module, wherein the downsampling path includes a first path composed of a spatial attention module and a single-branch 1*1 convolutional layer and a second path composed of a spatial attention module, a maximum pooling layer and an average pooling layer;
[0008] Acquire at least one historical tongue image, perform data enhancement on the at least one historical tongue image to obtain at least one historical tongue image set, and iteratively train the HPA-UNet network structure according to the at least one historical tongue image set to obtain a target HPA-UNet network structure;
[0009] Performing preliminary segmentation on the original tongue image acquired in real time according to the target HPA-UNet network structure to obtain a segmented image corresponding to the tongue image;
[0010] According to a preset Sobel operator, the vertical edge and the horizontal edge of the original tongue image are respectively identified, and a first identification result obtained by identifying the vertical edge of the original tongue image and a second identification result obtained by identifying the horizontal edge of the original tongue image are merged to obtain an updated RGB image, and the updated RGB image is input into a trained shallow neural network to obtain an edge feature segmentation result;
[0011] The pixel points of the segmented image and the pixel points determined as the tongue area in the edge feature segmentation result are combined to obtain a final tongue image.
[0012] In a second aspect, the present invention provides a tongue image segmentation system based on a hybrid deep neural network, comprising:
[0013] A construction module is configured to construct an HPA-UNet network structure according to a residual unit, a spatial attention mechanism, and a channel attention mechanism, wherein the HPA-UNet network structure includes an upsampling path composed of at least one upsampling module and a downsampling path composed of at least one downsampling module, wherein the downsampling path includes a first path composed of a spatial attention module and a single-branch 1*1 convolutional layer, and a second path composed of a spatial attention module, a maximum pooling layer, and an average pooling layer;
[0014] a training module configured to obtain at least one historical tongue image, perform data enhancement on the at least one historical tongue image to obtain at least one historical tongue image set, and iteratively train the HPA-UNet network structure according to the at least one historical tongue image set to obtain a target HPA-UNet network structure;
[0015] A segmentation module, configured to perform preliminary segmentation on the original tongue image acquired in real time according to the target HPA-UNet network structure to obtain a segmented image corresponding to the tongue image;
[0016] A recognition module, configured to respectively recognize the vertical edge and the horizontal edge of the original tongue image according to a preset Sobel operator, and merge a first recognition result obtained by recognizing the vertical edge of the original tongue image and a second recognition result obtained by recognizing the horizontal edge of the original tongue image to obtain an updated RGB image, and input the updated RGB image into a trained shallow neural network to obtain an edge feature segmentation result;
[0017] The fusion module is configured to take the union of each pixel point of the segmented image and the pixel point determined as the tongue area part in the edge feature segmentation result to obtain a final tongue image.
[0018] According to a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the tongue image segmentation method based on a hybrid deep neural network according to any embodiment of the present invention.
[0019] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the program instructions are executed by a processor, the processor executes the steps of the tongue image segmentation method based on a hybrid deep neural network of any embodiment of the present invention.
[0020] The tongue image segmentation method and system based on a hybrid deep neural network of the present application performs data enhancement on at least one historical tongue image to obtain at least one historical tongue image set, and iteratively trains the HPA-UNet network structure according to at least one historical tongue image set to obtain a target HPA-UNet network structure, which can reduce the occurrence of overfitting during the training process, and uses the target HPA-UNet network structure to recognize tongue images to obtain a high-precision tongue segmentation image, and then recognizes the vertical edges and horizontal edges of the original tongue image respectively according to the Sobel operator, which can avoid as much as possible the problem of missing or missing boundary information of the tongue segmentation image during the tongue image segmentation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1A flow chart of a tongue image segmentation method based on a hybrid deep neural network provided by an embodiment of the present invention;
[0023] Figure 2 A structural block diagram of a tongue image segmentation system based on a hybrid deep neural network provided by an embodiment of the present invention;
[0024] Figure 3 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] See also Figure 1 , which shows a flowchart of a tongue image segmentation method based on a hybrid deep neural network of the present application.
[0027] like Figure 1 As shown, the tongue image segmentation method based on the hybrid deep neural network specifically includes the following steps:
[0028] Step S101, constructing an HPA-UNet network structure according to the residual unit, the spatial attention mechanism and the channel attention mechanism, wherein the HPA-UNet network structure includes an upsampling path composed of at least one upsampling module and a downsampling path composed of at least one downsampling module, wherein the downsampling path includes a first path composed of a spatial attention module and a single-branch 1*1 convolutional layer and a second path composed of a spatial attention module, a maximum pooling layer and an average pooling layer.
[0029] In this step, the HPA-UNet network structure uses the residual unit as the basic unit of the network, and the entire structure can be divided into an encoder and a decoder.
[0030] The encoder is a downsampling process of the image, while the decoder is an upsampling process of the image. In particular, the first residual unit that processes the input image does not perform downsampling or upsampling operations, and 2 convolutional layers with a kernel size of 3 and a stride of 1, ReLU, and batch normalization layers are applied before and after. The downsampling and upsampling paths consist of 3 downsampling modules and 3 upsampling modules. After the input image is processed by the downsampling and upsampling modules, the length and height are halved or doubled. These basic blocks consist of an attention module, 3 convolutional layers, ReLU, batch normalization, and shortcut functions. The spatial attention mechanism is applied in the downsampling module, and the channel attention mechanism is applied in the upsampling module. In addition, there is a downsampling structure in the shortcut, which consists of a convolutional layer, a max pooling layer, and an average pooling layer. In order to reduce the semantic gap, there are skip connections between the downsampling and upsampling paths. After the downsampling and upsampling paths, the feature map will be restored to the original size of the input image, and then the feature map will pass through the convolutional layer and the sigmoid function to obtain the segmentation result. The parameters of the convolutional layer in the middle of the residual unit are shown in the following table.
[0031] ,
[0032] In the downsampling module, assuming the input feature map size is , then the output after the 2x2 max pooling layer is . The downsampling path consists of a spatial attention module, 2 convolutional layers with kernel size 3, stride 2, and padding 1. Batch normalization and ReLU activation function are used before each convolutional layer. The shortcut of the residual unit is carefully designed for better information transfer. Convolutional layers with stride 2 are used for downsampling. In order to reduce information loss, a shortcut with 2 branches is designed, one of which is a single-branch 1X1 convolutional layer, and the other is a max pooling layer and an average pooling layer. We concatenate the results after max pooling and average pooling to get a 1x1 convolution result.
[0033] Step S102, at least one historical tongue image, data enhancement is performed on the at least one historical tongue image to obtain at least one historical tongue image set, and the HPA-UNet network structure is iteratively trained according to the at least one historical tongue image set to obtain a target HPA-UNet network structure.
[0034] In this step, a maximum rotation angle is set, and at least one historical tongue image is rotated according to the maximum rotation angle to obtain a rotated image corresponding to at least one historical tongue image; at least one historical tongue image is randomly cropped from the original resolution to a cropped image with a horizontal resolution of 576*384 and a vertical resolution of 432*288, and the size of the cropped image is enlarged to the same size as at least one historical tongue image to obtain a cropped image corresponding to at least one historical tongue image; at least one historical tongue image is horizontally flipped to obtain a flipped image corresponding to at least one historical tongue image; average Gaussian noise is added to at least one historical tongue image to obtain a noise image corresponding to at least one historical tongue image; the rotated image, cropped image, flipped image and noise image corresponding to the same historical tongue image are combined into a historical tongue image set to obtain at least one historical tongue image set. And the HPA-UNet network structure is iteratively trained according to at least one historical tongue image set to obtain a target HPA-UNet network structure.
[0035] It should be noted that Gaussian noise is a type of noise whose probability density function follows a Gaussian distribution and is widely used in digital image processing. Gaussian noise is introduced into the tongue image to enhance the data diversity and generalization of the network used to identify pixels. Set the average value and variance 0 and 0.4 respectively, and then add them to the historical tongue image. The Gaussian probability density function is:
[0036] ,
[0037] In the formula, is the Gaussian probability density function, is a continuous random variable.
[0038] Step S103, performing preliminary segmentation on the original tongue image acquired in real time according to the target HPA-UNet network structure to obtain a segmented image corresponding to the tongue image.
[0039] In this step, given an original tongue image As the input of the ith downsampling module, the output of the ith downsampling module is , is the field of real numbers, is the number of channels of the feature map, is the height of the feature map, is the width of the feature map, where the expression for calculating the output of the i-th downsampling module is:
[0040] ,
[0041] In the formula, is a shortcut function, It is the residual function, which consists of a spatial attention mechanism, a convolution with batch normalization, and a ReLU activation function;
[0042] ,
[0043] In the formula, It is a 1*1 convolution with a step size of 2. For the original tongue image Perform average pooling, For the original tongue image Perform maximum pooling, To add elements one by one.
[0044] In the upsampling module, assuming the input feature map size is , then the output is Symmetrically to the downsampling module, the upsampling module consists of a channel attention module and two convolutional layers with a kernel size of 3, a stride of 1, and a padding of 1. Assume is the input of the lth upsampling module, then the output is . The output expression is: .
[0045] Step S104, according to the preset Sobel operator, the vertical edges and horizontal edges of the original tongue image are respectively identified, and the first recognition result obtained by identifying the vertical edge of the original tongue image and the second recognition result obtained by identifying the horizontal edge of the original tongue image are merged to obtain an updated RGB image, and the updated RGB image is input into the trained shallow neural network to obtain an edge feature segmentation result.
[0046] In this step, the expressions for identifying the vertical edge and the horizontal edge of the original tongue image respectively according to the preset Sobel operator are:
[0047] ,
[0048] In the formula, is the second recognition result obtained by recognizing the horizontal edge of the original tongue image, is the original tongue image, To multiply the elements one by one;
[0049] ,
[0050] In the formula, It is a first recognition result obtained by recognizing the vertical edge of the original tongue image.
[0051] The expression for combining the first recognition result obtained by recognizing the vertical edge of the original tongue image and the second recognition result obtained by recognizing the horizontal edge of the original tongue image is:
[0052] ,
[0053] In the formula, is the second recognition result obtained by recognizing the horizontal edge of the original tongue image, is a first recognition result obtained by recognizing the vertical edge of the original tongue image, is the updated RGB image.
[0054] It should be noted that the shallow neural network is specifically a LR-ASPP neural network.
[0055] Step S105 , taking the union of each pixel point of the segmented image and the pixel points determined to be the tongue area in the edge feature segmentation result, to obtain a final tongue image.
[0056] In summary, the method of the present application performs data enhancement on at least one historical tongue image to obtain at least one historical tongue image set, and iteratively trains the HPA-UNet network structure based on at least one historical tongue image set to obtain a target HPA-UNet network structure, which can reduce the occurrence of overfitting during the training process, and uses the target HPA-UNet network structure to recognize tongue images to obtain high-precision tongue segmentation images, and then uses the Sobel operator to respectively identify the vertical edges and horizontal edges of the original tongue image, which can avoid as much as possible the problem of missing or missing boundary information of the tongue segmentation image during the segmentation of the tongue image.
[0057] See also Figure 2 , which shows a structural block diagram of a tongue image segmentation system based on a hybrid deep neural network of the present application.
[0058] like Figure 2 As shown, the tongue image segmentation system 200 includes a construction module 210 , a training module 220 , a segmentation module 230 , a recognition module 240 and a fusion module 250 .
[0059] Among them, the construction module 210 is configured to construct an HPA-UNet network structure according to the residual unit, the spatial attention mechanism and the channel attention mechanism, the HPA-UNet network structure includes an upsampling path composed of at least one upsampling module and a downsampling path composed of at least one downsampling module, the downsampling path includes a first path composed of a spatial attention module and a single-branch 1*1 convolutional layer and a second path composed of a spatial attention module, a maximum pooling layer and an average pooling layer; the training module 220 is configured to obtain at least one historical tongue image, perform data enhancement on the at least one historical tongue image, obtain at least one historical tongue image set, and iteratively train the HPA-UNet network structure according to the at least one historical tongue image set to obtain a target HPA-UNet network structure. structure; a segmentation module 230, configured to perform preliminary segmentation on the original tongue image acquired in real time according to the target HPA-UNet network structure to obtain a segmented image corresponding to the tongue image; an identification module 240, configured to identify the vertical edge and the horizontal edge of the original tongue image respectively according to a preset Sobel operator, and merge a first identification result obtained by identifying the vertical edge of the original tongue image and a second identification result obtained by identifying the horizontal edge of the original tongue image to obtain an updated RGB image, and input the updated RGB image into the trained shallow neural network to obtain an edge feature segmentation result; a fusion module 250, configured to take the union of each pixel point of the segmented image with the pixel point determined as the tongue area part in the edge feature segmentation result to obtain a final tongue image.
[0060] It should be understood that Figure 2 Modules and references documented in Figure 1 Therefore, the operations and features described above for the method and the corresponding technical effects are also applicable to Figure 2 The modules in it will not be described in detail here.
[0061] In some other embodiments, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor executes the tongue image segmentation method based on a hybrid deep neural network in any of the above method embodiments;
[0062] As an implementation mode, the computer-readable storage medium of the present invention stores computer-executable instructions, and the computer-executable instructions are configured as follows:
[0063] Constructing an HPA-UNet network structure according to the residual unit, the spatial attention mechanism and the channel attention mechanism, wherein the HPA-UNet network structure includes an upsampling path composed of at least one upsampling module and a downsampling path composed of at least one downsampling module, wherein the downsampling path includes a first path composed of a spatial attention module and a single-branch 1*1 convolutional layer and a second path composed of a spatial attention module, a maximum pooling layer and an average pooling layer;
[0064] Acquire at least one historical tongue image, perform data enhancement on the at least one historical tongue image to obtain at least one historical tongue image set, and iteratively train the HPA-UNet network structure according to the at least one historical tongue image set to obtain a target HPA-UNet network structure;
[0065] Performing preliminary segmentation on the original tongue image acquired in real time according to the target HPA-UNet network structure to obtain a segmented image corresponding to the tongue image;
[0066] According to a preset Sobel operator, the vertical edge and the horizontal edge of the original tongue image are respectively identified, and a first identification result obtained by identifying the vertical edge of the original tongue image and a second identification result obtained by identifying the horizontal edge of the original tongue image are merged to obtain an updated RGB image, and the updated RGB image is input into a trained shallow neural network to obtain an edge feature segmentation result;
[0067] The pixel points of the segmented image and the pixel points determined as the tongue area in the edge feature segmentation result are combined to obtain a final tongue image.
[0068] The computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the tongue image segmentation system based on a hybrid deep neural network, etc. In addition, the computer-readable storage medium may include a high-speed random access memory, and may also include a memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the computer-readable storage medium may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the tongue image segmentation system based on a hybrid deep neural network via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0069] Figure 3 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 3As shown, the device includes: a processor 310 and a memory 320. The electronic device may also include: an input device 330 and an output device 340. The processor 310, the memory 320, the input device 330 and the output device 340 may be connected via a bus or other means. Figure 3 In the example, the bus connection is used. The memory 320 is the above-mentioned computer-readable storage medium. The processor 310 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 320, that is, the tongue image segmentation method based on the hybrid deep neural network of the above-mentioned method embodiment is implemented. The input device 330 can receive input digital or character information, and generate key signal input related to user settings and function control of the tongue image segmentation system based on the hybrid deep neural network. The output device 340 may include a display device such as a display screen.
[0070] The electronic device can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0071] As an implementation mode, the electronic device is applied to a tongue image segmentation system based on a hybrid deep neural network, and is used for a client, and includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can:
[0072] Constructing an HPA-UNet network structure according to the residual unit, the spatial attention mechanism and the channel attention mechanism, wherein the HPA-UNet network structure includes an upsampling path composed of at least one upsampling module and a downsampling path composed of at least one downsampling module, wherein the downsampling path includes a first path composed of a spatial attention module and a single-branch 1*1 convolutional layer and a second path composed of a spatial attention module, a maximum pooling layer and an average pooling layer;
[0073] Acquire at least one historical tongue image, perform data enhancement on the at least one historical tongue image to obtain at least one historical tongue image set, and iteratively train the HPA-UNet network structure according to the at least one historical tongue image set to obtain a target HPA-UNet network structure;
[0074] Performing preliminary segmentation on the original tongue image acquired in real time according to the target HPA-UNet network structure to obtain a segmented image corresponding to the tongue image;
[0075] According to a preset Sobel operator, the vertical edge and the horizontal edge of the original tongue image are respectively identified, and a first identification result obtained by identifying the vertical edge of the original tongue image and a second identification result obtained by identifying the horizontal edge of the original tongue image are merged to obtain an updated RGB image, and the updated RGB image is input into a trained shallow neural network to obtain an edge feature segmentation result;
[0076] The pixel points of the segmented image and the pixel points determined as the tongue area in the edge feature segmentation result are combined to obtain a final tongue image.
[0077] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A tongue image segmentation method based on a hybrid deep neural network, characterized in that: include: The HPA-UNet network structure is constructed according to the residual unit, the spatial attention mechanism and the channel attention mechanism. The HPA-UNet network structure includes an upsampling path composed of at least one upsampling module and a downsampling path composed of at least one downsampling module. In the downsampling module, assuming that the input feature map size is , the output after the 2x2 max pooling layer is ,The downsampling path consists of a spatial attention module, 2 convolutional layers with kernel size 3, stride 2, and padding 1; The downsampling path includes a first path consisting of a spatial attention module and a single-branch 1*1 convolutional layer and a second path consisting of a spatial attention module, a maximum pooling layer and an average pooling layer, wherein the HPA-UNet network structure uses a residual unit as a basic unit of the network, and the residual unit includes an input module, a first downsampling module, a second downsampling module, a third downsampling module, a first upsampling module, a second upsampling module and a third upsampling module; Acquire at least one historical tongue image, perform data enhancement on the at least one historical tongue image to obtain at least one historical tongue image set, and iteratively train the HPA-UNet network structure according to the at least one historical tongue image set to obtain a target HPA-UNet network structure; Performing preliminary segmentation on the original tongue image acquired in real time according to the target HPA-UNet network structure to obtain a segmented image corresponding to the tongue image; According to the preset Sobel operator, the vertical edge and the horizontal edge of the original tongue image are respectively identified, and the first identification result obtained by identifying the vertical edge of the original tongue image and the second identification result obtained by identifying the horizontal edge of the original tongue image are merged to obtain an updated RGB image, and the updated RGB image is input into the trained shallow neural network to obtain the edge feature segmentation result; the expression for identifying the vertical edge and the horizontal edge of the original tongue image according to the preset Sobel operator is: , In the formula, is the second recognition result obtained by recognizing the horizontal edge of the original tongue image, is the original tongue image, To multiply the elements one by one; , In the formula, A first recognition result obtained by recognizing the vertical edge of the original tongue image; The pixel points of the segmented image and the pixel points determined as the tongue area in the edge feature segmentation result are combined to obtain a final tongue image.
2. The tongue image segmentation method based on hybrid deep neural network according to claim 1 is characterized in that: The performing data enhancement on the at least one historical tongue image to obtain at least one historical tongue image set comprises: Setting a maximum rotation angle, rotating the at least one historical tongue image according to the maximum rotation angle, and obtaining a rotated image corresponding to the at least one historical tongue image; Randomly cropping the at least one historical tongue image from its original resolution to a cropped image with a horizontal resolution of 576*384 and a vertical resolution of 432*288, and enlarging the size of the cropped image to the same size as the at least one historical tongue image, to obtain a cropped image corresponding to the at least one historical tongue image; horizontally flipping the at least one historical tongue image to obtain a flipped image corresponding to the at least one historical tongue image; Adding Gaussian noise with a mean value of 0 and a variance of 0.4 to the at least one historical tongue image to obtain a noise image corresponding to the at least one historical tongue image; The rotated image, the cropped image, the flipped image and the noise image corresponding to the same historical tongue image are combined into a historical tongue image set, thereby obtaining at least one historical tongue image set.
3. The tongue image segmentation method based on hybrid deep neural network according to claim 1 is characterized in that: The expression for combining the first recognition result obtained by recognizing the vertical edge of the original tongue image and the second recognition result obtained by recognizing the horizontal edge of the original tongue image is: , In the formula, is the second recognition result obtained by recognizing the horizontal edge of the original tongue image, is a first recognition result obtained by recognizing the vertical edge of the original tongue image, is the updated RGB image.
4. The tongue image segmentation method based on hybrid deep neural network according to claim 1 is characterized in that: The initial segmentation of the original tongue image acquired in real time according to the target HPA-UNet network structure to obtain a segmented image corresponding to the tongue image includes: Given an original tongue image As the input of the ith downsampling module, the output of the ith downsampling module is , is the field of real numbers, is the number of channels of the feature map, is the height of the feature map, is the width of the feature map, where the expression for calculating the output of the i-th downsampling module is: , In the formula, is a shortcut function, It is the residual function, which consists of a spatial attention mechanism, a convolution with batch normalization, and a ReLU activation function; , In the formula, It is a 1*1 convolution with a step size of 2. For the original tongue image Perform average pooling, For the original tongue image Perform maximum pooling, To add elements one by one.
5. A tongue image segmentation system based on a hybrid deep neural network, characterized in that: include: A construction module, configured to construct an HPA-UNet network structure according to a residual unit, a spatial attention mechanism, and a channel attention mechanism, wherein the HPA-UNet network structure includes an upsampling path consisting of at least one upsampling module and a downsampling path consisting of at least one downsampling module, wherein the downsampling path includes a first path consisting of a spatial attention module and a single-branch 1*1 convolutional layer and a second path consisting of a spatial attention module, a maximum pooling layer, and an average pooling layer, wherein the HPA-UNet network structure uses a residual unit as a basic unit of the network, and the residual unit includes an input module, a first downsampling module, a second downsampling module, a third downsampling module, a first upsampling module, a second upsampling module, and a third upsampling module; a training module configured to obtain at least one historical tongue image, perform data enhancement on the at least one historical tongue image to obtain at least one historical tongue image set, and iteratively train the HPA-UNet network structure according to the at least one historical tongue image set to obtain a target HPA-UNet network structure; A segmentation module, configured to perform preliminary segmentation on the original tongue image acquired in real time according to the target HPA-UNet network structure to obtain a segmented image corresponding to the tongue image; The recognition module is configured to recognize the vertical edge and the horizontal edge of the original tongue image according to a preset Sobel operator, and merge the first recognition result obtained by recognizing the vertical edge of the original tongue image and the second recognition result obtained by recognizing the horizontal edge of the original tongue image to obtain an updated RGB image, and input the updated RGB image into the trained shallow neural network to obtain an edge feature segmentation result; the expression for recognizing the vertical edge and the horizontal edge of the original tongue image according to the preset Sobel operator is: , In the formula, is the second recognition result obtained by recognizing the horizontal edge of the original tongue image, is the original tongue image, To multiply the elements one by one; , In the formula, A first recognition result obtained by recognizing the vertical edge of the original tongue image; The fusion module is configured to take the union of each pixel point of the segmented image and the pixel point determined as the tongue area part in the edge feature segmentation result to obtain a final tongue image.
6. An electronic device, characterized in that: include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
CT image kidney segmentation algorithm based on residual double-attention deep network
CN110675406A
