A method and system for detecting tangerine peel year based on feature fusion

Through terahertz time-domain spectroscopy technology and feature fusion methods, using standard normal transformation preprocessing and convolution feature extraction, a classification model was constructed to solve the subjective and time-consuming problems in the identification of tangerine peel years, and achieve fast and accurate non-destructive testing.

CN116297301BActive Publication Date: 2025-09-19SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310116739.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2025-09-19
Estimated Expiration
2043-02-15

AI Technical Summary

Technical Problem

The existing technology has the limitations of being highly subjective, time-consuming chemical analysis and being unable to achieve rapid and non-destructive testing when identifying the age of tangerine peel. These are technical problems that cannot be effectively solved, and technical problems that cannot be solved quickly, non-destructively and accurately by the existing technology.

Method used

A technical solution was adopted: through multi-angle technical solutions, terahertz time-domain spectroscopy technology was used to measure the tangerine peel samples, combined with feature fusion methods, including standard normal transformation preprocessing, convolution feature extraction and classification model construction, to achieve rapid and accurate detection of tangerine peel year.

Benefits of technology

It realizes the rapid, accurate and non-destructive detection of the age of tangerine peel, reduces the dependence on the surface flatness of the sample, and can identify the age of tangerine peel from different origins, with universal applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116297301B_ABST
    Figure CN116297301B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting the age of dried tangerine peel based on feature fusion. The method comprises the following steps: obtaining terahertz spectrum information of dried tangerine peel samples at different angles, performing standard normal variable transformation preprocessing on each of the samples, performing a first convolution feature extraction on the standard normal terahertz spectra of the dried tangerine peel samples at different angles, performing corresponding summation and concatenation on the features obtained from the first convolution feature extraction to obtain new features, inputting the new features into a second convolution kernel to perform a second convolution feature extraction to obtain final features, establishing a classification model for the final features using a softmax function and a multi-classification cross entropy loss function, inputting the terahertz spectrum information of the dried tangerine peel sample to be tested into the trained features to establish the classification model, and outputting a predicted category, i.e., predicting the age of the corresponding dried tangerine peel sample. The present invention reduces noise in the spectrum while extracting high-intensity information, thereby achieving rapid and non-destructive detection of the age of dried tangerine peel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tangerine peel year detection, and in particular to a tangerine peel year detection method and system based on feature fusion. Background Art

[0002] The traditional method of differentiating dried tangerine peel in different years is sensory analysis, the color of the dried tangerine peel in different years, smell and texture often have certain difference, but sensory analysis has subjectivity, and because the dried tangerine peel of different storage years has similar morphological characteristics, need comparatively professional technician just can comparatively accurately identify different years, have certain limitation.The chemical analysis method of differentiating dried tangerine peel in different years mainly contains high performance liquid chromatography (HPLC) and gas chromatography-mass spectrometry (GC-MS), although chemical analysis method is comparatively accurate, but it often needs to carry out pre-treatment, need to expend a large amount of time, can not realize quick and nondestructive detection purpose.

[0003] Terahertz waves refer to electromagnetic waves with a frequency between 0.1 and 10 THz. Compared with other electromagnetic waves, terahertz waves have advantages such as strong penetration, low photon energy, wide spectral bandwidth and high signal-to-noise ratio. Since the low-frequency vibration and rotation modes of active ingredients in tangerine peel, such as hesperidin, nobiletin and tangeretin, are all within the terahertz wavelength range, terahertz time-domain spectroscopy (THz-TDS) technology has great potential for accurate, non-destructive and rapid identification of tangerine peel age. However, terahertz instruments have certain requirements for the surface flatness of the sample. Samples with uneven surfaces often cause scattering of terahertz waves and thus lead to large experimental errors. Therefore, it is very important to improve the applicability of the data obtained by terahertz instruments.

[0004] Research has shown that the rational use of terahertz spectral information can indirectly alleviate the limitations of terahertz instruments, enabling their further application. Raw terahertz spectra (low-level features) often contain considerable noise, necessitating further feature extraction to remove redundant or even harmful information. While the extracted features (high-level features) contain greater information, their resolution is lower, resulting in poorer perception of detail. Therefore, achieving appropriate feature extraction is crucial. Summary of the Invention

[0005] In order to overcome the defects and shortcomings of the existing technology, the present invention provides a method and system for detecting the age of tangerine peel based on feature fusion, which improves the applicability of terahertz time-domain spectrometer through multi-angle measurement, and realizes rapid and accurate non-destructive detection of tangerine peel age without destroying the tangerine peel sample.

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

[0007] The present invention provides a method for detecting the age of tangerine peel based on feature fusion, comprising the following steps:

[0008] Terahertz time-domain spectroscopy was used to measure tangerine peel slice samples of different storage years, and the terahertz spectrum information of tangerine peel slice samples at different angles was obtained.

[0009] The terahertz spectra of the tangerine peel slice samples at different angles were preprocessed by standard normal variable transformation to obtain the standard normal terahertz spectra of the tangerine peel slice samples at different angles.

[0010] The standard normal terahertz spectra of the tangerine peel slice sample at different angles are input into the first convolution kernel to perform the first convolution feature extraction, the features after the first convolution feature extraction are correspondingly added and connected, and the output values ​​of the same channel and the same position at different angles are added to obtain new features, and the network structure of the first convolution feature extraction includes a first convolution layer, a first Relu layer, a first maximum pooling layer, a second convolution layer, a second Relu layer, and a second maximum pooling layer connected in sequence;

[0011] Inputting the new features into the second convolution kernel for a second convolution feature extraction to obtain the final features, wherein the network structure of the second convolution feature extraction includes a third convolution layer, a third Relu layer, a third maximum pooling layer, a flattening layer, a first fully connected layer, a fourth Relu layer, a first Dropout layer, a second fully connected layer, a fifth Relu layer, and a second Dropout layer connected in sequence;

[0012] Use the softmax function and multi-classification cross entropy loss function to build a classification model for the final features;

[0013] The terahertz spectrum information of the tangerine peel slice sample to be tested is input into the trained features to establish a classification model, and the predicted category is output, that is, the year of the corresponding tangerine peel slice sample is predicted.

[0014] As a preferred technical solution, the terahertz spectrum information of the tangerine peel slice sample at different angles is obtained, specifically the terahertz spectrum information S0, S1, and S2 of the tangerine peel slice sample at four different angles is obtained. 90 , S 180 and S 270 ;

[0015] The initial position of the tangerine peel sample placed in the mold corresponds to 0°, S0=[X 0-1 ,X 0-2 ,X 0-3 ,…,X 0-n-2 ,X 0-n-1 ,X 0-n ], X is the absorption coefficient value of the corresponding frequency, 0-n is the frequency number at 0°;

[0016] The position of the tangerine peel sample rotated 90° clockwise around the normal line of the tangerine peel sample plane relative to the initial position corresponds to 90°, S 90 =[X 90-1 ,X 90-2 ,X 90 -3,…,X 90-n-2 ,X 90-n-1 ,X 90-n ], 90-n is the frequency number when 90°;

[0017] The position of the tangerine peel sample rotated 180° clockwise around the normal line of the tangerine peel sample plane relative to the initial position corresponds to 180°, S 180 =[X 180-1 ,X 180-2 ,X 180 -3,…,X 180-n-2 ,X 180-n-1 ,X 180-n ], 180-n is the frequency number when 180°;

[0018] The position of the tangerine peel slice sample rotated 270° clockwise around the normal line of the tangerine peel slice sample plane relative to the initial position corresponds to 270°, S 270 =[X 270-1 ,X 270-2 ,X 270 -3,…,X 270-n-2 ,X 270-n-1 ,X 270-n ], 270-n is the frequency number at 270°.

[0019] As a preferred technical solution, the terahertz spectra of the tangerine peel slice sample at different angles are preprocessed by standard normal variable transformation to obtain the standard normal terahertz spectra of the tangerine peel slice sample at different angles. The calculation formula of the standard normal terahertz spectrum is as follows:

[0020]

[0021] S SNV It represents the spectral data of a certain angle after the standard normal variable transformation preprocessing, S represents the average value of the absorption coefficient of all frequencies in the spectral data of a certain angle, i represents the i-th frequency, and n represents the total number of frequencies.

[0022] As a preferred technical solution, the standard normal terahertz spectrum of the tangerine peel sample at different angles is input into the first convolution kernel to perform the first convolution feature extraction. Four angles are selected, and the calculation formulas for the output of the first convolution are respectively:

[0023] S 0-CNN1 =Relu(W0*S 0-sNV )

[0024] S 90-CNN1 =Relu(W 90 *S 90-SNV )

[0025] S 180-CNN1 =Relu(W 180 *S 180-SNV )

[0026] S 270-CNN1 =Relu(W 270 *S 270-SNV )

[0027] Among them, S 0-CNN1 、S 90-CNN1 、S 180-CNN1 and S 270-CNN1 Respectively represent the output features of the first convolution at 0°, 90°, 180° and 270°, Relu represents the activation function Relu, W0, W 90 、W 180 and W 270 Represents the convolution kernel of the first convolution at 0°, 90°, 180° and 270° respectively, S 0-SNV 、S 90-SNV 、S 180-SNV and S 270-SNV Represent the features after 0°, 90°, 180° and 270° standard normal variable transformation preprocessing respectively.

[0028] As a preferred technical solution, the features extracted after the first convolution feature extraction are correspondingly added and connected, and the output values ​​of the same channel and the same position at different angles are added to obtain new features. Four angles are selected, and the new features are specifically expressed as follows:

[0029] S 0-CNN1 =[[M 0-1-1 ,M 0-1-2 ,M 0-1-3 ,…,M 0-1-t-2 ,M 0-1-t-1 ,M 0-1-t ],

[0030] [M 0-2-1 ,M 0-2-2 ,M 0-2-3 ,…,M 0-2-t-2 ,M 0-2-t-1 ,M 0-2-t ],

[0031] [M 0-3-1 ,M 0-3-2 ,M 0-3-3 ,…,M 0-3-t-2 ,M 0-3-t-1,M 0-3-t ],

[0032] ……,

[0033] [M 0-h-1 ,M 0-h-2 ,M 0-h-3 ,…,M 0-h-t-2 ,M 0-h-t-1 ,M 0-h-t ]]

[0034] S 90-CNN1 =[M 90-1-1 ,M 90-1-2 ,M 90-1-3 ,…,M 90-1-t-2 ,M 90-1-t-1 ,M 90-1-t ],

[0035] [M 90-2-1 ,M 90-2-2 ,M 90-2-3 ,…,M 90-2-t-2 ,M 90-2-t-1 ,M 90-2-t ],

[0036] [M 90-3-1 ,M 90-3-2 ,M 90-3-3 ,…,M 90-3-t-2 ,M 90-3-t-1 ,M 90-3-t ],

[0037] ……,

[0038] [M 90-h-1 ,M 90-h-2 ,M 90-h-3 ,…,M 90-h-t-2 ,M 90-h-t-1 ,M 90-h-t ]]

[0039] S 180-CNN1 =[M 180-1-1 ,M 180-1-2 ,M 180-1-3 ,…,M 180-1-t-2 ,M 180-1-t-1 ,M 180-1-t ],

[0040] [M 180-2-1 ,M 180-2-2 ,M 180-2-3 ,…,M 180-2-t-2 ,M 180-2-t-1 ,M 180-2-t ],

[0041] [M 180-3-1 ,M 180-3-2,M 180-3-3 ,…,M 180-3-t-2 ,M 180-3-t-1 ,M 180-3-t ],

[0042] ……,

[0043] [M 180-h-1 ,M 180-h-2 ,M 180-h-3 ,…,M 180-h-t-2 ,M 180-h-t-1 ,M 180-h-t ]]

[0044] S 270-CNN1 =[M 270-1-1 ,M 270-1-2 ,M 270-1-3 ,…,M 270-1-t-2 ,M 270-1-t-1 ,M 270-1-t ]

[0045] [M 270-2-1 ,M 270-2-2 ,M 270-2-3 ,…,M 270-2-t-2 ,M 270-2-t-1 ,M 270-2-t ],

[0046] [M 270-3-1 ,M 270-3-2 ,M 270-3-3 ,…,M 270-3-t-2 ,M 270-3-t-1 ,M 270-3-t ],

[0047] ……,

[0048] [M 270-h-1 ,M 270-h-2 ,M 270-h-3 ,…,M 270-h-t-2 ,M 270-h-t-1 ,M 270-h-t ]]

[0049] S add =[[M 0-1-1 +M 90-1-1 +M 180-1-1 +M 270-1-1 ,M 0-1-2 +M 90-1-2 +M 180-1-2 +M 270-1-2 ,M 0-1-3 +M 90-1-3 +M 180-1-3 +M 270-1-3 ,…,M 0-1-t-2 +M 90-1-t-2 +M180-1-t-2 +M 270-1-t-2 ,M 0-1-t-1 +M 90-1-t-1 +M 180-1-t-1 +M 270-1-t-1 ,M 0-1-t +M 90-1-t +M 180-1-t +M 270-1-t ],[M 0-2-1 +M 90-2-1 +M 180-2-1 +M 270-2-1 ,M 0-2-2 +M 90-2-2 +M 180-2-2 +M 270-2-2 ,M 0-2-3 +M 90-2-3 +M 180-2-3 +M 270-2-3 ,…,M 0-2-t-2 +M 90-2-t-2 +M 180-2-t-2 +M 270-2-t-2 ,M 0-2-t-1 +M 90-2-t-1 +M 180-2-t-1 +M 270-2-t-1 ,M 0-2-t +M 90-2-t +M 180-2-t +M 270-2-t ],[M 0-3-1 +M 90-3-1 +M 180-3-1 +M 270-3-1 ,M 0-3-2 +M 90-3-2 +M 180-3-2 +M 270-3-2 ,M 0-3-3 +M 90-3-3 +M 180-3-3 +M 270-3-3 ,…,M 0-3-t-2 +M 90-3-t-2 +M 180-3-t-2 +M 270-3-t-2 ,M 0-3-t-1 +M 90-3-t-1 +M 180-3-t-1 +M 270-3-t-1 ,M 0-3-t +M 90-3-t +M 180-3-t +M 270-3-t ],

[0050] ……,

[0051] [M 0-h-1 +M 90-h-1 +M 180-h-1 +M 270-h-1 ,M0-h-2 +M 90-h-2 +M 180-h-2 +M 270-h-2 , M 0-h-3 +M 90-h-3 +M 180-h-3 +M 270-h-3 ,…,M 0-h-t-2 +M 90-h-t-2 +M 180-h-t-2 +M 270-h-t-2 ,M 0-h-t-1 +M 90-h-t-1 +M 180-h-t-1 +M 270-h-t-1 ,M 0-h-t +M 90-h-t +M 180-h-t +M 270-h-t ]]

[0052] Among them, S 0-CNN1 , S 90-CNN1 , S 180-CNN1 and S 270-CNN1 Represents the features of the output of the first convolution at 0°, 90°, 180° and 270° respectively, M is the output value of the neuron, 0-ht, 90-ht, 180-ht and 270-ht are the frequency numbers of the hth channel at 0°, 90°, 180° and 270° respectively, + represents the corresponding output value addition operation, S add Represents the new features obtained by corresponding addition and connection.

[0053] As a preferred technical solution, the new features are input into the second convolution kernel for a second convolution feature extraction to obtain the final features. The calculation formula for the second convolution is:

[0054] S CNN2 =Relu(W*S add )

[0055] Where S CNN2 Represents the features obtained by the second convolution feature extraction, Relu represents the activation function Relu, W represents the convolution kernel of the second convolution, S add Indicates the new features obtained by the Add connection layer.

