A full current sensing system and detection method for identifying ingredients in commercially available beverages

By combining a self-powered nanogenerator with a full-current pulse neural network, the problems of large equipment size, high power consumption and low detection sensitivity in the existing technology are solved, and rapid and accurate identification of the ingredients of commercially available beverages is achieved, making it suitable for on-site detection of portable equipment.

CN120490265BActive Publication Date: 2025-09-23LUDONG UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510990698.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-09-23
Estimated Expiration
2045-07-18

AI Technical Summary

Technical Problem

Existing electronic tongue system equipment is large in size, has high power consumption, and low detection sensitivity, making it difficult to adapt to outdoor or mobile scenarios. In addition, traditional TENG is prone to charge decay under droplet impact, and cannot achieve real-time and continuous identification of commercially available beverage ingredients.

Method used

A self-powered nanogenerator is used to generate electrical signals, which are then processed using a full-current pulse neural network. Model training is optimized through Z-score normalization, data enhancement, and a three-stage learning rate scheduling strategy. Combined with a pulse attention mechanism, the temporal feature extraction of electrical signals and beverage category classification are achieved.

Benefits of technology

The system can quickly and accurately identify the ingredients of commercially available beverages. It does not require an external power supply, has a simple structure, short detection time, and high monitoring sensitivity. It is suitable for portable devices and is applicable to on-site rapid testing in supermarkets and catering scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120490265B_ABST
    Figure CN120490265B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of intelligent electrochemical sensing and nano-energy technology, and discloses a full-current sensing system and detection method for identifying the ingredients of commercially available beverages. The method drips the beverage to be tested onto the friction layer surface of the full-current nanogenerator at a rate of 1-5 drops / second, generating an electrical signal due to the liquid-solid triboelectric effect; S2, using a data acquisition module to collect the electrical signal in real time at a sampling rate of 1kHz. The signal processing process includes Z-score normalization, data enhancement, and signal truncation to optimize time domain and frequency domain feature extraction. By integrating the full-current droplet nanogenerator with deep learning, the present invention solves the technical bottleneck of traditional methods that rely on professional instruments and have complex detection processes, providing an innovative solution for the rapid on-site identification of commercially available beverage ingredients.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent electrochemical sensing and nano energy technology, and in particular relates to a full current sensing system and a detection method for identifying ingredients of commercially available beverages. Background Art

[0002] With increasing public concern for food safety and beverage quality, rapid and accurate identification of commercially available beverage ingredients has become a pressing need. To enable machines to discern subtle taste differences like humans, the "electronic tongue" is quietly emerging, and scientists have developed an electronic tongue system. Existing electronic tongue systems rely on an external power supply. Their sensor arrays, due to complex circuitry, result in large device size, high power consumption, long system response time, and low detection sensitivity (micromolar range), making them difficult to adapt to field or mobile scenarios. Furthermore, detection requires a constant temperature and humidity environment, making them less adaptable to temperature fluctuations (±5°C) and mechanical vibration. In recent years, machine learning-based algorithms have been able to predict the compositional characteristics of single molecules with considerable accuracy. Recently, self-powered technologies based on triboelectric nanogenerators (TENGs) have achieved electrical signal output through energy harvesting at solid-liquid interfaces, offering new opportunities for portable sensing. However, existing droplet-based nanogenerators are susceptible to charge decay under continuous droplet impact, resulting in signal drift. Furthermore, they lack efficient signal processing methods, making them difficult to meet the requirements of real-time and continuous identification. Furthermore, conventional TENGs lack a mechanism for extracting characteristic signals from complex liquids, making it difficult to establish a mapping relationship between composition and electrical response, and thus unable to adapt to diverse application scenarios. Therefore, an efficient and intelligent self-powered liquid identification technology is urgently needed. Summary of the Invention

[0003] To overcome the problems existing in the related art, the disclosed embodiments of the present invention provide a full-current sensing system and detection method for identifying the ingredients of commercially available beverages. Specifically, it relates to an intelligent electronic tongue system based on a self-powered nanogenerator and a liquid identification method thereof, which is particularly suitable for real-time detection and classification of commercially available beverage ingredients.

[0004] The technical solution is as follows: A detection method for a full current sensing system for identifying ingredients in commercially available beverages comprises the following steps:

[0005] S1, dripping the beverage to be tested onto the friction layer surface of the full-current nanogenerator at a rate of 1-5 drops / second, generating an electrical signal due to the liquid-solid triboelectric effect;

[0006] S2, using a data acquisition module to collect the electrical signal in real time at a sampling rate of 1 kHz. The signal processing process includes Z-score normalization, data enhancement and signal truncation to optimize time domain and frequency domain feature extraction;

[0007] S3 extracts the timing characteristics of electrical signals through a full current pulse neural network. It uses a three-stage learning rate scheduling strategy, including a warm-up phase, a stabilization phase, and a cosine decay phase, to optimize model training. It also combines a pulse attention mechanism to enhance the processing capability of complex timing signals.

[0008] S4, an interactive graphical interface based on PySide6, outputs beverage category classification results and probability distribution in real time, displays signal waveforms, beverage category identification results and images in real time, and the interactive interface supports dynamic waveform rendering.

[0009] In step S1, the full-current nanogenerator includes: a substrate, a friction layer surface, a charge collection needle, a top electrode, a bottom electrode, a top electrode lead, and a bottom electrode lead;

[0010] The surface of the friction layer is integrated on the upper surface of the substrate, the charge collection needle is installed at one end of the top electrode, the other end of the top electrode is connected to the current detector through the top electrode lead, the top electrode and the bottom electrode are respectively installed at the top and bottom of the friction layer surface; the end of the bottom electrode is connected to the current detector through the bottom electrode lead; an electrical signal is generated when a droplet of the liquid to be measured hits the surface of the friction layer.

[0011] Furthermore, the tip curvature radius of the charge collection needle is 200 μm, and the substrate is made of perfluoroethylene propylene copolymer (FEP).

[0012] In step S3, the signal features are extracted by the full current pulse neural network TCSN, including:

[0013] (1) Use the primary convolution extraction layer for standardization preprocessing and use Z-score standardization to adjust the distribution of electrical signals. The formula is:

[0014] ;

[0015] Where, is the processed signal, is the original signal, is the mean, is the standard deviation, and the signal is cut off at 0.1–5 s;

[0016] (2) The deep feature enhancement module ConvSAB introduces adaptive low-frequency noise, time axis translation, and amplitude perturbation to simulate the signal perturbation caused by droplet impact;

[0017] (3) During the training process, a three-stage cosine learning rate adjustment strategy is adopted to optimize the convergence of the time series signal. The three-stage cosine learning rate adjustment strategy includes: warm-up stage, stabilization stage and cosine decay stage.

[0018] In step (2), the deep feature enhancement module ConvSAB introduces adaptive low-frequency noise, time axis translation and amplitude perturbation to simulate the signal perturbation caused by droplet impact, including:

[0019] Adaptive low-frequency noise addition dynamically generates low-frequency noise and acts on the high-amplitude area of ​​the signal. The formula is:

[0020] ;

[0021] Where, is the signal amplitude, is the noise factor, The threshold is used to distinguish high / low amplitude areas and can be set according to signal characteristics (such as RMS value or peak value); is random noise, For in time The adaptive low-frequency noise signal generated at each moment has a strength that is dynamically related to the amplitude of the original signal; The original signal In time The absolute value at the moment (i.e., the instantaneous amplitude of the signal) is used to dynamically modulate the amplitude of the noise, making the noise more significant in high-amplitude areas. As a basic low-frequency noise source, its power spectrum density may satisfy the low-frequency characteristics; is an indicator function (usually a step function or a Boolean condition), which takes the value of 1 when the signal amplitude exceeds the threshold θ, and 0 otherwise. Its function is to limit the noise to act only on the high-amplitude area of ​​the signal, avoiding unnecessary interference on the low-amplitude part. This method simulates environmental interference and enhances the robustness of the model.

