A quality inspection system for traditional Chinese medicine based on image recognition

Through the traditional Chinese medicine quality inspection system based on image recognition, using cloud computing platform and three-dimensional image model, the problem of non-destructiveness and accuracy of traditional Chinese medicine quality detection is solved, rapid and scientific quality assessment of traditional Chinese medicine is realized, and the accuracy of detection is improved. and efficiency.

CN118674954BActive Publication Date: 2024-10-18CHANGCHUN UNIV OF CHINESE MEDICINE

Patent Information

Application Number
CN202411148202.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-10-18
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

Existing quality testing technologies for traditional Chinese medicines have problems such as long testing cycles, vulnerability to subjective factors, inability to conduct non-destructive testing, and inability to fully reflect the overall quality of traditional Chinese medicines.

Method used

A traditional Chinese medicine quality inspection system based on image recognition is used to connect the traditional Chinese medicine data collection module, training data analysis module and traditional Chinese medicine quality inspection module through the cloud computing platform, collect spectral image data and optical image data, generate a three-dimensional image model, and set detection areas and anomalies. In the pixel area, a traditional Chinese medicine quality inspection network is established to conduct non-destructive quality assessment.

Benefits of technology

While ensuring that the samples are not damaged, the accuracy of quality testing of traditional Chinese medicines is improved, and the standard quality, damaged status and moldy status of traditional Chinese medicines can be effectively detected, making the detection more scientific and rapid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118674954B_ABST
    Figure CN118674954B_ABST
Patent Text Reader

Abstract

The invention discloses a Chinese medicine quality detection system based on image recognition, relates to the field of image recognition technology, and effectively improves the accuracy of Chinese medicine quality detection. The invention generates a Chinese medicine three-dimensional image model according to a training image data set in each state, respectively sets a plurality of detection areas on the Chinese medicine three-dimensional image model, and then sets a plurality of pixel value jump vectors and abnormal pixel areas in each detection area, overlaps and maps the abnormal pixel areas generated when different model pixels are used as the first starting pixel, and then divides a plurality of abnormal condition areas in the detection area in different states, generates a target three-dimensional image model according to the detection image data set, sets a plurality of target detection areas in the target three-dimensional image model, and then obtains the detection pixel value jump vector of the target detection area, and performs quality assessment on the target Chinese medicine according to the matching condition between the detection pixel value jump vector and the abnormal condition area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image recognition, and in particular to a traditional Chinese medicine quality detection system based on image recognition. Background Art

[0002] As my country's traditional medical culture, Chinese medicine has a long history and significant curative effects, and is highly respected both at home and abroad. Traditional quality inspection methods often rely on manual visual inspection or chemical analysis, which has disadvantages such as long inspection cycles and susceptibility to subjective factors. Therefore, a more scientific, rapid and accurate inspection method is urgently needed.

[0003] The existing quality inspection technology for Chinese herbal medicines has the following defects:

[0004] Chemical analysis method: This method can accurately determine the content of active ingredients in traditional Chinese medicine, and has high quantitative analysis accuracy. However, this method requires the destruction of samples and cannot perform non-destructive testing on samples; it cannot fully reflect the overall quality of traditional Chinese medicine.

[0005] Infrared spectroscopy technology: This method can quickly obtain the spectral information of traditional Chinese medicine samples and analyze the physical structure and chemical composition of the samples. However, this method has high requirements for samples and is easily affected by sample preparation and environmental factors; its ability to analyze complex samples is limited.

[0006] Therefore, how to improve the accuracy of sample quality detection while ensuring that the sample is not damaged is a difficulty in the prior art. To this end, a traditional Chinese medicine quality detection system based on image recognition is provided. Summary of the invention

[0007] In order to solve the above technical problems, the purpose of the present invention is to provide a traditional Chinese medicine quality detection system based on image recognition.

[0008] In order to achieve the above object, the present invention provides the following technical solutions:

[0009] A Chinese medicine quality detection system based on image recognition, comprising a cloud computing platform, wherein the cloud computing platform is communicatively connected with a Chinese medicine data acquisition module, a training data analysis module and a Chinese medicine quality detection module;

[0010] The Chinese medicine data acquisition module is used to collect spectral image data and optical image data of various types of Chinese medicine in various states, and simultaneously collect real-time spectral image data and real-time optical image data of the target Chinese medicine, thereby generating a training image data set and a detection image data set;

