CN112035718A - Meat detection method based on time series classification method of trend consistency matching - Google Patents
Meat detection method based on time series classification method of trend consistency matching Download PDFInfo
- Publication number
- CN112035718A CN112035718A CN202010814796.XA CN202010814796A CN112035718A CN 112035718 A CN112035718 A CN 112035718A CN 202010814796 A CN202010814796 A CN 202010814796A CN 112035718 A CN112035718 A CN 112035718A
- Authority
- CN
- China
- Prior art keywords
- time sequence
- distance
- time
- trend
- optimal
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 71
- 235000013372 meat Nutrition 0.000 title claims abstract description 28
- 238000001514 detection method Methods 0.000 title claims abstract description 17
- 238000004364 calculation method Methods 0.000 claims abstract description 47
- 238000005452 bending Methods 0.000 claims abstract description 44
- 238000012360 testing method Methods 0.000 claims abstract description 27
- 238000012549 training Methods 0.000 claims abstract description 25
- 238000012216 screening Methods 0.000 claims abstract description 5
- 230000008569 process Effects 0.000 claims description 20
- 230000011218 segmentation Effects 0.000 claims description 17
- 238000004566 IR spectroscopy Methods 0.000 claims description 6
- 230000001174 ascending effect Effects 0.000 claims description 6
- 238000009825 accumulation Methods 0.000 claims description 4
- 238000001228 spectrum Methods 0.000 claims description 4
- 239000006185 dispersion Substances 0.000 claims description 3
- 235000015278 beef Nutrition 0.000 description 20
- 235000013305 food Nutrition 0.000 description 8
- 230000002776 aggregation Effects 0.000 description 5
- 238000004220 aggregation Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000003909 pattern recognition Methods 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000000306 component Substances 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 239000005428 food component Substances 0.000 description 1
- 235000012041 food component Nutrition 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 210000003734 kidney Anatomy 0.000 description 1
- 210000004185 liver Anatomy 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000877 morphologic effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/906—Clustering; Classification
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/17—Systems in which incident light is modified in accordance with the properties of the material investigated
- G01N21/25—Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
- G01N21/31—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
- G01N21/35—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
- G01N21/3563—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light for analysing solids; Preparation of samples therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2474—Sequence data queries, e.g. querying versioned data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/018—Certifying business or products
- G06Q30/0185—Product, service or business identity fraud
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Software Systems (AREA)
- Analytical Chemistry (AREA)
- Computational Linguistics (AREA)
- Chemical & Material Sciences (AREA)
- Immunology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Fuzzy Systems (AREA)
- Biochemistry (AREA)
- Probability & Statistics with Applications (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Pathology (AREA)
- Mathematical Physics (AREA)
- Entrepreneurship & Innovation (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Finance (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- General Health & Medical Sciences (AREA)
Abstract
The invention discloses a meat detection method based on a time series classification method of trend consistency matching, which comprises S1, training time sequence distance classification calculation, obtaining an optimal time sequence with the minimum bending distance in a class and a corresponding distance threshold; s2: performing trend representation on the optimal time sequence; s3: calculating the time bending distance between the test time sequence and the optimal time sequence, and screening the time sequence according to a distance threshold to obtain a candidate set; s4: performing trend representation on the time sequence in the time sequence alternative set, and performing consistency calculation with the optimal time sequence trend representation result; s5: finally determining the type of the test time sequence according to the calculation result of the matching consistency with the optimal time sequences of a plurality of types; the experimental results of the recognized time sequence database prove that the classification accuracy, recall rate and other indexes are remarkably improved, the classification result is not influenced by a plurality of time sequence types and data length, the classification standard is clear, and multiple times of training model learning is not needed.
Description
Technical Field
The invention relates to the technical field of time series classification in pattern recognition, in particular to a meat detection method based on a time series classification method of trend consistency matching.
Background
The time series has classification requirements in the fields of finance, medicine, meteorology and the like, the time series classification aims at obtaining corresponding time sequence characteristics according to training set data, judging the value of actual data according to the relation between an observed value and a characteristic value of a classification example, completing distance calculation on the basis of similarity measurement, and realizing that different types of time sequence classification are concerned by researchers through discrete representation or identification of numerical attributes, for example, in the field of food safety, infrared spectroscopy is generally adopted to identify food components, so that food calories and the like can be identified, food foreign matter pollution is prevented, in the process of identifying the components of meat, a time series classification method is adopted to identify the spectral data of the meat, identify the type of the meat, ensure the purity of beef, and has very important significance for food safety;
during the research process of time series, researchers have proposed the following several time series classification methods, the respective principles and advantages and disadvantages of which are as follows:
the time sequence simplified representation can reduce data dimensionality, realize lower calculation consumption and embody the time domain characteristics required by the classified training process; the requirements include: the overall trend characteristics are kept; the identification is clear and the comparison is easy to realize; insensitive to local noise or low amplitude fluctuations. Aiming at the trend characteristics of the time sequence, a method for classifying the shape of the subsequence is adopted, but the calculation time consumption of the method is too high, the time consumption of a corresponding improved method is high under the condition of a large data set, and the classification accuracy is not high;
symbolized represents a PAA method derived from piecewise linearity, with the most common being the symbol aggregation approximation method SAX; the aggregation approximation method divides the distribution space through the data distribution probability, and performs character representation according to the condition of the distribution space in which the segment mean value is positioned; the aggregation approximation method cannot reflect the sequence of the sub-trends, and meanwhile, the aggregation symbol results still need distance comparison; distance calculation with higher precision requirement is carried out on the basis of the mean probability, and the accuracy and the recall rate are both clearly influenced;
the linear segmentation method has the function of trend representation, but in order to ensure the comparability of the identification result, fixed step sampling segmentation is generally adopted; when a larger fixed step length is adopted, the obtained time sequence points often skip the maximum point, so that the trend identification cannot reflect the main characteristics; finally, the segmentation is too much, symbol marks cannot be effectively compared, and the defect cannot be overcome even if the sampling frequency is increased; at present, researchers begin to classify by adopting a method combining symbol aggregation approximation and dynamic time warping, but the symbolic mean method still needs to be fixedly segmented firstly, and classification errors caused by local morphological characteristics of a time sequence can be ignored; meanwhile, too many extremum segments will cause too many time sequence segments, and the main trend of the time sequence cannot be reflected. The time sequence segmented representation method mainly comprises segmented constant representation and segmented linear representation, mainly aims at solving the problem of fitting degree, and has the advantages of single representation mode and difficulty in fitting data with large fluctuation;
the piecewise linear method of the time sequence can rapidly segment the time sequence, has visual form and low computational complexity; the method mainly adopts an end point connection mode to express the curve form, and adopts a mechanical equal length method for step length selection to obtain a corresponding segmentation result; however, the end point direct method ignores the change process of the time sequence, and cannot effectively represent the data when the data in the interval has large amplitude change, which causes corresponding calculation precision loss; the corresponding turning points need to be established by combining the actual trend and the characteristics of the time sequence, and the local change in the interval is labeled, so that a definite time sequence segmented representation result is finally obtained.
Disclosure of Invention
Aiming at the existing problems, the invention aims to provide a meat detection method based on a time sequence classification method of trend consistency matching, in the process of detecting the purity of meat, the method firstly adopts an infrared spectroscopy to obtain the time sequence data of the meat, divides a time sequence data set into a training time sequence and a testing time sequence with the same length and size, obtains an intra-class optimal time sequence and a corresponding bending distance value by classifying and learning a training sample, and carries out extreme value segmentation and identification on the optimal time sequence; secondly, screening the test time sequence by adopting the bending distance values obtained in the training process, carrying out extremum segmentation on the obtained time sequence, carrying out trend matching with the extremum segmentation and the identification result of the optimal time sequence to obtain a final classification result, and experiments prove that the time sequence classification method adopting the trend consistency matching can improve the identification success rate of the pure beef and the adulterated samples, better ensure the food safety and has the characteristics of accurate and quick classification effect.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
the meat detection method based on the time series classification method of trend consistency matching comprises the following steps:
s1, when meat is detected by using an infrared spectroscopy, firstly, disordered time sequence data formed by the spectrum are obtained, the disordered time sequence data are divided into a training time sequence and a testing time sequence which are the same in length and size, in-class distance classification calculation is carried out on the training time sequence, and the optimal time sequence with the minimum in-class bending distance of the training time sequence and a corresponding distance threshold are obtained;
s2, performing trend representation on the optimal time sequence obtained in the step S1;
s3, calculating a time bending distance between the test time sequence and the optimal time sequence obtained in the S1, and screening the time sequence according to a distance threshold value to obtain a time sequence candidate set;
s4, performing trend representation on the time sequence in the time sequence alternative set obtained in the S3, and performing consistency calculation on the time sequence and the optimal time sequence trend representation result obtained in the S2;
and S5, finally determining the type of the test time sequence according to the optimal time sequence matching consistency calculation results of the multiple types, comparing the type with the time sequence type of the standard meat, and judging whether the meat is adulterated.
Preferably, the obtaining of the optimal timing sequence in step S1 includes:
s101, firstly, performing traversal calculation of time bending distances on all training time sequences of the same type;
s102, calculating and summing the time bending distance of each training time sequence and other time sequences of the same type, wherein the distance and the minimum time sequence are the optimal time sequence of the type, and the specific process is as follows:
(1) time series warped distance summation calculation:
wherein: dbase(s1,t1) As a base distance, adding up a distance Ddtw(S, T) selecting the minimum value of the three points at the left, lower part and left lower part of the current position and the base distance of the current point as the accumulated distance;
(2) sorting the bending distance results, and selecting the time sequence with the minimum accumulation distance as the optimal time sequence tyts:
preferably, the distance threshold in step S1 is a mean value of the distance between the optimal time sequence and other time sequences in the class, and the time sequence in the class is a time sequence in the training time sequence that is consistent with the type of the time sequence.
Preferably, the specific process of trending the optimal time sequence in step S2 includes:
s201, sequentially connecting all extreme points of the optimal time sequence to obtain a segmentation interval { S ] of the optimal time sequencekRepresents the time sequence S by a segment PNkRising or falling of }, then:
wherein: k, k +1 represents a time series SkDifferent segmentation of { when PN }k,k+1When-1, represents a time series { S }kA certain segment is dropped when PNk,k+1When +1, represents a time series { S }kRising a certain section;
s202, judging the ascending or descending trend of the interval, and calculating the segmentation interval { SkDetermining the trend representation result of the time sequence according to the multiple relation of the interval amplitude KN and the time sequence standard deviation, and then:
KNk,k+1=[(Sk+1-Sk)/v]
wherein: v represents S for a time seriesiAverage M, standard deviation of the entire sequence:the standard deviation can measure the degree of dispersion of the numerical value from the average value; and measuring the time sequence by adopting the standard deviation in the segmented interval, and judging the interval trend.
Preferably, the obtaining of the time-series alternative set in step S3 includes:
s301, calculating the time bending distance between the test time sequence and the optimal time sequence, wherein the time bending distance is calculated as follows:
wherein: dbase(s1,t1) As a base distance, adding up a distance Ddtw(S, T) selecting the minimum value of the three points at the left, lower and left lower parts of the current position plus the base distance of the current point as an accumulated distance to obtain a corresponding accumulated distance as a result D of the final bending distancedtw(S,T);
S302, comparing the time bending distance calculation result with a distance threshold corresponding to the optimal time sequence, wherein the time bending distance calculation result is larger than the distance threshold, does not belong to the type of the optimal time sequence, is smaller than the distance threshold, belongs to the type of the optimal time sequence, and enters an alternative set.
Preferably, the specific process of the consistency calculation in step S4 includes:
s401, sequentially connecting all extreme points EXTREM (a, b) of a time sequence in a time sequence alternative set to obtain a time sequence subsection interval in the alternative set;
wherein: EXTREM (a, b) ═ S (S)a,sb) A and b represent two extreme points in succession;
s402, judging the ascending or descending trend of the interval, and judging the multiple relation KN of the interval amplitude and the time sequence standard deviation of the segmented intervala,bDetermining a trend representation result of the time sequence;
wherein: KNa,b=[(Sb-Sa)/v]V represents the mean M, the standard deviation of the whole time sequence for the time sequence Si:
s403, according to the result of the standard deviation, subtracting the interval with the fluctuation lower than the standard deviation in the result represented by the trend in the step S202 and the step S402, and performing consistency calculation, namely, the remaining interval calculation mode is as follows:
|sb-sa|>v
wherein: for Feature identification, the most-valued identification and the volatility need to be calculated in sequence: firstly, calculating the most valued flag, and when the count (max (feature)) is true, calculating the volatility flag volume (max (feature)) which is volume (feature); if the volatility identification also keeps consistent, the test time sequence and the optimal time sequence trend have trend consistency.
Preferably, the method for determining the type of the test timing sequence in step S5 is: when the appearance time sequence accords with a plurality of types, the type is determined according to the principle of bending distance priority.
The invention has the beneficial effects that: the invention discloses a meat detection method based on a time series classification method of trend consistency matching, and compared with the prior art, the improvement of the invention is as follows:
(1) the invention designs a meat detection method based on a time sequence classification method of trend consistency matching, the method combines the advantages of two types of modes of time bending distance calculation and trend consistency calculation, fully considers interval fluctuation and symbolization of time sequence on the basis of reflecting the effect of data accumulation fluctuation on distance, provides a classification method with accurate calculation for time sequence classification in the field of pattern recognition, and the classification method shows good classification performance for time sequence classification with multiple types and high dimensionality;
(2) the symbol mark provided by the method has the trend representation effect, and the comparability of the mark result can be ensured; the method provided by the invention can also solve the problem that the time sequence with the bending distance meeting the threshold requirement cannot be subjected to trend identification;
(3) the method for the reference time sequence can improve the success rate of identifying the pure beef and the adulterated samples after obtaining the intra-class optimal time sequence, better ensure the food safety, and has the advantages of quicker learning process and quicker updating speed of a new training set.
Drawings
FIG. 1 is a flowchart of the calculation of the time series classification method based on trend consistent matching according to the present invention.
FIG. 2 is a schematic diagram of segment identification by using the time series classification method based on trend consistency matching according to the present invention.
Fig. 3 is a result diagram of classifying 2 kinds of beef time sequences by using a trend consistency matching time sequence classification method in embodiment 1 of the present invention.
Wherein: in fig. 3: (a) a result graph representing beef timing 1; (b) a result graph representing beef timing 2, and (c) a result graph representing beef timing 3.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the following further describes the technical solution of the present invention with reference to the drawings and the embodiments.
The time sequence classification method based on trend consistency matching is applied to the field of beef purity detection of food safety, the infrared spectroscopy is adopted to identify the pure beef and the adulterated beef (heart, pig tripe, kidney and liver), the time sequence data formed by the spectrum is combined, and the trend consistency matching time sequence classification method is adopted, so that the identification success rate of the pure beef and the adulterated sample can be improved, and the food safety can be better ensured;
the meat detection method based on the time series classification method of trend consistency matching shown in the attached figures 1-3 comprises the following steps:
s1, when meat is detected by using an infrared spectroscopy, firstly, disordered time sequence data formed by the spectrum are obtained, the disordered time sequence data are divided into a training time sequence and a testing time sequence which are the same in length and size, in-class distance classification calculation is carried out on the training time sequence, and the optimal time sequence with the minimum in-class bending distance of the training time sequence and a corresponding distance threshold are obtained;
the process of obtaining the optimal time sequence comprises the following steps:
s101, firstly, performing traversal calculation of time bending distances on all training time sequences of the same type;
s102, calculating and summing the time bending distance of each time sequence and other time sequences of the same type, wherein the distance and the minimum time sequence are the optimal time sequence of the type, and the specific process is as follows:
(1) time series warped distance summation calculation:
wherein: dbase(s1,t1) As a base distance, adding up a distance Ddtw(S, T) selecting the minimum value of the three points at the left, lower part and left lower part of the current position and the base distance of the current point as the accumulated distance;
(2) sorting the bending distance results, and selecting the time sequence with the minimum accumulation distance as the optimal time sequence tyts:
wherein: the distance threshold refers to the average value of the distance between the optimal time sequence and other time sequences in the class, and the time sequence in the class is a time sequence in the training time sequence and the type of the time sequence is consistent.
S2, performing trend representation on the optimal time sequence obtained in the step S1, wherein the specific process of performing trend representation on the optimal time sequence comprises the following steps:
s201, sequentially connecting all extreme points of the optimal time sequence to obtain a segmentation interval { S ] of the optimal time sequencekRepresents the time sequence S by a segment PNkRising or falling of }, then:
wherein: k, k +1 represents a time series SkDifferent segmentation of { when PN }k,k+1When-1, represents a time series { S }kA certain segment is dropped when PNk,k+1When +1, represents a time series { S }kRising a certain section;
s202, judging the ascending or descending trend of the interval, and calculating the segmentation interval { SkDetermining the trend representation result of the time sequence according to the multiple relation of the interval amplitude KN and the time sequence standard deviation, and then:
KNk,k+1=[(Sk+1-Sk)/v]
wherein: v represents S for a time seriesiAverage M, standard deviation of the entire sequence:the standard deviation can measure the degree of dispersion of the numerical value from the average value; in the segmented interval, measuring the time sequence by adopting a standard deviation, and judging the trend of the interval; as shown in FIG. 2, G represents upward, B represents downward, and GiAnd BiThe representing interval amplitude reaches i times of the standard deviation, and 3 represents the interval amplitude reaches 3 times of the standard deviation;
s3, calculating a time bending distance between the test time sequence and the optimal time sequence obtained in the S1, screening the time sequences according to a distance threshold, and specifically, obtaining a corresponding accumulated distance as a result of a final bending distance by calculating a base distance between the test time sequence and the optimal time sequence and adding the minimum value of the distances in the three directions; comparing the distance calculation result with a distance threshold corresponding to the optimal time sequence, if the distance calculation result is greater than the distance threshold, the type of the optimal time sequence is not belonged to, if the distance calculation result is less than the distance threshold, the type of the optimal time sequence is belonged to, entering a candidate set, and obtaining a time sequence candidate set;
the process of obtaining the time sequence alternative set comprises the following steps:
s301, calculating the time bending distance between the test time sequence and the optimal time sequence, wherein the time bending distance is calculated as follows:
wherein: wherein: dbase(s1,t1) As a base distance, adding up a distance Ddtw(S, T) selecting the minimum value of the three points at the left, lower and left lower parts of the current position plus the base distance of the current point as an accumulated distance to obtain a corresponding accumulated distance as a result D of the final bending distancedtw(S,T);
S302, comparing the time bending distance calculation result with a distance threshold corresponding to the optimal time sequence, wherein the time bending distance calculation result is larger than the distance threshold, does not belong to the type of the optimal time sequence, is smaller than the distance threshold, belongs to the type of the optimal time sequence, and enters an alternative set.
S4, performing trend representation on the time sequence in the time sequence alternative set obtained in the S3, and performing consistency calculation on the time sequence and the optimal time sequence trend representation result obtained in the S2;
the specific process of consistency calculation comprises the following steps:
s401, sequentially connecting all extreme points EXTREM (a, b) of a time sequence in a time sequence alternative set to obtain a time sequence subsection interval in the alternative set;
wherein: EXTREM (a, b) ═ S (S)a,sb) A and b represent two extreme points in succession;
s402, judging the ascending or descending trend of the interval, and judging the multiple relation KN of the interval amplitude and the time sequence standard deviation of the segmented intervala,bDetermining a trend representation result of the time sequence;
wherein: KNa,b=[(Sb-Sa)/v]V represents the mean M, the standard deviation of the whole time sequence for the time sequence Si:
s403, according to the result of the standard deviation, subtracting the interval with the fluctuation lower than the standard deviation in the result represented by the trend in the step S202 and the step S402, and performing consistency calculation, namely, the remaining interval calculation mode is as follows:
|sb-sa|>v
wherein: for Feature identification, the most-valued identification and the volatility need to be calculated in sequence: firstly, calculating the most valued flag, and when the count (max (feature)) is true, calculating the volatility flag volume (max (feature)) which is volume (feature); if the volatility identification also keeps consistent, the test time sequence and the optimal time sequence trend have trend consistency.
S5, finally determining the type of the test time sequence according to the calculation result of the matching consistency with the optimal time sequences of multiple types;
the method for determining the type of the test time sequence comprises the following steps: when the occurrence time sequence accords with a plurality of types, determining the types according to the principle of bending distance priority, such as: if the timing s and the two different types of timing t1 t2Time bending distance D ofdtw(s,t1) And Ddtw(s,t2) Are all less than the corresponding distance threshold, wherein the type represented by the smaller distance is the final type, i.e., when D is less than the corresponding distance thresholddtw(s,t1)<dtw(s,t2) When the temperature of the water is higher than the set temperature,
example 1:
the method comprises the following steps: selecting a Beef Beef database with the length of 470, the type of 5 and the number of 30, calculating the bending distance of the optimal time sequence in the class according to the type to obtain the optimal time sequence and a corresponding distance threshold in the class;
the time sequences for calculating the distance are equal in length, and the distance formula is as follows:
step two: performing trend representation on the time sequence of each type, and representing the time sequence as a corresponding form of Feature identification Feature; the segment representation for the type 1 optimal timing is shown in table 1:
table 1: segmentation of type 1 optimal timing
G1 | G1 | G2 | G2 | B3 | B1 |
Step three: calculating the bending distance between the test time sequence and the optimal time sequence of each type, and comparing the bending distance with a distance threshold k to obtain a test time sequence candidate set;
TSb=TSDTW<K
step four: performing trend representation on the time sequence in the time sequence alternative set, and performing consistency calculation with the optimal time sequence trend representation result;
for Feature identification, the most-valued identification and the volatility need to be calculated in sequence:
first, the maximum flag is calculated, and when count (max (feature)) is true, the volatility flag volume (max (feature)) is calculated. The test time sequence and the optimal time sequence have trend consistency; the most-valued identifications in the table are consistent, but the volatility is inconsistent, and the two time sequence trends are different, which is specifically shown in table 2;
table 2: each beef time sequence trend table
1 | G1 | G1 | G2 | | B3 | B1 | |
2 | G1 | G1 | G2 | | B3 | B1 | |
3 | B1 | G1 | G2 | G2 | B4 |
Step five: according to the calculation result of the matching consistency with the optimal time sequences of multiple types, the type of the test time sequence is finally determined, and as can be seen from table 2 and fig. 3, the trends of the beef time sequence 1 and the beef time sequence 2 are the same, and the beef time sequence 3 is different from the beef time sequence 1 and the beef time sequence 2, so that the possibility of adulteration of the beef time sequence 3 can be judged.
The foregoing shows and describes the general principles, essential features, and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.
Claims (7)
1. The meat detection method based on the time series classification method of trend consistency matching is characterized in that: the method comprises the following steps:
s1, when meat is detected by using an infrared spectroscopy, firstly, disordered time sequence data formed by the spectrum are obtained, the disordered time sequence data are divided into a training time sequence and a testing time sequence which are the same in length and size, in-class distance classification calculation is carried out on the training time sequence, and the optimal time sequence with the minimum in-class bending distance of the training time sequence and a corresponding distance threshold are obtained;
s2, performing trend representation on the optimal time sequence obtained in the step S1;
s3, calculating a time bending distance between the test time sequence and the optimal time sequence obtained in the S1, and screening the time sequence according to a distance threshold value to obtain a time sequence candidate set;
s4, performing trend representation on the time sequence in the time sequence alternative set obtained in the S3, and performing consistency calculation on the time sequence and the optimal time sequence trend representation result obtained in the S2;
and S5, finally determining the type of the test time sequence according to the optimal time sequence matching consistency calculation results of the multiple types, comparing the type with the time sequence type of the standard meat, and judging whether the meat is adulterated.
2. The meat detection method based on the time series classification method of trend consistent matching as claimed in claim 1, wherein: the process of obtaining the optimal timing sequence in step S1 includes:
s101, firstly, performing traversal calculation of time bending distances on all training time sequences of the same type;
s102, calculating and summing the time bending distance of each training time sequence and other time sequences of the same type, wherein the distance and the minimum time sequence are the optimal time sequence of the type, and the specific process is as follows:
(1) time series warped distance summation calculation:
wherein: dbase(s1,t1) As a base distance, adding up a distance Ddtw(S, T) selecting the minimum value of the three points at the left, lower part and left lower part of the current position and the base distance of the current point as the accumulated distance;
(2) sorting the bending distance results, and selecting the time sequence with the minimum accumulation distance as the optimal time sequence tyts:
3. the meat detection method based on the time series classification method of trend consistent matching as claimed in claim 2, wherein: the distance threshold in step S1 is the average of the distances between the optimal time sequence and other time sequences in the class, and the time sequence in the class is a time sequence in the training time sequence that is consistent with the type of the time sequence.
4. The meat detection method based on the time series classification method of trend consistent matching as claimed in claim 1, wherein: the specific process of trending the optimal time sequence in step S2 includes:
s201, sequentially connecting all extreme points of the optimal time sequence to obtain a segmentation interval { S ] of the optimal time sequencekRepresents the time sequence S by a segment PNkRising or falling of }, then:
wherein: k, k +1 represents a time series SkDifferent segmentation of { when PN }k,k+1When-1, represents a time series { S }kA certain segment is dropped when PNk,k+1When +1, represents a time series { S }kRising a certain section;
s202, judging the ascending or descending trend of the interval, and calculating the segmentation interval { SkDetermining the trend representation result of the time sequence according to the multiple relation of the interval amplitude KN and the time sequence standard deviation, and then:
KNk,k+1=[(Sk+1-Sk)/v]
wherein: v represents S for a time seriesiAverage M, standard deviation of the entire sequence:the standard deviation can measure the degree of dispersion of the numerical value from the average value; and measuring the time sequence by adopting the standard deviation in the segmented interval, and judging the interval trend.
5. The meat detection method based on the time series classification method of trend consistent matching as claimed in claim 1, wherein: the process of obtaining the time-series alternative set in step S3 includes:
s301, calculating the time bending distance between the test time sequence and the optimal time sequence, wherein the time bending distance is calculated as follows:
wherein: dbase(s1,t1) As a base distance, adding up a distance Ddtw(S, T) selecting the minimum value of the three points at the left, lower and left lower parts of the current position plus the base distance of the current point as an accumulated distance to obtain a corresponding accumulated distance as a result D of the final bending distancedtw(S,T);
S302, comparing the time bending distance calculation result with a distance threshold corresponding to the optimal time sequence, wherein the time bending distance calculation result is larger than the distance threshold, does not belong to the type of the optimal time sequence, is smaller than the distance threshold, belongs to the type of the optimal time sequence, and enters an alternative set.
6. The meat detection method based on the time series classification method of trend consistent matching as claimed in claim 4, wherein: the specific process of consistency calculation in step S4 includes:
s401, sequentially connecting all extreme points EXTREM (a, b) of a time sequence in a time sequence alternative set to obtain a time sequence subsection interval in the alternative set;
wherein: EXTREM (a, b) ═ S (S)a,sb) A and b represent two extreme points in succession;
s402, judging the ascending or descending trend of the interval, and judging the multiple relation KN of the interval amplitude and the time sequence standard deviation of the segmented intervala,bDetermining a trend representation result of the time sequence;
wherein: KNa,b=[(Sb-Sa)/v]V represents the mean M, the standard deviation of the whole time sequence for the time sequence Si:
s403, according to the result of the standard deviation, subtracting the interval with the fluctuation lower than the standard deviation in the result represented by the trend in the step S202 and the step S402, and performing consistency calculation, namely, the remaining interval calculation mode is as follows:
|sb-sa|>v
wherein: for Feature identification, the most-valued identification and the volatility need to be calculated in sequence: firstly, calculating the most valued flag, and when the count (max (feature)) is true, calculating the volatility flag volume (max (feature)) which is volume (feature); if the volatility identification also keeps consistent, the test time sequence and the optimal time sequence trend have trend consistency.
7. The meat detection method based on the time series classification method of trend consistent matching as claimed in claim 1, wherein: the method for determining the type of the test timing sequence in step S5 includes: when the appearance time sequence accords with a plurality of types, the type is determined according to the principle of bending distance priority.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010814796.XA CN112035718B (en) | 2020-08-13 | 2020-08-13 | Meat detection method based on trend consistency matching time sequence classification method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010814796.XA CN112035718B (en) | 2020-08-13 | 2020-08-13 | Meat detection method based on trend consistency matching time sequence classification method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112035718A true CN112035718A (en) | 2020-12-04 |
CN112035718B CN112035718B (en) | 2023-07-21 |
Family
ID=73577232
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010814796.XA Active CN112035718B (en) | 2020-08-13 | 2020-08-13 | Meat detection method based on trend consistency matching time sequence classification method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112035718B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060224356A1 (en) * | 2005-03-31 | 2006-10-05 | Ibm Corporation | Systems and methods for structural clustering of time sequences |
JP2009070065A (en) * | 2007-09-12 | 2009-04-02 | Nippon Telegr & Teleph Corp <Ntt> | Trend detection method, trend detection program, and trend detection device |
CN104794484A (en) * | 2015-04-07 | 2015-07-22 | 浙江大学 | Time series data nearest-neighbor classifying method based on subsection orthogonal polynomial decomposition |
CN104820673A (en) * | 2015-03-27 | 2015-08-05 | 浙江大学 | Time sequence similarity measurement method based on self-adaptive piecewise statistical approximation |
CN106777980A (en) * | 2016-12-16 | 2017-05-31 | 重庆邮电大学 | A kind of Time Series Similarity Forecasting Methodology based on DTW |
US20180150547A1 (en) * | 2016-11-30 | 2018-05-31 | Business Objects Software Ltd. | Time series analysis using a clustering based symbolic representation |
US20180183650A1 (en) * | 2012-12-05 | 2018-06-28 | Origin Wireless, Inc. | Method, apparatus, and system for object tracking and navigation |
CN108509990A (en) * | 2018-03-29 | 2018-09-07 | 重庆大学 | A kind of sequential key assignments type industrial process data Parallel analytic method |
CN109359135A (en) * | 2018-09-04 | 2019-02-19 | 河海大学 | A kind of Algorithm for Similarity Search in Time Series based on segmentation weight |
CN110197211A (en) * | 2019-05-17 | 2019-09-03 | 河海大学 | A kind of similarity data clustering method towards dam safety monitoring data |
-
2020
- 2020-08-13 CN CN202010814796.XA patent/CN112035718B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060224356A1 (en) * | 2005-03-31 | 2006-10-05 | Ibm Corporation | Systems and methods for structural clustering of time sequences |
JP2009070065A (en) * | 2007-09-12 | 2009-04-02 | Nippon Telegr & Teleph Corp <Ntt> | Trend detection method, trend detection program, and trend detection device |
US20180183650A1 (en) * | 2012-12-05 | 2018-06-28 | Origin Wireless, Inc. | Method, apparatus, and system for object tracking and navigation |
CN104820673A (en) * | 2015-03-27 | 2015-08-05 | 浙江大学 | Time sequence similarity measurement method based on self-adaptive piecewise statistical approximation |
CN104794484A (en) * | 2015-04-07 | 2015-07-22 | 浙江大学 | Time series data nearest-neighbor classifying method based on subsection orthogonal polynomial decomposition |
US20180150547A1 (en) * | 2016-11-30 | 2018-05-31 | Business Objects Software Ltd. | Time series analysis using a clustering based symbolic representation |
CN106777980A (en) * | 2016-12-16 | 2017-05-31 | 重庆邮电大学 | A kind of Time Series Similarity Forecasting Methodology based on DTW |
CN108509990A (en) * | 2018-03-29 | 2018-09-07 | 重庆大学 | A kind of sequential key assignments type industrial process data Parallel analytic method |
CN109359135A (en) * | 2018-09-04 | 2019-02-19 | 河海大学 | A kind of Algorithm for Similarity Search in Time Series based on segmentation weight |
CN110197211A (en) * | 2019-05-17 | 2019-09-03 | 河海大学 | A kind of similarity data clustering method towards dam safety monitoring data |
Non-Patent Citations (4)
Title |
---|
DUAN LINGZI等: "Time-series clustering based on linear fuzzy information granules", 《APPLIED SOFT COMPUTING 》, pages 1053 - 1067 * |
SUN Z等: "A Hybrid Segmentation Method for Multi-variate Time Series Based on the Dynamic Factor Model", 《STOCHASTIC ENVIRONMENTAL RESEARCH AND RISK ASSESSMENT》, pages 1291 - 1304 * |
刘杰: "时间序列相似性查询的研究与应用", 《中国优秀硕士学位论文全文数据库 信息科技辑》, pages 138 - 603 * |
崔美玲: "基于LBHust距离的时间序列数据聚类", 《中国优秀硕士学位论文全文数据库 信息科技辑》, pages 138 - 417 * |
Also Published As
Publication number | Publication date |
---|---|
CN112035718B (en) | 2023-07-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106202891B (en) | A kind of big data method for digging towards Evaluation of Medical Quality | |
Pratikakis et al. | ICFHR 2014 competition on handwritten keyword spotting (H-KWS 2014) | |
CN106529559A (en) | Pointer-type circular multi-dashboard real-time reading identification method | |
CN108877880B (en) | Patient similarity measurement device and method based on medical history text | |
CN109685117B (en) | Image measuring method for flow parameters in gas-liquid-solid three-phase system | |
CN104794484B (en) | The time series data arest neighbors sorting technique decomposed based on segmentation orthogonal polynomial | |
CN108241925A (en) | A kind of discrete manufacture mechanical product quality source tracing method based on outlier detection | |
CN104820673A (en) | Time sequence similarity measurement method based on self-adaptive piecewise statistical approximation | |
Sebti et al. | A new word sense similarity measure in WordNet | |
De Stefano et al. | Layout measures for writer identification in mediaeval documents | |
CN112215365A (en) | Method for providing feature prediction capability based on naive Bayes model | |
CN113640675B (en) | Aviation lithium battery abnormity detection method based on Snippets characteristic extraction | |
CN111461923A (en) | Electricity stealing monitoring system and method based on deep convolutional neural network | |
CN110909792A (en) | Clustering analysis method based on improved K-means algorithm and new clustering effectiveness index | |
CN112035718B (en) | Meat detection method based on trend consistency matching time sequence classification method | |
Pratiwi et al. | Personality type assessment system by using enneagram-graphology techniques on digital handwriting | |
CN116257651B (en) | Intelligent monitoring system for abnormal sound of through channel cab apron | |
CN115392375A (en) | Intelligent evaluation method and system for multi-source data fusion degree | |
CN115935160A (en) | Air quality data processing method based on neighborhood rough set attribute reduction | |
Yang et al. | A similarity measure for time series based on symbolic aggregate approximation and trend feature | |
CN111833856B (en) | Voice key information calibration method based on deep learning | |
CN101710392B (en) | Important information acquiring method based on variable boundary support vector machine | |
CN115049870A (en) | Target detection method based on small sample | |
CN115130343A (en) | Pipeline defect type identification method based on GA deep optimization machine learning | |
CN112347162A (en) | Multivariate time sequence data rule mining method based on online learning |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |