American ginseng quality detection method and system based on S transformation and multi-task deep learning

Through the method based on S transform and multi-task deep learning, the time-frequency feature map of the near-infrared spectrum of American ginseng is extracted, and combined with the multi-task deep learning model, the problem of insufficient quality detection accuracy of American ginseng is solved, and efficient and interpretable multi-task detection is achieved, which is suitable for quality analysis and origin classification of American ginseng and other crops.

CN120558902APending Publication Date: 2025-08-29HENAN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510530471.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

The traditional American ginseng quality detection methods have problems such as insufficient detection accuracy, low efficiency and inability to adapt to large-scale and efficient real-time detection, especially in the case of small samples, the modeling capabilities of traditional machine learning methods are insufficient.

Method used

The time-frequency feature map of the near-infrared spectrum of American ginseng is extracted through S-transform, and the multi-task deep learning model is used for feature extraction and interaction. Combined with feature interaction network and multi-task head network, the quality index prediction and origin classification of American ginseng are realized.

Benefits of technology

It improves the accuracy and efficiency of American ginseng quality detection, can complete multi-task detection at the same time, reduces repeated calculations, enhances feature interaction, provides interpretability of model decisions, and is suitable for quality detection and classification tasks of other crops.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120558902A_ABST
    Figure CN120558902A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of American ginseng quality detection, in particular to an American ginseng quality detection method and system based on S-transformation and multi-task deep learning. Near infrared spectrum data of American ginseng to be detected are extracted, and time-frequency conversion is performed on the near infrared spectrum data through S-transformation; obtaining a time-frequency characteristic pattern used for representing time-frequency domain information of the near infrared spectrum; and inputting the to-be-detected American ginseng time-frequency feature map into a pre-trained multi-task deep learning model, and identifying the producing area of the to-be-detected American ginseng and predicting the quality index of the to-be-detected American ginseng by using the multi-task deep learning model. The multi-task deep learning model comprises a feature extraction network used for extracting time-frequency features of each detection task of the feature map, a feature interaction network used for enhancing feature complementation between the tasks and performing feature fusion, and a multi-task head network used for executing a production place identification task and a quality index prediction task according to the time-frequency features and outputting the tasks. The method can be suitable for quality analysis and origin classification of small American ginseng samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of American ginseng quality detection technology, and in particular to a method and system for American ginseng quality detection based on S-transformation and multi-task deep learning. Background Art

[0002] In the modern food industry, quality control and origin traceability of American ginseng have become key links in ensuring product quality and safety. Traditional quality inspection methods mostly rely on manual sensory evaluation, chemical analysis, and physical testing. Although these methods are accurate, they usually take a long time and are destructive, making them unable to adapt to large-scale, efficient, and real-time testing needs. Near-infrared spectroscopy (NIR) technology has gradually become one of the mainstream methods for analyzing American ginseng components due to its advantages of being fast and non-destructive. However, traditional machine learning methods still face the problems of cumbersome feature extraction and insufficient modeling capabilities when processing American ginseng near-infrared spectral data, which greatly limits the improvement of detection accuracy and efficiency.

[0003] In recent years, deep learning technology has begun to be applied to near-infrared spectral data analysis due to its outstanding automatic feature extraction and pattern recognition capabilities. Convolutional neural networks (CNNs) automatically learn features from spectral data, extracting high-order time-frequency features and improving prediction accuracy. However, due to the relatively small amount of American ginseng sample data, direct training using near-infrared spectral data as input still has certain limitations. Therefore, improving prediction accuracy with small sample sizes and effectively handling the complex characteristics of American ginseng have become current technical challenges. Summary of the Invention

[0004] To this end, the present invention provides a method and system for detecting the quality of American ginseng based on S-transform and multi-task deep learning, which solves the problem that the existing small sample American ginseng quality detection effect has certain limitations.

[0005] According to the design scheme provided by the present invention, on the one hand, a method for detecting the quality of American ginseng based on S-transform and multi-task deep learning is provided, comprising:

