A method and system for detecting transparency of tortoise shell glue based on multi-spectrum

Through the multi-spectrum transparency detection method based on tortoise shell glue and combined with intelligent analysis algorithms, the subjectivity and inefficiency of the quality evaluation of tortoise shell glue in the existing technology are solved, and the objective and comprehensive evaluation of the transparency quality of tortoise shell glue is achieved, and the accuracy and reliability of the detection are improved.

CN119785063BActive Publication Date: 2025-05-13HUNAN DONGJIAN PHARMA CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510264946.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-05-13
Estimated Expiration
2045-03-07

AI Technical Summary

Technical Problem

The existing technology has problems such as strong subjectivity, low efficiency and inconsistent evaluation of tortoise shell glue quality, which is difficult to meet the needs of modern production and supervision.

Method used

The multi-spectrum-based tortoise shell glue transparency detection method is adopted. By obtaining the image information of the tortoise shell glue sample in multiple spectral bands, and combining intelligent analysis algorithms, an objective and comprehensive evaluation of the transparency quality of tortoise shell glue is achieved. Specific steps include band correction, spatial registration, spectral angle mapping, regional growth algorithm to extract tortoise shell glue areas, construct spectral feature matrix, establishing transparency and qualified taste identification model and quality grade division.

Benefits of technology

It has achieved an objective and comprehensive evaluation of the transparency quality of tortoise shell glue, improved the accuracy and reliability of inspection, and is suitable for modern production and supervision needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119785063B_ABST
    Figure CN119785063B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting the transparency of tortoise shell glue based on multispectrum, including: S1: obtaining a multispectral image sequence of a tortoise shell glue sample and performing band correction, constructing a multispectral image data cube and performing spatial registration; S2: generating a spectral angle mapping diagram according to the registered multispectral image data cube; S3: extracting the tortoise shell glue region through spectral angle mapping and regional growing algorithm and constructing a spectral feature matrix; S4: obtaining an optimal tortoise shell glue transparency qualified product identification model based on the spectral feature matrix and cross-validation method, and performing qualified judgment on the transparency of the tortoise shell glue sample to be tested; S5: constructing a transparency quality evaluation model, and classifying the transparency of tortoise shell glue into quality grades. Classifying the transparency of tortoise shell glue into quality grades. The present invention can achieve an objective and comprehensive evaluation of the transparency quality of tortoise shell glue by obtaining image information of tortoise shell glue samples in multiple spectral bands and combining intelligent analysis algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tortoise shell glue transparency detection, and in particular to a tortoise shell glue transparency detection method and system based on multi-spectrum. Background Art

[0002] As a traditional precious Chinese medicinal material, tortoise shell glue has the effects of nourishing yin and blood, strengthening the kidneys and tendons, and is widely used in clinical practice. With the rapid development of the Chinese medicine industry, the market demand for tortoise shell glue continues to increase, but its quality is uneven, and adulteration occurs from time to time, which seriously affects the safety and efficacy of clinical medication. Therefore, it is of great significance to establish a scientific and reliable tortoise shell glue quality evaluation method.

[0003] At present, the quality evaluation of tortoise shell glue mainly relies on traditional sensory inspection methods, which are judged by observing characteristics such as color, transparency, and smell. This method is highly subjective, inefficient, and has inconsistent evaluation standards, making it difficult to meet the needs of modern production and supervision. In recent years, with the development of analytical technology, some new detection methods have gradually been applied to the quality evaluation of tortoise shell glue. The existing invention patent with application number CN202211708805.2 discloses a method for identifying tortoise shell glue and detecting impurity-derived components based on ultra-high performance liquid chromatography-triple quadrupole mass spectrometry. Although this method has good specificity and sensitivity in component detection, it still has the following limitations: First, the sample needs to be subjected to complex pre-treatment, which destroys the integrity of the sample; second, the detection cost is high, the operation process is cumbersome, and it is not suitable for large-scale rapid screening; third, it can only reflect the local chemical composition information of the sample, and it is difficult to achieve an overall evaluation of the quality.

[0004] In addition, conventional physical and chemical index detection methods, microscopic image analysis methods and other methods have also been applied to the quality evaluation of tortoise shell glue. However, these methods either have long detection cycles and high costs, or can only obtain surface morphology information of samples, which are difficult to meet the needs of industrial development for fast, accurate and non-destructive testing. Although traditional machine vision methods have achieved non-destructive testing, they only use image information within the visible light range and ignore the characteristic differences of samples in different spectral bands, resulting in insufficient reliability of evaluation results. Summary of the invention

[0005] In view of this, the present invention provides a tortoise shell glue transparency detection method and system based on multi-spectrum, the purpose of which is to achieve an objective and comprehensive evaluation of the transparency quality of tortoise shell glue by acquiring image information of tortoise shell glue samples in multiple spectral bands and combining it with an intelligent analysis algorithm.

[0006] To achieve the above object, the present invention provides a method for detecting the transparency of tortoise shell glue based on multispectral, comprising the following steps:

