CN114371145A - Detection method and device for milk oil mixed pigment, electronic equipment and storage medium - Google Patents

Detection method and device for milk oil mixed pigment, electronic equipment and storage medium Download PDF

Info

Publication number
CN114371145A
CN114371145A CN202210276771.8A CN202210276771A CN114371145A CN 114371145 A CN114371145 A CN 114371145A CN 202210276771 A CN202210276771 A CN 202210276771A CN 114371145 A CN114371145 A CN 114371145A
Authority
CN
China
Prior art keywords
data
cream
model
pigment
detection model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210276771.8A
Other languages
Chinese (zh)
Inventor
刘军
张芸
张健行
侯青
黄晓彤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Institute of Technology
Original Assignee
Wuhan Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Institute of Technology filed Critical Wuhan Institute of Technology
Priority to CN202210276771.8A priority Critical patent/CN114371145A/en
Publication of CN114371145A publication Critical patent/CN114371145A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/31Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
    • G01N21/35Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
    • G01N21/359Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light using near infrared light
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/31Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
    • G01N21/35Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
    • G01N21/3577Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light for analysing liquids, e.g. polluted water
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Abstract

The invention relates to a detection method and device of a butter mixed pigment, electronic equipment and a storage medium, and belongs to the technical field of data detection. The method comprises the following steps: acquiring spectral data of cream to be detected; preprocessing the spectral data to obtain target data; and inputting the target data into a trained mixed pigment detection model to obtain a mixed pigment detection result of the cream to be detected, wherein the mixed pigment detection model is a migration model constructed on the basis of a single pigment detection model, and the single pigment detection model is used for detecting the single pigment detection result of the single pigment cream data. The migration model constructed on the basis of the single pigment detection model has high initial performance and high convergence speed, can overcome the defects of high difficulty and small data amount of mixed pigment detection, reduces the training time of the mixed pigment detection model, ensures the precision of the mixed pigment detection model, and realizes quick, small-damage and accurate mixed pigment detection.

Description