[0056] As a preferred technical solution, the softmax function and the multi-classification cross entropy loss function are used to establish a classification model for the final features. The calculation formula of the softmax function is expressed as:

[0057]

[0058] Among them, p kIndicates the probability of the kth category, num indicates the number of categories, c∈(0,], specifically indicates the cth category, k indicates a category in c, e k represents the output value of the neuron of the kth category,

[0059] The calculation formula of the multi-classification cross entropy loss function is expressed as:

[0060]

[0061] Among them, L represents the output value of the multi-classification cross entropy loss function, a represents the sample number, b represents the category number, and y ij represents the symbolic function, p ab Indicates the predicted probability that sample a belongs to category b;

[0062] The softmax function is used to convert the features into the probability of the corresponding category, and the probability of the category is output as the value of the multi-classification cross entropy loss function.

[0063] The present invention also provides a tangerine peel year detection system based on feature fusion, comprising: a terahertz spectrum information acquisition module, a preprocessing module, a first convolution feature extraction module, a feature addition and connection module, a second convolution feature extraction module, a classification model construction module and a year output module;

[0064] The terahertz spectrum information acquisition module is used to measure tangerine peel slice samples of different storage years using terahertz time-domain spectroscopy technology to obtain terahertz spectrum information of tangerine peel slice samples at different angles;

[0065] The preprocessing module is used to perform standard normal variable transformation preprocessing on the terahertz spectra of the tangerine peel slice sample at different angles to obtain standard normal terahertz spectra of the tangerine peel slice sample at different angles;

[0066] The first convolution feature extraction module is used to input the standard normal terahertz spectra of the tangerine peel slice sample at different angles into the first convolution kernel to perform the first convolution feature extraction;

[0067] The feature addition and connection module is used to perform corresponding addition and connection on the features extracted after the first convolution feature extraction, and add the output values ​​of the same channel and the same position at different angles to obtain new features;

[0068] The network structure of the first convolution feature extraction includes a first convolution layer, a first Relu layer, a first maximum pooling layer, a second convolution layer, a second Relu layer, and a second maximum pooling layer connected in sequence;

[0069] The second convolution feature extraction module is used to input the new features into the second convolution kernel to perform a second convolution feature extraction to obtain the final features;

[0070] The network structure of the second convolutional feature extraction includes a third convolutional layer, a third Relu layer, a third maximum pooling layer, a flattening layer, a first fully connected layer, a fourth Relu layer, a first Dropout layer, a second fully connected layer, a fifth Relu layer and a second Dropout layer connected in sequence;

[0071] The classification model building module is used to establish a classification model for the final features using a softmax function and a multi-classification cross entropy loss function;

[0072] The year output module is used to input the terahertz spectrum information of the tangerine peel slice sample to be tested into the trained features to establish a classification model, and output the predicted category, that is, output the year of the corresponding tangerine peel slice sample.

[0073] As a preferred technical solution, the first convolution feature extraction module performs the first convolution feature extraction and selects four angles, which are expressed as follows:

[0074] S 0-CNN1 =Relu(W0* 0-SNV )

[0075] S 90-CNN1 =Relu(W 90 * 90-SNV )

[0076] S 180-CNN1 =Relu(W 180 * 180-SNV )

[0077] S 270-CNN1 =Relu(W 270 * 270-SNV )

[0078] Among them, S 0-CNN1 、S 9o-CNN1 、S 180-CNN1 and S 270-CNN1 Respectively represent the output features of the first convolution at 0°, 90°, 180° and 270°, Relu represents the activation function Relu, W0, W 90 、W 180 and W 270 Represents the convolution kernel of the first convolution at 0°, 90°, 180° and 270° respectively, S 0-SNV 、S 90-SNV 、S 180-SNV and S 270-SNV Represent the features after 0°, 90°, 180° and 270° standard normal variable transformation preprocessing respectively;

[0079] The calculation formula for the second convolution is:

[0080] S CNN2 =Relu(W*S add )

[0081] Where S CNN2 Represents the features obtained by the second convolution feature extraction, Relu represents the activation function Relu, W represents the convolution kernel of the second convolution, S add Indicates the new features obtained by the Add connection layer.

[0082] As a preferred technical solution, the classification model building module is used to establish a classification model for the final features using the softmax function and the multi-classification cross entropy loss function. The calculation formula of the softmax function is expressed as:

[0083]

[0084] Among them, p k Indicates the probability of the kth category, num indicates the number of categories, c∈(0,], specifically indicates the cth category, k indicates a category in c, e k represents the output value of the neuron of the kth category,

[0085] The calculation formula of the multi-classification cross entropy loss function is expressed as:

[0086]

[0087] Among them, L represents the output value of the multi-classification cross entropy loss function, a represents the sample number, b represents the category number, and y ij represents the symbolic function, p ab Indicates the predicted probability that sample a belongs to category b;

[0088] The softmax function is used to convert the features into the probability of the corresponding category, and the probability of the category is output as the value of the multi-classification cross entropy loss function.

[0089] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0090] The present invention uses terahertz time-domain spectroscopy technology to measure tangerine peel slice samples of different storage years, obtains terahertz spectrum information of the tangerine peel slice samples at different angles, and performs a first convolution feature extraction, corresponding addition connection and a second convolution feature extraction on the terahertz spectrum information at different angles to obtain final features. The fused features have richer information, reduce noise in the spectrum while extracting high-intensity information, and reduce the dependence of the terahertz time-domain spectroscopy instrument on the surface flatness of the sample. Without destroying the tangerine peel slice samples, the present invention realizes rapid and non-destructive detection of the tangerine peel year; and can identify the year of tangerine peel from different origins, without the need to separately model tangerine peel from specific origins, thus having universal applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] Figure 1 Schematic diagram of the process of the tangerine peel year detection method based on feature fusion of the present invention;

[0092] Figure 2 (a) is a schematic diagram of the original terahertz spectrum of the dried tangerine peel slices at different angles of the present invention;

[0093] Figure 2 (b) is a schematic diagram of the terahertz SNV spectrum of the tangerine peel slices at different angles of the present invention;

[0094] Figure 3 Schematic diagram of the first convolution feature extraction of the present invention;

[0095] Figure 4 Schematic diagram of the second convolution feature extraction of the present invention;

[0096] Figure 5 Schematic diagram of the convolutional neural network structure for spectral data at the same angle of the present invention;

[0097] Figure 6 Schematic diagram of the effect of identifying the year of tangerine peel based on multi-input fusion features. DETAILED DESCRIPTION

[0098] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0099] Example 1

[0100] like Figure 1 As shown, this embodiment provides a method for detecting the age of tangerine peel based on feature fusion, comprising the following steps:

[0101] S1: Using terahertz time-domain spectroscopy technology to measure the tangerine peel slice samples of different storage years, the terahertz spectrum information S0, S1 at four different angles (0°, 90°, 180° and 270°) of the tangerine peel slice samples were obtained. 90 , S 180 and S 270 ;

[0102] In this embodiment, the gray-level co-occurrence matrix extraction method of traditional image processing is referenced, and four angles are preferably selected, which can reduce the budget and can also adjust different angle selection methods as needed.

[0103] In this embodiment, the definitions of different angles (0°, 90°, 180°, and 270°) are as follows:

[0104] 0°: refers to the initial position of the tangerine peel slices placed in the mold; S0 = [X 0-1 ,X 0-2 ,X 0-3 ,…,X 0-n-2 ,X 0-n-1 ,X 0-n ], X is the absorption coefficient value of the corresponding frequency, 0-n is the frequency number at 0° (n=1,2,3,…,284);

[0105] 90°: refers to the position of the tangerine peel slice rotated 90° clockwise around the normal line of the tangerine peel slice plane (a straight line that is always perpendicular to the tangerine peel slice plane) relative to the initial position; S 90 =[X 90-1 ,X 90-2 ,X 90 -3,…,X 90-n-2 ,X 90-n-1 ,X 90-n ], X is the absorption coefficient value of the corresponding frequency, 90-n is the frequency number when 90° (n=1, 2, 3, …, 284);

[0106] 180°: refers to the position of the tangerine peel slice rotated 180° clockwise around the normal line of the tangerine peel slice plane relative to the initial position; S 180 =[X 180-1 ,X 180-2 ,X 180 -3,…,X 180-n-2 ,X 180-n-1 ,X 180-n ], X is the absorption coefficient value of the corresponding frequency, and 180-n is the frequency number at 180° (n=1, 2, 3, …, 284).

[0107] 270°: refers to the position of the tangerine peel slice rotated 270° clockwise around the normal line of the tangerine peel slice plane relative to the initial position; S 270 =[X 270-1 ,X270-2 ,X 270 -3,…,X 270-n-2 ,X 270-n-1 ,X 270-n ], X is the absorption coefficient value of the corresponding frequency, and 270-n is the frequency number at 270° (n=1, 2, 3, …, 284).

[0108] S2: The terahertz spectra of the tangerine peel slice samples at four angles are preprocessed by standard normal variable transformation to obtain the standard normal terahertz spectra S of the tangerine peel slice samples at four angles. 0-SNV , S 90-SNV , S 180-SNV and S 270-SNV , the calculation formula of the standard normal terahertz spectrum is as follows:

[0109]

[0110] S SNV represents the spectral data of a certain angle that has been preprocessed by standard normal variable transformation, S represents the average absorption coefficient value of all frequencies in the spectral data of a certain angle, i represents the i-th frequency, and n represents the total number of frequencies (n = 1, 2, 3, ..., 284).

[0111] S3: If Figure 3 As shown, the standard normal terahertz spectra S of the tangerine peel samples at four angles are respectively 0-SNV , S 90-SNV , S 180-SNV and S 270-SNV , input the convolution kernel to perform the first convolution feature extraction, and add and connect the features of the four angles of the tangerine peel sample after the first convolution feature extraction to output the new feature S add .

[0112] The first convolution of the four angles of the same sample from the input layer to the output layer are connected as follows:

[0113] 0°: convolutional layer conv1 (size = 16@3×1, step = 1), Relu layer conv1_relu, maximum pooling layer max_pooling1 (size = 2×1, step = 1);

[0114] 90°: convolutional layer conv2 (size = 16@3×1, step = 1), Relu layer conv2_relu, maximum pooling layer max_pooling2 (size = 2×1, step = 1);

[0115] 180°: convolutional layer conv3 (size = 16@3×1, step = 1), Relu layer conv3_relu, maximum pooling layer max_pooling3 (size = 2×1, step = 1);

[0116] 270°: convolutional layer conv4 (size = 16@3×1, step = 1), Relu layer conv4_relu, maximum pooling layer max_pooling4 (size = 2×1, step = 1).

[0117] In the above examples, different layers within the same perspective are connected sequentially, and the structure of each layer from the input layer to the output layer is consistent. Convolutional layers are used to extract features; Relu layers can introduce nonlinear features to improve the robustness of the model; and max pooling layers are used to prevent overfitting.

[0118] The calculation formula of the Relu function of the Relu layer is as follows:

[0119]

[0120] Among them, Relu(X) represents the value after processing by the Relu layer, and x represents the characteristic value of the neuron.

[0121] The calculation formulas for the output of the first convolution of the four angles of the same sample are:

[0122] 0°: S 0-CNN1 =Relu(W0*S 0-SNV )

[0123] 90°: S 90-CNN1 =Relu(W 90 *S 90-SNV )

[0124] 180°: S 180-CNN1 =Relu(W 180 *S 180-SNV )

[0125] 270°: S 270-CNN1 =Relu(W 270 *S 270-SNV )

[0126] Among them, S 0-CNN1 , S 9o-CNN1 , S 180-CNN1 and S 270-CNN1 Represents the features of the output of the first convolution at 0°, 90°, 180° and 270° respectively, Relu represents the activation function Relu, W0, W 90 , W 180 and W270 Represents the convolution kernel of the first convolution at 0°, 90°, 180° and 270° respectively, S 0-SNV , S 90-SNV , S 180-SNV and S 270-SNV Represent the features after 0°, 90°, 180° and 270° standard normal variable transformation preprocessing respectively.

[0127] The connection method of the Add connection layer is as follows:

[0128] S 0-CNN1 =[[M 0-1-1 ,M 0-1-2 ,M 0-1-3 ,…,M 0-1-t-2 ,M 0-1-t-1 ,M 0-1-t ],

[0129] [M 0-2-1 ,M 0-2-2 ,M 0-2-3 ,…,M 0-2-t-2 ,M 0-2-t-1 ,M 0-2-t ],

[0130] [M 0-3-1 ,M 0-3-2 ,M 0-3-3 ,…,M 0-3-t-2 ,M 0-3-t-1 ,M 0-3-t ],

[0131] ……,

[0132] [M 0-h-1 ,M 0-h-2 ,M 0-h-3 ,…,M 0-h-t-2 ,M 0-h-t-1 ,M 0-h-t ]]

[0133] S 90-CNN1 =[M 90-1-1 ,M 90-1-2 ,M 90-1-3 ,…,M 90-1-t-2 ,M 90-1-t-1 ,M 90-1-t ],

[0134] [M 90-2-1 ,M 90-2-2 ,M 90-2-3 ,…,M 90-2-t-2 ,M 90-2-t-1 ,M 90-2-t ],

[0135] [M 90-3-1 ,M90-3-2 ,M 90-3-3 ,…,M 90-3-t-2 ,M 90-3-t-1 ,M 90-3-t ],

[0136] ……,

[0137] [M 90-h-1 ,M 90-h-2 ,M 90-h-3 ,…,M 90-h-t-2 ,M 90-h-t-1 ,M 90-h-t ]]

[0138] S 180-CNN1 =[M 180-1-1 ,M 180-1-2 ,M 180-1-3 ,…,M 180-1-t-2 ,M 180-1-t-1 ,M 180-1-t ],

[0139] [M 180-2-1 ,M 180-2-2 ,M 180-2-3 ,…,M 180-2-t-2 ,M 180-2-t-1 ,M 180-2-t ],

[0140] [M 180-3-1 ,M 180-3-2 ,M 180-3-3 ,…,M 180-3-t-2 ,M 180-3-t-1 ,M 180-3-t ],

[0141] ……,

[0142] [M 180-h-1 ,M 180-h-2 ,M 180-h-3 ,…,M 180-h-t-2 ,M 180-h-t-1 ,M 180-h-t ]]

[0143] S 270-CNN1 =[M 270-1-1 ,M 270-1-2 ,M 270-1-3 ,…,M 270-1-t-2 ,M 270-1-t-1 ,M 270-1-t ]

[0144] [M 270-2-1 ,M 270-2-2 ,M 270-2-3 ,…,M 270-2-t-2 ,M 270-2-t-1 ,M 270-2-t],

[0145] [M 270-3-1 ,M 270-3-2 ,M 270-3-3 ,…,M 270-3-t-2 ,M 270-3-t-1 ,M 270-3-t ],

[0146] ……,

[0147] [M 270-h-1 ,M 270-h-2 ,M 270-h-3 ,…,M 270-h-t-2 ,M 270-h-t-1 ,M 270-h-t ]]

