A method and device for detecting the liquid components of a plastic bottle

Through the combination of wifi signal transceiver and reception equipment and smart terminals, the problems of high cost and inconvenience in the existing technology are solved, and low-cost, fast and accurate liquid composition detection of plastic bottles is achieved.

CN119811523BActive Publication Date: 2025-08-01SICHUAN CHAOYIHONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411861989.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-08-01
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

The prior art equipment is costly and inconvenient for detecting liquid components of plastic bottles, making it difficult to achieve fast and accurate component identification.

Method used

Using wifi signal transceiver and reception devices and smart terminals, by obtaining channel state information, amplitude vectors and similarity vectors are extracted, and a liquid composition classification prediction model based on neural network is used for detection, so as to achieve fast and contactless liquid composition recognition.

Benefits of technology

It realizes low-cost, portable and fast liquid composition detection of plastic bottles, with an accuracy of more than 90%, and can identify components such as apple juice, Sprite, Coke, water, alcohol, gasoline, etc.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119811523B_ABST
    Figure CN119811523B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and device for detecting the liquid components of a plastic bottle. The method includes: sending data to a plastic bottle to be detected containing liquid, and receiving the data that penetrates the plastic bottle to be detected containing liquid; obtaining channel state information according to the received data; extracting the channel state information to obtain an amplitude vector and a similarity vector, splicing the amplitude vector and the similarity vector to obtain an input vector; inputting the input vector into a liquid component classification prediction model to obtain a liquid component detection result, wherein the liquid component classification prediction model is constructed based on a neural network and obtained by training based on a training set, and the training set includes the channel state information of different liquid components. The present invention can achieve the purpose of fast, non-contact, and low-cost detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of liquid detection, and particularly to a method and device for detecting the liquid components in a plastic bottle. Background Art

[0002] The rapid detection of liquid components is widely used in subways and high-speed trains. When passengers carry plastic drinks on high-speed trains and subways, it is necessary to quickly detect their components to determine their safety. Plastic packaging products are widely used, and the unsafe components contained therein will pose a hazard to traffic safety. The existing technical equipment measurement instruments determine the components according to the different conductivities of liquids with different components, and their equipment costs are high and they are not portable. Summary of the Invention

[0003] The purpose of the present invention is to provide a method and device for detecting the liquid components in a plastic bottle, so as to provide a portable, low-cost and rapid liquid component detection and provide accurate results for the rapid identification of liquid components.

[0004] To achieve the above purpose, the present invention provides the following solutions:

[0005] On the one hand, a method for detecting the liquid components in a plastic bottle is provided, including:

[0006] Sending data to the plastic bottle to be detected containing liquid, and receiving the data penetrating the plastic bottle to be detected containing liquid;

[0007] Obtaining channel state information according to the received data;

[0008] Extracting the channel state information, obtaining an amplitude vector and a similarity vector, splicing the amplitude vector and the similarity vector to obtain an input vector;

[0009] Inputting the input vector into a liquid component classification prediction model to obtain a liquid component detection result, wherein the liquid component classification prediction model is constructed based on a neural network and trained based on a training set, and the training set includes the channel state information of different liquid components.

[0010] Optionally, sending data to the plastic bottle to be detected containing liquid and receiving the data penetrating the plastic bottle to be detected containing liquid includes:

[0011] Sending a ping data packet to the plastic bottle to be detected containing liquid through a wifi device sending end, and a wifi device receiving end identifying the ping data packet to obtain a pilot symbol at the physical layer and the ping data packet, wherein during the process of sending the ping data packet, the pilot symbol is sent to the wireless channel through an antenna.

[0012] Optionally, obtaining channel state information according to the received data includes:

[0013] Obtain the sequence number of the ping data packet sent by the transmitting end of the wifi device, discard the ping data packets with disordered sequence numbers, save the continuous data packets, save the data packets with discontinuous sequence numbers within a preset range, and obtain the channel state information, where the channel state information is two-dimensional data in time series.

[0014] Optionally, extracting the channel state information to obtain an amplitude vector and a similarity vector includes:

[0015] Perform a non-zero judgment on each sub-channel information in the channel state information to obtain sub-channel data with non-zero data values;

[0016] Extract the real part and the imaginary part of the sub-channel data with non-zero data values to obtain the amplitude vector;

[0017] Calculate the cosine similarity between the sub-channel data with non-zero data values to obtain the similarity vector.

[0018] Optionally, the liquid component classification prediction model includes: an LSTM long short-term memory network, a first fully connected layer, a flattening layer, a second fully connected layer, and an output classification layer;