[0007] S1: Obtain a multispectral image sequence of the tortoise shell glue sample, perform band correction through dark current correction and white board correction, obtain a corrected multispectral image sequence, construct a multispectral image data cube and perform spatial registration, and obtain a registered multispectral image data cube;

[0008] S2: Calculate the spectral angle and generate the spectral angle map according to the registered multispectral data cube;

[0009] S3: Extract the tortoise shell glue area through spectral angle mapping and region growing algorithm, and construct the spectral feature matrix;

[0010] S4: Based on the spectral feature matrix and the cross-validation method, the optimal tortoise shell glue transparency qualified product identification model is obtained; the transparency of the tortoise shell glue sample to be tested is judged to be qualified by the optimal tortoise shell glue transparency qualified product identification model;

[0011] S5: Construct a transparency quality evaluation model. Based on the transparency quality evaluation model, use the fuzzy C-means clustering algorithm to classify the transparency of tortoise shell glue into quality grades.

[0012] Optionally, in step S1, obtaining a multispectral image sequence of a tortoise shell glue sample and performing band correction to obtain a corrected multispectral image sequence, constructing a multispectral image data cube and performing spatial registration to obtain a registered multispectral image data cube includes:

[0013] S11: A hyperspectral camera is used to sample at intervals of 2 nm in the 400-1000 nm band to obtain Multispectral image sequence of bands ,in For the Multispectral images of tortoise shell glue samples collected in bands. is the band number, the value range is ;

[0014] S12: Perform dark current correction and white board correction on the acquired multispectral image sequence to obtain a corrected multispectral image sequence , specifically:

[0015] ;

[0016] in, and are the horizontal and vertical coordinates of the multispectral image of the tortoise shell glue sample, respectively; For the Multispectral image after band correction; For the Multispectral image after band correction In pixel coordinates The pixel value at ; For the The multispectral image collected in the band is in the pixel coordinate The pixel value at ; is the dark current image at pixel coordinates The pixel value at ; The pixel coordinates for the whiteboard reference image The pixel value at ; For the Standard white plate reflectance in each band;

[0017] S13: Construct a multispectral image data cube, perform spatial registration on the corrected multispectral image sequence, and obtain the registered multispectral image data cube , specifically:

[0018] ;

[0019] in, is the multispectral image data cube after registration In space coordinates and band Spectral reflectance value at ; For the The spatial registration transformation matrix of the bands is:

[0020] ;

[0021] in, and are the height and width of the multispectral image, respectively; Get the function output value to achieve the minimum value ; ∑ is the summation symbol; The reference band image In pixel coordinates The pixel value at ; is the Euclidean distance norm; is the affine transformation matrix to be optimized:

[0022] ;

[0023] in, are the rotation and scaling parameters of the affine transformation, and is the translation parameter.

[0024] Optionally, in step S2, the spectral angle is calculated and a spectral angle map is generated according to the registered multispectral image data cube:

[0025] Calculate the spectral angle between each pixel in the registered multispectral image data cube and the standard tortoise shell glue spectral feature to obtain the spectral angle mapping diagram , specifically:

[0026] ;

[0027] in, Spectral angle map In pixel coordinates The spectral angle value at; arccos is the inverse cosine function; Standard tortoise shell glue The standard spectral reflectance value of each band.

[0028] Optionally, in step S3, extracting the tortoise shell glue region by using spectral angle mapping and region growing algorithm includes:

[0029] S31: Extract the tortoise shell glue region based on the region growing algorithm of the adaptive threshold, and obtain the region segmentation mask map E, which is specifically:

[0030] ;

[0031] in, is the region segmentation mask In pixel coordinates The value at and They are centered on the seed point. The spectral angle mean and standard deviation within the neighborhood; is the adaptive threshold coefficient; is the absolute value operator symbol;

[0032] S32: Extract the spectral features of the tortoise shell glue area and construct the spectral feature matrix , specifically:

[0033] ;

[0034] in, is the spectral feature matrix Middle The pixel at Spectral reflectance values ​​of each band; For the The spatial coordinates of the pixels; is the pixel number, , is the total number of pixels in the tortoise shell glue area; is the region segmentation mask In pixel coordinates The value at is the multispectral image data cube after registration In space coordinates and band The spectral reflectance value at .

[0035] Optionally, in step S4, the transparency of the tortoise shell glue sample to be tested is judged as qualified by using the optimal tortoise shell glue transparency qualified product identification model, including:

[0036] S41: Calculate the overall spectral characteristics of the tortoise shell glue area and construct the tortoise shell glue sample feature vector:

[0037] ;

[0038] in, For the tortoise shell glue area The average spectral response of each band; For the The standard deviation of the spectral response of each band;

[0039] Feature vector of tortoise shell glue sample for:

[0040] ;

[0041] in, and The tortoise shell glue area is Band and The average spectral response of each band; and The tortoise shell glue area is Band and The standard deviation of the spectral response of each band; is the pixel ratio of the tortoise shell glue area;