Detection method and device for milk oil mixed pigment, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of data detection, in particular to a method and a device for detecting a butter mixed pigment, electronic equipment and a storage medium.
Background
The artificial pigment has low cost, bright color and strong tinting strength, and various pigment additives can be added into the commercial products in the market at present to keep the beauty, improve the mouthfeel and reduce the cost. The pigment in the cream product is added in the preparation process and is mixed and stirred with the cream uniformly, so that the pigment is difficult to be directly separated and the content is difficult to detect.
In the related art, pigment detection is usually achieved based on a chemical method, which has the defects of long detection time and strong destructiveness, and accurate detection of mixed pigments is difficult to achieve.
Disclosure of Invention
In order to overcome the defects of long detection time, strong destructiveness and low accuracy of the conventional mixed pigment detection method, the invention provides a method and a device for detecting a mixed pigment of butter, electronic equipment and a storage medium.
In order to solve the above technical problems, the present invention provides a method for detecting a mixed colorant of milk oil, comprising:
acquiring spectral data of cream to be detected;
preprocessing the spectral data to obtain target data;
and inputting the target data into a trained mixed pigment detection model to obtain a mixed pigment detection result of the cream to be detected, wherein the mixed pigment detection model is a migration model constructed on the basis of a single pigment detection model, and the single pigment detection model is used for detecting the single pigment detection result of the single pigment cream data.
The invention has the beneficial effects that: the migration model constructed on the basis of the single pigment detection model has high initial performance and high convergence speed, and can overcome the defects of high difficulty and small data volume of mixed pigment detection, thereby reducing the training time of the mixed pigment detection model, ensuring the precision of the mixed pigment detection model and realizing the quick, small-damage and accurate mixed pigment detection.
Further, preprocessing the spectrum data to obtain target data, comprising:
segmenting the spectral data by utilizing a sliding window to obtain at least two data segments;
and performing dimensionality reduction on each data segment to obtain target data.
The beneficial effect who adopts above-mentioned improvement scheme is: the dimension reduction processing is carried out on each data segment, so that the differentiated dimension reduction of the spectral data is realized, the data volume is reduced, meanwhile, the effective pigment information in the spectral data is retained to the maximum extent, the calculation cost is reduced, and the detection performance of the model is improved.
Further, performing dimension reduction processing on each data segment to obtain target data, including:
carrying out PCA dimension reduction on each data segment, and determining each data segment subjected to PCA dimension reduction as a signal characteristic data set;
and acquiring a data segment meeting set conditions from the signal characteristic data set, and determining the data segment meeting the set conditions as target data, wherein the set conditions are that the data segment is a data segment with non-zero third-order cumulant and non-zero fourth-order cumulant.
The beneficial effect who adopts above-mentioned improvement scheme is: the non-Gaussian characteristic of each data segment is measured by utilizing the third-order cumulant and the fourth-order cumulant, and the data segment containing more pigment information can be accurately obtained, so that the data volume is further reduced, and the detection efficiency is improved.
Further, the mixed pigment detection model is established by the following method: training a convolution neural network model based on the obtained monochrome cream data to obtain a monochrome detection model, wherein the convolution neural network model comprises a convolution pooling layer for extracting monochrome features of the monochrome cream data;
extracting a convolution pooling layer in the single-color element detection model, establishing a full-link layer, establishing a new convolution neural network model based on the plurality of convolution pooling layers and the full-link layer, and taking the new convolution neural network model as a migration model;
and training the migration model based on the obtained mixed pigment cream data to obtain a trained mixed pigment detection model.
The beneficial effect who adopts above-mentioned improvement scheme is: the mixed pigment detection model is obtained by training the migration model, so that the training effect on the single pigment detection model can be kept to a certain extent to the training on the mixed pigment, thereby effectively reducing the training time of the model and ensuring the precision of the model.
Further, acquiring spectral data of cream to be detected comprises:
and (4) carrying out data acquisition on the cream to be detected through a near infrared spectrometer to obtain spectral data.
The beneficial effect who adopts above-mentioned improvement scheme is: the near infrared spectrum analysis technology is realized by using the near infrared spectrometer, so that the efficiency of spectrum analysis is improved and the cost is reduced.
In a second aspect, the present invention provides a device for detecting a milk oil mixed pigment, comprising:
the acquisition module is used for acquiring spectral data of cream to be detected;
the preprocessing module is used for preprocessing the spectral data to obtain target data;
and the detection module is used for inputting the target data into the trained mixed pigment detection model to obtain a mixed pigment detection result of the cream to be detected, wherein the mixed pigment detection model is a migration model established on the basis of a single pigment detection model, and the single pigment detection model is used for detecting the single pigment detection result of the single pigment cream data.
Further, the preprocessing module is specifically configured to segment the spectral data by using a sliding window to obtain at least two data segments; and performing dimensionality reduction on each data segment to obtain target data.
Further, the preprocessing module is also used for carrying out PCA dimension reduction on each data segment, and determining each data segment after the PCA dimension reduction as a signal characteristic data set; and acquiring a data segment meeting set conditions from the signal characteristic data set, and determining the data segment meeting the set conditions as target data, wherein the set conditions are that the data segment is a data segment with non-zero third-order cumulant and non-zero fourth-order cumulant.
In a third aspect, the present invention provides a computer-readable storage medium having stored therein instructions which, when run on a terminal device, cause the terminal device to perform all or part of the steps of the method for detecting a milk oil mixed pigment according to the first aspect.
In a fourth aspect, the present invention provides an electronic device, which includes a memory, a processor and a program stored in the memory and running on the processor, wherein the processor implements all or part of the steps of the method for detecting a milk oil mixed pigment according to the first aspect when executing the program.
Drawings
FIG. 1 is a schematic flow chart of a method for detecting a milk oil mixed pigment according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus for detecting a cream color mixture according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following examples are further illustrative and supplementary to the present invention and do not limit the present invention in any way.
The following describes a method for detecting a milk oil mixed pigment according to an embodiment of the present invention with reference to the accompanying drawings.
Referring to fig. 1, the present invention provides a method for detecting a milk oil mixed pigment, including the following steps S1 to S3.
In step S1, spectral data of cream to be detected is acquired.
It will be appreciated that the spectroscopic data can be indicative of differences in the optical properties of the chemical structures of different substances, and that analysis of such differences facilitates rapid, non-destructive determination of the amount of one or more substances (e.g. pigments) in a sample.
Optionally, in an embodiment, the obtaining of the spectral data of the cream to be detected includes:
and (4) carrying out data acquisition on the cream to be detected through a near infrared spectrometer to obtain spectral data.
The method has the advantages that the near infrared spectrum analysis technology is high in analysis speed, high in efficiency and low in cost, data acquisition is carried out on cream to be detected through the near infrared spectrometer, optical characteristics of chemical structures of substances such as pigments in the cream to be detected in a near infrared spectrum region can be obtained quickly, and subsequent model establishment and mixed pigment detection are facilitated.
Illustratively, resin cream used for determination is obtained, and the mixed pigment in the resin cream can be mixed pigment of amaranth and brilliant blue; putting the resin cream into a near-infrared spectrometer to perform three times of repeated near-infrared scanning; and the near infrared spectrum image recorded by the near infrared spectrometer is the spectrum data of the resin cream.
In step S2, the spectral data is preprocessed to obtain target data.
The preprocessing may include denoising processing, dimension reduction processing, and the like.
It can be understood that the spectral data is generally high-dimensional data, which contains a large amount of interference information such as background noise in addition to useful chemical information (such as pigment information), and the purpose of preprocessing the spectral data is to weaken the influence of various irrelevant factors on the cream pigment spectrum, reduce the data dimension, retain effective mixed pigment information, enhance the sensitivity of the spectral data to the pigment concentration, and further improve the accuracy of the model.
Optionally, in an embodiment, the preprocessing the spectral data to obtain the target data includes:
segmenting the spectral data by utilizing a sliding window to obtain at least two data segments;
and performing dimensionality reduction on each data segment to obtain target data.
It is understood that, taking the near infrared spectrum as an example, the correlation size between each band is different, and the spectral characteristics of each band reaction are different, and then if the spectral data is subjected to uniform dimensionality reduction, partial feature deletion may be caused.
For example, for different spectral regions (e.g., spectral data of different frequency bands), the data correlations are different, the data dimensionality reduction of a part of useful frequency bands may cause a large change in spectral information, while the data of another part of frequency bands originally contributes little to the model detection, and the detection effect may be disturbed after dimensionality reduction.
In this embodiment, the spectral data is segmented by using a sliding window to obtain at least two data segments, where each data segment includes characteristic information (e.g., frequency domain parameters such as formants and energy) of the spectrum. The window length of the sliding window may be set to 512 data points, and the step size is set to 1/4, i.e. 128 data points, of the window length, so as to realize the segmentation of the spectral data with short overlap, in which case, each data segment includes 512 data points.
By using the sliding window technology, the long-range spectral data can be smoothly segmented, so that main information is differentially extracted, the operation difference caused by different spectral characteristics is overcome, the data volume is reduced, and meanwhile, effective pigment information is retained to the maximum extent, so that the calculation cost is reduced and the model detection performance is improved.
Optionally, the performing the dimension reduction processing on each data segment to obtain the target data includes:
carrying out PCA dimension reduction on each data segment, and determining each data segment subjected to PCA dimension reduction as a signal characteristic data set;
and acquiring a data segment meeting set conditions from the signal characteristic data set, and determining the data segment meeting the set conditions as target data, wherein the set conditions are that the data segment is a data segment with non-zero third-order cumulant and non-zero fourth-order cumulant.
It will be appreciated that the goal of PCA dimension reduction is to map high dimensional data to a low dimensional space through projection, and that it is desirable to obtain maximum data variance over the projected dimensions in order to preserve more features of the original data points with fewer data dimensions. When the nonlinear problem is processed, the PCA can obtain a better data fitting effect with fewer parameter factors, has obvious advantages, and is more suitable for a small sample data set compared with other models. Therefore, the PCA dimensionality reduction is adopted in the preprocessing of the original data to obtain the data set for model detection, so that the information loss of the original data can be reduced to the maximum extent, and the influence of various irrelevant factors can be eliminated.
The principle of PCA dimensionality reduction is as follows:
there is a data set for a given principal axis vector
Figure 658737DEST_PATH_IMAGE001
The data set Z represents a vector of the main axis direction, and the data center of the data set Z is positioned
Figure 841457DEST_PATH_IMAGE002
N represents the number of data in data set Z; data centering is used to move the origin of coordinates of a primary coordinate axis (e.g., the x, y axes represented by the rows and columns of a matrix representing a two-dimensional dataset) to the data center, and a centered dataset Z is represented as
Figure 73724DEST_PATH_IMAGE003
The data set Z can be represented by a matrix of n rows and d dimensions, and a d-dimensional column vector
Figure 92DEST_PATH_IMAGE004
Respectively representing the mean value of each column element in the n rows of d-dimensional matrix.
Assuming the centered data set Z is on the first principal axis
Figure 80043DEST_PATH_IMAGE005
Distributed most open in direction, that is to say in
Figure 699243DEST_PATH_IMAGE005
The sum of the absolute values of the projections in the direction (or variance) is the largest, and calculating the projection is the data in the data set Z after centering
Figure 497435DEST_PATH_IMAGE006
And
Figure 230423DEST_PATH_IMAGE005
do inner product because only need to require
Figure 164881DEST_PATH_IMAGE005
In a direction of, so can be provided with
Figure 954983DEST_PATH_IMAGE005
Is a unit vector; maximize the formula
Figure 240471DEST_PATH_IMAGE007
To calculate to obtain data
Figure 508641DEST_PATH_IMAGE006
In that
Figure 359922DEST_PATH_IMAGE005
Namely, the maximum value of the projection in the direction of the first main axis, and the maximum projection is the shortest vertical distance from the data to the first main axis.
As known from the matrix algebra correlation knowledge, the absolute value sign term can be squared, i.e. the square processing is carried out
Figure 586504DEST_PATH_IMAGE008
And simultaneously introducing a covariance matrix, and using the covariance matrix to save the characteristics of the data, namely recording how the data is stretched and rotated.
Assuming that data represented by a matrix X obtained after zero-averaging (i.e., data centering) has d dimensions (d features), a covariance matrix of the matrix X is a matrix of d × d, and the covariance matrix represents a correlation degree of every two features in the data, i.e., a feature correlation degree after data stretching and rotation after zero-averaging.
For a matrix X of n rows and d columns, the covariance matrix is
Figure 93709DEST_PATH_IMAGE009
The main diagonal element in the covariance matrix is
Figure 165570DEST_PATH_IMAGE010
Representing the coordinates of the data after centering (i.e., after stretch rotation transformation). Assuming that the coordinates of the data represented by the matrix X are mapped to a new vector space and then represented by a matrix Y, and the covariance matrix of the matrix Y is D, then there is a matrix
Figure 74620DEST_PATH_IMAGE011
Covariance matrix
Figure 206524DEST_PATH_IMAGE012
(ii) a Where P is a matrix of D x k, which is composed of the first k column vectors of the covariance matrix D, the goal of dimensionality reduction is achieved when k is less than D.
In this embodiment, assuming that each data segment contains m1 m 2-dimensional data, each dimension of the data respectively representing one attribute (e.g., formants, energy) of the data, the single data segment is represented by a matrix a of m1 rows by m2 columns, each column of the matrix a representing one attribute of the data.
Zero-averaging is performed on each column of the matrix a, i.e., the average value of each column is subtracted from each element in the column to obtain a matrix X1. Solving a covariance matrix of the matrix X1, calculating an eigenvalue of the covariance matrix and a corresponding eigenvector, arranging the eigenvector into a matrix from top to bottom according to the magnitude sequence (such as the sequence from small to large or from large to small) of the corresponding eigenvalue, taking the top k rows from top to bottom to form a matrix P, and obtaining a matrix Y from Y = PX1, wherein the matrix Y represents data after dimensionality reduction to k dimensionalities. By carrying out PCA dimension reduction on the spectral data in a segmented manner, the principal component information of different waveband information can be respectively extracted, and the effectiveness and the accuracy of pigment information extraction are improved.
It should be noted that, compared with the spectrum of the ordinary non-pigmented cream, the capture of the spectral change after the addition of the pigment can be regarded as a problem of the detection of a non-gaussian signal in the two-dimensional gaussian noise. The non-gaussian characteristics of the principal component in each data segment are balanced with the third order and fourth order cumulants. If the data of a certain local window obeys Gaussian distribution, the corresponding third-order cumulant and fourth-order cumulant are zero. If the data of a certain local window has more pigment information, the Gaussian distribution is broken, the absolute values of the third-order cumulant and the fourth-order cumulant become large, and the data segment with more pigment information can be captured according to the characteristic.
The third-order cumulant and the fourth-order cumulant are respectively a third-order integral and a fourth-order integral after a characteristic function is obtained by performing Fourier transform on the probability density function of the data.
In step S3, the target data is input to the trained mixed pigment detection model to obtain a mixed pigment detection result of the cream to be detected, where the mixed pigment detection model is a migration model constructed based on a single pigment detection model, and the single pigment detection model is used to detect a single pigment detection result of the single pigment cream data.
Illustratively, data acquisition is carried out on cream of mixed pigments to be detected (such as amaranth and brilliant blue) by using a near infrared spectrum technology; preprocessing the collected spectral data of the mixed pigment cream to be detected; and inputting the preprocessed mixed pigment cream spectral data (target data) to be detected into a mixed pigment detection model to obtain the pigment content of the mixed pigment of the cream.
It can be understood that if want to detect the content of other mixed pigments, only need to wait to detect data and divide into training set and detection set, through the preliminary treatment after, train mixed pigment detection model with the training set again, use single pigment detection model to carry out the migration study as initial training model, can be fast convenient train out mixed pigment detection model, then will detect the collection and input mixed pigment detection model and obtain the detection result of final milk oil mixed pigment.
Optionally, in an embodiment, the mixed pigment detection model is established by: training a convolution neural network model based on the obtained monochrome cream data to obtain a monochrome detection model, wherein the convolution neural network model comprises a convolution pooling layer for extracting monochrome features of the monochrome cream data;
extracting a convolution pooling layer in the single-color element detection model, establishing a full-link layer, establishing a new convolution neural network model based on the plurality of convolution pooling layers and the full-link layer, and taking the new convolution neural network model as a migration model;
and training the migration model based on the obtained mixed pigment cream data to obtain a trained mixed pigment detection model.
Wherein, the single pigment cream data and the mixed pigment cream data are the preprocessed original spectrum data.
Illustratively, the establishing of the single pixel detection model includes:
randomly dividing the single pigment cream data into a training set and a testing set, wherein the quantity proportion of the training set and the testing set after the division meets the preset proportion (such as 6: 4); and importing real pigment content values corresponding to the data in the training set, and taking the training set and the real pigment content values as data of a training model.
The method comprises the steps of constructing a training model (namely a convolutional neural network model) by using a one-dimensional convolution function, vectorizing data by using a convolutional layer, a pooling layer and a full-link layer of the convolutional neural network in the training model, carrying out matrix operation, and finally outputting a specified dimensionality probability vector (namely a single voxel detection result). The loss is solved through each training, the network weight is updated along the gradient descending direction, the effect is gradually adjusted, and then the whole network is fitted with the real pigment content as much as possible, and a single pigment detection model is obtained.
In the experiment, a differential dimension reduction method combining sliding window and PCA dimension reduction is adopted for preprocessing the spectral data. By introducing the real pigment content value corresponding to the spectral data in the test set and analyzing the Mean Square Error (MSE) and the residual prediction deviation value (RPD) of the test set and the corresponding real pigment content value by using the single-color element detection model, the obtained MSE value breaks through the accuracy of four digits after a decimal point for the first time, the obtained RPD value is superior to the RPD value obtained by adopting other preprocessing methods and models, the effect of the single-color element detection model is very good, and the detection effect of the single-color element detection model is close to nondestructive detection.
Illustratively, the test set is input into a trained single color element detection model to obtain a predicted single color element content value, the result and the real single color element content in cream are calculated to obtain a Mean Square Error (MSE), and the formula is as follows:
Figure 201025DEST_PATH_IMAGE013
wherein the content of the first and second substances,
Figure 810998DEST_PATH_IMAGE014
is the true single-color pixel content value,
Figure 840134DEST_PATH_IMAGE014
the model predicted single voxel content value, n1 the data content in the test set, and MSE the mean square error value.
And calculating the prediction result and the real content of the monochromatics in the cream to obtain a residual prediction deviation value (RPD), wherein the formula is as follows:
Figure 874431DEST_PATH_IMAGE015
wherein, X1 is the real monochromator content value, X1 is the monochromator content value predicted by the model, E represents the average value calculation, and RPD is the residual prediction deviation value.
Illustratively, the data of the training model is the data of the divided training set and the corresponding real pigment content value, and the process of training the single pigment detection model includes:
a training model is constructed using a one-dimensional convolution function, the model being calculated as follows:
Figure 621807DEST_PATH_IMAGE016
wherein the content of the first and second substances,
Figure 35470DEST_PATH_IMAGE017
representing the difference between the true monochromator content value and the monochromator content value predicted by the model, and N represents the data volume of the training set.
Optionally, 24 layers of one-dimensional convolutional layers are selected to extract features, and a one-dimensional pooling layer is added after each two layers of convolutional layers to retain main features, so that parameters are reduced, and computational complexity is reduced. Each convolution layer uses a Linear rectification function (ReLU) as an activation function, and two convolution layers and one pooling layer are integrated to be used as one layer of a DN model in the convolutional neural network, namely the DN model comprises 12 convolution pooling layers and 2 full-connection layers, wherein the 12 convolution pooling layers are used for extracting the monochrome features of the monochrome cream data, and the 2 full-connection layers are used for flattening parameters and displaying the prediction result.
In the iterative process of the training model, data are transmitted to a final full-connection layer for 12 times layer by layer through the operation of a convolution pooling layer, then transmitted to an output end to calculate the difference with a real value so as to obtain an error, and transmitted back to each layer in a reverse mode, and parameters are updated according to gradients, so that the purpose of reducing the error is achieved. The iteration number of the training model can be set to be 50, namely after about 50 times of iterative training, the training model is used as a trained single pigment detection model.
Illustratively, the process of establishing the mixed pigment detection model includes:
randomly dividing the mixed pigment and cream data into a training set and a testing set, wherein the quantity proportion of the training set and the testing set after the division meets the preset proportion (such as 6: 4); and importing real pigment content values corresponding to the spectral data in the mixed pigment training set, and taking the training set and the real pigment content values as data of a training model.
It should be noted that the migration learning is to reuse the single-color pixel detection model as a starting point for training the mixed-color pixel model. For example, initializing the weight of a newly constructed training model by using the network weight of the single pigment detection model to replace the original random initialization; or, the single pigment detection model is used as a feature extractor of a new task, namely, a full connection layer is added on the basis of the original network of the single pigment detection model, and only the newly added full connection layer for outputting the detection result is trained.
As a possible implementation mode, a fine-tuning strategy of transfer learning is used, the characteristic similarity of a single pigment and a mixed pigment is found, part of weight parameters trained in a single pigment detection model are reserved, and a new convolutional neural network model is established based on the part of weight parameters to obtain a transfer model. For example, the weight parameters of the first 8 layers of convolution pooling layers in the single pigment detection model are fixed, and new convolution pooling layers and full-connected layers are added to obtain a migration model, which is then trained with a training set of mixed pigments and the true pigment content values.
Illustratively, for the convolution pooling layer of the first 8 layers in the single pixel detection model, which retains a large amount of information of the bottom layer, 4 layers of convolution pooling layers and the last full-link layer are added on the basis of the plurality of convolution pooling layers of the bottom layer.
Based on the parameters and the convolution pooling layer of the front 8 layers with fixed structure, training the convolution pooling layer of the back 4 layers and the full-connection layer by utilizing a training set and a real pigment content value. Namely, the data output by the convolution pooling layers of the first 8 layers needs to be transmitted 4 times layer by layer to the last full-connection layer, then transmitted to the output end to calculate the difference with the real pigment content value so as to obtain the error, and reversely transmitted back to the unfixed layers (the layers except the convolution pooling layers of the first 8 layers) so as to update the parameters according to the gradient, thereby achieving the purpose of reducing the error. After about 10 times of iterative training, a trained mixed pigment detection model can be obtained.
In the above embodiment, the transfer learning is used, so that the training effect on the single pigment detection model can be retained to some extent to the detection effect of the mixed pigment detection model. Through transfer learning, knowledge (such as a fixed network structure for extracting features, weight parameters and the like) can be obtained from a model (namely a single pigment detection model) trained previously to train a new model, and the method is suitable for solving the problems of small data volume and high difficulty of mixed pigment detection. The model is trained by using the transfer learning technology, so that the model can be trained under the condition of good effect, and the loss function can be reduced more quickly based on the previous training memory in the training process, so that the model can inherit the previous training effect, and the model training efficiency is improved.
It should be noted that RPD can comprehensively consider the standard deviation of the predicted sample chemical value and the predicted standard deviation of the created model, and is an important parameter for evaluating the resolution capability of the model. Generally, RPD is greater than 3.0, which shows that the calibration effect is good, and the established model can be used for actual sample detection.
In the experiment, a real mixed pigment content value corresponding to data in a mixed pigment test set is introduced, the test set is input into a trained mixed pigment detection model to obtain a predicted mixed pigment content value, and the result and the real mixed pigment content in the cream are calculated to obtain a Mean Square Error (MSE) and a residual prediction deviation value (RPD). The obtained MSE value still breaks through the accuracy of four digits after decimal point, and the RPD reaches 5.3262, which shows that the detection effect of the mixed pigment detection model is close to that of nondestructive detection compared with the complex mixed pigment which is difficult to detect by the traditional method, and the MSE value has the advantages of extremely high convergence speed, excellent performance, application prospect of realizing cross-platform detection and high popularization value in practical application.
In the above embodiments, although the steps are numbered as S1, S2, etc., but only the specific embodiments are given in this application, and those skilled in the art may adjust the execution sequence of S1, S2, etc. according to the actual situation, which is also within the protection scope of the present invention, it is understood that some embodiments may include some or all of the above embodiments.
As shown in fig. 2, a device 10 for detecting a milk oil mixed pigment according to an embodiment of the present invention includes:
the acquisition module 20 is used for acquiring spectral data of cream to be detected;
the preprocessing module 30 is configured to preprocess the spectral data to obtain target data;
and the detection module 40 is configured to input the target data to the trained mixed pigment detection model to obtain a mixed pigment detection result of the cream to be detected, where the mixed pigment detection model is a migration model constructed based on a single pigment detection model, and the single pigment detection model is used for detecting a single pigment detection result of the single pigment cream data.
Optionally, the preprocessing module 30 is specifically configured to segment the spectral data by using a sliding window to obtain at least two data segments; and performing dimensionality reduction on each data segment to obtain target data.
Optionally, the preprocessing module 30 is further configured to perform PCA dimension reduction on each data segment, and determine each data segment after the PCA dimension reduction as a signal feature data set; and acquiring a data segment meeting set conditions from the signal characteristic data set, and determining the data segment meeting the set conditions as target data, wherein the set conditions are that the data segment is a data segment with non-zero third-order cumulant and non-zero fourth-order cumulant.
Optionally, the detection module 40 is further configured to train a convolutional neural network model based on the obtained plain cream data to obtain a plain detection model, where the convolutional neural network model includes a convolution pooling layer for extracting a plain feature of the plain cream data; extracting a convolution pooling layer in the single-color element detection model, establishing a full-link layer, establishing a new convolution neural network model based on the plurality of convolution pooling layers and the full-link layer, and taking the new convolution neural network model as a migration model; and training the migration model based on the obtained mixed pigment cream data to obtain a trained mixed pigment detection model.
Optionally, the obtaining module 20 is specifically configured to perform data acquisition on cream to be detected through a near infrared spectrometer to obtain spectral data.
An embodiment of the present invention provides a computer-readable storage medium, which stores instructions that, when executed on a terminal device, cause the terminal device to perform the steps of the method for detecting a milk oil mixed pigment according to any one of the above embodiments.
As shown in fig. 3, an electronic device 500 according to an embodiment of the present invention includes a memory 510, a processor 520, and a program 530 stored in the memory 510 and running on the processor 520, where the processor 520 executes the program 530 to implement the steps of the method for detecting a milk-oil mixed pigment according to any one of the embodiments.
The electronic device 500 may be a computer, a mobile phone, or the like, and correspondingly, the program 530 is computer software or a mobile phone App, and the parameters and the steps in the electronic device 500 according to the present invention may refer to the parameters and the steps in the embodiment of the detection method for a butter mixed pigment, which are not described herein again.
As will be appreciated by one skilled in the art, the present invention may be embodied as a system, method or computer program product. Accordingly, the present disclosure may be embodied in the form of: may be embodied entirely in hardware, entirely in software (including firmware, resident software, micro-code, etc.) or in a combination of hardware and software, and may be referred to herein generally as a "circuit," module "or" system. Furthermore, in some embodiments, the invention may also be embodied in the form of a computer program product in one or more computer-readable media having computer-readable program code embodied in the medium.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A method for detecting a milk oil mixed pigment is characterized by comprising the following steps:
acquiring spectral data of cream to be detected;
preprocessing the spectral data to obtain target data;
and inputting the target data into a trained mixed pigment detection model to obtain a mixed pigment detection result of the cream to be detected, wherein the mixed pigment detection model is a migration model established on the basis of a single pigment detection model, and the single pigment detection model is used for detecting the single pigment detection result of the single pigment cream data.
2. The method of claim 1, wherein preprocessing the spectral data to obtain target data comprises:
segmenting the spectral data by utilizing a sliding window to obtain at least two data segments;
and performing dimensionality reduction processing on each data segment to obtain the target data.
3. The method of claim 2, wherein the performing the dimension reduction on each of the data segments to obtain the target data comprises:
carrying out PCA dimension reduction on each data segment, and determining each data segment subjected to PCA dimension reduction as a signal characteristic data set;
and acquiring a data segment meeting set conditions from the signal characteristic data set, and determining the data segment meeting the set conditions as the target data, wherein the set conditions are that the data segment is a data segment with non-zero third-order cumulant and non-zero fourth-order cumulant.
4. The method of claim 1, wherein the mixed pigment detection model is established by: training a convolution neural network model based on the obtained monochrome element cream data to obtain the monochrome element detection model, wherein the convolution neural network model comprises a convolution pooling layer used for extracting monochrome element characteristics of the monochrome element cream data;
extracting the convolution pooling layer in the single pixel detection model, establishing a full-connection layer, establishing a new convolution neural network model based on the convolution pooling layers and the full-connection layer, and taking the new convolution neural network model as the migration model;
and training the migration model based on the obtained mixed pigment cream data to obtain the trained mixed pigment detection model.
5. The method according to any one of claims 1 to 4, wherein the acquiring of the spectral data of the cream to be detected comprises:
and carrying out data acquisition on the cream to be detected through a near-infrared spectrometer to obtain the spectral data.
6. A device for detecting a cream mixed color, comprising:
the acquisition module is used for acquiring spectral data of cream to be detected;
the preprocessing module is used for preprocessing the spectral data to obtain target data;
and the detection module is used for inputting the target data into a trained mixed pigment detection model to obtain a mixed pigment detection result of the cream to be detected, wherein the mixed pigment detection model is a migration model established on the basis of a single pigment detection model, and the single pigment detection model is used for detecting the single pigment detection result of the single pigment cream data.
7. The apparatus according to claim 6, wherein the preprocessing module is configured to segment the spectral data using a sliding window to obtain at least two data segments; and performing dimensionality reduction processing on each data segment to obtain the target data.
8. The apparatus of claim 7, wherein the preprocessing module is further configured to perform PCA dimension reduction on each of the data segments, and determine each of the data segments after PCA dimension reduction as a signal feature data set; and acquiring a data segment meeting set conditions from the signal characteristic data set, and determining the data segment meeting the set conditions as the target data, wherein the set conditions are that the data segment is a data segment with non-zero third-order cumulant and non-zero fourth-order cumulant.
9. A computer-readable storage medium, characterized in that instructions are stored therein, which, when run on a terminal device, cause the terminal device to perform the steps of the method of detection of milk-oil mixed pigments according to any of claims 1 to 5.
10. An electronic device comprising a memory, a processor and a program stored on the memory and running on the processor, characterized in that the processor implements the steps of the method for detecting a milk-oil mixed color according to any one of claims 1 to 5 when executing the program.
CN202210276771.8A 2022-03-21 2022-03-21 Detection method and device for milk oil mixed pigment, electronic equipment and storage medium Pending CN114371145A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210276771.8A CN114371145A (en) 2022-03-21 2022-03-21 Detection method and device for milk oil mixed pigment, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210276771.8A CN114371145A (en) 2022-03-21 2022-03-21 Detection method and device for milk oil mixed pigment, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114371145A true CN114371145A (en) 2022-04-19

