Method and model for identifying the age of tortoise shell based on hyperspectral imaging

Through hyperspectral imaging technology and three-dimensional convolutional neural network, combined with the spectral-space attention mechanism, the complex and time-consuming problem of tortoise shell age identification in the existing technology is solved, and the rapid, lossless and accurate tortoise shell age identification is achieved, reducing costs and expanding the application prospects of traditional Chinese medicine material identification.

CN116448682BActive Publication Date: 2025-05-27ZHENGZHOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310431280.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-20
Publication Date
2025-05-27
Estimated Expiration
2043-04-20

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and without loss to identify the age of tortoise shells, and the traditional methods are complex, time-consuming and costly.

Method used

Hyperspectral imaging technology is used to combine three-dimensional convolutional neural networks to establish a spectral-spatial attention mechanism through the spectral information of hyperspectral data and the spatial information of the image to achieve rapid and lossless identification of the age of tortoise shells.

Benefits of technology

It realizes rapid, non-destructive and accurate determination of the age of the tortoise shell, reduces operational complexity and cost, provides theoretical basis and data support, and brings good application prospects to the field of traditional Chinese medicine identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116448682B_ABST
    Figure CN116448682B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention disclose a method and a discrimination model for discriminating the age of tortoise shells based on hyperspectral imaging. The discrimination method includes the steps of: (1) collecting hyperspectral data of tortoise shell samples of different ages; (2) processing the obtained hyperspectral data; (3) dividing the processed hyperspectral data into multiple image blocks according to a set size to form a tortoise shell sample data set; (4) establishing a three-dimensional convolutional neural network model; (5) training the three-dimensional convolutional neural network using the tortoise shell sample data set to obtain a tortoise shell age discrimination model. The method for discriminating the age of tortoise shells based on hyperspectral imaging utilizes the spectral information of hyperspectral image data and the spatial information of the image. According to the three-dimensional characteristics of the hyperspectral image, a three-dimensional convolutional neural network model is built, and the spectral-spatial attention mechanism is combined with three-dimensional convolutional operations to fully extract the characteristics of the hyperspectral image, simultaneously obtain spatial information and spectral information, and realize fast and non-destructive discrimination of the age of tortoise shells.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data processing, and particularly relates to a method and a discrimination model for discriminating the age of tortoise shells based on hyperspectral imaging. Background Art

[0002] The tortoise shell is the dorsal and ventral carapaces of the tortoise of the family Testudinidae. It is recorded in "Shennong's Herbal Classic". In China, the use of tortoise shells in medicine and diet therapy has a history of 1700 years and it is one of the traditional precious Chinese medicines. The pharmacological effects of tortoise shells are to regulate energy metabolism, enhance immunity, enrich blood, strengthen bones, protect the nervous system, and promote growth, so as to achieve the effects of nourishing yin and suppressing yang, tonifying the kidney and strengthening bones, and nourishing blood and calming the heart. It is mainly applicable to the treatment of symptoms such as yin deficiency and yang hyperactivity, hectic fever due to yin deficiency, dizziness and vertigo, internal stirring of wind due to deficiency, involuntary twitching of hands and feet, weak bones and muscles, weak waist and knees, unclosed fontanelle in children, palpitation and insomnia, amnesia, etc. The components of tortoise shells are very complex. Current research has found that tortoise shells contain mineral elements, fatty acids, phosphorus, peptides, enzymes and various amino acids, and also contain various essential trace elements for the human body such as zinc, manganese, copper, calcium, magnesium, and iron.

[0003] The demand for tortoise shells in modern medical care is increasing day by day. However, the quality of tortoise shells on the market is uneven, and the phenomenon of passing off inferior goods as good ones occurs from time to time. The safety and effectiveness of using tortoise shells in medicine cannot be guaranteed. Moreover, there is literature research indicating that the tortoise shells of turtles growing for more than three years can be used as medicine. As the age of the tortoise shells increases, the contents of zinc, manganese, and copper elements and the effective parts for nourishing yin gradually increase, and the curative effect of tortoise shells is better. Therefore, accurately discriminating the age of tortoise shells is of great significance.

[0004] However, the differences in the appearance characteristics such as morphological texture of tortoise shells in different years are small, and it is very difficult to directly discriminate by relying on traditional visual inspection. With the progress of detection technology, modern chemical detection technology and DNA sequence detection can also be used for discriminating the age of tortoise shells, but the operation is complex, time-consuming, requires trained professionals to master complex technologies, and usually requires damaging the sample structure, and the discrimination cost is too high. Summary of the Invention

[0005] In view of this, on the one hand, some embodiments disclose a method for discriminating the age of tortoise shells based on hyperspectral imaging, including the steps of:

[0006] S1. Collect hyperspectral data of tortoise shell samples of different ages;