[0042] S42: Based on the feature vector of tortoise shell glue sample A binary classification support vector machine model was constructed to establish a tortoise shell glue transparency qualified product identification model;

[0043] S43: Use cross-validation method to optimize the parameters of the tortoise shell glue transparency qualified product identification model to obtain the optimal tortoise shell glue transparency qualified product identification model , specifically:

[0044] ;

[0045] in, For the Identification model of qualified tortoise shell glue transparency in cross-validation The classification accuracy of is the number of cross-validation folds; Get the maximum value of the function output ;

[0046] Using the optimal tortoise shell glue transparency qualified product identification model Determine the transparency of the sample to be tested:

[0047] ;

[0048] in, It is the qualified judgment result of the transparency of the sample to be tested.

[0049] Optionally, the S42 comprises the following steps:

[0050] S421: Constructing a training sample set :

[0051] ;

[0052] in, For the The feature vector of training samples; is the corresponding category label, 1 represents qualified transparency, and -1 represents unqualified transparency; is the sample number, ; is the total number of training samples;

[0053] S422: Establishment of a model for identifying qualified products of tortoise shell glue with transparency :

[0054] ;

[0055] in, is a logical function that determines the positive and negative signs of real numbers; is the index set of the support vector in the training sample set, ; For the The weight coefficients of the support vectors; is the bias term; is the kernel function, specifically:

[0056] ;

[0057] in, is the kernel function parameter; is a natural constant.

[0058] Optionally, the step S5 classifies the transparency of the tortoise shell glue into quality grades, including:

[0059] S51: Extract features of samples that are judged as qualified for transparency in S4 and construct a transparency quality feature matrix :

[0060] ;

[0061] in, For the The quality feature vector of the tortoise shell glue samples; For the The feature vector of training samples; Respectively The spectral uniformity and band correlation of each sample are as follows:

[0062] ;

[0063] in, For the The tortoise shell glue samples were The standard deviation of the spectral response of each band; For the The tortoise shell glue samples were The average spectral response of each band; For the The tortoise shell glue samples were The spectral response sequence of the bands; For the The first sample of tortoise shell glue Band and covariance of the spectral response of the band; and Respectively The first sample of tortoise shell glue Band and The variance of the spectral response of the band;

[0064] S52: Constructing a transparency quality evaluation model , using fuzzy C-means clustering algorithm for quality classification:

[0065] ;

[0066] in, It is a tortoise shell glue transparency quality evaluation model; For the The transparency quality grade of each tortoise shell glue sample; is the transparency quality grade number; For the The tortoise shell glue sample belongs to The degree of membership of the level is:

[0067] ;

[0068] in, For the The cluster center of level; is the fuzziness coefficient; represents the Euclidean distance;

[0069] S53: Establish a quality evaluation confidence index matrix and determine the final quality level:

[0070] The quality evaluation confidence is specifically:

[0071] ;

[0072] in, For the The tortoise shell glue sample belongs to Confidence level of the level; For tortoise shell glue sample The maximum distance to all cluster centers;

[0073] Jordi The maximum confidence value of the tortoise shell glue sample is , then the tortoise shell glue sample The quality level is class.

[0074] The present invention also discloses a multi-spectral based tortoise shell glue transparency detection system, comprising:

[0075] Band correction module: obtain the multispectral image sequence of the tortoise shell glue sample and perform band correction to obtain the corrected multispectral image sequence, construct the multispectral image data cube and perform spatial registration to obtain the registered multispectral image data cube;

[0076] Spectral angle map generation module: calculates the spectral angle and generates a spectral angle map according to the registered multispectral image data cube;

[0077] Tortoise shell glue region identification module: extracts tortoise shell glue regions through spectral angle mapping and region growing algorithm, and constructs spectral feature matrix;

[0078] Qualified product identification module: Based on the spectral feature matrix and cross-validation method, the optimal tortoise shell glue transparency qualified product identification model is obtained; the transparency of the tortoise shell glue sample to be tested is judged to be qualified through the optimal tortoise shell glue transparency qualified product identification model;

[0079] Grading module: construct a transparency quality evaluation model, based on which the fuzzy C-means clustering algorithm is used to classify the transparency of tortoise shell glue into quality grades.

[0080] Compared with the prior art, the present invention has at least the following beneficial effects:

[0081] The present invention adopts dark current correction and whiteboard correction methods to eliminate system errors and ensure the accuracy of data. At the same time, the present invention introduces spatial registration technology and realizes accurate alignment of multi-band images through optimized affine transformation matrix, effectively solving the problem of insufficient image registration accuracy in traditional methods.