Family

ID=81145201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210276771.8A Pending CN114371145A (en) 2022-03-21 2022-03-21 Detection method and device for milk oil mixed pigment, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114371145A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1656485A (en) * 2002-04-22 2005-08-17 哈里公司 Blind source separation utilizing a spatial fourth order cumulant matrix pencil
CN109858516A (en) * 2018-12-24 2019-06-07 武汉工程大学 A kind of fire and smog prediction technique, system and medium based on transfer learning
CN112347697A (en) * 2020-11-10 2021-02-09 上海交通大学 Method and system for screening optimal carrier material in lithium-sulfur battery based on machine learning
CN113988358A (en) * 2021-09-07 2022-01-28 南方电网大数据服务有限公司 Carbon emission index prediction and treatment method based on transfer reinforcement learning
CN114088661A (en) * 2021-11-18 2022-02-25 云南省烟草农业科学研究院 Online prediction method for chemical components in tobacco leaf curing process based on transfer learning and near infrared spectrum
CN114112992A (en) * 2022-01-20 2022-03-01 武汉工程大学 Detection method and device for blue pigment of cream and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1656485A (en) * 2002-04-22 2005-08-17 哈里公司 Blind source separation utilizing a spatial fourth order cumulant matrix pencil
CN109858516A (en) * 2018-12-24 2019-06-07 武汉工程大学 A kind of fire and smog prediction technique, system and medium based on transfer learning
CN112347697A (en) * 2020-11-10 2021-02-09 上海交通大学 Method and system for screening optimal carrier material in lithium-sulfur battery based on machine learning
CN113988358A (en) * 2021-09-07 2022-01-28 南方电网大数据服务有限公司 Carbon emission index prediction and treatment method based on transfer reinforcement learning
CN114088661A (en) * 2021-11-18 2022-02-25 云南省烟草农业科学研究院 Online prediction method for chemical components in tobacco leaf curing process based on transfer learning and near infrared spectrum
CN114112992A (en) * 2022-01-20 2022-03-01 武汉工程大学 Detection method and device for blue pigment of cream and storage medium