[0022] Time axis translation, range The time axis of the random offset signal is preserved by linear interpolation to simulate the uncertainty of the droplet impact timing;

[0023] Random amplitude scaling, applied to the signal in the range The random scaling factor is:

[0024] ;

[0025] Where, is the scaled signal; is the scaling factor, indicating is a random variable that may affect the growth or decay rate of the system; represents a uniform distribution, i.e. In the interval The values ​​are taken with equal probability.

[0026] In step (3), the total number of training steps in the three-stage cosine learning rate adjustment strategy is:

[0027] ;

[0028] Where, is the total number of training steps, is the training round, is the number of iterations per round;

[0029] It includes the following stages:

[0030] Warm-up phase: 10% of the total number of steps, the learning rate increases from the initial value Increase linearly to the maximum value ;

[0031] Stable phase: From the end of the warm-up phase to 40% of the total number of steps, the learning rate is constant ;

[0032] Decay phase: The total number of steps ends at the end of the stable phase, and the cosine annealing strategy is adopted, and the learning rate is Gradually decays to near , the formula is:

[0033] ;

[0034] Where, is the current number of training steps (iterations), which is used to dynamically calculate the attenuation progress of the learning rate. is the dynamic learning rate at the current step, and its value changes from Gradually decrease to near , but by adjusting the cosine function and the offset term (0.499+0.5), we ensure that the learning rate will not drop completely to 0, but will approach , Indicates the end step number of the second stage (stable stage), that is, the starting point of the decay stage.

[0035] In step S3, the full current spiking neural network TCSN consists of a primary convolutional extraction layer, a deep feature enhancement module ConvSAB, a spiking neuron computing unit EIFNode, and a linear classification output layer;

[0036] The primary convolution extraction layer consists of multiple serially connected one-dimensional convolution modules Conv1D, batch normalization modules BatchNorm, and activation functions ReLU, forming a standard convolution feature unit sequence for edge enhancement, noise suppression, and low-level feature extraction of the input original signal;

[0037] The deep feature enhancement module ConvSAB performs feature fusion by introducing a residual branch and a feature fusion mechanism of channel attention and spatial attention;

[0038] The pulse neuron computing unit EIFNode adopts a multi-step exponential integration and discharge model. By setting the threshold potential, resting voltage, time constant, temperature factor and reset level, it simulates the membrane potential evolution process of biological neurons and completes the precise encoding of instantaneous activation points in dynamic signals and event triggering response.

[0039] The linear classification output layer outputs the probability distribution of multiple types of commercially available beverages through the fully connected layer to complete ingredient identification.

[0040] Furthermore, the deep feature enhancement module ConvSAB performs feature fusion by introducing a residual branch and a feature fusion mechanism of channel attention and spatial attention, including:

[0041] (I) Channel attention: Generate channel weights through adaptive average pooling AdaptiveAvgPool1d and two layers of one-dimensional convolution Conv1d, expressed as:

[0042] ;

[0043] Where, is the channel weight, is the Sigmoid activation function, is the input feature map, is the adaptive average pooling, It is a one-dimensional convolution operation used to capture nonlinear dependencies between channels; It is the Rectified Linear Unit activation function, which introduces nonlinearity between the two layers of Conv1d, enhances the expressive power of the model, and avoids the limitations of linear transformation.

[0044] Channel weight Weight each channel to highlight the key feature channels;

[0045] (II) Spatial attention: Generate spatial weights through one-dimensional convolution, expressed as:

[0046] ;

[0047] Where, is the spatial weight;

[0048] Spatial weight Weighting the spatial activation area of ​​the feature map to suppress background noise;

[0049] (III) Feature fusion: channel-weighted features and spatially weighted features Multiply element by element to generate the final feature:

[0050] ;

[0051] Where, It is the final fused feature map, which is the output result of dual adjustment of channel weighting and spatial weighting. It is the channel-weighted feature, through the channel attention weight For the original input features Perform channel-by-channel modulation. It is the spatially weighted feature map, and the channel weighted feature Based on the spatial attention weight Modulate each spatial position.

[0052] Furthermore, the spike neuron computing unit EIFNode uses a multi-step exponential integration and discharge model to simulate the membrane potential evolution process of biological neurons by setting the threshold potential, resting voltage, time constant, temperature factor and reset level. It can complete the precise encoding of instantaneous activation points in dynamic signals and event trigger response, including:

[0053] Time-step accumulation, input current At each time step Accumulate to membrane potential , the expression is:

[0054] ;

[0055] Where, is the time constant, in milliseconds (ms), reflecting the decay rate of the membrane potential; is the resting potential, capturing the instantaneous changes of the droplet impact signal; For the neuron at the next time step The membrane potential is the current membrane potential According to the input current and time constant The result of dynamic update. This process simulates the integral characteristics of biological neuron membrane potential, that is, the cumulative effect of input signal step by step. is the current time step, which is used to mark the instantaneous state of membrane potential and input current.

[0056] Voltage exponential decay, when there is no input current, the membrane potential exponentially decays to , the expression is:

[0057] ;

[0058] Simulate the dynamic response of neurons to intermittent signals;

[0059] Pulse trigger judgment, when the membrane potential Exceeding the threshold When , the trigger pulse is expressed as:

[0060] ;

[0061] encoding high-frequency features resulting from differences in beverage composition;

[0062] Discharge reset mechanism, after the pulse is triggered, the membrane potential is reset to . It is the resting potential (usually around -70mV), which represents the stable membrane potential of neurons when they are not stimulated.

[0063] In step S4, the signal waveform, beverage category identification results and images are displayed in real time, including:

[0064] Data processing and signal acquisition: The electrical signal generated by the full-current nanogenerator is collected by the data acquisition module at a rate of 1-5 drops / second. The original signal is standardized and uniformly truncated to 0.1-5s; it is adapted to the full-current pulse neural network TCSN input;

[0065] Real-time waveform rendering, multi-threaded signal processing unit dynamically renders time domain waveforms;

[0066] After the identification result is output, the full current pulse neural network TCSN extracts the signal features, and the Softmax function outputs the classification probability of multiple types of beverages.

[0067] Another object of the present invention is to provide a full current sensing system for identifying ingredients in commercial beverages, which implements the detection method of the full current sensing system for identifying ingredients in commercial beverages, and the system comprises:

[0068] Full-current nanogenerators for generating electrical signals;

[0069] A data signal acquisition module is used to monitor in real time the electrical signals on the surface of the full-current nanogenerator caused by beverage dripping;

[0070] An algorithm processing module is used to extract and classify the electrical signals generated by the full-current nanogenerator based on a pre-trained full-current pulse neural network (TCSN);

[0071] The interactive interface dynamically displays the electrical signal waveform, classification results, and probability distribution of the full-current nanogenerator through a cross-platform GUI framework.

[0072] In combination with all the above technical solutions, the beneficial effects of the present invention are as follows:

[0073] First, to address the challenges of commercially available beverage ingredient identification technologies, such as reliance on external power supplies, poor portability, and insufficient detection accuracy and anti-interference capabilities, this invention provides a fully current sensing system and detection method for commercially available beverage ingredient identification. By integrating a self-powered droplet nanogenerator with a deep learning algorithm, the system can rapidly and accurately identify the ingredients of 14 commercially available beverages (pure water, mineral water, alkaline soda water, glucose drinks, peach water, lemon soda water, Jinro Soju, cocktails, Sprite, vodka, Mizone, Erguotou, Dongpeng Electrolyte, and Jianlibao Electrolyte).

[0074] Second, the present invention provides self-powered, efficient detection: When a droplet of a commercially available beverage impacts the friction layer of the all-current nanogenerator, charge transfer occurs through the solid-liquid contact electrodynamic effect. The synergistic effect of the conduction current and displacement current directly converts the droplet's kinetic energy into an electrical signal. This system requires no external power supply, boasts a simple structure, and is low-cost. A single detection time is less than 0.5 seconds, and it can distinguish 14 types of beverages (including purified water, electrolyte beverages, alcoholic beverages, and carbonated drinks), making it suitable for rapid on-site identification.

[0075] High monitoring sensitivity: Differences in ion concentration, electrolyte composition, and pH between different beverages lead to significant variations in the amount of charge transferred between the test liquid droplet and the friction layer. Experiments have shown that the peak current signal difference between pure water and electrolyte beverages (such as Jianlibao) is several times greater, and signal strength is negatively correlated with compositional complexity. A deep learning model can establish a mapping between electrical signal characteristics and beverage category, enabling high-precision classification.

[0076] The algorithm has strong real-time performance: it uses a temporal convolution structure with a large convolution kernel and a long step size to complete feature extraction and output the results of a single liquid droplet signal to be tested within 0.3 seconds; the pulse attention module automatically focuses on specific response frequency bands, improving the model's ability to distinguish similar categories (such as Sprite and lemon soda) by 10%.

[0077] The system is lightweight and easy to use: The interactive interface is developed based on a lightweight framework, supporting expansion on embedded devices such as the Raspberry Pi, and maintaining low system utilization. The detection process requires no chemical reagents or pretreatment steps; simply dropping a droplet of the test liquid onto the device triggers identification. With low operational requirements and the ability to be integrated into portable devices, it is suitable for on-site rapid testing in supermarkets, restaurants, and other settings.

[0078] Excellent scalability: The system can be expanded to areas such as alcohol content identification and edible oil deterioration detection.

[0079] Third, the present invention solves the technical bottleneck of traditional methods that rely on professional instruments and have complex detection processes by integrating full-current droplet nanogenerators with deep learning, providing an innovative solution for the rapid on-site identification of commercially available beverage ingredients.

[0080] The technical solution provided by the present invention can achieve rapid detection at a rate of 1-5 drops / second without the need for complex professional instruments, greatly reducing the detection threshold and cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure;

[0082] Figure 1 This is a flow chart of a detection method for identifying ingredients of commercially available beverages using a full current sensing system provided by an embodiment of the present invention;

[0083] Figure 2 Schematic diagram of a full-current nanogenerator provided by an embodiment of the present invention;

[0084] Figure 3 Schematic diagram of current signals generated by different solutions (such as pure water, electrolyte beverages, carbonated beverages, etc.) on the full-current nanogenerator of the present invention;

[0085] Figure 4 This is a graph showing the learning rate changes during training of the full current pulse neural network (TCSN) model of the present invention;

[0086] Figure 5 This is a confusion matrix diagram of the full current pulse neural network TCSN model of the present invention for identifying 14 beverages;

[0087] Figure 6 This is the architecture diagram of the full current pulse neural network TCSN of the present invention;

[0088] Figure 7 It is a traversal graph for optimizing parameters of the primary convolution extraction layer of the full current pulse neural network TCSN of the present invention;

[0089] In the figure: 111, substrate; 112, friction layer surface; 113, charge collection needle; 114, top electrode; 115, bottom electrode; 116, top electrode lead; 117, bottom electrode lead; 118, droplet. DETAILED DESCRIPTION

[0090] To make the above-mentioned objects, features, and advantages of the present invention more readily apparent, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. The following description sets forth numerous specific details to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art may make similar modifications without departing from the scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0091] The innovation of this invention lies in its innovative fusion of a full-current droplet nanogenerator and deep learning. A beverage drop rate of 1-5 drops / second triggers the nanogenerator to generate a specific electrical signal, converting the droplet's kinetic energy into electrical signatures, replacing traditional complex instruments. A full-current pulsed neural network (TCSN) is used to extract and classify multi-scale features in the time and frequency domains, with results presented in real time on an interactive interface. The classification accuracy reaches 99.86%. The system is only one-tenth the size of a portable spectrometer, reducing costs by 90%, and its contactless detection requires no complex pre-processing. Compared to microfluidics technologies that rely on dedicated chips and biosensors with specific recognition elements, this technology eliminates the need for complex pre-processing and achieves rapid identification through contactless detection, offering greater universality and potential for scalable application. Through its "droplet dynamics-electrical signal-deep learning" approach, it overcomes the challenges of traditional detection, which include poor portability, high cost, and low efficiency, providing a disruptive technical solution for beverage ingredient identification.

[0092] Example 1, as Figure 1 As shown, the present invention provides a detection method of a full current sensing system for identifying ingredients of commercially available beverages, comprising:

[0093] S1, dripping the beverage to be tested onto the friction layer surface of the full-current nanogenerator at a rate of 1-5 drops / second, generating an electrical signal due to the liquid-solid triboelectric effect;

[0094] S2, using a data acquisition module to collect the electrical signal in real time at a sampling rate of 1 kHz. The signal processing process includes Z-score normalization, data enhancement and signal truncation to optimize time domain and frequency domain feature extraction;

[0095] Data enhancement includes but is not limited to adaptive low-frequency environmental noise addition and time axis shifting, and the signal truncation length is 0.1-5s;

[0096] S3 extracts the timing characteristics of electrical signals through a full current pulse neural network. It uses a three-stage learning rate scheduling strategy, including a warm-up phase, a stabilization phase, and a cosine decay phase, to optimize model training. It also combines a pulse attention mechanism to enhance the processing capability of complex timing signals.

[0097] S4, an interactive graphical interface based on PySide6, outputs beverage category classification results and probability distribution in real time, displays signal waveforms, beverage category identification results and images in real time, and the interactive interface supports dynamic waveform rendering.

[0098] Example 2: A full-current sensing system for identifying commercial beverage ingredients (a full-current droplet generator sensing system for identifying commercial beverage ingredients) provided by the present invention includes:

[0099] Full-current nanogenerators for generating electrical signals;

[0100] A data signal acquisition module is used to monitor in real time the electrical signals on the surface of the full-current nanogenerator caused by beverage dripping;

[0101] An algorithm processing module is used to extract and classify the electrical signals generated by the full-current nanogenerator based on a pre-trained full-current pulse neural network (TCSN);

[0102] The interactive interface dynamically displays the electrical signal waveform, classification results, and probability distribution of the full-current nanogenerator through a cross-platform GUI framework.

[0103] Specifically, a full current nanogenerator. Figure 2 As shown, an electrical signal is generated by the impact of a droplet 118 of the liquid to be measured on the friction layer, which includes a substrate 111, a friction layer surface 112, a charge collection needle 113, a top electrode 114, a bottom electrode 115, a top electrode lead 116, and a bottom electrode lead 117; the friction layer surface 112 is integrated on the upper surface of the substrate 111; the charge collection needle 113 is installed at one end of the top electrode 114, and the other end of the top electrode 114 is connected to the current detector through the top electrode lead 116, the top electrode 114 and the bottom electrode 115 are respectively installed at the top and bottom of the friction layer surface 112; the end of the bottom electrode 115 is connected to the current detector through the bottom electrode lead 117.

[0104] The top electrode 114 and the bottom electrode 115 are made of a conductive material selected from copper (Cu), aluminum (Al), titanium (Ti) or silver (Ag), the distance between the two electrodes is 0.01-1m, and the electrode leads are connected by metal conductive wires;

[0105] Data signal acquisition module: The electrical signals generated by the full-current nanogenerator are collected by the data acquisition module at a rate of 1-5 drops / second. The raw signals are standardized and truncated to 0.1-5s, adapting them to the input of the full-current pulse neural network (TCSN). Data enhancement (such as time axis shifting) simulates droplet impact disturbances to ensure signal robustness.

[0106] Algorithm processing module, based on pre-trained full current pulse neural network TCSN (such as Figure 6) model extracts and classifies features from the electrical signals generated by the all-current nanogenerator. Specifically, a multi-stage data processing pipeline is employed, including the following steps: First, the electrical signal undergoes normalization (adjusting signal distribution consistency based on the Z-score) and noise suppression (removing background interference through adaptive low-frequency filtering) in a preprocessing submodule. Subsequently, the feature extraction submodule utilizes large convolution kernels (5-16) and long step sizes (3-8) (5 to 16 time steps allow for longer signal sequences, thus capturing non-local features such as periodic fluctuations or low-frequency trends) to capture broad temporal and frequency domain features. Downsampling reduces computational effort while preserving key feature information. The combination of these two submodules enables multi-level feature extraction, from coarse to fine granularity. The pulse attention module dynamically adjusts feature weights like an "intelligent mixer," ultimately improving classification accuracy and system energy efficiency. Finally, the classification submodule outputs the probability distribution of 14 categories of commercially available beverages through a fully connected layer, thereby achieving efficient and accurate ingredient identification.

[0107] The interactive interface realizes the dynamic display of the full-current nanogenerator electrical signal waveform, classification results and probability distribution through a cross-platform GUI framework (such as PySide6), and is tightly coupled with the data processing process.

[0108] Exemplarily, the structural features of the full-current nanogenerator include:

[0109] (1) The volume of the test liquid droplet 118 naturally falling is 0.1-1 ml, and it is driven by gravity without external energy supply; the charge collection needle 113 is 0.01-1 m long and is made of copper (Cu), aluminum (Al) or silver (Ag) conductive material, with a tip curvature radius of ≤100 μm, which is used to optimize the contact and separation efficiency between the test liquid droplet 118 and the electrode; the substrate 111 is an insulating solid material selected from polytetrafluoroethylene (PTFE), polycarbonate (PC) or polymethyl methacrylate (PMMA), with a thickness of 1-10 mm;

[0110] (2) The charge collection needle 113 has a length of 1-100 cm and is made of copper (Cu), aluminum (Al) or silver (Ag) conductive material. It is used to measure the contact and separation efficiency between the liquid droplet 118 to be tested and the top electrode 114 and the bottom electrode 115. When the liquid droplet 118 to be tested subsequently collides with the top electrode 114 and the charge collection needle 113, the negative charge is transferred to the top electrode 114, and the remaining positive charge slides with the liquid droplet 118 to the bottom electrode 115 to complete the transfer. Experiments show that after optimizing the curvature radius of the charge collection needle 113 tip from 400 μm to 200 μm, the negative charge transfer efficiency is improved by 15%, and the signal peak value increases by about 200 nA.

[0111] (3) To optimize the signal output and classification performance of the full-current nanogenerator, multiple screening experiments were conducted to verify the influence of key process parameters: Droplet volume (0.3-0.9 ml): Experiments tested the effect of 0.3 ml, 0.5 ml, and 0.9 ml droplets on the signal peak of pure water and Jianlibao electrolyte beverage. The results showed that the 0.9 ml droplet achieved the best balance between signal stability (standard deviation <5%) and peak intensity (approximately 500 nA), making it suitable for rapid detection. The 0.03 ml droplet had a weaker signal (200 nA).

[0112] Charge collector needle 113 tip curvature radius (≤400μm): 200μm, 300μm, and 400μm copper collector needles were tested. The 200μm tip significantly improved charge transfer efficiency (signal peak increased by 15%).

[0113] Friction layer materials (PVC, Kapton, PTFE, FEP) on the friction layer surface 112: The hydrophobicity and triboelectric properties of the four materials were compared. FEP, due to its high hydrophobicity (contact angle > 110°) and strong negative charge capture ability, produced the highest signal peak (500nA, pure water), which is better than PVC (200nA) and Kapton (200nA). PTFE's performance was slightly lower than FEP (400nA). Figure 5 shown.

[0114] A screening experiment was conducted using 14 types of beverages (pure water, mineral water, etc.), with 50 replicates per group. Signals were collected using nidaqmx, and the TCSN model was used to evaluate classification accuracy. Optimized parameters (0.09ml droplet, 200μm tip, FEP friction layer) resulted in a classification accuracy of 99%, an improvement over the initial parameters (0.03ml, 400μm, PVC). The experimental data supports the rationality of the parameter selection, ensuring a balance between system portability and detection accuracy.

[0115] (4) The friction layer surface 112 is made of a solid material selected from polyvinyl chloride (PVC), polyimide (Kapton), polytetrafluoroethylene (PTFE) or perfluoroethylene propylene copolymer (FEP);

[0116] (5) The substrate 111 is an insulating solid material selected from polytetrafluoroethylene (PTFE), polycarbonate (PC) or polymethyl methacrylate (PMMA), with a thickness of 1-10 mm;

[0117] In a preferred embodiment of the present invention, the working mechanism of the full-current nanogenerator generating electrical signals includes:

[0118] When the liquid droplet 118 to be tested hits the friction layer surface 112 under the action of gravity, the solid-liquid contact electrochemical effect triggers charge transfer, and the negative charge in the liquid droplet 118 to be tested is injected into the friction layer, and the liquid droplet 118 to be tested carries an equal amount of positive charge; experimental data ( Figure 3 ) showed that pure water droplets produced a peak current of approximately 500nA, while Jianlibao electrolyte drink produced a peak current of 10nA due to its high ion concentration, indicating that ion concentration significantly affects the amount of charge transferred. Subsequently, when the test liquid droplet 118 impacted, it spread and contacted the top electrode 114 and the charge collection needle 113, transferring negative charge to the top electrode 114. The remaining positive charge slid along with the test liquid droplet 118 to the bottom electrode 115, completing the transfer. Experiments showed that reducing the curvature radius of the collection needle tip from 400μm to 200μm increased the negative charge transfer efficiency by 15%, and the signal peak increased by approximately 200nA.

[0119] The synergistic effect of conduction current (generated by direct charge transfer) and displacement current (induced by changes in the electric field) enhances the signal's sensitivity to beverage composition. Experimental results show significant differences in the signal waveforms for carbonated beverages (such as Sprite, pH 3.5) and alkaline soda water (pH 8.0), attributed to the effect of pH on interfacial charge distribution. The TCSN model leverages these features to accurately distinguish 14 beverage types with a classification accuracy of 99.86%.

[0120] As another embodiment of the present invention, the present invention proposes a full current pulse neural network (TCSN) based on the coupling of a pulse neuron model and a convolutional attention mechanism, which involves a time series signal processing and intelligent classification method with multi-module collaborative operation. The full current pulse neural network TCSN structure mainly consists of a primary convolution extraction layer (Conv1D+BatchNorm+ReLU), a deep feature enhancement module (ConvSAB), a pulse neuron calculation unit (EIFNode), and a linear classification output layer. Figure 6 shown.