[0006] Extracting the near-infrared spectrum data of the American ginseng to be detected, and performing time-frequency conversion on the near-infrared spectrum data by S-transformation to obtain a time-frequency feature map for representing the time-frequency domain information of the near-infrared spectrum of the American ginseng to be detected;

[0007] The time-frequency feature map of the American ginseng to be tested is input into a pre-trained multi-task deep learning model, and the multi-task deep learning model is used to identify the origin of the American ginseng to be tested and predict the quality indicators of the American ginseng to be tested. The multi-task deep learning model includes a feature extraction network for extracting the time-frequency features of each detection task in the feature map, a feature interaction network for enhancing feature complementarity between tasks and performing feature fusion, and a multi-task head network that performs origin identification tasks and quality indicator prediction tasks based on time-frequency features and outputs them.

[0008] As the American ginseng quality detection method based on S-transform and multi-task deep learning of the present invention, further, extracting the near-infrared spectrum data of the American ginseng to be detected, comprising:

[0009] Slice and pre-treat the American ginseng to be tested, wherein the pre-treatment includes: refrigeration treatment in a refrigerated environment and static treatment in a designated environment;

[0010] The near-infrared spectral data of the American ginseng slices to be tested after preprocessing are collected within a specified range by a near-infrared spectral analyzer.

[0011] As the American ginseng quality detection method based on S-transform and multi-task deep learning of the present invention, further, the near-infrared spectral data is subjected to time-frequency conversion by S-transform, comprising:

[0012] Set the time window size and process the near-infrared spectral data in segments by sliding the time window;

[0013] By performing Fourier transform on the near-infrared spectral data in each time window, a time-frequency feature fusion matrix is ​​obtained, wherein the time-frequency feature fusion matrix contains time-frequency positioning information and multi-scale resolution information in each band of the near-infrared spectrum;

[0014] Each element in the time-frequency feature fusion matrix is ​​mapped to the grayscale range to obtain the time-frequency feature map of the near-infrared spectrum of the American ginseng to be detected after grayscale processing.

[0015] As a method for detecting quality of American ginseng based on S-transform and multi-task deep learning of the present invention, the feature extraction network further includes: an initial convolution layer for extracting low-level features of an input feature map, and a plurality of dense blocks for gradually compressing the feature space through dense connections and adjusting the number of channels to reuse and expand the low-level features to extract high-level features of the input feature map and output them. The input of each dense block includes the output of all previous layers of the current dense block, and the output of all previous layers of the current dense block is spliced ​​in the channel dimension and input into the current dense block, and the dense blocks are connected by a transition layer.

[0016] As the American ginseng quality detection method based on S transform and multi-task deep learning of the present invention, the feature interaction network further includes: SENet, which uses an average pooling layer, a fully connected layer and an activation function to capture the global features of the feature extraction network output feature map and calibrates the feature map at the channel level, a classification task feature extraction layer for extracting the origin identification classification task features in the SENet output feature map, a regression task feature extraction layer for extracting the quality indicator prediction regression task features in the SENet output feature map, and a gated interaction layer for adjusting and fusing the classification task features and the regression task features through a gating mechanism.

[0017] As the American ginseng quality detection method based on S transform and multi-task deep learning of the present invention, further, the multi-task head network includes a global average pooling layer for performing average pooling operation on the fused feature map, and a classification and recognition fully connected layer for classifying and identifying the origin of American ginseng based on the fused features, and an index prediction fully connected layer for predicting the quality index of American ginseng based on the fused features. The classification and recognition fully connected layer and the index prediction fully connected layer are executed in parallel.

[0018] As the American ginseng quality detection method based on S-transform and multi-task deep learning of the present invention, further, the multi-task deep learning model training process includes:

[0019] Collect slices of American ginseng samples from known regions, collect near-infrared spectral data of the slices using a near-infrared spectrometer, monitor the total ginsenoside content in the slices using a liquid chromatograph, and use the total ginsenoside content as a quality indicator for American ginseng, and mark the known region as the place of origin;

[0020] The near-infrared spectral data of American ginseng sample slices were processed using S-transform to obtain the corresponding time-frequency feature grayscale image. Sample data for model training was constructed based on the time-frequency feature grayscale image and American ginseng quality index markers and origin markers.