[0082] The present invention develops a method for extracting tortoise shell glue regions based on spectral angle mapping and adaptive region growing algorithm. By calculating the spectral angle between the sample and the standard spectral features and combining the adaptive threshold strategy, the accurate segmentation of the tortoise shell glue region is achieved. This method makes full use of the spectral response characteristics of the sample in multiple bands, overcoming the defect that the traditional single-band image segmentation method is easily affected by background interference. At the same time, by constructing a sample feature vector containing multi-dimensional features such as average spectral response, standard deviation and regional proportion, a comprehensive and reliable feature characterization is provided for subsequent quality evaluation.

[0083] The present invention constructs an intelligent transparency evaluation system, realizes automatic identification of qualified products through support vector machine model, and classifies quality grades by combining fuzzy C-means clustering algorithm. In particular, the quality evaluation confidence index is introduced into the evaluation model, and the evaluation result with reliability guarantee is given by calculating the distance relationship between the sample and the cluster center of each quality grade. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Figure 1 A schematic flow chart of a method for detecting the transparency of tortoise shell glue based on multi-spectrum according to an embodiment of the present invention;

[0085] Figure 2 This is a multispectral image of a tortoise shell glue sample before correction according to an embodiment of the present invention, wherein (a) is a near-infrared band, and (b) is a mid-infrared band;

[0086] Figure 3 This is a multispectral image of a tortoise shell glue sample after correction according to an embodiment of the present invention, wherein Figure (a) is a near-infrared band and Figure (b) is a mid-infrared band. DETAILED DESCRIPTION

[0087] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.

[0088] Example 1: A method for detecting the transparency of tortoise shell glue based on multi-spectrum, such as Figure 1 As shown, the following steps are included:

[0089] S1: Obtain the multispectral image sequence of the tortoise shell glue sample and perform band correction to obtain the corrected multispectral image sequence, construct a multispectral image data cube and perform spatial registration to obtain the registered multispectral image data cube:

[0090] S11: A hyperspectral camera is used to sample at intervals of 2 nm in the 400-1000 nm band to obtain Multispectral image sequence of bands ,in For the Multispectral images of tortoise shell glue samples collected in bands. is the band number, the value range is ;

[0091] S12: Perform dark current correction and white board correction on the acquired multispectral image sequence to obtain a corrected image sequence , the multispectral imaging of tortoise shell glue before correction is shown in Figure 2 As shown, specifically:

[0092] ;

[0093] in, and are the horizontal and vertical coordinates of the multispectral image of the tortoise shell glue sample, respectively; For the Multispectral image after band correction; For the Multispectral image after band correction In pixel coordinates The pixel value at ; For the The multispectral image collected in the band is in the pixel coordinate The pixel value at ; is the dark current image at pixel coordinates The pixel value at ; The pixel coordinates for the whiteboard reference image The pixel value at ; For the The reflectance of a standard white plate in each band.

[0094] It should be noted that, in this embodiment, while keeping the camera exposure parameters consistent with those during sample collection, the light source is turned off, and the camera lens is completely shielded with an opaque shading cover, 10 frames of images are collected and the average value is taken as the dark current image; in this embodiment, a standard white board with a reflectivity of not less than 98% is selected, and it is placed in the same collection position as the sample, the light source is kept on and the lighting conditions are consistent with those during sample collection, 10 frames of images are collected and the average value is taken as the white board reference image; the corrected tortoise shell glue multispectral image is shown in FIG. Figure 3 shown.

[0095] S13: Construct a multispectral image data cube, perform spatial registration on the corrected multispectral image sequence, and obtain the registered multispectral image data cube , specifically:

[0096] ;

[0097] in, is the multispectral image data cube after registration In space coordinates and band Spectral reflectance value at ; For the The spatial registration transformation matrix of the bands is:

[0098] ;

[0099] in, and are the height and width of the multispectral image, respectively; Get the function output value to achieve the minimum value ; The reference band image In pixel coordinates The pixel value at, in this embodiment, the first band image is selected as the reference band image; is the Euclidean distance norm; is the affine transformation matrix to be optimized:

[0100] ;

[0101] in, are the rotation and scaling parameters of the affine transformation, and is the translation parameter.

[0102] It should be noted that the spatial registration optimization process in this embodiment is solved by the gradient descent method, and the iteration is stopped when the change of the affine transformation parameters in two consecutive iterations is less than the preset threshold value 1e-3. and The initial value of is 1. and The initial value of is 0. and The initial value of is 0.

[0103] This step uses a hyperspectral camera to perform high-density sampling of tortoise shell glue, and obtains the spectral response characteristics of the tortoise shell glue samples at different wavelengths. Compared with the traditional single-band image acquisition method, it can more comprehensively reflect the optical properties of the sample. At the same time, this step establishes a complete image correction process, which effectively eliminates the noise interference of the camera itself through dark current correction, and compensates for the influence of uneven light source intensity and inconsistent spectral response through whiteboard correction, ensuring the accuracy and comparability of the data. In particular, when constructing a multispectral data cube, a spatial registration method based on affine transformation is used to solve the problem of spatial position offset between images of different bands due to chromatic aberration of the optical system, ensuring the accuracy of subsequent feature extraction.