[0121] For example, the TCSN network front-end includes a primary convolutional extraction layer (Conv1D+BatchNorm+ReLU). This layer consists of multiple serially connected one-dimensional convolutional modules (Conv1D), batch normalization modules (BatchNorm), and activation functions (ReLU), forming a standard sequence of convolutional feature units. This primary convolutional extraction layer is primarily used to enhance edges, suppress noise, and extract low-level features from the raw input signal, providing a more stable input representation for the subsequent spiking neuron module. Figure 7 It is a traversal graph for optimizing parameters of the primary convolution extraction layer of the full current pulse neural network TCSN of the present invention;

[0122] After initial convolution processing, the feature data is sequentially fed into one or more deep feature enhancement modules (ConvSABs) for deep structural modeling and dynamic response enhancement. During this process, the signal is repeatedly processed through a multi-stage convolution-spike-attention pathway and fused with the main pathway via a residual channel. The network then compresses the temporal dimension using the GlobalAverage Pooling layer in the linear classification output layer, and implements model regularization and improved generalization through Dropout. Finally, the fully connected layer (Linear) outputs the final classification vector, and a Softmax layer generates a multi-category probability distribution, achieving accurate recognition and discriminant output of the input time series signal.

[0123] To improve the robustness and convergence performance of the Total-Current Spiking Network (TCSN) model, the front-end signal input undergoes a joint optimization process of normalization preprocessing, data augmentation, and a three-stage cosine annealing learning rate scheduling strategy before being sent to the network. The normalization preprocessing module uses a normalization method to adjust the consistency of the data distribution. To improve the robustness and convergence performance of the Total-Current Spiking Network (TCSN), the signal processing flow integrates normalization preprocessing, data augmentation, and a three-stage learning rate scheduling strategy to optimize the processing of electrical signals generated by the Total-Current Spiking Network (TCNG). The specific process is as follows:

[0124] (1) Use the primary convolution extraction layer (Conv1D+BatchNorm+ReLU) for standardization preprocessing: Use Z-score standardization to adjust the distribution of electrical signals. The formula is:

[0125] ;

[0126] Where, is the processed signal, is the original signal, is the mean, is the standard deviation;

[0127] This method ensures consistent distribution of signals across different beverages. The improvement lies in combining signal truncation (uniformly set to 0.1-5s) to adapt to TCSN input and reduce the interference of long sequences on model training.

[0128] (2) Adaptive low-frequency noise, time axis translation, and amplitude perturbation are introduced into the deep feature enhancement module ConvSAB to improve the adaptability of the full current pulse neural network (TCSN) model to complex current patterns;

[0129] By adaptively adding low-frequency noise, time axis shifting, and random amplitude scaling, the signal disturbance caused by droplet impact is simulated, improving the model's generalization ability for complex scenarios.

[0130] 3) Three-stage cosine learning rate adjustment strategy: The three-stage cosine learning rate adjustment strategy is used during the training process to improve the convergence stability and generalization ability of the model at each stage. Figure 4 As shown;

[0131] Specifically, it includes a warm-up phase (where the learning rate increases linearly), a stabilization phase (where the maximum learning rate is maintained), and a cosine decay phase (where the learning rate gradually decays). The improvement is to dynamically adjust the learning rate to optimize the convergence stability of TCSN for time series signals.

[0132] For example, the deep feature enhancement module ConvSAB improves the adaptability of TCSN to complex electrical signals by:

[0133] Adaptive low-frequency noise addition: Dynamically generates low-frequency noise, preferentially acting on high-amplitude areas of the signal. The formula is:

[0134] ;

[0135] Where, is the signal amplitude, is the noise factor, is random noise, For in time The adaptive low-frequency noise signal generated at each moment has a strength that is dynamically related to the amplitude of the original signal; The original signal In time The absolute value at the moment (i.e., the instantaneous amplitude of the signal) is used to dynamically modulate the amplitude of the noise, making the noise more significant in high-amplitude areas. As a basic low-frequency noise source, its power spectrum density may satisfy the low-frequency characteristics; is an indicator function (usually a step function or a Boolean condition) that is triggered when the signal amplitude exceeds a threshold. The value is 1 when the signal is high, otherwise it is 0. Its function is to limit the noise to act only on the high-amplitude area of ​​the signal, avoiding unnecessary interference on the low-amplitude part. is a threshold used to distinguish high and low amplitude regions. It can be set based on signal characteristics (such as RMS value or peak value). This method simulates environmental interference and enhances model robustness.

[0136] Time axis shift: Randomly offset the signal time axis (range ), the signal continuity is maintained by linear interpolation to simulate the uncertainty of the droplet impact timing.

[0137] Random Amplitude Scaling: Applies a random scaling factor to the signal (range ), the formula is:

[0138] ;

[0139] Where, is the scaled signal; is the scaling factor, indicating is a random variable that may affect the growth or decay rate of the system; represents a uniform distribution, i.e. In the interval The values ​​are taken with equal probability.

[0140] This method simulates signal intensity fluctuations caused by changes in droplet volume or ion concentration.

[0141] For example, the spiking neuron computational unit (EIFNode) employs a multi-step exponential integration and discharge model (MultiStep EIFNode). This unit simulates the membrane potential evolution of biological neurons by setting threshold potential, resting voltage, time constant, temperature factor, and reset level. Its computational process includes time-step accumulation of input current, exponential voltage decay, pulse triggering determination, and discharge reset mechanism, enabling precise encoding of instantaneous activation points in dynamic signals and event-triggered response.

[0142] The multi-step exponential integration and discharge model achieves precise encoding and event triggering of TCNG electrical signals through the following mechanisms:

[0143] Time-step accumulation, input current At each time step Accumulate to membrane potential , the expression is:

[0144] ;

[0145] Where, is the membrane time constant, in milliseconds (ms), reflecting the decay rate of the membrane potential; is the resting potential, capturing the instantaneous changes of the droplet impact signal; For the neuron at the next time step The membrane potential is the current membrane potential According to the input current and time constant The result of dynamic update. This process simulates the integral characteristics of biological neuron membrane potential, that is, the cumulative effect of input signal step by step. is the current time step, which marks the instantaneous state of membrane potential and input current.

[0146] Voltage exponential decay, when there is no input current, the membrane potential exponentially decays to , the expression is:

[0147] ;

[0148] Simulate the dynamic response of neurons to intermittent signals;

[0149] Pulse trigger judgment, when the membrane potential Exceeding the threshold When , the trigger pulse is expressed as:

[0150] ;

[0151] encoding high-frequency features resulting from differences in beverage composition;

[0152] Discharge reset mechanism, after the pulse is triggered, the membrane potential is reset to , to prevent overfitting of strong signals. It is the resting potential (usually around -70mV), which represents the stable membrane potential of neurons when they are not stimulated.

[0153] Specifically, the pulse neuron computing unit EIFNode implements trainable parameters (such as 、 ), initial value 1.0, time step 1ms, adapted to 0.1-5s signal processing, and improved classification accuracy.

[0154] The Convolutional Spiking Attention Block (Convolutional Spiking Attention Block) and the Deep Feature Enhancement Module (ConvSAB) integrate two levels of one-dimensional convolutional layers (Conv1D), batch normalization layers (BatchNorm), and nonlinear spiking activation units (EIFNodes) to form a nested structure for deep semantic extraction. Each convolutional layer is followed by BatchNorm and EIFNodes, effectively improving the network's nonlinear expression capabilities and neural dynamics.

