Sampling detection method for oil content of fried potato chips

Through image acquisition and machine learning technology, the characteristics of fried potato chips are extracted and an oil content analysis model is established, which solves the problem of long detection cycle in the existing technology, realizes fast, accurate and non-destructive testing of fried potato chips, and meets the needs of food Rapid feedback requirements for production lines.

CN118566217APending Publication Date: 2024-08-30滇二娃生物科技(云南)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410612176.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The existing oil content detection method of fried potato chips requires a large number of destructive samples, and the detection process cycle is long, making it difficult to meet the rapid feedback needs of the food production line.

Method used

Using image acquisition and machine learning technology, the texture, color and shape features of fried potato chips are extracted through wavelet scattering transform, convolutional neural network and other methods, self-supervised clustering and deep learning model training are performed, and an oil content analysis model is established to achieve Non-destructive and rapid oil content detection.

Benefits of technology

It realizes non-destructive testing, improves detection speed and efficiency, improves detection accuracy and stability, and can comprehensively evaluate the entire batch of products to meet the rapid feedback needs of the food production line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118566217A
    Figure CN118566217A
Patent Text Reader

Abstract

The invention provides a sampling detection method for the oil content of fried potato chips, and belongs to the technical field of fried potato chips, and the sampling detection method comprises the following steps: randomly extracting a sample from the whole batch of fried potato chips as an initial sample; extracting features to obtain a first feature vector and a second feature vector; performing self-supervised clustering on each fried potato chip in the initial sample to obtain a plurality of clustering centers and a plurality of non-clustering points; detecting the oil content of each fried potato chip in the detection set by adopting an experimental method; establishing training data, and training a neural network model to obtain an oil content analysis model of the fried potato chips; randomly extracting samples from the whole batch of fried potato chips as to-be-detected samples, acquiring the thickness and image of each to-be-detected sample, and inputting the thickness and image into the oil content analysis model of the fried potato chips to obtain the oil content of the to-be-detected samples; and based on the oil content of each to-be-detected sample in the to-be-detected samples, evaluating the average oil content of the whole batch of fried potato chips.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of fried potato chips, and in particular relates to a method for sampling and detecting the oil content of fried potato chips. Background Art

[0002] Fried food is a common processed food and widely exists in daily life. Among them, fried potato chips, as a popular snack, occupy an important position in the food industry. The production and quality control of fried potato chips have always been one of the key issues of concern in the food industry. As a fried food, the oil content of potato chips is one of the key indicators reflecting its quality and nutritional value.

[0003] Existing oil content detection of fried potato chips mainly relies on laboratory analysis and testing, such as Soxhlet extraction and microwave extraction. Although these methods can accurately determine the oil content of samples, they cannot achieve rapid and non-destructive detection. Each test requires a large amount of samples, causing waste of products, requiring professional experimental equipment and personnel, and a long detection cycle, which is difficult to meet the rapid feedback needs of food production lines. Summary of the invention

[0004] In view of this, the present invention provides a method for sampling and detecting the oil content of fried potato chips, which can solve the problem that the existing technology often uses a large number of destructive samples for detection, and the detection process has a long cycle and cannot meet the rapid feedback requirements on the food production line.

[0005] The present invention is achieved in that:

[0006] A first aspect of the present invention provides a method for sampling and detecting the oil content of fried potato chips, which comprises the following steps:

[0007] S10, randomly selecting a sample from the entire batch of fried potato chips as an initial sample, and obtaining basic parameters of each fried potato chip in the initial sample, including thickness and image;

[0008] S20, preprocessing each image of the fried potato chips in the initial sample to obtain a preprocessed image;

[0009] S30, extracting texture features from the preprocessed image using a wavelet scattering transform method to obtain a first feature vector;

[0010] S40, extracting color and shape features from the preprocessed image using low-pass filtering and convolutional neural network to obtain a second feature vector;

[0011] S50, performing self-supervised clustering on each fried potato chip in the initial sample based on the first feature, the second feature and the thickness, to obtain a plurality of cluster centers and a plurality of non-clusterable points;

[0012] S60, establishing a test set, including all fried potato chips corresponding to the points that cannot be clustered, and two fried potato chips corresponding to the points that are most similar and least similar to the cluster center in each cluster, and using an experimental method to detect the oil content of each fried potato chip in the test set;

[0013] S70, establishing training data, including the thickness of each fried potato chip in the detection set and the oil content detected by the image machine, training a neural network model, and obtaining an oil content analysis model for fried potato chips;

[0014] S80, randomly selecting samples from the entire batch of fried potato chips as samples to be tested, the number of samples to be tested being greater than the number of samples of the initial samples, and obtaining the thickness and image of each sample to be tested, inputting the samples into the fried potato chips oil content analysis model, and obtaining the oil content of the samples to be tested;

