Mixed grease detection method and device

By combining the neural network model with Raman spectrum data, the problem of low sensitivity and overlapping spectral peaks in the detection of mixed oils is solved, more accurate and faster detection of oil components is achieved, and the reliability of the detection results is improved.

CN118734199AInactive Publication Date: 2024-10-01INTELLIGENT ANALYSIS SERVICE CO LTD

Patent Information

Application Number
CN202410740959.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Raman spectrum detection of mixed oils and fats has the problems of low sensitivity and overlapping spectral peaks, which makes it difficult to distinguish mixed oil samples and affects the accuracy and rapidity of detection.

Method used

A mixed grease detection method based on neural networks is adopted. By obtaining the Raman spectrum data of grease and inputting it into a pre-trained mixed-sample grease detection model, the convolution layer, global average pooling layer, maximum pooling layer, residual module and Softmax are used. Functions and other neural network layers are used to extract abstract features and classify them, and train the model using the learning rate decay method to improve detection accuracy.

Benefits of technology

It effectively improves the accuracy and speed of grease detection, can accurately distinguish grease components in complex mixed systems, reduces errors and handles signal overlap and background noise, improving the reliability of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734199A_ABST
    Figure CN118734199A_ABST
Patent Text Reader

Abstract

The invention relates to a mixed grease detection method and device, and belongs to the technical field of data processing. The method comprises the following steps: acquiring Raman spectrum data of grease; obtaining a pre-trained mixed sample grease detection model; wherein the mixed sample grease detection model is obtained by training a neural network model based on sample data of multiple types of grease; the sample data comprises sample Raman spectrum data of various types of grease and grease classification labels corresponding to the sample Raman spectrum data; the Raman spectrum data are input into a mixed grease detection model, grease classification corresponding to the Raman spectrum data is obtained, and the grease classification belongs to one of multiple mixed grease types; the one-dimensional convolutional neural network (1DCNN) deep learning model can process the problems of signal overlapping and background noise, extract weak signals, reduce errors and provide more accurate detection results, so that the grease mixed sample detection problem can be solved by combining the Raman spectrum with the 1DCNN deep learning model, and the detection accuracy is improved. The detection accuracy of the Raman spectrum in a complex mixed system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a mixed grease detection method and device, and belongs to the technical field of data processing. Background Art

[0002] As a common vibration spectrum, near infrared spectroscopy is more accurate in detecting the total fatty acid content of oil products. However, in terms of oil mixed sample detection, Raman spectroscopy has fingerprint spectral characteristics and stronger resolution. Based on this, currently, mixed oils such as olive oil, soybean oil, sunflower oil, corn oil and rapeseed oil are usually detected based on Raman spectroscopy.

[0003] However, Raman spectroscopy detection of mixed oils and fats has technical problems such as low sensitivity and spectral peak overlap. Summary of the invention

[0004] This application provides a mixed oil detection method and device, which can solve the problem of difficulty in distinguishing mixed oil samples, effectively improve the accuracy and speed of oil detection, and meet the demand for oil component detection efficiency in industrial production and laboratory analysis. This application provides the following technical solutions:

[0005] In a first aspect, a mixed grease detection method is provided, the method comprising:

[0006] Obtain Raman spectrum data of oils and fats;

[0007] Obtain a pre-trained mixed sample grease detection model; wherein the mixed sample grease detection model is obtained by training a neural network model based on sample data of multiple types of grease; the sample data includes sample Raman spectrum data of multiple types of grease, and grease classification labels corresponding to the sample Raman spectrum data;

[0008] The Raman spectrum data is input into the mixed oil detection model to obtain the oil classification corresponding to the Raman spectrum data, and the oil classification belongs to one of the mixed multiple oil types.

[0009] Optionally, the mixed grease detection model includes the following neural network layers in sequence:

[0010] Convolutional layers;

[0011] A global average pooling layer connected to the convolutional layer;

[0012] a maximum pooling layer connected to the global average pooling layer;

[0013] Two residual modules for extracting abstract features;

[0014] A flatten layer connected to the last residual module to reorganize the abstract features into a one-dimensional vector;

[0015] A dense layer connected to the flatten layer to convert the one-dimensional vector into numerical values ​​corresponding to the multiple types of fats and oils;

