Non-destructive measurement method, device and system for temperature inside mushroom stick
Through the combination of acoustic sensor and XGBoost model, the transit time of the sound wave signal and the sound speed of the composite signal are used to achieve lossless measurement of the internal temperature of the shiitake mushroom rod, solving the problems of large errors and environmental damage in the existing technology, and improving the accuracy of measurement and stability.
Patent Information
- Application Number
- CN202411442741.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-10-16
AI Technical Summary
The prior art has large errors and damage to the growth environment of mycelium when measuring the internal temperature of the shiitake mushroom rod, making it difficult to accurately judge the maturity of mycelium and affect yield and quality.
The acoustic sensor combined with the XGBoost machine learning model is used to measure the internal temperature of the bacteria rod losslessly through the transit time of the acoustic signal and the composite signal sound speed, and use the monotonic incremental constraint between the composite signal sound speed and temperature for data-physical hybrid modeling.
The internal temperature measurement of bacteria rods is achieved without loss, accurate and efficient, which avoids damage to the mycelial growth environment, improves the accuracy and reliability of measurement, and significantly improves the measurement accuracy.
Smart Images

Figure CN118960987B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural information processing, and in particular to a method, device and system for non-destructive measurement of the internal temperature of a mushroom stick. Background Art
[0002] Edible fungi occupy an important position in global agricultural products. For example, shiitake mushrooms are one of the most important varieties, with a wide range of planting areas. Their annual production and consumption occupy a significant position in the global edible fungi market. In the cultivation process of shiitake mushrooms, accurate judgment of the physiological maturity of mycelium is crucial to improving the yield and quality of shiitake mushrooms. During this stage, accurate measurement of the internal temperature of mycelium from the time it grows all over the mushroom sticks to the time it is moved to the mushroom shed is the key to evaluating the maturity of mycelium.
[0003] Currently, the industry generally uses ambient temperature (i.e., air temperature) or the surface temperature of the mushroom stick to evaluate the internal temperature of the mushroom stick. This method ignores the actual temperature changes inside the mushroom stick, resulting in large measurement errors, which may miss the best time for fruiting and affect the yield and quality of shiitake mushrooms. Another common method is to use a metal probe temperature detector. Although this method can reflect some temperature information inside the mushroom stick, it will damage the microenvironment for the growth of mycelium and is not conducive to the growth of shiitake mushrooms.
[0004] Considering that the existing technology has many shortcomings in the non-destructive measurement of the internal temperature of the mushroom stick, a non-destructive, efficient and accurate measurement method is urgently needed. Summary of the invention
[0005] The present invention provides a method, device and system for non-destructive measurement of the internal temperature of a mushroom stick, and proposes a method for non-destructive detection of the internal temperature of a mushroom stick based on an acoustic sensor. The method combines the acoustic temperature measurement principle and the XGBoost machine learning model, aiming to overcome the defects of the prior art and improve the accuracy and stability of the measurement of the internal temperature of the mushroom stick.
[0006] The present invention provides a method for non-destructive measurement of the internal temperature of a mushroom stick, comprising the following steps:
[0007] Acquiring a first sound wave signal and a second sound wave signal received by a first microphone and a second microphone, wherein the first microphone and the second microphone are arranged on opposite side walls of the bacteria stick to be tested;
[0008] Determining the transit time of the acoustic wave signal passing through the test bacteria stick according to the mutual correlation coefficient between the first acoustic wave signal and the second acoustic wave signal;
[0009] Determining a composite signal sound velocity of the acoustic wave signal passing through the tested bacteria stick according to the transit time and the microphone spacing, wherein the microphone spacing is the spacing between the first microphone and the second microphone;
[0010] Inputting the temperature influence characteristic into the temperature measurement model to obtain the internal temperature of the mushroom stick output by the temperature measurement model, wherein the temperature influence characteristic is determined according to the sound velocity of the composite signal, the distance between the sound sources and the ambient temperature, and the distance between the sound sources is the distance between the mushroom stick to be measured and the sound source;
[0011] The temperature measurement model is obtained by training with the XGboost model as the initial model. When constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a splitting constraint.
[0012] According to a non-destructive measurement method for the internal temperature of a mushroom stick provided by the present invention, when constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a splitting constraint, including:
[0013] Initialize the model parameters of the XGboost model;
[0014] When each decision tree is constructed, the composite signal speed is set as a split feature to split the leaf node using the composite signal speed.
[0015] After the split, the composite signal sound velocity and the internal temperature of the mushroom stick at the split point on the subtree on one side are always smaller than the corresponding values at the split point on the subtree on the other side.
[0016] According to a method for non-destructive measurement of the internal temperature of a mushroom stick provided by the present invention, the method of determining the transit time of the sound wave signal passing through the mushroom stick to be measured according to the mutual correlation coefficient between the first sound wave signal and the second sound wave signal comprises:
[0017] Calculating a cross-correlation value between the first sound wave signal and the second sound wave signal at each delayed sampling point, wherein the maximum value of the cross-correlation values at all delayed sampling points is the cross-correlation coefficient;
[0018] Taking the delayed sampling point corresponding to the cross-correlation coefficient as the target sampling point;
[0019] The transit time is determined according to the number of delayed sampling points of the target sampling point and a preset sampling time interval.
[0020] According to a non-destructive measurement method for the internal temperature of a mushroom stick provided by the present invention, the cross-correlation value between the first acoustic wave signal and the second acoustic wave signal at each delayed sampling point is calculated based on the following function:
[0021] ;
[0022] in, For the mCross-correlation value of delayed sampling points; is the number of delayed sampling points corresponding to the maximum delay allowed when calculating the cross-correlation value; N is the total number of data points of the sampling signal related to the first sound wave signal and the second sound wave signal; The first sound wave signal The sampling value of The second sound wave signal The sampling value of .
[0023] According to a method for non-destructive measurement of the internal temperature of a mushroom stick provided by the present invention, the method of determining the transit time of the sound wave signal passing through the mushroom stick to be measured according to the mutual correlation coefficient between the first sound wave signal and the second sound wave signal comprises:
[0024] Obtaining the target delayed sampling point number corresponding to the cross-correlation coefficient;
[0025] The transit time is determined according to the target delayed sampling point number and the sampling time interval of the sampling signal.
[0026] A non-destructive measurement method for the internal temperature of a mushroom stick provided by the present invention further includes:
[0027] Obtain the signal sound pressure values of the sound source signals at different sound wave frequencies after penetrating the mushroom stick sample;
[0028] Determine the rate of change of sound velocity at unit temperature when the sound wave signals at different sound wave frequencies pass through the mushroom sticks within a preset mushroom stick temperature range;
[0029] According to the signal sound pressure value and the sound velocity change rate, a target sound wave frequency of the sound source signal is determined from the different sound wave frequencies, and the signal sound pressure value of the target sound wave frequency is the largest and the sound velocity change rate is the largest.
[0030] According to a non-destructive measurement method for the internal temperature of a mushroom stick provided by the present invention, when constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a split constraint. The loss function when training with the XGboost model as the initial model is:
[0031] ;
[0032] ;
[0033] ;
[0034] in, is the initial loss, is the optimized loss, is the internal temperature of the output mushroom stick; It is the temperature label of the inside of the mushroom stick; is the ambient temperature; is a hyperparameter that controls the intensity of the penalty; penalty ( x ) is a penalty function; m is the number of training sessions; x is an intermediate variable.
[0035] The present invention also provides a non-destructive measurement device for the internal temperature of a mushroom stick, comprising:
[0036] An acoustic wave collection unit, used to obtain a first acoustic wave signal and a second acoustic wave signal received by a first microphone and a second microphone, wherein the first microphone and the second microphone are arranged on opposite side walls of the bacterial stick to be tested;
[0037] an acoustic wave processing unit, used for determining a transit time of the acoustic wave signal passing through the test bacteria stick according to a correlation coefficient between the first acoustic wave signal and the second acoustic wave signal;
[0038] A sound velocity prediction unit, used to determine the composite signal sound velocity of the sound wave signal passing through the tested bacteria stick according to the transit time and the microphone spacing, wherein the microphone spacing is the spacing between the first microphone and the second microphone;
[0039] a temperature prediction unit, used for inputting the temperature influence characteristic into the temperature measurement model to obtain the internal temperature of the mushroom stick output by the temperature measurement model, wherein the temperature influence characteristic is determined according to the sound velocity of the composite signal, the distance between the sound sources and the ambient temperature, and the distance between the sound sources is the distance between the mushroom stick to be measured and the sound source;
[0040] The temperature measurement model is obtained after training with the XGboost model as the initial model. When constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a splitting constraint.
[0041] The present invention also provides a non-destructive measurement system for the internal temperature of a mushroom stick, comprising: a first microphone, a second microphone, a microphone power supply, an acquisition card, a power amplifier, a signal output and acquisition controller and a processor;
[0042] The first microphone and the second microphone are detachably arranged on opposite side walls of the bacterial stick to be tested;
[0043] The signal output and acquisition controller controls the acquisition card to output a sound source signal of preset frequency and duration through a sound source, and uses the power amplifier to linearly amplify the sound source signal;
[0044] The microphone power supply is used to provide power for the first microphone and the second microphone, and send the collected first sound wave signal and the second sound wave signal to the processor through the acquisition card;
[0045] The processor executes any one of the above-mentioned methods for non-destructive measurement of the internal temperature of the mushroom stick when running.
[0046] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned methods for non-destructive measurement of the internal temperature of a mushroom stick is implemented.
[0047] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for non-destructive measurement of the internal temperature of a mushroom stick as described in any one of the above is implemented.
[0048] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for non-destructive measurement of the internal temperature of a mushroom stick as described above is implemented.
[0049] The method, device and system for non-destructive measurement of the internal temperature of a mushroom stick provided by the present invention adopt acoustic sensor technology to measure the internal temperature of the mushroom stick through sound wave signals, thereby realizing non-destructive detection, avoiding damage to the mycelium growth environment, and improving the accuracy and reliability of measurement. At the same time, the XGBoost model is used for data-physics hybrid modeling, and the temperature is deduced through the propagation speed of the sound wave signal in the mushroom stick, which significantly improves the measurement accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 The present invention is a flow chart of a method for non-destructive measurement of the internal temperature of a mushroom stick.
[0052] Figure 2 It is a schematic diagram of the microphone arrangement method used in the prior art;
[0053] Figure 3 is a schematic diagram of the microphone arrangement method adopted in the present invention;
[0054] Figure 4 It is a schematic diagram of an experimental device for measuring the transmission speed inside a mushroom stick provided by the present invention;
[0055] Figure 5 It is a comprehensive schematic diagram of the sound velocity of the transmission signal and the sound velocity of the composite signal at different sound wave frequencies provided by the present invention;
[0056] Figure 6 It is a schematic diagram of the sound pressure value of the transmission signal at different sound wave frequencies provided by the present invention;
[0057] Figure 7 It is a schematic diagram of the change of the sound velocity when the sound wave signal at different sound wave frequencies provided by the present invention passes through the mushroom stick;
[0058] Figure 8 It is a schematic diagram of the change of the sound velocity of the composite signal provided by the present invention with the temperature inside the mushroom stick;
[0059] Fig. 9 It is a schematic diagram of the change of the sound velocity of the composite signal provided by the present invention with the ambient temperature;
[0060] Fig.10 It is a structural schematic diagram of a non-destructive measurement device for the internal temperature of a mushroom stick provided by the present invention;
[0061] Fig.11 It is a structural schematic diagram of the non-destructive measurement system of the internal temperature of the mushroom stick provided by the present invention;
[0062] Fig.12 It is a schematic diagram of evaluation indexes of the temperature measurement model under different moisture contents provided by the present invention;
[0063] Fig.13 It is a schematic diagram of the measurement error of the internal temperature of the mushroom stick under different sound source spacings provided by the present invention;
[0064] Fig.14 This is a comparison chart of the effects of different temperature measurement models provided by the present invention;
[0065] Fig.15 It is a comparison chart of evaluation indicators of different temperature measurement models provided by the present invention;
[0066] Fig.16 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0068] It should be noted that in the description of the present invention, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The orientation or position relationship indicated by the terms "upper", "lower" and the like is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0069] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" means at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0070] In the factory cultivation process of edible mushrooms, the internal temperature of the mushroom stick is one of the key factors affecting the growth rate and quality of the mushroom stick. Traditional temperature measurement methods often require physical contact with the mushroom stick, which may not only introduce contamination, but also damage the internal structure of the mushroom stick and affect the growth of mycelium. Therefore, it is of great significance to develop a method for non-destructive detection of the internal temperature of the mushroom stick.
[0071] As a non-invasive and reliable temperature measurement method, acoustic temperature measurement can indirectly measure the temperature of the medium through the corresponding relationship between the propagation speed of sound in the medium and the temperature of the medium. This measurement method can not only protect the structure of the mushroom stick and the environment of the bacteria, but also has the advantages of being fast, accurate and contactless.
[0072] The present invention aims to provide a method and device for non-destructive detection of the internal temperature of a mushroom stick based on an acoustic sensor. The method calculates the speed of the acoustic signal in the mushroom stick by measuring the transit time of the acoustic signal inside the mushroom stick, and then derives the internal temperature of the mushroom stick.
[0073] Combine the following Figure 1-Figure 15 The present invention describes a method, device and system for non-destructive measurement of the internal temperature of a mushroom stick.
[0074] Figure 1 FIG. 1 is a flow chart of a method for non-destructive measurement of the internal temperature of a mushroom stick provided by the present invention. Figure 1 As shown, including but not limited to the following steps:
[0075] Step 101: Acquire a first sound wave signal and a second sound wave signal received by a first microphone and a second microphone.
[0076] Wherein, the first microphone and the second microphone are arranged on opposite side walls of the bacteria stick to be tested.
[0077] Figure 2 It is a schematic diagram of the microphone arrangement method used in the prior art, such as Figure 2 As shown, in order to detect the internal temperature of the mushroom stick, the microphone needs to be buried in the mushroom stick medium (the main component is wood particles). Microphones 1 and 2 can only collect the sound wave signal that penetrates the mushroom stick medium, and can directly receive the sound wave signal inside the mushroom stick, but there are the following disadvantages:
[0078] Because the microphone needs to be embedded in the medium of the mushroom stick, this not only increases the complexity and cost of the measurement, but may also have an adverse effect on the growth environment of the mushroom stick, and may even introduce pollution or destroy the integrity of the mushroom stick. And because the microphone is fixed inside the medium, its measurement range is limited, and it is difficult to flexibly adjust to accommodate mushroom sticks of different sizes or shapes. After long-term use, the microphone may be corroded or blocked by the medium, affecting the measurement accuracy, and it is not easy to repair or replace. In addition, Figure 2 The embedded installation method shown increases the equipment cost and installation difficulty, and may not be economical for large-scale, batch agricultural monitoring applications.
[0079] Figure 3This is a schematic diagram of the microphone layout method used in the present invention. Different from the prior art, the present invention places the microphones on the opposite side walls of the mushroom stick to be tested, and does not directly embed them into the medium. Therefore, it will not cause any impact on the growth environment of the mushroom stick, thereby maintaining the non-invasiveness of the measurement and the integrity of the mushroom stick. The microphone is located outside the mushroom stick, and its position can be easily adjusted to accommodate mushroom sticks of different sizes or shapes, thereby improving the flexibility and adaptability of the measurement. Since the microphone is located outside the mushroom stick, it is easy to maintain and replace, reducing the maintenance cost and difficulty of long-term use. Compared with the embedded installation method, the layout method of the present application is simpler and more economical, reduces equipment costs and installation difficulty, and is more suitable for large-scale, batch agricultural monitoring applications.
[0080] It should be noted that when the microphone is placed outside the mushroom stick to be tested, the sound wave signal diffracted along the surface of the mushroom stick will be received. However, the present invention can effectively reduce the influence of diffraction on the temperature measurement inside the mushroom stick through careful signal processing, time delay calculation, sound speed derivation and experimental verification, and provide accurate and stable measurement results. This part will be described in detail in subsequent embodiments.
[0081] In step 101, by placing the first microphone and the second microphone behind the opposite side walls of the tested bacteria stick, it is ensured that both are at the same horizontal position as the sound source. Then, a low-frequency speaker is used to transmit a sinusoidal wave signal of a certain frequency and duration to the tested bacteria stick. At this time, the first microphone receives the superposition of the signal incident from the front surface of the tested bacteria stick and the noise signal, which is called the first sound wave signal. The signal received by the second microphone includes a transmission signal (i.e., a signal that passes directly through the inside of the bacteria stick) and a sound wave signal diffracted along the surface of the bacteria stick and a noise signal, which is called the second sound wave signal. The first sound wave signal and the second sound wave signal received by the two microphones are respectively saved by the acquisition card, and the signal saving duration can be set to 100ms.
[0082] Step 102: determining the transit time of the acoustic wave signal passing through the test bacteria stick according to the correlation coefficient between the first acoustic wave signal and the second acoustic wave signal.
[0083] The first sound wave signal and the second sound wave signal collected in step 101 may be subjected to bandpass filtering and noise reduction processing respectively to improve signal quality.
[0084] Then, the time delay between the two acoustic wave signals is calculated using the cross-correlation method. This time delay is the transit time of the acoustic wave signal passing through the tested bacterial stick.
[0085] Among them, the basic principle of the cross-correlation method is to find the time point when the waveforms of two sound wave signals are most similar, and the time delay corresponding to this time point is the actual time delay.
[0086] Step 103, determining the composite signal sound velocity of the sound wave signal passing through the tested bacteria stick according to the transit time and the microphone spacing, wherein the microphone spacing is the spacing between the first microphone and the second microphone.
[0087] Furthermore, the composite signal sound velocity of the sound wave signal passing through the tested bacteria stick can be calculated using a sound velocity calculation formula according to the transit time obtained in step 102 and the known microphone spacing (ie, the distance between the first microphone and the second microphone).
[0088] It should be noted that the composite signal sound velocity includes the sound velocity information of the transmission signal and the diffraction signal. However, since the cross-correlation method used in the present invention mainly relies on the transmission signal to calculate the time delay, the composite signal sound velocity Mainly affected by the sound velocity information of the transmission signal.
[0089] The calculation formula of the composite signal sound velocity can be expressed as:
[0090] ;
[0091] Where d is the distance between the microphones and t is the transit time.
[0092] Step 104, inputting the temperature influence characteristic into the temperature measurement model to obtain the internal temperature of the mushroom stick output by the temperature measurement model, wherein the temperature influence characteristic is determined according to the sound velocity of the composite signal, the distance between the sound sources and the ambient temperature, and the distance between the sound sources is the distance between the mushroom stick to be measured and the sound source;
[0093] It should be emphasized that the temperature measurement model used in the present invention is obtained after training with the XGboost model as the initial model. When constructing the decision tree of the XGboost model, the monotonically increasing constraint between the composite signal sound velocity and the internal temperature of the mushroom stick is used as a splitting constraint.
[0094] The invention selects the XGBoost model as the initial model of data-physics hybrid modeling, takes the distance between the sound source and the mushroom stick, the sound velocity of the composite signal, and the ambient temperature as input quantities, and takes the internal temperature of the mushroom stick as output quantity for training.
[0095] The present invention provides a nondestructive measurement method for the internal temperature of a mushroom stick, which adopts acoustic sensor technology to measure the internal temperature of the mushroom stick through sound wave signals, thereby realizing nondestructive detection, avoiding damage to the mycelium growth environment, and improving the accuracy and reliability of measurement. At the same time, the XGBoost model is used for data-physics hybrid modeling, and the temperature is deduced through the propagation speed of the sound wave signal in the mushroom stick, which significantly improves the measurement accuracy.
[0096] Based on the content of the above embodiment, as an optional embodiment, when constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a splitting constraint, including:
[0097] Initialize the model parameters of the XGboost model;
[0098] When each decision tree is constructed, the composite signal speed is set as a split feature to split the leaf node using the composite signal speed.
[0099] After the split, the composite signal sound velocity and the internal temperature of the mushroom stick at the split point on the subtree on one side are always smaller than the corresponding values at the split point on the subtree on the other side.
[0100] In the process of non-destructive measurement of the internal temperature of the mushroom stick, in order to improve the measurement accuracy and stability, this study introduced the XGboost model for data-physics hybrid modeling. In order to better utilize the physical law (i.e., the monotonically increasing relationship between the sound velocity of the composite signal and the internal temperature of the mushroom stick), the present invention proposes to use this monotonically increasing relationship as a split constraint when constructing the decision tree of the XGboost model. This improvement is described in detail below.
[0101] In the process of non-destructive measurement of the internal temperature of the mushroom stick, in order to improve the measurement accuracy and stability, this study introduced the XGboost model for data-physics hybrid modeling. In order to better utilize the physical law (i.e., the monotonically increasing relationship between the sound velocity of the composite signal and the internal temperature of the mushroom stick), the present invention proposes to use this monotonically increasing relationship as a split constraint when constructing the decision tree of the XGboost model.
[0102] Before building the XGboost model, you first need to initialize the parameters of the XGboost model, including learning rate, tree depth, regularization term, etc. The settings of these parameters will directly affect the training effect and performance of the model.
[0103] In the process of building each decision tree, the composite signal speed is used as an important splitting feature. This means that at each node of the decision tree, the algorithm will check the value of the composite signal speed and split the node accordingly.
[0104] During the splitting process of the decision tree, the monotonically increasing constraint between the composite signal sound velocity and the internal temperature of the mushroom stick is applied. The specific steps include: when the composite signal sound velocity is used as the splitting feature, the composite signal sound velocity feature is used for splitting on a leaf node, and the algorithm calculates the values of the composite signal sound velocity and the internal temperature of the mushroom stick in the subtrees on both sides after the split at the node.
[0105] Ensure that the composite signal sound velocity and the internal temperature of the mushroom stick at the split point on one subtree after the split are always smaller than the corresponding values at the split point on the other subtree (for example, the sound velocity and the temperature of the mushroom stick at the split point on the left subtree are always smaller than the sound velocity and the temperature of the mushroom stick at the split point on the right subtree). This step is achieved by introducing physical constraints in model training to ensure that the changing relationship between the temperature value and the sound velocity value output by the model conforms to the actual physical laws.
[0106] After the temperature measurement model training is completed, the temperature influence characteristics (including the characteristic vector composed of the composite signal sound velocity, sound source distance and ambient temperature) are input into the temperature measurement model, and the internal temperature of the mushroom stick output by the temperature measurement model can be directly obtained.
[0107] In terms of technical implementation, the Python package xgboost can be used to configure the monotone constraints parameters to ensure the stable implementation of this incremental constraint relationship.
[0108] In addition, in the early stage of model training, the sound source distance between the sound source and the mushroom stick, the composite signal sound velocity and the ambient temperature can be used as input to collect samples, obtain multiple training samples, and annotate each training sample with the temperature label inside the mushroom stick. The training sample set constructed by all training samples is divided into a training set, a validation set and a test set, and the ratio between the three can be set to 6:2:2.
[0109] When collecting each training sample, the composite sound wave signal collected by the microphone needs to be preprocessed to remove the interference of various noises. The composite sound wave signal fluctuates up and down. Since it has a monotonically increasing relationship with the ambient temperature and a monotonically decreasing relationship with the moisture content of the mushroom stick, the present invention can use the above two relationship rules to screen out abnormal points of the composite sound wave signal.
[0110] The nondestructive measurement method of the internal temperature of the mushroom stick provided by the present invention introduces a monotonically increasing constraint between the composite signal sound velocity and the internal temperature of the mushroom stick, so that the XGboost model can better learn the physical relationship between the two during the training process, thereby improving the measurement accuracy. The introduction of physical constraints enables the model to maintain stable output when facing different mushroom sticks and environmental conditions, thereby improving the robustness and generalization ability of the model. The application of monotonically increasing constraints helps to optimize the structure of the model, so that the model can reduce unnecessary calculations while maintaining high accuracy and improve operating efficiency.
[0111] Based on the content of the above embodiment, as an optional embodiment, according to the mutual correlation coefficient between the first sound wave signal and the second sound wave signal, the transit time of the sound wave signal passing through the test bacteria stick can be determined in the following ways, including but not limited to:
[0112] Calculating a cross-correlation value between the first sound wave signal and the second sound wave signal at each delayed sampling point, wherein the maximum value of the cross-correlation values at all delayed sampling points is the cross-correlation coefficient;
[0113] Taking the delayed sampling point corresponding to the cross-correlation coefficient as the target sampling point;
[0114] The transit time is determined according to the number of delayed sampling points of the target sampling point and a preset sampling time interval.
[0115] The non-destructive measurement method of the internal temperature of the mushroom stick is achieved by accurately measuring the transit time of the sound wave signal through the measured mushroom stick, and then the temperature inside the mushroom stick is deduced using the relationship between sound speed and temperature.
[0116] First, the first sound wave signal and the second sound wave signal are collected by two microphones (the first microphone and the second microphone). The signal received by the first microphone is mainly composed of the signal incident on the front surface of the mushroom stick and the noise signal, while the signal received by the second microphone includes the transmission signal penetrating the mushroom stick to the air, the sound wave signal diffracted along the surface of the mushroom stick, and the noise signal.
[0117] In order to improve signal quality, the collected first sound wave signal and the second sound wave signal are subjected to bandpass filtering and noise reduction processing to remove unnecessary noise interference.
[0118] The cross-correlation method is used to calculate the cross-correlation coefficient between the first sound wave signal and the second sound wave signal. The specific steps are as follows:
[0119] The delayed sampling points start from 0 and gradually increase until a preset maximum number of delayed points is reached, until the cross-correlation value between the first sound wave signal and the second sound wave signal at each delayed sampling point is calculated.
[0120] As an optional embodiment, it is assumed that the first sound wave signal and the second sound wave signal as time domain signals are sound wave signals with a certain time delay difference.
[0121] Among the cross-correlation values of all delayed sampling points, find the maximum value, which is the first sound wave signal and the second sound wave signal, recorded as and , the calculation formula of the mutual correlation coefficient between the two can be expressed as:
[0122] ;
[0123] in, For the m The cross-correlation value of the delayed sampling points reflects the similarity between the first sound wave signal and the second sound wave signal; m is the number of delayed samples (m =0, 1, 2, ..., , …, M ); is the number of delayed sampling points corresponding to the maximum delay allowed when calculating the cross-correlation value; N is the total number of data points of the sampling signal related to the first sound wave signal and the second sound wave signal; The first sound wave signal The sampling value of The second sound wave signal The sampling value of .
[0124] Furthermore, the delayed sampling point corresponding to the cross-correlation coefficient is used as the target sampling point, which represents the time delay required for the acoustic wave signal to propagate inside the mushroom stick, that is, a part of the transit time.
[0125] According to the number of delayed sampling points of the target sampling point and the preset sampling time interval, the transit time of the acoustic wave signal through the mushroom stick can be calculated, which can be calculated in the following ways, including:
[0126] Obtaining the target delayed sampling point number corresponding to the cross-correlation coefficient;
[0127] The transit time is determined according to the target delayed sampling point number and the sampling time interval of the sampling signal. The specific calculation formula can be expressed as:
[0128] ;
[0129] in, For the crossing time; The target delay sampling points, that is, in the range of 0~M The horizontal coordinate corresponding to the maximum value in ; is the preset sampling time interval.
[0130] Based on the contents of the above embodiments, as an optional embodiment, the method for non-destructive measurement of the internal temperature of a mushroom stick provided by the present invention further includes:
[0131] Obtain the signal sound pressure values of the sound source signals at different sound wave frequencies after penetrating the mushroom stick sample;
[0132] Determine the rate of change of sound velocity at unit temperature when the sound wave signals at different sound wave frequencies pass through the mushroom sticks within a preset mushroom stick temperature range;
[0133] According to the signal sound pressure value and the sound velocity change rate, a target sound wave frequency of the sound source signal is determined from the different sound wave frequencies, and the signal sound pressure value of the target sound wave frequency is the largest and the sound velocity change rate is the largest.
[0134] The above step of determining the optimal target sound wave frequency of the sound source signal can be determined by experiment. A specific implementation method is provided below:
[0135] First, the mushroom stick material was selected. From the factory-based production line of shiitake mushrooms, short mushroom sticks that were in the spawning stage were randomly selected for experimental measurement. The material composition ratio of the short mushroom sticks was 78% sawdust, 20% bran, 1% lime, and 1% gypsum. The moisture content w of the mushroom sticks ranged from 45% to 70%. Such mushroom sticks were mixed and filled by automated production equipment to ensure uniform particles and regular shapes. They were wrapped in double-layer high-density polyethylene plastic bags with inner and outer bag thicknesses of 0.01 mm and 0.05 mm, respectively. The diameter d of the mushroom stick measured during the experiment was 10.5 cm and the height was 20 cm. The central area of the mushroom stick was selected for experimental data collection.
[0136] In order to measure the acoustic velocity of the transmission signal inside the mushroom stick and the acoustic pressure amplitude of the transmission signal, the present invention provides a schematic diagram of an experimental device for measuring the transmission velocity inside the mushroom stick, as shown in FIG. Figure 4 As shown, in the constant temperature and humidity test box, microphone 1 is set at a very small gap with the surface of the mushroom stick, microphone 2 is set inside the mushroom stick, and microphone 1, microphone 2 and the sound source channel of the sound source are located on the same horizontal axis. A temperature sensor probe is arranged every 90° on the cross section in the middle of the mushroom stick to monitor the temperature change of the mushroom stick, and the insertion depth of each probe can be set to 4 cm.
[0137] exist Figure 4 In the figure, microphones 1 and 2 inside and outside the mushroom stick are set at the same horizontal position as the sound source. The signal received by microphone 1 is the superposition of the incident signal on the front surface of the mushroom stick and the noise signal, which is recorded as the composite signal sound velocity The signal received by microphone 2 is a mixture of the transmission signal and the noise signal, recorded as the transmission signal sound velocity Similarly, the host computer software is used to control the acquisition card to save the sound wave signals collected by the two microphones respectively, and the signal storage duration is 100ms.
[0138] After the signal is bandpass filtered to reduce noise, the cross-correlation method is used to calculate the time delay between the incident sound wave signal and the transmitted sound wave signal to calculate the sound velocity of the transmitted signal.
[0139] Figure 5 It is a comprehensive schematic diagram of the transmission signal sound velocity and the composite signal sound velocity at different sound wave frequencies provided by the present invention, such as Figure 5 As shown in the figure, the transmission signal sound velocity of the signal in the range of 600Hz~1000Hz in the mushroom stick was measured in a sampling manner. and the composite signal velocity During the experiment, the temperature T of the mushroom stick was 22.4℃, the moisture content of the mushroom stick was 66.47%, the ambient temperature of the mushroom stick was 23.4℃, and the air humidity was 75.3%. When the difference between the measured values of the four temperature sensors did not exceed 0.1℃, the average value of the four temperature sensors was used to represent the internal temperature of the mushroom stick.
[0140] Through the above test method, it can be known that when the signal frequency is in the range of 600Hz~1000Hz, the sound velocity of the transmission signal and the sound velocity of the composite signal increase with the increase of frequency. This is due to the dispersion phenomenon of sound waves in the material. The sound wave propagates through the air gap inside the mushroom stick, but the sound velocity of the transmission signal and the composite signal velocity It is much smaller than the speed of sound of air in a free field. This is because the complex structure inside the mushroom stick causes the sound waves to undergo multiple reflections and scatterings. At the same time, the mushroom stick material has a certain absorption effect on the sound signal, which makes the acoustic impedance of the mushroom stick higher than that of the air.
[0141] Figure 6 Schematic diagram of the sound pressure values of the transmission signal at different sound wave frequencies provided by the present invention. In order to further find out the optimal target sound wave frequency of the sound source signal, the present invention measures the sound pressure values of the transmission signal of the sound source signal at each frequency in the mushroom stick. Figure 6 As shown in the figure, it is proved that the sound pressure amplitude of the light source signal with a frequency of about 850Hz is the largest, while the sound pressure amplitude of the signal with a frequency of 750Hz is the smallest, which means that the acoustic impedance of the mushroom stick to the 850Hz sound wave signal is the smallest, and the acoustic impedance to the 750Hz is the largest. Small acoustic impedance means that the light source signal encounters less resistance and less energy loss when propagating in the mushroom stick medium. Therefore, choosing a frequency with small acoustic impedance (such as about 850Hz) can improve the accuracy and resolution of temperature measurement, which is more suitable for measuring the internal temperature of the mushroom stick.
[0142] Furthermore, the present invention also experimentally measures the law of how the sound velocity of the composite signal received by the microphone changes with the temperature of the mushroom stick in the sound source signal within the sound wave frequency range of 600Hz~1000Hz. Figure 7 shown.
[0143] The invention measures the sound velocity of the composite signal collected by the microphone within the frequency range of 600 Hz to 1000 Hz, and the speed changes with the internal temperature of the mushroom stick. The starting frequency is 600 Hz, and the step length is 50 Hz to increase to the cutoff frequency of 1000 Hz. The duration of the sound wave signal of each frequency is 100 ms.
[0144] Through analysis, it can be found that when the temperature inside the mushroom stick is in the normal temperature range of 18℃~42℃, the sound velocity of the composite signal in the range of 600Hz~1000Hz shows the characteristic of increasing with the increase of temperature. And as the temperature inside the mushroom stick increases, the rate of change of sound velocity per unit temperature at each frequency gradually becomes faster.
[0145] As Figure 7 In the embodiment shown, the minimum sound velocity change of the composite signal with a frequency of 850 Hz under unit temperature is 0.41 m / s, which is higher than the sound velocity change rate at other frequencies. Therefore, the temperature measurement resolution is highest when the frequency of the composite signal is set at 850 Hz, and the acoustic impedance of the mushroom stick to the 850 Hz sound wave is the smallest. Therefore, it can be considered to select the characteristic frequency of the sound wave signal of the sound source to be set to 850 Hz.
[0146] In summary, the non-destructive measurement method of the internal temperature of the mushroom stick provided by the present invention, through experimental measurement and data analysis, found that the sound pressure amplitude of the sound wave signal with a frequency of 850Hz is the largest and the sound velocity change rate is the largest, so 850Hz is selected as the target sound wave frequency of the sound source signal. This selection helps to improve the accuracy and stability of the non-destructive measurement of the internal temperature of the mushroom stick.
[0147] One of the main improvements of the present invention is emphasized below. By studying the sound velocity of the composite signal under different ambient temperatures and internal temperatures of the mushroom stick, a constraint relationship between the sound velocity of the composite signal and the internal temperature of the mushroom stick is constructed to solve the problem that when the microphone is set outside the mushroom stick to be tested, the sound wave signal diffracted along the surface of the mushroom stick will be received, which will affect the measurement accuracy of the internal temperature of the mushroom stick.
[0148] In order to measure the composite signal sound velocity under different ambient temperatures and internal temperatures of the mushroom stick, the following test was used: under the conditions of the moisture content of the mushroom stick being 65.28% and the air humidity being 75.36%, the composite signal sound velocity of each sampling point within the ambient temperature range of 18 ~ 42°C was measured, and the following results can be obtained: Figure 8 The schematic diagram of the composite signal sound velocity changing with the internal temperature of the mushroom stick is shown.
[0149] At the same time, Mangbang also conducted experiments under the conditions of 65.28% moisture content of the mushroom stick and 75.36% air humidity, and obtained the composite signal sound velocity under different ambient temperatures to construct a Fig. 9 The schematic diagram of the composite signal sound velocity changing with ambient temperature is shown.
[0150] The above experiments show that the composite signal sound velocity increases with the increase of the internal temperature of the mushroom stick, and there is a monotonically increasing relationship between the composite signal sound velocity and the internal temperature of the mushroom stick. The composite signal sound velocity also increases with the increase of the ambient temperature, and there is a monotonically increasing relationship between the composite signal sound velocity and the ambient temperature.
[0151] Based on this discovery, the present invention chooses to introduce the XGboost model for data-physics hybrid modeling, and in order to better utilize the physical law of the monotonically increasing relationship between the speed of sound of the composite signal and the internal temperature of the mushroom stick, it is proposed to use this monotonically increasing relationship as a split constraint when constructing the decision tree of the XGboost model. The specific analysis has been carried out in detail in the previous embodiment, so it will not be repeated here. At the same time, in order to further overcome the above-mentioned defects, the present invention sets the loss function of the temperature measurement model after adding the monotonicity constraint to:
[0152] ;
[0153] ;
[0154] ;
[0155] in, is the initial loss, is the optimized loss, is the internal temperature of the output mushroom stick; It is the temperature label of the inside of the mushroom stick; is the ambient temperature; is a hyperparameter that controls the intensity of the penalty; penalty ( x ) is a penalty function; m is the number of training sessions; x is an intermediate variable.
[0156] When optimizing the original initial loss, the following factors are mainly considered:
[0157] The temperature inside the mushroom stick is generally higher than the ambient temperature around the mushroom stick. No more than 2°C. Therefore, this constraint is added on the basis of the monotonicity constraint.
[0158] The computer hardware and software configuration used for the experiment is as follows: the CPU processor is Intel i7-12700H with 16GB of memory, the GPU graphics card is NVIDIA RTX3060, the operating system is 64-bit Windows 11, and the programming environment is python3.6.
[0159] To evaluate the performance of the model, the present invention uses root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R 2 ) is used as an evaluation indicator for training convergence.
[0160] In summary, in order to achieve non-destructive measurement of the material temperature of shiitake mushroom sticks, the present invention designs a non-destructive mushroom stick temperature measurement method based on the principle of acoustic temperature measurement, which mainly includes but is not limited to the following advantages:
[0161] 1) It is determined that the sound velocity resolution per unit temperature is the highest at a certain sound wave frequency, for example, 850 Hz is determined as the target sound wave frequency of the sound source signal in the embodiment.
[0162] 2) The measurement accuracy of the internal temperature of the mushroom stick is determined by the proportion of the internal transmission signal of the mushroom stick in the composite signal. The change in moisture content affects the proportion of the internal transmission signal of the mushroom stick in the composite acoustic wave signal. When the moisture content of the mushroom stick ranges from 45% to 55%, 56% to 66%, and 66% to 77%, the proportion of the transmission signal of the mushroom stick in the composite signal is 55.3%, 61.1%, and 39.51%, respectively.
[0163] 3) The increase in the distance between the sound sources will lead to an increase in the proportion of air diffraction signals in the received composite sound wave signal, and the temperature measurement error will gradually increase. As the distance between the sound sources increases, the error turns from positive to negative. Taking the above embodiment as an example, the optimal distance between the sound source and the mushroom stick is determined to be 8.7 cm.
[0164] 4) Compared with the pure data-driven temperature measurement model, the temperature measurement model after the physical constraints are introduced in the present invention has its RMSE, MAE, and MAPE reduced by 74.86%, 77.22%, and 69.30% respectively, and the R² value increased by 1.86%; with the increase of constraint types, the accuracy and reliability of the temperature measurement model can be continuously enhanced.
[0165] Fig.10 Schematic diagram of the structure of the non-destructive measurement device for the internal temperature of the mushroom stick provided by the present invention. Fig.10 As shown, it mainly includes:
[0166] The sound wave collecting unit 11 is used to obtain the first sound wave signal and the second sound wave signal received by the first microphone and the second microphone, wherein the first microphone and the second microphone are arranged on opposite side walls of the bacteria stick to be tested.
[0167] The acoustic wave processing unit 12 is used to determine the transit time of the acoustic wave signal passing through the test bacteria stick according to the mutual correlation coefficient between the first acoustic wave signal and the second acoustic wave signal.
[0168] The sound velocity prediction unit 13 is used to determine the composite signal sound velocity of the sound wave signal passing through the tested bacteria stick according to the transit time and the microphone spacing, wherein the microphone spacing is the spacing between the first microphone and the second microphone.
[0169] The temperature prediction unit 14 is used to input the temperature influence characteristics into the temperature measurement model to obtain the internal temperature of the mushroom stick output by the temperature measurement model, wherein the temperature influence characteristics are determined according to the sound velocity of the composite signal, the sound source spacing and the ambient temperature, and the sound source spacing is the distance between the mushroom stick to be measured and the sound source.
[0170] The temperature measurement model is obtained after training with the XGboost model as the initial model. When constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a splitting constraint.
[0171] It should be noted that the non-destructive measurement device for the internal temperature of a mushroom stick provided by the present invention can execute the non-destructive measurement method for the internal temperature of a mushroom stick described in any of the above embodiments during specific operation, which will not be elaborated in this embodiment.
[0172] The device for nondestructive measurement of the internal temperature of a mushroom stick provided by the present invention adopts acoustic sensor technology to measure the internal temperature of the mushroom stick through sound wave signals, thereby realizing nondestructive detection, avoiding damage to the mycelium growth environment, and improving the accuracy and reliability of measurement. At the same time, the XGBoost model is used for data-physics hybrid modeling, and the temperature is deduced through the propagation speed of the sound wave signal in the mushroom stick, which significantly improves the measurement accuracy.
[0173] Fig.11 Schematic diagram of the structure of the non-destructive measurement system of the internal temperature of the mushroom stick provided by the present invention. Fig.11 As shown, it mainly includes a first microphone 1, a second microphone 2, a microphone power supply 3, an acquisition card 4, a power amplifier 5, a signal output and acquisition controller 6 and a processor 7;
[0174] The first microphone 1 and the second microphone 2 are detachably arranged on opposite side walls of the bacterial stick to be tested;
[0175] The signal output and acquisition controller 6 controls the acquisition card 4 to output a sound source signal of preset frequency and duration through a sound source, and uses the power amplifier 5 to linearly amplify the sound source signal;
[0176] The microphone power supply 3 is used to provide power for the first microphone 1 and the second microphone 2, and send the collected first sound wave signal and the second sound wave signal to the processor through the acquisition card;
[0177] The processor executes the non-destructive measurement method for the internal temperature of the mushroom stick provided by any of the above embodiments when running.
[0178] As an optional embodiment, the processor 7 is loaded with self-developed LabVIEW host computer software, which is used to control the acquisition card 4 to generate a sound source signal of the required frequency and duration, and the sound source signal is linearly amplified by the power amplifier 5, and then the low-frequency sound source is driven to transmit a sine sound wave signal with a duration of 100ms to the mushroom stick. The sine sound wave signal starts from a starting frequency of 600Hz, with a step size of 50Hz, and gradually increases to a cutoff frequency of 1000Hz.
[0179] The microphones on both sides of the mushroom stick are at the same horizontal position as the sound source, wherein the first sound wave signal received by microphone 1 is composed of the sound wave signal incident from the front surface of the mushroom stick and the noise signal. The second sound wave signal received by microphone 2 includes a composite sound wave signal and a noise signal, wherein the composite sound wave signal is composed of the signal transmitted by the mushroom stick and the sound wave signal diffracted along the surface of the mushroom stick.
[0180] Finally, the signal output and acquisition controller controls the acquisition card to save the first sound wave signal and the second sound wave signal with a duration of 100ms respectively. Further, the first sound wave signal and the second sound wave signal can be denoised using a bandpass filtering algorithm, and then the time delay between the two sound wave signals can be calculated using a cross-correlation method to determine the transit time of the sound wave signal passing through the mushroom stick, and then the composite signal sound velocity of the sound wave signal passing through the mushroom stick can be calculated.
[0181] Finally, by inputting the composite signal sound velocity, sound source distance and ambient temperature into the trained XGboost model, the internal temperature of the mushroom stick can be obtained.
[0182] As an optional embodiment, regarding the selection of microphone 1 and microphone 2, the response frequency range can be selected as 20Hz ~ 12.5kHz; the power amplifier 5 can be selected with a maximum power of 50w; the sound source can be selected with a rated power of 15w, a resistance of 8Ω, and a frequency response range of 108Hz to 20kHz; the data acquisition card uses a high-speed data acquisition card, for example, with 4-channel analog input, 2-channel analog output, 16-bit resolution, and a maximum sampling rate of 3.57MS / s.
[0183] As an optional embodiment, a closed soundproof cover can be configured for the sound source, the sound source can be placed in the soundproof cover, and a channel can be opened in the direction of the soundproof cover toward the two microphones, and it can be ensured that the channel and the two microphones are in the same horizontal direction.
[0184] The soundproof cover can effectively isolate external noise and reduce the impact of noise on the measurement of sound wave signals, which helps to ensure that the sound wave signals received by the microphone mainly come from the sound source rather than the interference of external noise. In addition, through the channel in the soundproof cover, the sound wave signal can be transmitted to the two microphones in a more consistent manner, which helps to reduce the attenuation and deformation of the sound wave signal during the propagation process, thereby improving the accuracy of the measurement.
[0185] It should be noted that, when the present invention performs non-destructive measurement of the internal temperature of the mushroom stick, the first microphone, the second microphone and the sound source are arranged on the same horizontal axis, so that the sound wave signal can be transmitted to the microphone more directly, reducing the attenuation of the sound wave signal caused by different propagation paths. The consistent propagation path helps to ensure that the sound wave signal received by the microphone is more accurate, reducing the error caused by interference and deformation during the propagation process.
[0186] In order to further demonstrate the feasibility of the method for non-destructive measurement of the internal temperature of the mushroom stick provided by the present invention, a detailed description is given below in combination with some data during the research and development process.
[0187] In order to verify the influence of the acoustic wave signals at different acoustic wave frequencies on the temperature measurement effect of the temperature measurement model, the present invention conducted the following experiments.
[0188] In order to determine the optimal target sound wave frequency, the present invention uses sound wave signals of different frequencies for testing and verification. The temperature measurement effect of the mushroom stick internal temperature of the temperature measurement model driven by the recording data-physics hybrid is shown in Table 1:
[0189] Table 1 Evaluation indexes of temperature measurement model under different frequency sound wave signals
[0190]
[0191] As shown in Table 1, the root mean square error (RMSE) of the temperature measurement model at a frequency of 850 Hz is 0.054°C, the mean absolute error (MAE) is 0.047°C, the mean absolute percentage error (MAPE) is 0.218%, and the coefficient of determination (R²) is 0.999. The root mean square error (RMSE) of the temperature measurement model at a frequency of 750 Hz is 0.13°C, the mean absolute error (MAE) is 0.113°C, the mean absolute percentage error (MAPE) is 0.385%, and the coefficient of determination (R²) is 0.988. Compared with the frequency of 750 Hz, the root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) of the temperature measurement model at a frequency of 850 Hz decreased by 58.5%, 58.4%, and 43.4%, respectively, and the coefficient of determination (R2) increased by 1.12%. Therefore, when 850 Hz is used as the target sound wave frequency of the sound source signal, the temperature measurement model can accurately reflect the temperature of the mushroom stick. The higher the R², the stronger the correlation between the sound velocity of the composite signal and the internal temperature of the mushroom stick, and the better the temperature measurement model fits the data.
[0192] Furthermore, the present invention verifies the influence of the moisture content of the mushroom stick on the temperature measurement effect of the temperature measurement model by means of experiments.
[0193] Fig.12 Schematic diagram of the temperature measurement model evaluation index under different moisture contents provided by the present invention. Fig.12 As shown, the present invention randomly selects 10 mushroom sticks in multiple moisture content ranges such as 45-55%, 56-66%, 67-77%, etc., for a total of 30, and uses a temperature measurement model to measure the internal temperature of the mushroom sticks at each moisture content to be 27.24°C.
[0194] W1, W2, and W3 represent the moisture content of the mushroom sticks of 45-55%, 56-66%, and 66%-77%, respectively. When the moisture content of the mushroom sticks was W1, the root mean square error (RMSE) of the temperature measurement was 0.074°C, the mean absolute error (MAE) was 0.06°C, and the mean absolute percentage error (MAPE) was 0.252%; when the moisture content of the mushroom sticks was W2, the root mean square error (RMSE) of the temperature measurement model was 0.056°C, the mean absolute error (MAE) was 0.041°C, and the mean absolute percentage error (MAPE) was 0.223%; when the moisture content of the mushroom sticks was W3, the root mean square error (RMSE) was 0.096°C, the mean absolute error (MAE) was 0.091°C, and the mean absolute percentage error (MAPE) was 0.333%.
[0195] The comparison shows that the temperature measurement model has the best performance when the moisture content of the mushroom stick is W3, the temperature measurement model has the second best performance when the moisture content of the mushroom stick is W2, and the temperature measurement model has the worst performance when the moisture content of the mushroom stick is W1. This is because the accuracy of measuring the internal temperature of the mushroom stick is determined by the internal transmission signal of the mushroom stick in the composite sound wave signal, and the change in moisture content affects the proportion of the internal transmission signal of the mushroom stick in the composite sound wave signal.
[0196] The present invention further verifies the influence of the sound source distance and the sound source spacing between the mushroom sticks on the measurement accuracy of the temperature measurement model, and can determine the optimal sound source spacing through experiments.
[0197] Fig.13 Schematic diagram of the measurement error of the internal temperature of the mushroom stick under different sound source spacings provided by the present invention. Fig.13 As shown, in order to obtain the optimal sound source spacing when applying the temperature measurement model, the present invention gradually increases the distance between the sound source and the mushroom stick and performs temperature measurement verification. The temperature sensor can be used to detect that the actual temperature inside the mushroom stick is 26.76°C.
[0198] As the distance from the sound source increases, the temperature measurement error of the temperature measurement model gradually increases. This is because the increase in the distance from the sound source causes the proportion of air diffraction signals in the composite sound wave signal received by microphone 2 to increase, reducing the proportion of the bacteria stick transmission signal in the composite sound wave signal, resulting in a decrease in the correlation between the measured composite signal sound velocity and the internal temperature of the bacteria stick. The temperature measurement error of the temperature measurement model is 0.08°C at 5cm. As the distance from the sound source increases, the error changes from positive to negative. When the distance is 8.7cm, the output value of the temperature measurement model is consistent with the actual temperature inside the bacteria stick measured by the temperature sensor. Therefore, in this embodiment, the temperature measurement model should select the optimal distance from the sound source to the bacteria stick as 8.7cm.
[0199] Furthermore, the present invention also verifies the differences in temperature measurement effects of different temperature measurement models.
[0200] In order to prove the temperature measurement performance of the temperature measurement model provided by the present invention, the important role of the two physical constraints mentioned in the above embodiment in improving the temperature measurement accuracy and generalization ability of the temperature measurement model is verified.
[0201] Fig.14 is a comparison chart of the effects of different temperature measurement models provided by the present invention, such as Fig.14As shown, the entire verification process uses a pure data-driven XGboost model, a model that only adds the monotonic physical constraints of the composite signal sound velocity and the internal temperature of the mushroom stick (XGboost model with only monotonic constraints), and a model that only adds the physical constraint that the difference between the internal temperature of the mushroom stick and the ambient temperature is less than 2°C (called the XGboost model with only temperature difference constraints), and compares the effects with the temperature measurement model provided by the present invention (called the XGboost model driven by data-physics hybrid). M1, M2, M3, and M4 represent the pure data model, the model with only monotonic constraints, the model with only temperature difference constraints, and the data-physics hybrid driven model, respectively.
[0202] Fig.15 is a comparison chart of evaluation indicators of different temperature measurement models provided by the present invention, such as Fig.15 As shown in Figure 2, the root mean square error (RMSE) of M1 is 0.21°C, the mean absolute error (MAE) is 0.195°C, the mean absolute percentage error (MAPE) is 0.71%, and the coefficient of determination (R 2 ) is 0.991. The root mean square error (RMSE) of M2 is 0.108°C, the mean absolute error (MAE) is 0.106°C, the mean absolute percentage error (MAPE) is 0.37%, and the coefficient of determination (R 2 ) is 0.997. The root mean square error (RMSE) of M3 is 0.149°C, the mean absolute error (MAE) is 0.143°C, and the mean absolute percentage error (MAPE) is 0.49%. The coefficient of determination (R 2 ) is 0.994. The root mean square error (RMSE) of M4 used in the present invention is 0.055°C, the mean absolute error (MAE) is 0.0465°C, the mean absolute percentage error (MAPE) is 0.22%, and the determination coefficient (R 2 ) is 0.999.
[0203] From the comparison of the above indicators, it can be seen that the introduction of physical constraints improves the performance of the model. The error of the pure data-driven model is large. After adding the monotonicity constraints of the composite signal sound velocity and the temperature of the mushroom stick, the error indicators are significantly improved. The RMSE decreased by 48.57%, the MAE decreased by 45.64%, the MAPE decreased by 47.89%, and the R 2 The value increased by 0.605%. After adding the physical constraint that the difference between the temperature of the mushroom sticks and the ambient temperature is less than 2°C, although the improvement is not as good as the former, the error is reduced compared with the pure data-driven model. Finally, the data-physics hybrid driven model combining these two physical constraints achieved a 74.86% decrease in RMSE, a 77.22% decrease in MAE, a 69.30% decrease in MAPE, and a 10.5% decrease in R 2The value increased significantly by 0.807%. This shows that the introduction of physical constraints can significantly optimize the prediction performance of the model. As the number and types of physical constraints increase, the performance of the model improves more significantly.
[0204] Fig.16 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Fig.16 As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communications interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute a non-destructive measurement method for the internal temperature of a bacteria stick, the method comprising: obtaining a first sound wave signal and a second sound wave signal received by a first microphone and a second microphone, wherein the first microphone and the second microphone are arranged on opposite side walls of the bacteria stick to be measured; determining the transit time of the sound wave signal passing through the bacteria stick to be measured according to the mutual correlation coefficient between the first sound wave signal and the second sound wave signal; determining the composite signal sound velocity of the sound wave signal passing through the bacteria stick to be measured according to the transit time and the microphone spacing, wherein the microphone spacing is the same as the transit time. The distance is the distance between the first microphone and the second microphone; the temperature influence feature is input into the temperature measurement model to obtain the internal temperature of the mushroom stick output by the temperature measurement model, the temperature influence feature is determined according to the sound velocity of the composite signal, the sound source distance and the ambient temperature, and the sound source distance is the distance between the mushroom stick to be measured and the sound source; the temperature measurement model is obtained after training with the XGboost model as the initial model, and when constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a splitting constraint.
[0205] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0206] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the computer can execute the non-destructive measurement method for the internal temperature of a mushroom stick provided in the above-mentioned embodiments, the method comprising: acquiring a first sound wave signal and a second sound wave signal received by a first microphone and a second microphone, the first microphone and the second microphone being arranged on opposite side walls of the mushroom stick to be tested; determining a transit time of the sound wave signal passing through the mushroom stick to be tested according to a mutual correlation coefficient between the first sound wave signal and the second sound wave signal; and determining a transit time of the sound wave signal passing through the mushroom stick to be tested according to the transit time. The composite signal sound velocity of the acoustic wave signal passing through the tested mushroom stick is determined by the distance between the first microphone and the second microphone, and the microphone distance is the distance between the first microphone and the second microphone; the temperature influence feature is input into the temperature measurement model to obtain the internal temperature of the mushroom stick output by the temperature measurement model, and the temperature influence feature is determined according to the composite signal sound velocity, the sound source distance and the ambient temperature, and the sound source distance is the distance between the tested mushroom stick and the sound source; the temperature measurement model is obtained after training with the XGboost model as the initial model, and when constructing the decision tree of the XGboost model, the monotonically increasing constraint between the composite signal sound velocity and the internal temperature of the mushroom stick is used as a splitting constraint.
[0207] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the non-destructive measurement method of the internal temperature of the mushroom stick provided in the above-mentioned embodiments, the method comprising: obtaining a first sound wave signal and a second sound wave signal received by a first microphone and a second microphone, wherein the first microphone and the second microphone are arranged on opposite side walls of the mushroom stick to be tested; determining a transit time of the sound wave signal passing through the mushroom stick to be tested based on a mutual correlation coefficient between the first sound wave signal and the second sound wave signal; determining a transit time of the sound wave signal passing through the mushroom stick to be tested based on the transit time and the microphone spacing. the composite signal sound velocity of the tested mushroom stick, the microphone spacing is the spacing between the first microphone and the second microphone; the temperature influence feature is input into the temperature measurement model to obtain the internal temperature of the mushroom stick output by the temperature measurement model, the temperature influence feature is determined according to the composite signal sound velocity, the sound source spacing and the ambient temperature, and the sound source spacing is the distance between the tested mushroom stick and the sound source; the temperature measurement model is obtained after training with the XGboost model as the initial model, and when constructing the decision tree of the XGboost model, the monotonically increasing constraint between the composite signal sound velocity and the internal temperature of the mushroom stick is used as a split constraint.
[0208] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0209] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0210] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for non-destructive measurement of the internal temperature of a mushroom stick, characterized in that: include: Acquiring a first sound wave signal and a second sound wave signal received by a first microphone and a second microphone, wherein the first microphone and the second microphone are arranged on opposite side walls of the bacteria stick to be tested; Determining the transit time of the acoustic wave signal passing through the test bacteria stick according to the mutual correlation coefficient between the first acoustic wave signal and the second acoustic wave signal; Determining a composite signal sound velocity of the acoustic wave signal passing through the tested bacteria stick according to the transit time and the microphone spacing, wherein the microphone spacing is the spacing between the first microphone and the second microphone; Inputting the temperature influence characteristic into the temperature measurement model to obtain the internal temperature of the mushroom stick output by the temperature measurement model, wherein the temperature influence characteristic is determined according to the sound velocity of the composite signal, the distance between the sound sources and the ambient temperature, and the distance between the sound sources is the distance between the mushroom stick to be measured and the sound source; The temperature measurement model is obtained by training with the XGboost model as the initial model. When constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a split constraint; Wherein, determining the transit time of the acoustic wave signal passing through the test bacteria stick according to the mutual correlation coefficient between the first acoustic wave signal and the second acoustic wave signal comprises: Calculating a cross-correlation value between the first sound wave signal and the second sound wave signal at each delayed sampling point, wherein the maximum value of the cross-correlation values at all delayed sampling points is the cross-correlation coefficient; Taking the delayed sampling point corresponding to the cross-correlation coefficient as the target sampling point; Determining the transit time according to the number of delayed sampling points of the target sampling point and a preset sampling time interval; The cross-correlation value between the first sound wave signal and the second sound wave signal at each delayed sampling point is calculated based on the following function: ; in, For the m Cross-correlation value of delayed sampling points; is the number of delayed sampling points corresponding to the maximum delay allowed when calculating the cross-correlation value; N is the total number of data points of the sampling signal related to the first sound wave signal and the second sound wave signal; The first sound wave signal The sampling value of The second sound wave signal The sampling value of .
2. The method for non-destructive measurement of the internal temperature of a mushroom stick according to claim 1, characterized in that: When constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a splitting constraint, including: Initialize the model parameters of the XGboost model; When each decision tree is constructed, the composite signal speed is set as a split feature to split the leaf node using the composite signal speed. After the split, the composite signal sound velocity and the internal temperature of the mushroom stick at the split point on the subtree on one side are always smaller than the corresponding values at the split point on the subtree on the other side.
3. The method for non-destructive measurement of the internal temperature of a mushroom stick according to claim 1, characterized in that: The step of determining the transit time of the acoustic wave signal passing through the test bacteria stick according to the mutual correlation coefficient between the first acoustic wave signal and the second acoustic wave signal comprises: Obtaining the target delayed sampling point number corresponding to the cross-correlation coefficient; The transit time is determined according to the target delayed sampling point number and the sampling time interval of the sampling signal.
4. The method for non-destructive measurement of the internal temperature of a mushroom stick according to claim 1, characterized in that: Also includes: Obtain the signal sound pressure values of the sound source signals at different sound wave frequencies after penetrating the mushroom stick sample; Determine the rate of change of sound velocity at unit temperature when the sound wave signals at different sound wave frequencies pass through the mushroom sticks within a preset mushroom stick temperature range; According to the signal sound pressure value and the sound velocity change rate, a target sound wave frequency of the sound source signal is determined from the different sound wave frequencies, and the signal sound pressure value of the target sound wave frequency is the largest and the sound velocity change rate is the largest.
5. The method for non-destructive measurement of the internal temperature of a mushroom stick according to claim 2, characterized in that: When constructing the decision tree of the XGboost model, the monotonically increasing constraint between the composite signal sound velocity and the internal temperature of the mushroom stick is used as the split constraint. The loss function when training with the XGboost model as the initial model is: ; ; ; in, is the initial loss, is the optimized loss, is the internal temperature of the output mushroom stick; It is the temperature label of the inside of the mushroom stick; is the ambient temperature; is a hyperparameter that controls the intensity of the penalty; penalty ( x ) is a penalty function; m is the number of training sessions; x is an intermediate variable.
6. A non-destructive measuring device for the internal temperature of a mushroom stick, characterized in that: include: An acoustic wave collection unit, used to obtain a first acoustic wave signal and a second acoustic wave signal received by a first microphone and a second microphone, wherein the first microphone and the second microphone are arranged on opposite side walls of the bacterial stick to be tested; The acoustic wave processing unit is used to determine the transit time of the acoustic wave signal passing through the test bacteria stick according to the mutual correlation coefficient between the first acoustic wave signal and the second acoustic wave signal, comprising: Calculating a cross-correlation value between the first sound wave signal and the second sound wave signal at each delayed sampling point, wherein the maximum value of the cross-correlation values at all delayed sampling points is the cross-correlation coefficient; Taking the delayed sampling point corresponding to the cross-correlation coefficient as the target sampling point; Determining the transit time according to the number of delayed sampling points of the target sampling point and a preset sampling time interval; The cross-correlation value between the first sound wave signal and the second sound wave signal at each delayed sampling point is calculated based on the following function: ; in, For the m Cross-correlation value of delayed sampling points; is the number of delayed sampling points corresponding to the maximum delay allowed when calculating the cross-correlation value; N is the total number of data points of the sampling signal related to the first sound wave signal and the second sound wave signal; The first sound wave signal The sampling value of The second sound wave signal The sampling value of A sound velocity prediction unit, used to determine the composite signal sound velocity of the sound wave signal passing through the tested bacteria stick according to the transit time and the microphone spacing, wherein the microphone spacing is the spacing between the first microphone and the second microphone; a temperature prediction unit, used for inputting the temperature influence characteristic into the temperature measurement model to obtain the internal temperature of the mushroom stick output by the temperature measurement model, wherein the temperature influence characteristic is determined according to the sound velocity of the composite signal, the distance between the sound sources and the ambient temperature, and the distance between the sound sources is the distance between the mushroom stick to be measured and the sound source; The temperature measurement model is obtained after training with the XGboost model as the initial model. When constructing the decision tree of the XGboost model, the monotonically increasing constraint between the sound velocity of the composite signal and the internal temperature of the mushroom stick is used as a splitting constraint.
7. A non-destructive measurement system for the internal temperature of a mushroom stick, characterized in that: include: A first microphone, a second microphone, a microphone power supply, an acquisition card, a power amplifier, a signal output and acquisition controller and a processor; The first microphone and the second microphone are detachably arranged on opposite side walls of the bacterial stick to be tested; The signal output and acquisition controller controls the acquisition card to output a sound source signal of preset frequency and duration through a sound source, and uses the power amplifier to linearly amplify the sound source signal; The microphone power supply is used to provide power for the first microphone and the second microphone, and send the collected first sound wave signal and the second sound wave signal to the processor through the acquisition card; The processor executes the non-destructive measurement method for the internal temperature of the mushroom stick according to any one of claims 1 to 5 when running.
8. The non-destructive measurement system for the internal temperature of a mushroom stick according to claim 7, characterized in that: The first microphone, the second microphone and the sound source are arranged on the same horizontal axis.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for non-destructive measurement of the internal temperature of a mushroom stick as claimed in any one of claims 1 to 5 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for non-destructive measurement of the internal temperature of a mushroom stick as claimed in any one of claims 1 to 5 is implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for non-destructive measurement of the internal temperature of a mushroom stick as claimed in any one of claims 1 to 5 is implemented.