[0021] The sample data is randomly divided into a training set and a test set according to a specified ratio. The training set is used to train the multi-task deep learning model, and the test set is used to test and evaluate the trained multi-task deep learning model.

[0022] Based on the test evaluation results, the multi-task deep learning model used for the American ginseng detection task is determined.

[0023] On the other hand, the present invention also provides a ginseng quality detection system based on S transform and multi-task deep learning, comprising: a data acquisition module and a task detection module, wherein:

[0024] A data acquisition module is used to extract the near-infrared spectrum data of the American ginseng to be detected, and perform time-frequency conversion on the near-infrared spectrum data through S-transformation to obtain a time-frequency feature map for representing the time-frequency domain information of the near-infrared spectrum of the American ginseng to be detected;

[0025] The task detection module is used to input the time-frequency feature map of the American ginseng to be detected into a pre-trained multi-task deep learning model, and use the multi-task deep learning model to identify the origin of the American ginseng to be detected and predict the quality indicators of the American ginseng to be detected. The multi-task deep learning model includes a feature extraction network for extracting the time-frequency features of each detection task in the feature map, a feature interaction network for enhancing feature complementarity between tasks and performing feature fusion, and a multi-task head network that executes the origin identification task and the quality indicator prediction task based on the time-frequency features and outputs them.

[0026] Beneficial effects of the present invention:

[0027] The present invention can simultaneously complete the prediction of American ginseng quality indicators and the classification of origin tasks through a multi-task head network structure. Compared with traditional single-task models (such as ResNet, MobileNet, etc.), it shares feature extraction networks on multiple tasks, thereby improving computational efficiency and making full use of shared information between tasks to avoid repeated calculations. Through S-transformation, the time-frequency features of American ginseng samples can be extracted and high-quality grayscale images can be generated, effectively capturing the time-frequency features of near-infrared spectral data, providing richer information for model learning, and enhancing the performance of American ginseng quality and origin classification tasks; the feature interaction network integrates SENet modules, Gated Interaction modules and other mechanisms to enhance the interaction between task-specific features, optimize the deep interaction between shared features and task-specific features, improve the performance of the model in multi-task learning, and use the Grad-CAM algorithm to generate a visual feature heat map of model predictions, revealing the time-frequency feature areas that the model focuses on in American ginseng quality prediction and origin classification tasks. Compared with traditional black box models, it can provide interpretability of model decisions, help researchers understand the behavior of the model and its focus areas in specific tasks, and enhance the trust and transparency of American ginseng quality analysis. This solution is based on a multi-task model architecture of deep learning, and through reasonable feature extraction and interaction mechanisms, it is not only suitable for quality analysis and origin classification of American ginseng samples, but can also be extended to quality inspection and classification tasks of other crops. It has broad application potential and market prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 Schematic diagram of the American ginseng quality detection process based on S-transform and multi-task deep learning in the embodiment;

[0029] Figure 2 This is a schematic diagram of the multi-task deep learning model structure in the embodiment;

[0030] Figure 3 This is a schematic diagram of a slice of a American ginseng sample in the embodiment;

[0031] Figure 4 The original NIR spectrum of American ginseng in the examples is shown;

[0032] Figure 5 This is a grayscale diagram of the time-frequency characteristics of American ginseng in the embodiment;

[0033] Figure 6 Schematic diagram of the algorithm flow for quality detection of American ginseng in the embodiment;

[0034] Figure 7 This is a visualization diagram of the feature heat map in the embodiment. DETAILED DESCRIPTION

[0035] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention is further described in detail below with reference to the accompanying drawings and technical solutions.

[0036] Aiming at the shortcomings of existing American ginseng quality detection and origin identification technologies in terms of real-time performance, non-destructive testing, and small sample accuracy, the embodiments of the present invention, such as Figure 1 As shown, a method for detecting the quality of American ginseng based on S-transform and multi-task deep learning is provided, comprising:

[0037] S101, extracting the near-infrared spectrum data of the American ginseng to be detected, and performing time-frequency conversion on the near-infrared spectrum data by S-transformation to obtain a time-frequency feature graph for representing the time-frequency domain information of the near-infrared spectrum of the American ginseng to be detected.