[0155] At the same time, the deep feature enhancement module ConvSAB introduces a residual branch and feature fusion mechanism, including: a feature stream that undergoes continuous convolution and pulse coding in the main path; the residual branch maintains the continuity and stability of information transmission through Shortcut Conv; and the introduction of channel attention and spatial attention mechanisms in branch fusion, which respectively perform fine weighting on inter-channel weights and spatial activation areas through adaptive pooling and small-scale convolution operations, thereby highlighting key features, suppressing background noise, and ultimately performing feature fusion. The specific processing process of branch fusion is as follows:

[0156] (I) Channel attention: Generate channel weights through adaptive average pooling AdaptiveAvgPool1d and two layers of one-dimensional convolution Conv1d, expressed as:

[0157] ;

[0158] Where, is the channel weight, is the Sigmoid activation function, is the input feature map, is the adaptive average pooling, It is a one-dimensional convolution operation used to capture the nonlinear dependencies between channels; It is the Rectified Linear Unit activation function, which introduces nonlinearity between the two Conv1d layers, enhances the expressiveness of the model, and avoids the limitations of linear transformation;

[0159] Channel weight Weight each channel to highlight the key feature channels;

[0160] (II) Spatial attention: Generate spatial weights through one-dimensional convolution, expressed as:

[0161] ;

[0162] Where, is the spatial weight;

[0163] Spatial weight Weighting the spatial activation area of ​​the feature map to suppress background noise;

[0164] (III) Feature fusion: channel-weighted features and spatially weighted features Multiply element by element to generate the final feature:

[0165] ;

[0166] Where, It is the final fused feature map, which is the output result of dual adjustment of channel weighting and spatial weighting. It is the channel-weighted feature, through the channel attention weight For the original input features Perform channel-by-channel modulation. It is the spatially weighted feature map, and the channel weighted feature Based on the spatial attention weight Modulate each spatial position.

[0167] Exemplarily, the dynamic display and identification process of the interactive interface is as follows:

[0168] Data Processing and Signal Acquisition: The electrical signals generated by the full-current nanogenerator are collected by a data acquisition module at a rate of 1-5 drops / second. The raw signals are normalized and truncated to 0.1-5 seconds to adapt them to the input of the full-current pulse neural network (TCSN). Data augmentation (such as time axis shifting) simulates droplet impact disturbances to ensure signal robustness.

[0169] Real-time waveform rendering: A multi-threaded signal processing unit dynamically renders time-domain waveforms. Waveform updates are synchronized with the acquisition rate (<5ms latency), intuitively reflecting differences in beverage composition (e.g., peak values ​​between pure water and electrolyte drinks).