[0015] S90. Evaluate the average oil content of the entire batch of fried potato chips based on the oil content of each sample to be tested.

[0016] Wherein, the step S10 specifically includes:

[0017] Step 1, randomly selecting a sample from the entire batch of fried potato chips as an initial sample;

[0018] Step 2, measuring the thickness of each fried potato chip in the initial sample;

[0019] Step 3: Use an image acquisition device to photograph each fried potato chip in the initial sample to obtain its original image data.

[0020] Wherein, the specific steps of step S20 include:

[0021] Step 1: performing denoising processing on the image data of the initial sample to eliminate noise interference in the image;

[0022] Step 2, converting the color space of the image from RGB to HSV or Lab color space;

[0023] Step 3: perform scale normalization processing on the image to ensure that all sample images have the same scale.

[0024] Wherein, the specific steps of step S30 include:

[0025] Step 1, performing wavelet decomposition on the pre-processed fried potato chips image to obtain wavelet coefficients of different scales and directions;

[0026] Step 2: Calculate the modulus of the wavelet coefficients and average them to form a compact first eigenvector.

[0027] Wherein, the specific steps of step S40 include:

[0028] Step 1: low-pass filter the preprocessed image to remove high-frequency components and highlight the color information of the image;

[0029] Step 2: Use a pre-trained convolutional neural network model to extract color and shape features from the filtered image to form a second feature vector.

[0030] Pre-training method: Use more than 100 sets of filtered images, use Candy to extract edge features, merge edge features as shape features, and extract color features; establish a training set, the input of the training is the filtered image, the output of the training is the shape features and color features, and pre-train the convolutional neural network. The convolutional neural network model used is AlexNet.

[0031] Wherein, the specific steps of step S50 include:

[0032] Step 1: Based on the first eigenvector, the second eigenvector and the sample thickness information, the fried potato chips in the initial sample are divided into multiple clusters using a k-means or a Gaussian mixture model;

[0033] Step 2: Record outlier samples that cannot be assigned to any cluster.

[0034] The specific steps of step S60 include:

[0035] Step 1: All outlier samples that cannot be assigned to any cluster in step S50 are included in the detection set;

[0036] Step 2: For each cluster, select the fried potato chips corresponding to the two sample points that are most similar and least similar to the cluster center and add them to the test set;

[0037] Step 3: For each fried potato chip in the test set, the oil content is accurately determined using a laboratory test method.

[0038] The specific steps of step S70 include:

[0039] Step 1: Use the image features, thickness information and experimental test oil content of the test set samples established in step S60 as a training data set;

[0040] Step 2: Use a convolutional neural network or a long short-term memory network deep learning model, take the image feature vector and thickness information as input, and the oil content as output, and train to obtain a fried potato chips oil content analysis model.

[0041] The specific steps of step S80 include:

[0042] Step 1, randomly selecting a certain number of samples from the entire batch of fried potato chips as samples to be tested;

[0043] Step 2, measuring the thickness of the sample to be tested and collecting its image data;

[0044] Step 3: Input the thickness information and image features of the sample to be tested into the deep neural network model trained in step S70 to obtain the oil content prediction result of each sample.

[0045] The specific steps of step S90 include:

[0046] Step 1: Calculate the arithmetic mean of the predicted results of the oil content of all samples to be tested as the average oil content of the entire batch of products;

[0047] Step 2: Calculate the standard deviation of the predicted results of the oil content of all samples to be tested as the variance indicator of the oil content of the entire batch of products.

[0048] Compared with the prior art, the method for sampling and detecting the oil content of fried potato chips provided by the present invention has the following beneficial effects:

[0049] 1. Nondestructive testing is achieved: the method of the present invention only requires sampling fried potato chips for experimental oil content testing during the process of establishing the fried potato chips oil content analysis model. After the model is generated, there is no need to perform destructive testing on the fried potato chips samples, and only image data of the samples need to be collected. This not only greatly reduces the consumption of samples, but also allows multiple tests to be performed on the same batch of products, thereby improving the representativeness of the test.

[0050] 2. Improved detection speed and efficiency: Compared with traditional laboratory analysis methods, this method, based on image acquisition and machine learning algorithms, can quickly complete the prediction of the oil content of samples. Production companies can monitor product quality in real time on the production line, detect and adjust abnormal situations in a timely manner, and greatly improve the response speed of quality control.

[0051] 3. Improved detection accuracy and stability: This method combines a variety of visual feature extraction technologies, such as wavelet analysis and convolutional neural networks, to more comprehensively and accurately describe the texture, color and shape characteristics of fried potato chips, providing more reliable input for subsequent oil content prediction. At the same time, the use of self-supervised clustering and deep learning model training can effectively overcome the limitations of a single feature or method, and improve the overall detection accuracy and stability.