[0038] The extraction of near-infrared spectrum data of American ginseng to be tested can be designed to include:

[0039] Slice and pre-treat the American ginseng to be tested, wherein the pre-treatment includes: refrigeration treatment in a refrigerated environment and static treatment in a designated environment;

[0040] The near-infrared spectral data of the American ginseng slices to be tested after preprocessing are collected within a specified range by a near-infrared spectral analyzer.

[0041] Specifically, the time-frequency conversion of near-infrared spectral data is performed by S-transformation, which can be designed to include:

[0042] Set the time window size and process the near-infrared spectral data in segments by sliding the time window;

[0043] By performing Fourier transform on the near-infrared spectral data in each time window, a time-frequency feature fusion matrix is ​​obtained, wherein the time-frequency feature fusion matrix contains time-frequency positioning information and multi-scale resolution information in each band of the near-infrared spectrum;

[0044] Each element in the time-frequency feature fusion matrix is ​​mapped to the grayscale range to obtain the time-frequency feature map of the near-infrared spectrum of the American ginseng to be detected after grayscale processing.

[0045] S102. Input the time-frequency feature graph of the American ginseng to be detected into a pre-trained multi-task deep learning model, and use the multi-task deep learning model to identify the origin of the American ginseng to be detected and predict the quality indicators of the American ginseng to be detected. The multi-task deep learning model includes a feature extraction network for extracting the time-frequency features of each detection task in the feature graph, a feature interaction network for enhancing feature complementarity between tasks and performing feature fusion, and a multi-task head network for performing origin identification tasks and quality indicator prediction tasks based on time-frequency features and outputting outputs.

[0046] The feature extraction network may include: an initial convolutional layer for extracting low-level features of the input feature map, and a number of dense blocks for gradually compressing the feature space through dense connections and adjusting the number of channels to reuse and expand the low-level features to extract high-level features of the input feature map and output them. The input of each dense block includes the output of all layers before the current dense block. The output of all layers before the current dense block is spliced ​​in the channel dimension and input into the current dense block, and the dense blocks are connected by a transition layer. The feature interaction network may include: SENet, which uses average pooling layers, fully connected layers, and activation functions to capture the global features of the feature extraction network output feature map and calibrates the feature map at the channel level, outputs, a classification task feature extraction layer for extracting features for the origin identification classification task in the SENet output feature map, a regression task feature extraction layer for extracting features for the quality indicator prediction regression task in the SENet output feature map, and a gated interaction layer that adjusts and fuses the classification task features and regression task features through a gating mechanism.

[0047] The multi-task head network may include a global average pooling layer for performing an average pooling operation on the fused feature map, a classification and recognition fully connected layer for classifying and identifying the origin of American ginseng based on the fused features, and an index prediction fully connected layer for predicting the quality index of American ginseng based on the fused features. The classification and recognition fully connected layer and the index prediction fully connected layer are executed in parallel.

[0048] like Figure 2As shown in the figure, the feature extraction network uses the DenseNet model as the backbone network, consisting of an initial convolutional layer and four DenseBlocks. A multi-path feature extraction module is added to the initial convolutional layer and DenseBlocks to improve the model's performance and efficiency in extracting time-frequency and grayscale features. The feature interaction network integrates the SENet module, the Classification Feature Layer, the Regression Feature Layer, and the Gated Interaction module. The SENet module optimizes the deep interaction between shared features and task-specific features, allowing each task to focus on its own relevant features; the Classification Feature Layer extracts features for classification tasks; the Regression Feature Layer extracts features for regression tasks; and the Gated Interaction module is a private feature interaction module based on a gating system that enhances collaboration between task-specific features. The multi-task head network includes a global average pooling layer and two parallel fully connected layers to simultaneously complete classification and regression tasks. The hierarchical structure design of each network in practical applications can be shown in Table 1.

[0049] Table 1 Multi-task deep learning model structure

[0050]

[0051]

