Method and system for monitoring stir-frying process of traditional Chinese medicinal materials
By conducting characteristic extraction and model training on the historical data of traditional Chinese medicinal materials, real -time monitoring and adjusting the number of speculation ginsengs, solving the problem of not timely monitoring and error of the existing technology of traditional Chinese medicinal materials. Burning quality control.
Patent Information
- Application Number
- CN202411381379.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
AI Technical Summary
The quality monitoring of the prior art Chinese medicinal materials stir-frying process has problems such as untimely and large errors, making it difficult to achieve rapid and accurate detection.
A method for monitoring the stir-frying process of Chinese herbal medicines is adopted. By obtaining historical stir-frying data, extracting stir-frying characteristics and training a stir-frying quality prediction model, the stir-frying process can be monitored in real time and the stir-frying duration and heat can be adjusted.
The real -time quality monitoring of the speculation process of Chinese medicinal materials has been realized, the accuracy and production efficiency of the quality of speculation are improved, and the cost and time cost of labor are reduced.
Smart Images

Figure CN119360296A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of data processing, and in particular to a method and system for monitoring a frying and roasting process of traditional Chinese medicine. Background Art
[0002] With the continuous expansion of the Chinese medicine market, the quality control of Chinese medicinal materials is becoming increasingly strict. The existing judgment of the frying of medicinal materials is manually determined. Experienced workers extract a part of the medicinal materials from the medicinal materials that have been fried for a certain period of time through sampling and testing. By observing the changes in the condition of the medicinal materials, they judge whether the medicinal materials are fried and the degree of frying based on experience and standards. Manual judgment is not accurate enough, and sampling testing is prone to generalization. It is not easy to achieve the judgment of all fried medicinal materials. Even if it is achieved, it is quite time-consuming and labor-intensive, and the speed is not fast enough.
[0003] It can be seen that the current monitoring of the frying quality of Chinese medicinal materials during the frying process is not timely and has large errors. Therefore, it is urgent to develop an intelligent method that can quickly and accurately detect the frying process of Chinese medicinal materials to improve the production efficiency of Chinese medicinal materials and the monitoring of frying quality. Summary of the invention
[0004] In order to avoid and overcome the technical problems existing in the prior art, the present invention provides a method and system for monitoring the frying process of Chinese medicinal materials. The present invention can monitor the frying quality of Chinese medicinal materials in real time during the frying process, and timely adjust the subsequent frying time and frying temperature to improve the frying quality.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A method for monitoring a frying and roasting process of Chinese medicinal materials comprises the following steps:
[0007] S1. Obtaining historical roasting data of Chinese herbal medicines during the historical roasting process;
[0008] S2. Extracting stir-fry features from historical stir-fry data, and using the stir-fry features to train a model, so as to obtain a stir-fry quality prediction model that can predict stir-fry quality, subsequent stir-fry duration, and subsequent stir-fry temperature;
[0009] S3. Acquire the stir-frying data of the Chinese medicinal materials in the stir-frying process in real time, extract the stir-frying features of the stir-frying data and input the stir-frying features into the stir-frying quality prediction model, and adjust the subsequent stir-frying time and subsequent stir-frying temperature of the Chinese medicinal materials in real time according to the prediction results until the stir-frying of the Chinese medicinal materials is completed.
[0010] As a further technical solution of the present invention: the stir-frying quality prediction model includes a first self-attention module, a second self-attention module, a third self-attention module, a fourth self-attention module, a first cross-attention module, a second cross-attention module, a third cross-attention module, a fourth cross-attention module, a fifth cross-attention module, a sixth cross-attention module, a stir-frying quality prediction module, a stir-frying heat prediction module, and a stir-frying time prediction module.
[0011] As a further technical solution of the present invention: the stir-frying features obtained by feature extraction are input into the stir-frying quality prediction model to train the stir-frying quality prediction model. The training process is as follows:
[0012] S31, simultaneously inputting the three-dimensional features in the fried features at the same time into the first self-attention module; inputting the optical features in the fried features into the second self-attention module; inputting the spectral features in the fried features into the third self-attention module; and inputting the sensor features in the fried features into the fourth self-attention module;
[0013] S32, inputting the feature data output by the first self-attention module and the feature data output by the second self-attention module into the first cross attention module at the same time; inputting the feature data output by the second self-attention module and the feature data output by the third self-attention module into the second cross attention module at the same time; inputting the feature data output by the third self-attention module and the feature data output by the fourth self-attention module into the third cross attention module at the same time;
[0014] S33, inputting the feature data output by the first cross attention module and the feature data output by the second cross attention module into the fourth cross attention module; inputting the feature data output by the second cross attention module and the feature data output by the third cross attention module into the fifth cross attention module;
[0015] S34, inputting the feature data output by the fourth cross attention module and the feature data output by the fifth cross attention module into the sixth cross attention module;
[0016] S35, inputting the feature data output by the sixth cross attention module into the stir-fry quality prediction module, the stir-fry time prediction module and the stir-fry temperature prediction module at the same time, and iteratively training all modules through the back propagation algorithm or the gradient descent method, and stopping the iteration after reaching the set prediction accuracy;
[0017] S36. According to the process from step S31 to step S35, the stir-frying quality prediction model is trained using all the data in the training set to obtain a stir-frying quality prediction model that meets the prediction accuracy.
[0018] As a further technical solution of the present invention: the self-attention module adopts a residual connection method, including two dense transformer layers and a patchy layer. Various types of data first pass through a patchy layer and two dense transformer layers, and then are added to the feature data after the residual connection and the patchy layer before output;
[0019] The cross attention module uses a residual connection method, which includes three dense transformer layers, a forward SSM layer and a reverse SSM layer. All kinds of data first pass through two dense transformer layers, and then pass through the forward SSM layer and the reverse SSM layer respectively. The results of these two layers pass through a dense transformer layer again, and finally the results of the dense transformer layer through residual connection are added and the results are output.
[0020] The stir-fry quality prediction module, the stir-fry temperature prediction module, and the stir-fry time prediction module are all composed of two fully connected layers and two layers of ReLU activation functions.
[0021] As a further technical solution of the present invention: the stir-frying data of Chinese medicinal materials include image data characterizing the current shape of the Chinese medicinal materials during the stir-frying process, spectral data characterizing the current physical or chemical properties of the Chinese medicinal materials, and sensor data characterizing the current smell of the Chinese medicinal materials. More than two kinds of data are marked with the corresponding stir-frying quality, subsequent stir-frying time and subsequent stir-frying temperature.
[0022] As a further technical solution of the present invention: after obtaining the historical stir-frying data of Chinese medicinal materials, it is necessary to perform noise reduction processing on the historical stir-frying data; the specific noise reduction processing process is as follows: use image processing technology to perform noise reduction processing on image data to reduce image noise in image data and improve image quality; use spectral filtering method to perform noise reduction processing on spectral data to smooth the spectral curve in spectral data; use digital filtering to perform noise reduction processing on sensor data to reduce high-frequency noise in sensor data.
[0023] As a further technical solution of the present invention: after the historical data is subjected to noise reduction processing, feature extraction processing is then performed. The specific process is as follows:
[0024] The gray level co-occurrence matrix in the image processing technology is used to extract features from the image data, and the extracted features are recorded as image features, and the image features are marked with the roasting quality, subsequent roasting time and subsequent roasting temperature corresponding to the original image data;
[0025] The principal component analysis or partial least squares method in the dimensionality reduction technology is used to extract the features in the spectral data, and the extracted features are recorded as spectral features, and the spectral features are marked with the roasting quality, subsequent roasting time and subsequent roasting temperature corresponding to the original spectral data;
[0026] The features in the sensor data are extracted using a feature selection algorithm, and the extracted features are recorded as odor features, and the odor features are marked with the roasting quality, subsequent roasting time, and subsequent roasting temperature corresponding to the original sensor data.
[0027] As a further technical solution of the present invention: the image data includes three-dimensional data representing the three-dimensional shape of the Chinese medicinal material and an optical image representing the plane image of the Chinese medicinal material; after the three-dimensional data is subjected to feature extraction using the gray level co-occurrence matrix in the image processing technology, three-dimensional features are obtained; after the optical image is subjected to feature extraction using the gray level co-occurrence matrix in the image processing technology, optical features are obtained.
[0028] As a further technical solution of the present invention: using a depth camera to photograph the Chinese medicinal materials during the frying process, image data representing the current shape of the Chinese medicinal materials can be obtained; using a spectrometer to irradiate the Chinese medicinal materials during the frying process, spectral data representing the current physical or chemical properties of the Chinese medicinal materials can be obtained; using an odor sensor to detect the molecular components emitted by the Chinese medicinal materials during the frying process, sensor data representing the current smell of the Chinese medicinal materials can be obtained.
[0029] A monitoring system for the frying and roasting process of Chinese medicinal materials, which applies the above-mentioned monitoring method for the frying and roasting process of Chinese medicinal materials, comprises the following components:
[0030] Data collection unit: used to collect the frying data of Chinese medicinal materials during the frying process;
[0031] Data preprocessing unit: used to perform noise reduction on the acquired frying data;
[0032] Data extraction unit; used to extract features from the denoised data and store the extracted features in a training set;
[0033] Model building unit: used to train the model using the stir-fry features in the training set to obtain a stir-fry quality prediction model that meets the prediction accuracy;
[0034] Model application unit: Apply the stir-frying quality prediction model to the traditional Chinese medicine preparation scenario, use the stir-frying quality prediction model to predict the stir-frying quality, subsequent stir-frying heat and subsequent stir-frying time of traditional Chinese medicine during the stir-frying process, and monitor the stir-frying process of traditional Chinese medicine through the prediction structure.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] 1. The present invention not only realizes all-round data collection by collecting and processing a variety of information, but also makes each functional module work together through the corresponding algorithm, greatly improving the overall performance of the system. The image acquisition module can capture the appearance changes of Chinese medicinal materials in real time, the spectrum acquisition module deeply analyzes its internal chemical composition information, and the sensor data acquisition module uses the data collected by a variety of sensors to monitor various environmental parameters during the frying process. The present invention further realizes the complementarity and coordination of multiple modules by further screening, analyzing, model training and other processing of the acquired multi-dimensional information, and realizes the comprehensive analysis and monitoring of the data of the frying process of Chinese medicinal materials.
[0037] 2. The present invention collects images, spectra and sensor data in real time during the frying process, and the system can immediately analyze and judge the status of Chinese medicinal materials. Establishing an effective instant feedback mechanism helps to promptly discover and solve problems that may arise during the frying process, thereby avoiding quality loss caused by lag in traditional methods. At the same time, the system of the present invention processes and analyzes the collected data, and conducts in-depth model training and verification to ensure the accuracy and reliability of the analysis results, providing a strong guarantee for the quality control of Chinese medicinal materials.
[0038] 3. On the one hand, the present invention replaces traditional manual operations with automated and intelligent means, reducing labor costs and time costs; on the other hand, the system of the present invention can automatically adjust the stir-frying parameters according to real-time data to ensure that the Chinese medicinal materials achieve the best stir-frying effect in the shortest time. This efficient production method not only improves production efficiency, but also reduces energy consumption and material waste in the production process.
[0039] 4. The present invention realizes comprehensive quality control of the stir-frying process of Chinese medicinal materials through real-time monitoring and data analysis. The system of the present invention can accurately identify key indicators such as color, shape, and composition of Chinese medicinal materials, and make judgments and adjustments based on preset standards. This precise quality control method helps to reduce quality fluctuations and errors caused by human factors and improve the overall quality level of Chinese medicinal materials.
[0040] 5. By separating the feature processing, attention mechanism (self-attention and cross-attention), and the final stir-fry parameter prediction module, the whole system structure is clear, easy to maintain and expand. Each module focuses on a specific task, which improves the flexibility and reusability of the system. Multiple self-attention modules are used to process different types of features (such as three-dimensional features, optical features, spectral features, etc.), and these features are further integrated through the cross-attention module, which effectively utilizes the complementary information in multi-source data and enhances the prediction ability of the model. By introducing self-attention and cross-attention mechanisms, the model can automatically learn and capture the complex dependencies between features, improve the ability to identify key information and suppress noise, thereby improving the accuracy of prediction. The back-propagation algorithm or gradient descent method is used to iteratively train the stir-fry quality, stir-fry time and stir-fry temperature prediction modules, and the prediction accuracy is set as the condition for stopping iteration to ensure the precise control of the training process and the stability of the model performance. The stir-fry parameter prediction model is trained by traversing all the data in the training set, which ensures that the model can learn enough sample features and improves the generalization ability and robustness of the model. After reaching the set prediction accuracy, the iteration stops automatically and the current optimal stir-fry parameter prediction model is output, which realizes the automation and efficiency of the training process and facilitates rapid deployment and use in practical applications. The stir-fry quality prediction model can not only predict the stir-fry quality, but also predict the stir-fry time and heat, meeting the prediction needs of multiple key parameters in the stir-fry process and providing comprehensive data support for the optimization of the stir-fry process. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flow chart of the present invention.
[0042] Figure 2 This is a structural diagram of the model in the present invention.
[0043] Figure 3 Schematic diagram of the structure of the self-attention module in the present invention.
[0044] Figure 4 Schematic diagram of the structure of the cross-attention module in the present invention.
[0045] Figure 5 It is a structural schematic diagram of the stir-frying quality prediction module in the present invention.
[0046] Figure 6 This is a flow chart of model training in the present invention.
[0047] Figure 7 It is a schematic diagram of the structure of the system in the present invention.
[0048] Figure 8 This is a flow chart of donkey-hide gelatin bead monitoring in an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] like Figures 1 to 8 As shown, the present invention mainly includes the following contents.
[0051] 1. Obtain historical speculation data.
[0052] The historical frying data of the Chinese medicinal materials in the historical frying process are obtained, where the historical frying data include the current frying state of the Chinese medicinal materials, and the frying quality, subsequent frying time and subsequent frying temperature corresponding to the current frying state.
[0053] The current stir-frying status data of the Chinese medicinal materials include image data characterizing the current shape of the Chinese medicinal materials during the stir-frying process, spectral data characterizing the current physical or chemical properties of the Chinese medicinal materials, and sensor data characterizing the current smell of the Chinese medicinal materials, and each type of data is marked with the corresponding stir-frying quality, subsequent stir-frying time, and subsequent stir-frying temperature.
[0054] During the process of frying Chinese medicinal materials, a depth camera or an X-ray machine can be used to shoot the Chinese medicinal materials to obtain image data representing the current shape of the Chinese medicinal materials. The image data includes three-dimensional data representing the three-dimensional shape of the Chinese medicinal materials and an optical image representing the plane image of the Chinese medicinal materials, and the image is clear and has no shadow interference.
[0055] During the frying process of Chinese medicinal materials, spectral data representing the current physical or chemical properties of the Chinese medicinal materials can be obtained by irradiating the Chinese medicinal materials with equipment such as an infrared spectrometer or a near-infrared spectrometer.
[0056] During the frying process of Chinese medicinal materials, sensor devices such as electronic noses and electronic tongues are used to obtain sensory data such as the smell and taste of the Chinese medicinal materials. This data and sensor data characterize the current smell or taste of the Chinese medicinal materials.
[0057] 2. Data preprocessing
[0058] When processing multi-dimensional data containing the historical roasting process of Chinese medicinal materials, noise reduction becomes particularly important, because this data not only contains the physical and chemical properties of Chinese medicinal materials, but also involves the real-time status of the roasting process and the guidance information for subsequent roasting. The following is the method of noise reduction:
[0059] 2.1. 3D data denoising
[0060] The collected 3D data is processed by denoising, interference removal, enhancement, and edge detection to extract the visual features of the shape, color, texture, etc. of the Chinese medicinal materials. The specific methods are as follows:
[0061] Smoothing: Use smoothing algorithms (such as Gaussian filtering, bilateral filtering, etc.) to reduce noise points in the data.
[0062] Contrast enhancement: Enhance the contrast of 3D data by adjusting the window width and window position.
[0063] 2.2 Optical Data Denoising
[0064] The collected optical data is processed by denoising, interference removal, enhancement, and edge detection to extract the visual features of Chinese medicinal materials such as shape, color, and texture. The specific methods are as follows:
[0065] Image preprocessing: Use image processing techniques (such as median filtering, Gaussian filtering, morphological operations, etc.) to reduce image noise and improve image quality.
[0066] Background segmentation: Accurately segment Chinese medicinal materials from the background to reduce the impact of background noise on the analysis.
[0067] Color Correction: Adjust the color balance and brightness of an image to ensure data consistency.
[0068] 2.3 Spectral data denoising
[0069] By filtering, baseline correction, normalization and other processing of spectral data, noise and interference can be eliminated and the reliability and accuracy of data can be improved. The specific methods are as follows:
[0070] Baseline Correction: Removes baseline drift from spectral data, which is usually caused by instrument background or light source fluctuations.
[0071] Smoothing and detrending: Use methods such as sliding average and Savitzky-Golay filtering to smooth the spectral curve and remove long-term trends.
[0072] Noise Assessment: Quantify the noise level in spectral data using the signal-to-noise ratio (SNR) or noise level assessment.
[0073] 2.4 Sensor Data Denoising
[0074] The original signal collected by the sensor is converted into a quantifiable feature vector. The specific method is as follows:
[0075] Signal filtering: Applying digital filters (such as low-pass filters) to reduce high-frequency noise.
[0076] Feature extraction: Extract key features (such as peak, mean, standard deviation, etc.) from sensor data, which are usually more robust to noise.
[0077] Data fusion: If possible, fuse the odor sensor data with other types of data (such as spectral data) to improve the accuracy and reliability of the data.
[0078] 2.5 Comprehensive noise reduction strategy
[0079] Time series analysis: For data that changes over time (such as spectral and odor data during the roasting process), time series analysis methods can be used to identify and remove noise.
[0080] Machine learning denoising: Use machine learning algorithms (such as autoencoders, denoising autoencoders, random forests, etc.) to automatically identify and correct noise in data.
[0081] Integration of domain knowledge: Combined with professional knowledge in the field of stir-frying and roasting of Chinese medicinal materials, the noise reduction process is guided and verified to ensure the accuracy and reliability of the data.
[0082] 2.6 Data Quality Assessment
[0083] Data consistency check: Verify the consistency between different types of data to ensure that the status of the Chinese medicinal materials they describe are consistent.
[0084] Correlation analysis of stir-frying quality: Analyze the relationship between the denoised data and the stir-frying quality, stir-frying time and stir-frying temperature to verify the effectiveness of the noise reduction process.
[0085] Finally, it should be emphasized that noise reduction processing should be customized based on the specific characteristics of the data and the purpose of analysis.
[0086] 3. Feature extraction
[0087] The gray level co-occurrence matrix (GLCM), SIFT, SURF and other algorithms in image processing technology are used to extract the visual features of Chinese medicinal materials such as shape, color, and texture, and the extracted features are recorded as image features. The image features are marked with the stir-frying quality, subsequent stir-frying time, and subsequent stir-frying temperature corresponding to the original image data.
[0088] For example, the gray level co-occurrence matrix can be used to extract the texture features of the image. The calculation formula is shown in the following formula (1) and formula (2):
[0089] Contrast=∑ i,j |ij|2P(i,j) (1)
[0090] Energy=∑ i,j P 2(i,j) (2)
[0091] Where P(i,j) is the probability that gray level i and gray level j appear at the same time. Contrast represents contrast. Energy represents energy.
[0092] The principal component analysis (PCA) and partial least squares (PLS) methods in dimensionality reduction techniques are used to extract features from the spectral data, and the extracted features are recorded as spectral features, and the spectral features are marked with the roasting quality, subsequent roasting time, and subsequent roasting degree corresponding to the original spectral data. Among them, PCA is realized by solving the eigenvalues and eigenvectors of the covariance matrix. The larger the eigenvalue corresponding to the eigenvector, the greater the data change in that direction, that is, the more important the feature in that direction.
[0093] The feature selection algorithm is used to extract visual, taste, olfactory and other features such as shape, color and taste in the sensor data, and the extracted features are recorded as odor features, and the odor features are marked with the stir-frying quality, subsequent stir-frying time and subsequent stir-frying temperature corresponding to the original sensor data.
[0094] 4. Model training
[0095] The stir-frying data of the Chinese medicinal materials in the stir-frying process are obtained, and then the features of the stir-frying data are extracted. The extracted features are then input into the stir-frying quality prediction model to predict the corresponding stir-frying quality, subsequent stir-frying time and subsequent stir-frying heat, and the stir-frying time and stir-frying heat of the Chinese medicinal materials are adjusted according to the prediction results.
[0096] like Figure 2 As shown, the stir-fry quality prediction model includes a first self-attention module, a second self-attention module, a third self-attention module, a fourth self-attention module, a first cross-attention module, a second cross-attention module, a third cross-attention module, a fourth cross-attention module, a fifth cross-attention module, a sixth cross-attention module, a stir-fry quality prediction module, a stir-fry heat prediction module, and a stir-fry time prediction module.
[0097] like Figure 3 As shown in the figure, the self-attention module adopts the residual connection method, which includes two dense transformer layers and one patchy layer. Various types of data first pass through a patchy layer and two dense transformer layers, and then are added to the feature data after the residual connection and the patchy layer before output;
[0098] like Figure 4As shown in the figure, the cross attention module adopts the residual connection method, which includes three dense transformer layers, a forward SSM layer and a reverse SSM layer; various types of data first pass through two dense transformer layers, and then pass through the forward SSM layer and the reverse SSM layer respectively, and the results of these two layers pass through a dense transformer layer again, and finally the results of the dense transformer layer through the residual connection are added and the results are output;
[0099] like Figure 5 As shown, the stir-fry quality prediction module, the stir-fry temperature prediction module, and the stir-fry time prediction module are all composed of two fully connected layers and two layers of ReLU activation functions.
[0100] like Figure 6 As shown, each feature data obtained after feature extraction is input into the stir-fry quality prediction model to train the stir-fry quality prediction model. The training process is as follows:
[0101] S31. Simultaneously input the three-dimensional features at the same moment into the first self-attention module; input the optical features into the second self-attention module; input the spectral features into the third self-attention module; and input the spectral features into the fourth self-attention module.
[0102] S32. Input the feature data output by the first self-attention module and the feature data output by the second self-attention module into the first cross-attention module at the same time; input the feature data output by the second self-attention module and the feature data output by the third self-attention module into the second cross-attention module at the same time; input the feature data output by the third self-attention module and the feature data output by the fourth self-attention module into the third cross-attention module at the same time.
[0103] S33, inputting the feature data output by the first cross attention module and the feature data output by the second cross attention module into the fourth cross attention module; inputting the feature data output by the second cross attention module and the feature data output by the third cross attention module into the fifth cross attention module;
[0104] S34. Input the feature data output by the fourth cross-attention module and the feature data output by the fifth cross-attention module into the sixth cross-attention module.
[0105] S35. Input the feature data output by the sixth cross-attention module into the stir-fry quality prediction module, the stir-fry time prediction module and the stir-fry heat prediction module at the same time, and iteratively train all modules through the back propagation algorithm or the gradient descent method, and stop the iteration after reaching the set prediction accuracy.
[0106] S36. According to the process from step S31 to step S35, the stir-frying quality prediction model is trained using all the data in the training set to obtain a stir-frying quality prediction model that meets the prediction accuracy.
[0107] 5. Frying monitoring
[0108] The stir-frying data of the Chinese medicinal materials in the stir-frying process are obtained, and then the features of the stir-frying data are extracted. The extracted features are then input into the stir-frying quality prediction model to predict the corresponding stir-frying quality, subsequent stir-frying time and subsequent stir-frying heat, and the stir-frying time and stir-frying heat of the Chinese medicinal materials are adjusted according to the prediction results.
[0109] 6. Monitoring system
[0110] The monitoring system consists of the following components:
[0111] Data sampling unit: used to sample the historical data to be monitored and transmit the samples to the data acquisition unit.
[0112] Data acquisition unit: used to collect the roasting data of Chinese medicinal materials during the roasting process. The data acquisition unit includes an image acquisition module, a spectrum acquisition module and a sensor data acquisition module. The image acquisition module is used to collect image data, which can be derived from a high-resolution camera and a stable light source. The collected image data includes two-dimensional image data and three-dimensional image data. The three-dimensional image data can be derived from a Micro CT device. The spectrum acquisition module uses equipment such as an infrared spectrometer or a near-infrared spectrometer to collect the spectrum data of Chinese medicinal materials and obtain their chemical composition information.
[0113] Data preprocessing unit: used to perform noise reduction on the acquired frying data.
[0114] Data extraction unit; used for extracting features from the data after noise reduction processing.
[0115] Model building unit: used to train the model using the data in the training set to obtain a stir-fry quality prediction model that meets the prediction accuracy.
[0116] Model application unit: Apply the stir-frying quality prediction model to the traditional Chinese medicine preparation scenario, use the stir-frying quality prediction model to predict the stir-frying quality, stir-frying heat and stir-frying time of traditional Chinese medicine during the stir-frying process, and monitor the stir-frying process of traditional Chinese medicine through the prediction structure.
[0117] 7. The process of frying and roasting donkey hide gelatin beads
[0118] 7.1. Multimodal data collection of donkey-hide gelatin beads
[0119] Optical image acquisition of donkey-hide gelatin beads: Use a high-resolution camera and a stable light source to capture the appearance of donkey-hide gelatin beads at different stages of frying to ensure that the image is clear and free of shadow interference.
[0120] Spectral data collection: An infrared spectrometer was used to collect spectral data of donkey-hide gelatin beads at different frying stages to obtain and record their chemical composition information.
[0121] Sensor data collection: The sensory characteristic data such as the smell and taste of donkey-hide gelatin beads at different frying stages are obtained through electronic nose, electronic tongue and other sensor equipment.
[0122] CT image acquisition: The CT device is used to acquire the three-dimensional internal data of donkey-hide gelatin beads at different frying stages.
[0123] Based on the experience of experienced pharmacists, feedback indicators are given to the donkey-hide gelatin beads at different frying stages, including frying quality, subsequent frying time and frying temperature, etc., or other related scoring methods. This embodiment uses the feedback from experienced pharmacists as the data source.
[0124] 7.2 Data Preprocessing
[0125] Image preprocessing: All collected donkey-hide gelatin bead images were denoised using Gaussian filtering, contrast was enhanced using histogram equalization, and edge detection was performed using the Sobel operator. Through the above operations, visual features such as shape, color, and texture of the donkey-hide gelatin beads were extracted.
[0126] Spectral data preprocessing: Filter, baseline correct, normalize and process all spectral data to eliminate noise and interference and improve data reliability and accuracy.
[0127] Sensor data preprocessing: Convert the raw signal of donkey-hide gelatin beads collected by the sensor into a quantifiable feature vector, such as the concentration value of odor molecules, the quantitative value of taste intensity, etc.
[0128] Three-dimensional data preprocessing: The three-dimensional internal data obtained by the Micro CT device is denoised using median filtering, and the contrast of the three-dimensional data is enhanced by adjusting the window width and window position.
[0129] 7.3 Feature Extraction
[0130] The gray level co-occurrence matrix such as formula (1) and formula (2) is used to extract features of image features, spectral features, and sensor data.
[0131] 7.4 Model Training
[0132] The stir-frying quality prediction model was selected as the quality assessment model for donkey-hide gelatin beads.
[0133] Construct data pairs: use the optical image, spectral data, sensor data and three-dimensional data after data preprocessing as the input of the neural network, and use the corresponding quality data and feedback guidance data of the donkey-hide gelatin beads as the label data of the neural network.
[0134] Data partitioning: All data pairs are divided into training set, validation set and test set in a ratio of 5:2:3 to ensure the effectiveness and generalization ability of model training.
[0135] Model training: The model was trained using the training set data, using Adam as the optimizer, cross entropy as the loss function, and a learning rate of 0.001. The model parameters were adjusted through optimization algorithms such as back propagation and gradient descent, so that the model could accurately determine the quality of donkey-hide gelatin beads at different frying stages.
[0136] Model testing: Once the model training is completed, the model performance can be tested on the test set. When the test performance meets the expected requirements, the trained model can be used to judge the quality of donkey-hide gelatin beads at different frying stages.
[0137] 7.5、Frying monitoring
[0138] The system is used to evaluate the quality of donkey-hide gelatin beads and provide feedback guidance for roasting, and guide the next roasting operation of donkey-hide gelatin beads. In actual operation, the donkey-hide gelatin beads to be evaluated are first sampled (they can be taken out using a robotic arm or other suitable sampling methods). For the donkey-hide gelatin beads to be evaluated, multimodal data is first collected, including donkey-hide gelatin bead image acquisition, spectrum acquisition, sensor data acquisition, and three-dimensional acquisition. Then, data preprocessing is performed on the collected data, including image preprocessing, spectrum data preprocessing, sensor data preprocessing, and three-dimensional data preprocessing. Then, all the preprocessed data, i.e., feature data, are input into the trained model, and the model can output the quality score and roasting guidance feedback of the donkey-hide gelatin beads to be evaluated. Finally, the parameters such as the roasting time and heat are adjusted according to the output results of the model.
[0139] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for monitoring the frying process of Chinese medicinal materials, characterized in that: The following steps are involved: S1. Obtaining historical roasting data of Chinese herbal medicines during the historical roasting process; S2. Extracting stir-fry features from historical stir-fry data, and using the stir-fry features to train a model, so as to obtain a stir-fry quality prediction model that can predict stir-fry quality, subsequent stir-fry duration, and subsequent stir-fry temperature; S3. Acquire the stir-frying data of the Chinese medicinal materials in the stir-frying process in real time, extract the stir-frying features of the stir-frying data and input the stir-frying features into the stir-frying quality prediction model, and adjust the subsequent stir-frying time and subsequent stir-frying temperature of the Chinese medicinal materials in real time according to the prediction results until the stir-frying of the Chinese medicinal materials is completed.
2. A method for monitoring the frying process of Chinese medicinal materials according to claim 1, characterized in that: The stir-fry quality prediction model includes a first self-attention module, a second self-attention module, a third self-attention module, a fourth self-attention module, a first cross-attention module, a second cross-attention module, a third cross-attention module, a fourth cross-attention module, a fifth cross-attention module, a sixth cross-attention module, a stir-fry quality prediction module, a stir-fry heat prediction module, and a stir-fry time prediction module.
3. A method for monitoring the frying process of Chinese medicinal materials according to claim 2, characterized in that: The stir-fry features obtained after feature extraction are input into the stir-fry quality prediction model to train the stir-fry quality prediction model. The training process is as follows: S31, simultaneously inputting the three-dimensional features in the fried features at the same time into the first self-attention module; inputting the optical features in the fried features into the second self-attention module; inputting the spectral features in the fried features into the third self-attention module; and inputting the sensor features in the fried features into the fourth self-attention module; S32, inputting the feature data output by the first self-attention module and the feature data output by the second self-attention module into the first cross attention module at the same time; inputting the feature data output by the second self-attention module and the feature data output by the third self-attention module into the second cross attention module at the same time; inputting the feature data output by the third self-attention module and the feature data output by the fourth self-attention module into the third cross attention module at the same time; S33, inputting the feature data output by the first cross attention module and the feature data output by the second cross attention module into the fourth cross attention module; inputting the feature data output by the second cross attention module and the feature data output by the third cross attention module into the fifth cross attention module; S34, inputting the feature data output by the fourth cross attention module and the feature data output by the fifth cross attention module into the sixth cross attention module; S35, inputting the feature data output by the sixth cross attention module into the stir-fry quality prediction module, the stir-fry time prediction module and the stir-fry temperature prediction module at the same time, and iteratively training all modules through the back propagation algorithm or the gradient descent method, and stopping the iteration after reaching the set prediction accuracy; S36. According to the process from step S31 to step S35, the stir-frying quality prediction model is trained using all the data in the training set to obtain a stir-frying quality prediction model that meets the prediction accuracy.
4. A method for monitoring the frying process of Chinese medicinal materials according to claim 3, characterized in that: The self-attention module uses a residual connection method, which includes a dense transformer layer and a patchy layer. After various types of data pass through the patchy layer and the dense transformer layer in turn, they are added to the feature data after the residual connection and the patchy layer before being output. The cross attention module uses a residual connection method, which includes a dense transformer layer, a forward SSM layer, and a reverse SSM layer. All kinds of data first pass through the dense transformer layer, and then pass through the forward SSM layer and the reverse SSM layer respectively. The results of these two layers are passed through the dense transformer layer again, and finally the results of the dense transformer layer through the residual connection are added and the results are output. The stir-fry quality prediction module, the stir-fry temperature prediction module, and the stir-fry time prediction module are all composed of two fully connected layers and two layers of ReLU activation functions.
5. A method for monitoring the frying and roasting process of Chinese medicinal materials according to any one of claims 1 to 4, characterized in that: The stir-frying data of Chinese medicinal materials include image data representing the current shape and internal structure of the Chinese medicinal materials during the stir-frying process, spectral data representing the current physical or chemical properties of the Chinese medicinal materials, and sensor data representing the current smell of the Chinese medicinal materials. Each type of data is marked with the corresponding stir-frying quality, subsequent stir-frying time, and subsequent stir-frying temperature.
6. A method for monitoring the frying process of Chinese medicinal materials according to claim 5, characterized in that: After obtaining the historical stir-frying data of Chinese medicinal materials, it is necessary to perform noise reduction processing on the historical stir-frying data; the specific noise reduction process is as follows: use image processing technology to perform noise reduction processing on image data to reduce image noise in image data and improve image quality; use spectral filtering method to perform noise reduction processing on spectral data to smooth the spectral curve in spectral data; use digital filtering to perform noise reduction processing on sensor data to reduce high-frequency noise in sensor data.
7. A method for monitoring the frying process of Chinese medicinal materials according to claim 6, characterized in that: After the historical data is subjected to noise reduction, the feature extraction process is then performed. The specific process is as follows: The gray level co-occurrence matrix in the image processing technology is used to extract features from the image data, and the extracted features are recorded as image features, and the image features are marked with the roasting quality, subsequent roasting time and subsequent roasting temperature corresponding to the original image data; The principal component analysis or partial least squares method in the dimensionality reduction technology is used to extract the features in the spectral data, and the extracted features are recorded as spectral features, and the spectral features are marked with the roasting quality, subsequent roasting time and subsequent roasting temperature corresponding to the original spectral data; The features in the sensor data are extracted using a feature selection algorithm, and the extracted features are recorded as odor features, and the odor features are marked with the roasting quality, subsequent roasting time, and subsequent roasting temperature corresponding to the original sensor data.
8. The method for monitoring the frying process of Chinese medicinal materials according to claim 7, characterized in that: The image data includes three-dimensional data representing the internal structure of the Chinese medicinal material and an optical image representing the plane image of the appearance of the Chinese medicinal material; the three-dimensional data is subjected to feature extraction by the gray-level co-occurrence matrix in the image processing technology to obtain three-dimensional features; The optical image is subjected to feature extraction using the gray-level co-occurrence matrix in image processing technology to obtain optical features.
9. A method for monitoring the frying process of Chinese medicinal materials according to claim 8, characterized in that: By using an image acquisition device to photograph the Chinese medicinal materials during the frying process, image data representing the current shape and internal structure of the Chinese medicinal materials can be obtained; by using a spectrometer to irradiate the Chinese medicinal materials during the frying process, spectral data representing the current physical or chemical properties of the Chinese medicinal materials can be obtained; by using an odor sensor to detect the molecular components emitted by the Chinese medicinal materials during the frying process, sensor data representing the current odor of the Chinese medicinal materials can be obtained.
10. A monitoring system for the frying and roasting process of Chinese medicinal materials, the monitoring system using the monitoring method for the frying and roasting process of Chinese medicinal materials according to claim 9, characterized in that: It includes the following components: Data collection unit: used to collect the frying data of Chinese medicinal materials during the frying process; Data preprocessing unit: used to perform noise reduction on the acquired frying data; Data extraction unit; used to extract features from the denoised data and store the extracted features in a training set; Model building unit: used to train the model using the stir-fry features in the training set to obtain a stir-fry quality prediction model that meets the prediction accuracy; Model application unit: Apply the stir-frying quality prediction model to the traditional Chinese medicine preparation scenario, use the stir-frying quality prediction model to predict the stir-frying quality, subsequent stir-frying heat and subsequent stir-frying time of traditional Chinese medicine during the stir-frying process, and monitor the stir-frying process of traditional Chinese medicine through the prediction results.
Citation Information
Cited By
Full-automatic integrated traditional Chinese medicine detection method and equipment
CN119757775A
A fully automatic integrated traditional Chinese medicine detection method and equipment
CN119757775B
Medical material processing and production digital visual supervision system and method based on cloud platform
CN120669651A
Method and system for optimizing stir-frying process of traditional Chinese medicine decoction pieces
CN120875653A
A method and system for optimizing a traditional Chinese medicine decoction piece frying process
CN120875653B