A method for identifying color difference of cigarette packaging materials based on near infrared technology and discrete wavelet transform-random forest algorithm
Patent Information
- Application Number
- CN202210006254.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-04
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2042-01-04
AI Technical Summary
The accuracy of the near-infrared technology used in the prior art for color difference identification of cigarette packaging materials is low and cannot meet the inspection needs of actual products.
The method based on near-infrared technology and discrete wavelet transform-random forest algorithm is used to distinguish the color difference of cigarette packaging materials, and the interference signals are removed through discrete wavelet transform preprocessing. The random forest algorithm recognizes feature information and establishes an accurate color difference model.
The accurate identification of the color difference of cigarette packaging materials is achieved, the identification results are consistent with the visual results, and the accuracy rate reaches 100%, meeting the color difference identification needs of actual products.
Smart Images

Figure CN114544543B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of color difference identification of cigarette packaging materials, and more specifically, to a method for identifying color difference of cigarette packaging materials based on near infrared technology and discrete wavelet transform-random forest algorithm. Background Art
[0002] The quality of cigarette packaging materials directly determines the final consumer's first impression of cigarette products, and to a certain extent affects consumers' choice of cigarette products. When the quality stability of trademark printing is poor, color difference will occur in cigarette packaging materials. To evaluate the degree of color difference of printed products, subjective visual inspection or colorimeter method is usually used to compare the printed products with standard samples. Although these two methods are simple to operate, there are many problems in actual use.
[0003] The visual inspection method generally uses human eyes to observe under standard light sources. This method is relatively simple and can directly find out the color difference problems of the product. When the standard sample is used as the basis for testing, it is enough to observe whether there is a color difference between the standard sample and the test sample in the standard light box. The advantages of this method are simple operation and low price of instruments and equipment. The disadvantage is that it is affected by human subjective factors, emotions, visual fatigue and surrounding environment.
[0004] The colorimeter method uses a colorimeter and color management software to compare the color difference between the standard sample and the test sample. The colorimeter is an optical measuring instrument that simulates the human eye's sensitivity to red, green, and blue light. It can analyze the object under test from five angles and provide quantitative test results. This method also has certain limitations. Since the parameter range of the tolerance formula is often relatively fixed and the adjustable range is narrow, the test values of some samples with special visual effects may have certain deviations. In addition, different personnel have different operating methods for colorimeter inspection, which also has a certain impact on the final test data.
[0005] Near infrared spectroscopy is one of the fastest-growing analytical methods in recent years. It does not require complex sample pretreatment and has the advantages of high accuracy, low cost, simplicity, and rapidity. It has been widely used in the tobacco industry. However, the development of the method of color difference identification of cigarette packaging materials using near infrared technology is still immature. Some previous studies simply analyzed the test data, lacked systematic and comprehensive analytical methods, and did not build a suitable analysis model and verification model. Some used preset monochromatic samples to build color difference analysis models, and the constructed models were of limited practicality. The existing literature (Analysis of visible light color difference of cigarette packaging paper by near infrared molecular spectroscopy, Li Chao et al., Paper and Papermaking, Vol. 34, No. 4, April 2015, 69-72) used PLS-DA to determine and establish a similarity matching model for different colors of paper products, but this method used preset monochromatic samples to build a color difference analysis model. The constructed model is not suitable for analyzing cigarette packaging materials with complex colors and processes, and cannot meet the actual product inspection needs. In addition, there are literatures (Color difference analysis of cigarette packaging materials based on near infrared spectroscopy, Zhang Yipeng et al., Tobacco Science and Technology) that only use a small number of qualified samples (40) to establish a similarity identification model, using the principal component analysis (PCA) method to model, and using Hotelling T 2 Statistics are used to evaluate the discrete degree of the spectrum of unknown samples, thereby reflecting the color difference of the samples. However, this method has a low accuracy rate for identifying samples with slight color differences. In view of this, further research on the near-infrared method is needed before it can be used in the color difference identification of actual products of cigarette packaging materials. Summary of the invention
[0006] The purpose of the present invention is to overcome the problem of low accuracy of the color difference identification method of cigarette packaging materials using near infrared technology in the prior art, and to provide a method for identifying the color difference of cigarette packaging materials based on near infrared technology and discrete wavelet transform-random forest algorithm. The method of the present invention can accurately identify the color difference of cigarette packaging materials, and the identification result is consistent with the visual result, with a high accuracy rate of 100%, and high practicality. Therefore, the method of the present invention can meet the color difference identification needs of actual products of cigarette packaging materials.
[0007] To achieve the above invention objectives, the present invention adopts the following technical solutions.
[0008] A method for identifying color difference of cigarette packaging materials based on near infrared technology and discrete wavelet transform-random forest algorithm comprises the following steps:
[0009] S1: Cigarette packaging materials were used as modeling samples;
[0010] S2: visually compare the color difference between the standard sample and the modeling sample to obtain the color difference evaluation result of the modeling sample for later use;
[0011] S3: Use near-infrared technology to perform spectral scanning on the modeling sample to obtain original near-infrared spectral information;
[0012] S4: Preprocessing the original near-infrared spectrum information using discrete wavelet transform method to obtain reconstructed spectrum information;
[0013] S5: using random forest algorithm to identify feature information from the reconstructed spectral information, for later use;
[0014] S6: establishing a corresponding relationship between the characteristic information obtained in S5 and the color difference evaluation result in S2, and constructing an identification model of the color difference of cigarette packaging materials;
[0015] S7: According to the same steps as S3 to S5, the original near-infrared spectrum information, reconstructed spectrum information and characteristic information of the unknown sample are obtained respectively, and compared with the identification model obtained in S6 to obtain the color difference evaluation result of the unknown sample.
[0016] In existing research, the accuracy of using near-infrared chromatography to identify the color difference of cigarette packaging materials is low. The reason may be that the color difference of cigarette packaging materials is mainly determined by the composition of ink, but is also affected by the composition of paper, which makes the cigarette packaging materials have a complex near-infrared spectrum with many interference signals after scanning by near-infrared technology. The spectral preprocessing and modeling algorithms in existing research are insufficient in selecting and optimizing such complex near-infrared spectra with many interference signals, resulting in a low accuracy rate of color difference identification.
[0017] The inventor of the present invention has found through many studies that based on the modeling samples of cigarette packaging materials, the color difference of unknown samples of cigarette packaging materials can be identified by combining near-infrared technology, discrete wavelet transform preprocessing and random forest algorithm modeling, and the color difference of cigarette packaging materials can be accurately identified. The reason is that the near-infrared spectrum with many and complex interference signals of cigarette packaging materials is decomposed, denoised and reconstructed at different scales by discrete wavelet transform preprocessing, which can remove interference information for establishing the color difference model of cigarette packaging materials and provide a purer signal basis; on this basis, since the random forest algorithm has excellent classification performance, it can identify the characteristic information of different color differences in the reconstructed signal, thereby establishing a color difference recognition model with high accuracy. The method of the present invention can accurately identify the color difference of cigarette packaging materials, and the identification results are consistent with the visual results, with a high accuracy rate of 100%, and high practicality. Therefore, the method of the present invention can meet the color difference identification needs of actual products of cigarette packaging materials.
[0018] Preferably, the modeling sample in step S1 is a printed sample and / or a homemade sample.
[0019] It should be understood that the printed samples refer to cigarette packaging materials produced by suppliers and are commercially available.
[0020] More preferably, the printed samples are from the same supplier.
[0021] Further preferably, the printed samples come from the same supplier and belong to different seasons and production batches.
[0022] Preferably, the brightness L', red-green value a' and yellow-blue value b' of the modeling sample and the brightness L*, red-green value a* and yellow-blue value b* of the standard sample meet the following requirements: L'=(L*-5.0)~(L*+5.0), a'=(a*-5.0)~(a*+5.0), b'=(b*-5.0)~(b*+5.0).
[0023] The brightness L', red-green value a' and yellow-blue value b' of the modeled samples are distributed in a comprehensive range on the Lab color model, which is conducive to providing the accuracy of color difference identification.
[0024] Preferably, the number of the modeling samples in step S1 is 400 to 1000.
[0025] More preferably, the number of the modeling samples in step S2 is 600 to 900.
[0026] Preferably, the comparison method in step S2 is a three-point test method.
[0027] The three-point inspection method can maximize the accuracy of the color difference evaluation results of the modeling samples, which is beneficial to improve the accuracy of the color difference identification model established subsequently.
[0028] More preferably, the three-point inspection method is performed under D65 standard light source.
[0029] Preferably, in step S2, if there is a large color difference between the modeling sample and the standard sample by visual comparison, the modeling sample is evaluated as unqualified or has a significant color difference; otherwise, the modeling sample is evaluated as qualified.
[0030] More preferably, the modeling samples evaluated as qualified are further evaluated: if there is a small color difference between the modeling sample and the standard sample by visual comparison, the modeling sample is evaluated as having a slight color difference; if there is no color difference between the modeling sample and the standard sample by visual comparison, the modeling sample is evaluated as having no color difference.
[0031] Preferably, the spectrum acquisition range of the near infrared technology in step S3 is 4000-12000cm -1 .
[0032] Preferably, the resolution of the near infrared technology in step S3 is 8 cm -1 , the number of scans is 64 times.
[0033] Preferably, the scanning method of the scanning in step S3 is fixed scanning or rotation scanning.
[0034] More preferably, the fixed scanning method is to place the pure color part of the modeling sample on the scanning port for fixed scanning; the rotation scanning method is to place the patterned part of the modeling sample in the sample cup for rotation scanning.
[0035] Preferably, the wavelet basis function of the discrete wavelet transform method in step S4 is db1, db2 or db3, and the number of wavelet decomposition layers is 2, 3 or 4.
[0036] More preferably, the wavelet basis function of the discrete wavelet transform method in step S4 is db1, and the number of wavelet decomposition layers is 3.
[0037] Preferably, in step S6, a correspondence is established between part of the feature information obtained in S5 and the color difference evaluation result in S2 to construct an identification model for color difference of cigarette packaging materials; then the remaining feature information obtained in S5 is used as a test set, and a ten-fold cross-validation method is used to verify the accuracy of the identification model.
[0038] More preferably, in step S6, a correspondence is established between two-thirds of the feature information obtained in S5 and the color difference evaluation result in S2 to construct an identification model for color difference of cigarette packaging materials; then the remaining one-third of the feature information obtained in S5 is used as a test set, and a ten-fold cross-validation method is used to verify the accuracy of the identification model.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] The method of the present invention can accurately identify the color difference of cigarette packaging materials, and the identification result is consistent with the visual result, with a high accuracy rate of 100%, and high practicality. Therefore, the method of the present invention can meet the color difference identification needs of actual products of cigarette packaging materials. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is the original near-infrared spectrum obtained after the modeling sample of Material 1 in Example 1 was scanned by near-infrared spectrum.
[0042] Figure 2 This is the original near-infrared spectrum of the modeled sample of Material 2 in Example 2 obtained after near-infrared spectrum scanning.
[0043] Figure 3 This is the original near-infrared spectrum obtained after the modeling sample of Material 3 in Example 3 was scanned by near-infrared spectrum.
[0044] Figure 4This is the original near-infrared spectrum of the modeled sample of Material 4 in Example 4 obtained after near-infrared spectrum scanning.
[0045] Figure 5 This is the original near-infrared spectrum of the modeled sample of Material 5 in Example 5 obtained after near-infrared spectrum scanning.
[0046] Figure 6 This is the original near-infrared spectrum of the modeled sample of Material 6 in Example 6 obtained after near-infrared spectrum scanning.
[0047] Figure 7 This is the original near-infrared spectrum of the modeled sample of Material 7 in Example 7 obtained after near-infrared spectrum scanning.
[0048] Figure 8 It is a reconstructed spectrum obtained after the original near-infrared spectrum of the modeling sample of Material 1 in Example 1 is preprocessed by discrete wavelet transform.
[0049] Fig. 9 It is a reconstructed spectrum obtained after the original near-infrared spectrum of the modeling sample of Material 2 in Example 2 is preprocessed by discrete wavelet transform.
[0050] Fig.10 It is a reconstructed spectrum obtained after the original near-infrared spectrum of the modeling sample of Material 3 in Example 3 is preprocessed by discrete wavelet transform.
[0051] Fig.11 It is a reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of Material 4 in Example 4 with discrete wavelet transform.
[0052] Fig.12 It is a reconstructed spectrum obtained after the original near-infrared spectrum of the modeling sample of Material 5 in Example 5 is preprocessed by discrete wavelet transform.
[0053] Fig.13 It is a reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of Material 6 in Example 6 with discrete wavelet transform.
[0054] Fig.14 It is a reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of Material 7 in Example 7 with discrete wavelet transform.
[0055] Fig.15 These are the identification results of all samples in the test set of the modeling sample of Material 1 of Example 1.
[0056] Fig.16 This is the color difference-free sample identification result of the test set of the material 1 modeling sample of Example 1.
[0057] Fig.17This is the identification result of the subtle color difference samples of the test set of the material 1 modeling sample of Example 1.
[0058] Fig.18 This is the identification result of the obvious color difference samples of the test set of the material 1 modeling sample in Example 1.
[0059] Fig.19 This is the original near-infrared spectrum of the unknown sample of Material 1 in Example 1 obtained after near-infrared spectrum scanning.
[0060] Fig. 20 This is the original near-infrared spectrum of the unknown sample of Material 2 in Example 2 obtained after near-infrared spectrum scanning.
[0061] Fig.21 This is the original near-infrared spectrum of the unknown sample of Material 3 in Example 3 obtained after near-infrared spectrum scanning.
[0062] Fig. 22 This is the original near-infrared spectrum of the unknown sample of material 4 in Example 4 obtained after near-infrared spectrum scanning.
[0063] Fig.23 This is the original near-infrared spectrum of the unknown sample of material 5 in Example 5 obtained after near-infrared spectrum scanning.
[0064] Fig.24 This is the original near-infrared spectrum of the unknown sample of material 6 in Example 6 obtained after near-infrared spectrum scanning.
[0065] Fig.25 This is the original near-infrared spectrum of the unknown sample of material 7 in Example 7 obtained after near-infrared spectrum scanning.
[0066] Fig.26 It is a reconstructed spectrum obtained after the original near-infrared spectrum of the unknown sample of Material 1 in Example 1 is preprocessed by discrete wavelet transform.
[0067] Fig. 27 It is the reconstructed spectrum obtained after the original near-infrared spectrum of the unknown sample of Material 2 in Example 2 is preprocessed by discrete wavelet transform.
[0068] Fig.28 It is the reconstructed spectrum obtained after the original near-infrared spectrum of the unknown sample of material 3 in Example 3 was preprocessed by discrete wavelet transform.
[0069] Fig.29 It is the reconstructed spectrum obtained after the original near-infrared spectrum of the unknown sample of material 4 in Example 4 is preprocessed by discrete wavelet transform.
[0070] Fig.30It is the reconstructed spectrum obtained after the original near-infrared spectrum of the unknown sample of Material 5 in Example 5 is preprocessed by discrete wavelet transform.
[0071] Fig.31 It is the reconstructed spectrum obtained after the original near-infrared spectrum of the unknown sample of Material 6 in Example 6 is preprocessed by discrete wavelet transform.
[0072] Fig.32 It is the reconstructed spectrum obtained after the original near-infrared spectrum of the unknown sample of Material 7 in Example 7 was preprocessed by discrete wavelet transform.
[0073] Fig.33 It is a schematic diagram of the flow chart of the identification method of Example 1. DETAILED DESCRIPTION
[0074] The present invention is further described below in conjunction with the examples. These examples are only typical descriptions of the present invention, but the present invention is not limited thereto. The test methods used in the following examples are conventional methods unless otherwise specified, and the raw materials, reagents, etc. used are raw materials and reagents that can be obtained from conventional commercial sources such as commercial purchases unless otherwise specified.
[0075] Example 1
[0076] This embodiment uses a method for identifying color difference of cigarette packaging materials based on near-infrared technology and discrete wavelet transform-random forest algorithm to perform color difference identification on cigarette packaging material 1 (referred to as material 1). Material 1 is Double Happiness (Hard Classic) carton packaging paper, and its standard sample has a brightness value L1*=40.14, a red-green value a1*=60.45, and a yellow-blue value b1*=40.43.
[0077] 1. Collect and / or make modeling samples
[0078] The printed samples (491) and homemade samples (379) of material 1 were used as modeling samples, totaling 870. Among them, the printed samples came from the same supplier and belonged to different seasons and production batches. The brightness value L1', red-green value a1' and yellow-blue value b1' of the modeling samples met the following requirements: L1'=35-45, a1'=55-65, b1'=35-45.
[0079] 2. Visually evaluate the color difference of the modeled samples
[0080] Two cut standard samples and one cut modeling sample are randomly sorted and coded, and set as a group of visual samples. Each group of visual samples is put into a sealed bag, numbered and stored separately.
[0081] In the D65 standard light source mode of the multi-light source standard observation box, 7 experts were organized to conduct visual observation evaluation and voting for each group of visual samples using the three-point inspection method. The procedure of the three-point inspection method is: show the visual samples to the expert group members, and ask the expert group members to pick out 2 standard samples from the visual samples. If the number of correct answers is greater than or equal to 5, the null hypothesis is rejected at a significance level of 5% and the alternative hypothesis is accepted, that is, when there is a large color difference between the modeling sample and the standard sample, it is evaluated as unqualified or obvious color difference; otherwise, there is no color difference and it is judged to be qualified. Then, the modeling samples evaluated as qualified are compared with the standard samples in pairs, and the modeling samples are visually evaluated and voted for subtle color difference / obvious color difference. If there is a small color difference between the modeling sample and the standard sample, the modeling sample is evaluated as subtle color difference. If there is no color difference between the modeling sample and the standard sample, the modeling sample is evaluated as no color difference. The voting results are determined by the principle of minority obeys majority. After the above two rounds of voting, all samples are finally divided into three categories: no color difference, slight color difference and obvious color difference, or into two categories: qualified and unqualified.
[0082] 3. Near infrared scanning
[0083] 3.1 Instrument parameters
[0084] The near-infrared spectral scanning was performed using the MPA Fourier transform near-infrared spectrometer from BRUKER. The instrument parameters selected in this method are: the spectral acquisition range is 4000-12000cm -1 , resolution 8cm -1 , the number of scans is 64 times.
[0085] 3.2 Scanning Method
[0086] Place the printed surface of the cut modeling sample downward on the scanning port of the near-infrared spectrometer, press the sample presser to make the printed surface of the sample close to the scanning port, and perform fixed scanning on each sample. According to the classification of no color difference, slight color difference and obvious color difference, or according to the classification of qualified and unqualified, the near-infrared spectrum information, that is, the original near-infrared spectrum, is obtained.
[0087] 4. Infrared spectrum information preprocessing
[0088] The Daubechies wavelet system (wavelet basis function db1, wavelet decomposition level 3) is used to preprocess the near-infrared spectral information to obtain the reconstructed spectral information, namely the reconstructed spectrum graph.
[0089] 5. Random Forest Modeling
[0090] 2 / 3 of the reconstructed spectral information was divided into a training set and 1 / 3 as a test set. The random forest algorithm was used to identify the color difference characteristics of the packaging material from the reconstructed spectral information. Based on the training set, a color difference identification model for material 1 was constructed. Matlab 2015 and Microsoft Excel 2007 were used for data processing and statistical analysis. At the same time, the identification accuracy of the identification model was also examined by the ten-fold cross-validation method.
[0091] 6. Identification
[0092] Take one unknown sample of material 1 (the visual color difference evaluation result is no color difference), obtain its original near-infrared spectrum through near-infrared spectral scanning, and use the Daubechies wavelet system (wavelet basis function db1, wavelet decomposition level 3) to preprocess the near-infrared spectral information to obtain reconstructed spectral information, and then use the random forest algorithm to identify feature information from the reconstructed spectral information. Finally, the obtained feature information is compared with the color difference identification model of material 1, and it is concluded that the color difference evaluation result of the unknown sample of material 1 is no color difference.
[0093] Figure 1 This is the original near-infrared spectrum of the modeling sample of material 1 obtained after near-infrared spectrum scanning, and its spectrum data are shown in Table 1.
[0094] Figure 8 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of material 1 with discrete wavelet transform.
[0095] Fig.19 It is the original near-infrared spectrum obtained after the unknown sample of material 1 is scanned by near-infrared spectrum.
[0096] Fig.26 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the unknown sample of material 1 with discrete wavelet transform.
[0097] Fig.33 It is a flowchart of the identification method of this embodiment.
[0098] Example 2
[0099] This embodiment uses a method for identifying color difference of cigarette packaging materials based on near-infrared technology and discrete wavelet transform-random forest algorithm to perform color difference identification on cigarette packaging material 2 (referred to as material 2). Material 2 is Double Happiness (Spring Slim) carton packaging paper, and its standard sample has a brightness value of L2*, a red-green value of a2*, and a yellow-blue value of b2*.
[0100] 1. Collect and / or make modeling samples
[0101] The printed samples (498) and self-made samples (342) of material 2 were used as modeling samples, totaling 840. Among them, the printed samples came from the same supplier and belonged to different seasons and production batches. The brightness value L2', red-green value a2' and yellow-blue value b2' of the modeling samples met the following requirements: L2'=(L2*-5.0)~(L2*+5.0), a2'=(a2*-5.0)~(a2*+5.0), b2'=(b2*-5.0)~(b2*+5.0).
[0102] 2-4. Carry out the same process as steps 2-4 of Example 1.
[0103] 5. Random Forest Modeling
[0104] 2 / 3 of the reconstructed spectral information was divided into a training set and 1 / 3 as a test set. The random forest algorithm was used to identify the color difference characteristics of the packaging material from the reconstructed spectral information. Based on the training set, the color difference identification model of material 2 was constructed. Matlab 2015 and Microsoft Excel 2007 were used for data processing and statistical analysis. At the same time, the identification accuracy of the identification model was also examined by the ten-fold cross-validation method.
[0105] 6. Identification
[0106] Take one unknown sample of material 2 (visual result is obvious color difference), obtain its original near-infrared spectrum by near-infrared spectrum scanning, and use Daubechies wavelet system (wavelet basis function db1, wavelet decomposition level 3) to preprocess the near-infrared spectrum information to obtain reconstructed spectrum information. Then, the random forest algorithm is used to identify feature information from the reconstructed spectrum information. Finally, the obtained feature information is compared with the color difference identification model of material 2, and the color difference evaluation result of the unknown sample of material 2 is obtained as obvious color difference.
[0107] Figure 2 This is the original near-infrared spectrum of the modeling sample of material 2 obtained after near-infrared spectrum scanning, and its spectrum data are shown in Table 1.
[0108] Fig. 9 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of material 2 with discrete wavelet transform.
[0109] Fig. 20 This is the original near-infrared spectrum of the unknown sample of material 2 obtained after near-infrared spectrum scanning.
[0110] Fig. 27 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the unknown sample of material 2 with discrete wavelet transform.
[0111] Example 3
[0112] This embodiment uses a method for identifying color difference of cigarette packaging materials based on near-infrared technology and discrete wavelet transform-random forest algorithm to perform color difference identification on cigarette packaging material 3 (referred to as material 3). Material 3 is Double Happiness (Soft Classic 1906) carton packaging paper, and its standard sample has a brightness value of L3*, a red-green value of a3*, and a yellow-blue value of b3*.
[0113] 1. Collect and / or make modeling samples
[0114] The printed samples (334) and homemade samples (336) of material 3 were used as modeling samples, totaling 670. Among them, the printed samples came from the same supplier and belonged to different seasons and production batches. The brightness value L3', red-green value a3' and yellow-blue value b3' of the modeling samples met the following requirements: L3'=(L3*-5.0)~(L3*+5.0), a3'=(a3*-5.0)~(a3*+5.0), b3'=(b3*-5.0)~(b3*+5.0).
[0115] 2-4. Carry out the same process as steps 2-4 of Example 1.
[0116] 5. Random Forest Modeling
[0117] 2 / 3 of the reconstructed spectral information was divided into a training set and 1 / 3 as a test set. The random forest algorithm was used to identify the color difference characteristics of packaging materials from the reconstructed spectral information. Based on the training set, a color difference identification model for material 3 was constructed. Matlab 2015 and Microsoft Excel 2007 were used for data processing and statistical analysis. At the same time, the identification accuracy of the identification model was also examined by the ten-fold cross-validation method.
[0118] 6. Identification
[0119] Take one unknown sample of material 3 (the visual color difference evaluation result is no color difference), obtain its original near-infrared spectrum through near-infrared spectral scanning, and use the Daubechies wavelet system (wavelet basis function db1, wavelet decomposition level 3) to preprocess the near-infrared spectral information to obtain reconstructed spectral information, and then use the random forest algorithm to identify feature information from the reconstructed spectral information. Finally, the obtained feature information is compared with the color difference identification model of material 3, and it is concluded that the color difference evaluation result of the unknown sample of material 3 is no color difference.
[0120] Figure 3 This is the original near-infrared spectrum of the modeling sample of material 3 obtained after near-infrared spectrum scanning, and its spectrum data are shown in Table 1.
[0121] Fig.10It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of material 3 with discrete wavelet transform.
[0122] Fig.21 This is the original near-infrared spectrum of the unknown sample of material 3 obtained after near-infrared spectrum scanning.
[0123] Fig.28 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the unknown sample of material 3 with discrete wavelet transform.
[0124] Example 4
[0125] This embodiment uses a method for identifying color difference of cigarette packaging materials based on near-infrared technology and discrete wavelet transform-random forest algorithm to perform color difference identification on cigarette packaging material 4 (referred to as material 4). Material 4 is Double Happiness (Hongyouxi) carton packaging paper, and its standard sample has a brightness value of L4*, a red-green value of a4*, and a yellow-blue value of b4*.
[0126] 1. Collect and / or make modeling samples
[0127] The printed samples (627) and self-made samples (223) of material 4 were used as modeling samples, totaling 850. Among them, the printed samples came from the same supplier and belonged to different seasons and production batches. The brightness value L4', red-green value a4' and yellow-blue value b4' of the modeling samples met the following requirements: L4'=(L4*-5.0)~(L4*+5.0), a4'=(a4*-5.0)~(a4*+5.0), b4'=(b4*-5.0)~(b4*+5.0).
[0128] 2-4. Carry out the same process as steps 2-4 of Example 1.
[0129] 5. Random Forest Modeling
[0130] 2 / 3 of the reconstructed spectral information was divided into a training set and 1 / 3 as a test set. The random forest algorithm was used to identify the color difference characteristics of the packaging materials from the reconstructed spectral information. Based on the training set, a color difference identification model for material 4 was constructed. Matlab 2015 and Microsoft Excel 2007 were used for data processing and statistical analysis. At the same time, the identification accuracy of the identification model was also examined by the ten-fold cross-validation method.
[0131] 6. Identification
[0132] Take one unknown sample of material 4 (the visual color difference evaluation result is no color difference), obtain its original near-infrared spectrum through near-infrared spectral scanning, and use the Daubechies wavelet system (wavelet basis function db1, wavelet decomposition level 3) to preprocess the near-infrared spectral information to obtain reconstructed spectral information, and then use the random forest algorithm to identify feature information from the reconstructed spectral information. Finally, the obtained feature information is compared with the color difference identification model of material 4, and it is concluded that the color difference evaluation result of the unknown sample of material 4 is no color difference.
[0133] Figure 4 This is the original near-infrared spectrum of the modeling sample of material 4 obtained after near-infrared spectrum scanning, and its spectrum data are shown in Table 1.
[0134] Fig.11 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of material 4 with discrete wavelet transform.
[0135] Fig. 22 This is the original near-infrared spectrum of the unknown sample of material 4 obtained after near-infrared spectrum scanning.
[0136] Fig.29 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the unknown sample of material 4 with discrete wavelet transform.
[0137] Example 5
[0138] This embodiment uses a method for identifying color difference of cigarette packaging materials based on near infrared technology and discrete wavelet transform-random forest algorithm to identify the color difference of cigarette packaging material 5 (referred to as material 5). Material 5 is Double Happiness (01) tipping paper, and its standard sample has a brightness value of L5*, a red-green value of a5*, and a yellow-blue value of b5*.
[0139] 1. Collect and / or make modeling samples
[0140] The printed samples (411) and homemade samples (379) of material 5 were used as modeling samples, totaling 790. Among them, the printed samples came from the same supplier and belonged to different seasons and production batches. The brightness value L5', red-green value a5' and yellow-blue value b5' of the modeling samples met the following requirements: L5' = (L5*-5.0) ~ (L5*+5.0), a5' = (a5*-5.0) ~ (a5*+5.0), b5' = (b5*-5.0) ~ (b5*+5.0).
[0141] 2-4. Carry out the same process as steps 2-4 of Example 1.
[0142] 5. Random Forest Modeling
[0143] 2 / 3 of the reconstructed spectral information was divided into a training set and 1 / 3 as a test set. The random forest algorithm was used to identify the color difference characteristics of packaging materials from the reconstructed spectral information. Based on the training set, a color difference identification model for material 5 was constructed. Matlab 2015 and Microsoft Excel 2007 were used for data processing and statistical analysis. At the same time, the identification accuracy of the identification model was also examined by the ten-fold cross-validation method.
[0144] 6. Identification
[0145] Take one unknown sample of material 5 (the visual color difference evaluation result is no color difference), obtain its original near-infrared spectrum through near-infrared spectral scanning, and use the Daubechies wavelet system (wavelet basis function db1, wavelet decomposition level 3) to preprocess the near-infrared spectral information to obtain reconstructed spectral information, and then use the random forest algorithm to identify feature information from the reconstructed spectral information. Finally, the obtained feature information is compared with the color difference identification model of material 5, and it is concluded that the color difference evaluation result of the unknown sample of material 5 is no color difference.
[0146] Figure 5 This is the original near-infrared spectrum of the modeling sample of material 5 obtained after near-infrared spectrum scanning, and its spectrum data are shown in Table 1.
[0147] Fig.12 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of material 5 with discrete wavelet transform.
[0148] Fig.23 This is the original near-infrared spectrum of the unknown sample of material 5 obtained after near-infrared spectrum scanning.
[0149] Fig.30 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the unknown sample of material 5 with discrete wavelet transform.
[0150] Example 6
[0151] This embodiment uses a method for identifying color difference of cigarette packaging materials based on near-infrared technology and discrete wavelet transform-random forest algorithm to identify the color difference of cigarette packaging material 6 (referred to as material 6). Material 6 is Double Happiness (Lianxiang) tipping paper, and its standard sample has a brightness value of L6*, a red-green value of a6*, and a yellow-blue value of b6*.
[0152] 1. Collect and / or make modeling samples
[0153] The printed samples (518) and self-made samples (222) of material 6 were used as modeling samples, totaling 740. Among them, the printed samples came from the same supplier and belonged to different seasons and production batches. The brightness value L6', red-green value a6' and yellow-blue value b6' of the modeling samples met the following requirements: L6' = (L6*-5.0) ~ (L6*+5.0), a6' = (a6*-5.0) ~ (a6*+5.0), b6' = (b6*-5.0) ~ (b6*+5.0).
[0154] 2-4. Carry out the same process as steps 2-4 of Example 1.
[0155] 5. Random Forest Modeling
[0156] 2 / 3 of the reconstructed spectral information was divided into a training set and 1 / 3 as a test set. The random forest algorithm was used to identify the color difference characteristics of packaging materials from the reconstructed spectral information. Based on the training set, a color difference identification model for material 6 was constructed. Matlab 2015 and Microsoft Excel 2007 were used for data processing and statistical analysis. At the same time, the identification accuracy of the identification model was also examined by the ten-fold cross-validation method.
[0157] 6. Identification
[0158] Take one unknown sample of material 6 (the visual color difference evaluation result is no color difference), obtain its original near-infrared spectrum through near-infrared spectral scanning, and use the Daubechies wavelet system (wavelet basis function db1, wavelet decomposition level 3) to preprocess the near-infrared spectral information to obtain reconstructed spectral information, and then use the random forest algorithm to identify feature information from the reconstructed spectral information. Finally, the obtained feature information is compared with the color difference identification model of material 6, and it is concluded that the color difference evaluation result of the unknown sample of material 6 is no color difference.
[0159] Figure 6 This is the original near-infrared spectrum of the modeling sample of material 6 obtained after near-infrared spectrum scanning, and its spectrum data are shown in Table 1.
[0160] Fig.13 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of material 6 with discrete wavelet transform.
[0161] Fig.24 This is the original near-infrared spectrum of the unknown sample of material 6 obtained after near-infrared spectrum scanning.
[0162] Fig.31 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the unknown sample of material 6 with discrete wavelet transform.
[0163] Example 7
[0164] This embodiment uses a method for identifying color difference of cigarette packaging materials based on near-infrared technology and discrete wavelet transform-random forest algorithm to identify the color difference of cigarette packaging material 7 (referred to as material 7). Material 7 is Double Happiness (Shengshi) tipping paper, and its standard sample has a brightness value of L7*, a red-green value of a7*, and a yellow-blue value of b7*.
[0165] 1. Collect and / or make modeling samples
[0166] The printed samples (496) and homemade samples (334) of material 7 were used as modeling samples, totaling 830. Among them, the printed samples came from the same supplier and belonged to different seasons and production batches. The brightness value L7', red-green value a7' and yellow-blue value b7' of the modeling samples met the following requirements: L7' = (L7*-5.0) ~ (L7*+5.0), a7' = (a7*-5.0) ~ (a7*+5.0), b7' = (b7*-5.0) ~ (b7*+5.0).
[0167] 2-4. Carry out the same process as steps 2-4 of Example 1.
[0168] 5. Random Forest Modeling
[0169] 2 / 3 of the reconstructed spectral information was divided into a training set and 1 / 3 as a test set. The random forest algorithm was used to identify the color difference characteristics of packaging materials from the reconstructed spectral information. Based on the training set, a color difference identification model for material 7 was constructed. Matlab 2015 and Microsoft Excel 2007 were used for data processing and statistical analysis. At the same time, the identification accuracy of the identification model was also examined by the ten-fold cross-validation method.
[0170] 6. Identification
[0171] Take one unknown sample of material 7 (the visual color difference evaluation result is slight color difference), obtain its original near-infrared spectrum by near-infrared spectral scanning, and use Daubechies wavelet system (wavelet basis function db1, wavelet decomposition level 3) to preprocess the near-infrared spectral information to obtain reconstructed spectral information, and then use random forest algorithm to identify feature information from the reconstructed spectral information. Finally, compare the obtained feature information with the color difference identification model of material 7, and conclude that the color difference evaluation result of the unknown sample of material 7 is slight color difference.
[0172] Figure 7 This is the original near-infrared spectrum of the modeling sample of material 7 obtained after near-infrared spectrum scanning, and its spectrum data are shown in Table 1.
[0173] Fig.14It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the modeling sample of material 7 with discrete wavelet transform.
[0174] Fig.25 This is the original near-infrared spectrum of the unknown sample of material 7 obtained after near-infrared spectrum scanning.
[0175] Fig.32 It is the reconstructed spectrum obtained by preprocessing the original near-infrared spectrum of the unknown sample of material 7 with discrete wavelet transform.
[0176] Table 1 Classification and spectrum number information of materials 1 to 7 cigarette packaging materials (unit: piece)
[0177] Material No. No color difference Slight color difference Obvious color difference total 1 302 257 311 870 2 280 250 310 840 3 220 240 210 670 4 270 290 290 850 5 261 249 280 790 6 230 240 270 740 7 271 229 330 830
[0178] Example 8 Analysis and Optimization of Conditions
[0179] 1. Preprocessing optimization and model building of near infrared spectra
[0180] Scanning cigarette packaging materials with a near-infrared spectrometer can obtain the original near-infrared spectrum containing various information. Figure 1 to Figure 7 It can be seen that the original near-infrared spectrum absorption peaks overlap seriously. The original near-infrared spectrum of a multi-component complex sample is not the superposition of the individual spectra of each component. The difference in color difference cannot be intuitively identified from the spectrum alone. Therefore, chemometrics is needed to extract effective information from complex spectra. In addition, due to the difference in spectral absorption of different cigarette packaging materials, especially for samples with beam laser, the transfer paper layer has a greater impact on the optical path of the detection. The spectral absorption peak obtained by scanning is very different from that of non-beam laser samples. Therefore, color difference identification models for different brands should be established separately.
[0181] There are many classical spectral preprocessing methods, such as derivative, standard normal variate transform (SNV), multiple scattering correction (MSC), etc. The inventor tried to use the above classical spectral preprocessing methods to denoise and establish a model, and found that the identification effect of the model was not ideal. After many attempts, the data preprocessing method finally adopted was discrete wavelet transformation (DWT). Discrete wavelet transform is an efficient signal processing method, which is essentially to decompose the signal into wavelets of different scales and displacements, and has the multi-resolution analysis characteristics that Fourier does not exist. This method is often used in chemometrics for calculations such as smoothing denoising, data compression and baseline subtraction. Discrete wavelet transform is used to decompose near-infrared spectral data in the frequency domain at multiple scales to obtain corresponding low-frequency wavelet coefficients and high-frequency wavelet coefficients. Among them, the low-frequency wavelet coefficients mainly show the approximate components of the signal, and the high-frequency coefficients are mainly displayed as detail components and most of the noise components. By decomposing, denoising and reconstructing signals at different scales, interference information can be removed to establish a color difference model for cigarette packaging materials, providing a purer signal basis.
[0182] Discrete wavelet transform has many wavelet bases to choose from. The same signal will have different decomposition effects when displayed on different wavelet bases. Commonly used wavelet basis functions include Daubechies, Symlets, Coiflets and Biorthogonal. Among them, the Daubechies wavelet basis function is referred to as dbN. It has good regularity. With the increase of wavelet decomposition level, the vanishing moment of the wavelet function increases, the wavelet becomes smoother, the tight support in the time domain decreases, and the locality in the frequency domain increases.
[0183] Random forest (RF) is a classification algorithm proposed by Leo Breiman in 2001 that combines decision trees with Bootstrap resampling methods. It uses the Bagging method to generate differentiated training sets and introduces random selection attributes on this basis. This "double random" strategy allows for greater differences between sub-classifiers, giving it superior classification performance. The RF algorithm is used to identify feature information of different color differences from wavelet coefficients and establish a color difference recognition model. There are two parameters that need to be optimized in RF classifier training, namely the number of decision trees in the forest (ntree) and the number of decision tree node trees (mtry), where ntree is 500 and mtry is the square root of the total number of variables.
[0184] This embodiment uses different Daubechies wavelet basis functions (db1, db2, db3, ..., db6) and wavelet decomposition layers (1 to 6) to process the original near-infrared spectrum to obtain different wavelet coefficients to reconstruct spectral information ( Figure 8 to Figure 14 ). 2 / 3 of the spectral information reconstructed by wavelet coefficients was divided into training set and 1 / 3 as test set. RF was used to identify the difference feature information from the spectral information reconstructed by different wavelet coefficients. A color difference identification model for cigarette packaging materials was constructed based on the training set. The classification accuracy of the training set and the test set under different spectral preprocessing conditions was investigated by the ten-fold cross validation method.
[0185] Table 2 Color difference identification results of training set of materials 1 to 7 cigarette packaging materials
[0186]
[0187]
[0188] *Since material 3 is a beam laser sample, the transfer layer will have a certain impact on the optical path during near-infrared scanning, so the accuracy will decrease to a certain extent.
[0189] Table 3 Color difference identification results of the test set of materials 1 to 7 cigarette packaging materials
[0190]
[0191] This embodiment reconstructs spectral information based on wavelet coefficients obtained from different wavelet basis functions and decomposition layers and uses the random forest method for training. Table 2 shows the color difference identification results of the training set of cigarette packaging materials of materials 1 to 7, and Table 3 shows the color difference identification results of the test set of cigarette packaging materials of materials 1 to 7. Take material 1 as an example for specific explanation. It can be seen from Tables 2 and 3 that the identification accuracy of the training set of the color difference identification model of material 1 is 100%, while the identification accuracy of the test set is different. Therefore, this embodiment selects a better spectral preprocessing method through the identification results of the test set. Fig.15 is the identification result of all samples in the test set of the modeling sample of material 1 of Example 1; Fig.16 is the identification result of the test set of the material 1 modeling sample without color difference in Example 1; Fig.17 is the identification result of the slight color difference samples of the test set of the modeling sample of Material 1 of Example 1; Fig.18 This is the identification result of the obvious color difference samples of the test set of the modeling sample of Material 1 in Example 1. Figure 15 to Figure 18It can be seen that when the wavelet basis function is db1 and the number of decomposition layers is 3, the model has the highest accuracy rate for all samples in the test set, reaching 93.10%, which is much higher than the accuracy rate (82.97%) obtained by directly modeling the original spectrum. The combination of wavelet basis function db1 and decomposition layer 3 has the following accuracy rates for material 1 with different degrees of color difference: 93.32% for no color difference, 83.05% for slight color difference, and 100% for obvious color difference, which is significantly better than the identification results of other wavelet coefficients. Among them, all samples with obvious color difference were correctly identified, and a few misjudgments occurred in the identification of samples with no color difference and slight color difference, which has good practicality.
[0192] This embodiment uses the same method to perform spectral preprocessing and model establishment on materials 2 to 7. After comparison, it is found that the better wavelet basis function is db1, and the better wavelet decomposition layer number is 3. This parameter combination may have better versatility for identifying non-cigarette packaging materials. As shown in Table 2, for the training set, the overall color difference identification accuracy of several cigarette packaging materials except material 3 is 100%, and all three types of samples, no color difference, slight color difference and obvious color difference, are correctly identified. The overall color difference identification accuracy of the material 3 training set can also reach 94.93%, which is a relatively high level. Among them, the identification accuracy of the no color difference sample is 96.77%, the identification accuracy of the slight color difference sample is 88.30%, and the identification accuracy of the obvious color difference sample is 100%. As shown in Table 3, for the test set, the overall color difference identification accuracy of several cigarette packaging materials except material 3 reaches more than 90%. Among them, the best classification effect is material 4, whose overall identification accuracy is 99.06%, the identification accuracy of samples without color difference is 98.55%, the identification accuracy of samples with slight color difference is 98.71%, and the identification accuracy of samples with obvious color difference is 100%. The overall identification accuracy of material 3 is 89.54%, which is also very close to 90%, among which the identification accuracy of samples without color difference is 92.30%, the identification accuracy of samples with slight color difference is 76.49%, and the identification accuracy of samples with obvious color difference is 100%.
[0193] From the above analysis, we can summarize:
[0194] (1) The DWT-RF near-infrared model established by the present invention can well identify samples with obvious color difference (i.e., unqualified). In the test, 100% of the samples with obvious color difference in all different brands and types of cigarette material samples can be correctly identified. Not missing unqualified samples is more important in practical applications, and the model established by the present invention can meet this requirement.
[0195] (2) A small number of misjudgments generally exist between samples with no color difference and samples with slight color difference, which may be due to the small difference between the two types of samples within the critical range.
[0196] (3) Although the transfer layer of the beam laser sample will have a certain impact on the optical path during near-infrared scanning, and its spectrum is also quite different from that of the non-beam laser sample, after extracting effective information from the complex spectrum through chemometrics, the final near-infrared model can still better identify the color difference information in the sample, and the color difference evaluation results are also relatively satisfactory.
[0197] Therefore, the present invention finally determines to use the optimized discrete wavelet transform (wavelet basis function db1, wavelet decomposition layer number 3) as the spectrum preprocessing method.
[0198] 2. Modeling sample classification and the impact of samples from different suppliers
[0199] In actual product inspection, it is ultimately necessary to distinguish samples as qualified or unqualified based on the degree of color difference of the cigarette packaging materials. Therefore, in the present invention, the inventors divide the modeling samples into qualified products and unqualified products according to the color difference degree classification in the previous text for modeling and comparison. Among them, qualified products = samples with no color difference + samples with slight color difference, and unqualified products = samples with obvious color difference. In Tables 4 and 5, "two categories" refers to the model built by dividing all samples into the two categories of "qualified / unqualified", and "three categories" refers to the model built by dividing all samples into the three categories of "no color difference / slight color difference / detailed color difference". In addition, the cigarette packaging materials collected by the present invention are provided by two printing suppliers. In view of the fact that the inks and paper-based components used by the two suppliers may be different, which may have a certain impact on the model, the study attempts to establish a mixed model based on the spectra of the samples provided by the two suppliers, and to establish a separate model based on the spectra of the samples provided by the same supplier, and compare the identification effects.
[0200] Table 4 Comparison of color difference identification results of different classification models training sets
[0201]
[0202] Table 5 Comparison of color difference identification results of different classification models test set
[0203]
[0204] Table 4 shows the color difference identification results of the training set of different classification models, and Table 5 shows the color difference identification results of the test set of different classification models. From Tables 4 and 5, we can see that:
[0205] (1) The model for distinguishing the two categories of "qualified / unqualified" has a higher identification accuracy than the model for distinguishing the three categories of "no color difference / slight color difference / detailed color difference". From the identification results of the training set, it can be seen that the identification accuracy of the "two-category" classification model for all modeled samples is 100%. When Material 3 is divided into "three categories" and the two suppliers' mixed model is used, the overall identification accuracy is 94.93%, but if the two categories of "no color difference / slight color difference" samples are combined into the "qualified" sample category, the identification accuracy of the constructed model can reach 100%. The same rule can be seen from the identification results of the test set. By comparing the "three categories" and "two categories" models in the two suppliers' mixed model and the single model of the same supplier, it can be found that the identification accuracy of the "two categories" is almost higher than the identification accuracy of the "three categories", which also reflects the experimental result in the previous article that "misjudgment generally exists between samples without color difference and samples with slight color difference". Since "misjudgment generally exists between samples with no color difference and samples with slight color difference", in practical applications, it can be classified into "qualified / unqualified" or "no color difference / slight color difference / detailed color difference", both of which can meet the requirements of product inspection.
[0206] (2) The color difference identification accuracy of the single model of the same supplier is higher than that of the mixed model of two suppliers. From the identification results of the training set, it can be seen that whether it is divided into "two categories" or "three categories", the identification accuracy of the "single model of the same supplier" for all modeling samples is 100%, while when material 3 is divided into "three categories" and the mixed model of two suppliers is used, the overall identification accuracy is 94.93%. In the identification results of the test set, the "mixed model of two suppliers" and the "single model of the same supplier" of the same "three categories" and "two categories" are compared respectively. It can be found that the identification accuracy of the "single model of the same supplier" is higher than that of the "mixed model of two suppliers". This shows that although the final visual effect of printing is similar, there should be some differences in the raw materials and printing processes used by different suppliers, and these differences will have a certain impact on the establishment of the model. Therefore, in practical applications, in order to ensure the accuracy of color difference identification, even for the same brand and type of cigarette packaging materials, it is still advisable to establish models based on different suppliers.
[0207] 3. Selection of detection area and sample scanning method
[0208] This embodiment selects two detection areas and compares two sample scanning methods: the first is to directly cut the pure color part of the sample into a size slightly larger than the near-infrared spectrum detection port and place it on the scanning port of the near-infrared spectrometer for fixed scanning, and the second is to cut a larger sample range containing a pattern into a circle with a certain size and place it in a sample cup for rotational scanning. This embodiment selects material 1 for a scanning method comparison test. The test samples come from the same supplier. Using the DWT-RF model, the color difference identified by the model is classified into two categories: qualified / unqualified.
[0209] Table 6 Color difference identification training results of different scanning methods
[0210]
[0211] Table 6 shows the color difference identification training results of material 1 under two different scanning methods. It can be seen from Table 6 that when the first scanning method is used, the identification accuracy of the training set is 100%, and the identification accuracy of the test set is 99.18%, while when the second scanning method is used, the identification accuracy of the training set is 95.21%, and the identification accuracy of the test set is 93.76%. Whether it is the training set or the test set, the identification accuracy of the first scanning method is obviously higher than that of the second scanning method. The prediction effect of the second scanning method is poor, which may be because the bottom area of the sample cup is large, and the circular area cut and scanned not only includes the background color that needs to be identified for color difference, but also inevitably includes a large number of words and patterns on the packaging. Since the words and patterns on the cigarette packaging samples are printed with inks different from the background color, this means that the chemical composition contained therein is also complex, so the spectral information obtained by scanning is interfered to a certain extent. Therefore, in terms of actual effect, it is better to use the first scanning method to identify the same color difference of packaging materials, that is, directly cut into custom specifications and place them on the scanning port of the near-infrared spectrometer for fixed scanning.
[0212] Example 9 Methodology Verification
[0213] In order to examine the effectiveness of the color difference identification model for cigarette packaging materials, 20 samples from a supplier were selected from actual production as an external prediction set for verification. The models used were the "three-category" model and the "two-category" model for the same supplier, and the results were compared using both the visual method and the colorimeter method. The following is a specific explanation using Material 1 as an example.
[0214] Table 7 Comparison of external prediction set results of Material 1
[0215]
[0216]
[0217] It can be seen from Table 7 that, whether it is the “three-class” or “two-class” model, the prediction results of the near-infrared method for the external prediction set are consistent with the visual results, with an accuracy rate of 100%.
[0218] Comparison of Example 1 with other color difference identification models
[0219] In order to fully test the accuracy of the color difference identification model of the present invention, this comparative example compares it with the identification models established by six algorithm methods: KNN, SVM, ELM, PLS, PLS-DA and PCA. Material 1 is selected as an example below. The test samples come from the same supplier, and the spectral preprocessing uses the optimized DWT. The color difference identified by the model is classified into two categories: qualified / unqualified.
[0220] K-nearest neighbor (KNN) is a classic lazy classification algorithm. It uses a passive method of testing and training to establish a classification model. It uses the pattern recognition assumption that similar samples are close to each other in the pattern space as the classification basis. It has been widely used in pattern recognition, computer vision, coding theory, and text classification. In this comparative example, the KNN algorithm color difference identification model was established for material 1 according to the method in the literature (Bin Jun et al., Automatic classification of flue-cured tobacco leaves based on NIR technology and ELM, Chinese Journal of Tobacco Science).
[0221] Support vector machine (SVM) is a multivariate technology of machine learning. It maps the input vector to a high-dimensional feature space through a selected kernel function and constructs an optimal hyperplane in the space to achieve the purpose of classification. The SVM model has good generalization performance and can avoid the selection of a neural network structure, but the SVM method requires dimensionality reduction of samples, complex pre-processing, and empirical optimization parameters. This comparative example establishes an SVM algorithm color difference identification model for material 1 according to the method in the literature (Bin Jun et al., Automatic classification of flue-cured tobacco leaves based on NIR technology and ELM, Chinese Journal of Tobacco Science).
[0222] ELM is a new type of single hidden layer feedforward neural network (SLFNs) learning algorithm proposed by Singaporean scholar Huang Guang-bin in 2004. During the execution of the algorithm, the input weights of the network and the bias of the hidden layer neurons are automatically adjusted. The learning speed is fast, the generalization performance is good, and the optimal solution can be obtained. In the case where the activation function is infinitely differentiable and the input weights and hidden layer bias are set based on the law of random numbers and the law of large numbers, the parameters of the ELM neural network do not need to be iteratively adjusted, and the output weights of the network can be calculated in one step. The algorithm structure is simple and the calculation rate is fast. Moreover, in most applications, the generalization ability of ELM is better than that of the gradient-based algorithm. At the same time, ELM directly constructs a single hidden layer feedback neural network, which can avoid the thorny problems such as local minimum, appropriate learning rate, overfitting, etc. that need to be solved by traditional gradient-based algorithms. This comparative example establishes an ELM algorithm color difference identification model for material 1 according to the method in the literature (Bin Jun et al., Automatic classification of flue-cured tobacco leaves based on NIR technology and ELM, Chinese Tobacco Journal).
[0223] According to the method in the literature (Guan Liming et al., Application of near-infrared spectroscopy in color detection of printed materials, Journal of Central South University (Natural Science Edition)), a PLS algorithm color difference identification model was established for material 1; according to the method in the literature (Li Chao et al., Analysis of visible light color difference of cigarette packaging paper by near-infrared molecular spectroscopy, Paper and Papermaking), a PLS-DA algorithm color difference identification model was established for material 1; according to the method in the literature (Zhang Yipeng et al., Color difference analysis of cigarette packaging materials based on near-infrared spectroscopy, Tobacco Science and Technology), a PCA+Hotelling T 2 Algorithmic color difference discrimination model.
[0224] Table 8 Color difference identification training results of models built by different algorithms
[0225]
[0226] Table 8 shows the color difference identification training results of material 1 using different identification models. From Table 8, it can be seen that among several algorithms, the identification effect of color difference of cigarette packaging materials is RF>ELM>SVM>KNN>PLS>PCA+Hotelling T 2 >PLS-DA. The RF algorithm has excellent performance on both the training set and the test set. The identification effect of the ELM algorithm is close to that of RF. The KNN algorithm has poor interpretability when classifying samples and cannot give rules like decision trees. The color difference identification effect is also worse than that of RF, SVM and ELM. The most commonly used PLS, PLS-DA and PCA+Hotelling T 2 The identification accuracy of the algorithms is less than 85%, which cannot meet actual needs.
[0227] As can be seen from the above, the present invention uses a near-infrared spectrometer to perform a spectral scan on cigarette packaging materials and establishes an optimized DWT-RF model. For 7 representative samples, the same supplier model for identifying the two categories of "qualified / unqualified" has a 100% identification accuracy for the training set and a 97.35% to 100% identification accuracy for the test set; the same supplier model for identifying the three categories of "no color difference / slight color difference / obvious color difference" has a 100% identification accuracy for the training set and a 94.83% to 100% identification accuracy for the test set. For the external prediction set, the model can also accurately identify the color difference of the sample, and the identification result is consistent with the visual result. Overall, the near-infrared method and DWT-RF model of the present invention have a high identification accuracy for the color difference of cigarette packaging materials, which can meet the color difference identification of actual products of cigarette packaging materials.
[0228] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. A method for identifying color difference of cigarette packaging materials based on near infrared technology and discrete wavelet transform-random forest algorithm, characterized in that: The steps include: S1: Cigarette packaging materials were used as modeling samples; S2: visually compare the color difference between the standard sample and the modeling sample to obtain the color difference evaluation result of the modeling sample for later use; S3: Use near-infrared technology to perform spectral scanning on the modeling sample to obtain original near-infrared spectral information; S4: Preprocessing the original near-infrared spectrum information using discrete wavelet transform method to obtain reconstructed spectrum information; S5: using random forest algorithm to identify feature information from the reconstructed spectral information, for later use; S6: establishing a corresponding relationship between the characteristic information obtained in S5 and the color difference evaluation result in S2, and constructing an identification model of the color difference of cigarette packaging materials; S7: According to the same steps as S3 to S5, the original near-infrared spectrum information, reconstructed spectrum information and characteristic information of the unknown sample are obtained respectively, and compared with the identification model obtained in S6 to obtain the color difference evaluation result of the unknown sample.
2. The identification method according to claim 1, characterized in that: The modeling sample in step S1 is a printed sample and / or a self-made sample.
3. The identification method according to claim 1, characterized in that: The brightness L', red-green value a' and yellow-blue value b' of the modeling sample and the brightness L*, red-green value a* and yellow-blue value b* of the standard sample meet the following requirements: L'=(L*-5.0)~(L*+5.0), a'=(a*-5.0)~(a*+5.0), b'=(b*-5.0)~(b*+5.0).
4. The identification method according to claim 1, characterized in that: The number of the modeling samples in step S1 is 400 to 1000.
5. The identification method according to claim 1, characterized in that: The comparison method in step S2 is a three-point inspection method.
6. The identification method according to claim 1, characterized in that: In step S2, if there is a large color difference between the modeling sample and the standard sample by visual comparison, the modeling sample is evaluated as unqualified or has a significant color difference; otherwise, the modeling sample is evaluated as qualified.
7. The identification method according to claim 6, characterized in that: The qualified modeling samples are further evaluated: if there is a small color difference between the modeling sample and the standard sample by visual comparison, the modeling sample is evaluated as having a slight color difference; if there is no color difference between the modeling sample and the standard sample by visual comparison, the modeling sample is evaluated as having no color difference.
8. The identification method according to claim 1, characterized in that: The spectrum acquisition range of the near infrared technology in step S3 is 4000~12000cm -1 ; The scanning mode of the scanning in step S3 is fixed scanning or rotation scanning.
9. The identification method according to claim 1, characterized in that: The wavelet basis function of the discrete wavelet transform method in step S4 is db1, db2 or db3, and the number of wavelet decomposition layers is 2, 3 or 4.
10. The identification method according to claim 1, characterized in that: In step S6, a correspondence is established between part of the feature information obtained in S5 and the color difference evaluation result in S2 to construct an identification model for color difference of cigarette packaging materials; then the remaining feature information obtained in S5 is used as a test set, and a ten-fold cross-validation method is used to verify the accuracy of the identification model.