[0052] Through the feature extraction network, feature interaction network and multi-task head network shown in Table 1, and using the Dense Block network for time-frequency feature extraction in the feature extraction network, combined with the feature interaction network to optimize the deep collaboration between shared features and task-specific features, enhance the feature complementarity between tasks, and finally achieve simultaneous detection of American ginseng origin identification and quality index prediction through the multi-task head network.

[0053] Specifically, the multi-task deep learning model training process can be designed to include:

[0054] Collect slices of American ginseng samples from known regions, collect near-infrared spectral data of the slices using a near-infrared spectrometer, monitor the total ginsenoside content in the slices using a liquid chromatograph, and use the total ginsenoside content as a quality indicator for American ginseng, and mark the known region as the place of origin;

[0055] The near-infrared spectral data of American ginseng sample slices were processed using S-transform to obtain the corresponding time-frequency feature grayscale image. Sample data for model training was constructed based on the time-frequency feature grayscale image and American ginseng quality index markers and origin markers.

[0056] The sample data is randomly divided into a training set and a test set according to a specified ratio. The training set is used to train the multi-task deep learning model, and the test set is used to test and evaluate the trained multi-task deep learning model.

[0057] Based on the test evaluation results, the multi-task deep learning model used for the American ginseng detection task is determined.

[0058] Sample preparation, such as Figure 3 As shown, American ginseng samples from four regions (Weihai, Shandong, Baishan, Jilin, Montreal, Canada, and Wisconsin, USA) can be used, and the origin of these samples has been verified by experts. All samples are cut into uniform sizes, and 5-8 slices are regarded as one sample, with a total of 300 groups. All samples are healthy, complete, and stored in a refrigerated environment at 2°C. Before measuring the near-infrared spectral data and quality indicators, all samples are taken out and kept at a temperature of 20°C for 8 hours to ensure data consistency during the near-infrared spectral analysis process. The near-infrared spectral data of the American ginseng sample can be collected by the DA7250 NIR analyzer in the range of 950 to 1650nm with a resolution of 0.5nm. The device has a built-in tungsten halogen light source, and collects spectral data after 30 minutes of preheating. The sliding window technology is used to reduce the original spectrum from 1401 dimensions to 280 dimensions to reduce redundant information. The obtained original NIR spectrum is as shown below. Figure 4 The total ginsenoside content in American ginseng samples can be determined by HPLC.

[0059] After S-transformation, a time-frequency feature fusion matrix S is obtained, which contains the time-frequency positioning and multi-scale resolution information of all bands of NIR data. Then each element in the feature fusion matrix is ​​linearly mapped to the grayscale range [0, 255], thereby obtaining a time-frequency feature grayscale image based on ST, such as Figure 5 The American ginseng sample dataset was randomly divided into a training set and a test set in a ratio of 7:3, so that the training set and the test set were used for model training and evaluation respectively.

[0060] Furthermore, based on the above method, an embodiment of the present invention also provides a ginseng quality detection system based on S transform and multi-task deep learning, comprising: a data acquisition module and a task detection module, wherein:

[0061] A data acquisition module is used to extract the near-infrared spectrum data of the American ginseng to be detected, and perform time-frequency conversion on the near-infrared spectrum data through S-transformation to obtain a time-frequency feature map for representing the time-frequency domain information of the near-infrared spectrum of the American ginseng to be detected;

[0062] The task detection module is used to input the time-frequency feature map of the American ginseng to be detected into a pre-trained multi-task deep learning model, and use the multi-task deep learning model to identify the origin of the American ginseng to be detected and predict the quality indicators of the American ginseng to be detected. The multi-task deep learning model includes a feature extraction network for extracting the time-frequency features of each detection task in the feature map, a feature interaction network for enhancing feature complementarity between tasks and performing feature fusion, and a multi-task head network that executes the origin identification task and the quality indicator prediction task based on the time-frequency features and outputs them.

[0063] To verify the effectiveness of this solution, the following is a further explanation based on experimental data:

[0064] Based on the training and test sets of the American ginseng samples, we conducted comparative experiments with three single-task deep learning models (ResNet, MobileNet, and ShuffleNet) and their corresponding multi-task models. The final experimental results were averaged across 10 replicates to verify the effectiveness of the MTDGNet model used in this case study.