[0104] S2: Calculate the spectral angle and generate a spectral angle map according to the registered multispectral image data cube;

[0105] Calculate the spectral angle between each pixel in the registered multispectral image data cube and the standard tortoise shell glue spectral feature to obtain the spectral angle mapping diagram , specifically:

[0106] ;

[0107] in, Spectral angle map In pixel coordinates The spectral angle value at; arccos is the inverse cosine function; Standard tortoise shell glue The standard spectral reflectance value of each band.

[0108] It should be noted that the standard spectral reflectance value in this embodiment is obtained by selecting a tortoise shell glue standard certified by the State Food and Drug Administration, collecting its multispectral image under the same experimental conditions, and extracting a 100×100 pixel area from the central area of ​​the sample after processing in step S1. The average spectral reflectance value of the area in each band is calculated as the standard spectral feature.

[0109] This step introduces a similarity analysis method based on spectral angle quantity, and realizes accurate identification of the tortoise shell glue area by calculating the similarity of spectral characteristics between the sample to be tested and the standard tortoise shell glue. Compared with the traditional identification method based on a single band or a simple threshold, this step makes full use of the rich spectral information in the multi-spectral data, and can effectively distinguish substances with similar visual appearance but different spectral characteristics, significantly improving the accuracy of tortoise shell glue area identification. Especially when dealing with complex backgrounds or the presence of interfering substances, this step converts multi-dimensional spectral characteristics into an intuitive two-dimensional similarity distribution map through spectral angle mapping technology, which not only retains the discrimination ability of spectral information, but also simplifies the subsequent regional segmentation process.

[0110] S3: Extract the tortoise shell glue area through spectral angle mapping and region growing algorithm, and construct the spectral feature matrix;

[0111] S31: Extract the tortoise shell glue region based on the region growing algorithm of the adaptive threshold, and obtain the region segmentation mask map E, which is specifically:

[0112] ;

[0113] in, is the region segmentation mask In pixel coordinates The value at is the absolute value operator symbol;

[0114] and They are centered on the seed point. The spectral angle mean and standard deviation in the neighborhood, in this embodiment ; is the adaptive threshold coefficient, which is 2 in this embodiment.

[0115] Further explanation, in this embodiment, when the change rate of the region growing results of two adjacent iterations is less than 1%, the region growing process is stopped; the seed point selection method is specifically:

[0116] Spectral angle mapping In the example, the centroid position of the continuous area with the smallest spectral angle value is selected as the seed point; if there are multiple minimum value areas with similar spectral angle values, the centroid of the area with the largest area is selected as the seed point;

[0117] S32: Extract the spectral features of the tortoise shell glue area and construct the spectral feature matrix , specifically:

[0118] ;

[0119] in, is the spectral feature matrix Middle The pixel at Spectral reflectance values ​​of each band; For the The spatial coordinates of the pixels; is the pixel number, , is the total number of pixels in the tortoise shell glue area; is the region segmentation mask In pixel coordinates The value at is the multispectral image data cube after registration In space coordinates and band Spectral reflectance value at

[0120] It should be noted that this step combines spectral angle mapping and adaptive region growing algorithm to achieve accurate extraction of tortoise shell glue area. Compared with the traditional fixed threshold segmentation method, this step adopts an adaptive threshold strategy based on local statistical characteristics, which can better adapt to the spectral changes inside the sample area and effectively solve the problem of spectral response differences caused by factors such as uneven sample thickness and surface reflection. Especially when dealing with edge transition areas, by dynamically adjusting the growth criteria, the continuity of segmentation is guaranteed, and the overgrowth phenomenon is avoided, which significantly improves the accuracy of regional extraction.

[0121] S4: Based on the spectral feature matrix and the cross-validation method, the optimal tortoise shell glue transparency qualified product identification model is obtained; the transparency of the tortoise shell glue sample to be tested is judged to be qualified by the optimal tortoise shell glue transparency qualified product identification model;

[0122] S41: Calculate the overall spectral characteristics of the tortoise shell glue area and construct the tortoise shell glue sample feature vector:

[0123] ;

[0124] in, For the tortoise shell glue area The average spectral response of each band; For the The standard deviation of the spectral response of each band;

[0125] Feature vector of tortoise shell glue sample for:

[0126] ;

[0127] in, and The tortoise shell glue area is Band and The average spectral response of each band; and The tortoise shell glue area is Band and The standard deviation of the spectral response of each band; is the pixel ratio of the tortoise shell glue area;

[0128] S42: Based on the feature vector of tortoise shell glue sample A binary classification support vector machine model was constructed to establish a tortoise shell glue transparency qualified product identification model, specifically:

[0129] S421: Constructing a training sample set :

[0130] ;

[0131] in, For the The feature vector of training samples; is the corresponding category label, 1 represents qualified transparency, and -1 represents unqualified transparency; is the sample number, ; is the total number of training samples;

[0132] S422: Establishment of a model for identifying qualified products of tortoise shell glue with transparency :