[0148] S add =[[M 0-1-1 +M 90-1-1 +M 180-1-1 +M 270-1-1 ,M 0-1-2 +M 90-1-2 +M 180-1-2 +M 270-1-2 ,M 0-1-3 +M 90-1-3 +M 180-1-3 +M 270-1-3 ,…,M 0-1-t-2 +M 90-1-t-2 +M 180-1-t-2 +M 270-1-t-2 ,M 0-1-t-1 +M 90-1-t-1 +M 180-1-t-1 +M 270-1-t-1 ,M 0-1-t +M 90-1-t +M 180-1-t +M 270-1-t ],[M 0-2-1 +M 90-2-1 +M 180-2-1 +M 270-2-1 ,M 0-2-2 +M 90-2-2 +M 180-2-2 +M 270-2-2 ,M 0-2-3 +M 90-2-3 +M 180-2-3 +M 270-2-3 ,…,M 0-2-t-2 +M 90-2-t-2 +M 180-2-t-2 +M 270-2-t-2 ,M 0-2-t-1 +M 90-2-t-1 +M 180-2-t-1 +M 270-2-t-1 ,M 0-2-t +M90-2-t +M 180-2-t +M 270-2-t ,[M 0-3-1 +M 90-3-1 +M 180-3-1 +M 270-3-1 ,M 0-3-2 +M 90-3-2 +M 180-3-2 +M 270-3-2 ,M 0-3-3 +M 90-3-3 +M 180-3-3 +M 270-3-3 ,…,M 0-3-t-2 +M 90-3-t-2 +M 180-3-t-2 +M 270-3-t-2 ,M 0-3-t-1 +M 90-3-t-1 +M 180-3-t-1 +M 270-3-t-1 ,M 0-3-t +M 90-3-t +M 180-3-t +M 270-3-t ,

[0149] ……,

[0150] [M 0-h-1 +M 90-h-1 +M 180-h-1 +M 270-h-1 ,M 0-h-2 +M 90-h-2 +M 180-h-2 +M 270-h-2 ,M 0-h-3 +M 90-h-3 +M 180-h-3 +M 270-h-3 ,…,M 0-h-t-2 +M 90-h-t-2 +M 180-h-t-2 +M 270-h-t-2 ,M 0-h-t-1 +M 90-h-t-1 +M<000​​​​​​​​​​​​​​​​​​​​​Represent the features of the output of the first convolution at 0°, 90°, 180° and 270° respectively, M is the output value of the neuron, 0-ht, 90-ht, 180-ht and 270-ht are the frequency numbers of the hth channel at 0°, 90°, 180° and 270° respectively, and + represents the addition operation of the corresponding output values.

[0152] The final feature S is obtained by adding the output values ​​of the same channel at the same position at different angles. add , the information of the fused features is richer.

[0153] S4: As Figure 4 As shown, the new feature S add Input into the convolution kernel for the second convolution feature extraction to obtain the final features.

[0154] The second convolution of the four angles of the same sample is connected from the input layer to the output layer as follows:

[0155] Convolutional layer conv (size = 16@3×1, step = 1), Relu layer conv_relu, maximum pooling layer max_pooling (size = 2×1, step = 1), flattening layer Flatten, fully connected layer dense1 (units = 128), Relu layer dense1_relu, Dropout layer dense1_dropout (p = 0.5), fully connected layer dense2 (units = 128), Relu layer dense2_relu, Dropout layer dense2_dropout (p = 0.5).

[0156] The connections between different layers in the same perspective are all sequential. The convolutional layer is used to extract features; the Relu layer can introduce nonlinear features, thereby improving the robustness of the model; the max pooling layer is used to prevent overfitting of the model; the flattening layer can flatten features of different dimensions, reducing multidimensional features to one dimension; the fully connected layer can integrate features into a single value, reducing the influence of feature position on the classification result; the dropout layer can inactivate some neurons according to a certain probability, thereby preventing overfitting of the model.

[0157] The calculation formula for the second convolution of the same sample at four angles is:

[0158] S CNN2 =Relu(W*S add )

[0159] Among them, S CNN2 Represents the features obtained by the second convolution feature extraction, Relu represents the activation function Relu, W represents the convolution kernel of the second convolution, S addIndicates the features obtained by the Add connection layer.

[0160] S5: Use the softmax function and multi-classification cross entropy loss function to build a classification model for the final features. The calculation formula of the softmax function is:

[0161]

[0162] Among them, p k Indicates the probability of the kth category, num indicates the number of categories, c∈(0,], specifically indicates the cth category, k indicates a category in c, e k represents the output value of the neuron of the kth category,

[0163] The calculation formula of the multi-classification cross entropy loss function is:

[0164]

[0165] Where L represents the output value of the multi-class cross entropy loss function, a represents the sample number (a = 1, 2, 3, ..., A), b represents the category number (b = 1, 2, ..., B), and y ij Represents the symbol function (if the true label of sample a is label b, y ab =1, otherwise y ab =0), p ab It represents the predicted probability that sample a belongs to category b.

[0166] Use the softmax function to transform the feature S add The output is the probability p of the corresponding category k , and then the probability of the category p ab The output is the value L of the multi-classification cross entropy loss function. The smaller L is, the better the prediction effect of the model. If L is too large, it can be fed back to the previous convolutional neural network to automatically modify the parameters of the model to make L smaller and smaller. When L reaches the minimum value, the model can stop training, and the model is the optimal model.

[0167] S6: Input the terahertz spectrum information of the tangerine peel slice sample to be tested into the trained features to establish a classification model, and output the predicted category, that is, predict the year of the corresponding tangerine peel slice sample.

[0168] To further illustrate the detection results of the feature-fused tangerine peel year detection method in this embodiment, tangerine peels from different years were selected for search result verification, as follows:

[0169] (1) Tangerine peel from different years (2017, 2019 and 2021) was cut into 13 mm round tangerine peel slices and placed in a forced air drying oven at 30 °C for drying and preservation. The tangerine peel slices from each year contained a certain number of tangerine peel slices from different origins (Gujing, Qibao, Shuangshui, Meijiang and Sanjiang), and tangerine peel samples from different years were obtained.

[0170] (2) The dried tangerine peel sample was taken out of the blast drying oven, placed in a special mold and placed in a tablet press (1 MPa, 30 s) to flatten the disc. Finally, the flattened disc sample and the special mold were placed in a terahertz detector filled with nitrogen to obtain terahertz spectrum data (to ensure the accuracy of the spectrum measurement, each sample was measured 100 times at the same angle, and the average value was taken as the original spectrum of the sample). The corresponding terahertz time-domain spectrum data of each dried tangerine peel sample were collected in sequence at four angles of 0°, 90°, 180° and 270°.

[0171] (3) Figure 2 As shown in (a), the spectral curves of the same tangerine peel slice at different angles are obtained. It can be seen from the figure that even if it is the same tangerine peel slice, the spectral curves at different angles still have large differences. This is because the surface of the tangerine peel slice is too rough or has particulate matter; and the standard normal variable transformation can eliminate the influence caused by surface scattering as much as possible, which is used in the present invention as a pre-processing method for the spectrum, such as Figure 2 As shown in (b), the spectral curves at the four angles in the figure are closer to the original spectral curve. It can be seen that the standard normal variable transformation can reduce the spectral differences between the four angles of the same sample.

[0172] (4) First, 600 spectral curves (3 years × 5 origins × 10 tangerine peel slices × 4 angles) were divided into training set and test set according to 4:1. Then, the spectral curves of the same tangerine peel slice at different angles after standard normal variable transformation were input into a convolution feature extraction (such as Figure 3 As shown) and secondary convolution feature extraction (as Figure 4 As shown in the figure), the new features of the four angles are output and integrated. Finally, the softmax function and multi-classification cross entropy loss function are used to establish a classification model for the year of tangerine peel.

[0173] (5) Figure 5 As shown in Figure 1, a new convolutional neural network model was used to conduct a comparative modeling analysis of spectral data at the same angle. The modeling results of the same angle and feature fusion are shown in Table 1. As can be seen from Table 1, the modeling effect after multi-input feature fusion is 88.66%, which is better than the 0° spectrum, 90° spectrum, 180° spectrum, and 270° spectrum. This shows that multi-input feature fusion reduces the impact of the surface unevenness of the tangerine peel to a certain extent, thereby improving the accuracy of the model.

[0174] Table 1 Schematic diagram of the detection results of tangerine peel years with different spectral data

[0175]

[0176] Example 2

[0177] Except for the following technical contents, the rest of the technical contents of this embodiment are the same as those of Example 1;

[0178] To further illustrate the detection results of the feature-fused tangerine peel year detection method of this embodiment, tangerine peels from different years from 2017 to 2021 were selected for search result verification, as follows:

[0179] Tangerine peel from different years (2017, 2018, 2019, 2020 and 2021) was cut into 13mm round tangerine peel slices and placed in a forced air drying oven at 30°C for drying and preservation. The tangerine peel slices from each year contained a certain number of tangerine peel slices from different origins (Gujing, Qibao, Shuangshui, Meijiang and Sanjiang), so that tangerine peel samples from different years were obtained.

[0180] (2) The dried tangerine peel sample was taken out of the blast drying oven, placed in a special mold and placed in a tablet press (1 MPa, 30 s) to flatten the disc. Finally, the flattened disc sample and the special mold were placed in a terahertz detector filled with nitrogen to obtain terahertz spectrum data (to ensure the accuracy of the spectrum measurement, each sample was measured 100 times at the same angle, and the average value was taken as the original spectrum of the sample). The corresponding terahertz time-domain spectrum data of each dried tangerine peel sample were collected in sequence at four angles of 0°, 90°, 180° and 270°.

[0181] (3) First, 1000 spectral curves (5 years × 5 origins × 10 tangerine peel slices × 4 angles) were divided into training set and test set according to the ratio of 4:1. Then, the spectral curves of the same tangerine peel slice at different angles after standard normal variable transformation were input into a convolution feature extraction (such as Figure 3 As shown) and secondary convolution feature extraction (as Figure 4 As shown in the figure), the new features of the four angles are output and integrated. Finally, the softmax function and multi-classification cross entropy loss function are used to establish a model for identifying the year of tangerine peel.

[0182] (4) The new convolutional neural network model is used to conduct modeling and comparative analysis on the spectral data at the same angle. The modeling effects of the same angle and feature fusion are shown in Table 2. It can be seen from Table 2 that the modeling effect after multi-input feature fusion is 84.25%, which is better than the 0° spectrum, 90° spectrum, 180° spectrum and 270° spectrum. This shows that multi-input feature fusion reduces the impact of the unevenness of the tangerine peel surface to a certain extent, thereby improving the accuracy of the model. Figure 6 As shown, the confusion matrix of the model results of multi-input feature fusion is obtained, from Figure 6 It can be seen that the discrimination accuracy of multi-input feature fusion for each year exceeds 82.00% and the difference is not much, indicating that multi-input feature fusion has reasonably integrated the spectral information of the four angles.

[0183] Table 2 Schematic diagram of the detection results of tangerine peel years with different spectral data

[0184]

[0185] Example 3

[0186] Except for the following technical contents, the rest of the technical contents of this embodiment are the same as those of Example 1;

[0187] This embodiment provides a tangerine peel year detection system based on feature fusion, comprising: a terahertz spectrum information acquisition module, a preprocessing module, a first convolution feature extraction module, a feature addition and connection module, a second convolution feature extraction module, a classification model construction module, and a year output module;

[0188] In this embodiment, the terahertz spectrum information acquisition module is used to measure tangerine peel slice samples of different storage years using terahertz time-domain spectroscopy technology to obtain terahertz spectrum information of the tangerine peel slice samples at different angles;

[0189] In this embodiment, the preprocessing module is used to perform standard normal variable transformation preprocessing on the terahertz spectra of the tangerine peel slice sample at different angles to obtain standard normal terahertz spectra of the tangerine peel slice sample at different angles;

[0190] In this embodiment, the first convolution feature extraction module is used to input the standard normal terahertz spectra of the tangerine peel slice sample at different angles into the first convolution kernel to perform the first convolution feature extraction;

[0191] In this embodiment, the feature addition and connection module is used to perform corresponding addition and connection on the features extracted after the first convolution feature extraction, and add the output values ​​of the same channel and the same position at different angles to obtain new features;

[0192] In this embodiment, the network structure of the first convolutional feature extraction includes a first convolutional layer, a first Relu layer, a first maximum pooling layer, a second convolutional layer, a second Relu layer, and a second maximum pooling layer connected in sequence;

[0193] In this embodiment, the second convolution feature extraction module is used to input the new features into the second convolution kernel to perform the second convolution feature extraction to obtain the final features;

[0194] In this embodiment, the network structure of the second convolutional feature extraction includes a third convolutional layer, a third Relu layer, a third maximum pooling layer, a flattening layer, a first fully connected layer, a fourth Relu layer, a first Dropout layer, a second fully connected layer, a fifth Relu layer, and a second Dropout layer connected in sequence;

[0195] In this embodiment, the classification model building module is used to establish a classification model for the final features using a softmax function and a multi-classification cross entropy loss function;

[0196] In this embodiment, the year output module is used to input the terahertz spectrum information of the tangerine peel slice sample to be tested into the trained feature to establish a classification model, and output the predicted category, that is, output the year of the corresponding tangerine peel slice sample.

[0197] In this embodiment, the first convolution feature extraction module performs the first convolution feature extraction and selects four angles, which are respectively represented as:

[0198] S 0-CNN1 =Relu(W0* 0-sNV )

[0199] S 90-CNN1 =Relu(W 90 * 90-SNV )

[0200] S 180-CNN1 =Relu(W 180 * 180-SNV )

[0201] S 270-CNN1 =Relu(W 270 * 270-SNV )

[0202] Among them, S 0-CNN1 、S 90-CNN1 、S 180-CNN1 and S 270-CNN1 Respectively represent the output features of the first convolution at 0°, 90°, 180° and 270°, Relu represents the activation function Relu, W0, W 90 、W 180 and W 270Represents the convolution kernel of the first convolution at 0°, 90°, 180° and 270° respectively, S 0-SNV 、S 90-SNV 、S 180-SNV and S 270-SNV Represent the features after 0°, 90°, 180° and 270° standard normal variable transformation preprocessing respectively;

[0203] The calculation formula for the second convolution is:

[0204] S CNN2 =Eelu(W*S add )

[0205] Where S CNN2 Represents the features obtained by the second convolution feature extraction, Relu represents the activation function Relu, W represents the convolution kernel of the second convolution, S add Indicates the new features obtained by the Add connection layer.

[0206] In this embodiment, the classification model building module is used to establish a classification model for the final features using the softmax function and the multi-classification cross entropy loss function. The calculation formula of the softmax function is expressed as:

[0207]

[0208] Among them, p k Indicates the probability of the kth category, num indicates the number of categories, c∈(0,], specifically indicates the cth category, k indicates a category in c, e k represents the output value of the neuron of the kth category,

[0209] The calculation formula of the multi-classification cross entropy loss function is expressed as:

[0210]

[0211] Among them, L represents the output value of the multi-classification cross entropy loss function, a represents the sample number, b represents the category number, and y ij represents the symbolic function, p ab It represents the predicted probability that sample a belongs to category b.

[0212] The softmax function is used to convert the features into the probability of the corresponding category, and the probability of the category is output as the value of the multi-classification cross entropy loss function.

[0213] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A method for detecting the age of dried tangerine peel based on feature fusion, characterized in that: The steps include: Terahertz time-domain spectroscopy was used to measure tangerine peel slice samples of different storage years, and the terahertz spectrum information of tangerine peel slice samples at different angles was obtained. The terahertz spectrum information of the tangerine peel slice sample at different angles is obtained, specifically the terahertz spectrum information S0, S1, S2, and S3 of the tangerine peel slice sample at four different angles is obtained. 90 , S 180 and S 270 ; The initial position of the tangerine peel sample placed in the mold corresponds to 0°, S0=[X 0-1 ,X 0-2 ,X 0-3 ,…,X 0-n-2 ,X 0-n-1 ,X 0-n ], X is the absorption coefficient value of the corresponding frequency, 0-n is the frequency number at 0°; The position of the tangerine peel sample rotated 90° clockwise around the normal line of the tangerine peel sample plane relative to the initial position corresponds to 90°, S 90 =[X 90-1 ,X 90-2 ,X 90-3 ,…,X 90-n-2 ,X 90-n-1 ,X 90-n ], 90-n is the frequency number when 90°; The position of the tangerine peel sample rotated 180° clockwise around the normal line of the tangerine peel sample plane relative to the initial position corresponds to 180°, S 180 =[X 180-1 ,X 180-2 ,X 180-3 ,…,X 180-n-2 ,X 180-n-1 ,X 180-n ], 180-n is the frequency number when 180°; The position of the tangerine peel slice sample rotated 270° clockwise around the normal line of the tangerine peel slice sample plane relative to the initial position corresponds to 270°, S 270 =[X 270-1 ,X 270-2 ,X 270-3 ,…,X 270-n-2 ,X 270-n-1 ,X 270-n ], 270-n is the frequency number at 270°; The terahertz spectra of the tangerine peel slice samples at different angles were preprocessed by standard normal variable transformation to obtain the standard normal terahertz spectra of the tangerine peel slice samples at different angles. The standard normal terahertz spectra of the tangerine peel slice sample at different angles are input into the first convolution kernel to perform the first convolution feature extraction, the features after the first convolution feature extraction are correspondingly added and connected, and the output values ​​of the same channel and the same position at different angles are added to obtain new features, and the network structure of the first convolution feature extraction includes a first convolution layer, a first Relu layer, a first maximum pooling layer, a second convolution layer, a second Relu layer, and a second maximum pooling layer connected in sequence; The standard normal terahertz spectra of the tangerine peel slice sample at different angles are input into the first convolution kernel to perform the first convolution feature extraction. Four angles are selected, and the calculation formulas of the output of the first convolution are respectively: S 0-CNN1 =Relu(W0*S 0-SNV ) S 90-CNN1 =Relu(W 90 *S 90-SNV ) S 180-CNN1 =Relu(W 180 *S 180-SNV ) S 270-CNN1 =Relu(W 270 *S 270-SNV ) Among them, S 0-CNN1 、S 90-CNN1 、S 180-CNN1 and S 270-CNN1 Respectively represent the output features of the first convolution at 0°, 90°, 180° and 270°, Relu represents the activation function Relu, W0, W 90 、W 180 and W 270 Represents the convolution kernel of the first convolution at 0°, 90°, 180° and 270° respectively, S 0-SNV 、S 90-SNV 、S 180-SNV and S 270-SNV Represent the features after 0°, 90°, 180° and 270° standard normal variable transformation preprocessing respectively; Inputting the new features into the second convolution kernel for a second convolution feature extraction to obtain the final features, wherein the network structure of the second convolution feature extraction includes a third convolution layer, a third Relu layer, a third maximum pooling layer, a flattening layer, a first fully connected layer, a fourth Relu layer, a first Dropout layer, a second fully connected layer, a fifth Relu layer, and a second Dropout layer connected in sequence; The calculation formula for the second convolution is: S CNN2 =Relu(W*S add ) Where S CNN2 Represents the features obtained by the second convolution feature extraction, Relu represents the activation function Relu, W represents the convolution kernel of the second convolution, S add Indicates the new features obtained by the Add connection layer; Use the softmax function and multi-classification cross entropy loss function to build a classification model for the final features; The terahertz spectrum information of the tangerine peel slice sample to be tested is input into the trained classification model, and the predicted category is output, that is, the year of the corresponding tangerine peel slice sample is predicted.

2. The method for detecting tangerine peel year based on feature fusion according to claim 1, wherein The features extracted from the first convolution feature extraction are added and connected accordingly, and the output values ​​of the same channel and the same position at different angles are added to obtain new features. Four angles are selected, and the new features are specifically expressed as follows: S 0-CNN1 =[[M 0-1-1 ,M 0-1-2 ,M 0-1-3 ,…,M 0-1-t-2 ,M 0-1-t-1 ,M 0-1-t ], [M 0-2-1 ,M 0-2-2 ,M 0-2-3 ,…,M 0-2-t-2 ,M 0-2-t-1 ,M 0-2-t ], [M 0-3-1 ,M 0-3-2 ,M 0-3-3 ,…,M 0-3-t-2 ,M 0-3-t-1 ,M 0-3-t ], ……, [M 0-h-1 ,M 0-h-2 ,M 0-h-3 ,…,M 0-h-t-2 ,M 0-h-t-1 ,M 0-h-t ]] S 90-CNN1 =[M 90-1-1 ,M 90-1-2 ,M 90-1-3 ,…,M 90-1-t-2 ,M 90-1-t-1 ,M 90-1-t ], [M 90-2-1 ,M 90-2-2 ,M 90-2-3 ,…,M 90-2-t-2 ,M 90-2-t-1 ,M 90-2-t ], [M 90-3-1 ,M 90-3-2 ,M 90-3-3 ,…,M 90-3-t-2 ,M 90-3-t-1 ,M 90-3-t ], ……, [M 90-h-1 ,M 90-h-2 ,M 90-h-3 ,…,M 90-h-t-2 ,M 90-h-t-1 ,M 90-h-t ]] S 180-CNN1 =[M 180-1-1 ,M 180-1-2 ,M 180-1-3 ,…,M 180-1-t-2 ,M 180-1-t-1 ,M 180-1-t ], [M 180-2-1 ,M 180-2-2 ,M 180-2-3 ,…,M 180-2-t-2 ,M 180-2-t-1 ,M 180-2-t ], [M 180-3-1 ,M 180-3-2 ,M 180-3-3 ,…,M 180-3-t-2 ,M 180-3-t-1 ,M 180-3-t ], ……, [M 180-h-1 ,M 180-h-2 ,M 180-h-3 ,…,M 180-h-t-2 ,M 180-h-t-1 ,M 180-h-t ]] S 270-CNN1 =[M 270-1-1 ,M 270-1-2 ,M 270-1-3 ,…,M 270-1-t-2 ,M 270-1-t-1 ,M 270-1-t ] [M 270-2-1 ,M 270-2-2 ,M 270-2-3 ,…,M 270-2-t-2 ,M 270-2-t-1 ,M 270-2-t ], [M 270-3-1 ,M 270-3-2 ,M 270-3-3 ,…,M 270-3-t-2 ,M 270-3-t-1 ,M 270-3-t ], ……, [M 270-h-1 ,M 270-h-2 ,M 270-h-3 ,…,M 270-h-t-2 ,M 270-h-t-1 ,M 270-h-t ]] S add =[[M 0-1-1 +M 90-1-1 +M 180-1-1 +M 270-1-1 ,M 0-1-2 +M 90-1-2 +M 180-1-2 +M 270-1-2 , M 0-1-3 +M 90-1-3 +M 180-1-3 +M 270-1-3 ,…,M 0-1-t-2 +M 90-1-t-2 +M 180-1-t-2 +M 270-1-t-2 , M 0-1-t-1 +M 90-1-t-1 +M 180-1-t-1 +M 270-1-t-1 ,M 0-1-t +M 90-1-t +M 180-1-t +M 270-1-t ], [M 0-2-1 +M 90-2-1 +M 180-2-1 +M 270-2-1 ,M 0-2-2 +M 90-2-2 +M 180-2-2 +M 270-2-2 , M 0-2-3 +M 90-2-3 +M 180-2-3 +M 270-2-3 ,…,M 0-2-t-2 +M 90-2-t-2 +M 180-2-t-2 +M 270-2-t-2 , M 0-2-t-1 +M 90-2-t-1 +M 180-2-t-1 +M 270-2-t-1 ,M 0-2-t +M 90-2-t +M 180-2-t +M 270-2-t ], [M 0-3-1 +M 90-3-1 +M 180-3-1 +M 270-3-1 ,M 0-3-2 +M 90-3-2 +M 180-3-2 +M 270-3-2 , M 0-3-3 +M 90-3-3 +M 180-3-3 +M 270-3-3 ,…,M 0-3-t-2 +M 90-3-t-2 +M 180-3-t-2 +M 270-3-t-2 , M 0-3-t-1 +M 90-3-t-1 +M 180-3-t-1 +M 270-3-t-1 ,M 0-3-t +M 90-3-t +M 180-3-t +M 270-3-t ], ……, [M 0-h-1 +M 90-h-1 +M 180-h-1 +M 270-h-1 ,M 0-h-2 +M 90-h-2 +M 180-h-2 +M 270-h-2 , M 0-h-3 +M 90-h-3 +M 180-h-3 +M 270-h-3 ,…,M 0-h-t-2 +M 90-h-t-2 +M 180-h-t-2 +M 270-h-t-2 , M 0-h-t-1 +M 90-h-t-1 +M 180-h-t-1 +M 270-h-t-1 ,M 0-h-t +M 90-h-t +M 180-h-t +M 270-h-t ]] Among them, S 0-CNN1 , S 90-CNN1 , S 180-CNN1 and S 270-CNN1 Represents the features of the output of the first convolution at 0°, 90°, 180° and 270° respectively, M is the output value of the neuron, 0-ht, 90-ht, 180-ht and 270-ht are the frequency numbers of the hth channel at 0°, 90°, 180° and 270° respectively, + represents the corresponding output value addition operation, S add Represents the new features obtained by corresponding addition and connection.

3. The method for detecting tangerine peel year based on feature fusion according to claim 1, wherein The softmax function and multi-classification cross entropy loss function are used to establish a classification model for the final features. The calculation formula of the softmax function is expressed as: Among them, p k Indicates the probability of the kth category, num indicates the number of categories, c∈(0,num], specifically indicates the cth category, k indicates a category in c, e k represents the output value of the neuron of the kth category, The calculation formula of the multi-classification cross entropy loss function is expressed as: Among them, L represents the output value of the multi-classification cross entropy loss function, a represents the sample number, b represents the category number, and y ab represents the symbolic function, p ab Indicates the predicted probability that sample a belongs to category b; The softmax function is used to convert the features into the probability of the corresponding category, and the probability of the category is output as the value of the multi-classification cross entropy loss function.

4. A tangerine peel year detection system based on feature fusion, characterized in that: include: Terahertz spectrum information acquisition module, preprocessing module, first convolution feature extraction module, feature addition and connection module, second convolution feature extraction module, classification model construction module and year output module; The terahertz spectrum information acquisition module is used to measure tangerine peel slice samples of different storage years using terahertz time-domain spectroscopy technology to obtain terahertz spectrum information of tangerine peel slice samples at different angles; The terahertz spectrum information of the tangerine peel slice sample at different angles is obtained, specifically the terahertz spectrum information S0, S1, S2, and S3 of the tangerine peel slice sample at four different angles is obtained. 90 , S 180 and S 270 ; The initial position of the tangerine peel sample placed in the mold corresponds to 0°, S0=[X 0-1 ,X 0-2 ,X 0-3 ,…,X 0-n-2 ,X 0-n-1 ,X 0-n ], X is the absorption coefficient value of the corresponding frequency, 0-n is the frequency number at 0°; The position of the tangerine peel sample rotated 90° clockwise around the normal line of the tangerine peel sample plane relative to the initial position corresponds to 90°, S 90 =[X 90-1 ,X 90-2 ,X 90-3 ,…,X 90-n-2 ,X 90-n-1 ,X 90-n ], 90-n is the frequency number when 90°; The position of the tangerine peel sample rotated 180° clockwise around the normal line of the tangerine peel sample plane relative to the initial position corresponds to 180°, S 180 =[X 180-1 ,X 180-2 ,X 180-3 ,…,X 180-n-2 ,X 180-n-1 ,X 180-n ], 180-n is the frequency number when 180°; The position of the tangerine peel slice sample rotated 270° clockwise around the normal line of the tangerine peel slice sample plane relative to the initial position corresponds to 270°, S 270 =[X 270-1 ,X 270-2 ,X 270-3 ,…,X 270-n-2 ,X 270-n-1 ,X 270-n ], 270-n is the frequency number at 270°; The preprocessing module is used to perform standard normal variable transformation preprocessing on the terahertz spectra of the tangerine peel slice sample at different angles to obtain standard normal terahertz spectra of the tangerine peel slice sample at different angles; The first convolution feature extraction module is used to input the standard normal terahertz spectra of the tangerine peel slice sample at different angles into the first convolution kernel to perform the first convolution feature extraction; The first convolution feature extraction module performs the first convolution feature extraction and selects four angles, which are expressed as: S 0-CNN1 =Relu(W0*S 0-SNV ) S 90-CNN1 =Relu(W 90 *S 90-SNV ) S 180-CNN1 =Relu(W 180 *S 180-SNV ) S 270-CNN1 =Relu(W 270 *S 270-SNV ) Among them, S 0-CNN1 、S 90-CNN1 、S 180-CNN1 and S 270-CNN1 Respectively represent the output features of the first convolution at 0°, 90°, 180° and 270°, Relu represents the activation function Relu, W0, W 90 、W 180 and W 270 Represents the convolution kernel of the first convolution at 0°, 90°, 180° and 270° respectively, S 0-SNV 、S 90-SNV 、S 180-SNV and S 270-SNV Represent the features after 0°, 90°, 180° and 270° standard normal variable transformation preprocessing respectively; The feature addition and connection module is used to perform corresponding addition and connection on the features extracted after the first convolution feature extraction, and add the output values ​​of the same channel and the same position at different angles to obtain new features; The network structure of the first convolution feature extraction includes a first convolution layer, a first Relu layer, a first maximum pooling layer, a second convolution layer, a second Relu layer, and a second maximum pooling layer connected in sequence; The second convolution feature extraction module is used to input the new features into the second convolution kernel to perform a second convolution feature extraction to obtain the final features; The calculation formula for the second convolution is: S CNN2 =Relu(W*S add ) Where S CNN2 Represents the features obtained by the second convolution feature extraction, Relu represents the activation function Relu, W represents the convolution kernel of the second convolution, S add Indicates the new features obtained by the Add connection layer; The network structure of the second convolutional feature extraction includes a third convolutional layer, a third Relu layer, a third maximum pooling layer, a flattening layer, a first fully connected layer, a fourth Relu layer, a first Dropout layer, a second fully connected layer, a fifth Relu layer and a second Dropout layer connected in sequence; The classification model building module is used to establish a classification model for the final features using a softmax function and a multi-classification cross entropy loss function; The year output module is used to input the terahertz spectrum information of the tangerine peel slice sample to be tested into the trained classification model, and output the predicted category, that is, output the year of the corresponding tangerine peel slice sample.

5. The tangerine peel year detection system based on feature fusion according to claim 4 is characterized in that, The classification model building module is used to establish a classification model for the final features using the softmax function and the multi-classification cross entropy loss function. The calculation formula of the softmax function is expressed as: Among them, p k Indicates the probability of the kth category, num indicates the number of categories, c∈(0,num], specifically indicates the cth category, k indicates a category in c, e k represents the output value of the neuron of the kth category, The calculation formula of the multi-classification cross entropy loss function is expressed as: Among them, L represents the output value of the multi-classification cross entropy loss function, a represents the sample number, b represents the category number, and y ab represents the symbolic function, p ab Indicates the predicted probability that sample a belongs to category b; The softmax function is used to convert the features into the probability of the corresponding category, and the probability of the category is output as the value of the multi-classification cross entropy loss function.

Citation Information

Patent Citations

  • Identification method and identification system of dried tangerine peel

    CN110108648A

  • Method and device for detecting year of Chinese medicinal materials, and terminal equipment

    CN110749566A