[0052] 4. Comprehensive evaluation is achieved: This method can not only detect the oil content of a small number of sampled products, but also evaluate the average oil content level and its dispersion of the entire batch of products through statistical analysis, providing a more comprehensive basis for the quality control of food companies.

[0053] In general, the method for rapid detection of oil content of fried potato chips proposed in the present invention makes full use of image processing and machine learning technology to achieve non-destructive, efficient and accurate detection, which solves the problem that the existing technology often uses destructive testing of a large number of samples, and the detection process has a long cycle and cannot meet the rapid feedback requirements on the food production line. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0055] Figure 1 A flow chart of the method provided by the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0057] like Figure 1 FIG. 1 is a flow chart of a method for sampling and detecting the oil content of fried potato chips provided by the present invention. The method comprises the following steps:

[0058] S10, randomly selecting a sample from the entire batch of fried potato chips as an initial sample, and obtaining basic parameters of each fried potato chip in the initial sample, including thickness and image;

[0059] S20, preprocessing each fried potato chip image in the initial sample to obtain a preprocessed image;

[0060] S30, extracting texture features from the preprocessed image using a wavelet scattering transform method to obtain a first eigenvector;

[0061] S40, extracting color and shape features from the preprocessed image using low-pass filtering and a convolutional neural network to obtain a second feature vector;

[0062] S50, performing self-supervised clustering on each fried potato chip in the initial sample based on the first feature, the second feature and the thickness, to obtain a plurality of cluster centers and a plurality of non-clusterable points;

[0063] S60, establishing a test set, including all fried potato chips corresponding to the points that cannot be clustered, and two fried potato chips corresponding to the points that are most similar and least similar to the cluster center in each cluster, and using an experimental method to detect the oil content of each fried potato chip in the test set;

[0064] S70, establishing training data, including the thickness of each fried potato chip in the detection set and the oil content detected by the image machine, training a neural network model, and obtaining an oil content analysis model for fried potato chips;

[0065] S80, randomly selecting samples from the entire batch of fried potato chips as samples to be tested, the number of samples to be tested is greater than the number of samples of the initial samples, and obtaining the thickness and image of each sample to be tested, and inputting them into a fried potato chip oil content analysis model to obtain the oil content of the sample to be tested;

[0066] S90. Evaluate the average oil content of the entire batch of fried potato chips based on the oil content of each sample to be tested.

[0067] The specific implementation methods of the above steps are described in detail below:

[0068] The specific implementation of step S10 is as follows:

[0069] Before determining the oil content of fried potato chips, it is necessary to randomly select samples from the entire batch of fried potato chips as initial samples. Select an appropriate random sampling method, such as simple random sampling, stratified random sampling, etc., to extract a certain number of fried potato chip samples from the entire batch of products. For each sample extracted, measure its thickness, and use an image acquisition device to shoot it to obtain the original image data of each sample. These original image data will be used in subsequent image preprocessing and feature extraction. By measuring the thickness of the sample and obtaining its image data, the necessary input information is provided for subsequent self-supervised clustering and model training.

[0070] The specific implementation of step S20 is as follows:

[0071] After obtaining the image data of each fried potato chip in the initial sample, these image data need to be preprocessed. First, the image is denoised to eliminate noise interference in the image. Common image denoising methods such as median filtering and Gaussian filtering can be used. Then, the image is converted into a color space, converting the original RGB color space into a color space that is more conducive to feature extraction, such as HSV, Lab, etc. Next, it may be necessary to scale the image to ensure that all sample images have the same scale to prepare for subsequent feature extraction. Through these preprocessing steps, the quality and stability of subsequent feature extraction can be improved.

[0072] The specific implementation of step S30 is as follows:

[0073] The texture features of the pre-processed fried potato chips image are extracted using the wavelet scattering transform method to obtain the first eigenvector. Wavelet scattering transform is a multi-scale analysis method that can effectively capture texture information in an image. Specifically, the image is first decomposed by wavelet to obtain wavelet coefficients at different scales and directions. Then, the modulus of these wavelet coefficients is calculated and averaged to form a compact eigenvector, which is the first eigenvector. This wavelet-based texture feature extraction method can better describe the texture features of the surface of fried potato chips and provide important input for subsequent self-supervised clustering and model training.

[0074] The specific implementation of step S40 is as follows:

[0075] In addition to extracting wavelet-based texture features, it is also necessary to extract color and shape features from the preprocessed fried potato chips image to construct a second feature vector. Specifically, the image is first low-pass filtered to remove high-frequency components and highlight the color information of the image. Then, the color and shape features of the image are extracted using a convolutional neural network. A convolutional neural network is a powerful deep learning model that can automatically learn high-level visual features in an image. Through the trained convolutional neural network model, feature information such as color distribution and shape contours can be efficiently extracted from the fried potato chips image to form a second feature vector. These two different feature extraction methods can more comprehensively describe the visual features of fried potato chips.

[0076] The specific implementation of step S50 is as follows:

[0077] Based on the first eigenvector and the second eigenvector extracted in steps S30 and S40, and the thickness information of the sample, self-supervised clustering is performed on each fried potato chip in the initial sample. Self-supervised clustering is a clustering method that does not require labeled samples and can automatically discover potential cluster structures based on the similarities between samples. In this step, classic self-supervised clustering methods such as the k-means algorithm or the Gaussian mixture model can be used to divide the fried potato chips in the initial sample into multiple clusters. At the same time, some outliers that cannot be attributed to any cluster are also recorded as subsequent detection set samples. Through self-supervised clustering, the natural clustering structure of fried potato chips in the feature space can be discovered, laying the foundation for the subsequent oil content detection model training.

[0078] The specific implementation of step S60 is as follows:

[0079] Based on the clustering results in step S50, a test set sample is established. The test set includes two parts: first, all the fried potato chip samples corresponding to the outliers that cannot be attributed to any cluster in step S50 are included in the test set; second, for each cluster, the fried potato chips corresponding to the two sample points that are most similar and least similar to the cluster center are selected and also added to the test set. After such screening, the samples in the test set can better cover the entire feature space and provide representative samples for subsequent oil content detection. Next, for each fried potato chip in the test set, the oil content is accurately determined by the laboratory test method. These experimental test results will serve as the label of the training data set to provide a basis for the establishment of the subsequent oil content analysis model.

[0080] The specific implementation of step S70 is as follows:

[0081] Based on the detection set established in step S60, including the image features, thickness information and corresponding experimental test oil content of each sample, a training data set is constructed. Using these training data, a deep neural network model is trained as the final fried potato chips oil content analysis model. Specifically, a deep learning model such as a convolutional neural network or a long short-term memory network can be used, and the input includes image feature vectors and thickness information, and the output is the predicted oil content. During the model training process, a loss function such as mean absolute error or mean square error is used, and the model parameters are optimized through a back propagation algorithm, and finally an accurate fried potato chips oil content analysis model is obtained. This trained model will play an important role in the subsequent oil content determination.

[0082] The specific implementation of step S80 is as follows:

[0083] After the model training is completed, the oil content of new samples to be tested needs to be analyzed. First, a certain number of samples are randomly selected from the whole batch of fried potato chips as samples to be tested. The number of samples should be greater than the initial number of samples in step S10. For each sample to be tested, its thickness is also measured and image data is collected. Then, the thickness information and image features of these samples to be tested are input into the deep neural network model trained in step S70 to obtain the oil content prediction results of each sample to be tested.

[0084] The specific implementation of step S90 is as follows:

[0085] Based on the predicted results of the oil content of all samples to be tested obtained in step S80, the average oil content of the whole batch of fried potato chips can be evaluated. Specifically, the arithmetic mean of the oil content of all samples to be tested can be calculated as the average oil content of the whole batch of products. At the same time, the standard deviation of the oil content of the samples to be tested can also be calculated as the variance index of the oil content of the whole batch of products. Through the statistical analysis of the oil content of the samples to be tested, the average oil content level of the whole batch of fried potato chips can be comprehensively evaluated, providing a basis for subsequent quality control.

[0086] In general, the oil content sampling detection method of fried potato chips proposed in the present invention makes full use of the technical means of image processing and machine learning to achieve rapid and accurate detection of the oil content of fried potato chips. The method mainly includes: 1) randomly extracting initial samples from the whole batch of products, measuring the sample thickness and collecting images; 2) preprocessing the sample images and extracting texture, color and shape features; 3) using self-supervised clustering to discover the potential structure between samples and establish a detection set; 4) experimentally testing the detection set samples, obtaining oil content labels, and training deep learning models; 5) using the trained model to analyze the oil content of new samples to be tested, and evaluating the average oil content level of the whole batch of products. This method based on image features and machine learning can quickly and non-destructively detect the oil content of fried potato chips, providing an effective means for food quality monitoring.

[0087] In order to better explain the present method, the specific implementation of steps S30-S50 and S90 of the present method is explained in more detail below in combination with formulas:

[0088] The specific implementation of step S30 is as follows:

[0089] The texture features of the preprocessed fried potato chips image are extracted by wavelet scattering transform method to obtain the first eigenvector. Wavelet scattering transform is a multi-scale analysis method that can effectively capture the texture information in the image.

[0090] Specifically, let the original image be x, and the image obtained after preprocessing be x(0) First, for x (0) Perform wavelet decomposition to obtain wavelet coefficients of different scales and directions Where j represents the scale and m represents the direction. Daubechies wavelet is used as the analysis wavelet.

[0091] Then, the modulus of each wavelet coefficient is calculated and averaged to obtain the texture feature vector t:

[0092]

[0093] in, Indicates the number of wavelet coefficients in the mth direction of the jth scale. In this way, rich texture information in the image can be extracted to form a compact first eigenvector t, that is, the extracted texture feature vector.

[0094] The specific implementation of step S40 is as follows:

[0095] In addition to extracting wavelet-based texture features, it is also necessary to extract color and shape features from the preprocessed fried potato chips image to construct the second feature vector.

[0096] First, for the image x (0) Perform low-pass filtering to remove high-frequency components and highlight the color information of the image. Here, a Butterworth low-pass filter is used, and its transfer function is:

[0097]

[0098] Among them, u and v are the horizontal and vertical coordinates in the frequency domain, D0 is the cutoff frequency, and n is the order of the Butterworth low-pass filter. After low-pass filtering, the image x is obtained. (1) .

[0099] Next, we use the pre-trained convolutional neural network model to (1) Extract color and shape features from the . AlexNet model is used here to convert x (1) The image is input into the convolutional layer and pooling layer of the model, and after feature extraction, a feature vector c with a length of 4096 is obtained, which is the extracted color and shape feature vector.

[0100] Combining steps S30 and S40, two feature vectors t and c can be obtained, which respectively describe the texture and color / shape features of the fried potato chips image. These two feature vectors are connected in series to form a final second feature vector f = [t, c].

[0101] The specific implementation of step S50 is as follows:

[0102] Based on the first feature vector t, the second feature vector f, and the sample thickness h extracted in steps S30 and S40, self-supervised clustering is performed on each fried potato chip in the initial sample. Self-supervised clustering is a clustering method that does not require labeled samples and can automatically discover potential clustering structures based on the similarity between samples.

[0103] Here, Gaussian mixture model (GMM) is used for self-supervised clustering. Let feature vector z = [t, f, h], and GMM models z as:

[0104]

[0105] Where K is the number of Gaussian components, π k is the mixing weight of the kth Gaussian component, μ k and∑ k are the mean vector and covariance matrix of the kth Gaussian component respectively. Generally, K=100 and k=10.

[0106] The parameters of the GMM model can be learned through the expectation maximization (EM) algorithm. Then, for each initial sample z i Calculate the posterior probability p(k|z i ), and divide it into the cluster corresponding to the component with the largest posterior probability.

[0107] At the same time, for those outlier samples z that cannot be clearly classified into any cluster j , recorded as candidate samples for subsequent detection sets. Through this self-supervised clustering method, the natural clustering structure of fried potato chips in the feature space can be discovered.

[0108] The specific implementation of step S90 is as follows:

[0109] Based on the oil content prediction results of all the samples to be tested obtained in step S80, the average oil content level of the entire batch of fried potato chips can be evaluated.

[0110] First, calculate the arithmetic mean of the oil content prediction results of all samples to be tested As the average oil content of the whole batch of products:

[0111]

[0112] Among them, x i is the predicted value of oil content of the i-th sample to be tested, and θ is the total number of samples to be tested.

[0113] At the same time, the standard deviation s of the predicted value of the oil content of the sample to be tested can also be calculated as the variance indicator of the oil content of the entire batch of products:

[0114]

[0115] Through statistical analysis of the predicted results of oil content of the samples to be tested, the average oil content level and its dispersion of the entire batch of fried potato chips can be comprehensively evaluated, providing a basis for subsequent quality control.

[0116] In summary, the specific implementation process of steps S30-S50 and S90 can be summarized as follows:

[0117] 1. Step S30 uses wavelet scattering transform to extract image texture features t to form a first feature vector.

[0118] 2. Step S40 first performs low-pass filtering on the image to highlight the color information, and then uses a convolutional neural network to extract color and shape features c to construct a second feature vector f = [t, c].

[0119] 3. Step S50: Based on the feature vector z=[t, f, h], a Gaussian mixture model is used to perform self-supervised clustering to find the natural clustering structure of the fried potato chips samples and record the outliers that cannot be clustered.

[0120] 4. Step S90 Calculate the average value of the predicted oil content of the sample to be tested The average oil content of the entire batch of products is taken as the standard deviation s, which is used as a dispersion indicator to provide a basis for quality control.

[0121] Specifically, the principle of the present invention is:

[0122] 1. Multimodal feature extraction: This method uses image acquisition equipment to obtain high-definition images of fried potato chips samples, and extracts rich visual features from them, including texture, color, shape and other information, through wavelet analysis, convolutional neural network and other technologies. These multimodal features can more comprehensively describe the appearance characteristics of fried potato chips, laying a solid foundation for the subsequent oil content prediction.

