CN116879409A - Analysis and detection method for fruit damage based on gas sensor - Google Patents

Analysis and detection method for fruit damage based on gas sensor Download PDF

Info

Publication number
CN116879409A
CN116879409A CN202310859061.2A CN202310859061A CN116879409A CN 116879409 A CN116879409 A CN 116879409A CN 202310859061 A CN202310859061 A CN 202310859061A CN 116879409 A CN116879409 A CN 116879409A
Authority
CN
China
Prior art keywords
feature
damage
fruit
value
detected
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
CN202310859061.2A
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.)
South China Agricultural University
Original Assignee
South China Agricultural University
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 South China Agricultural University filed Critical South China Agricultural University
Priority to CN202310859061.2A priority Critical patent/CN116879409A/en
Publication of CN116879409A publication Critical patent/CN116879409A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N29/00Investigating or analysing materials by the use of ultrasonic, sonic or infrasonic waves; Visualisation of the interior of objects by transmitting ultrasonic or sonic waves through the object
    • G01N29/44Processing the detected response signal, e.g. electronic circuits specially adapted therefor
    • G01N29/4472Mathematical theories or simulation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N29/00Investigating or analysing materials by the use of ultrasonic, sonic or infrasonic waves; Visualisation of the interior of objects by transmitting ultrasonic or sonic waves through the object
    • G01N29/04Analysing solids
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N29/00Investigating or analysing materials by the use of ultrasonic, sonic or infrasonic waves; Visualisation of the interior of objects by transmitting ultrasonic or sonic waves through the object
    • G01N29/22Details, e.g. general constructional or apparatus details
    • G01N29/24Probes
    • G01N29/2412Probes using the magnetostrictive properties of the material to be examined, e.g. electromagnetic acoustic transducers [EMAT]
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N2291/00Indexing codes associated with group G01N29/00
    • G01N2291/02Indexing codes associated with the analysed material
    • G01N2291/028Material parameters
    • G01N2291/0289Internal structure, e.g. defects, grain size, texture
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N2291/00Indexing codes associated with group G01N29/00
    • G01N2291/04Wave modes and trajectories
    • G01N2291/042Wave modes
    • G01N2291/0427Flexural waves, plate waves, e.g. Lamb waves, tuning fork, cantilever
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Biochemistry (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Algebra (AREA)
  • Mathematical Optimization (AREA)
  • Electromagnetism (AREA)
  • Acoustics & Sound (AREA)
  • Investigating Or Analyzing Materials By The Use Of Fluid Adsorption Or Reactions (AREA)

Abstract

The invention discloses a method for analyzing and detecting fruit damage based on a gas sensor, which comprises the following steps: collecting sensor response signals of detected fruits through a sensor array, and filtering the sensor response signals; extracting characteristics of the sensor response signals after the filtering treatment, and constructing a characteristic matrix; filtering by a sensor to obtain detected fruit and constructing a feature vector corresponding to the feature value of the detection environment; performing three-stage feature selection on the initial feature data by adopting a feature selection algorithm to finally obtain an input feature combination; and inputting the input characteristic combination into a support vector machine model for improving particle swarm optimization, performing multi-task identification prediction, and obtaining fruit damage data by using a damage calculation formula. The invention can improve the fruit damage prediction and detection precision, realize effective qualitative and quantitative output of the fruit damage, and can meet the method requirement of portable detection equipment.

Description

Analysis and detection method for fruit damage based on gas sensor
Technical Field
The invention relates to the technical field of gas environment monitoring, in particular to an analysis and detection method for fruit damage based on a gas sensor.
Background
With the support of the national development of agriculture, the demand of agricultural monitoring is higher and higher, and for the fruits of tender, the fruits are easy to mechanically damage, so that the pulp tissues are softened, the damaged parts are subjected to tissue browning, and the aging of the fruits is accelerated; moreover, the damage on the surface of the fruit is extremely easy to be infected by pathogenic bacteria so as to cause decay; therefore, it is important to select mechanically damaged fruits at an early stage and prevent serious economic loss at a later stage of storage.
At present, hyperspectral, near infrared and other technologies are mainly used for identifying damaged fruits, the discrimination effect is good, however, the equipment is usually large and expensive, and the damaged parts of the fruits in the actual transportation process are inconsistent, so that certain difficulty is brought to the visual imaging technology; in the portable detection device, the sensor is affected by noise and manufacturing precision, so that the detection effect is reduced; meanwhile, the components of the gas environment in the field are complex, and the single sensor has cross sensitivity and can be sensitive to various gases in the environment of the detection object, so that the recognition accuracy cannot be expected.
In fruit damage detection based on a gas sensor, input features can have different influences on the recognition effect, the recognition effect can be influenced by the selection of characteristic features of a sensor response curve, different features are connected to qualitative and quantitative detection, and the technical difficulty of how to select the combination of the features with the optimal detection recognition effect to be qualitative and quantitative for fruit damage is solved.
Disclosure of Invention
In view of the above, the invention provides an analysis and detection method for fruit damage based on a gas sensor; the method can solve the problem of selecting the characteristic combination with the optimal detection and identification effects, can improve the fruit damage prediction and detection precision, and realizes the effective qualitative and quantitative output of fruit damage.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
a method for analyzing and detecting fruit damage based on a gas sensor, wherein the gas sensor comprises a multifunctional sensing element which is responsive to a plurality of gases and a plurality of single sensing elements which are respectively responsive to the plurality of gases, and the single sensing elements have different response values under different concentration values of the corresponding gases;
the analysis and detection method comprises the following steps:
s1, acquiring sensor response signals of detected fruits through a sensor array, and filtering the sensor response signals of the detected fruits;
s2, carrying out feature extraction on the sensor response signals of the detected fruit after the filtering treatment to construct a feature matrix; filtering by a sensor to obtain the detected fruit and a characteristic value construction characteristic vector corresponding to a detection environment; carrying out normalization processing on each data to obtain initial characteristic data;
s3, adopting a feature selection algorithm to perform three-stage feature selection on the initial feature data, and finally obtaining an input feature combination;
s4, inputting the input characteristic combination into a support vector machine model for improved particle swarm optimization, performing multitasking recognition and prediction, and obtaining fruit damage data of the detected fruit by using a damage calculation formula.
Preferably, the step S1 specifically includes the following steps:
s11, acquiring AD response values of the detected fruit of the gas sensor array in a preset period, and performing Kalman filtering processing on response signals of the detected fruit acquired by each sensor;
s12, performing wavelet filtering for improving a wavelet threshold function on the response signal of the detected fruit subjected to Kalman filtering, and performing data smoothing;
s13, extracting steady state values t, h, v, p, m of a temperature and humidity sensor, an airflow velocity sensor, an air pressure sensor and a weight sensor in the detected fruit corresponding detection environment.
Preferably, the step S12 specifically includes the following steps:
s121, acquiring a response signal sequence of the detected fruit subjected to Kalman filtering processing, and performing wavelet transformation on an original signal of the detected fruit signal sequence by utilizing a preset wavelet basis function to obtain a wavelet coefficient;
s122, performing quantization filtering processing on the wavelet coefficients by using an improved wavelet threshold function;
s123, carrying out wavelet reconstruction on the signals according to the low-frequency coefficient of the N layer of wavelet decomposition and the high-frequency coefficients of the 1 st layer to the N layer after quantization treatment to obtain the final filtered signals of the detected fruits.
Preferably, the step S2 specifically includes the following steps:
s21, removing the front-end time by 0-t according to the length of the air path in the hardware structure 0 The signal sequence of the detected fruit is filtered to finally obtain t 0 -t n Is a signal response sequence of the detected fruit; feature extraction is carried out to construct a feature matrix;
s22, extracting the relevant characteristics of the signal response sequence, including a first-order integral value, a relative steady-state value, an average differential value, a response maximum value, a response differential value, a first-order differential maximum value and T A S、T B S, responding to the values at two moments, and constructing characteristic data of the detected fruit;
s23, acquiring steady-state values of temperature, humidity, airflow velocity, air pressure and weight in the corresponding detection environment, and constructing characteristic data of the corresponding detection environment; the characteristic data of the detected fruit and the characteristic data corresponding to the detection environment form a characteristic vector;
and S24, carrying out normalization processing on the feature matrix, the feature vector and the multi-task output feature, eliminating adverse effects caused by singular sample data, and obtaining initial feature data.
Preferably, the step S3 specifically includes the following steps:
s31, carrying out correlation analysis on the initial characteristic data, and eliminating the characteristic that the correlation coefficient reaches a set threshold value to obtain the characteristic of the first stage;
s32, calculating the maximum information coefficient of each input feature and the multi-task output feature by using the features of the first stage to obtain feature importance, and removing features smaller than a feature importance threshold to obtain features of the second stage;
s33, substituting the features of the second stage into a support vector machine model for improving particle swarm optimization to perform multi-task detection, and gradually and iteratively improving the accuracy of the multi-task detection to obtain an optimal input feature combination.
Preferably, the step S31 specifically includes the following steps:
s311, calculating Pearson correlation coefficients among the input features, and simultaneously calculating Pearson correlation coefficient absolute value accumulated values of one input feature and other input features one by one;
s312, gradually substituting the sequenced features of the accumulated values into a support vector machine model for improving particle swarm optimization to identify and predict different tasks, determining a threshold value of the absolute value accumulated value of the correlation coefficient by the root mean square error of the test set, and removing the redundancy features;
s313, eliminating the features according to the threshold value of the absolute value accumulated value of the correlation coefficient to obtain the features of the first stage.
Preferably, the step S32 specifically includes the following steps:
s321, calculating the maximum information coefficient of each input feature and the multi-task output feature in the first stage to obtain the feature importance of each input feature for task output;
s322, sorting the damage degree tasks and the damage time tasks through feature importance, setting a feature importance threshold, and removing features with little influence on the damage degree tasks and the damage time tasks to obtain a feature sorting combination of the second stage on each task.
Preferably, the step S33 specifically includes the following steps:
s331, substituting the feature ordering combination of the damage degree task and the damage time task in the second stage into a support vector machine model for improving particle swarm optimization step by step to obtain a training set root mean square error when features are increased;
s332, when root mean square error of training sets of the damage degree task and the damage time task reaches a steady state value, acquiring a feature combination of the two tasks at the moment, acquiring a main feature combination by combining the feature combinations of the two tasks, taking the rest as a secondary feature combination, and sequencing each feature of the secondary feature combination according to the feature importance accumulated value of the two tasks;
s333, substituting the main feature combination described in S332 and the feature vector described in S23 into a support vector machine model for improved particle swarm optimization, gradually adding features according to the ranking of the secondary feature combinations, calculating the decision coefficient of model training, and determining the optimal input feature combination when the decision coefficient of the training set reaches a steady state.
Preferably, the step S4 specifically includes the following steps:
s41, introducing a shrinkage factor of an average grain distance of an initial population and self-adaptive inertia weight to the ASPSO-LSSVM, so that parameter optimizing and regression accuracy is better improved relative to an original SVM;
s42, substituting the input characteristic combination into a support vector machine model identification prediction for improved particle swarm optimization, and obtaining a damage degree quantized value and a damage time quantized value through inverse normalization;
s43, obtaining physical parameters of a detection object, and obtaining an output result of damage degree and damage time of the individual fruits through a damage calculation formula; the damage calculation formula is as follows:
wherein k is a test object class coefficient; s is the influence coefficient of the test system; h is a damage degree quantization value; m is the weight of the detected fruit object; DEI is the degree of injury of the subject individual, and represents the quantitative injury of the actual individual, and injury ratings are carried out on different individuals.
Compared with the prior art, the analysis and detection method for fruit damage based on the gas sensor has the following advantages:
according to the invention, the detected fruits are detected and analyzed by utilizing a plurality of gas sensors, and the four aspects of sensor signal preprocessing, feature extraction, feature selection and mode detection are optimally designed, so that the feature validity is improved, the feature redundancy is reduced, the feature validity is improved, the fruit damage prediction and detection precision is further improved, meanwhile, an actual available model is established for fruit damage evaluation, the effective qualitative and quantitative output of the fruit damage is realized, and the method requirement of portable detection equipment can be met.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of an analysis and detection method for fruit damage based on a gas sensor;
FIG. 2 is a flow chart of the sensor array signal filtering preprocessing provided by the invention;
FIG. 3 is a flow chart of feature selection provided by the present invention;
FIG. 4 is a flow chart of pattern recognition prediction provided by the present invention;
FIG. 5 is a flowchart of a support vector machine model algorithm for improved particle swarm optimization provided by the invention;
fig. 6 is a graph of an improved wavelet threshold function provided by the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that they may be embodied in various forms.
The present disclosure should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
After the tender and vulnerable fruits are mechanically damaged in the agricultural production process, the concentration and the type of the volatile organic compound gas generated by different damage degrees of the fruits can be correspondingly changed along with the time, and how to become the key point for improving the accurate detection and identification of the fruits according to the volatile organic compound gas concentration and the type and the damage information of the fruits.
In the specific implementation process, the gas change of the volatile organic compounds generated by different fruit injuries can be different, and in the embodiment of the invention, single or a plurality of damaged fruits are aimed at; taking apple mechanical bruise detection as an example, in the selection process of the sensor, referring to the data, various volatile organic compound gases can change correspondingly along with the lapse of the injury time: the concentration is from low to high, the concentration is from high to low, the concentration is from low to high to low, the concentration is from high to low to high, the species are from none to have, etc.; for example, after mechanical impact of apples, hydrocarbon gas such as toluene is from low to high and then to low, n-hexane is from high to low and then to no, aldehyde gas such as n-hexanal is from low to high, ketone gas such as acetone is from low to high, ester gas such as ethyl octoate is from no to high, alcohol gas such as n-hexanol is from low to high and then to low, etc.; for the like, the selection of the sensor is required to be based on the gas variation type corresponding to the fruit damage, and the sensitive gas corresponding to the sensor can be selected to be suitable for one or more types according to the gas variation type, such as hydrocarbon gas toluene, n-hexane, aldehyde gas n-hexanal, benzaldehyde, ketone gas acetone, ester gas propyl acetate, butyl acetate, alcohol gas n-hexanol and n-butanol after apple mechanical impact, which have obvious variation; simultaneously, other sensitive gas sensors and gas sensors with cross sensitivity can be selected without affecting the detection of obviously changed gases, such as WSP7110 sensitive to toluene, SMD1015 sensitive to acetone, WSP2110 sensitive to toluene and acetone, TGS2612 and MQ-5 sensitive to hydrocarbon gases, MQ-138 sensitive to ketone gases and TGS2602 sensitive to various VOC gases; the more the sensor types are selected, the effective detection information which is reserved after the algorithm selection is correspondingly increased, and the final detection and identification precision is improved; in the design process, a user can select the most suitable combination of sensor components according to technical requirements, so that an optimal solution is obtained;
in this embodiment, as shown in fig. 1, for a specific fruit damage detection process, the detection method includes the following steps:
s1, acquiring sensor response signals of detected fruits through a sensor array, and filtering the sensor response signals of the detected fruits;
s2, carrying out feature extraction on the sensor response signals of the detected fruit after the filtering treatment to construct a feature matrix; filtering by a sensor to obtain the detected fruit and a characteristic value construction characteristic vector corresponding to a detection environment; carrying out normalization processing on each data to obtain initial characteristic data;
s3, adopting a feature selection algorithm to perform three-stage feature selection on the initial feature data, and finally obtaining an input feature combination;
s4, inputting the input characteristic combination into a support vector machine model for improved particle swarm optimization, performing multitasking recognition and prediction, and obtaining fruit damage data of the detected fruit by using a damage calculation formula.
In this embodiment, the gas sensor includes a multifunctional sensing element that is responsive to a plurality of gases and a plurality of single sensing elements that are respectively responsive to the plurality of gases, the plurality of single sensing elements being composed of a plurality of different types of metal oxide semiconductor gas sensors, the single sensing elements having different response values at different concentration values of the corresponding gases;
the various gases comprise volatile organic compound gases such as hydrocarbon, aldehydes, ketones, esters and alcohols generated by chemical reaction and the like generated by fruits of a certain kind with different damage degrees in the health and damage state process; meanwhile, in order to solve the damage detection of single and multiple vulnerable fruits, such as apples, strawberries and the like, the detection range of a single sensing element can cover as many volatile organic compound gas types as possible so as to meet the detection requirement of a portable fruit damage detection device system.
In this embodiment, as shown in fig. 2, in step S1, when the system is in operation, sampling time is set to perform a certain sampling frequency f to collect AD output values of a gas sensor, a temperature and humidity sensor, an airflow velocity sensor, an air pressure sensor, and a weight sensor in a detection environment, so as to obtain an original detection data sequence; performing filtering processing on the original detection data sequence, wherein the filtering processing comprises the following steps:
s11, acquiring AD response values of the detected fruit of the gas sensor array in a preset period, and performing Kalman filtering processing on response signals of the detected fruit acquired by each sensor; according to the object analyzed by the method, filtering calculation is carried out according to the following formula;
prediction process
P k' =AP k-1 A T +Q
Update procedure
K k =P k' H T (HP k' +R) -1
P k =(I-K k H)P k'
In the method, in the process of the invention,for the current time prediction value, +.>The predicted value is the previous time; a is a state transition matrix; p (P) k' A covariance matrix estimated a priori at time k; q is 0 as the mean value, obeys the covariance matrix of normal distribution process noise; h is a measurement matrix; r is 0 as the mean value, and obeys a covariance matrix of normal distribution measurement noise; />Is a predicted value after Kalman filtering; p (P) k Estimating a covariance matrix for the posterior at time k; i is an identity matrix; in the embodiment of the invention, A is [ 1]]H is [ 1]];
S12, performing wavelet filtering for improving a wavelet threshold function on the response signal of the detected fruit subjected to Kalman filtering, and performing data smoothing;
s13, extracting steady-state values t, h, v, p, m of a temperature and humidity sensor, an airflow velocity sensor, an air pressure sensor and a weight sensor in a detection environment corresponding to the fruit to be detected; in order to achieve a better recognition of the mapping relationship.
In this embodiment, the step S12 specifically includes the following steps:
s121, acquiring a response signal sequence of the detected fruit subjected to Kalman filtering processing, and performing wavelet transformation on an original signal by using a preset wavelet basis function on the detected fruit signal sequence to obtain wavelet coefficients, wherein FIG. 6 is an improved wavelet threshold function graph (a short dashed line is a soft threshold function, a long dashed line is a hard threshold function, and a solid line is an improved threshold function);
s122, performing quantization filtering processing on the wavelet coefficients by using an improved wavelet threshold function;
wherein omega is j,k The wavelet coefficients of each layer after the multi-scale decomposition by wavelet transformation; sign (omega) j,k ) To be about omega j,k Is a sign function of (2); p is in the range of (0, T), and T is the VisuShrink thresholdWherein sigma is the standard deviation of noise, N is the signal length, sigma takes mean (x)/0.6745 in practical application, wherein x is the median of the wavelet coefficient amplitudes of all high frequency subbands;
s123, carrying out wavelet reconstruction on the signals according to the low-frequency coefficient of the N layer of wavelet decomposition and the high-frequency coefficients of the 1 st layer to the N layer after quantization treatment to obtain the final filtered signals of the detected fruits.
In this embodiment, the step S2 specifically includes the following steps:
s21, removing the front-end time by 0-t according to the length of the air path in the hardware structure 0 The signal sequence of the detected fruit is filtered to finally obtain t 0 -t n Is a signal response sequence of the detected fruit; feature extraction is carried out to construct a feature matrix;
s22, extracting the relevant characteristics of the signal response sequence, including a first-order integral value, a relative steady-state value, an average differential value, a response maximum value, a response differential value, a first-order differential maximum value and T A S、T B S, responding to the values at two moments, and constructing characteristic data of the detected fruit; the first-order integral value, the relative steady-state value and the average differential value are calculated as shown in the following formula;
the first-order integral value reflects the overall response result of the sensor to volatile components of the object to be detected, and is calculated as follows:
wherein T is the acquisition time of a sample by the sensor; x is x i A response value of the ith second; Δt is the time interval between two adjacent sampling points;
the relative steady state value is used to characterize the steady state characteristic by the average value of the sensor response signal relative to the steady state interval, and is calculated as follows:
wherein t is 0 The corresponding time when the steady state is to be reached; x is x i A response value of the ith second; t is the acquisition time of the sensor to one sample;
the average differential value reflects the degree of change of the sensor response curve, and is calculated as follows:
wherein T is the acquisition time of a sample by the sensor; x is x i A response value of the ith second; Δt is the interval between two adjacent sampling points;
s23, acquiring steady-state values of temperature, humidity, airflow velocity, air pressure and weight in the corresponding detection environment, and constructing characteristic data of the corresponding detection environment; the characteristic data of the detected fruit and the characteristic data corresponding to the detection environment form a characteristic vector;
s24, carrying out normalization processing on the feature matrix, the feature vector and the multi-task output feature, eliminating adverse effects caused by singular sample data, and obtaining initial feature data;
normalizing the obtained input feature vector and the multitasking output feature to [0,1];
wherein X is i Is the characteristic value of the original data; x is X min Is the original feature minimum; x is X max Is the original characteristic maximum value;
in this embodiment, as shown in fig. 3, step S3 includes the following steps:
s31, carrying out correlation analysis on the initial characteristic data, and eliminating the characteristic that the correlation coefficient reaches a set threshold value to obtain the characteristic of the first stage;
s32, calculating the maximum information coefficient of each input feature and the multi-task output feature by using the features of the first stage to obtain feature importance, and removing features smaller than a feature importance threshold to obtain features of the second stage;
s33, substituting the features of the second stage into an improved particle swarm optimization support vector machine model (ASPSO-LSSVM) to perform multi-task detection, and gradually and iteratively improving the accuracy of the multi-task detection to obtain an optimal input feature combination.
Further, the step S31 specifically includes the following steps:
s311, calculating Pearson correlation coefficients among the input features, and simultaneously calculating Pearson correlation coefficient absolute value accumulated values of one input feature and other input features one by one; calculating the following formula;
wherein x is i The relative change value of the characteristic value x to the ith sample; y is i The relative change value of the characteristic value y to the ith sample;the characteristic value x is the average value of all samples; />The mean value of the characteristic value y to all samples; n is the total number of samples; r is R xy The Pearson correlation coefficient is the characteristic value x and the characteristic value y; n is the total number of sample feature dimensions; r is (r) i The absolute value accumulated value of the Pearson correlation coefficient of a certain feature and other features;
s312, identifying and predicting different tasks by gradually substituting the sequenced features of the accumulated values into a support vector machine model (ASPSO-LSSVM) for improving particle swarm optimization, determining a threshold value of the absolute value accumulated value of the correlation coefficient by the root mean square error of the following test set, and removing the redundant features;
wherein y is i The true value is output for the model;a predicted value output by the model; n is the total number of test set samples;
s313, eliminating the features according to the threshold value of the absolute value accumulated value of the correlation coefficient to obtain the features of the first stage.
Further, the step S32 specifically includes the following steps:
s321, calculating the maximum information coefficient of each input feature and the multi-task output feature in the first stage to obtain the feature importance of each input feature for task output; calculating the following formula;
MI(F,C)=H(F)+H(C)-H(F,C
I * (F,C,a,b)=max MI(F,C) a,b
MIC(F,X)=max[MIC(F,C) a,b ]s.t.ab<n 0.6
wherein f is the characteristic value of the sample input characteristic, and c is the characteristic value of the sample output characteristic; h (F, C) is the cross entropy of feature F and feature C, H (F) and H (C) representing the information entropy of feature F and feature C, respectively; p (F) and P (C) respectively represent the edge distributions of the feature F and the feature C, and P (F, C) is the joint distribution of the feature F and the feature C; a, b is the grid dividing number of a rows and b columns; MI (F, C) is the mutual information value of feature F and feature C; i * (F, C, a, b) is the maximum mutual information value of the grid division feature F and the feature C in a row, b column; MIC (F, C) a,b Dividing the maximum information coefficient of the feature F and the feature C into a row and a column in a grid manner; MIC (F, C) is the maximum information coefficient at different division numbers; n is the data amount;
s322, sorting the damage degree tasks and the damage time tasks through feature importance, setting a feature importance threshold, and removing features with little influence on the damage degree tasks and the damage time tasks to obtain a feature sorting combination of the second stage on each task.
In this embodiment, the step S33 specifically includes the following steps:
s331, respectively gradually replacing a support vector machine model (ASPSO-LSSVM) for optimizing the improved particle swarm by the feature sequence combination of the damage degree task and the damage time task in the second stage to obtain a root mean square error of a training set when the features are increased;
s332, when root mean square error of training sets of the damage degree task and the damage time task reaches a steady state value, acquiring a feature combination of the two tasks at the moment, acquiring a main feature combination by combining the feature combinations of the two tasks, taking the rest as a secondary feature combination, and sequencing each feature of the secondary feature combination according to the feature importance accumulated value of the two tasks;
s333, substituting the main feature combination in S332 and the feature vector in S23 into a support vector machine model (ASPSO-LSSVM) for improving particle swarm optimization, gradually adding features according to the ranking of the secondary feature combinations, calculating a decision coefficient of model training by the following formula, and determining an optimal input feature combination when the decision coefficient of a training set reaches a steady state;
wherein y is i The true value is output for the model;a predicted value output by the model; />A predicted value output by the model; n is the total number of training set samples.
In this embodiment, as shown in fig. 4, step S4 includes the following steps:
s41, introducing a shrinkage factor of an average grain distance of an initial population and self-adaptive inertia weight to the ASPSO-LSSVM, so that parameter optimizing and regression accuracy is better improved relative to an original SVM;
as shown in fig. 5, the ASPSO-LSSVM model described above includes:
the LSSVM is a support vector machine with a loss function being a secondary loss function, so that the secondary optimization of an algorithm in the original SVM is changed into solving a linear equation, the solving difficulty is reduced, and the solving speed is improved; in actual training, the input space is mapped to a high-dimensional feature space by a nonlinear function phi (x). The regression function of the embodiment of the invention is as follows;
y(x)=w T φ(x)+b w∈Z,b∈R
wherein w is a weight; x is the sample feature; b is the deviation;
the LSSVM regression problem can be expressed as the minimum value of the risk of solving the structure under constraint conditions;
s.t.y i =w T φ(x i )+b+e i ,i=1,2...,l
wherein, C is penalty factor; e, e i An error between the actual output and the predicted output of the ith data;
the corresponding Lagrange function is
Wherein alpha is i Is a Lagrangian factor; y is i Is the actual output of the ith data;
transforming according to KKT optimization conditions to obtain the following analytical solution;
wherein y= [ y ] 1 ,y 2 ,...,y l ];A=[1,1,...,1] T ;α=[α 12 ,...,α l ]The method comprises the steps of carrying out a first treatment on the surface of the b is the deviation; i is an identity matrix; k is a kernel matrix; c is penalty factor;
obtaining the LSSVM prediction model as
Wherein alpha is i B is obtained by solving the above formula; k (x, x) i ) As a radial basis function, as follows
K(x,x i )=exp(-||x-x i || 2 /2σ 2 )
Wherein x represents an input vector; x is x i Is the center of the ith radial basis function; sigma is a standardized parameter; ||x-x i The I is a vector x-x i Is a norm of (2);
introducing an ASPSO algorithm to optimize parameters C and sigma of the LSSVM, wherein the method specifically comprises the following steps:
introducing a shrinkage factor and a self-adaptive inertia factor of the average grain distance of the initial population into a traditional PSO algorithm; the PSO model improvement is obtained as follows, and in each iteration of each round, the particle will track two extremum, one being the optimal solution pbest found for the particle itself id Known as an individual optimal solution; the other is the optimal solution gbestid found for the whole population, called global optimal solution. During each iteration, each particle adjusts its position and velocity according to the following equation;
β=e -D
wherein beta is a contraction factor, omega is an adaptive inertia factor; c 1 And c 2 For acceleration constant r 1 、r 2 And r 3 And are mutually independent random numbers obeying [0,1]]Uniformly distributed on the upper part;a speed of the k+1st iteration; />The speed of the kth iteration; />The position of the (k+1) th iteration; />The position of the kth iteration; d is the average grain distance of the initial population, m is the number of grains in the population, L is the maximum length of the diagonal of the search space, n is the dimension of the solution space, and p id D-th dimensional position coordinate value indicating the ith particle,/->An average value of d-th-dimensional position coordinate values representing the i-th particle; />Is an adaptive inertia factor; omega min Is the minimum inertia factor; omega max Is the maximum inertia factor; />The fitness of the particles at the kth iteration; />The minimum fitness of all particles at the kth iteration; />The average fitness of all particles at the kth iteration; in the example C search range is [0.1,150 ]]Sigma search range is [0.1,10 ]],c 1 And c 2 Can be set to 1.5 and 1.7, omega respectively min And omega max Can be set to 0.4 and 0.9 respectively; the fitness function uses a test set root mean square error of a support vector machine model (ASPSO-LSSVM) that improves particle swarm optimization; obtaining optimal parameter output of the system through final feature combination;
s42, substituting the input characteristic combination into an improved particle swarm optimization support vector machine model (ASPSO-LSSVM) to identify and predict, and obtaining a damage degree quantized value and a damage time quantized value through inverse normalization;
s43, obtaining physical parameters of a detection object, and obtaining an output result of damage degree and damage time of the individual fruits through a damage calculation formula;
wherein k is a test object class coefficient; s is the influence coefficient of the test system; h is a damage degree quantization value; m is the weight of the detected fruit object; DEI is the degree of injury of the subject individual, and represents the quantitative injury of the actual individual, and injury ratings are carried out on different individuals.
Finally, the invention provides an analysis and detection method for fruit damage based on a gas sensor, which comprises the steps of sensor signal pretreatment, feature extraction, feature selection optimization, regression analysis and pattern recognition; the sensor signal is composed of a gas sensor group through collecting volatile organic compound signals after fruit damage, and the collected sensor signal is subjected to Kalman-wavelet filtering denoising smoothing treatment; extracting characteristic values from sensor response signals after denoising smoothing treatment to form an original characteristic matrix, and simultaneously obtaining a sensor steady-state output signal of an actual detection environment; carrying out feature iteration selection on the original feature data subjected to normalization processing through Pearson correlation analysis, maximum information coefficient analysis and model feature importance analysis to obtain an optimized feature matrix; the qualitative and quantitative damage detection result is obtained by carrying out two-stage recognition regression on the optimized feature matrix through an improved particle swarm optimized support vector machine model (ASPSO-LSSVM), and method support is provided for the design of a portable fruit damage detection device system.
The foregoing describes preferred embodiments of the present invention; it will be appreciated by those skilled in the art that while embodiments of the invention have been shown and described in detail herein, many other variations or modifications which are in accordance with the principles of the invention may be directly ascertained or inferred from the present disclosure without departing from the spirit and scope of the invention. Accordingly, the scope of the present invention should be understood and deemed to cover all such other variations or modifications.