[0011] The training data analysis module is used to generate a corresponding three-dimensional image model of traditional Chinese medicine according to the training image data set in each state, and set a number of detection areas on the three-dimensional image model of traditional Chinese medicine in each state, and then set a number of pixel value jump vectors and abnormal pixel areas in each detection area, and overlap and map the abnormal pixel areas generated when different model pixels are used as the first starting point pixel, and then divide a number of abnormal condition areas in the detection area under different states, and summarize the detection areas under different states to establish a traditional Chinese medicine quality detection network;

[0012] The traditional Chinese medicine quality detection module is used to generate a target three-dimensional image model of the target traditional Chinese medicine based on the detection image data set, set a number of target detection areas in the target three-dimensional image model, and then obtain the detection pixel value jump vectors of the target detection area, input all the detection pixel value jump vectors into the corresponding detection area in the traditional Chinese medicine quality detection network, and perform quality assessment on the target traditional Chinese medicine based on the matching status between the detection pixel value jump vectors and the abnormal condition area.

[0013] Furthermore, the generation process of the training image dataset and the detection image dataset includes:

[0014] The traditional Chinese medicine data acquisition module is provided with a plurality of spectrometers and cameras. The traditional Chinese medicine data acquisition module sends spectral signals to the traditional Chinese medicine in various states from multiple directions through the spectrometer, and at the same time, takes optical image data of the traditional Chinese medicine from the emission direction of the spectral signal through the camera;

[0015] According to the reflection degree of the spectral signal on each part of the Chinese medicine, the spectrometer generates the spectral reflection signal of the Chinese medicine in each state, and then obtains the spectral image data of the Chinese medicine in the corresponding state at each angle according to the spectral reflection signal;

[0016] The Chinese medicine data acquisition module integrates several pairs of optical image data and spectral image data of different types of Chinese medicine in various states to obtain training image data sets, and sets a number s for each training image data set n,1 、s n,2 、s n,3 ,……,s n,m , where s n,m represents the nth training image dataset in the mth state, where n and m are natural numbers greater than 0;

[0017] At the same time, the Chinese medicine data acquisition module uses a spectrometer and a camera to collect several real-time spectral image data and real-time optical image data of the target Chinese medicine according to the method of generating a training image data set, and then generates a detection image data set and annotates it with a number S i , where i is a natural number less than or equal to n and greater than 0.

[0018] Furthermore, the status of the traditional Chinese medicine includes a standard quality status, a damaged status, and a moldy status, wherein the standard quality status indicates that the corresponding traditional Chinese medicine has no damage and no moldy parts, the damaged status indicates that the corresponding traditional Chinese medicine has missing leaves, flowers, or branches, and the moldy status indicates that mold exists in the leaves, flowers, or branches of the corresponding traditional Chinese medicine.

[0019] Furthermore, the process of establishing a three-dimensional image model of each type of Chinese medicine according to the training image data set includes:

[0020] Generate spectral three-dimensional image models and optical three-dimensional image models of corresponding types of traditional Chinese medicine in various states according to the training image data set;

[0021] Overlapping and mapping the spectral three-dimensional image model and the optical three-dimensional image model corresponding to each type of traditional Chinese medicine under the same state and the same acquisition angle, and generating a local three-dimensional image model of the traditional Chinese medicine according to the overlapping mapping result;

[0022] k overlapping feature points are set at the edge position of each local three-dimensional image model of traditional Chinese medicine, the overlapping feature points on each local three-dimensional image model of traditional Chinese medicine are matched with each other, and a threshold value of the number of overlaps is set;

[0023] If the number of overlapping feature points of two local Chinese medicine three-dimensional image models that are continuously matched is greater than or equal to the overlapping number threshold, the local Chinese medicine three-dimensional image models are spliced ​​according to the positions of the mutually matched overlapping feature points, otherwise no operation is performed, wherein k is a natural number greater than 0;

[0024] Repeat the above matching and splicing operations to splice each local Chinese medicine 3D image model into a Chinese medicine 3D image model, and mark the number of the corresponding training image data set.

[0025] Furthermore, the process of dividing the abnormal pixel area includes:

[0026] For any type of traditional Chinese medicine, Num detection areas are respectively set on the three-dimensional image model of the traditional Chinese medicine in each state, and the detection areas are in a three-dimensional state, and the spatial volume size of each detection area is the same, where Num is a natural number greater than 0;

[0027] Set N model pixels in the detection area, establish a three-dimensional coordinate system, and map each detection area to the three-dimensional coordinate system, where N is a natural number greater than 0;

[0028] If the pixel value difference between the starting pixel and the model pixel at its adjacent position is less than 5%, a pixel value jump vector is generated with the model pixel with a relatively larger pixel value as the end point and the model pixel with a relatively smaller pixel value as the start point, and then the model pixel at the end point of the pixel value jump vector is recorded as the starting pixel, and the pixel value difference is compared with the model pixel at its adjacent position, and so on, until the starting pixel is a model pixel at the edge of the detection area, or the pixel value difference between the starting pixel and the model pixel at its adjacent position is more than 5%;

[0029] If the pixel value difference between the starting point pixel and the model pixel at its adjacent position is more than 5%, the model pixel at the adjacent position is marked as a difference model pixel;

[0030] When all pixel value jump vectors in the detection area stop extending, the difference model pixels at adjacent positions in the detection area are connected in sequence, and then several abnormal pixel areas are divided in the detection area.

[0031] Furthermore, the process of establishing the traditional Chinese medicine quality inspection network includes:

[0032] The abnormal pixel areas generated when different model pixels are sequentially used as the first starting pixel are overlapped and mapped, and several abnormal condition areas in each detection area under the corresponding state are generated according to the overlapped mapping results, and the model pixel at the center of the abnormal condition area is used as the starting point, and the corresponding pixel value jump vector is marked in the abnormal condition area, and the pixel value jump vector is recorded as the characteristic pixel value jump vector;

[0033] Each abnormal condition area is marked on the three-dimensional image model of traditional Chinese medicine in the corresponding state, and a corresponding abnormal score is set for each abnormal condition area. The three-dimensional image models of traditional Chinese medicine of the same type in various states are summarized to obtain the traditional Chinese medicine quality detection network of various types of traditional Chinese medicine.

[0034] Furthermore, for the three-dimensional image model of traditional Chinese medicine under standard quality conditions, there are only several detection areas that do not contain any abnormal conditions, and each detection area contains several pixel value jump vectors generated with the model pixel at its center position as the first starting pixel.

[0035] Furthermore, the process of quality assessment of target TCM includes:

[0036] The Chinese medicine quality detection module generates a target three-dimensional image model of the target Chinese medicine according to the detection image data set from the Chinese medicine data acquisition module, and then matches the corresponding Chinese medicine quality detection network according to the subscript number of the number carried by the detection image data set;

[0037] According to the division positions of each detection area on the three-dimensional image model of traditional Chinese medicine in the matched traditional Chinese medicine quality detection network, the same target detection area is divided on the target three-dimensional image model;

[0038] The model pixel at the center of each target detection area is taken as the first starting pixel, and then the detection pixel value jump vector of each target detection area is generated, and the detection pixel value jump vector of each target detection area is overlapped with the pixel value jump vector in the detection area on the three-dimensional image model of traditional Chinese medicine corresponding to the standard quality state in the traditional Chinese medicine quality detection network, and according to the cosine similarity between each detection pixel value jump vector and the pixel value jump vector, it is judged whether the corresponding target detection area is abnormal;

[0039] The starting point of the characteristic pixel value jump vector in the abnormal state area on the three-dimensional image model of traditional Chinese medicine in other states is overlapped by the target detection area with the abnormal state area, so as to obtain the cosine similarity;

[0040] If the number of occurrences of the cosine similarity between the detected pixel value jump vector and the pixel value jump vector within (0.95, 1) is greater than or equal to 90% of the total number of detected pixel value jump vectors, then the target detection area with an abnormality is judged to match the corresponding abnormal condition area, and the abnormal score of the abnormal condition area is accumulated, otherwise it is judged to be unmatched and no operation is performed;