[0133] ;

[0134] in, is the characteristic vector of the sample to be tested; is a logical function that determines the positive and negative signs of real numbers; is the index set of the support vector in the training sample set, ; For the The weight coefficients of the support vectors; is the bias term; is the kernel function, specifically:

[0135] ;

[0136] in, is the kernel function parameter. In this embodiment, ; is a natural constant;

[0137] S43: Use cross-validation method to optimize the parameters of the tortoise shell glue transparency qualified product identification model to obtain the optimal tortoise shell glue transparency qualified product identification model , specifically:

[0138] ;

[0139] in, For the Identification model of qualified tortoise shell glue transparency in cross-validation The classification accuracy of is the number of cross-validation folds; Get the maximum value of the function output ;

[0140] Using the optimal tortoise shell glue transparency qualified product identification model Determine the transparency of the sample to be tested:

[0141] ;

[0142] in, It is the qualified judgment result of the transparency of the sample to be tested.

[0143] It should be noted that this step combines statistical features and machine learning methods to construct an intelligent model for distinguishing the transparency of tortoise shell glue. By extracting statistical features such as the average spectral response and standard deviation of the tortoise shell glue area, and considering the spatial distribution characteristics of the sample, a comprehensive characterization of the transparency characteristics of the sample is achieved. Compared with the traditional single indicator evaluation method, this step adopts a multi-dimensional feature fusion strategy, which not only considers the overall spectral characteristics of the sample, but also includes local variation information, which can more accurately reflect the transparency of tortoise shell glue.

[0144] S5: Construct a transparency quality evaluation model. Based on the transparency quality evaluation model, the fuzzy C-means clustering algorithm is used to classify the transparency of tortoise shell glue into quality grades:

[0145] S51: Constructing a transparency quality feature matrix , extract features of samples judged as qualified in transparency in S4:

[0146] ;

[0147] in, For the The quality feature vector of samples; No. The feature vector of training samples; Respectively The spectral uniformity and band correlation of each sample are as follows:

[0148] ;

[0149] in, For the The tortoise shell glue samples were The standard deviation of the spectral response of each band; For the The tortoise shell glue samples were The average spectral response of each band; For the The tortoise shell glue samples were The spectral response sequence of the bands; For the The first sample of tortoise shell glue Band and covariance of the spectral response of the band; and Respectively The first sample of tortoise shell glue Band and The variance of the spectral response of the band;

[0150] S52: Constructing a transparency quality evaluation model , using fuzzy C-means clustering algorithm for quality classification:

[0151] ;

[0152] in, It is a tortoise shell glue transparency quality evaluation model; For the The transparency quality grade of the tortoise shell glue samples; is the transparency quality grade number, which is 3 in this embodiment; For the The tortoise shell glue sample belongs to The degree of membership of the level is:

[0153] ;

[0154] in, For the When the cluster center is initialized, select the manual classification to the first The samples of level 1 are taken as the initial cluster centers; is the fuzziness coefficient, which is 2 in this embodiment; Represents the Euclidean distance; the termination condition of clustering iteration is that the change of cluster center in two consecutive iterations is less than 0.1%;

[0155] S53: Establish a quality evaluation confidence index matrix and determine the final quality level:

[0156] The quality evaluation confidence is specifically:

[0157] ;

[0158] in, For the The tortoise shell glue sample belongs to Confidence level of the level; For tortoise shell glue sample The maximum distance to all cluster centers;

[0159] Jordi The maximum confidence value of the tortoise shell glue sample is , then the tortoise shell glue sample The quality level is class.

[0160] This step establishes a more comprehensive and objective quality evaluation system by comprehensively considering multiple quality characteristic indicators such as spectral uniformity, band correlation and transmittance. Compared with the traditional single indicator evaluation method, this step uses a fuzzy clustering algorithm for quality grading, which can better handle the ambiguity and uncertainty between sample characteristics and avoid the limitations of traditional hard classification methods when dealing with boundary samples.

[0161] This application conducts a verification experiment on 100 samples of tortoise shell glue, including samples from different origins and batches. The sample size is 10cm×10cm standard sheet, the test environment temperature is 23±2℃, and the relative humidity is 45%±5%. A hyperspectral imaging system is used for image acquisition, with a wavelength range of 400-1000nm and a spectral resolution of 2nm.

[0162] Table 1 Statistics of test results of tortoise shell glue samples of different quality grades

[0163]

[0164] Table 2 System performance index verification results

[0165]

[0166] Table 1 shows the test results of tortoise shell glue samples of different quality grades. The application can achieve an accuracy rate of 98.0% for the identification of premium products. Table 2 shows the verification results of the system performance indicators. The system of the application has a fast detection speed, and the detection time of a single sample does not exceed 3 seconds; the measurement results have good repeatability, and the coefficient of variation CV is controlled within 2.0%, which meets the requirements of practical applications.

[0167] Embodiment 2: The present invention also discloses a multi-spectral based tortoise shell glue transparency detection system, comprising the following five modules:

[0168] Band correction module: obtain the multispectral image sequence of the tortoise shell glue sample and perform band correction to obtain the corrected multispectral image sequence, construct the multispectral image data cube and perform spatial registration to obtain the registered multispectral image data cube;

[0169] Spectral angle map generation module: calculates the spectral angle and generates a spectral angle map according to the registered multispectral image data cube;

[0170] Tortoise shell glue region identification module: extracts tortoise shell glue regions through spectral angle mapping and region growing algorithm, and constructs spectral feature matrix;

[0171] Qualified product identification module: Based on the spectral feature matrix and cross-validation method, the optimal tortoise shell glue transparency qualified product identification model is obtained; the transparency of the tortoise shell glue sample to be tested is judged to be qualified through the optimal tortoise shell glue transparency qualified product identification model;

[0172] Grading module: construct a transparency quality evaluation model, based on which the fuzzy C-means clustering algorithm is used to classify the transparency of tortoise shell glue into quality grades.

[0173] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0174] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0175] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for detecting the transparency of tortoise shell glue based on multi-spectrum, characterized in that: The following steps are involved: S1: Obtain a multispectral image sequence of the tortoise shell glue sample, perform band correction through dark current correction and white board correction, obtain a corrected multispectral image sequence, construct a multispectral image data cube and perform spatial registration, and obtain a registered multispectral image data cube; S2: Calculate the spectral angle and generate a spectral angle map according to the registered multispectral image data cube; S3: Extract the tortoise shell glue area through spectral angle mapping and region growing algorithm, and construct the spectral feature matrix; S4: Based on the spectral feature matrix and the cross-validation method, the optimal tortoise shell glue transparency qualified product identification model is obtained; the transparency of the tortoise shell glue sample to be tested is judged to be qualified by the optimal tortoise shell glue transparency qualified product identification model; S5: Construct a transparency quality evaluation model. Based on the transparency quality evaluation model, use the fuzzy C-means clustering algorithm to classify the transparency of tortoise shell glue into quality grades.

2. The method for detecting transparency of tortoise shell glue based on multispectrum according to claim 1, characterized in that: The S1 comprises the following steps: S11: A hyperspectral camera is used to sample at intervals of 2 nm in the 400-1000 nm band to obtain Multispectral image sequence of bands ,in For the Multispectral images of tortoise shell glue samples collected in bands. is the band number, the value range is ; S12: Perform dark current correction and white board correction on the acquired multispectral image sequence to obtain a corrected multispectral image sequence , specifically: ; in, and are the horizontal and vertical coordinates of the multispectral image of the tortoise shell glue sample, respectively; For the Multispectral image after band correction; For the Multispectral image after band correction In pixel coordinates The pixel value at ; For the The multispectral image collected in the band is in the pixel coordinate The pixel value at ; is the dark current image at pixel coordinates The pixel value at ; The pixel coordinates for the whiteboard reference image The pixel value at ; For the Standard white plate reflectance in each band; S13: Construct a multispectral image data cube, perform spatial registration on the corrected multispectral image sequence, and obtain the registered multispectral image data cube , specifically: ; in, is the multispectral image data cube after registration In space coordinates and band Spectral reflectance value at ; For the The spatial registration transformation matrix of the bands is: ; in, and are the height and width of the multispectral image, respectively; Get the function output value to achieve the minimum value ; ∑ is the summation symbol; The reference band image In pixel coordinates The pixel value at ; is the Euclidean distance norm; is the affine transformation matrix to be optimized: ; in, are the rotation and scaling parameters of the affine transformation, and is the translation parameter.

3. The method for detecting transparency of tortoise shell glue based on multispectrum according to claim 2, characterized in that: The S2 comprises the following steps: Calculate the spectral angle between each pixel in the registered multispectral image data cube and the standard tortoise shell glue spectral feature to obtain the spectral angle mapping diagram , specifically: ; in, Spectral angle mapping In pixel coordinates The spectral angle value at; arccos is the inverse cosine function; Standard tortoise shell glue The standard spectral reflectance value of each band.

4. The method for detecting transparency of tortoise shell glue based on multispectrum according to claim 3, characterized in that: The S3 comprises the following steps: S31: Extract the tortoise shell glue region based on the region growing algorithm of the adaptive threshold, and obtain the region segmentation mask map E, which is specifically: ; in, is the region segmentation mask In pixel coordinates The value at and They are centered on the seed point. The spectral angle mean and standard deviation within the neighborhood; is the adaptive threshold coefficient; is the absolute value operator symbol; S32: Extract the spectral features of the tortoise shell glue area and construct the spectral feature matrix , specifically: ; in, is the spectral feature matrix Middle The pixel at Spectral reflectance values ​​of each band; For the The spatial coordinates of the pixels; is the pixel number, , is the total number of pixels in the tortoise shell glue area; is the region segmentation mask In pixel coordinates The value at is the multispectral image data cube after registration In space coordinates and band The spectral reflectance value at .