[0007] S2. Process the obtained hyperspectral data;

[0008] S3. Divide the processed hyperspectral data into multiple image blocks according to a set size to form a tortoise shell sample data set;

[0009] S4. Establish a three-dimensional convolutional neural network model;

[0010] S5. Train a three-dimensional convolutional neural network using the tortoise shell sample dataset to obtain a tortoise shell age discrimination model.

[0011] Furthermore, for the tortoise shell age discrimination method based on hyperspectral imaging disclosed in some embodiments, the hyperspectral data obtained by processing in step S2 includes:

[0012] S2-1. Perform black and white correction to reduce the influence of uneven light source intensity distribution on the image data;

[0013] S2-2. Perform principal component analysis dimensionality reduction on the corrected hyperspectral image data.

[0014] Furthermore, for the tortoise shell age discrimination method based on hyperspectral imaging disclosed in some embodiments, the calculation formula for black and white correction in step S2-1 is:

[0015]

[0016] where, R raw represents the original hyperspectral image, R cal represents the finally corrected hyperspectral image, R dark represents the black reference image, and R white represents the white reference image.

[0017] For the tortoise shell age discrimination method based on hyperspectral imaging disclosed in some embodiments, in step S3, the tortoise shell sample dataset is divided into a training set and a test set according to a ratio of 8:2.

[0018] For the tortoise shell age discrimination method based on hyperspectral imaging disclosed in some embodiments, in step S4, the three-dimensional convolutional neural network includes an input layer, a spectral-spatial attention module, a three-dimensional convolutional layer, a fully connected layer, and a Softmax layer.

[0019] For the tortoise shell age discrimination method based on hyperspectral imaging disclosed in some embodiments, the three-dimensional convolutional layer includes a three-dimensional convolution operation, a batch normalization layer, and an activation function layer;

[0020] The formula for the three-dimensional convolution operation is:

[0021]

[0022] where, m represents the (i-1)-th feature map connected to the current j-th feature map, H i and W i are respectively the height and width of the convolutional kernel in space, R i is the depth of the convolutional kernel in the spectral dimension, is the weight at the (h, w, r) position connected to the m-th feature map, Φ() is the activation function, and b ij is the bias of the j-th feature map of the i-th layer. Denote the image patch of the j-th feature map in the i-th layer at the position (x, y, z). Denote the image patch of the j-th feature map in the (i - 1)-th layer at the position (x + h, y + w, z + r).

[0023] For the hyperspectral imaging-based tortoise shell age discrimination method disclosed in some embodiments, the spectral-spatial attention module includes a spectral attention mechanism and a spatial attention mechanism. For the input feature map l ∈ R H×W×C , the overall calculation formula is as follows:

[0024]

[0025]

[0026] where M se (l) is the spectral attention map generated by the spectral attention mechanism, and l ′ is the output feature map of the spectral attention mechanism; M sa (l′) is the spatial attention map generated by the spatial attention mechanism; l″ is the output feature map of the spatial attention mechanism. The input feature map is usually the tortoise shell sample image data in the tortoise shell sample dataset.

[0027] For the hyperspectral imaging-based tortoise shell age discrimination method disclosed in some embodiments, the spectral attention mechanism maps the input feature map to a spectral weight vector through global max pooling and global average pooling. The calculation formula of the spectral weight vector is as follows:

[0028]

[0029] Furthermore, the spectral attention map is obtained by using the spectral weight vector. The calculation formula of the spectral attention map is as follows:

[0030] M se (l) = σ(M s ′ e (l))

[0031] where M s ′ e (l) is the spectral weight vector; is the average pooling feature on the spectrum, generated by global average pooling; is the max pooling feature on the spectrum, generated by global max pooling; W0 is the dimensionality reduction parameter of the first fully connected layer; W1 is the dimensionality increase parameter of the second fully connected layer; f relu is the ReLU activation function; σ is the sigmoid function; M se (l) is the spectral attention map generated by the spectral attention mechanism.

[0032] Some embodiments disclose a method for identifying the age of tortoise shells based on hyperspectral imaging. The spatial attention mechanism performs pooling of the maximum and average values in the channel dimension, and generates a spatial feature map through convolution with spatial attention weights. The calculation formula is:

[0033]

[0034] M sa (l) = σ(M s ′ a (l))

[0035] Wherein, is the average pooling feature on the channel, is the maximum pooling feature on the channel, * is a convolution operation with a filter size of 7×7, σ is the sigmoid function, M s ′ a (l) is the spatial attention weight, W2 is the convolution parameter of the spatial attention mechanism, and M sa (l) is the spatial feature map.

[0036] On the other hand, some embodiments disclose a model for identifying the age of tortoise shells based on hyperspectral imaging, which is obtained from the method for identifying the age of tortoise shells based on hyperspectral imaging.

[0037] The method for identifying the age of tortoise shells based on hyperspectral imaging disclosed in the embodiments of the present invention utilizes hyperspectral imaging technology to simultaneously obtain multi-band spectral variables and the spatial position information of tortoise shells, extract the hyperspectral information of tortoise shells and further preprocess it, and further train the preprocessed spectral information through a three-dimensional convolutional neural network to obtain a trained model for identifying the age of tortoise shells. The method for identifying the age of tortoise shells based on hyperspectral imaging utilizes the spectral information of hyperspectral data and the spatial information of images, further combines the deep learning ability of a three-dimensional convolutional neural network, selects a three-dimensional convolutional neural network to build a model according to the three-dimensional characteristics of hyperspectral images. The spectral-spatial attention mechanism in the model combines three-dimensional convolution operations, which can fully exploit the features of hyperspectral images, simultaneously obtain spatial information and spectral information, and finally achieve fast and non-destructive identification of the age of tortoise shells, providing a theoretical basis and data support for the identification of the age of tortoise shells in industrial production, and having good application prospects in the field of traditional Chinese medicine material identification such as accurate identification of the age of tortoise shells. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 、 One Flowchart of the method for identifying the age of tortoise shells based on hyperspectral imaging disclosed in some embodiments;

[0039] Figure 2 、One Example diagram of the hyperspectral image of the turtle shell sample disclosed in some embodiments;

[0040] Figure 3 、 One Structure diagram of the 3D convolutional neural network disclosed in some embodiments;

[0041] Figure 4 、 One Schematic diagram of the spectral-spatial attention module structure disclosed in some embodiments;

[0042] Figure 5 、 One Schematic diagram of the spectral attention module structure disclosed in some embodiments;

[0043] Figure 6 、 One Schematic diagram of the spatial attention module structure disclosed in some embodiments;

[0044] Figure 7 、 One Schematic diagram of the 3D convolutional layer structure disclosed in some embodiments. Detailed implementation manners

[0045] The special term "embodiment" used herein, any embodiment described as "exemplary" does not have to be construed as superior to or better than other embodiments. For the performance index test in the embodiments of the present invention, unless otherwise specified, the conventional test methods in the art are adopted. It should be understood that the terms described in the embodiments of the present invention are only for describing specific embodiments and are not used to limit the content disclosed in the embodiments of the present invention.

[0046] Unless otherwise specified, the technical and scientific terms used herein have the same meanings as those commonly understood by those of ordinary skill in the technical field to which the embodiments of the present invention belong; other test methods and technical means not specifically noted in the embodiments of the present invention refer to the experimental methods and technical means commonly adopted by those of ordinary skill in the art.

[0047] As used herein, the terms "substantially" and "about" are used to describe minor fluctuations. For example, they can refer to less than or equal to ±5%, such as less than or equal to ±2%, such as less than or equal to ±1%, such as less than or equal to ±0.5%, such as less than or equal to ±0.2%, such as less than or equal to ±0.1%, such as less than or equal to ±0.05%. Numerical data presented or represented in a range format herein is used for convenience and brevity only and should therefore be interpreted flexibly as including not only the values explicitly listed as the bounds of the range but also all individual values or sub-ranges included within that range. For example, a numerical range of "1 to 5%" should be interpreted as including not only the explicitly listed values of 1% to 5% but also individual values and sub-ranges within the indicated range. Thus, individual values such as 2%, 3.5%, and 4% and sub-ranges such as 1% to 3%, 2% to 4%, and 3% to 5% etc. are included within this numerical range. This principle also applies to ranges that list only one numerical value. In addition, such an interpretation applies regardless of the width of the range or the characteristics described.

[0048] As used herein, including in the claims, conjunctive words such as "comprising", "including", "carrying", "having", "containing", "involving", "accommodating", etc. are understood to be open-ended, that is, meaning "including but not limited to". Only the conjunctive words "consisting of" and "composed of" are closed conjunctions.

[0049] For a better illustration of the content of the present invention, numerous specific details are given in the following specific embodiments. Those skilled in the art should understand that the present invention can be implemented without some specific details. In the embodiments, some methods, means, instruments, equipment, etc. well-known to those skilled in the art are not described in detail in order to highlight the gist of the present invention.

[0050] On the premise of no conflict, the technical features disclosed in the embodiments of the present invention can be combined arbitrarily, and the obtained technical solutions belong to the content disclosed in the embodiments of the present invention.

[0051] In some embodiments, a method for identifying the age of turtle shells based on hyperspectral imaging, such as Figure 1 shown, includes the steps of:

[0052] S1. Collect hyperspectral data of turtle shell samples of different ages; generally, different-aged turtle shell samples can be collected first, and then a hyperspectral imager can be used to obtain hyperspectral images of the turtle shells; generally, images can be collected separately for the front and back of the turtle shell samples; Figure 2 is a hyperspectral image of a turtle shell sample with a turtle shell age of 13 years disclosed in some embodiments; Figure 2 shows the front images of the dorsal and ventral shell samples of a 13-year-old turtle;

[0053] S2, processing the obtained hyperspectral data; usually the obtained hyperspectral image of the tortoise shell sample is processed to eliminate information distortion or information redundancy caused in the process of acquiring the image, for example, black and white correction can be used to reduce the influence caused by uneven distribution of light source intensity, and obtain corrected hyperspectral image data. Usually, black and white correction calibrates the original intensity image into a reflectance image by using white and black reference images; further, principal component analysis is performed on the corrected hyperspectral image data to reduce the computational difficulty and information redundancy; usually, principal component analysis is a data linear projection method for statistical processing of multivariate data, which maps samples in high-dimensional space to lower-dimensional principal component space on the basis of retaining the original information as much as possible;

[0054] S3, dividing the processed hyperspectral data into multiple image blocks according to a set size to form a tortoise shell sample data set; usually the sample data set is divided into a training data set and a test data set according to a certain ratio;

[0055] S4. Establish a three-dimensional convolutional neural network model;

[0056] S5. Use the tortoise shell sample data set to train a three-dimensional convolutional neural network to obtain a tortoise shell age identification model. Further, the obtained tortoise shell age identification model can be used to identify the age of the tortoise shell sample. For example, a hyperspectral image of the tortoise shell sample to be identified can be obtained using hyperspectral imaging technology, and then the hyperspectral image can be used as input image data of the tortoise shell age identification model. The input tortoise shell sample hyperspectral image is identified using the tortoise shell age identification model to determine the age of the tortoise shell sample.

[0057] In some embodiments, a laboratory-grade Hyspex series hyperspectral imager (Norsk ElektroOptikk AS) is used to obtain a hyperspectral image of a tortoise shell. The Norsk Elektro Optikk AS hyperspectral imaging spectrometer consists of a CCD detector, a N3124 SWIP lens, a mobile platform, a computer with built-in software, and two 150W tungsten halogen lamps for illuminating the sample stage. The distance between the camera lens and the tortoise shell sample is set to 20 to 30 cm, the platform movement speed is 1.5 mm / s, and hyperspectral images are collected in the wavelength range of 948.72 to 2512.97 nm, with a spectral resolution of 5.43 nm and a total of 288 bands.

[0058] In some embodiments, the selected tortoise shell samples of different ages include tortoise shell samples of five ages: four years, five years, six years, eleven years and thirteen years.

[0059] In some embodiments, hyperspectral images are collected for the front and back sides of the plastron and carapace of the tortoise shell sample, respectively, and the wavelength range of the hyperspectral image is 950-2500nm.

[0060] In some embodiments, the obtained hyperspectral image of the tortoise shell sample is preprocessed, and the preprocessing method includes:

[0061] S2-1. Perform black and white correction to reduce the influence of uneven light source intensity distribution on the image data; obtain the corrected hyperspectral image data.

[0062] S2-2. Perform principal component analysis dimensionality reduction on the corrected hyperspectral image data to reduce the calculation difficulty and information redundancy.

[0063] In some embodiments, the calculation formula for black and white correction to reduce the uneven light source intensity distribution is:

[0064]

[0065] where R raw represents the original hyperspectral image, R cal represents the finally corrected hyperspectral image, R dark represents the black reference image, and R white represents the white reference image.

[0066] Due to the large number of bands in the hyperspectral image, the spectra are highly correlated, and there are defects of information redundancy, which increases the difficulty of data analysis. Principal component analysis transforms the spectral image data into a linear combination of fewer new variables to achieve data dimensionality reduction. At the same time, these variables should represent the data characteristics of the original variables as much as possible without losing information. Among them, the setting of the number of principal components will directly affect the classification performance of the model. If the setting is too small, most of the effective features in the original data will be lost. If the setting is too large, the computational burden will increase greatly. In some embodiments, the number of principal components in the principal component analysis is 60.

[0067] In some embodiments, Python code is used to perform principal component analysis dimensionality reduction processing on the black and white corrected hyperspectral image of the tortoise shell.

[0068] In the method for identifying the age of tortoise shell based on hyperspectral imaging disclosed in some embodiments, the tortoise shell sample dataset is divided into a training dataset and a test dataset according to a ratio of 8:2. Since the number of obtained hyperspectral images of the tortoise shell is limited, and deep learning models usually require a large amount of data for training to achieve good results, the hyperspectral images can be segmented into several image blocks with a size of 64x64 pixels to increase the sample size of the dataset and used as the input image information of the three-dimensional convolutional neural network.