[0016] The Softmax function connected to the dense layer converts the numerical value into the predicted probability of the multiple types of oils and fats, and outputs the type with the largest predicted probability to obtain the oil and fat classification.

[0017] Optionally, the residual module includes a main path and a skip connection path connected to the main path;

[0018] The main path includes multiple layers of nonlinear transformations. The main path passes the input features through a 1-dimensional convolution layer with a convolution kernel size of 3, and then maps the input features to a first feature representation through regularized batch normalization BN and a nonlinear activation function ReLU;

[0019] The skip connection path adjusts the dimension of the input data through a convolution layer to obtain a second feature representation so that the channel size of the second feature representation and the first feature representation remain the same.

[0020] Optionally, the method for acquiring the sample data includes:

[0021] Mixing the sample Raman spectrum data of one type of oil product among the multiple types of oil products with the sample Raman spectrum data of other types of oil products at different concentrations;

[0022] The sample Raman spectral data of other types of oil products at different concentrations include: sample Raman spectral data collected according to a concentration gradient of 0%-90% with an interval of 10%.

[0023] Optionally, one type of oil among the plurality of types of oils includes olive oil, and the other types of oils include soybean oil, sunflower oil, corn oil and rapeseed oil.

[0024] Optionally, the mixed sample grease detection model is trained in combination with a learning rate decay method.

[0025] Optionally, the learning rate decay method includes:

[0026] After every preset number of batches, the current learning rate is multiplied by a preset ratio, where the preset ratio is less than 1.

[0027] Optionally, the initial learning rate of the mixed sample grease detection model is 0.005, the batch size is set to 64, the dropout rate is 0.1, the preset number is 50, and after 100 iterations, the learning rate approaches 0 and the training is stopped.

[0028] In a second aspect, a mixed grease detection device is provided, the device comprising:

[0029] A spectrum acquisition module, used to obtain Raman spectrum data of oil;

[0030] A model acquisition module, used to acquire a pre-trained mixed sample grease detection model; wherein the mixed sample grease detection model is obtained by training a neural network model based on sample data of multiple types of grease; the sample data includes sample Raman spectrum data of multiple types of grease, and grease classification labels corresponding to the sample Raman spectrum data;

[0031] The grease detection module is used to input the Raman spectrum data into the mixed grease detection model to obtain the grease classification corresponding to the Raman spectrum data, and the grease classification belongs to one of the multiple types.

[0032] Optionally, the mixed grease detection model includes the following neural network layers in sequence:

[0033] Convolutional layers;

[0034] A global average pooling layer connected to the convolutional layer;

[0035] a maximum pooling layer connected to the global average pooling layer;

[0036] Two residual modules for extracting abstract features;

[0037] A flatten layer connected to the last residual module to reorganize the abstract features into a one-dimensional vector;

[0038] A dense layer connected to the flatten layer to convert the one-dimensional vector into numerical values ​​corresponding to the multiple types of fats and oils;

[0039] The Softmax function connected to the dense layer converts the numerical value into the predicted probability of the multiple types of oils and fats, and outputs the type with the largest predicted probability to obtain the oil and fat classification.

[0040] By obtaining Raman spectral data of oil and fat; obtaining a pre-trained mixed sample oil and fat detection model; wherein the mixed sample oil and fat detection model is obtained by training a neural network model based on sample data of multiple types of oil and fat; the sample data includes sample Raman spectral data of multiple types of oil and fat, and oil classification labels corresponding to the sample Raman spectral data; the Raman spectral data is input into the mixed oil and fat detection model to obtain the oil classification corresponding to the Raman spectral data, and the oil classification belongs to one of multiple types; since the 1DCNN deep learning model can handle signal overlap and background noise problems, extract weak signals and reduce errors, and provide more accurate detection results, therefore, by combining Raman spectroscopy with the 1DCNN deep learning model, the problem of mixed sample oil and fat detection can be solved, and the detection accuracy of Raman spectroscopy in complex mixed systems can be improved.

[0041] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present application in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 is a flow chart of a mixed grease detection method provided by an embodiment of the present application;

[0043] Figure 2 It is a structural schematic diagram of a mixed grease detection model provided by an embodiment of the present application;

[0044] Figure 3 is a schematic diagram of the structure of a residual module provided by an embodiment of the present application;

[0045] Figure 4 and Figure 5 It is a schematic diagram of the loss curve of the 1DCNN learning model of the training set and the validation set provided by an embodiment of the present application;

