Gastrodia elata quality detection method based on computer vision technology
By collecting multimodal data of Gastrodia elata through multi-source equipment, constructing a three-dimensional feature network, and combining deep learning to evaluate the quality of Gastrodia elata, the problems of low detection efficiency and low accuracy in existing technologies are solved, and the automated and precise detection and rating of Gastrodia elata quality are realized.
Patent Information
- Application Number
- CN202510952944.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-10-14
AI Technical Summary
Existing Gastrodia elata quality assessment technology relies on manual sensory judgment, which has problems such as strong subjectivity, low detection efficiency and low accuracy, especially in the identification of three-dimensional morphology and internal defects.
Multi-source equipment is used to collect multimodal data of Gastrodia elata, and quality feature vectors are generated through illumination compensation and feature extraction. A three-dimensional feature network is constructed, and deep learning is combined for quality assessment and grading. Industrial cameras, infrared imagers, 3D scanning equipment and spectrometers are used to obtain visual, temperature and chemical composition information.
It has achieved automated and precise detection of Gastrodia elata quality, improved detection efficiency and recognition accuracy, and is able to identify three-dimensional morphology and internal defects, and generate explainable quality assessment reports.
Smart Images

Figure CN120778723A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of intelligent detection, in particular to a ginseng quality detection method based on computer vision technology. BACKGROUND
[0002] In the modernization process of traditional Chinese medicine, as an important traditional Chinese medicinal material, the industrial scale of ginseng is continuously expanding. At present, the application range of ginseng is extended from traditional decoction to various Chinese patent medicines and health products, and the market puts forward higher demands on the stability and reliability of the quality of ginseng. With the innovation of planting technology, the yield of ginseng is significantly improved, but different producing areas and planting methods lead to uneven quality of ginseng, so that accurate quality evaluation becomes a key link in the development of the industry. However, the current ginseng quality evaluation technology is difficult to match the development speed of the industry, and still has many deficiencies.
[0003] At present, the quality evaluation of ginseng has long relied on artificial sensory judgment, relying on the experience of appraisers, and is evaluated by observing the appearance, color and luster, smelling the smell, touching the texture and the like. This method is highly subjective, and the evaluation results of different appraisers are prone to deviation, and the recognition ability for subtle differences and internal quality defects is limited. In recent years, the detection method based on image recognition has made progress, but most of them focus on two-dimensional image analysis, and only part of the surface characteristics of ginseng can be obtained, and the complex three-dimensional morphology cannot be displayed, and the defects such as insect damage and mildew existing in the internal part are difficult to detect. At the same time, there are shortcomings in the detection of chemical components, resulting in low detection efficiency and low quality recognition accuracy in the process of detecting the quality of ginseng.
[0004] In order to solve the above-mentioned defects, the present application provides a technical scheme. SUMMARY
[0005] The purpose of the present application is to solve the problems of low detection efficiency and low quality recognition accuracy, and to provide a ginseng quality detection method based on computer vision technology.
[0006] The purpose of the present application can be realized by the following technical scheme:
[0007] A ginseng quality detection method based on computer vision technology, comprising:
[0008] S1, ginseng data acquisition and processing: the multi-modal data of ginseng is collected by multi-source equipment in all directions, and light compensation and feature extraction are carried out, so as to provide standardized data for quality detection;
[0009] S2, quality feature vector generation: multi-dimensional feature extraction is carried out on the preprocessed data, and a unified ginseng quality feature vector is generated;
[0010] S3, quality characteristic map construction: a three-dimensional characteristic network is constructed through the quality characteristic vector of Gastrodia and multi-dimensional data, the correlation between characteristics is established based on cross-modal mapping, and an interpretable quality evaluation knowledge graph is formed;
[0011] S4, quality evaluation and grading: based on the multi-dimensional characteristics of the quality characteristic map, the quality of Gastrodia is evaluated and graded.
[0012] As a further improvement of the application, the specific operation process of the Gastrodia data acquisition comprises:
[0013] By deploying an industrial camera to capture RGB color images to obtain visual features, including appearance color, texture and shape; by deploying a photosensitive sensor to collect environmental light intensity in real time;
[0014] The compensation value is obtained by the formula , and the uneven illumination correction is carried out; wherein, represents the original pixel value; , represents the illumination adjustment coefficient; , represents the reference brightness offset;
[0015] The infrared imager deployed collects the surface temperature of Gastrodia and converts it into a thermal map to detect surface moisture anomalies and heating uniformity;
[0016] The 3D scanning device emits a multi-line laser array transmitter, cooperates with an electric rotating table with an encoder, and collects point cloud data each time the rotating table rotates , constructs a three-dimensional point cloud model and calculates three-dimensional geometric data to obtain key morphological characteristics;
[0017] Near-infrared and mid-infrared spectrometers collect spectral data;
[0018] A unified trigger signal is generated by a programmable logic controller and transmitted to each device to realize clock synchronization and mark a unified timestamp during acquisition, and the spectral data is aligned according to the timestamp using linear interpolation.
[0019] As a further improvement of the application, the specific operation steps of the Gastrodia data processing are as follows:
[0020] The RGB three-channel pixel values are converted to single-channel grayscale values according to the human eye sensitivity and by the formula , wherein, RGB three-channel pixel values are respectively the influence weight factor; a grayscale histogram is constructed, the optimal separation threshold is calculated, and the grayscale image is binarized;
[0021] A radial coordinate system is established with the geometric center of the tuber as the origin, the rate of change of temperature with radial distance is calculated based on the finite difference method, the maximum radial gradient, mean value and variance are extracted to construct a three-dimensional temperature gradient vector; the moisture aggregation area has low temperature due to evaporation heat absorption, and the absolute value of the maximum radial gradient increases, the mean value deviates to the negative side, and the variance increases;
[0022] 3D point cloud data: based on voxel network filtering and Gaussian filtering to remove outliers, find k nearest neighbor points for each point to construct a local field, and calculate the deviation interproduct matrix to obtain the principal curvature, quantize the surface curvature degree based on the average curvature, label the abnormal area based on the threshold, construct a 3D-2D mapping matrix, project the curvature abnormal points to the RGB image, and verify the defect type combined with the color texture feature, including rot, worm, mechanical damage, mildew and dry cracking.
[0023] As a further improvement of the application, the specific operation process of S2 is as follows:
[0024] Extract key morphological features from three-dimensional point cloud data; at the same time, extract surface texture features, obtain statistical features including energy and entropy value based on gray level co-occurrence matrix, and construct a differential texture feature library of different grades of Gastrodia; extract color features of Gastrodia in RGB color space, and analyze overall color distribution based on color histogram and matrix;
[0025] Extract the type, size, location and number of defects, and get the defect score through the formula Wherein, represents the total number of defects; represents the first defect; represents the assignment of defect type, including worm = 5, mildew = 4, mechanical damage = 3, rot = 2 and dry cracking = 1; represents the defect size, which refers to the proportion of defect area to the surface area of Gastrodia; represents the defect location, which refers to the assignment of the influence of location on quality, including top defect = 3, middle defect = 2 and bottom defect = 1, which is adjusted based on defect area; represents the number of defects, which refers to the density of defects of the same type; are the influence weight factors of the type, size, location and number of defects respectively;
[0026] The greater the score, the more serious the quality influence; the multi-dimensional features are weighted and fused through attention mechanism to generate Gastrodia quality feature vector.
[0027] As a further improvement of the application, the specific implementation process of S3 is as follows:
[0028] Obtain three-dimensional geometric data, key morphological features and average curvature, and establish the topological hierarchical relationship of the tuber main body, the top boss, the horizontal ring and the longitudinal wrinkle based on the three-dimensional point cloud skeleton extraction algorithm; take the curvature abnormal point of the pit defect as a node, and the topological connection relationship of the longitudinal wrinkle as an edge, to construct the mold correlation path of the intersection area of the pit defect and the longitudinal wrinkle;
[0029] Extract the main color, color uniformity, texture complexity and gray level co-occurrence matrix energy of the texture feature from the RGB image; quantify the maximum radial gradient and the proportion of the low temperature area by the heat map, superimpose the texture and the temperature gradient based on the 3D-2D mapping matrix, and project the curvature abnormal point to the RGB image to label the defect color feature;
[0030] Establish a defect feature matrix, and quantify the defect type from three-dimensional geometry, RGB vision and heat map multidimensional features; construct a defect propagation path graph of pits, cracks and mold based on a graph convolution network;
[0031] Construct the spectrum and component correlation by near-infrared and mid-infrared spectrum technology.
[0032] As a further improvement of the application, the specific operation steps of S4 include:
[0033] Extract the volume data in the three-dimensional geometric data and compare it with the standard sample volume of the pre-constructed gastrodia tuber sample library to obtain the volume integrity; obtain the top boss density by counting the proportion of the top boss area point cloud in the overall point cloud; obtain the continuity profile score by identifying the horizontal ring profile using an edge detection algorithm; and obtain the physical morphological feature value based on a weighted formula ;
[0034] Extract the color uniformity in the color feature, and count the energy value and entropy value of the feature; obtain the surface feature value by a weighted formula ;
[0035] Extract the spectrum data, obtain the corresponding chemical component content contained in gastrodia tuber through the constructed spectrum and component correlation, the chemical components include gastrodin content, polysaccharide content and impurity content, and obtain the chemical component value by a weighted formula ;
[0036] Extract the physical morphological feature value , the surface feature value , the defect score and the chemical component value , obtain the comprehensive score by a formula , wherein are the influence weight factors of the physical morphology, the surface feature, the defect correlation and the chemical attribute respectively;
[0037] When When When When When When the
[0038] It adopts an architecture that combines transfer learning with attention mechanism, uses pre-trained convolutional networks to extract RGB deep visual features, integrates 3D point clouds and heat maps to construct multimodal tensors, and uses multi-head attention to weightedly fuse morphological features. The features are mapped into quality scores through fully connected layers and output grade judgments.
[0039] As a further improvement of the present invention, the specific operation steps of S4 further include:
[0040] When the number of unqualified products per unit time reaches 10% of the total inspections, the unqualified cause analysis process is triggered:
[0041] Extract the quality feature vectors of all unqualified products and decompose them into morphological features, texture features, defect features and chemical features; build an unqualified feature dataset ,in, represents the unqualified feature dataset; Indicates the The feature vector of unqualified products, , It is an integer, which refers to the total number of unqualified products;
[0042] By formula Get the characteristic influence value; among them, Represents the multi-classification normalization function; represents the symbol of partial derivative; The preset weight factor for the unqualified feature dataset;
[0043] Based on the feature influence values, the morphological, texture, defect and chemical influence values are obtained, and the influence values are compared with the preset thresholds. When the influence value is lower than the preset threshold, it is determined to be the main influencing factor; an unqualified quality evaluation report is generated, which includes the overall rating, scores for each dimension, main influencing factors and improvement suggestions.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] This invention uses deployed industrial cameras and 3D scanning equipment to accurately capture three-dimensional morphology and surface texture. Infrared imagers are combined with thermal maps to detect moisture anomalies and heating uniformity. Spectroscopic technology correlates chemical composition. Data processing uses illumination compensation, curvature calculation, feature extraction, and fusion to generate quality feature vectors, significantly improving the efficiency of large-scale detection.
[0046] The application constructs a cross-modal three-dimensional feature map, realizes quality automatic grading and defect tracing by combining deep learning, maps features such as morphology, color and defects into an interpretable quality score through a graph neural network and a transfer learning architecture, analyzes main influencing factors when the unqualified rate exceeds a threshold, and generates an evaluation report containing chemical properties and morphological characteristics, thereby significantly improving the accuracy of ginseng quality identification. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to facilitate the understanding of those skilled in the art, the application will be further described below in conjunction with the drawings;
[0048] Figure 1 The method flowchart of the application. DETAILED DESCRIPTION
[0049] The technical solutions of the application will be described below in conjunction with the embodiments, obviously, the described embodiments are only part of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor belong to the protection scope of the application.
[0050] It should be understood that the terms "include" and "contain" used in the specification and claims of the present disclosure indicate the presence of the described features, whole, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, whole, steps, operations, elements, components and / or their sets.
[0051] It should also be understood that the terms used herein in the specification of the present disclosure are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. As used in the specification and claims of the present disclosure, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms. It should be further understood that the term "and / or" used in the specification and claims of the present disclosure means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0052] As Figure 1 shown, a ginseng quality detection method based on computer vision technology includes image acquisition and preprocessing,
[0053] S1, ginseng data acquisition and processing: multi-source equipment is used to collect multi-modal data of ginseng in all directions, and light compensation and feature extraction are performed to provide standardized data for quality detection;
[0054] S101、data collection: multi-source equipment includes industrial camera, infrared imager 3D scanning device and near-infrared and mid-infrared spectrometer, wherein:
[0055] By deploying the industrial camera with lens above the object table and on the side, the RGB color image of Gastrodia elata is captured to obtain the visual features of the Gastrodia elata sample, including appearance color, texture and shape; and the ambient light intensity is collected in real time by the photosensitive sensor , the compensation value is calculated by the formula ; wherein, represents the original pixel value; , represents the illumination adjustment coefficient, which is adjusted based on the ambient light intensity; , represents the reference brightness offset;
[0056] Based on the compensation value, the uneven illumination is corrected to ensure the consistency of image brightness;
[0057] The infrared imager deployed above the object table collects the temperature of the surface of Gastrodia elata and converts it into a thermal map, based on which the moisture anomaly of the surface of Gastrodia elata and the uniformity of heating of Gastrodia elata during processing are detected;
[0058] The 3D scanning device emits light signals to Gastrodia elata through the multi-line laser array transmitter deployed on the side of the object table , and receives the reflected information; the laser transmitter is flush with the center height of the object table; an electric rotating table and a high-precision encoder are added to the 3D scanning device, and the point cloud data of Gastrodia elata is collected once for each rotation of the rotating table ; the rotation angle positioning accuracy of the rotating table is improved to , and the rotating speed of the rotating table is also improved synchronously; the spatial position of the surface of Gastrodia elata is converted into a series of discrete three-dimensional coordinate points to construct a three-dimensional point cloud model; based on the three-dimensional point cloud data, the three-dimensional geometric data of the rhizome of Gastrodia elata is calculated, including volume, curvature and concave-convex degree; based on the three-dimensional geometric data, the key morphological features of Gastrodia elata are identified, including the top boss structure, the bottom pit feature, the horizontal ring pattern and the vertical wrinkle;
[0059] The near-infrared and mid-infrared spectrometer collects spectral data; which is used to provide a basis for chemical composition analysis;
[0060] A unified trigger signal is generated by a programmable logic controller, transmitted to the industrial camera through a hardware trigger interface, based on a hardware trigger mode, ensuring that the time difference of multi-view image acquisition is less than a preset threshold, cooperating with the rotation of the rotating table, realizing image stitching; and is transmitted to the infrared imager and the 3D scanning device synchronously; through interrupt response, the acquisition clock is synchronized, and a unified time stamp is marked during data collection; the linear interpolation method is used to align the time stamp for spectral data;
[0061] S102, Gastrodia Data Processing: Based on the characteristics of RGB color image, heat map and 3D point cloud data, different methods are used for processing respectively; The specific processing process is as follows:
[0062] For RGB color image, the RGB three-channel pixel value is converted into single-channel gray value based on human eye sensitivity, and the single-channel gray value is calculated by formula , wherein , are the influence weight factors of RGB three-channel pixel value;
[0063] Based on the single-channel gray value, the gray histogram is constructed and the optimal segmentation threshold is calculated ; Based on the optimal segmentation threshold, the gray image is binarized into a binary image of white gastrodia main body and black background;
[0064] For heat map, the temperature matrix is obtained based on infrared imager ; The radial coordinate system is established based on the geometric center of gastrodia rhizome as the origin , wherein is the coordinate value relative to the geometric center origin in the plane rectangular coordinate system; The radial gradient is calculated by finite difference method , wherein represents the rate of change of temperature with radial distance; represents the partial derivative symbol;
[0065] The maximum radial gradient , the mean value and the variance are extracted, and the three-dimensional temperature gradient vector is constructed; Based on the three-dimensional temperature gradient vector, the surface water distribution is quantified; Among them, the water accumulation area presents low temperature state due to evaporation heat absorption, and the corresponding maximum radial gradient absolute value increases, the mean value negative offset and the variance rise;
[0066] For 3D point cloud data, voxel network filtering is used to reduce data density, and Gaussian filtering is used to remove outliers; For each point , find nearest neighbor points to construct local field ; Based on the local field , the deviation interproduct matrix is calculated, and the value is calculated by formula ; wherein represents any point in the local field , , is an integer; represents the average value of all point coordinates in the neighborhood; represents the number of point clouds in the neighborhood; represents the point and the difference of the average value , the outer product of represents the matrix transpose symbol;
[0067] The principal curvatures are obtained by performing eigenvalue decomposition on the deviation interproduct matrix , and satisfy ; the average curvature quantifies the degree of surface bending; wherein the average curvature of the normal Gastrodia elata surface is , and the average curvature of the defect of the worm-eaten hole or the damaged gap is ; based on a preset threshold, an abnormal area is marked; a 3D-2D coordinate mapping matrix is constructed through camera calibration parameters, the curvature abnormal points are projected to the RGB image, and the defect type is verified in combination with the color texture features, including rot, worm-eaten, mechanical damage, mildew and dry cracking; wherein the damaged gap shows linear curvature mutation in 3D, and the RGB image shows that the edge color is light and the texture is messy; the worm-eaten hole shows a concave curvature area, corresponding to the dark brown hole and the residual powder of the edge worm-eaten in the RGB image;
[0068] S2, quality feature vector generation: through multi-dimensional feature extraction on the preprocessed data, a unified Gastrodia elata quality feature vector is generated; the specific implementation process is as follows:
[0069] S201, morphological feature extraction: based on the three-dimensional point cloud data obtained by data acquisition, key morphological features are obtained;
[0070] S202, surface texture analysis: through a multi-scale local binary pattern algorithm, the surface texture features of Gastrodia elata are extracted, and the fineness, regularity and local change of the surface texture are quantified; combined with a gray level co-occurrence matrix, the statistical features of the texture are extracted, including energy value, contrast, correlation and entropy value; for the surface feature differences of Gastrodia elata of different grades, a differential texture feature library is constructed;
[0071] S203, color feature analysis: in the RGB color space, the color features of Gastrodia elata are extracted, including color uniformity, dominant color distribution and typical color proportion; based on a color histogram and a color moment, the overall color distribution features of Gastrodia elata are extracted; for the color change law in the quality degradation process of Gastrodia elata, a color change detection index is designed;
[0072] S204, defect feature detection: the type, size, position and number of defects are extracted, and the defect score is calculated through the formula ; wherein represents the total number of defects; represents the first defect; represents the assignment of defect types, including wormhole = 5, mildew = 4, mechanical damage = 3, rot = 2 and dry = 1; represents the defect size, which refers to the proportion of the defect area to the surface area of the ginseng; represents the defect position, which refers to the assignment of the impact of the position on the quality, including top defect = 3, middle defect = 2 and bottom defect = 1, which is adjusted based on the defect area; represents the defect quantity, which refers to the density of defects of the same type; respectively, the impact weight factors of the type, size, position and quantity of the defect;
[0073] The greater the defect score value, the more serious the impact on the quality;
[0074] The multi-dimensional ginseng characteristics are weighted and fused through the attention mechanism to generate a unified ginseng quality feature vector;
[0075] S3, quality feature map construction: a three-dimensional feature network is constructed through the ginseng quality feature vector and multi-dimensional data, the correlation between features is established based on cross-modal mapping, and an interpretable quality evaluation knowledge graph is formed; The specific implementation process is as follows:
[0076] The three-dimensional feature network includes a physical form layer, a surface feature layer, a defect correlation layer and a chemical attribute layer;
[0077] Physical form: three-dimensional geometric data and key morphological features are obtained based on 3D point cloud data, and at the same time, average curvature is obtained through deviation interproduct matrix; The topological hierarchical relationship of tuber main body, top boss, horizontal ring pattern and longitudinal wrinkle is established based on three-dimensional point cloud skeleton extraction algorithm, the mold correlation path is constructed through graph neural network, the curvature anomaly point of pit defect is taken as node, and the topological connection relationship of longitudinal wrinkle is taken as edge, based on the temperature gradient of the heat map of the ginseng mildew sample and the fungal culture experiment data, the mold correlation path of the intersection area of pit defect and longitudinal wrinkle is constructed;
[0078] Surface features: the dominant color and color uniformity in color features are extracted in the RGB image; At the same time, the texture complexity and gray level co-occurrence matrix energy in texture features are extracted; The maximum radial gradient and low temperature zone proportion of temperature gradient features are quantified in the heat map; The texture features and temperature gradient are superimposed through 3D-2D mapping matrix to form a visual correlation diagram of the low temperature zone corresponding to the texture rough area, and the curvature anomaly point is projected to the RGB image to label the defect color feature;
[0079] Defect correlation: Establish a defect feature matrix, and quantize the defect type from three-dimensional geometry, RGB vision, and thermal map multi-dimensional features. For example, insect damage corresponds to the concave curvature area and dark brown pit, and mildew is accompanied by surface convexity and concave degree mutation and gray-green mildew spot; based on graph convolution network, the defect propagation path graph of pit, crack, and mildew is constructed;
[0080] Chemical properties: Establish the correlation between spectrum and composition by near-infrared and mid-infrared spectroscopy technology, such as The absorption peak intensity corresponds to the content of gastrodin and The peak area is related to the content of polysaccharide; based on spectral imaging, an appearance morphology and chemical composition mapping model is constructed, and it is found that the content of gastrodin is positively correlated with the density of the top boss;
[0081] S4, quality evaluation and grading: based on the multi-dimensional features of the quality feature map, the quality of Gastrodia rubra is evaluated and graded; the specific implementation process is as follows:
[0082] S401, comprehensive score generation: compare the volume data in the three-dimensional geometric data with the standard sample volume of the pre-constructed Gastrodia rubra sample library to obtain the volume integrity; the proportion of the number of top boss area point cloud to the whole point cloud is calculated to obtain the top boss density; the edge detection algorithm is used to identify the contour of the horizontal ring pattern, and the continuity contour score is calculated; the volume integrity, top boss density, and contour score are calculated based on the weighted formula to obtain the physical morphology characteristic value The larger the physical morphology value is, the better the physical morphology of Gastrodia rubra is, such as clear top boss, regular horizontal ring pattern, and no damage;
[0083] Extract the color uniformity in the color feature, and calculate the energy value and entropy value of the feature; the surface feature value is obtained by the weighted formula; the larger the surface feature value is, the more uniform the surface color of Gastrodia rubra is, and the more delicate and regular the texture is;
[0084] Extract the spectral data, and obtain the corresponding chemical composition content of Gastrodia rubra through the constructed spectrum and composition correlation, including the content of gastrodin, polysaccharide, and impurities; the chemical composition value is obtained by the weighted formula, the larger the chemical composition value is, the higher the content of gastrodin and polysaccharide is, and the less the impurities are;
[0085] Extract the physical morphology characteristic value , the surface feature value , the defect score , and the chemical composition value , and obtain the comprehensive score by the formula , wherein are the influence weight factors of physical morphology, surface feature, defect correlation, and chemical properties, respectively;
[0086] S402, quality grading standard construction: based on the national pharmacopoeia and industry standards, combined with market demand to establish a multi-level evaluation system; quality grading includes special superior grade, first grade, second grade, third grade and unqualified;
[0087] When , it is determined as special superior Gastrodia, special superior Gastrodia requires 3D point cloud data volume integrity , RGB color uniformity , the number of identifiable horizontal ring patterns is not less than 12, the defect score is 0, and the gastrodin content is more than 1.5 times the standard requirement, and the standard requirement is 0.10%;
[0088] When , it is determined as first grade Gastrodia, first grade Gastrodia requires morphological characteristics and standard model deviation ; RGB color uniformity , the defect area is not more than 3% of the total area, and the gastrodin content meets the standard requirement; the standard model is based on the 3D point cloud data of the special superior Gastrodia sample selected by artificial screening, and the reference model is generated by point cloud registration and mean fusion;
[0089] When , it is determined as second grade Gastrodia, the second grade Gastrodia standard is further relaxed: morphological characteristics and standard model deviation , but the key morphological characteristics can be identified; RGB color tone deviation ; horizontal ring pattern can be recognized but not less than 8; the defect area is controlled within 10% of the total area, without serious rot or insect damage; gastrodin content ≥0.12%, polysaccharide content ≥15%;
[0090] When , it is determined as third grade Gastrodia, third grade Gastrodia requires morphological characteristics and standard model deviation , key morphological characteristics can be identified; RGB color tone ; horizontal ring pattern can be recognized but not less than 6; the defect area is not more than 20% of the total area; gastrodin content ≥0.10%, polysaccharide content ≥12%;
[0091] When , it is determined as unqualified; the unqualified Gastrodia determination standard includes morphological characteristics and standard model deviation , key morphological characteristics cannot be identified; RGB color tone ; the defect area is not more than 20% of the total area; gastrodin content <0.10%;
[0092] S403, Feature fusion score: a deep learning architecture combining transfer learning and attention mechanism is used to extract the key quality features of Gastrodia; the key quality features include morphological features, visual appearance features, and chemical composition features; a pre-trained convolutional neural network backbone is used to extract deep visual features of RGB images; 3D point cloud and heat map features are fused to construct a multi-modal input tensor; a multi-head attention mechanism is designed to weight and fuse different modal features, achieving adaptive combination of morphology, surface, defects, and chemical features; after feature fusion, a fully connected layer is connected, which maps the multi-modal fused feature vector to a one-dimensional quality score through linear transformation, and outputs the corresponding grade based on the pre-set grading threshold;
[0093] S404, Quality prediction and explanation
[0094] Based on the quality feature map and deep learning mechanism, the quality of Gastrodia is accurately predicted and explained; through the analysis of the feature nodes in the quality feature map, the key factors affecting the quality score are tracked;
[0095] When the number of unqualified products in a unit of time reaches 10% of the total detection, the unqualified reason analysis process is triggered:
[0096] Extract the quality feature vector of all unqualified products and decompose it into four-dimensional sub-features, including morphological features , texture features , defect features and chemical features ; construct an unqualified feature dataset , wherein represents the unqualified feature dataset; represents the feature vector of the unqualified product, , is an integer, indicating the total number of unqualified products;
[0097] The feature influence value is calculated by the formula ; wherein represents a multi-classification normalization function that converts any real-valued vector into a probability distribution, is a pre-set weight factor of the unqualified feature dataset;
[0098] Based on the feature influence value, the morphological influence value, the texture influence value, the defect influence value, and the chemical influence value are obtained, and each influence value is compared with the corresponding pre-set threshold value; when the influence value is lower than the pre-set threshold value, it is determined as the main influencing factor;
[0099] Based on the judgment result, a substandard quality evaluation report is generated, the report including overall rating, each dimension score, main influencing factors and improvement suggestions; meanwhile, quality change trend prediction is realized, a quality deterioration model is established based on environmental conditions and storage time, and a scientific basis is provided for storage and circulation of Gastrodia elata.
[0100] The preferred embodiments of the application disclosed above are only used to help explain the application. The preferred embodiments do not describe all the details and limit the application to the specific embodiments. Obviously, many modifications and variations can be made according to the content of the specification. The specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the application, so that those skilled in the art can well understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.
Claims
1. A method for detecting the quality of Gastrodia elata based on computer vision technology, characterized in that: include: S1. Gastrodia elata data collection and processing: Multi-source equipment is used to comprehensively collect multimodal data on Gastrodia elata, and then perform illumination compensation and feature extraction to provide standardized data for quality inspection; S2. Generating quality feature vectors: extracting multi-dimensional features from the pre-processed data and generating a unified quality feature vector for Gastrodia elata; S3. Quality feature graph construction: A three-dimensional feature network is constructed using Gastrodia elata quality feature vectors and multidimensional data. Inter-feature associations are established based on cross-modal mapping to form an interpretable quality assessment knowledge graph. S4. Quality assessment and grading: Based on the multidimensional features of the quality characteristic map, the quality of Gastrodia elata is assessed and graded.
2. The method for detecting the quality of Gastrodia elata based on computer vision technology according to claim 1, wherein: The specific operation process of Gastrodia elata data collection includes: By deploying industrial cameras to capture RGB color images, visual features are obtained, including appearance color, texture, and shape; and ambient light intensity is collected in real time through photosensitive sensors. ; By formula Get the compensation value and perform the correction for the uneven illumination; Represents the original pixel value; , represents the illumination adjustment coefficient; , represents the reference brightness offset; The deployed infrared imager collects the surface temperature of Gastrodia elata and converts it into a thermal map to detect surface moisture anomalies and heating uniformity; The 3D scanning device uses a multi-line laser array transmitter and an electric rotary table with an encoder to scan the image every time. Collect point cloud data, build a 3D point cloud model and calculate 3D geometric data to obtain key morphological features; Near-infrared and mid-infrared spectrometers collect spectral data; A unified trigger signal is generated by a programmable logic controller and transmitted to each device to synchronize the acquisition clock and mark a unified timestamp. The spectral data are aligned according to the timestamp using linear interpolation.
3. The method for detecting the quality of Gastrodia elata based on computer vision technology according to claim 1, wherein: The specific operation steps of the Gastrodia elata data processing are as follows: The RGB three-channel pixel values are calculated according to the sensitivity of the human eye and the formula Convert to a single-channel grayscale value, where are the influence weight factors of the RGB three-channel pixel values respectively; construct a grayscale histogram, calculate the optimal separation threshold and binarize the grayscale image; A radial coordinate system was established with the geometric center of the tuber as the origin. The rate of change of temperature with radial distance was calculated using the finite difference method. The maximum radial gradient, mean, and variance were extracted to construct a three-dimensional temperature gradient vector. The water accumulation area absorbs heat due to evaporation and has a low temperature, which corresponds to an increase in the absolute value of the maximum radial gradient, a negative shift in the mean, and an increase in the variance. 3D point cloud data: Based on voxel network filtering and Gaussian filtering to remove outliers, the k nearest neighbor points are found for each point to construct a local area, and the deviation cross-product matrix is calculated. The principal curvature is decomposed and the degree of surface curvature is quantified using the average curvature. Abnormal areas are marked based on thresholds, and a 3D-2D mapping matrix is constructed. The curvature anomalies are projected onto the RGB image. The color and texture features are combined to verify the defect type, including rot, insect damage, mechanical damage, mildew, and cracking.
4. The method for detecting the quality of Gastrodia elata based on computer vision technology according to claim 1, wherein: The specific operation process of S2 is as follows: Extract key morphological features from 3D point cloud data; simultaneously extract surface texture features and combine them with the gray-level co-occurrence matrix to obtain statistical features, including energy and entropy, to construct a differential texture feature library for different grades of Gastrodia elata; extract color features in the RGB color space, and analyze the overall color distribution based on color histograms and moments; Extract the type, size, location and number of defects by formula Get defect score; where, Indicates the total number of defects; Refers to defects; Refers to the assignment of values for defect types, including insect damage = 5, mildew = 4, mechanical damage = 3, rot = 2, and cracking = 1; Indicates the size of the defect, which refers to the ratio of the defect area to the surface area of Gastrodia elata; Indicates the defect location, which refers to the value assigned to the location's impact on quality, including top defect = 3, middle defect = 2, and bottom defect = 1, adjusted based on the defect area; Indicates the number of defects, which refers to the density of defects of the same type; are the impact weight factors of defect type, size, location and number respectively; The higher the score, the more serious the quality impact; the multi-dimensional features are weighted and fused through the attention mechanism to generate the Gastrodia elata quality feature vector.
5. The method for detecting the quality of Gastrodia elata based on computer vision technology according to claim 1, wherein: The specific implementation process of the S3 step is as follows: The researchers obtained 3D geometric data, key morphological features, and average curvature, and established a topological hierarchical relationship between the tuber body, apical boss, transverse rings, and longitudinal wrinkles based on a 3D point cloud skeleton extraction algorithm. Using the curvature anomalies of pit defects as nodes and the topological connections of longitudinal wrinkles as edges, they constructed a mold-related path in the intersection of pit defects and longitudinal wrinkles. Extract the main color tone, color uniformity, texture complexity, and grayscale co-occurrence matrix energy from the RGB image; quantify the maximum radial gradient and the proportion of low-temperature areas using a heat map; superimpose texture and temperature gradients based on a 3D-2D mapping matrix; and project curvature anomalies onto the RGB image to annotate defect color features. Establish a defect feature matrix to quantify defect types from multiple dimensions, including 3D geometry, RGB vision, and thermal maps. Construct defect propagation path maps for potholes, cracks, and mildew based on graph convolutional networks. Spectral and component correlations were established using near-infrared and mid-infrared spectroscopy techniques.
6. The method for detecting the quality of Gastrodia elata based on computer vision technology according to claim 1, wherein: The specific operation steps of S4 include: The volume data extracted from the 3D geometric data was compared with the standard sample volume of the pre-built Gastrodia elata sample library to obtain the volume completeness; the ratio of the number of point clouds in the top boss area to the overall point cloud was calculated to obtain the top boss density; the edge detection algorithm was used to identify the horizontal ring pattern contour to obtain the continuity contour score; and the physical morphological feature value was obtained based on the weighted formula. ; Extract the color uniformity in the color feature, as well as the energy value and entropy value of the statistical feature; obtain the surface feature value through the weighted formula ; Extract spectral data and obtain the corresponding chemical component content of Gastrodia elata by building a correlation between the spectrum and the components. The chemical components include gastrodin content, polysaccharide content and impurity content. The chemical component value is obtained by weighted formula ; Extract physical morphological features , surface eigenvalues , defect score And chemical composition values , through the formula Get comprehensive rating ,in are the influence weight factors of physical morphology, surface characteristics, defect association and chemical properties respectively; when When When When When When the It adopts an architecture that combines transfer learning with attention mechanism, uses pre-trained convolutional networks to extract RGB deep visual features, integrates 3D point clouds and heat maps to construct multimodal tensors, and uses multi-head attention to weightedly fuse morphological features. The features are mapped into quality scores through fully connected layers and output grade judgments.
7. The method for detecting the quality of Gastrodia elata based on computer vision technology according to claim 6, wherein: The specific operation steps of S4 also include: When the number of unqualified products per unit time reaches 10% of the total inspections, the unqualified cause analysis process is triggered: Extract the quality feature vectors of all unqualified products and decompose them into morphological features, texture features, defect features and chemical features; build an unqualified feature dataset ,in, represents the unqualified feature dataset; Indicates the The feature vector of unqualified products, , It is an integer, which refers to the total number of unqualified products; By formula Get the characteristic influence value; among them, Represents the multi-classification normalization function; represents the symbol of partial derivative; The preset weight factor for the unqualified feature dataset; Based on the feature influence values, the morphological, texture, defect and chemical influence values are obtained, and the influence values are compared with the preset thresholds. When the influence value is lower than the preset threshold, it is determined to be the main influencing factor; an unqualified quality evaluation report is generated, which includes the overall rating, scores for each dimension, main influencing factors and improvement suggestions.
Citation Information
Cited By
Waste metal classification and identification method and system based on image identification
CN120997639A
An image recognition-based waste metal classification and recognition method and system
CN120997639B
Cross-domain transfer learning laser ultrasonic layering defect detection method suitable for composite material and application of cross-domain transfer learning laser ultrasonic layering defect detection method
CN121959304A
Laser-ultrasonic delamination defect detection method for composite materials based on cross-domain transfer learning and application thereof
CN121959304B