[0170] Identification Result Output: After the full current pulse neural network (TCSN) extracts signal features, the Softmax function outputs classification probabilities for 14 beverage categories. The interactive interface dynamically updates the probability distribution using a probability histogram (Matplotlib's bar function). The category statistics panel displays identification results and representative images (such as beverage icons), allowing users to review the results using a drop-down menu.

[0171] Standardization ensures waveform consistency across samples, while data augmentation improves the model's adaptability to noise, making the interface more reliable in complex environments (such as supermarkets). TCSN's inference time is less than 0.3s, and combined with multi-threaded rendering, the total latency is less than 0.5s, ensuring real-time performance.

[0172] Specifically, the interactive interface achieves seamless integration of signal acquisition, processing, and visualization through multi-threaded data flow and algorithm processing modules. The specific process is as follows:

[0173] (a) Signal acquisition: The full-current nanogenerator signal is captured in real time at a rate of 1-5 drops / s through the Task class of the nidaqmx library and stored in a ring buffer;

[0174] (b) Data preprocessing: The signal is normalized by Z-score, noise filtered, and length truncated (300 data points) to generate the TCSN model input;

[0175] (c) Feature extraction and classification: The TCSN model extracts time and frequency domain features through large convolution kernels (5-16) and pulse attention blocks, and outputs the classification probability of 14 types of beverages through the softmax function;

[0176] (d) Visual output: Matplotlib’s FigureCanvas class renders the time domain waveform and FFT spectrum. The probability histogram and category image are dynamically updated on the interface.

[0177] To ensure real-time performance, the interactive interface utilizes an intelligent triggering mechanism: when the signal amplitude exceeds 1nA, a 400ms time window (50ms before and 350ms after the trigger) is automatically captured, using a ring buffer to ensure lossless data capture. The TCSN model inference time is less than 0.3 seconds, and combined with multi-threaded rendering, the total latency is less than 0.5 seconds. The interface supports dynamically updating probability bar charts and category statistics panels, allowing users to adjust categories or review results using drop-down menus, significantly improving interactivity.

[0178] The interactive interface, developed using the PySide6 framework, utilizes minimal resources and supports deployment on embedded devices such as the Raspberry Pi. Waveform display uses NumPy's np.linspace function to generate smooth time series data, and Matplotlib's bar function to plot probability distributions, ensuring visual clarity. The interface supports exporting test reports (waveforms, results, and probability data), making it suitable for rapid testing in scenarios such as supermarkets and restaurants.

[0179] Example 3, as another possible embodiment of the present invention, a full current nanogenerator ( Figure 2 ) comprises:

[0180] Step 1: Select a commercially available PC board as the substrate material and apply a commercially available FEP film to the surface as the triboelectric layer. No further processing is required on the device.

[0181] Step 2: Metal tape (copper tape in this example) is used as the conductive electrodes for the top electrode 114 and the bottom electrode 115. A conductive wire (200μm diameter titanium wire in this example) is attached to the top electrode 114 as a charge collection needle 113, while the bottom electrode 115 does not require a charge collection needle 113. The two electrodes are placed on the FEP film with a spacing of 3.5cm. Wires (copper wire in this example) serve as leads.

[0182] Step 3: Select a solution (pure water in this example) and drop it onto the inclined surface of the all-current nanogenerator. The droplet volume is controlled to 0.09 ml, with a drop rate of 1-5 drops / second, driven by gravity. The test liquid droplet 118 is ensured to contact the charge collection needle 113 and the bottom electrode 115, respectively. The improved structure (200 μm tip, FEP friction layer) significantly increases signal peak value and classification accuracy compared to the original design (400 μm tip, PVC friction layer).

[0183] Example 4, as another possible implementation of the present invention, detects the sensing effect of commercially available beverages.

[0184] See Figure 3 The full-current nanogenerator's sensing performance on commercially available beverages was demonstrated. Comprehensive testing was conducted on 14 commercially available beverages (in this example: pure water, mineral water, alkaline soda water, glucose drink, peach water, lemon soda water, Jinro Soju, cocktails, Sprite, vodka, Pulse, Erguotou, Dongpeng Electrolyte, and Jianlibao Electrolyte), further validating the superiority of the proposed sensing system. The experimental results showed that the peak signal difference between pure water and Jianlibao reached 50 times (10nA vs. 500nA), attributed to differences in ion concentration. The waveforms of glucose drink and lemon soda water were highly similar, but the pH difference resulted in improved frequency domain feature differentiation.

[0185] Example 5, as another possible implementation of the present invention, is a model training method.

[0186] See Figure 4 To enhance the robustness and convergence of the TENG, this embodiment implements a data preprocessing method and a three-stage learning rate scheduler. This scheduler divides the entire training process into three phases: warm-up, stabilization, and decay, to optimize the model's adaptability to complex nonlinear electrical signals and convergence efficiency.

[0187] Assume the total number of training steps is:

[0188] ;

[0189] Where, is the total number of training steps, is the training round, is the number of iterations per round;

[0190] In this experiment, , ,thereby .

[0191] The specific parameter configurations for the three stages are as follows:

[0192] Warm-up phase: 10% of the total number of steps (i.e. step), the learning rate starts from the initial value Increase linearly to the maximum value , to smooth the initial gradient and reduce the risk of overfitting.

[0193] Stabilization phase: from the end of the warm-up phase (step 7000) to 40% of the total number of steps (i.e. steps), the learning rate is kept constant at , ensuring that the model parameters are fully optimized at high learning rates.

[0194] Decay phase: From the end of the stable phase (step 28000) to the end of the total number of steps (step 70000), the cosine annealing strategy is adopted, and the learning rate is Gradually decays to near , the formula is:

[0195] ;

[0196] Where, is the current number of training steps (iterations), which is used to dynamically calculate the attenuation progress of the learning rate. is the dynamic learning rate at the current step, and its value changes from Gradually decrease to near , but by adjusting the cosine function and the offset term (0.499+0.5), we ensure that the learning rate will not drop completely to 0, but will approach , Indicates the end step number of the second stage (stable stage), that is, the starting point of the decay stage. The number of steps at the end of the stable phase. This strategy enhances the model's generalization ability for noisy data and complex features by dynamically adjusting the learning rate.

[0197] Dynamic learning rate adjustment effectively balances rapid convergence in the early stages of training with fine-grained optimization in the later stages, making the loss curve less volatile during training and significantly improving training stability. Combined with the three-stage scheduler, the TCSN model achieved 99.86% accuracy after 100 rounds of training (see Figure 5 ) is significantly better than the traditional fixed learning rate method, proving the effectiveness of the optimization.

[0198] Example 6, as another possible implementation of the present invention, proposes a full current pulse network based on the optimization and improvement of the traditional convolutional neural network.

[0199] See Figure 6In this example, a fully current pulse network based on the optimization of traditional convolutional neural networks was proposed for feature extraction of TENG signals. The optimized network structure significantly improved the model's ability to process complex time series signals, especially in capturing and classifying long-range dependencies. The classification output of beverage category identification results reached an accuracy rate of 99.86%.

[0200] The core process of the optimized network is as follows: the input signal X first passes through the first convolution layer (Conv1), using a kernel size of 16, a stride of 4, and a padding of 6 to extract preliminary features. The second convolution layer (Conv2) uses the same parameters (kernel size of 16, stride of 4, and padding of 6). By cascading two layers of large convolution kernels, the global nature of feature extraction is further enhanced.

[0201] See Figure 7 To explore the impact of parameter configuration, we tested the effects of different convolution kernel sizes (K) and strides (S) of Conv2 on signal recognition. K = S × m, where m is the multiplier. In the experiment, the stride S ranged from 1 to 7, the multiplier m ranged from 2 to 7, and the convolution kernel size K reached a maximum of 49. The results showed that when Conv2 used a smaller convolution kernel (e.g., K = 2, S = 1, m = 2), the classification accuracy was 81%. When adjusted to (K = 49, S = 7, m = 7), the accuracy increased to 95.8%, indicating that the larger convolution kernel and stride configuration significantly expanded the receptive field and improved the model's ability to capture the long-range dependencies of TENG signals.

[0202] The features output by Conv2 undergo batch normalization (BatchNorm1d) and activation (ReLU) before entering the deep feature enhancement module ConvSAB. This module enhances key feature representations through channel attention and spatial attention mechanisms. Channel attention generates channel weights through adaptive average pooling, highlighting key feature channels; spatial attention generates spatial weights through small-scale convolution (kernel size 7, padding 3), focusing on key signal regions. These two features are fused through element-wise multiplication to generate weighted features, effectively suppressing background noise and improving the ability to distinguish target signals. Experimental results show that the SAB module significantly enhances the model's robustness to noise interference.

[0203] Example 6, as another possible implementation of the present invention, the interactive interface implementation method includes:

[0204] System initialization module construction: Use the PySide6 framework to create the main window component, set up a multi-threaded data acquisition module (this example uses the NIDAQmx library), configure a double-buffered drawing area (including a real-time waveform display area and a probability distribution visualization area), and load the pre-trained full current pulse neural network TCSN.

[0205] Intelligent trigger mechanism configuration: Define trigger conditions based on signal amplitude (in this example, the threshold is set to 1nA). When a trigger event is detected, the 400ms time window data (including the 50ms before and 350ms after the trigger) is automatically captured, achieving lossless data capture through a ring buffer.

[0206] Real-time prediction module deployment: The preprocessed data is input into the full current pulse network. The output layer uses the softmax function to obtain the probability, and the recognition results are synchronously displayed through the probability histogram and category cumulative statistics panel.

[0207] The above description is only a preferred specific implementation method of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with this technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the scope of protection of the present invention.

Claims

1. A detection method of a full current sensing system for identifying ingredients of commercially available beverages, characterized in that: The method comprises the following steps: S1, dripping the beverage to be tested onto the friction layer surface of the full-current nanogenerator at a rate of 1-5 drops / second, generating an electrical signal due to the liquid-solid triboelectric effect; S2, using a data acquisition module to collect the electrical signal in real time at a sampling rate of 1 kHz. The signal processing process includes Z-score normalization, data enhancement and signal truncation to optimize time domain and frequency domain feature extraction; S3 extracts the timing characteristics of electrical signals through a full current pulse neural network. It uses a three-stage learning rate scheduling strategy, including a warm-up phase, a stabilization phase, and a cosine decay phase, to optimize model training. It also combines a pulse attention mechanism to enhance the processing capability of complex timing signals. S4, an interactive graphical interface based on PySide6, outputs beverage category classification results and probability distribution in real time, displays signal waveforms, beverage category identification results and images in real time, and the interactive interface supports dynamic waveform rendering; In step S1, the full-current nanogenerator includes: a substrate (111), a friction layer surface (112), a charge collection needle (113), a top electrode (114), a bottom electrode (115), a top electrode lead (116), and a bottom electrode lead (117); The friction layer surface (112) is integrated on the upper surface of the substrate (111); a charge collecting needle (113) is mounted on one end of a top electrode (114); the other end of the top electrode (114) is connected to a current detector via a top electrode lead (116); the top electrode (114) and the bottom electrode (115) are mounted on the top and bottom of the friction layer surface (112), respectively; the end of the bottom electrode (115) is connected to the current detector via a bottom electrode lead (117); and an electrical signal is generated by a droplet of liquid to be measured (118) impacting the friction layer surface (112); The tip curvature radius of the charge collection needle (113) is 200 μm, and the substrate (111) is made of perfluoroethylene propylene copolymer (FEP).

2. The detection method of the full current sensing system for identifying the ingredients of commercially available beverages according to claim 1, characterized in that: In step S3, the signal features are extracted by the full current pulse neural network TCSN, including: (1) Use the primary convolution extraction layer for standardization preprocessing and use Z-score standardization to adjust the distribution of electrical signals. The formula is: Where x′ is the processed signal, x is the original signal, μ is the mean, σ is the standard deviation, and the signal is truncated to 0.1-5s; (2) The deep feature enhancement module ConvSAB introduces adaptive low-frequency noise, time axis translation, and amplitude perturbation to simulate the signal perturbation caused by droplet impact; (3) During the training process, a three-stage cosine learning rate adjustment strategy is adopted to optimize the convergence of the time series signal. The three-stage cosine learning rate adjustment strategy includes: warm-up stage, stabilization stage and cosine decay stage.

3. The detection method of the full current sensing system for identifying the ingredients of commercially available beverages according to claim 2, characterized in that: In step (2), the deep feature enhancement module ConvSAB introduces adaptive low-frequency noise, time axis translation and amplitude perturbation to simulate the signal perturbation caused by droplet impact, including: Adaptive low-frequency noise addition dynamically generates low-frequency noise and acts on the high-amplitude area of ​​the signal. The formula is: n_″adaptive″(t)=a·|x(t)|·n(t)·I(|x(t)|>θ) Where x(t) is the signal amplitude, a is the noise factor, θ is the threshold, n(t) is random noise, n_″adaptive"(t) is the adaptive low-frequency noise signal generated at time t, |x(t)| is the absolute value of the original signal x(t) at time t, n(t) is the basic low-frequency noise source, and I(|x(t)|>θ) is an indicator function. The time axis is shifted in the range of [-0.05s, 0.05s] to randomly offset the signal time axis through linear interpolation to simulate the uncertainty of the droplet impact timing; Random amplitude scaling applies a random scaling factor in the range of (0.8, 1.2) to the signal. The formula is: x′(t)=β·x(t),β~u(0.8,1.2) Where x′(t) is the scaled signal; β is the scaling factor, and u(0.8, 1.2) represents a uniform distribution, meaning that β takes values ​​with equal probability in the interval (0.8, 1.2). In step (3), the total number of training steps in the three-stage cosine learning rate adjustment strategy is: total steps=epochs×steps per epoch Where total steps is the total number of training steps, epochs is the number of training rounds, and steps per epoch is the number of iterations per round; It includes the following stages: Warm-up phase: 10% of the total number of steps, the learning rate is increased from the initial value lr min =0.005 linearly increases to the maximum value lr max =0.01; Stable phase: from the end of the warm-up phase to 40% of the total number of steps, the learning rate is constant at lr max =0.01; Decay phase: The total number of steps ends at the end of the stable phase, and the cosine annealing strategy is adopted, and the learning rate is lr max Gradually decays to near lr min , the formula is: Where current step is the current training step, lr is the dynamic learning rate under the current step, and stage2 end is the end step of the second stage.

4. The detection method of the full current sensing system for identifying the ingredients of commercially available beverages according to claim 1, characterized in that: In step S3, the full current spike neural network TCSN consists of a primary convolutional extraction layer, a deep feature enhancement module ConvSAB, a spike neuron computing unit EIFNode, and a linear classification output layer; The primary convolution extraction layer consists of multiple serially connected one-dimensional convolution modules Conv1D, batch normalization modules BatchNorm, and activation functions ReLU, forming a standard convolution feature unit sequence for edge enhancement, noise suppression, and low-level feature extraction of the input original signal; The deep feature enhancement module ConvSAB performs feature fusion by introducing a residual branch and a feature fusion mechanism of channel attention and spatial attention; The pulse neuron computing unit EIFNode adopts a multi-step exponential integration and discharge model. By setting the threshold potential, resting voltage, time constant, temperature factor and reset level, it simulates the membrane potential evolution process of biological neurons and completes the precise encoding of instantaneous activation points in dynamic signals and event triggering response. The linear classification output layer outputs the probability distribution of multiple types of commercially available beverages through the fully connected layer to complete ingredient identification.

5. The detection method of the full current sensing system for identifying the ingredients of commercially available beverages according to claim 4, characterized in that: The deep feature enhancement module ConvSAB performs feature fusion by introducing a residual branch and a feature fusion mechanism of channel attention and spatial attention, including: (I) Channel attention: Generate channel weights through adaptive average pooling AdaptiveAvgPool1d and two layers of one-dimensional convolution Convld, expressed as: W c =σ(Conv1d(ReLU(Conv1d(AvgPool(X))))) Where W c is the channel weight, which represents the generated channel weight vector; σ() is the Sigmoid activation function, X is the input feature map, AvgPool() is the adaptive average pooling, Conv1d() is the one-dimensional convolution operation used to capture the nonlinear dependency between channels; ReLU() is the rectified linear unit activation function; Channel weight W c Weight each channel to highlight the key feature channels; (II) Spatial attention: Generate spatial weights through one-dimensional convolution, expressed as: IN s =σ(Conv1d(X)) Where W s is the spatial weight; Spatial weight W s Weighting the spatial activation area of ​​the feature map to suppress background noise; (III) Feature fusion: channel-weighted feature X c =W c X and spatially weighted features X s =W s ·X c Multiply element by element to generate the final feature: X out =X s Where, X out is the final fused feature map, X c It is the channel weighted feature, through the channel attention weight W c Modulate the original input feature X channel by channel; X s It is the spatially weighted feature map, and the channel weighted feature X c Based on the spatial attention weight W s Modulate each spatial position.

6. The detection method of the full current sensing system for identifying the ingredients of commercially available beverages according to claim 4, characterized in that: The EIFNode uses a multi-step exponential integration and discharge model to simulate the membrane potential evolution of biological neurons by setting the threshold potential, resting voltage, time constant, temperature factor, and reset level. This allows for precise encoding of instantaneous activation points in dynamic signals and event-triggered responses, including: Accumulated time-step by time, the input current I(t) accumulates to the membrane potential V(t) at each time step Δt, which is expressed as: Where τ is the membrane time constant, V rest is the resting potential, capturing the instantaneous change of the droplet impact signal; V(t+Δt) is the membrane potential of the neuron at the next time step t+Δt, which is the result of the dynamic update of the current membrane potential V(t) according to the input current I(t) and the time constant τ; t is the current time step; Voltage exponential decay: when there is no input current, the membrane potential exponentially decays to V rest , the expression is: Simulate the dynamic response of neurons to intermittent signals; Pulse trigger judgment, when the membrane potential V(t) exceeds the threshold V th When , the trigger pulse is expressed as: encoding high-frequency features resulting from differences in beverage composition; Discharge reset mechanism, after the pulse is triggered, the membrane potential is reset to V reset ; V rest It is the resting potential, which represents the stable membrane potential of the neuron when it is not stimulated.

7. The detection method of the full current sensing system for identifying the ingredients of commercially available beverages according to claim 1, characterized in that: In step S4, the signal waveform, beverage category identification results and images are displayed in real time, including: Data processing and signal acquisition: The electrical signal generated by the full-current nanogenerator is collected by the data acquisition module at a rate of 1-5 drops / second. The original signal is standardized and uniformly truncated to 0.1-5s; it is adapted to the full-current pulse neural network TCSN input; Real-time waveform rendering, multi-threaded signal processing unit dynamically renders time domain waveforms; After the identification result is output, the full current pulse neural network TCSN extracts the signal features, and the Softmax function outputs the classification probability of multiple types of beverages.

8. A full current sensing system for identifying ingredients in commercially available beverages, characterized in that: The system implements the detection method of the full current sensing system for identifying the ingredients of commercially available beverages as described in any one of claims 1 to 7, and the system comprises: Full-current nanogenerators for generating electrical signals; A data signal acquisition module is used to monitor in real time the electrical signals on the surface of the full-current nanogenerator caused by beverage dripping; An algorithm processing module is used to extract and classify the electrical signals generated by the full-current nanogenerator based on a pre-trained full-current pulse neural network (TCSN); The interactive interface dynamically displays the electrical signal waveform, classification results, and probability distribution of the full-current nanogenerator through a cross-platform GUI framework.

Citation Information

Patent Citations

  • Direct-current droplet generator and preparation method thereof

    CN113489122A