[0046] Figure 6 It is a confusion matrix diagram of a one-dimensional CNN model provided by an embodiment of the present application;

[0047] Figure 7 It is a block diagram of a mixed grease detection device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0048] The specific implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application but are not intended to limit the scope of the present application.

[0049] Figure 1A flowchart of a mixed grease detection method provided in an embodiment of the present application is provided. This embodiment is described by taking the method used in a mixed grease detection device as an example. The mixed grease detection device can be an electronic device with image processing and computing capabilities, such as a computer or a tablet computer. Figure 1 As shown, the method includes at least the following steps:

[0050] Step 101, obtaining Raman spectrum data of oil.

[0051] In this embodiment, the mixed grease detection device collects Raman spectrum data of the grease to be detected to perform grease detection.

[0052] Step 102, obtaining a pre-trained mixed sample grease detection model; wherein the mixed sample grease detection model is obtained by training a neural network model based on sample data of multiple types of grease; the sample data includes sample Raman spectrum data of multiple types of grease, and grease classification labels corresponding to the sample Raman spectrum data.

[0053] The training of the neural network model based on sample data of various types of oils and fats includes the following steps:

[0054] Step 1: Get sample data.

[0055] Specifically, the method for acquiring sample data includes: mixing sample Raman spectrum data of one type of oil products among multiple types of oil products with sample Raman spectrum data of other types of oil products at different concentrations; wherein the sample Raman spectrum data of other types of oil products at different concentrations includes: sample Raman spectrum data collected according to a concentration gradient of 0%-90% with an interval of 10%.

[0056] Illustratively, one of the multiple types of oils includes olive oil, and other types of oils include soybean oil, sunflower oil, corn oil, and rapeseed oil.

[0057] In one example, the sample data is randomly divided into a training set, a validation set, and a test set according to 75%, 15%, and 10%. Schematically, 20,250 pieces of the sample data obtained by the division are used for training the model, 4,050 pieces are used for validating the model, and 2,700 pieces are used for evaluating the model.

[0058] Step 2, construct a neural network model, the network structure of which is the same as the network structure of the mixed sample oil detection model.

[0059] Specifically, refer to Figure 2 , the mixed grease detection model and the neural network model include the following neural network layers in sequence:

[0060] 1. Convolutional layer 210; according to Figure 2It can be seen that this convolution layer is a one-dimensional convolution.

[0061] 2. A global average pooling layer 220 connected to the convolutional layer.

[0062] 3. A maximum pooling layer 230 connected to a global average pooling layer.

[0063] 4. Two residual modules 240 are used to extract abstract features.

[0064] 5. A flatten layer connected to the last residual module to reorganize the abstract features into a one-dimensional vector.

[0065] 6. A dense layer 250 connected to the flatten layer to convert the one-dimensional vector into numerical values ​​corresponding to various types of fats and oils.

[0066] 7. A Softmax function 260 connected to the dense layer converts the numerical value into the predicted probability of various types of oils and fats, and outputs the type with the largest predicted probability to obtain the oil and fat classification.

[0067] Among them, reference Figure 3 , the residual module 240 includes a main path 241 and a skip connection path 242 connected to the main path 241.

[0068] The main path 241 includes multiple layers of nonlinear transformations. After the input features pass through a 1-dimensional convolution layer with a convolution kernel size of 3, the main path maps the input features to a first feature representation through regularization batch normalization (BN) and a nonlinear activation function ReLU;

[0069] The skip connection path 242 adjusts the dimension of the input data through a convolutional layer to obtain a second feature representation so that the channel size of the second feature representation and the first feature representation remain the same.

[0070] Adding the second feature representation to the first feature representation is the final output of the residual module.

[0071] Step 3: Use sample data to train the neural network model according to the learning rate decay method to obtain a mixed sample oil detection model.

[0072] In other words, the mixed sample oil detection model is trained by combining the learning rate decay method.

[0073] The learning rate attenuation method includes: multiplying the current learning rate by a preset ratio after each preset number of batches, and the preset ratio is less than 1. For example, the preset ratio is 0.4.

[0074] Schematically, the initial learning rate of the mixed sample oil detection model is 0.005, the batch size is set to 64, the dropout rate is 0.1, the preset number is 50, and after 100 iterations, the learning rate tends to 0 and the training is stopped.