[0069] In the method for identifying the age of tortoise shell based on hyperspectral imaging disclosed in some embodiments, such as Figure 3As shown, the established three-dimensional convolutional neural network model includes an input layer, a spectral-spatial attention module, three-dimensional convolutional layers, a fully connected layer, and a Softmax layer. Generally, the input layer is used to receive the hyperspectral image information of the tortoise shell samples; the spectral-spatial attention module is used to emphasize the information that helps feature representation and final classification in both the spectral and spatial aspects; the three-dimensional convolutional layers are used to jointly extract features in the spatial and spectral dimensions; and the Softmax layer is used for classification training.

[0070] In some embodiments, the Adam neural network optimizer and the cross-entropy loss function are selected for the training of the three-dimensional convolutional neural network.

[0071] In some embodiments, the programming language for building and training the three-dimensional convolutional network includes Python, and the operating environment includes PyTorch.

[0072] In the method for identifying the age of tortoise shell based on hyperspectral imaging disclosed in some embodiments, the spectral-spatial attention module includes a spectral attention mechanism (SeAM) and a spatial attention mechanism (SaAM), which emphasize the information that is beneficial to feature representation and final classification in the spectral and spatial aspects respectively. As Figure 4 shown, the pattern information data of the tortoise shell samples is usually input into the spectral attention module. The spectral attention module uses its data processing mechanism to emphasize the information that is beneficial to feature representation and final classification, and outputs the output feature map of the spectral attention mechanism. The output feature map of the spectral attention mechanism processed by the spectral attention module is used as the input image information of the spatial attention module. In the spatial attention module, the image information is processed according to its mechanism to emphasize the information that is beneficial to feature representation and final classification, and the output feature map of the spatial attention mechanism is obtained.

[0073] In some embodiments, the spectral attention mechanism maps the input feature map to a spectral weight vector through global max pooling and global average pooling. The two-layer neural network with shared weights fully captures the correlations between bands. As Figure 5 shown, the spectral attention mechanism first extracts spectral features from the input feature map using global max pooling and global average pooling. Then, the extracted spectral features are respectively passed through two fully connected (FC) layers with shared weights to fully capture the correlations between bands, constructing two pooling channel information. Then, they are summed element-wise and merged, and then passed through a sigmoid activation operation to generate the final spectral feature map.

[0074] The spatial attention mechanism performs max and average pooling in the channel dimension and generates a spatial feature map through a convolution with attention weights.

[0075] In some embodiments, for the input feature map l ∈ R H×W×C , the calculation formula is:

[0076]

[0077]

[0078] Among them, M se (l) is the spectral attention map generated by the spectral attention mechanism, and l ′ is the output feature map of the spectral attention mechanism; M sa (l′) is the spatial attention map generated by the spatial attention mechanism; l″ is the output feature map of the spatial attention mechanism.

[0079] In some embodiments, the spectral attention mechanism maps the input feature map to a spectral weight vector through global max pooling and global average pooling. The calculation formula of the spectral weight vector is:

[0080]

[0081] Furthermore, the spectral attention map is obtained by using the spectral weight vector. The calculation formula of the spectral attention map is:

[0082] M se (l) = σ(M s ′ e (l))

[0083] Among them, M s ′ e (l) is the spectral weight vector; is the average pooling feature on the spectrum, generated by global average pooling; is the max pooling feature on the spectrum, generated by global max pooling; W0 is the dimensionality reduction parameter of the first fully connected layer; W1 is the dimensionality increase parameter of the second fully connected layer; f relu is the ReLU activation function; σ is the sigmoid function; M se (l) is the spectral attention map generated by the spectral attention mechanism.

[0084] In some embodiments, the spatial attention mechanism performs aggregation of the maximum and average values in the channel dimension and generates a spatial feature map through convolution with spatial attention weights. Figure 6 As shown, the spatial attention mechanism first performs global max pooling and global average pooling on the input feature map based on the spectral dimension respectively, and performs channel splicing on the two obtained feature maps; then reduces the dimension through convolution operation, and finally generates a spatial feature map through sigmoid activation operation. The calculation formula of the spatial feature map is:

[0085]

[0086] M sa(l) = σ(M s ′ a (l))

[0087] wherein, is the average pooling feature on the channel, is the max pooling feature on the channel, * is a convolution operation with a filter size of 7×7, σ is the sigmoid function, M s ′ a (l) is the spatial attention weight, W2 is the spatial attention parameter, M sa (l) is the spatial feature map.

[0088] In some embodiments, the 3D convolutional layer includes a 3D convolution operation, a batch normalization layer, and an activation function layer; as Figure 7 shown.

[0089] In some embodiments, input 3D data, perform spatial and spectral dimension convolutions on the input image information data, and perform a 3D convolution operation; the formula for the 3D convolution operation is:

[0090]

[0091] wherein, m represents the feature map of the (i - 1)th layer connected to the current jth feature map, H i and W i are respectively the height and width of the convolution kernel in the spatial dimension, R i is the depth of the convolution kernel in the spectral dimension, is the weight at the (h, w, r) position connected to the mth feature map, Φ() is the activation function, b ij is the bias of the jth feature map of the ith layer, represents the image block of the jth feature map of the ith layer at the position (x, y, z); represents the image block of the jth feature map of the (i - 1)th layer at the position (x + h, y + w, z + r).

[0092] Generally, an important reason why deep neural networks are difficult to train is the high correlation and coupling between layers in the network. As the training progresses, the parameters in the network are constantly updated with gradient descent. On the one hand, when there are slight changes in the parameters of the underlying network, due to the linear transformation and non-linear activation mapping in each layer, these slight changes are amplified as the depth of the network increases. On the other hand, the changes in parameters cause the input distribution of each layer to change, and then the upper-layer network needs to constantly adapt to these distribution changes, making the model training difficult. The batch normalization layer makes the distribution of the input data in each layer of the network relatively stable, accelerating the model learning speed; making the model less sensitive to the parameters in the network, simplifying the parameter tuning process, and making the network learning more stable.

[0093] Some embodiments disclose a tortoise shell age discrimination model based on hyperspectral imaging, which is obtained from a tortoise shell age discrimination method based on hyperspectral imaging. Generally, the tortoise shell age discrimination model is a three-dimensional convolutional neural network model, which includes an input layer, a spectral-spatial attention module, a three-dimensional convolutional layer, a fully connected layer, and a Softmax layer. Among them, the input layer is used to receive the hyperspectral image information of the tortoise shell sample; the spectral-spatial attention module is used to emphasize the information helpful for feature representation and final classification in both spectral and spatial aspects; the three-dimensional convolutional layer is used to jointly extract features in the spatial and spectral dimensions; the Softmax layer is used for classification training.

[0094] The following further exemplarily illustrates the technical details in combination with embodiments.

[0095] Embodiment 1

[0096] In Embodiment 1, the tortoise shell age discrimination method based on hyperspectral imaging includes:

[0097] S1. Collect tortoise shell samples of different years, and use a hyperspectral imaging device to collect the hyperspectral image data of the tortoise shell samples; the tortoise shell samples used in this Embodiment 1 are provided by the national-level Jingshan Shengchang Tortoise Original Seed Farm. A total of 20 tortoise samples were collected, which were born in 2008, 2010, 2015, 2016, and 2017 respectively, and the tortoise shells were collected in September 2021; that is, the growth years of the tortoise shell samples are 4 years, 5 years, 6 years, 11 years, and 13 years respectively;

[0098] This Embodiment 1 uses a laboratory-level Hyspex series hyperspectral imager (Norsk Elektro Optikk AS) to obtain the tortoise shell hyperspectral images;

[0099] S2. Use black and white correction to reduce the influence caused by uneven light source intensity distribution, and perform principal component analysis dimensionality reduction on the corrected hyperspectral image data to reduce the calculation difficulty and information redundancy, and the number of principal components is set to 60; the calculation formula is:

[0100]

[0101] Among them, R raw represents the original hyperspectral image, and R cal represents the finally corrected hyperspectral image, and R dark represents the black reference image, and R white represents the white reference image;

[0102] S3. Divide the processed hyperspectral data into several image blocks according to a predetermined size to obtain a sample dataset; the hyperspectral image is segmented into several image blocks with a size of 64x64 pixels to increase the sample size of the dataset and used as the input of the 3D convolutional neural network. Finally, the dataset statistical information is shown in Table 1;

[0103] Table 1: Statistical Information of the Hyperspectral Image Dataset of Turtle Shell Samples

[0104]

[0105] S4. Establish a 3D convolutional neural network structure; the 3D convolutional neural network includes an input layer, a spectral-spatial attention module, 3D convolutional layers, a fully connected layer, and a Softmax layer;

[0106] The spectral-spatial attention module includes a spectral attention mechanism and a spatial attention mechanism. For the input feature map l∈R H×W×C , the calculation formula is:

[0107]

[0108]

[0109] Among them, M se (l) is the spectral attention map generated by the spectral attention mechanism, and l ′ is the output feature map of the spectral attention mechanism; M sa (l′) is the spatial attention map generated by the spatial attention mechanism; l″ is the output feature map of the spatial attention mechanism;

[0110] The spectral attention mechanism maps the input feature map to a spectral weight vector through global max pooling and global average pooling. The calculation formula of the spectral weight vector is:

[0111]