5. The method for detecting transparency of tortoise shell glue based on multispectrum according to claim 4, characterized in that: The S4 comprises the following steps: S41: Calculate the overall spectral characteristics of the tortoise shell glue area and construct the tortoise shell glue sample feature vector: ; in, For the tortoise shell glue area The average spectral response of each band; For the The standard deviation of the spectral response of each band; Tortoise shell glue sample feature vector for: ; in, and The tortoise shell glue area is Band and The average spectral response of each band; and The tortoise shell glue area is Band and The standard deviation of the spectral response of each band; is the pixel ratio of the tortoise shell glue area; S42: Based on the feature vector of tortoise shell glue sample Construct a binary support vector machine model and establish a tortoise shell glue transparency qualified product identification model ; S43: Use cross-validation method to optimize the parameters of the tortoise shell glue transparency qualified product identification model to obtain the optimal tortoise shell glue transparency qualified product identification model , specifically: ; in, For the Identification model of qualified tortoise shell glue transparency in cross-validation The classification accuracy of is the number of cross-validation folds; Get the maximum value of the function output ; Using the optimal tortoise shell glue transparency qualified product identification model Determine the transparency of the sample to be tested: ; in, is the qualified judgment result of the transparency of the sample to be tested, is the feature vector of the sample to be tested.

6. The method for detecting transparency of tortoise shell glue based on multispectrum according to claim 5, characterized in that: The S42 comprises the following steps: S421: Constructing a training sample set : ; in, For the The feature vector of training samples; is the corresponding category label, 1 represents qualified transparency, and -1 represents unqualified transparency; is the sample number, ; is the total number of training samples; S422: Establishment of a model for identifying qualified products of tortoise shell glue with transparency : ; in, is a logical function that determines the positive and negative signs of real numbers; is the index set of the support vector in the training sample set, ; For the The weight coefficients of the support vectors; is the bias term; is the kernel function, specifically: ; in, is the kernel function parameter; is a natural constant.

7. The method for detecting transparency of tortoise shell glue based on multi-spectrum according to claim 5, characterized in that: The S5 comprises the following steps: S51: Extract features of the tortoise shell glue samples that are judged to be qualified in transparency in S4, and construct a tortoise shell glue transparency quality feature matrix : ; in, For the The quality feature vector of the tortoise shell glue samples; For the The feature vector of training samples; Respectively The spectral uniformity and band correlation of the tortoise shell glue samples are as follows: ; in, For the The tortoise shell glue samples were The standard deviation of the spectral response of each band; For the The tortoise shell glue samples were The average spectral response of each band; For the The tortoise shell glue samples were The spectral response sequence of the bands; For the The first sample of tortoise shell glue Band and covariance of the spectral response of the band; and Respectively The first sample of tortoise shell glue Band and The variance of the spectral response of the band; S52: Constructing a transparency quality evaluation model , using fuzzy C-means clustering algorithm for quality classification: ; in, It is a tortoise shell glue transparency quality evaluation model; For the The transparency quality grade of the tortoise shell glue samples; is the transparency quality grade number; For the The tortoise shell glue sample belongs to The degree of membership of the level is: ; in, For the The cluster center of level; is the fuzziness coefficient; represents the Euclidean distance; S53: Establish a quality evaluation confidence index matrix and determine the final quality level: The quality evaluation confidence is specifically: ; in, For the The tortoise shell glue sample belongs to Confidence level of the level; For tortoise shell glue sample The maximum distance to all cluster centers; Jordi The maximum confidence value of the tortoise shell glue sample is , then the tortoise shell glue sample The quality level is class.

8. A multi-spectral tortoise shell glue transparency detection system, characterized in that: include: Band correction module: obtain the multispectral image sequence of the tortoise shell glue sample and perform band correction to obtain the corrected multispectral image sequence, construct the multispectral image data cube and perform spatial registration to obtain the registered multispectral image data cube; Spectral angle map generation module: calculates the spectral angle and generates a spectral angle map according to the registered multispectral image data cube; Tortoise shell glue region identification module: extracts tortoise shell glue regions through spectral angle mapping and region growing algorithm, and constructs spectral feature matrix; Qualified product identification module: Based on the spectral feature matrix and cross-validation method, the optimal tortoise shell glue transparency qualified product identification model is obtained; the transparency of the tortoise shell glue sample to be tested is judged to be qualified through the optimal tortoise shell glue transparency qualified product identification model; Grade classification module: construct a transparency quality evaluation model, based on which the fuzzy C-means clustering algorithm is used to classify the transparency of tortoise shell glue into quality grades; To realize a multi-spectral based tortoise shell glue transparency detection method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method for identifying tortoise-shell glue and simultaneously detecting impurity skin source components

    CN116818921A

  • PCR identification method of Chinese medicament turtle-derived component

    CN101838684A

  • Multi-temporal multi-spectral remote sensing image change detection method and system

    CN109242832A