[0123] 2. Self-supervised clustering: After obtaining the sample features, this method uses self-supervised clustering algorithms such as Gaussian mixture model (GMM) to perform unlabeled clustering analysis on the samples. Through this method of automatically discovering potential clustering structures, the natural distribution pattern of fried potato chips in the feature space can be found, providing a basis for establishing the detection set. It is worth noting that this self-supervised clustering method does not require the oil content information of the samples to be labeled in advance, avoiding the tedious work of manual labeling.

[0124] 3. Deep learning modeling: Based on the sample features and oil content information discovered by self-supervised clustering, this method uses deep learning models such as convolutional neural networks or long short-term memory networks to establish a mapping relationship between the oil content of fried potato chips and image features. This data-driven modeling method can make full use of the rich information implicit in the sample image to learn an accurate oil content prediction model, overcoming the limitations of traditional methods.

[0125] 4. Comprehensive evaluation: In addition to predicting the oil content of a single sample, this method can also evaluate the average oil content level and its fluctuation of the entire batch of products through statistical analysis. Specifically, the arithmetic mean of the predicted oil content values ​​of all samples to be tested can be calculated as the average oil content index of the entire batch of products; at the same time, the standard deviation of the predicted values ​​can also be calculated to reflect the degree of dispersion of the oil content of the entire batch of products. This comprehensive evaluation method can provide food production companies with a more valuable reference for quality control.

[0126] In general, the method of the present invention realizes rapid, non-destructive and high-precision detection of the oil content of fried potato chips through key technologies such as multimodal feature extraction, self-supervised clustering and deep learning modeling, and provides a comprehensive quality assessment.

[0127] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

[0128] A specific embodiment of the present invention is provided below: This embodiment uses a fried potato chip sample provided by a typical potato chip manufacturer. The equipment used in the embodiment includes: a digital camera (pixel resolution 5184×3888), a computer (CPU: Intel i7-10700K, RAM: 32GB, GPU: NVIDIA RTX 3080) and related image processing and machine learning software.

[0129] First, 30 samples were selected as initial samples from the whole batch of fried potato chips by simple random sampling. For each initial sample, its thickness was measured and a high-resolution image was taken using a digital camera. The thickness data of the initial samples are shown in Table 1, and the image size is 5184×3888 pixels.

[0130] Table 1 Initial sample thickness data

[0131]

[0132]

[0133] Image preprocessing

[0134] After obtaining the images and thickness data of the initial samples, these images are first preprocessed. The specific steps are as follows:

[0135] 1. Image denoising: Use median filtering to denoise the image and remove salt and pepper noise in the image. The kernel size of the median filter is set to 3×3.

[0136] 2. Color space conversion: Convert the original RGB image to Lab color space to highlight the color information of the sample.

[0137] 3. Scale normalization: All images are uniformly scaled to 256×256 pixels.

[0138] After the above preprocessing, the standardized image data of 30 initial samples are obtained, which is ready for subsequent feature extraction.

[0139] Feature extraction

[0140] Based on the preprocessed image data, wavelet analysis and convolutional neural network methods are used to extract visual features and construct feature vectors.

[0141] 1. Wavelet analysis feature extraction:

[0142] Daubechies wavelet decomposition is performed on each image sample to obtain wavelet coefficient matrices of three scales (scale=1, 2, 3) and three directions (direction=horizontal, vertical, diagonal), a total of 9 wavelet coefficient matrices.

[0143] Calculate the average absolute value of each wavelet coefficient matrix to form a 9-dimensional texture feature vector t.

[0144] 2. Convolutional Neural Network Feature Extraction:

[0145] The pre-trained AlexNet model is used to input the preprocessed 256×256 image into the model, and the 4096-dimensional feature vector c of the pool5 layer is extracted as the color and shape features.

[0146] The 9-dimensional texture feature vector t obtained by wavelet analysis and the 4096-dimensional color and shape feature vector c extracted by the convolutional network are concatenated to form the final 13105-dimensional feature vector f = [t, c].

[0147] Through the above feature extraction steps, the 30 initial sample images are converted into corresponding 13105-dimensional feature vectors f, ready for subsequent self-supervised clustering.

[0148] Self-supervised clustering

[0149] Based on the extracted 13105-dimensional feature vector f and sample thickness h, a Gaussian mixture model (GMM) is used to perform self-supervised clustering of the initial samples, with the aim of discovering the natural clustering structure of the samples in the feature space.

[0150] The specific steps are as follows:

[0151] 1. Construct a 13106-dimensional feature vector z = [f, h], which contains both visual features and thickness information.

[0152] 2. Use the EM (expectation-maximization) algorithm to train the parameters of the GMM model, including the number of Gaussian components K and the mixing weight π of each component k , mean μ k and covariance∑ k After repeated iterations, K=7 was finally determined.

[0153] 3. For each initial sample Z i Calculate the posterior probability p(k|z i ), and divide it into the cluster corresponding to the component with the largest posterior probability.