[0065] To evaluate the performance of the model in the tasks of predicting the quality index content of American ginseng and classifying the origin of the plant, the following indicators were used:

[0066] The coefficient of determination (R 2 ), root mean square error (RMSE), and residual prediction deviation (RPD) are used to measure the fit between the predicted value and the true value, the error, and the prediction stability, respectively. Accuracy (ACC) and F1 score are used to evaluate the classification effect.

[0067] like Figure 6 As shown in the figure, the Grad-CAM algorithm is used to visualize the features of the time-frequency feature grayscale image of American ginseng samples extracted by the MTDGNet model. By generating a feature heat map, it can be revealed which parts of the time-frequency feature grayscale image the model focuses on when predicting American ginseng quality indicators and origin classification tasks.

[0068] The experiment is divided into the following three parts:

[0069] Experiment 1: Use the single-task model DenseNet to perform origin classification and quality indicator prediction tasks. Feature heatmaps are generated from the output of the feature extraction network to analyze the feature attention ability of the single-task model.

[0070] Experiment 2: We replaced the output layer of the single-task model DenseNet with a multi-task head network to construct the multi-task model MTDNet. MTDNet was used to simultaneously predict American ginseng quality indicators and origin classification. Feature heatmaps were generated from the output of the feature extraction network to analyze the impact of shared features on multi-task learning.

[0071] Experiment 3: In FFMNet, we use MTDGNet to perform the same task and generate feature heatmaps from the output of the feature interaction network to evaluate the role of the feature interaction mechanism in improving model performance.

[0072] Table 2 Experimental results

[0073]

[0074] The experimental results are shown in Table 2 and Figure 7 As shown in the figure, the absorption peaks of the NIR spectrum of American ginseng are compared with those of the American ginseng. The comparison results can further verify the effectiveness and interpretability of the proposed model.

[0075] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0076] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0077] The units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation is not considered to be beyond the scope of the present invention.

[0078] Those skilled in the art will appreciate that all or part of the steps in the above method can be performed by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk, or an optical disk. Alternatively, all or part of the steps in the above embodiment can be implemented using one or more integrated circuits. Accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or software functional modules. The present invention is not limited to any specific combination of hardware and software.

[0079] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A method for detecting the quality of American ginseng based on S-transform and multi-task deep learning, characterized in that: Include: Extracting the near-infrared spectrum data of the American ginseng to be detected, and performing time-frequency conversion on the near-infrared spectrum data by S-transformation to obtain a time-frequency feature map for representing the time-frequency domain information of the near-infrared spectrum of the American ginseng to be detected; The time-frequency feature map of the American ginseng to be tested is input into a pre-trained multi-task deep learning model, and the multi-task deep learning model is used to identify the origin of the American ginseng to be tested and predict the quality indicators of the American ginseng to be tested. The multi-task deep learning model includes a feature extraction network for extracting the time-frequency features of each detection task in the feature map, a feature interaction network for enhancing feature complementarity between tasks and performing feature fusion, and a multi-task head network that performs origin identification tasks and quality indicator prediction tasks based on time-frequency features and outputs them.

2. The American ginseng quality detection method based on S transform and multi-task deep learning according to claim 1, characterized in that, Extract the near-infrared spectral data of American ginseng to be tested, including: Slice and pre-treat the American ginseng to be tested, wherein the pre-treatment includes: refrigeration treatment in a refrigerated environment and static treatment in a designated environment; The near-infrared spectral data of the American ginseng slices to be tested after preprocessing are collected within a specified range by a near-infrared spectral analyzer.

3. The American ginseng quality detection method based on S transform and multi-task deep learning according to claim 1, wherein The time-frequency conversion of near-infrared spectral data is performed through S-transformation, including: Set the time window size and process the near-infrared spectral data in segments by sliding the time window; By performing Fourier transform on the near-infrared spectral data in each time window, a time-frequency feature fusion matrix is ​​obtained, wherein the time-frequency feature fusion matrix contains time-frequency positioning information and multi-scale resolution information in each band of the near-infrared spectrum; Each element in the time-frequency feature fusion matrix is ​​mapped to the grayscale range to obtain the time-frequency feature map of the near-infrared spectrum of the American ginseng to be detected after grayscale processing.