Claims (9)

1. The method for analyzing and detecting the fruit damage based on the gas sensor is characterized in that the gas sensor comprises a multifunctional sensing element which is responsive to various gases and a plurality of single sensing elements which are respectively responsive to the various gases, wherein the single sensing elements have different response values under different concentration values of the corresponding gases;
the analysis and detection method comprises the following steps:
s1, acquiring sensor response signals of detected fruits through a sensor array, and filtering the sensor response signals of the detected fruits;
s2, carrying out feature extraction on the sensor response signals of the detected fruit after the filtering treatment to construct a feature matrix; filtering by a sensor to obtain the detected fruit and a characteristic value construction characteristic vector corresponding to a detection environment; carrying out normalization processing on each data to obtain initial characteristic data;
s3, adopting a feature selection algorithm to perform three-stage feature selection on the initial feature data, and finally obtaining an input feature combination;
s4, inputting the input characteristic combination into a support vector machine model for improved particle swarm optimization, performing multitasking recognition and prediction, and obtaining fruit damage data of the detected fruit by using a damage calculation formula.
2. The method for analyzing and detecting fruit damage based on the gas sensor according to claim 1, wherein the step S1 specifically comprises the following steps:
s11, acquiring AD response values of the detected fruit of the gas sensor array in a preset period, and performing Kalman filtering processing on response signals of the detected fruit acquired by each sensor;
s12, performing wavelet filtering for improving a wavelet threshold function on the response signal of the detected fruit subjected to Kalman filtering, and performing data smoothing;
s13, extracting steady state values t, h, v, p, m of a temperature and humidity sensor, an airflow velocity sensor, an air pressure sensor and a weight sensor in the detected fruit corresponding detection environment.
3. The method for analyzing and detecting fruit damage based on the gas sensor according to claim 2, wherein the step S12 specifically comprises the following steps:
s121, acquiring a response signal sequence of the detected fruit subjected to Kalman filtering processing, and performing wavelet transformation on an original signal of the detected fruit signal sequence by utilizing a preset wavelet basis function to obtain a wavelet coefficient;
s122, performing quantization filtering processing on the wavelet coefficients by using an improved wavelet threshold function;
s123, carrying out wavelet reconstruction on the signals according to the low-frequency coefficient of the N layer of wavelet decomposition and the high-frequency coefficients of the 1 st layer to the N layer after quantization treatment to obtain the final filtered signals of the detected fruits.
4. The method for analyzing and detecting fruit damage based on the gas sensor according to claim 1, wherein the step S2 specifically comprises the following steps:
s21, removing the front-end time by 0-t according to the length of the air path in the hardware structure 0 The signal sequence of the detected fruit is filtered to finally obtain t 0 -t n Is a signal response sequence of the detected fruit; feature extraction is carried out to construct a feature matrix;
s22, extracting the relevant characteristics of the signal response sequence, including a first-order integral value, a relative steady-state value, an average differential value, a response maximum value, a response differential value, a first-order differential maximum value and T A S、T B S, responding to the values at two moments, and constructing characteristic data of the detected fruit;
s23, acquiring steady-state values of temperature, humidity, airflow velocity, air pressure and weight in the corresponding detection environment, and constructing characteristic data of the corresponding detection environment; the characteristic data of the detected fruit and the characteristic data corresponding to the detection environment form a characteristic vector;
and S24, carrying out normalization processing on the feature matrix, the feature vector and the multi-task output feature, eliminating adverse effects caused by singular sample data, and obtaining initial feature data.
5. The method for analyzing and detecting fruit damage based on the gas sensor according to claim 4, wherein the step S3 specifically comprises the following steps:
s31, carrying out correlation analysis on the initial characteristic data, and eliminating the characteristic that the correlation coefficient reaches a set threshold value to obtain the characteristic of the first stage;
s32, calculating the maximum information coefficient of each input feature and the multi-task output feature by using the features of the first stage to obtain feature importance, and removing features smaller than a feature importance threshold to obtain features of the second stage;
s33, substituting the features of the second stage into a support vector machine model for improving particle swarm optimization to perform multi-task detection, and gradually and iteratively improving the accuracy of the multi-task detection to obtain an optimal input feature combination.
6. The method for analyzing and detecting fruit damage based on the gas sensor according to claim 5, wherein the step S31 specifically comprises the following steps:
s311, calculating Pearson correlation coefficients among the input features, and simultaneously calculating Pearson correlation coefficient absolute value accumulated values of one input feature and other input features one by one;
s312, gradually substituting the sequenced features of the accumulated values into a support vector machine model for improving particle swarm optimization to identify and predict different tasks, determining a threshold value of the absolute value accumulated value of the correlation coefficient by the root mean square error of the test set, and removing the redundancy features;
s313, eliminating the features according to the threshold value of the absolute value accumulated value of the correlation coefficient to obtain the features of the first stage.
7. The method for analyzing and detecting fruit damage based on gas sensor according to claim 5, wherein the step S32 specifically comprises the following steps:
s321, calculating the maximum information coefficient of each input feature and the multi-task output feature in the first stage to obtain the feature importance of each input feature for task output;
s322, sorting the damage degree tasks and the damage time tasks through feature importance, setting a feature importance threshold, and removing features with little influence on the damage degree tasks and the damage time tasks to obtain a feature sorting combination of the second stage on each task.
8. The method for analyzing and detecting fruit damage based on gas sensor according to claim 5, wherein the step S33 specifically comprises the following steps:
s331, substituting the feature ordering combination of the damage degree task and the damage time task in the second stage into a support vector machine model for improving particle swarm optimization step by step to obtain a training set root mean square error when features are increased;
s332, when root mean square error of training sets of the damage degree task and the damage time task reaches a steady state value, acquiring a feature combination of the two tasks at the moment, acquiring a main feature combination by combining the feature combinations of the two tasks, taking the rest as a secondary feature combination, and sequencing each feature of the secondary feature combination according to the feature importance accumulated value of the two tasks;
s333, substituting the main feature combination described in S332 and the feature vector described in S23 into a support vector machine model for improved particle swarm optimization, gradually adding features according to the ranking of the secondary feature combinations, calculating the decision coefficient of model training, and determining the optimal input feature combination when the decision coefficient of the training set reaches a steady state.
9. The method for analyzing and detecting fruit damage based on the gas sensor according to claim 1, wherein the step S4 specifically comprises the following steps:
s41, introducing a shrinkage factor of an average grain distance of an initial population and self-adaptive inertia weight to the ASPSO-LSSVM, so that parameter optimizing and regression accuracy is better improved relative to an original SVM;
s42, substituting the input characteristic combination into a support vector machine model identification prediction for improved particle swarm optimization, and obtaining a damage degree quantized value and a damage time quantized value through inverse normalization;
s43, obtaining physical parameters of a detection object, and obtaining an output result of damage degree and damage time of the individual fruits through a damage calculation formula; the damage calculation formula is as follows:
wherein k is a test object class coefficient; s is the influence coefficient of the test system; h is a damage degree quantization value; m is the weight of the detected fruit object; DEI is the degree of injury of the subject individual, and represents the quantitative injury of the actual individual, and injury ratings are carried out on different individuals.
CN202310859061.2A 2023-07-13 2023-07-13 Analysis and detection method for fruit damage based on gas sensor Pending CN116879409A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310859061.2A CN116879409A (en) 2023-07-13 2023-07-13 Analysis and detection method for fruit damage based on gas sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310859061.2A CN116879409A (en) 2023-07-13 2023-07-13 Analysis and detection method for fruit damage based on gas sensor