[0019] Among them, the LSTM long short-term memory network extracts features from the input vector to obtain associated features, inputs the associated features into the first fully connected layer to obtain overall features, inputs the overall features into the flattening layer for feature compression, inputs the compressed overall features into the second fully connected layer, and the second fully connected layer maps the compressed overall features to the output classification layer to obtain the liquid component detection result.

[0020] On the other hand, a liquid component detection device for plastic bottles is also provided, including a wifi signal transceiver device and an intelligent terminal;

[0021] The wifi signal transceiver device is used to place a plastic bottle filled with liquid to be detected between the wifi signal transceiver devices to send data and receive the data penetrating the plastic bottle filled with liquid to be detected;

[0022] The intelligent terminal is used to obtain channel state information according to the received data, extract the channel state information to obtain an amplitude vector and a similarity vector, splice the amplitude vector and the similarity vector to obtain an input vector, input the input vector into a liquid component classification prediction model to obtain a liquid component detection result, where the liquid component classification prediction model is constructed based on a neural network and obtained by training based on a training set, and the training set includes channel state information of different liquid components.

[0023] The beneficial effects of the present invention are as follows: The present invention provides a method and device for quickly detecting the liquid components in a plastic bottle. First, data is sent to the plastic bottle to be detected containing liquid, and the data penetrating the plastic bottle to be detected containing liquid is received; secondly, channel state information is obtained according to the received data; thirdly, the channel state information is extracted to obtain an amplitude vector and a similarity vector, and the amplitude vector and the similarity vector are spliced to obtain an input vector; finally, the input vector is input into a liquid component classification prediction model to obtain a liquid component detection result, where the liquid component classification prediction model is constructed based on a neural network. The present invention can use channel state information for classification and identification of liquid components during communication between both parties in channel communication; it can be used to detect components such as apple juice, Sprite, Coke, water, alcohol, gasoline, etc., and accurate prediction results are obtained through the intelligent algorithm of the pre-trained neural network model, achieving the purpose of fast, non-contact, and low-cost detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0025] Figure 1 It is a flowchart of a method for detecting the liquid components in a plastic bottle according to an embodiment of the present invention;

[0026] Figure 2 It is a schematic diagram of a device for detecting the liquid components in a plastic bottle according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0028] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] Embodiment 1:

[0030] As Figure 1 shown, this embodiment provides a method for detecting the liquid components of a plastic bottle, including:

[0031] Sending data to the plastic bottle to be detected containing liquid, and receiving the data penetrating the plastic bottle to be detected containing liquid;

[0032] Obtaining channel state information according to the received data;

[0033] Extracting the channel state information to obtain an amplitude vector and a similarity vector, splicing the amplitude vector and the similarity vector to obtain an input vector;

[0034] Inputting the input vector into the liquid component classification prediction model to obtain the liquid component detection result, where the liquid component classification prediction model is constructed based on a neural network and obtained by training based on a training set, and the training set includes the channel state information of different liquid components.

[0035] Specifically, when the wifi signal is sent from the transmitting end to the receiving end, the signal may reach the receiving end through multiple paths, and these paths may include direct, reflected, diffracted, transmitted paths, etc. The arrival time, phase, amplitude, and frequency of the signal on each path may be different, which will result in the superposition effect of the received signal. When a plastic bottle containing liquid is placed between the transceiver ends, it will cause changes in the amplitude, phase, frequency, etc. of the propagated signal, which are then reflected in the channel responses of each subcarrier channel received by the receiving party. These changes are related to the liquid components of the plastic bottle placed between the transceiver devices, and their effects can be modeled to establish relevant relationships, so that they can be analyzed and identified. At the same time, the intelligent algorithm of the neural network model is used for prediction to achieve the purpose of fast, non-contact, and low-cost detection.

[0036] Among them, the method for obtaining the training set is to place the signal transceiver devices of the wifi device at a distance of about 15 cm from each other, place plastic bottles containing different liquids in the middle position of the wifi signal transceiver devices for sensing, place them for 2 - 3 seconds, use a computer or an intelligent terminal with a usb interface to connect to the receiving device to receive ping data, preprocess the ping data, remove the data with disordered receiving serial numbers, incomplete data, and incorrect formats, then extract the CSI (channel state information) data of each subchannel, remove the invalid subchannel data, take the subchannel data with non-zero data values and extract them, obtain the amplitude vector and the similarity vector, and splice the amplitude vector and the similarity vector to obtain the spliced vector including different liquid components as the training set.