[0041] According to the types of Chinese medicine, multiple abnormal score intervals are set for each Chinese medicine quality detection network, and the quality of the corresponding target Chinese medicine is judged according to the abnormal score interval in which the cumulative abnormal score is located.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] The present invention sets a plurality of detection areas on a three-dimensional image model of traditional Chinese medicine, sets a plurality of pixel value jump vectors and abnormal pixel areas in each detection area, performs overlapping mapping on the abnormal pixel areas generated when different model pixels are used as the first starting point pixels, thereby obtaining a plurality of abnormal condition areas divided in the detection area under different conditions, generates a target three-dimensional image model according to a detection image data set, obtains a detection pixel value jump vector of the target detection area, and performs quality assessment on the target traditional Chinese medicine according to the matching condition between the detection pixel value jump vector and the abnormal condition area, thereby ensuring that the sample is not damaged and improving the accuracy of sample quality detection at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention.

[0045] Figure 1 It is a schematic diagram of the present invention. DETAILED DESCRIPTION

[0046] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0047] like Figure 1 As shown, a Chinese medicine quality detection system based on image recognition includes a cloud computing platform, wherein the cloud computing platform is communicatively connected with a Chinese medicine data acquisition module, a training data analysis module, and a Chinese medicine quality detection module;

[0048] The traditional Chinese medicine data acquisition module is used to collect spectral image data and optical image data of various types of traditional Chinese medicine in standard quality states and various loss states, and then generate a training image data set in the corresponding state and send it to the detection data analysis module, and at the same time collect real-time spectral image data and real-time optical image data of the target traditional Chinese medicine, and generate a detection image data set and send it to the traditional Chinese medicine quality detection module;

[0049] The training data analysis module is used to generate a corresponding three-dimensional image model of traditional Chinese medicine according to the training image data set in each state, and set a number of detection areas on the three-dimensional image model of traditional Chinese medicine in each state, and then set a number of pixel value jump vectors and abnormal pixel areas in each detection area, and overlap and map the abnormal pixel areas generated when different model pixels are used as the first starting point pixel, and then divide a number of abnormal condition areas in the detection area under different states, and summarize the detection areas under different states to establish a traditional Chinese medicine quality detection network;

[0050] The traditional Chinese medicine quality detection module is used to generate a target three-dimensional image model of the target traditional Chinese medicine based on the detection image data set, set a number of target detection areas in the target three-dimensional image model, and then obtain the detection pixel value jump vectors of the target detection area, input all the detection pixel value jump vectors into the corresponding detection area in the traditional Chinese medicine quality detection network, and perform quality assessment on the target traditional Chinese medicine based on the matching status between the detection pixel value jump vectors and the abnormal condition area.

[0051] Further, the working principle of the present invention is described below by way of examples:

[0052] The traditional Chinese medicine data acquisition module is provided with a plurality of spectrometers and cameras, and the traditional Chinese medicine data acquisition module collects spectral image data and optical image data of various types of traditional Chinese medicine in different states through the spectrometers and cameras. The specific process includes:

[0053] The status of the Chinese medicine includes a standard quality status, a damaged status, a moldy status, etc., wherein the standard quality status indicates that the corresponding Chinese medicine has no damage and no moldy parts, the damaged status indicates that the leaves, flowers, branches, etc. of the corresponding Chinese medicine are missing, and the moldy status indicates that the leaves, flowers, branches, etc. of the corresponding Chinese medicine have molds;

[0054] The Chinese medicine data acquisition module sends spectral signals to the Chinese medicine in various states from multiple directions through a spectrometer, and at the same time uses a camera to capture optical image data of the Chinese medicine from the direction in which the spectral signals are emitted;

[0055] According to the reflection degree of the spectral signal on each part of the Chinese medicine, the spectrometer generates the spectral reflection signal of the Chinese medicine in each state, and then obtains the spectral image data of the Chinese medicine in the corresponding state at each angle according to the spectral reflection signal;

[0056] The Chinese medicine data acquisition module integrates several pairs of optical image data and spectral image data of different types of Chinese medicine in various states to obtain training image data sets, and sets a number s for each training image data set n,1 、s n,2 、s n,3 ,……,s n,m , where s n,m represents the nth training image dataset in the mth state, where n and m are natural numbers greater than 0;

[0057] At the same time, the Chinese medicine data acquisition module uses a spectrometer and a camera to collect several real-time spectral image data and real-time optical image data of the target Chinese medicine according to the method of generating a training image data set, and then generates a detection image data set and annotates it with a number S i , where i is a natural number less than or equal to n and greater than 0.