[0154] 4. Record outlier samples that cannot be clearly classified into any cluster.

[0155] After the above self-supervised clustering process, 30 initial samples were divided into 7 clusters, of which 4 samples were identified as outliers.

[0156] Test set establishment

[0157] Based on the results of self-supervised clustering, the next step is to establish a test set sample to prepare for the subsequent oil content prediction model training. The specific steps are as follows:

[0158] 1. Include all 4 samples identified as outliers into the test set.

[0159] 2. For the other 7 clusters, select the 2 samples that are most similar and least similar to the cluster center, a total of 14 samples, and add them to the test set.

[0160] 3. For the 18 samples in the test set (4 outlier samples + 14 cluster representative samples), their oil content was tested in the laboratory using the Soxhlet extraction method as label data.

[0161] In this way, a test set of 18 samples was established, including outlier samples and representative samples near the cluster center, and the actual oil content of each sample was measured. These data will serve as input and labels for subsequent model training.

[0162] Deep learning model training

[0163] After having the test set data containing feature vectors and oil content labels, the next step is to train a deep learning model to predict the oil content of new samples to be tested. Here, a convolutional neural network (CNN) is selected as the model structure.

[0164] 1. Data division: 15 of the 18 samples in the test set are used for model training, and the remaining 3 are used for model validation.

[0165] 2. Model structure: AlexNet is used as the backbone of the CNN model. The 13105-dimensional feature vector f and the sample thickness h are concatenated and input into the fully connected layer of the model. The output dimension of the last fully connected layer is 1, corresponding to the predicted oil content value.

[0166] 3. Training process: Use mean absolute error (MAE) as the loss function, adopt Adam optimization algorithm to train the model, the batch size is 8, the initial value of learning rate is 0.001, and train for 50 epochs.

[0167] After training, the average absolute error of the model on the validation set is 0.98%, indicating that the model has learned a relatively accurate prediction capability for oil content. Next, the performance of the model is further evaluated on the test samples.

[0168] Model Performance Evaluation

[0169] After the model training is completed, 50 samples are randomly selected from the remaining batch of fried potato chips as the test samples. The thickness of these 50 samples is also measured and high-resolution images are collected. These image data and thickness information are input into the trained CNN model to obtain the predicted oil content of each sample.

[0170] In order to comprehensively evaluate the performance of the model, the following aspects are analyzed here:

[0171] 1. Prediction accuracy: The oil content of 50 samples predicted by the model was compared with the actual oil content of laboratory tests, and the mean absolute error (MAE) and mean square error (MSE) were calculated. The results are shown in Table 2.

[0172] Table 2 Model prediction performance indicators

[0173]

[0174]

[0175] 2. Correlation analysis: The Pearson correlation coefficient between the oil content predicted by the calculation model and the actual oil content was 0.92, indicating that the two have a strong linear correlation.

[0176] 3. Clustering consistency: The 50 samples to be tested were clustered according to the oil content predicted by the model using the k-means algorithm (k=7, consistent with the initial clustering) and compared with the initial clustering results. The results showed that 84% of the samples were correctly classified into the corresponding clusters, indicating that the prediction results of the model are highly consistent with the essential characteristics of the samples.

[0177] 4. Whole batch evaluation: Based on the predicted oil content of 50 samples to be tested, the average value is calculated to be 32.86% and the standard deviation is 3.02%. Reflecting these statistical indicators on the whole batch of products, it can be concluded that the average oil content is about 32.9%, and the oil content fluctuation is within a reasonable range of ±3%.

[0178] Based on the above performance indicators, it can be seen that the deep learning model has achieved good results in predicting the oil content of fried potato chips. Both MAE and MSE are within 1.5%, and the correlation has reached 0.92. The clustering consistency is high, and it can accurately reflect the average oil content level and its discreteness of the entire batch of products. These results fully verify the effectiveness and advantages of the method of the present invention.

[0179] Comparison with traditional methods

[0180] To further illustrate the advantages of the method of the present invention, it is compared with the traditional laboratory test method:

[0181] 1. Detection efficiency: The method of the present invention only needs to collect sample image data and quickly complete the oil content prediction through the deep learning model. The whole process only takes a few minutes. Laboratory testing takes several hours and is much less efficient.

[0182] 2. Sample loss: The present invention does not require destructive testing, and each test consumes only one sample image data. Laboratory testing requires the consumption of a large number of samples, resulting in great waste.

[0183] 3. Detection accuracy: As shown in the above performance evaluation, the prediction error of the method of the present invention is within 1.5%, which is highly consistent with the laboratory test results. In contrast, laboratory tests have certain experimental errors.

Claims