Publications (1)

Publication Number Publication Date
CN116879409A true CN116879409A (en) 2023-10-13

Family

ID=88256393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310859061.2A Pending CN116879409A (en) 2023-07-13 2023-07-13 Analysis and detection method for fruit damage based on gas sensor

Country Status (1)

Country Link
CN (1) CN116879409A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117890440A (en) * 2024-03-14 2024-04-16 东北大学 Semiconductor gas sensor temperature control voltage optimization method based on information entropy

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117890440A (en) * 2024-03-14 2024-04-16 东北大学 Semiconductor gas sensor temperature control voltage optimization method based on information entropy

Similar Documents

Publication Publication Date Title
Bock et al. From visual estimates to fully automated sensor-based measurements of plant disease severity: status and challenges for improving accuracy
CN109916628B (en) Rolling bearing fault diagnosis method based on improved multi-scale amplitude perception permutation entropy
CN110531054B (en) Soil organic carbon prediction uncertainty estimation method based on Bootstrap sampling
CN116879409A (en) Analysis and detection method for fruit damage based on gas sensor
CN115828140B (en) Method, system and application for detecting fault by fusing neighborhood mutual information and random forest
CN113008805B (en) Radix angelicae decoction piece quality prediction method based on hyperspectral imaging depth analysis
CN110346312A (en) Winter wheat fringe head blight recognition methods based on Fei Shi linear discriminant and support vector machines technology
CN110991422A (en) Rolling bearing fault diagnosis method based on multi-element time-shifting multi-scale permutation entropy
CN111832507A (en) Wheat head top spectrum information-based wheat scab remote sensing identification method
CN116499938B (en) Intelligent monitoring method for aerosol suspended matters in professional workplace
JP2016532443A (en) Method and device for analyzing biological samples
CN111833330B (en) Intelligent lung cancer detection method and system based on fusion of image and machine olfaction
CN114113471A (en) Method and system for detecting food freshness of artificial nose refrigerator based on machine learning
CN113866102A (en) Soil health investigation monitoring method based on spectrum
CN110779875B (en) Method for detecting moisture content of winter wheat ear based on hyperspectral technology
CN113030001A (en) Fruit sugar degree detection method and system
Wen et al. Rapid odor recognition based on reliefF algorithm using electronic nose and its application in fruit identification and classification
CN110956331A (en) Method, system and device for predicting operation state of digital factory
CN113514410A (en) Real-time quantitative monitoring method for vertical distribution of nitrogen utilization rate of summer corn in whole growth period based on canopy hyperspectral technology
CN113947796A (en) Human body temperature trend detection method and device based on identity recognition
CN109840386B (en) Damage identification method based on factor analysis
CN111709440B (en) Feature selection method based on FSA-choket fuzzy integral
CN114324215A (en) Lemon leaf chlorophyll content and two-dimensional distribution detection method thereof
CN117893537B (en) Decoloring detection method and system for tray surface material
CN117541626B (en) Remote sensing image change detection method based on deep 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