[0058] Further, the traditional Chinese medicine data acquisition module sends all training image data sets to the training data analysis module, and sends the detection image data sets to the traditional Chinese medicine quality detection module;

[0059] The training data analysis module establishes a three-dimensional image model of each type of Chinese medicine based on the training image data set. The specific process includes:

[0060] First, the training data analysis module classifies each training image data set according to the first subscript number of the number of each training image data set;

[0061] Then, the image data set is trained to generate spectral three-dimensional image models and optical three-dimensional image models of the corresponding types of traditional Chinese medicine in various states;

[0062] Since the reflection degree of spectral signals of various parts of traditional Chinese medicine is inconsistent, the spectral reflection signals generated by various parts are inconsistent. Therefore, the spectral three-dimensional image model generated according to the spectral reflection signals at different angles can represent the internal condition of the corresponding traditional Chinese medicine. At the same time, the camera collects optical image data and generates an optical three-dimensional image model to represent the appearance condition of the traditional Chinese medicine.

[0063] Overlapping and mapping the spectral three-dimensional image model and the optical three-dimensional image model corresponding to each type of traditional Chinese medicine under the same state and the same acquisition angle, and generating a local three-dimensional image model of the traditional Chinese medicine according to the overlapping mapping result;

[0064] k overlapping feature points are set at the edge position of each local three-dimensional image model of traditional Chinese medicine, the overlapping feature points on each local three-dimensional image model of traditional Chinese medicine are matched with each other, and a threshold value of the number of overlaps is set;

[0065] If the number of overlapping feature points of two local traditional Chinese medicine three-dimensional image models that are continuously matched is greater than or equal to the overlapping number threshold, the local traditional Chinese medicine three-dimensional image models are spliced ​​according to the positions of the overlapping feature points that match each other;

[0066] If the number of overlapping feature points of two local TCM 3D image models that are continuously matched is less than the overlapping number threshold, no operation is performed;

[0067] Repeat the above matching and splicing operations to splice each local Chinese medicine 3D image model into a Chinese medicine 3D image model, and mark the number of the corresponding training image data set.

[0068] Further, for any type of traditional Chinese medicine, Num detection areas are respectively set on the three-dimensional image model of the traditional Chinese medicine in each state, the detection areas are in a three-dimensional state, and the spatial volume of each detection area is the same, wherein Num is a natural number greater than 0;

[0069] It should be noted that the positions of the detection areas on the three-dimensional image models of Chinese medicines of the same type in different states are the same, while the positions of the detection areas on the three-dimensional image models of Chinese medicines of different types in different states are not exactly the same;

[0070] Set N model pixels in the detection area, establish a three-dimensional coordinate system, and map each detection area to the three-dimensional coordinate system, where N is a natural number greater than 0;

[0071] It should be noted that, in actual applications, the same type of Chinese medicine presents certain differences in shape, so the parts of the same type of Chinese medicine in different states are divided into detection areas of the same size;

[0072] Starting from the first model pixel in the detection area, the model pixel at the starting position is recorded as the starting point pixel, and the pixel value difference relationship between it and the model pixel at the adjacent position is determined;

[0073] When the Chinese medicine has mold, damage or aging, the model pixels of the corresponding part on the three-dimensional image model of the Chinese medicine will show regular pixel changes. For example, when mold appears on the surface of the Chinese medicine, the three-dimensional image model of the Chinese medicine generated according to the optical image data of the corresponding part will show obvious pixel differences. When the roots, stems, branches and leaves of the Chinese medicine are damaged, obvious pixel loss will appear on the corresponding part of the three-dimensional image model of the Chinese medicine.

[0074] Based on the above reasons, if the pixel value difference between the starting point pixel and the model pixel at the adjacent position is less than 5%, a pixel value jump vector is generated with the model pixel with a relatively larger pixel value as the end point and the model pixel with a relatively smaller pixel value as the start point, and then the model pixel at the end point of the pixel value jump vector is recorded as the starting point pixel, and the pixel value difference is compared with the model pixel at the adjacent position, and so on, until the starting point pixel is a model pixel at the edge position of the detection area, or the pixel value difference between the starting point pixel and the model pixel at the adjacent position is more than 5%;

[0075] If the pixel value difference between the starting point pixel and the model pixel at its adjacent position is more than 5%, the model pixel at the adjacent position is marked as a difference model pixel;