4. The American ginseng quality detection method based on S transform and multi-task deep learning according to claim 1, wherein The feature extraction network includes: an initial convolutional layer for extracting low-level features of the input feature map, and several dense blocks for gradually compressing the feature space through dense connections and adjusting the number of channels to reuse and expand the low-level features to extract high-level features of the input feature map and output them. The input of each dense block includes the output of all previous layers of the current dense block. The output of all previous layers of the current dense block is spliced ​​in the channel dimension and input into the current dense block, and the dense blocks are connected through the transition layer.

5. The American ginseng quality detection method based on S transform and multi-task deep learning according to claim 1, characterized in that, The feature interaction network includes: SENet, which uses an average pooling layer, a fully connected layer and an activation function to capture the global features of the feature extraction network output feature map and calibrates the feature map at the channel level; a classification task feature extraction layer for extracting the origin identification classification task features in the SENet output feature map; a regression task feature extraction layer for extracting the quality indicator prediction regression task features in the SENet output feature map; and a gated interaction layer for adjusting and fusing the classification task features and the regression task features through a gating mechanism.

6. The American ginseng quality detection method based on S transform and multi-task deep learning according to claim 1, characterized in that, The multi-task head network includes a global average pooling layer for performing average pooling operations on the fused feature map, a classification and recognition fully connected layer for classifying and identifying the origin of American ginseng based on the fused features, and an index prediction fully connected layer for predicting the quality index of American ginseng based on the fused features. The classification and recognition fully connected layer and the index prediction fully connected layer are executed in parallel.

7. The American ginseng quality detection method based on S transform and multi-task deep learning according to claim 1, characterized in that, The multi-task deep learning model training process includes: Collect slices of American ginseng samples from known regions, collect near-infrared spectral data of the slices using a near-infrared spectrometer, monitor the total ginsenoside content in the slices using a liquid chromatograph, and use the total ginsenoside content as a quality indicator for American ginseng, and mark the known region as the place of origin; The near-infrared spectral data of American ginseng sample slices were processed using S-transform to obtain the corresponding time-frequency feature grayscale image. Sample data for model training was constructed based on the time-frequency feature grayscale image and American ginseng quality index markers and origin markers. The sample data is randomly divided into a training set and a test set according to a specified ratio. The training set is used to train the multi-task deep learning model, and the test set is used to test and evaluate the trained multi-task deep learning model. Based on the test evaluation results, the multi-task deep learning model used for the American ginseng detection task is determined.

8. A ginseng quality detection system based on S-transform and multi-task deep learning, characterized in that: Contains: data acquisition module and task detection module, among which, A data acquisition module is used to extract the near-infrared spectrum data of the American ginseng to be detected, and perform time-frequency conversion on the near-infrared spectrum data through S-transformation to obtain a time-frequency feature map for representing the time-frequency domain information of the near-infrared spectrum of the American ginseng to be detected; The task detection module is used to input the time-frequency feature map of the American ginseng to be detected into a pre-trained multi-task deep learning model, and use the multi-task deep learning model to identify the origin of the American ginseng to be detected and predict the quality indicators of the American ginseng to be detected. The multi-task deep learning model includes a feature extraction network for extracting the time-frequency features of each detection task in the feature map, a feature interaction network for enhancing feature complementarity between tasks and performing feature fusion, and a multi-task head network that executes the origin identification task and the quality indicator prediction task based on the time-frequency features and outputs them.

9. An electronic device, characterized in that: include: at least one processor, and a memory coupled to the at least one processor; The memory stores a computer program, and the computer program can be executed by the at least one processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 can be implemented.

Citation Information

Cited By

  • Modeling method suitable for traceability and quality parameter collaborative detection of mineral products

    CN121073511A

  • Modeling method suitable for collaborative detection of traceability and quality parameters of mineral products

    CN121073511B

  • American ginseng quality high-throughput detection method and system based on near infrared spectrum and multi-task deep learning

    CN121601085A