[0037] Furthermore, data is sent to the plastic bottle to be detected filled with liquid, and the data received by penetrating the plastic bottle to be detected filled with liquid includes:

[0038] A ping data packet is sent to the plastic bottle to be detected filled with liquid through the sending end of the wifi device, and the receiving end of the wifi device identifies the ping data packet to obtain the pilot symbol at the physical layer and the ping data packet. Among them, during the process of sending the ping data packet, the pilot symbol is sent to the wireless channel through the antenna.

[0039] The principle of the method in this embodiment is to use the wifi transceiver device for data transmission. The wifi communication adopts the orthogonal frequency division multiplexing modulation technology (OFDM). OFDM divides the frequency resources into multiple subcarriers, and independent data symbols are transmitted on each subcarrier. At the sending end, the wifi device performs channel estimation by sending pilot symbols. The pilot symbol is a known reference signal. The receiving end can estimate the channel response on each subcarrier in the propagation channel space by comparing the received pilot symbol with the known transmitted symbol.

[0040] Specifically, write the sending end program and compile it into a binary file and burn it into the ESP32-S3 sending end A. After power-on, it can automatically run and actively send ping broadcast data packets. During this process, the device wifi driver program and the physical layer will automatically process the generation and transmission of OFDM symbols, carry the pilot symbol modulation and send it to the wireless channel through the antenna. The automatic receiving program written at the receiving end B is compiled into a binary file and flashed into the ESP32-S3. After power-on, it automatically runs. The function of the receiving end B is to automatically receive broadcast data, identify the broadcast data packet with the sending address of A, so that in the communication process, the receiving party demodulates from the wireless channel to obtain the pilot symbol at the physical layer and the sent ping data packet. Through the written special program, the pilot symbol at the physical layer can be obtained on the receiving party device to perform channel estimation and calculate the channel response.

[0041] Furthermore, according to the received data, obtaining the channel state information includes:

[0042] Obtain the sequence number of the ping data packet sent by the wifi device sending end, discard the ping data packets with disordered sequence numbers, save the continuous data packets, and save the data packets with discontinuous sequence numbers within a preset range to obtain the channel state information, where the channel state information is two-dimensional data in time series.

[0043] Specifically, the complete channel response data (received data packets) are of a fixed length. An automated program determines whether the channel response meets the fixed length requirement, automatically discards error data packets with incomplete data lengths, and preprocesses the complete data packets.

[0044] Preprocessing process: For each received complete channel response data packet, extract the packet sequence number sent by the sender A in the communication, discard packets with disordered sequence numbers, save the continuous data of the received data packets, and save the data with discontinuous sequence numbers within a certain range to form a two-dimensional CSI data in time series.

[0045] Furthermore, extract the channel state information to obtain the amplitude vector and similarity vector, including:

[0046] Judge whether each sub-channel information in the channel state information is non-zero to obtain the sub-channel data with non-zero data values;

[0047] Extract the real part and imaginary part of the sub-channel data with non-zero data values to obtain the amplitude vector;

[0048] Calculate the cosine similarity between the sub-channel data with non-zero data values to obtain the similarity vector.

[0049] Specifically, judge whether each sub-channel in the saved CSI data is non-zero, and select the non-zero sub-channels to form new effective CSI sub-channel data.

[0050] Extract the real part and imaginary part of the complex vector sub-channel data composed of effective CSI, and calculate its amplitude. The complex vector is expressed as:

[0051] Y i =a i +b i j

[0052] where i represents the i-th sub-channel, a i represents its real part, and b i represents its imaginary part. The expression for calculating its amplitude is Thus, a new two-dimensional amplitude vector V of each sub-channel is formed.