[0076] When all pixel value jump vectors in the detection area stop extending, the difference model pixels at adjacent positions in the detection area are connected in sequence, and then several abnormal pixel areas are divided in the detection area;

[0077] It should be noted that when the three-dimensional image model of traditional Chinese medicine is in a non-standard quality state, and the first starting point pixel selected is at a damaged position or an abnormal position such as mold, the corresponding generated pixel value jump vector and the difference model pixel will be concentrated at the position corresponding to the damaged position or the abnormal position such as mold in the three-dimensional image model of traditional Chinese medicine;

[0078] Then, the abnormal pixel areas generated when different model pixels are used as the first starting pixel are overlapped and mapped, and several abnormal condition areas in each detection area under the corresponding state are generated according to the overlapped mapping results, and the model pixel at the center of the abnormal condition area is used as the starting point, and the corresponding pixel value jump vector is marked in the abnormal condition area, and the pixel value jump vector is recorded as the characteristic pixel value jump vector;

[0079] Each abnormal condition area is marked on the three-dimensional image model of the traditional Chinese medicine in the corresponding state, and a corresponding abnormal score is set for each abnormal condition area. The three-dimensional image models of the traditional Chinese medicine of the same type in various states are summarized, and then the traditional Chinese medicine quality detection network of each type of traditional Chinese medicine is obtained;

[0080] It should be noted that, for the three-dimensional image model of traditional Chinese medicine under standard quality conditions, there are only a few detection areas that do not contain any abnormal conditions, and each detection area contains a number of pixel value jump vectors generated with the model pixel at its center position as the first starting pixel.

[0081] Further, the training data analysis module sends the Chinese medicine quality detection network of each type of Chinese medicine to the Chinese medicine quality detection module;

[0082] The Chinese medicine quality detection module generates a target three-dimensional image model of the target Chinese medicine according to the detection image data set from the Chinese medicine data acquisition module, and then matches the corresponding Chinese medicine quality detection network according to the subscript number of the number carried by the detection image data set;

[0083] According to the division positions of each detection area on the three-dimensional image model of traditional Chinese medicine in the matched traditional Chinese medicine quality detection network, the same target detection area is divided on the target three-dimensional image model;

[0084] Taking the model pixel at the center position of each target detection area as the first starting pixel, the detection pixel value jump vector of each target detection area is generated, and the detection pixel value jump vector of each target detection area is overlapped with the pixel value jump vector in the detection area on the three-dimensional image model of traditional Chinese medicine corresponding to the standard quality state in the traditional Chinese medicine quality detection network, so as to obtain the cosine similarity between each detection pixel value jump vector and the pixel value jump vector;

[0085] If the number of occurrences of the cosine similarity between the detection pixel value jump vector and the pixel value jump vector within (0.95, 1) is greater than or equal to 90% of the total number of detection pixel value jump vectors, the corresponding target detection area is judged to be normal;

[0086] If the number of occurrences of the cosine similarity between the detected pixel value jump vector and the pixel value jump vector within (0.95, 1) is less than 90% of the total number of detected pixel value jump vectors, it is judged that the corresponding target detection area has an abnormality;

[0087] The starting point of the characteristic pixel value jump vector in the abnormal state area on the three-dimensional image model of traditional Chinese medicine in other states is overlapped by the target detection area with the abnormal state area, so as to obtain the cosine similarity;

[0088] If the number of occurrences of the cosine similarity between the detected pixel value jump vector and the pixel value jump vector within (0.95, 1) is greater than or equal to 90% of the total number of detected pixel value jump vectors, then the target detection area with an abnormality is judged to match the corresponding abnormal condition area, and the abnormal score of the abnormal condition area is accumulated, otherwise it is judged to be unmatched and no operation is performed;

[0089] According to the types of traditional Chinese medicine, a first abnormal score interval (0, β1), a second abnormal score interval [β1, β2) and a third abnormal score interval [β2, ∞] are set for each traditional Chinese medicine quality detection network;

[0090] If the cumulative abnormal score corresponding to the target three-dimensional image model is in the first abnormal score interval (0, β1), the quality of the corresponding target traditional Chinese medicine is judged to be high quality;

[0091] If the cumulative abnormal score corresponding to the target three-dimensional image model is in the second abnormal score interval [β1, β2), the quality of the corresponding target traditional Chinese medicine is judged to be low quality;

