A rapid identification method for adulteration of star anise powder based on deep learning
Through deep learning-based methods, a SqueezeNet classification model for identifying adulteration of star anise powder was established, which solved the problem of difficult to quickly identify adulteration of star anise powder in the prior art, and achieved efficient and simple detection effects.
Patent Information
- Application Number
- CN202111510302.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-11
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-12-11
AI Technical Summary
The existing technology is difficult to quickly and easily identify adulteration of star anise powder, which affects the normal development of the spice market and the legitimate rights and interests of consumers.
Using a deep learning-based method, a SqueezeNet deep learning classification model is established by taking images of pure chaff powder and star anise powder sample with different adulteration ratios to achieve rapid identification of samples to be tested.
It realizes rapid and simple identification of the adulteration ratio of star anise powder, significantly improves detection efficiency, simplifies the adulteration recognition process, and has strong practicality and broad application prospects.
Smart Images

Figure CN114140464B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of food detection, and in particular relates to a method for rapidly identifying adulteration of star anise powder based on deep learning. Background Art
[0002] Star anise is a plant in the genus Illicium of the family Illicium, and is also a famous spice. The peel, seeds and leaves of star anise contain aromatic oils, which can be used as important raw materials for the manufacture of cosmetics, sweet wine, beer and related industries such as the food industry. Star anise can be used directly in the cooking process of daily life, such as stewing, boiling, pickling, braising, soaking and other cooking environments, and can also be made into five-spice seasoning powder. The anise oil and star anise oleoresin in star anise fruits are also often used in the processing of meat products, condiments, soft drinks, cold drinks, candies, cakes, baked goods and other foods. Star anise oleoresin is similar to other spice oleoresins. The market demand for this product is increasing year by year, and there is a possibility of replacing traditional spices. At present, although the market development of the spice industry is still stable and improving, there are also many problems: because the price of star anise powder is generally not low, there are many unscrupulous merchants who have the problem of passing it off as the real thing and replacing it with other cheap similarities such as corn flour and husk powder. This situation will not only affect the normal development of the spice market, but also infringe upon the legitimate rights and interests of consumers. Therefore, identifying adulteration of star anise powder can effectively protect the legitimate rights and interests of consumers and maintain the normal development of related industries.
[0003] In summary, in order to expand the application of star anise powder adulteration detection in the food field, it is necessary to develop an efficient and simple method for real-time detection of star anise powder adulteration. Summary of the invention
[0004] The purpose of the present invention is to provide a method for rapid identification of adulteration of star anise powder based on deep learning, using pure husk powder and star anise powder with different adulteration ratios as experimental samples; taking photos of pure husk powder and star anise powder with different adulteration ratios in a studio as original data sets; segmenting the collected original images to separate the background and the target; establishing a deep learning classification model for predicting adulteration of pure husk powder and star anise powder based on the obtained image information; and identifying the pure husk powder and star anise powder samples to be tested based on the established classification model. The method is conducive to simply and quickly detecting adulteration of star anise powder.
[0005] To achieve the above-mentioned purpose, the technical solution of the present invention is: a method for quickly identifying adulterated star anise powder based on deep learning, which uses pure husk powder and star anise powder sample images with different adulteration ratios as data sets to train a deep learning classification model; and quickly identifies the adulteration ratio of star anise powder through the deep learning classification model obtained through training.
[0006] In one embodiment of the present invention, the method is specifically implemented in the following steps:
[0007] Step S1, using star anise and rice husk as experimental samples;
[0008] Step S2, grinding and drying the star anise and rice husks;
[0009] Step S3, preparing adulterated star anise powder samples for filming;
[0010] Step S4, collecting image data of pure husk powder and star anise powder samples with different adulteration ratios;
[0011] Step S5, segmenting the original images of pure husk powder and star anise powder with different adulteration ratios to separate the background from the target;
[0012] Step S6, based on the sample images of pure husk powder and star anise powder with different adulteration ratios obtained in step S5, a deep learning classification model for predicting adulteration of pure husk powder and star anise powder with different adulteration ratios is established;
[0013] Step S7: Based on the deep learning classification model established in step S6, the pure husk powder and star anise powder samples to be tested are identified for adulteration.
[0014] In one embodiment of the present invention, in step S1, the purchased star anise is sold by Chongqing Wanshi Trading Co., Ltd.
[0015] In one embodiment of the present invention, in step S2, the preparation of star anise powder is carried out according to the process flow specified in GB / T 12729.3-2020.
[0016] In one embodiment of the present invention, in step S3, the pure star anise powder sample is used as a blank group, the adulterated sample is husk powder, and 5 different original adulteration ratios, i.e., adulteration rates, of 10%, 20%, 30%, 40%, and 50% are selected, and the mass of the star anise powder and the adulterated powder at each adulteration rate is calculated in turn, accurately weighed, and the total mass is 8 g, and mixed in an oscillator for later use;
[0017] Assume that the adulteration rate is p, the mass of pure star anise powder is M, the mass of doped powder is m, and the total mass of the sample is 8 g. .
[0018] In one embodiment of the present invention, in step S4, pure husk powder and star anise powder with different adulteration ratios are placed in a photography studio, a culture dish is used as a stage, and a Canon 600D camera is used to take pictures.
[0019] In one embodiment of the present invention, in step S5, a certain pixel region in the middle of the image is segmented to separate the background from the object.
[0020] In one embodiment of the present invention, a SqueezeNet deep learning classification model is established in step S6.
[0021] In one embodiment of the present invention, the process of identifying the pure husk powder and the adulterated star anise powder samples in step S7 is as follows:
[0022] Take the pure husk powder and star anise powder samples to be tested, put them in a petri dish, take photos in a studio, segment and resize the photos, and finally input the modified images into the trained SqueezeNet deep learning classification model. The SqueezeNet deep learning classification model will predict the adulteration rate of the pure husk powder and star anise powder adulterated samples to be tested and use it as the output.
[0023] Compared with the prior art, the present invention has the following beneficial effects: the present invention constructs a SqueezeNet deep learning classification model by shooting pure husk powder and adulterated star anise powder sample images with different adulteration ratios in a studio as the original data set, and the model can effectively identify the adulteration ratios of pure husk powder and star anise powder. The method is simple and fast, can significantly improve the detection efficiency, and provides a new method for simplifying the identification of adulterated star anise powder, which has strong practicality and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flow chart of the method implementation of the embodiment of the present invention.
[0025] Figure 2 These are original images of pure husk powder and adulterated samples of star anise powder with different adulteration ratios in the embodiments of the present invention.
[0026] Figure 3 These are segmented images of pure husk powder and adulterated samples of star anise powder with different adulteration ratios in the embodiments of the present invention.
[0027] Figure 4 It is a secondary segmentation image of pure husk powder and adulterated samples of star anise powder with different adulteration ratios in the embodiment of the present invention.
[0028] Figure 5 Schematic diagram of the accuracy curve of the model established in the embodiment of the present invention.
[0029] Figure 6 Schematic diagram of the loss curve of the model established in the embodiment of the present invention.
[0030] Figure 7 Schematic diagram of the test results of the SqueezeNet model established in the embodiment of the present invention. DETAILED DESCRIPTION
[0031] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings.
[0032] The present invention discloses a method for rapidly identifying adulterated star anise powder based on deep learning. The method adopts pure husk powder and sample images of star anise powder with different adulterated proportions as data sets to train a deep learning classification model. The deep learning classification model obtained through training is used to rapidly identify the adulterated proportion of star anise powder.
[0033] The following is the specific implementation process of the present invention.
[0034] This embodiment provides a method for rapid rice variety identification based on machine learning. Figure 1 As shown, the following steps are included:
[0035] (1) Star anise was purchased from the supermarket and rice husk was purchased online as experimental samples;
[0036] In this embodiment, star anise is purchased in a supermarket and rice husks are purchased online. The purchased star anise is sold by Chongqing Wanshi Trading Co., Ltd.
[0037] (2) Grinding and drying the purchased star anise and rice husks;
[0038] In this embodiment, the preparation of star anise powder is carried out according to the process flow specified in GB / T 12729.3-2020.
[0039] (3) preparing adulterated star anise powder samples for filming;
[0040] In this example, the pure star anise powder sample was used as the blank group, and the adulterated sample was the husk powder. Five different original adulteration ratios, namely adulteration rates, were selected, namely 10%, 20%, 30%, 40%, and 50%. The mass of the star anise powder and the adulterated powder at each adulteration rate was calculated in turn, accurately weighed, and the total mass was 8 g. The mixture was mixed in an oscillator and set aside.
[0041] Assume that the adulteration rate is p, the mass of pure star anise powder is M, the mass of doped powder is m, and the total mass of the sample is 8g, then .
[0042] (4) Collect image data of pure husk powder and star anise powder samples with different adulteration ratios;
[0043] In this embodiment, pure husk powder and star anise powder with different adulteration ratios were placed in a photography studio, a culture dish was used as a stage, and a Canon 600D camera was used to take pictures.
[0044] (5) Segment the collected original image to separate the background from the target;
[0045] In this embodiment, a certain pixel area in the middle of the image is segmented to separate the background from the target.
[0046] (6) Based on the sample images obtained in step (5), a deep learning classification model is established to predict the adulteration of pure husk powder and star anise powder;
[0047] In this embodiment, a SqueezeNet deep learning classification model is established, and the established model achieves 99.42% recognition results on the test set.
[0048] (7) Based on the classification model established in step (6), the adulteration of the star anise powder sample to be tested is identified.
[0049] In this embodiment, a small amount of the star anise powder sample to be tested is taken, placed in a culture dish, placed in a studio to take a photo, the photo is segmented and resized, and finally the modified image is resized and input into the trained SqueezeNet model. The SqueezeNet model will predict the adulteration rate of the adulterated star anise powder sample to be tested and use it as output.
[0050] The present invention will be further described below with reference to specific embodiments.
[0051] 1. If Figure 2 Shown are the original images of pure star anise powder, pure husk powder, and 7 different adulteration ratios and adulterants, namely 10%, 20%, 30%, 40%, and 50%. 120 images were taken for each category, with a total sample size of 120×7=840. After shooting, the photos were promptly imported into the computer, and programs were written using python and matlab2020a for subsequent modeling and analysis.
[0052] 2. Segment the 600×600 pixel image in the middle area of the original image. The segmentation effect is as follows: Figure 3 shown.
[0053] 3. The segmented 600×600 pixel image is evenly divided into 4 300×300 pixel images to expand the data set to 4×840=3360 images. The segmentation effect is as follows: Figure 4 shown.
[0054] 4. The dataset (3360 images) was randomly divided into training set, validation set and test set according to 75%, 15% and 10%, 2520 images were used for training model, 497 images were used for validation model and 343 images were used for evaluation model.
[0055] 5. If Figure 5 , Figure 6As shown in the figure, after 780 iterations, the model gradually converged on both the training set and the validation set, achieving a high recognition rate on both the training set and the validation set, and the loss curve did not show obvious overfitting. The established model achieved a recognition result of 99.42% on the test set.
[0056] 6. If Figure 7 The following is the confusion matrix of the SqueezeNet model, with the predicted labels on the horizontal axis and the true labels on the vertical axis. As can be seen from the figure, the 0% category: no misclassification; the 10% category: no misclassification; the 20% category: 1 sample was misclassified as the 10% category; the 30% category: no misclassification; the 40% category: 1 sample was misclassified as the 50% category; the 50% category: no misclassification, and the husk powder category: no misclassification.
[0057] Finally, the obtained deep learning classification model can be used to predict the unknown adulterated star anise powder images.
[0058] The above are preferred embodiments of the present invention. Any changes made according to the technical solution of the present invention, as long as the resulting functions do not exceed the scope of the technical solution of the present invention, belong to the protection scope of the present invention.
Claims
1. A method for rapid identification of adulteration of star anise powder based on deep learning, characterized in that: Pure husk powder and star anise powder sample images with different adulteration ratios were used as data sets to train a deep learning classification model; the adulteration ratio of star anise powder was quickly identified through the deep learning classification model obtained through training; the specific implementation steps of this method are as follows: Step S1, using star anise and rice husk as experimental samples; Step S2, grinding and drying the star anise and rice husks; Step S3, preparing adulterated star anise powder samples for filming; Step S4, collecting image data of pure husk powder and star anise powder samples with different adulteration ratios; Step S5, segmenting the original images of pure husk powder and star anise powder with different adulteration ratios to separate the background from the target; Step S6, based on the sample images of pure husk powder and star anise powder with different adulteration ratios obtained in step S5, a deep learning classification model for predicting adulteration of pure husk powder and star anise powder with different adulteration ratios is established; Step S7, based on the deep learning classification model established in step S6, the pure husk powder and star anise powder samples to be tested are subjected to adulteration identification; In step S6, a SqueezeNet deep learning classification model is established; The process of identifying the pure husk powder and the adulterated star anise powder samples in step S7 is as follows: Take the pure husk powder and star anise powder samples to be tested, put them in a petri dish, take photos in a studio, segment and resize the photos, and finally input the modified images into the trained SqueezeNet deep learning classification model. The SqueezeNet deep learning classification model will predict the adulteration rate of the pure husk powder and star anise powder adulterated samples to be tested and use it as the output.
2. According to claim 1, a method for rapid identification of adulteration of star anise powder based on deep learning is characterized in that: In step S3, the pure star anise powder sample is used as the blank group, and the adulterated sample is husk powder. Five different original adulteration ratios, namely adulteration rates, of 10%, 20%, 30%, 40%, and 50% are selected. The mass of the star anise powder and the adulterated powder at each adulteration rate is calculated in turn, and the total mass is 8 g after accurate weighing. The mixture is mixed in an oscillator and set aside.
3. A method for rapid identification of adulteration of star anise powder based on deep learning according to claim 2, characterized in that: In step S4, pure husk powder and star anise powder with different adulteration ratios are placed in a photography studio, a culture dish is used as a stage, and a Canon 600D camera is used to take pictures.
4. A method for rapid identification of adulteration of star anise powder based on deep learning according to claim 2, characterized in that: In step S5, the image of the predetermined pixel area in the middle of the image is segmented to separate the background from the target.
Citation Information
Patent Citations
Neural network detection method for USB surface defect detection
CN111768385A
Rice variety rapid identification method based on machine learning
CN113255749A