Non-Patent Citations (11)

* Cited by examiner, † Cited by third party
Title
亓铭瑞等: "基于CNN-BiGRU 的空间目标RCS 异常检测方法", 《空间电子技术》 *
何盈盈: "基于回声状态与多尺度卷积联合模型", 《中国优秀博硕士学位论文全文数据库(硕士)》 *
司马海峰等: "《遥感图像分类中的智能计算方法》", 31 January 2018, 吉林大学出版社 *
周祥等: "基于CSI的日常行为识别方法", 《计算机工程与设计》 *
唐友福等: "《高阶统计量工具箱及其在机械故障诊断中的应用》", 31 October 2017, 哈尔滨工业大学出版社 *
汪海晋等: "基于一维卷积神经网络的螺旋铣刀具磨损监测", 《浙江大学学报》 *
罗正华等: "干扰环境下无人机图传信号的识别技术", 《现代电子技术》 *
苗芃等: "基于迁移学习的植物花朵图像识别方法", 《电脑知识与技术》 *
谷延锋等: "基于光谱解译的高光谱图像奇异检测算法", 《红外与毫米波学报》 *
闫龙川等译: "《TensorFlow 2.0神经网络实践》", 30 June 2020, 机械工业出版社 *
高东生等: "基于独立分量分析的高光谱图像目标盲探测方法研究", 《国家安全地球物理丛书(八)——遥感地球物理与国家安全中国地球物理学会专题资料汇编》 *