[0112] Among them, M s ′ e (l) is the spectral weight vector; is the average pooling feature on the spectrum, generated by global average pooling; is the maximum pooling feature on the spectrum, generated by global maximum pooling; W0 is the dimensionality reduction parameter of the first fully connected layer; W1 is the dimensionality increase parameter of the second fully connected layer; f relu is the ReLU activation function;

[0113] Furthermore, a spectral attention map is obtained using the spectral weight vector, and the calculation formula for the spectral attention map is:

[0114] M se (l) = ∫(M s ′ e (l)) (5)

[0115] where σ is the sigmoid function; M se (l) is the spectral attention map generated through the spectral attention mechanism.

[0116] The spatial attention mechanism performs max and average pooling in the channel dimension and generates a spatial feature map through convolution with spatial attention weights; the calculation formula is:

[0117]

[0118] M sa (l) = σ(M s ′ a (l)) (7)

[0119] where is the average pooling feature on the channel, is the maximum pooling feature on the channel, * is a convolution operation with a filter size of 7×7, σ is the sigmoid function, M s ′ a (l) is the spatial attention weight, W2 is the convolution parameter of the spatial attention mechanism, M sa (l) is the spatial feature map;

[0120] The three-dimensional convolutional layer includes three-dimensional convolution operations, a batch normalization layer, and an activation function layer, where the activation function is ReLU;

[0121] The formula for the three-dimensional convolution operation is:

[0122]

[0123] where m represents the feature map of the (i - 1)th layer connected to the current jth feature map, H i and W i are respectively the height and width of the convolution kernel in space, Ri is the depth of the convolutional kernel in the spectral dimension, is the weight at the (h, w, r) position connected to the m-th feature map, Φ() is the activation function, and b ij is the bias of the j-th feature map of the i-th layer, represents the image patch of the j-th feature map of the i-th layer at the position (x, y, z); represents the image patch of the j-th feature map of the (i - 1)-th layer at the position (x + h, y + w, z + r);

[0124] S5. Obtain a tortoise shell age discrimination model by training tortoise shell samples from different years; divide 2574 hyperspectral images in the tortoise shell sample dataset into independent training and test datasets according to a training set: test set ratio of 8:2; among them, there are 2059 hyperspectral images in the training dataset and 515 hyperspectral images in the test dataset.

[0125] Input the hyperspectral images in the training dataset into a three-dimensional convolutional neural network, select the Adam neural network optimizer, set the learning rate to 0.005, set the loss function to the cross-entropy loss function, and initialize the parameters in the form of the Xavier standard normal distribution to complete the training of the three-dimensional convolutional neural network. At the same time, complete the testing of the model through the test dataset to form the final tortoise shell age discrimination model.

[0126] To fully prove the effectiveness of the tortoise shell discrimination method in Example 1, ablation experiments were conducted according to different module combinations, and the influence of different components on the entire model was analyzed using three evaluation indicators: the kappa coefficient, F1 score, and accuracy rate of the test set. The experimental results are listed in Table 2.

[0127] Through experimental verification, the three-dimensional convolutional network in Example 1 can well learn the effective features of the tortoise shell sample images, with an accuracy rate of up to 93.75%. The spectral attention and spatial attention respectively emphasize the information that helps feature representation and final classification in the spectral and spatial aspects, and both improve the classification effect.

[0128] Table 2. Ablation experiment results of Example 1

[0129]

[0130] Through experimental verification, the accuracy rate of the tortoise shell age discrimination model disclosed in this Example 1 for identifying the age of tortoise shells is as high as 95.90%, and it can quickly, non-destructively, intuitively, and accurately determine the age of tortoise shells.

[0131] The method for identifying the age of tortoise shell based on hyperspectral imaging disclosed in the embodiments of the present invention uses hyperspectral imaging technology to simultaneously obtain multi-band spectral variables and the spatial position information of the tortoise shell, extract the hyperspectral information of the tortoise shell and further preprocess it, and further train the preprocessed spectral information through a three-dimensional convolutional neural network to obtain a trained tortoise shell age identification model; the method for identifying the age of tortoise shell based on hyperspectral imaging utilizes the spectral information of hyperspectral data and the spatial information of the image, further combines the deep learning ability of the three-dimensional convolutional neural network, selects a three-dimensional convolutional neural network to build a model according to the three-dimensional characteristics of the hyperspectral image, and combines the spectral-spatial attention mechanism with three-dimensional convolutional operations in the model, which can fully mine the hyperspectral image features, obtain spatial information and spectral information simultaneously, and finally realize the fast and non-destructive identification of the age of tortoise shell, providing a theoretical basis and data support for the age identification of tortoise shell in industrial production, and having good application prospects in the field of traditional Chinese medicine material identification such as accurate identification of the age of tortoise shell.