[0053] V=[V0 V1 … V i … V m

[0054] Cosine similarity is used to represent the factor affected by the object to be detected between adjacent CSI channels. Calculating the cosine similarity includes:

[0055]

[0056] where, Y qi and Y q(i+1) ​They are the vector complex values of the q-th row and the i-th subchannel, and the q-th row and the (i + 1)-th subchannel in the CSI data respectively. j is the number of received timing data.

[0057] Through this calculation process, the column vector C corresponding to the cosine similarity expression of the original CSI data can be obtained.

[0058] C = [C0 C1 … C i … Cm]

[0059] C i = cos(θ) i

[0060] Among them, C i represents the cosine similarity value between the i-th subchannel and the (i + 1)-th subchannel.

[0061] The input vector I is obtained by concatenating the amplitude vector V and the similarity vector C column by column, and is used as the input vector of the subsequent neural network classification model.

[0062] I = [V|C]

[0063] Furthermore, the neural network classification prediction model includes: LSTM long short-term memory network, the first fully connected layer, the flattening layer, the second fully connected layer, and the output classification layer;

[0064] Among them, the LSTM long short-term memory network extracts features from the input vector to obtain associated features, inputs the associated features into the first fully connected layer to obtain overall features, inputs the overall features into the flattening layer for feature compression, inputs the compressed overall features into the second fully connected layer, and the second fully connected layer maps the compressed overall features to the output classification layer to obtain the liquid component detection result.

[0065] Specifically, a large amount of sensing data is collected by the foregoing method from plastic bottles filled with apple juice, Sprite, Coke, water, alcohol, and gasoline, and is used to train a neural network classification prediction model. The neural network classification prediction model is a hybrid model constructed using LSTM (Long Short-Term Memory Network) + the first fully connected layer + the flattening layer + the second fully connected layer + the output classification layer. LSTM is used for feature extraction of time series data and can extract associated features from continuous channel state data over time. Among the associated features, there are factors affecting the components of the object to be measured in each sub-channel, which are related to amplitude, frequency, and phase and are directly associated with the components of the object to be measured. Through the first fully connected layer, the features are further abstracted to obtain overall features, and the overall features reflect the comprehensive influence factors of the components of the object to be measured on amplitude, frequency, and phase, reflecting the comprehensive influence on all sub-channels of CSI. The flattening layer is used to further compress the features, and the second fully connected layer is used to map the features to an output layer with multiple output nodes, and each node corresponds to a classification. The output layer is used to perform classification and discrimination tasks, and finally a model M for classification prediction is formed.

[0066] Embodiment 2:

[0067] A plastic bottle liquid component detection device includes a wifi signal transceiver device and an intelligent terminal;

[0068] The wifi signal transceiver device is used to send data to a plastic bottle filled with liquid to be detected placed in a fixed position area between wifi signal transceiver devices and receive the data that penetrates the plastic bottle filled with liquid to be detected;

[0069] The intelligent terminal is used to obtain channel state information according to the received data, extract the channel state information, obtain an amplitude vector and a similarity vector, splice the amplitude vector and the similarity vector to obtain an input vector, input the input vector into the liquid component classification prediction model, and obtain the liquid component detection result. The liquid component classification prediction model is constructed based on a neural network and obtained by training based on a training set, and the training set includes channel state information of different liquid components.

[0070] The device first acquires CSI data, preprocesses it, and removes data with out-of-order received sequence numbers, incomplete data, or incorrect formats. It then extracts data from each CSI subchannel, removes invalid subchannel data, and takes CSI subchannel data with non-zero values. The valid subchannel data is processed in two steps. The first step extracts the complex values of the valid CSI subchannels and calculates their amplitudes, V, while also calculating the cosine similarity, C, of the data between the valid subchannels. The second step concatenates the amplitudes, V, and cosine similarity, C, from the previous step into a new vector, I. This new vector, I, is then used as the data input for a neural network model, which trains a classification model called an LSTM (Long-Short Term Time Series Prediction Neural Network). This results in a trained neural network model, M, that can measure solutions with a variety of different components. The data acquired by the Wi-Fi device is fed into model M in real time for classification and recognition, yielding accurate results.

[0071] The component detection device in this embodiment also includes a power supply for supplying power to the WiFi signal transceiver device.

[0072] The liquid component detection achieved by the above device includes: Figure 2 As shown, the distance between the WiFi signal transceiver devices is about 15 cm. Using the detection equipment and related algorithms, the plastic bottle containing the above-mentioned liquid is placed in the middle position of the WiFi signal transceiver used for sensing, and left there for 2-3 seconds. A computer or an intelligent terminal with a USB interface is used to connect the receiving device to receive data and run the measurement and analysis algorithm. The analysis and detection algorithm automatically gives the possible measurement results of the components, and the accuracy of the detection results can reach more than 90%.

[0073] This embodiment utilizes two embedded ESP32-S3 Wi-Fi devices for Wi-Fi broadcast communication, enabling one device to continuously send ping packets and the other to receive them. The receiving end extracts the Wi-Fi signal strength information transmitted by the transmitter and interprets it as Wi-Fi CSI data. CSI data is a composite of multiple sub-channels of Wi-Fi channel state information derived from the signal strength of the transmitted signal at different frequency bands within the propagation wireless channel. By leveraging the characteristic that electromagnetic waves, when penetrating liquids of different compositions, alter the amplitude, phase, and frequency of the original signal at different frequency bands, causing characteristic changes, an artificial intelligence neural network model was developed to identify the different compositions of liquids in plastic bottles. The characteristics of the influence of different solutions on the amplitude, phase, and frequency bands of the transmitted signal are classified and identified, enabling rapid, contactless detection of different solutions. This approach not only reduces detection costs, but also shortens detection time and improves detection efficiency. Furthermore, the overall detection device features a simple structure and high portability.

[0074] The embodiments described above are only descriptions of the preferred embodiments of the present invention and do not limit the scope of the present invention. Without departing from the spirit of the present invention's design, various deformations and improvements made by those of ordinary skill in the art to the technical solutions of the present invention shall fall within the protection scope determined by the claims of the present invention.

Claims

1. A method for detecting the liquid components of a plastic bottle, characterized in that, Including: Sending data to a plastic bottle filled with liquid to be detected and receiving data that penetrates the plastic bottle filled with liquid to be detected; Obtaining channel state information according to the received data; Extracting the channel state information to obtain an amplitude vector and a similarity vector, concatenating the amplitude vector and the similarity vector to obtain an input vector; Obtaining the similarity vector includes: Performing a non-zero judgment on each sub-channel information in the channel state information to obtain sub-channel data with non-zero data values; Calculating the cosine similarity between the sub-channel data with non-zero data values to obtain the similarity vector; Inputting the input vector into a liquid component classification prediction model to obtain a liquid component detection result, where the liquid component classification prediction model is constructed based on a neural network and trained based on a training set, and the training set includes channel state information of different liquid components.

2. The method for detecting the liquid components of a plastic bottle according to claim 1, wherein Sending data to a plastic bottle filled with liquid to be detected and receiving data that penetrates the plastic bottle filled with liquid to be detected includes: Sending a ping data packet to the plastic bottle filled with liquid to be detected through a wifi device sending end, and the wifi device receiving end identifying the ping data packet to obtain a pilot symbol at the physical layer and the ping data packet. Among them, during the process of sending the ping data packet, the pilot symbol is sent to the wireless channel through an antenna.

3. The method for detecting the liquid components of a plastic bottle according to claim 2, characterized in that, Obtaining channel state information according to the received data includes: Obtaining the sequence number of the ping data packet sent by the wifi device sending end, discarding the ping data packets with disordered sequence numbers, saving the continuous data packets, and saving the data packets with discontinuous sequence numbers within a preset range to obtain the channel state information, where the channel state information is two-dimensional data in time series.

4. The method for detecting the liquid components of a plastic bottle according to claim 1, wherein, Obtaining the amplitude vector includes: extracting the real part and the imaginary part from the sub-channel data with non-zero data values to obtain the amplitude vector.

5. The method for detecting the liquid components of a plastic bottle according to claim 1, characterized in that, The liquid component classification prediction model includes: an LSTM long short-term memory network, a first fully connected layer, a flattening layer, a second fully connected layer, and an output classification layer; Among them, the LSTM long short-term memory network extracts features from the input vector to obtain associated features, inputs the associated features into the first fully connected layer to obtain overall features, inputs the overall features into the flattening layer for feature compression, inputs the compressed overall features into the second fully connected layer, and the second fully connected layer maps the compressed overall features to the output classification layer to obtain the liquid component detection result.

6. The detection device for the plastic bottle liquid component detection method according to any one of claims 1-5, characterized in that, Including a wifi signal transceiver device and an intelligent terminal; The wifi signal transceiver device is used to send data to a plastic bottle filled with liquid placed between the wifi signal transceiver devices and receive data that penetrates the plastic bottle filled with liquid to be detected; The intelligent terminal is used to obtain channel state information according to the received data, extract the channel state information, obtain an amplitude vector and a similarity vector, splice the amplitude vector and the similarity vector to obtain an input vector, input the input vector into a liquid component classification prediction model, and obtain a liquid component detection result, where the liquid component classification prediction model is constructed based on a neural network and obtained by training based on a training set, and the training set includes channel state information of different liquid components; Obtaining the similarity vector includes: Performing a non-zero judgment on each sub-channel information in the channel state information to obtain sub-channel data with non-zero data values; Calculating the cosine similarity between the sub-channel data with non-zero data values to obtain the similarity vector.

Citation Information

Patent Citations

  • Method and device for measuring complex dielectric constant of liquid based on Wi-Fi signals

    CN112595898A

  • Liquid type detection method and device based on acoustic perception and medium

    CN117890461A