[0092] If the cumulative abnormal score corresponding to the target three-dimensional image model is in the third abnormal score interval [β2, ∞), the quality of the corresponding target traditional Chinese medicine is judged to be low quality.

[0093] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A Chinese medicine quality inspection system based on image recognition, including a cloud computing platform, It is characterized in that The cloud computing platform is communicatively connected with a traditional Chinese medicine data acquisition module, a training data analysis module and a traditional Chinese medicine quality detection module; The Chinese medicine data acquisition module is used to collect spectral image data and optical image data of various types of Chinese medicine in various states, and simultaneously collect real-time spectral image data and real-time optical image data of the target Chinese medicine, thereby generating a training image data set and a detection image data set; The generation process of the training image data set and the detection image data set includes: The traditional Chinese medicine data acquisition module is provided with a plurality of spectrometers and cameras. The traditional Chinese medicine data acquisition module sends spectral signals to the traditional Chinese medicine in various states from multiple directions through the spectrometer, and at the same time, takes optical image data of the traditional Chinese medicine from the emission direction of the spectral signal through the camera; According to the reflection degree of the spectral signal on each part of the Chinese medicine, the spectrometer generates the spectral reflection signal of the Chinese medicine in each state, and then obtains the spectral image data of the Chinese medicine in the corresponding state at each angle according to the spectral reflection signal; The Chinese medicine data acquisition module integrates several pairs of optical image data and spectral image data of different types of Chinese medicine in various states to obtain training image data sets, and sets a number s for each training image data set n,1 、s n,2 、s n,3 ,……,s n,m , where s n,m represents the nth training image dataset in the mth state, where n and m are natural numbers greater than 0; At the same time, according to the method of generating training image datasets, the detection image dataset of the target Chinese medicine is generated and labeled with the number S i , where i is a natural number less than or equal to n and greater than 0; The training data analysis module is used to generate a corresponding three-dimensional image model of traditional Chinese medicine according to the training image data set in each state, and set a number of detection areas on the three-dimensional image model of traditional Chinese medicine in each state, and then set a number of pixel value jump vectors and abnormal pixel areas in each detection area, and overlap and map the abnormal pixel areas generated when different model pixels are used as the first starting point pixel, and then divide a number of abnormal condition areas in the detection area under different states, and summarize the detection areas under different states to establish a traditional Chinese medicine quality detection network; The process of establishing a three-dimensional image model of each type of Chinese medicine according to the training image data set includes: Generate spectral three-dimensional image models and optical three-dimensional image models of corresponding types of traditional Chinese medicine in various states according to the training image data set, overlap and map the spectral three-dimensional image models and optical three-dimensional image models generated corresponding to each type of traditional Chinese medicine in the same state and the same acquisition angle, and generate a local three-dimensional image model of the traditional Chinese medicine according to the overlap mapping result; k overlapping feature points are set at the edge position of each local Chinese medicine 3D image model, and the overlapping feature points on each local Chinese medicine 3D image model are matched with each other. According to the matching results, each local Chinese medicine 3D image model is spliced ​​into a Chinese medicine 3D image model, and the number of the corresponding training image data set is marked; The process of dividing the abnormal pixel area includes: For any type of traditional Chinese medicine, Num detection areas are respectively set on the three-dimensional image model of the traditional Chinese medicine in each state, and the detection areas are in a three-dimensional state, and the spatial volume size of each detection area is the same, where Num is a natural number greater than 0; Set N model pixels in the detection area, establish a three-dimensional coordinate system, and map each detection area to the three-dimensional coordinate system, where N is a natural number greater than 0; If the pixel value difference between the starting pixel and the model pixel at its adjacent position is less than 5%, a pixel value jump vector is generated with the model pixel with a relatively larger pixel value as the end point and the model pixel with a relatively smaller pixel value as the start point, and then the model pixel at the end point of the pixel value jump vector is recorded as the starting pixel, and the pixel value difference is compared with the model pixel at its adjacent position, and so on, until the starting pixel is a model pixel at the edge of the detection area, or the pixel value difference between the starting pixel and the model pixel at its adjacent position is more than 5%; If the pixel value difference between the starting point pixel and the model pixel at its adjacent position is more than 5%, the model pixel at the adjacent position is marked as a difference model pixel; When all pixel value jump vectors in the detection area stop extending, the difference model pixels at adjacent positions in the detection area are connected in sequence, and then several abnormal pixel areas are divided in the detection area; The process of establishing the traditional Chinese medicine quality inspection network includes: The abnormal pixel areas generated when different model pixels are sequentially used as the first starting pixel are overlapped and mapped, and several abnormal condition areas in each detection area under the corresponding state are generated according to the overlapped mapping results, and the model pixel at the center of the abnormal condition area is used as the starting point, and the corresponding pixel value jump vector is marked in the abnormal condition area, and the pixel value jump vector is recorded as the characteristic pixel value jump vector; Each abnormal condition area is marked on the three-dimensional image model of the traditional Chinese medicine in the corresponding state, and a corresponding abnormal score is set for each abnormal condition area. The three-dimensional image models of the traditional Chinese medicine of the same type in various states are summarized, and then the traditional Chinese medicine quality detection network of each type of traditional Chinese medicine is obtained; The traditional Chinese medicine quality detection module is used to generate a target three-dimensional image model of the target traditional Chinese medicine based on the detection image data set, set a number of target detection areas in the target three-dimensional image model, and then obtain the detection pixel value jump vectors of the target detection area, input all the detection pixel value jump vectors into the corresponding detection area in the traditional Chinese medicine quality detection network, and perform quality assessment on the target traditional Chinese medicine based on the matching status between the detection pixel value jump vectors and the abnormal condition area.