[0132] The technical solutions disclosed in the embodiments of the present invention and the technical details disclosed in the embodiments are only exemplary illustrations of the inventive concept of the present invention and do not constitute a limitation to the technical solutions of the embodiments of the present invention. Any conventional changes, substitutions or combinations made to the technical details disclosed in the embodiments of the present invention have the same inventive concept as the present invention and are within the protection scope of the claims of the present invention.

Claims

1. A method for identifying the age of turtle shells based on hyperspectral imaging, characterized in that, it includes the steps: S1. Collect hyperspectral data of turtle shell samples of different ages; S2. Process the obtained hyperspectral data; S3. Divide the processed hyperspectral data into multiple image blocks according to a set size to form a turtle shell sample data set; S4. Establish a three-dimensional convolutional neural network model; the three-dimensional convolutional neural network model includes an input layer, a spectral-spatial attention module, three-dimensional convolutional layers, a fully connected layer, and a Softmax layer; The three-dimensional convolutional layer includes three-dimensional convolutional operations, a batch normalization layer, and an activation function layer; The formula for the three-dimensional convolutional operation is: Among them, m represents the feature map of the (i-1)-th layer connected to the current j-th feature map, H i and W i are the height and width of the convolutional kernel in the spatial domain respectively, R i is the depth of the convolutional kernel in the spectral dimension, is the weight at the (h, w, r) position connected to the m-th feature map, Φ() is the activation function, b ij is the bias of the j-th feature map of the i-th layer, represents the image patch of the j-th feature map of the i-th layer at the position (x, y, z); represents the image patch of the j-th feature map of the (i-1)-th layer at the position (x+h, y+w, z+r); The spectral-spatial attention module includes a spectral attention mechanism and a spatial attention mechanism. The spectral attention mechanism maps the input feature map to a spectral weight vector through global max pooling and global average pooling. The spatial attention mechanism performs aggregation of the maximum and average values in the channel dimension and generates a spatial feature map through convolution with spatial attention weights. For the input feature map l ∈ R H×W×C , the overall calculation formula is: Among them, M se (l) is the spectral attention map generated by the spectral attention mechanism, where l ′ is the output feature map of the spectral attention mechanism; M sa (l′) is the spatial attention map generated by the spatial attention mechanism; l″ is the output feature map of the spatial attention mechanism; S5. Use the turtle shell sample data set to train the three-dimensional convolutional neural network model to obtain a turtle shell age identification model.

2. The method for identifying the age of turtle shells based on hyperspectral imaging according to claim 1, characterized in that, the hyperspectral data processed in step S2 includes: S2-1. Perform black and white correction to reduce the influence of uneven light source intensity distribution on image data; S2-2. Perform principal component analysis dimensionality reduction on the corrected hyperspectral image data.

3. The method for identifying the age of turtle shells based on hyperspectral imaging according to claim 2, characterized in that, the formula for black and white correction in step S2-1 is: Among them, R raw represents the original hyperspectral image, R cal represents the finally corrected hyperspectral image, R dark represents the black reference image, R white represents the white reference image.

4. The method for identifying the age of turtle shells based on hyperspectral imaging according to claim 1, characterized in that, in step S3, the turtle shell sample data set is divided into a training set and a test set according to a ratio of 8:

2.

5. The method for identifying the age of turtle shells based on hyperspectral imaging according to claim 1, characterized in that, the formula for the spectral weight vector is: Furthermore, a spectral attention map is obtained using the spectral weight vector, and the formula for the spectral attention map is: M se σ(l) = σ(M s ′ e (l)) Among them, M s ′ e (l) is the spectral weight vector; is the average pooling feature on the spectrum, generated by global average pooling; is the maximum pooling feature on the spectrum, generated by global maximum pooling; W0 is the dimensionality reduction parameter of the first fully connected layer; W1 is the dimensionality increase parameter of the second fully connected layer; f relu is the ReLU activation function; σ is the sigmoid function; M se (l) is the spectral attention map generated through the spectral attention mechanism.

6. The method for identifying the age of turtle shells based on hyperspectral imaging according to claim 1, characterized in that, the formula for the spatial feature map is: M sa l) = σ(M s ′ a (l)) Among them, is the average pooling feature on the channel, is the max pooling feature on the channel, * is the convolution operation with a filter size of 7×7, σ is the sigmoid function, M s ′ a Attention(l) is the spatial attention weight, W2 is the convolution parameter of the spatial attention mechanism, M sa Attention(l) is the spatial feature map.

7. A turtle shell age identification model based on hyperspectral imaging, characterized in that, it is obtained by the method for identifying the age of turtle shells based on hyperspectral imaging according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Honey adulteration detection method and device based on hyperspectral imaging technology

    CN110516668A

  • Method for identifying ginseng age limit based on hyperspectral imaging technology

    CN112113922A