1. A method for sampling and detecting the oil content of fried potato chips, characterized in that: The following steps are involved: S10, randomly selecting a sample from the entire batch of fried potato chips as an initial sample, and obtaining basic parameters of each fried potato chip in the initial sample, including thickness and image; S20, preprocessing each image of the fried potato chips in the initial sample to obtain a preprocessed image; S30, extracting texture features from the preprocessed image using a wavelet scattering transform method to obtain a first feature vector; S40, extracting color and shape features from the preprocessed image using low-pass filtering and convolutional neural network to obtain a second feature vector; S50, performing self-supervised clustering on each fried potato chip in the initial sample based on the first feature, the second feature and the thickness, to obtain a plurality of cluster centers and a plurality of non-clusterable points; S60, establishing a test set, including all fried potato chips corresponding to the points that cannot be clustered, and two fried potato chips corresponding to the points that are most similar and least similar to the cluster center in each cluster, and using an experimental method to detect the oil content of each fried potato chip in the test set; S70, establishing training data, including the thickness of each fried potato chip in the detection set and the oil content detected by the image machine, training a neural network model, and obtaining an oil content analysis model for fried potato chips; S80, randomly selecting samples from the entire batch of fried potato chips as samples to be tested, the number of samples to be tested being greater than the number of samples of the initial samples, and obtaining the thickness and image of each sample to be tested, inputting the samples into the fried potato chips oil content analysis model, and obtaining the oil content of the samples to be tested; S90. Evaluate the average oil content of the entire batch of fried potato chips based on the oil content of each sample to be tested.

2. A method for sampling and detecting the oil content of fried potato chips according to claim 1, characterized in that: The step S10 specifically includes: Step 1, randomly select a sample from the whole batch of fried potato chips as an initial sample; Step 2, measuring the thickness of each fried potato chip in the initial sample; Step 3: Use an image acquisition device to photograph each fried potato chip in the initial sample to obtain its original image data.

3. A method for sampling and detecting the oil content of fried potato chips according to claim 1, characterized in that: The specific steps of step S20 include: Step 1: De-noising the image data of the initial sample to eliminate noise interference in the image; Step 2, converting the color space of the image from RGB to HSV or Lab color space; Step 3: perform scale normalization on the image to ensure that all sample images have the same scale.

4. A method for sampling and detecting the oil content of fried potato chips according to claim 1, characterized in that: The specific steps of step S30 include: Step 1, performing wavelet decomposition on the pre-processed fried potato chips image to obtain wavelet coefficients of different scales and directions; Step 2: Calculate the modulus of the wavelet coefficients and average them to form a compact first eigenvector.

5. A method for sampling and detecting the oil content of fried potato chips according to claim 1, characterized in that: The specific steps of step S40 include: Step 1: low-pass filter the preprocessed image to remove high-frequency components and highlight the color information of the image; Step 2: Use a pre-trained convolutional neural network model to extract color and shape features from the filtered image to form a second feature vector.

6. A method for sampling and detecting the oil content of fried potato chips according to claim 1, characterized in that: The specific steps of step S50 include: Step 1: Based on the first eigenvector, the second eigenvector and the sample thickness information, the fried potato chips in the initial sample are divided into multiple clusters using a k-means or a Gaussian mixture model; Step 2: Record outlier samples that cannot be assigned to any cluster.

7. A method for sampling and detecting the oil content of fried potato chips according to claim 1, characterized in that: The specific steps of step S60 include: Step 1: All outlier samples that cannot be assigned to any cluster in step S50 are included in the detection set; Step 2: For each cluster, select the fried potato chips corresponding to the two sample points that are most similar and least similar to the cluster center and add them to the test set; Step 3: For each fried potato chip in the test set, accurately determine its oil content using a laboratory test method.

8. A method for sampling and detecting the oil content of fried potato chips according to claim 1, characterized in that: The specific steps of step S70 include: Step 1: Use the image features, thickness information and experimental test oil content of the test set samples established in step S60 as a training data set; Step 2: Use a convolutional neural network or long short-term memory network deep learning model, with image feature vector and thickness information as input and oil content as output, to train a fried potato chips oil content analysis model.

9. A method for sampling and detecting the oil content of fried potato chips according to claim 1, characterized in that: The specific steps of step S80 include: Step 1, randomly selecting a certain number of samples from the entire batch of fried potato chips as samples to be tested; Step 2, measuring the thickness of the sample to be tested and collecting its image data; Step 3: Input the thickness information and image features of the sample to be tested into the deep neural network model trained in step S70 to obtain the oil content prediction result of each sample.

10. A method for sampling and detecting the oil content of fried potato chips according to claim 1, characterized in that: The specific steps of step S90 include: Step 1: Calculate the arithmetic mean of the predicted results of the oil content of all samples to be tested as the average oil content of the entire batch of products; Step 2: Calculate the standard deviation of the predicted results of the oil content of all samples to be tested as the variance indicator of the oil content of the entire batch of products.