Similar Documents

Publication Publication Date Title
CN108491849B (en) Hyperspectral image classification method based on three-dimensional dense connection convolution neural network
Yuan et al. Remote sensing image segmentation by combining spectral and texture features
Du et al. Spatial and spectral unmixing using the beta compositional model
Plaza et al. Spatial/spectral endmember extraction by multidimensional morphological operations
CN107992891B (en) Multispectral remote sensing image change detection method based on spectral vector analysis
CN108229551B (en) Hyperspectral remote sensing image classification method based on compact dictionary sparse representation
CN108182449A (en) A kind of hyperspectral image classification method
Xu et al. Hyperspectral image denoising using a spatial–spectral monte carlo sampling approach
CN107610118B (en) Based on dMImage segmentation quality evaluation method
CN107145831B (en) Hyperspectral image classification method based on vector probability diffusion and Markov random field
CN111680579B (en) Remote sensing image classification method for self-adaptive weight multi-view measurement learning
Wang et al. The PAN and MS image fusion algorithm based on adaptive guided filtering and gradient information regulation
Song et al. Detection of subpixel targets on hyperspectral remote sensing imagery based on background endmember extraction
CN112733736A (en) Class imbalance hyperspectral image classification method based on enhanced oversampling
CN110097499B (en) Single-frame image super-resolution reconstruction method based on spectrum mixing kernel Gaussian process regression
Da et al. Spectral-spatial target detection based on data field modeling for hyperspectral data
Antoniadis et al. Peaks detection and alignment for mass spectrometry data
CN111222576A (en) High-resolution remote sensing image classification method
CN111460943A (en) Remote sensing image ground object classification method and system
Huang et al. A hybrid spatial-spectral denoising method for infrared hyperspectral images using 2DPCA
Wang et al. Autonomous endmember detection via an abundance anomaly guided saliency prior for hyperspectral imagery
CN114371145A (en) Detection method and device for milk oil mixed pigment, electronic equipment and storage medium
CN113887656B (en) Hyperspectral image classification method combining deep learning and sparse representation
Ma et al. Multi-spectral image change detection based on single-band iterative weighting and fuzzy C-means clustering
CN115511928A (en) Matching method of multispectral image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220419