[0075] In this embodiment, a cross-entropy loss function is used in the model learning process to measure the degree of inconsistency between the model's predicted probability distribution for each category and the true label by calculating the cross-entropy.

[0076] Figure 4 and Figure 5 The loss curves of the 1DCNN learning model for the training set and validation set are given. It can be seen that in the early training stage, the loss curve drops rapidly, showing a good convergence speed. Then the model falls into a local optimal solution at a higher initial learning rate. Near the 50th iteration, the loss curves of the training set and validation set drop to close to 0, and then remain stable without large fluctuations. The established model achieves 98.52% recognition results on the test set.

[0077] like Figure 6 The figure shows the confusion matrix of a one-dimensional convolutional neural network (CNN) model, with the horizontal axis representing the predicted label and the vertical axis representing the true label. Figure 6 It can be seen that the mixed samples of olive oil and other oils can be accurately classified, and this classification model can accurately predict the unknown edible oil samples.

[0078] Step 103, inputting the Raman spectrum data into a mixed oil detection model to obtain an oil classification corresponding to the Raman spectrum data, where the oil classification belongs to one of the mixed multiple oil types.

[0079] In summary, the mixed oil and fat detection method provided in this embodiment obtains Raman spectral data of oil and fat; obtains a pre-trained mixed sample oil and fat detection model; wherein the mixed sample oil and fat detection model is obtained by training a neural network model based on sample data of multiple types of oil and fat; the sample data includes sample Raman spectral data of multiple types of oil and fat, and oil classification labels corresponding to the sample Raman spectral data; the Raman spectral data is input into the mixed oil and fat detection model to obtain the oil classification corresponding to the Raman spectral data, and the oil classification belongs to one of multiple types; since the 1DCNN deep learning model can handle signal overlap and background noise problems, extract weak signals and reduce errors, and provide more accurate detection results, therefore, by combining Raman spectroscopy with the 1DCNN deep learning model, the problem of mixed sample oil and fat detection can be solved, and the detection accuracy of Raman spectroscopy in complex mixed systems can be improved.

[0080] Figure 77 is a block diagram of a mixed grease detection device provided in an embodiment of the present application. The device comprises at least the following modules: a spectrum acquisition module 710 , a model acquisition module 720 and a grease detection module 730 .

[0081] Spectrum acquisition module 710, used to acquire Raman spectrum data of oil;

[0082] The model acquisition module 720 is used to acquire a pre-trained mixed sample grease detection model; wherein the mixed sample grease detection model is obtained by training a neural network model based on sample data of multiple types of grease; the sample data includes sample Raman spectrum data of multiple types of grease, and grease classification labels corresponding to the sample Raman spectrum data;

[0083] The grease detection module 730 is used to input the Raman spectrum data into the mixed grease detection model to obtain the grease classification corresponding to the Raman spectrum data, where the grease classification belongs to one of the mixed multiple grease types.

[0084] Optionally, the mixed grease detection model includes the following neural network layers in sequence:

[0085] Convolutional layers;

[0086] A global average pooling layer connected to the convolutional layer;

[0087] a maximum pooling layer connected to the global average pooling layer;

[0088] Two residual modules for extracting abstract features;

[0089] A flatten layer connected to the last residual module to reorganize the abstract features into a one-dimensional vector;

[0090] A dense layer connected to the flatten layer to convert the one-dimensional vector into numerical values ​​corresponding to the multiple types of fats and oils;

[0091] A Softmax function connected to the dense layer converts the numerical value into the predicted probability of the multiple types of oils and fats, and outputs the type with the largest predicted probability to obtain the oil classification

[0092] For relevant details, refer to the above method embodiment.

[0093] It should be noted that: the mixed grease detection device provided in the above embodiment only uses the division of the above functional modules as an example when performing mixed grease detection. In actual applications, the above functional distribution can be completed by different functional modules as needed, that is, the internal structure of the mixed grease detection device is divided into different functional modules to complete all or part of the functions described above. In addition, the mixed grease detection device provided in the above embodiment and the mixed grease detection method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0094] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the mixed grease detection method of the above method embodiment.

[0095] Optionally, the present application also provides a computer product, which includes a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the mixed grease detection method of the above method embodiment.