2. A Chinese medicine quality detection system based on image recognition according to claim 1, It is characterized in that The status of the traditional Chinese medicine includes a standard quality status, a damaged status, and a moldy status, wherein the standard quality status indicates that the corresponding traditional Chinese medicine has no damage and no moldy parts, the damaged status indicates that the leaves, flowers, or branches of the corresponding traditional Chinese medicine are missing, and the moldy status indicates that mold exists in the leaves, flowers, or branches of the corresponding traditional Chinese medicine.

3. A Chinese medicine quality detection system based on image recognition according to claim 1, It is characterized in that There are only a number of detection areas that do not contain any abnormal condition areas on the three-dimensional image model of traditional Chinese medicine in the standard quality state, and each detection area contains a number of pixel value jump vectors generated with the model pixel at its center position as the first starting pixel.

4. A Chinese medicine quality detection system based on image recognition according to claim 3, It is characterized in that The process of quality assessment of target Chinese medicines includes: Generate a target three-dimensional image model of the target traditional Chinese medicine according to the detection image data set, and match the corresponding traditional Chinese medicine quality detection network according to the subscript number of the number carried by the detection image data set; According to the matched traditional Chinese medicine quality inspection network, the same target inspection area is divided on the target three-dimensional image model, and the model pixel at the center position of each target inspection area is used as the first starting pixel, and then the detection pixel value jump vector of each target inspection area is generated, and according to the cosine similarity between each detection pixel value jump vector and the corresponding pixel value jump vector under the standard quality state, it is judged whether the corresponding target inspection area is abnormal; The starting point of the characteristic pixel value jump vector of the target detection area judged to have an abnormality is overlapped with that of the abnormal condition area of ​​the three-dimensional image model of traditional Chinese medicine in other states, so as to obtain the cosine similarity; If the number of occurrences of the cosine similarity between the detected pixel value jump vector and the pixel value jump vector within (0.95, 1) is greater than or equal to 90% of the total number of detected pixel value jump vectors, then the target detection area with an abnormality is judged to match the corresponding abnormal condition area, and the abnormal score of the abnormal condition area is accumulated, otherwise it is judged to be unmatched and no operation is performed; According to the types of Chinese medicine, multiple abnormal score intervals are set for each Chinese medicine quality detection network, and the quality of the corresponding target Chinese medicine is judged according to the abnormal score interval in which the cumulative abnormal score is located.

Citation Information

Patent Citations

  • MRI multi-modal image segmentation method and system based on ACU-Net

    CN112215844A

  • Product quality real-time nondestructive testing method based on video hyperspectral imaging technology

    CN114663821A

Cited By

  • Quality detection method of mitochondrial nutrient goat milk powder based on image processing

    CN119861044A

  • A quality detection method for mitochondrial nutrient goat milk powder based on image processing

    CN119861044B