[0096] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0097] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A mixed grease detection method, characterized in that: The method comprises: Obtain Raman spectrum data of oils and fats; Obtain a pre-trained mixed sample grease detection model; wherein the mixed sample grease detection model is obtained by training a neural network model based on sample data of multiple types of grease; the sample data includes sample Raman spectrum data of multiple types of grease, and grease classification labels corresponding to the sample Raman spectrum data; The Raman spectrum data is input into the mixed oil detection model to obtain the oil classification corresponding to the Raman spectrum data, and the oil classification belongs to one of the mixed multiple oil types.

2. The method according to claim 1, characterized in that The mixed grease detection model includes the following neural network layers in sequence: Convolutional layers; A global average pooling layer connected to the convolutional layer; a maximum pooling layer connected to the global average pooling layer; Two residual modules for extracting abstract features; A flatten layer connected to the last residual module to reorganize the abstract features into a one-dimensional vector; A dense layer connected to the flatten layer to convert the one-dimensional vector into numerical values ​​corresponding to the multiple types of fats and oils; The Softmax function connected to the dense layer converts the numerical value into the predicted probability of the multiple types of oils and fats, and outputs the type with the largest predicted probability to obtain the oil and fat classification.

3. The method according to claim 2, characterized in that The residual module includes a main path and a skip connection path connected to the main path; The main path includes multiple layers of nonlinear transformations. The main path passes the input features through a 1-dimensional convolution layer with a convolution kernel size of 3, and then maps the input features to a first feature representation through regularized batch normalization BN and a nonlinear activation function ReLU; The skip connection path adjusts the dimension of the input data through a convolutional layer to obtain a second feature representation, so that the channel size of the second feature representation and the first feature representation remain the same.

4. The method according to claim 1, characterized in that: The method for obtaining the sample data includes: Mixing the sample Raman spectrum data of one type of oil product among the multiple types of oil products with the sample Raman spectrum data of other types of oil products at different concentrations; The sample Raman spectral data of other types of oil products at different concentrations include: sample Raman spectral data collected according to a concentration gradient of 0%-90% with an interval of 10%.

5. The method according to claim 4, characterized in that One type of oil among the plurality of types of oils includes olive oil, and the other types of oils include soybean oil, sunflower oil, corn oil, and rapeseed oil.

6. The method according to claim 1, characterized in that The mixed sample grease detection model is trained by combining a learning rate decay method.

7. The method according to claim 6, characterized in that The learning rate attenuation method includes: After every preset number of batches, the current learning rate is multiplied by a preset ratio, where the preset ratio is less than 1.

8. The method according to claim 7, characterized in that The initial learning rate of the mixed sample grease detection model is 0.005, the batch size is set to 64, the dropout rate is 0.1, the preset number is 50, and after 100 iterations, the learning rate tends to 0 and the training is stopped.

9. A mixed grease detection device, characterized in that: The device comprises: A spectrum acquisition module, used to obtain Raman spectrum data of oil; A model acquisition module, used to acquire a pre-trained mixed sample grease detection model; wherein the mixed sample grease detection model is obtained by training a neural network model based on sample data of multiple types of grease; the sample data includes sample Raman spectrum data of multiple types of grease, and grease classification labels corresponding to the sample Raman spectrum data; The grease detection module is used to input the Raman spectrum data into the mixed grease detection model to obtain the grease classification corresponding to the Raman spectrum data, and the grease classification belongs to one of the mixed multiple grease types.

10. The device according to claim 9, characterized in that The mixed grease detection model includes the following neural network layers in sequence: Convolutional layers; A global average pooling layer connected to the convolutional layer; a maximum pooling layer connected to the global average pooling layer; Two residual modules for extracting abstract features; A flatten layer connected to the last residual module to reorganize the abstract features into a one-dimensional vector; A dense layer connected to the flatten layer to convert the one-dimensional vector into numerical values ​​corresponding to the multiple types of fats and oils; The Softmax function connected to the dense layer converts the numerical value into the predicted probability of the multiple types of oils and fats, and outputs the type with the largest predicted probability to obtain the oil and fat classification.

Citation Information

Patent Citations

  • Gasoline adulteration identification and analysis method based on Raman spectroscopy combined with random forest algorithm

    CN110836885A

Cited By

  • Gaseous pollutant Fourier transform infrared spectroscopic analysis method based on deep learning

    CN120490000A