Tobacco quality detection method and system based on superconducting magnetic quantum sensor
By combining a superconducting magnetic quantum sensor with multiphysics field excitation and an improved SRU model, the consistency and accuracy problems of existing tobacco quality detection methods have been solved, realizing high-resolution, interference-resistant intelligent detection and grading of tobacco quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-25
- Publication Date
- 2026-04-10
AI Technical Summary
Existing tobacco quality testing methods rely on inconsistent manual assessments, chemical analysis is complex and destructive, and spectral analysis has poor response to internal magnetic properties, making it difficult to perform precise grading.
By employing a superconducting magnetic quantum sensor combined with multi-physics field excitation, and through qubit-like state encoding and an improved SRU model, multi-level spectrum reconstruction and feature extraction are performed to achieve intelligent detection and grading of tobacco quality.
It achieves high-resolution, interference-resistant tobacco quality classification, improving detection and classification accuracy, and enabling accurate grading of tobacco quality.
Smart Images

Figure CN121830889A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent tobacco quality detection technology, and in particular to a method and system for tobacco quality detection based on a superconducting magnetic quantum sensor. Background Technology
[0002] With the tobacco industry's continuous improvement in the precision of quality control, especially in key stages such as raw material screening and finished product grading, higher requirements are placed on quality testing technologies. Existing tobacco quality testing methods mainly rely on traditional means such as sensory evaluation, chemical composition analysis, or near-infrared spectroscopy, but these methods generally have the following technical limitations in practical applications:
[0003] Sensory evaluation relies on human judgment, is easily affected by experience and subjective bias, and lacks consistency and repeatability; chemical composition analysis, although highly accurate, is complex, time-consuming, and requires sample destruction, making it difficult to meet the needs of rapid detection; spectroscopic analysis methods are extremely sensitive to the external environment and sample surface condition, and are insufficient in expressing differences in magnetic property responses caused by changes in internal microstructure, making it difficult to effectively distinguish samples of similar quality levels; existing methods lack sufficient modeling means for the temporal characteristics and spectral changes of acquired signals, especially in processing nonlinear and unstable magnetic response data, traditional frequency domain analysis methods suffer from insufficient information compression, delayed anomaly detection, and easy confusion due to frequency interference, limiting their practical value in the refined grading of tobacco quality.
[0004] Therefore, how to provide a method and system for tobacco quality detection based on superconducting magnetic quantum sensors is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a method and system for tobacco quality detection based on a superconducting magnetic quantum sensor. This invention employs a fusion technology of multi-physics field excitation and a superconducting magnetic quantum sensor, combined with a quantum bit-like state encoding and an improved SRU model that introduces a synaptic-like dynamic gating mechanism, to perform multi-level spectral reconstruction and feature extraction on tobacco magnetic response data, thereby realizing intelligent detection and grading of tobacco quality. It has the advantages of high resolution, strong anti-interference ability, and high classification accuracy.
[0006] The tobacco quality detection method based on a superconducting magnetic quantum sensor according to an embodiment of the present invention includes the following steps:
[0007] Step 1: Apply multiphysics field excitation to the tobacco sample to be tested, and collect the magnetic response data of the tobacco sample based on a superconducting magnetic quantum sensor;
[0008] Step 2: Organize the magnetic response data of the tobacco sample to be tested according to the window structure, bind each window to the corresponding timestamp, and generate a time-series magnetic flux change rate curve;
[0009] Step 3: Analyze the time-series magnetic flux change rate curve, identify local magnetic anomaly regions, and extract local magnetic anomaly response characteristics;
[0010] Step 4: The FastDTW algorithm is used to time-register the local magnetic anomaly response characteristics with the magnetic response characteristics of the standard tobacco sample, construct a three-layer time series structure, and generate the response deviation trajectory.
[0011] Step 5: Based on the response deviation trajectory, the magnetic response data of the tobacco sample to be tested is reconstructed into a multi-level magnetic spectrum structure to generate a global average magnetic spectrum, a local magnetic anomaly spectrum, and a response mutation point spectrum. A superposition state encoding method is then used to generate magnetic spectrum encoded data.
[0012] Step 6: Input the magnetic spectrum encoding data into the improved SRU model for classification. The improved SRU model introduces a synaptic dynamic gating mechanism to dynamically modulate the hidden state and obtain the classification confidence of the tobacco sample to be tested belonging to each quality grade.
[0013] Step 7: Output the final quality grade of the tobacco sample to be tested based on the classification confidence level.
[0014] Optionally, step one specifically includes:
[0015] The tobacco sample to be tested is placed in a temperature-controlled chamber. A temperature gradient field is applied to the tobacco sample to be tested through a low-temperature refrigeration unit and a heating unit during the same detection process. The tobacco sample to be tested sequentially experiences a low-temperature zone and a room temperature zone, wherein the temperature range of the low-temperature zone is 77K to 120K and the temperature range of the room temperature zone is 290K to 310K.
[0016] During the application of the temperature gradient field, an alternating weak magnetic scanning field is applied to the tobacco sample to be tested by a Helmholtz coil group set outside the temperature control cavity. The magnetic field strength of the alternating weak magnetic scanning field is 1μT to 100μT, the magnetic field change frequency is 0.1Hz to 100Hz, and the magnetic field direction of the alternating weak magnetic scanning field is set along the length direction of the tobacco sample to be tested.
[0017] Under the simultaneous action of a temperature gradient field and an alternating weak magnetic scanning field, a directional electrostatic field is applied to the tobacco sample under test through parallel plate electrodes set on both sides of the temperature-controlled cavity. The electric field strength of the directional electrostatic field is 10²V / m to... Furthermore, the electric field direction of the directional electrostatic field is set along the width direction of the tobacco sample to be tested, and is perpendicular to the magnetic field direction of the alternating weak magnetic scanning field.
[0018] During the synchronous action of a temperature gradient field, an alternating weak magnetic scanning field, and a directional electrostatic field, a superconducting magnetic quantum sensor is used to detect the magnetic response of the tobacco sample under test. The sampling time interval of the superconducting magnetic quantum sensor is 0.1ms to 5ms, and the magnetic response signal generated by the tobacco sample under test under multi-physics field excitation conditions is continuously acquired to obtain the magnetic response data of the tobacco sample under test.
[0019] Optionally, step two specifically involves:
[0020] The magnetic response data of the tobacco samples to be tested are arranged in chronological order of sampling time to form a continuous magnetic response time series.
[0021] The magnetic response time series is divided into continuous windows according to the set time window length, and time overlap intervals are set between adjacent time windows so that adjacent time windows contain some of the same magnetic response sampling points.
[0022] A corresponding timestamp is assigned to each time window, and the timestamp is taken as the sampling time corresponding to the first magnetic response sampling point within the time window;
[0023] Within each time window, the magnetic response sampling points in the time window are subjected to first-order difference processing according to the sampling time order to obtain a sequence of magnetic response amplitude changes.
[0024] Divide each change in magnetic response amplitude in the magnetic response amplitude change sequence by the corresponding sampling time interval to obtain the rate of change sequence;
[0025] The arithmetic mean of the rate of change sequence within the same time window is used to obtain the magnetic flux change rate corresponding to the time window.
[0026] Arrange the magnetic flux change rate corresponding to each time window in the order of the timestamp of each time window to generate a time-series magnetic flux change rate curve.
[0027] Optionally, step three specifically includes:
[0028] The time-series magnetic flux change rate curves are traversed and analyzed in time stamp order. The mean magnetic flux change rate of the time-series magnetic flux change rate curves is calculated, and the mean magnetic flux change rate is used as the baseline value.
[0029] The flux change rate corresponding to each time point in the time-series flux change rate curve is compared with the baseline value point by point. When the deviation of the flux change rate corresponding to the time point from the baseline value exceeds the set deviation threshold, the time point is marked as an abnormal candidate point.
[0030] The continuity of adjacent anomaly candidate points is judged. When multiple anomaly candidate points appear consecutively on the time axis and the number of consecutive points meets the set threshold, the corresponding time interval is determined as a local magnetic anomaly region.
[0031] In each of the local magnetic anomaly regions, the corresponding magnetic flux change rate subsequence is extracted, and the magnetic flux change rate subsequence is used as the local magnetic anomaly response feature.
[0032] Optionally, step four specifically involves:
[0033] The local magnetic anomaly response characteristics were used as the sequence to be registered, and the corresponding magnetic flux change rate sequence in the standard tobacco sample was used as the reference sequence.
[0034] A three-layer time series structure is constructed based on the original resolution sequence to be registered and the reference sequence. The three-layer time series structure includes a first-layer low-resolution time series, a second-layer medium-resolution time series, and a third-layer original resolution time series. The second-layer medium-resolution time series is obtained by downsampling the third-layer original resolution time series, and the first-layer low-resolution time series is obtained by downsampling the second-layer medium-resolution time series. The sequence length of the first-layer low-resolution time series is half the sequence length of the second-layer medium-resolution time series, and the sequence length of the second-layer medium-resolution time series is half the sequence length of the third-layer original resolution time series.
[0035] On the first layer of low-resolution time series, the initial time alignment path between the sequence to be registered and the reference sequence is calculated using dynamic time warping. The initial time alignment path consists of a set of time index pairs.
[0036] The initial time alignment path is mapped to the second-layer medium-resolution time series. A first constraint window is constructed around the mapped time index pairs, and the time alignment path of the second-layer medium-resolution time series is calculated within the search range defined by the first constraint window.
[0037] The time alignment path obtained from the second-layer medium-resolution time series is further mapped to the third-layer original resolution time series. A second constraint window is constructed at the corresponding mapping position, and the nonlinear time alignment of the third-layer original resolution time series is completed within the search range defined by the second constraint window to obtain the final time alignment path.
[0038] Based on the final time alignment path, the magnetic flux change rate corresponding to each time index in the sequence to be registered is calculated point by point with the magnetic flux change rate corresponding to the time index in the reference sequence to generate the response deviation trajectory.
[0039] Optionally, based on the response deviation trajectory, the magnetic response data of the tobacco sample to be tested is reconstructed into a multi-level magnetic spectrum structure to generate a global average magnetic spectrum, a local magnetic anomaly spectrum, and a response abrupt change point spectrum, specifically as follows:
[0040] Based on the response deviation trajectory, the magnetic response data of the tobacco sample to be tested is aligned with the time index so that each sampling point in the magnetic response data corresponds to the time index in the response deviation trajectory, thus obtaining a time-aligned magnetic response data sequence.
[0041] The response deviation trajectory is traversed in time index order, and the difference between response deviation values at adjacent time indices is calculated to obtain the response deviation change sequence.
[0042] The time index position where the absolute value of the change in response deviation is greater than a preset mutation threshold is determined as the response mutation point, where the preset mutation threshold is three times the average value of the change in response deviation.
[0043] Taking the time index corresponding to each response mutation point as the center, several continuous sampling points are selected in the positive and negative directions of the time axis to form a mutation window, and the magnetic response data corresponding to the mutation window is determined as the magnetic response data of the mutation segment.
[0044] The magnetic response data corresponding to the time index in the response deviation trajectory where the response deviation value is not greater than a preset stability threshold is determined as the stable segment magnetic response data, where the preset stability threshold is 10% of the mean of the response deviation trajectory.
[0045] The magnetic response data corresponding to the time index in the response deviation trajectory where the response deviation value exceeds the preset stability threshold and is not determined as a response mutation point is identified as the abnormal segment magnetic response data.
[0046] The stable segment magnetic response data are grouped according to their continuity on the time axis. Frequency domain transformation is performed on each group of stable segment magnetic response data to obtain the corresponding stable segment spectrum results. The frequency points of each stable segment spectrum results are averaged in the frequency domain to generate a global average magnetic spectrum consisting of multiple frequency points and corresponding average spectral amplitudes.
[0047] The magnetic response data of the anomalous segment is grouped according to the continuity on the time axis. Frequency domain transformation is performed on each group of magnetic response data of the anomalous segment. The spectral amplitude of the corresponding frequency point in the same anomalous segment is accumulated point by point to generate a local magnetic anomaly spectrum characterizing the magnetic response accumulation characteristics of each anomalous time period.
[0048] Frequency domain transformation is performed on the magnetic response data of the abrupt change segment to obtain a response abrupt change point spectrum consisting of multiple frequency points and corresponding spectral amplitudes.
[0049] Optionally, the method of using a qubit-like state encoding to perform superposition state encoding and generate magnetic spectrum encoded data specifically involves:
[0050] Using the global average magnetic spectrum, local magnetic anomaly spectrum, and response mutation point spectrum as input spectra, each input spectrum is discretely sampled along the frequency axis to obtain multiple frequency index positions;
[0051] At each frequency index position, the spectral amplitude values of the global average magnetic spectrum, the local magnetic anomaly spectrum, and the response mutation point spectrum corresponding to the frequency index position are obtained respectively, forming a three-channel spectral amplitude vector for the corresponding frequency index position;
[0052] The three-channel spectral amplitude vectors are subjected to complex number mapping processing, which maps the spectral amplitude of each channel to a complex amplitude. The magnitude of the complex amplitude is obtained by normalizing the corresponding channel spectral amplitude by dividing it by the square root of the sum of the squares of the three channel spectral amplitudes. The phase of the complex amplitude is determined by the sign of the difference between the channel spectral amplitude and the corresponding channel spectral amplitude at the adjacent frequency index position.
[0053] The three complex amplitudes are assigned to three pairwise orthogonal ground state components to construct a state vector comprising three complex components. The three components of the state vector correspond to the ground state of the global average magnetic spectrum, the ground state of the local magnetic anomaly spectrum, and the ground state of the response mutation point spectrum, respectively.
[0054] Perform component-wise complex addition on the state vectors corresponding to adjacent frequency index positions to obtain the superimposed state vectors at the corresponding frequency index positions;
[0055] Perform a modulus square operation on each complex component in the superimposed state vector to obtain the probability component at the corresponding frequency index position;
[0056] Multiple probability components corresponding to the same frequency index position are combined to form the magnetic spectrum encoding vector of the frequency index position, and the magnetic spectrum encoding vectors corresponding to each frequency index position are arranged in the order of frequency index to generate magnetic spectrum encoding data.
[0057] Optionally, step six specifically includes:
[0058] The magnetic spectrum encoded data is input into the improved SRU model, which includes an input feature mapping layer, an SRU time-series update layer, a synaptic weight dynamic modulation layer, and a classification output layer.
[0059] The input feature mapping layer receives magnetic spectrum encoded data, performs a linear mapping operation on the magnetic spectrum encoded vector corresponding to each frequency index position, and obtains an input feature vector sequence, wherein the input feature vector sequence maintains the order of the magnetic spectrum encoded data in the frequency index direction.
[0060] The SRU time-series update layer is based on the SRU unit structure and updates the input feature vector sequence step by step according to the frequency index order to obtain the hidden state sequence.
[0061] The synaptic weight dynamic modulation layer is set after the SRU timing update layer and introduces a synaptic-like dynamic gating mechanism, which specifically includes:
[0062] Calculate the difference between the magnetic spectrum coding vectors corresponding to adjacent frequency index positions to obtain the magnetic spectrum difference vector;
[0063] The magnetic spectrum difference vector is linearly transformed and processed by the Sigmoid activation function to obtain synaptic weight coefficients between 0 and 1.
[0064] The synaptic weight coefficients are multiplied element-wise with the hidden states at the corresponding frequency index positions to obtain the hidden state sequence after synaptic weight modulation.
[0065] The classification output layer receives the hidden state sequence modulated by synaptic weights and maps it into a single feature vector. A linear classification operation is then performed on the single feature vector. The linear classification operation uses a fully connected linear mapping function to obtain the classification score corresponding to each quality grade. Softmax normalization is then performed on the classification score to obtain the classification confidence of the tobacco sample belonging to each quality grade.
[0066] Optionally, step seven specifically includes:
[0067] Obtain the classification confidence level corresponding to each quality grade of the tobacco sample to be tested, wherein the quality grades include first-grade quality, second-grade quality, third-grade quality, and unqualified quality;
[0068] The quality grade with the highest classification confidence value is selected as the final quality grade of the tobacco sample to be tested and output.
[0069] The tobacco quality detection system based on a superconducting magnetic quantum sensor according to an embodiment of the present invention includes the following modules:
[0070] The multi-physics field excited magnetic response acquisition module is used to apply multi-physics field excitation to the tobacco sample under test and acquire the magnetic response data of the tobacco sample under test based on the superconducting magnetic quantum sensor.
[0071] The temporal magnetic flux change rate construction module is used to organize the magnetic response data of the tobacco sample to be tested according to the window structure, with each window bound to a corresponding timestamp, to generate a temporal magnetic flux change rate curve;
[0072] The local magnetic anomaly response feature extraction module is used to perform traversal analysis on the time-series magnetic flux change rate curve, identify local magnetic anomaly regions, and extract local magnetic anomaly response features.
[0073] The nonlinear time registration deviation trajectory generation module is used to perform time registration between the local magnetic anomaly response characteristics and the magnetic response characteristics of the standard tobacco sample based on the FastDTW algorithm, construct a three-layer time series structure, and generate the response deviation trajectory.
[0074] The multi-level magnetic spectrum structure reconstruction module is used to reconstruct the multi-level magnetic spectrum structure of the magnetic response data of the tobacco sample under test based on the response deviation trajectory, and generate the global average magnetic spectrum, local magnetic anomaly spectrum and response mutation point spectrum.
[0075] The magnetic spectrum qubit state encoding module is used to perform frequency axis discrete sampling on the global average magnetic spectrum, local magnetic anomaly spectrum and response mutation point spectrum, and to perform superposition state encoding using a qubit-like state encoding method to generate magnetic spectrum encoded data.
[0076] The quality classification module is used to input magnetic spectrum encoded data into the improved SRU model for classification. The improved SRU model introduces a synaptic dynamic gating mechanism to dynamically modulate the hidden state and obtain the classification confidence of the tobacco sample to be tested belonging to each quality grade.
[0077] The results output module is used to output the final quality grade of the tobacco sample to be tested based on the classification confidence level.
[0078] The beneficial effects of this invention are:
[0079] This invention addresses the low sensitivity, strong interference, and feature confusion issues in existing tobacco quality detection methods by using magnetic response detection based on a superconducting magnetic quantum sensor and multi-physics synergistic excitation. It constructs a feature reconstruction path combining a multi-level magnetic spectrum structure and qubit-like state encoding. By utilizing the synergistic effect of a temperature gradient field, an alternating weak magnetic scanning field, and a directional electrostatic field, it induces differences in the magnetic response of the internal structure of the tobacco sample under test. High-temporal-resolution magnetic response data are continuously recorded by the superconducting magnetic quantum sensor, and a temporal flux change rate construction module is used to generate a temporal flux change rate curve. Analysis of this curve identifies local magnetic anomaly regions, extracts local magnetic anomaly response features, and uses the FastDTW algorithm to time-register these features with the magnetic response features of a standard tobacco sample, constructing a three-layer time series structure and generating a response deviation trajectory. Furthermore, in the multi-level magnetic spectrum structure reconstruction module, stable segments, abnormal segments, and abrupt change segments are divided according to the response deviation trajectory, and frequency domain transformation is performed on the magnetic response of each segment to generate a global average magnetic spectrum, a local magnetic anomaly spectrum, and a response abrupt change point spectrum. Addressing the insufficient expressive power of traditional feature encoding methods, this invention introduces a quantum-state superposition mechanism in the magnetic spectrum quantum bit state encoding module to construct a quantum-state magnetic spectrum encoding vector that integrates complex amplitude and orthogonal ground state mapping. In the quality classification module, the magnetic spectrum encoding data is input into an improved SRU model with a synaptic dynamic gating mechanism. Frequency domain change trends are integrated in the SRU time-series update and synaptic weight dynamic modulation to improve the model's sensitivity and stability to subtle quality differences. Finally, the result output module outputs quality grades including first-level, second-level, third-level, and unqualified quality, achieving intelligent classification and accurate grading of tobacco quality. Attached Figure Description
[0080] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0081] Figure 1 This is an overall flowchart of the tobacco quality detection method based on a superconducting magnetic quantum sensor proposed in this invention.
[0082] Figure 2 This is a schematic diagram of the tobacco quality detection system based on a superconducting magnetic quantum sensor proposed in this invention. Detailed Implementation
[0083] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0084] refer to Figure 1 A tobacco quality detection method based on a superconducting magnetic quantum sensor includes the following steps:
[0085] Step 1: Apply multiphysics field excitation to the tobacco sample to be tested, and collect the magnetic response data of the tobacco sample based on a superconducting magnetic quantum sensor;
[0086] Step 2: Organize the magnetic response data of the tobacco sample to be tested according to the window structure, bind each window to the corresponding timestamp, and generate a time-series magnetic flux change rate curve;
[0087] Step 3: Analyze the time-series magnetic flux change rate curve, identify local magnetic anomaly regions, and extract local magnetic anomaly response characteristics;
[0088] Step 4: The FastDTW algorithm is used to time-register the local magnetic anomaly response characteristics with the magnetic response characteristics of the standard tobacco sample, construct a three-layer time series structure, and generate the response deviation trajectory.
[0089] Step 5: Based on the response deviation trajectory, the magnetic response data of the tobacco sample to be tested is reconstructed into a multi-level magnetic spectrum structure to generate a global average magnetic spectrum, a local magnetic anomaly spectrum, and a response mutation point spectrum. A superposition state encoding method is then used to generate magnetic spectrum encoded data.
[0090] Step 6: Input the magnetic spectrum encoding data into the improved SRU model for classification. The improved SRU model introduces a synaptic dynamic gating mechanism to dynamically modulate the hidden state and obtain the classification confidence of the tobacco sample to be tested belonging to each quality grade.
[0091] Step 7: Output the final quality grade of the tobacco sample to be tested based on the classification confidence level.
[0092] In this embodiment, step one specifically includes:
[0093] The tobacco sample to be tested is placed in a temperature-controlled chamber. A temperature gradient field is applied to the tobacco sample to be tested through a low-temperature refrigeration unit and a heating unit during the same detection process. The tobacco sample to be tested sequentially experiences a low-temperature zone and a room temperature zone, wherein the temperature range of the low-temperature zone is 77K to 120K and the temperature range of the room temperature zone is 290K to 310K.
[0094] During the application of the temperature gradient field, an alternating weak magnetic scanning field is applied to the tobacco sample to be tested by a Helmholtz coil group set outside the temperature control cavity. The magnetic field strength of the alternating weak magnetic scanning field is 1μT to 100μT, the magnetic field change frequency is 0.1Hz to 100Hz, and the magnetic field direction of the alternating weak magnetic scanning field is set along the length direction of the tobacco sample to be tested.
[0095] Under the simultaneous action of a temperature gradient field and an alternating weak magnetic scanning field, a directional electrostatic field is applied to the tobacco sample under test through parallel plate electrodes set on both sides of the temperature-controlled cavity. The electric field strength of the directional electrostatic field is 10²V / m to... Furthermore, the electric field direction of the directional electrostatic field is set along the width direction of the tobacco sample to be tested, and is perpendicular to the magnetic field direction of the alternating weak magnetic scanning field.
[0096] During the synchronous action of a temperature gradient field, an alternating weak magnetic scanning field, and a directional electrostatic field, a superconducting magnetic quantum sensor is used to detect the magnetic response of the tobacco sample under test. The sampling time interval of the superconducting magnetic quantum sensor is 0.1ms to 5ms. The magnetic response signal generated by the tobacco sample under test under multi-physics field excitation conditions is continuously collected to obtain the magnetic response data of the tobacco sample under test.
[0097] In this invention, the application of a multi-physics field consisting of a temperature gradient field, an alternating weak magnetic scanning field, and a directional electrostatic field to the tobacco sample under controlled conditions aims to fully excite the quality-related physical and chemical differential responses within the tobacco material. The temperature gradient field can induce different components in the tobacco sample to produce differentiated magnetization behaviors and energy level distribution changes within the low-temperature to room-temperature range, thereby enhancing the magnetic response characteristics related to moisture content, fermentation degree, and trace metal ion distribution. The alternating weak magnetic scanning field is used to drive the magnetic components within the tobacco sample to generate repeatable dynamic magnetic responses, thereby forming a time-dependent magnetic response. The magnetic response signal of the interphase structure; the directional electrostatic field modulates and amplifies some potential weak magnetic anomalies by changing the distribution state of polar molecules and charge carriers. The synergistic effect of the above multi-physics fields fully reveals the micro-regional heterogeneity of the tobacco sample at the magnetic response level. Using a superconducting magnetic quantum sensor for magnetic response acquisition, it is possible to detect magnetic signal changes below the microtesla level under extremely low noise and high sensitivity conditions, ensuring the acquisition of high temporal resolution and high signal-to-noise ratio magnetic response data during multi-physics field excitation, providing a reliable data foundation for time series analysis, anomaly feature extraction and quality grading.
[0098] In this embodiment, step two specifically includes:
[0099] The magnetic response data of the tobacco samples to be tested are arranged in chronological order of sampling time to form a continuous magnetic response time series.
[0100] The magnetic response time series is divided into continuous windows according to the set time window length, and time overlap intervals are set between adjacent time windows so that adjacent time windows contain some of the same magnetic response sampling points.
[0101] A corresponding timestamp is assigned to each time window, and the timestamp is taken as the sampling time corresponding to the first magnetic response sampling point within the time window;
[0102] Within each time window, the magnetic response sampling points in the time window are subjected to first-order difference processing according to the sampling time order to obtain a sequence of magnetic response amplitude changes.
[0103] Divide each change in magnetic response amplitude in the magnetic response amplitude change sequence by the corresponding sampling time interval to obtain the rate of change sequence;
[0104] The arithmetic mean of the rate of change sequence within the same time window is used to obtain the magnetic flux change rate corresponding to the time window.
[0105] Arrange the magnetic flux change rate corresponding to each time window in the order of the timestamp of each time window to generate a time-series magnetic flux change rate curve.
[0106] In this invention, the temporal magnetic flux change rate curve is obtained by windowing the magnetic response data of the tobacco sample to be tested and calculating the change rate. The magnetic response data are arranged in the order of sampling time to form a continuous magnetic response time sequence. The magnetic response time sequence is divided into continuous windows with a fixed time window length of 1ms. A time overlap interval of 0.5ms is set between adjacent time windows to ensure the continuity of magnetic response changes between adjacent windows. The timestamp corresponding to each time window is the sampling time of the first magnetic response sampling point within the time window, which is used to identify the position of the time window in the overall time axis.
[0107] Within each time window, the sampling time interval for the magnetic response data is set to 0.1 ms. The magnetic response sampling points are processed by first-order difference according to the sampling time order to obtain a sequence of changes in magnetic response amplitude. Each change in magnetic response amplitude is divided by the corresponding sampling time interval to calculate the rate of change sequence. The arithmetic mean of the rate of change sequences within the same time window is calculated to obtain the magnetic flux change rate corresponding to the time window. By arranging the corresponding magnetic flux change rates according to the timestamp order of each time window, a time-series magnetic flux change rate curve is generated to characterize the dynamic characteristics of the magnetic response of the tested tobacco sample changing with time.
[0108] In this embodiment, step three specifically includes:
[0109] The time-series magnetic flux change rate curves are traversed and analyzed in time stamp order. The mean magnetic flux change rate of the time-series magnetic flux change rate curves is calculated, and the mean magnetic flux change rate is used as the baseline value.
[0110] The flux change rate corresponding to each time point in the time-series flux change rate curve is compared with the baseline value point by point. When the deviation of the flux change rate corresponding to the time point from the baseline value exceeds the set deviation threshold, the time point is marked as an abnormal candidate point.
[0111] The continuity of adjacent anomaly candidate points is judged. When multiple anomaly candidate points appear consecutively on the time axis and the number of consecutive points meets the set threshold, the corresponding time interval is determined as a local magnetic anomaly region.
[0112] In each of the local magnetic anomaly regions, the corresponding magnetic flux change rate subsequence is extracted, and the magnetic flux change rate subsequence is used as the local magnetic anomaly response feature.
[0113] In this invention, the extraction of local magnetic anomaly response features is based on the anomaly analysis results of the time-series magnetic flux change rate curve. By performing a traversal analysis of the time-series magnetic flux change rate curve over the entire detection time range, the mean value of the magnetic flux change rate is calculated and set as the baseline value to characterize the steady-state magnetic response level of the tobacco sample under multi-physics field excitation conditions. The magnetic flux change rate corresponding to each time stamp is compared point by point with the baseline value. When the deviation of the magnetic flux change rate from the baseline value exceeds a set deviation threshold, the corresponding time stamp is marked as an anomaly candidate point, where the deviation threshold is set to 1.5 times the mean value of the magnetic flux change rate. Furthermore, the continuity of the anomaly candidate points on the time axis is judged. When the number of consecutive anomaly candidate points reaches a set number threshold, the corresponding time interval is determined as a local magnetic anomaly region, where the number threshold is set to 3 consecutive time stamps.
[0114] Within each local magnetic anomaly region, the corresponding magnetic flux change rate subsequence is directly extracted as a local magnetic anomaly response feature. Compared with time registration based on overall magnetic response data, this invention performs time registration based on local magnetic anomaly response features, which can effectively focus on key time segments in tobacco samples where magnetic response changes significantly, avoiding the dominance and interference of steady-state background response on the time alignment path. This improves the stability and discrimination sensitivity of nonlinear time registration, making the generation of response deviation trajectories more accurately reflect the microscopic differences related to tobacco quality.
[0115] In this embodiment, step four specifically includes:
[0116] The local magnetic anomaly response characteristics were used as the sequence to be registered, and the corresponding magnetic flux change rate sequence in the standard tobacco sample was used as the reference sequence.
[0117] A three-layer time series structure is constructed based on the original resolution sequence to be registered and the reference sequence. The three-layer time series structure includes a first-layer low-resolution time series, a second-layer medium-resolution time series, and a third-layer original resolution time series. The second-layer medium-resolution time series is obtained by downsampling the third-layer original resolution time series, and the first-layer low-resolution time series is obtained by downsampling the second-layer medium-resolution time series. The sequence length of the first-layer low-resolution time series is half the sequence length of the second-layer medium-resolution time series, and the sequence length of the second-layer medium-resolution time series is half the sequence length of the third-layer original resolution time series.
[0118] On the first layer of low-resolution time series, the initial time alignment path between the sequence to be registered and the reference sequence is calculated using dynamic time warping. The initial time alignment path consists of a set of time index pairs.
[0119] The initial time alignment path is mapped to the second-layer medium-resolution time series. A first constraint window is constructed around the mapped time index pairs, and the time alignment path of the second-layer medium-resolution time series is calculated within the search range defined by the first constraint window.
[0120] The time alignment path obtained from the second-layer medium-resolution time series is further mapped to the third-layer original resolution time series. A second constraint window is constructed at the corresponding mapping position, and the nonlinear time alignment of the third-layer original resolution time series is completed within the search range defined by the second constraint window to obtain the final time alignment path.
[0121] Based on the final time alignment path, the magnetic flux change rate corresponding to each time index in the sequence to be registered is calculated point by point with the magnetic flux change rate corresponding to the time index in the reference sequence to generate the response deviation trajectory.
[0122] In this invention, step four employs a nonlinear time registration method based on local magnetic anomaly response characteristics. The local magnetic anomaly response characteristics are abnormal time segments extracted from the time-series magnetic flux change rate curve, corresponding to local intervals where the magnetic response changes significantly. The magnetic flux change rate sequence of the standard tobacco sample, serving as the reference sequence, is the corresponding time segment extracted from the complete magnetic response sequence of the standard tobacco sample. This ensures that the sequence to be registered and the reference sequence are consistent in time scale, thereby avoiding forced stretching and path distortion caused by directly registering the local abnormal segment with the full-length steady-state sequence.
[0123] During time registration, a three-layer time series structure is constructed, and a constraint window is used to refine the alignment path step by step. When the initial time alignment path obtained from the first-layer low-resolution time series is mapped to the second-layer medium-resolution time series, a first constraint window is constructed, centered on each mapped time index pair and extended by 10 sampling points in both the positive and negative directions of the time axis, to limit the search range of the second-layer medium-resolution time series. When the time alignment path obtained from the second-layer medium-resolution time series is further mapped to the third-layer original resolution time series, a second constraint window is constructed, centered on the mapped time index pair and extended by 20 sampling points in both the positive and negative directions of the time axis, to limit the search range of the original resolution level. By completing the layer-by-layer nonlinear time alignment within the above constraint windows, a response deviation trajectory that can accurately characterize the differences in local magnetic anomaly response is generated.
[0124] In this embodiment, the step of reconstructing the multi-level magnetic spectrum structure of the magnetic response data of the tobacco sample to be tested based on the response deviation trajectory to generate a global average magnetic spectrum, a local magnetic anomaly spectrum, and a response mutation point spectrum specifically involves:
[0125] Based on the response deviation trajectory, the magnetic response data of the tobacco sample to be tested is aligned with the time index so that each sampling point in the magnetic response data corresponds to the time index in the response deviation trajectory, thus obtaining a time-aligned magnetic response data sequence.
[0126] The response deviation trajectory is traversed in time index order, and the difference between response deviation values at adjacent time indices is calculated to obtain the response deviation change sequence.
[0127] The time index position where the absolute value of the change in response deviation is greater than a preset mutation threshold is determined as the response mutation point, where the preset mutation threshold is three times the average value of the change in response deviation.
[0128] Taking the time index corresponding to each response mutation point as the center, several continuous sampling points are selected in the positive and negative directions of the time axis to form a mutation window, and the magnetic response data corresponding to the mutation window is determined as the magnetic response data of the mutation segment.
[0129] The magnetic response data corresponding to the time index in the response deviation trajectory where the response deviation value is not greater than a preset stability threshold is determined as the stable segment magnetic response data, where the preset stability threshold is 10% of the mean of the response deviation trajectory.
[0130] The magnetic response data corresponding to the time index in the response deviation trajectory where the response deviation value exceeds the preset stability threshold and is not determined as a response mutation point is identified as the abnormal segment magnetic response data.
[0131] The stable segment magnetic response data are grouped according to their continuity on the time axis. Frequency domain transformation is performed on each group of stable segment magnetic response data to obtain the corresponding stable segment spectrum results. The frequency points of each stable segment spectrum results are averaged in the frequency domain to generate a global average magnetic spectrum consisting of multiple frequency points and corresponding average spectral amplitudes.
[0132] The magnetic response data of the anomalous segment is grouped according to the continuity on the time axis. Frequency domain transformation is performed on each group of magnetic response data of the anomalous segment. The spectral amplitude of the corresponding frequency point in the same anomalous segment is accumulated point by point to generate a local magnetic anomaly spectrum characterizing the magnetic response accumulation characteristics of each anomalous time period.
[0133] Frequency domain transformation is performed on the magnetic response data of the abrupt change segment to obtain the response abrupt change point spectrum composed of multiple frequency points and corresponding spectral amplitudes;
[0134] In this invention, the multi-level magnetic spectrum structure reconstruction uses the response deviation trajectory as a time reference. The magnetic response data of the tobacco sample to be tested is uniformly aligned with the time index, so that each sampling point in the magnetic response data is associated with the time index in the response deviation trajectory, thereby ensuring that subsequent magnetic spectrum analysis is performed in the same time coordinate system. By traversing the response deviation trajectory, the difference between the response deviation values at adjacent time indices is calculated. When the absolute value of the difference exceeds the preset mutation threshold, the corresponding time index is determined as a response mutation point. The mutation threshold is set to three times the average change in response deviation to reduce the influence of random noise on mutation determination.
[0135] For each response mutation point, three consecutive sampling points are selected in both the positive and negative directions of the time axis, centered on the time index, to form a mutation window. The magnetic response data corresponding to the mutation window is determined as the mutation segment magnetic response data, covering the main transition process when the magnetic response changes abruptly, while avoiding the introduction of steady-state components in the non-mutation segment by an excessively wide window. After removing the mutation segment magnetic response data, the remaining magnetic response data is further divided into stable segment and abnormal segment according to the response deviation amplitude. The stable segment corresponds to the time index interval where the response deviation value does not exceed the preset stable threshold, and the abnormal segment corresponds to the time index interval where the response deviation value exceeds the preset stable threshold.
[0136] During the spectrum reconstruction process, the magnetic response data of the stable segment are grouped according to their continuity on the time axis, and a frequency domain transformation is performed on each group of stable segment magnetic response data. In the frequency domain, the spectra of multiple stable segments are averaged point by point to reduce the influence of random fluctuations on the spectral morphology and generate a global average magnetic spectrum that can reflect the overall magnetic response characteristics of the tobacco sample. For the magnetic response data of the abnormal segment, a frequency domain transformation is performed on each abnormal time period and the frequency points are accumulated to make the duration and amplitude of the abnormality jointly reflected in the spectrum and generate a local magnetic anomaly spectrum. For the magnetic response data of the abrupt segment, a frequency domain transformation is performed separately to generate a spectrum of the response abrupt point, which is used to characterize the spectral characteristics when the magnetic response undergoes transient changes.
[0137] By using the above-mentioned multi-level magnetic spectrum structure reconstruction method, the present invention can simultaneously obtain global steady-state magnetic response characteristics, local anomalous magnetic response characteristics, and transient abrupt magnetic response characteristics in the same detection process, avoiding the problem of masking local differences by relying solely on a single average spectrum, and improving the ability to identify micro-regional anomalies and structural abrupt changes in tobacco quality detection.
[0138] In this embodiment, the method of using a qubit-like state encoding to perform superposition state encoding and generate magnetic spectrum encoded data specifically involves:
[0139] Using the global average magnetic spectrum, local magnetic anomaly spectrum, and response mutation point spectrum as input spectra, each input spectrum is discretely sampled along the frequency axis to obtain multiple frequency index positions;
[0140] At each frequency index position, the spectral amplitude values of the global average magnetic spectrum, the local magnetic anomaly spectrum, and the response mutation point spectrum corresponding to the frequency index position are obtained respectively, forming a three-channel spectral amplitude vector for the corresponding frequency index position;
[0141] The three-channel spectral amplitude vectors are subjected to complex number mapping processing, which maps the spectral amplitude of each channel to a complex amplitude. The magnitude of the complex amplitude is obtained by normalizing the corresponding channel spectral amplitude by dividing it by the square root of the sum of the squares of the three channel spectral amplitudes. The phase of the complex amplitude is determined by the sign of the difference between the channel spectral amplitude and the corresponding channel spectral amplitude at the adjacent frequency index position.
[0142] The three complex amplitudes are assigned to three pairwise orthogonal ground state components to construct a state vector comprising three complex components. The three components of the state vector correspond to the ground state of the global average magnetic spectrum, the ground state of the local magnetic anomaly spectrum, and the ground state of the response mutation point spectrum, respectively.
[0143] In this invention, assigning three complex amplitude values to three pairwise orthogonal ground state components is a state representation method used to describe the parallel coexistence of information from different magnetic spectrum sources. Specifically, the global average magnetic spectrum, the local magnetic anomaly spectrum, and the response mutation point spectrum reflect the physical characteristics of the tobacco sample under test at three different levels: overall magnetic response, local anomalous magnetic response, and transient mutation magnetic response. These three types of magnetic spectrum information are physically independent and do not have a substitutable relationship. To avoid weighted merging or priority filtering of these three types of information during the feature construction stage, this invention uses a state vector to uniformly express the three types of magnetic spectrum information.
[0144] The state vector consists of three pairwise orthogonal ground state components. Each ground state component carries a complex amplitude corresponding to a type of magnetic spectrum source. The complex amplitude contains both spectral intensity information and spectral shape change direction information. By mapping the three types of magnetic spectrum information to mutually orthogonal ground state components, it can be ensured that the information of different magnetic spectrum sources at the same frequency index position will not overlap or be lost, but will exist in the same state vector in parallel. The construction of this state vector does not involve comparison, filtering or merging of each magnetic spectrum source, but provides a structured, multi-source coexistence magnetic spectrum information representation basis for state superposition and probability calculation based on frequency neighborhood.
[0145] Perform component-wise complex addition on the state vectors corresponding to adjacent frequency index positions to obtain the superimposed state vectors at the corresponding frequency index positions;
[0146] Perform a modulus square operation on each complex component in the superimposed state vector to obtain the probability component at the corresponding frequency index position;
[0147] Multiple probability components corresponding to the same frequency index position are combined to form the magnetic spectrum encoding vector of the frequency index position, and the magnetic spectrum encoding vectors corresponding to each frequency index position are arranged in the order of frequency index to generate magnetic spectrum encoding data.
[0148] This invention achieves high-fidelity representation of multi-level features of tobacco magnetic response by introducing a qubit-like state encoding method for superposition-state encoding of magnetic spectral information. Unlike traditional methods that directly splice or weightedly fuse multiple magnetic spectral features, this invention maps the spectral amplitude information of the global average magnetic spectrum, local magnetic anomaly spectrum, and response mutation point spectrum to mutually orthogonal state components at the same frequency index position. This allows magnetic spectral information from different sources to coexist in parallel during the encoding stage, avoiding information loss due to feature compression or priority filtering. Through complex mapping and phase introduction, the encoding process not only preserves spectral amplitude intensity information but also introduces spectral shape on the frequency axis. The dynamic characteristic of the direction of change enables magnetic spectrum coding to reflect the continuous characteristics of magnetic response as frequency changes. Furthermore, by performing complex superposition operations on the state vectors of adjacent frequency index positions, natural coupling of magnetic spectrum information within the frequency neighborhood is achieved. This strengthens spectral components with consistent changing trends in the coding results, while suppressing spectral components with opposite changing trends. The probability components obtained through modulo-square operations enable the coding results to be output in a stable, non-negative numerical form. This preserves the structural relationship of multi-source magnetic spectrum information and facilitates direct processing by classification models, thereby improving the ability to express and distinguish subtle differences in magnetic spectrum during tobacco quality grading.
[0149] In this embodiment, step six specifically includes:
[0150] The magnetic spectrum encoded data is input into the improved SRU model, which includes an input feature mapping layer, an SRU time-series update layer, a synaptic weight dynamic modulation layer, and a classification output layer.
[0151] The input feature mapping layer receives magnetic spectrum encoded data, performs a linear mapping operation on the magnetic spectrum encoded vector corresponding to each frequency index position, and obtains an input feature vector sequence, wherein the input feature vector sequence maintains the order of the magnetic spectrum encoded data in the frequency index direction.
[0152] The SRU time-series update layer is based on the SRU unit structure and updates the input feature vector sequence step by step according to the frequency index order to obtain the hidden state sequence.
[0153] In this invention, the SRU time-series update layer uses a Simple Recurrent Unit (SRU) structure to perform sequence modeling on magnetic spectrum encoded data. The core feature of the SRU unit is that it decouples the calculation of gating parameters from the time-series recursion process, thereby reducing the computational complexity caused by time-series dependencies while maintaining the sequence modeling capability. Specifically, at each frequency index position, the SRU unit calculates the gating parameters corresponding to the update gate and reset gate based solely on the current input feature vector through linear transformation. The gating parameters do not depend on the hidden state of the previous frequency index position, allowing the gating calculation to be completed in parallel along the sequence dimension.
[0154] During the state update phase, the SRU unit combines the current input feature vector with the state value of the previous frequency index position using the gating parameters to obtain the state value of the current frequency index position. This state value is used to carry long-term dependency information in the sequence and is the only variable in the SRU unit that participates in the recursion. Subsequently, the SRU unit combines the state value of the current frequency index position with the current input feature vector to obtain the corresponding hidden state. The hidden state is used as the output feature of the frequency index position to participate in subsequent processing. While ensuring the continuity of state recursion, the SRU unit avoids the dependence of gating calculation on historical hidden states, making the model more computationally efficient and stable when processing frequency index sequences.
[0155] The synaptic weight dynamic modulation layer is set after the SRU timing update layer and introduces a synaptic-like dynamic gating mechanism, which specifically includes:
[0156] Calculate the difference between the magnetic spectrum coding vectors corresponding to adjacent frequency index positions to obtain the magnetic spectrum difference vector;
[0157] The magnetic spectrum difference vector is linearly transformed and processed by the Sigmoid activation function to obtain synaptic weight coefficients between 0 and 1.
[0158] The synaptic weight coefficients are multiplied element-wise with the hidden states at the corresponding frequency index positions to obtain the hidden state sequence after synaptic weight modulation.
[0159] The classification output layer receives the hidden state sequence after synaptic weight modulation and maps it into a single feature vector. It then performs a linear classification operation on the single feature vector. The linear classification operation uses a fully connected linear mapping function to obtain the classification score corresponding to each quality grade. The classification score is then normalized using Softmax to obtain the classification confidence of the tobacco sample belonging to each quality grade.
[0160] Compared with the existing standard SRU model, the improved SRU model in this invention, while maintaining the original parallel gating computation and lightweight state recursion structure of the SRU unit, introduces a synaptic weight dynamic modulation layer independent of the internal gating of the SRU unit, thereby realizing secondary regulation of the sequence feature transmission path. The traditional SRU model only relies on the input feature itself to calculate the gating parameters, and the transmission strength of its hidden state in the time or sequence dimension is mainly determined by the internal state recursion, lacking the ability to explicitly perceive the change amplitude of features at adjacent positions.
[0161] This invention constructs a magnetic spectrum difference vector reflecting the intensity of magnetic spectrum response changes by calculating the difference between magnetic spectrum coding vectors corresponding to adjacent frequency index positions. Based on this difference vector, synaptic weight coefficients are generated for element-wise modulation of the hidden state output by the SRU. This structure enables the model to dynamically adjust the feature transmission intensity according to the degree of change of the magnetic spectrum response in the frequency index direction without destroying the parallel computing characteristics of the SRU. This strengthens feature expression in frequency bands with significant magnetic spectrum changes and suppresses redundant information in frequency bands with gentle changes. Through the above improvements, the model can more effectively distinguish key spectral features corresponding to different quality levels when processing magnetic spectrum coding data with significant frequency response differences, thereby improving the stability and discrimination accuracy of the classification results.
[0162] In this embodiment, step seven specifically includes:
[0163] Obtain the classification confidence level corresponding to each quality grade of the tobacco sample to be tested, wherein the quality grades include first-grade quality, second-grade quality, third-grade quality, and unqualified quality;
[0164] The quality grade with the highest classification confidence value is selected as the final quality grade of the tobacco sample to be tested and output.
[0165] refer to Figure 2 A tobacco quality detection system based on a superconducting magnetic quantum sensor includes the following modules:
[0166] The multi-physics field excited magnetic response acquisition module is used to apply multi-physics field excitation to the tobacco sample under test and acquire the magnetic response data of the tobacco sample under test based on the superconducting magnetic quantum sensor.
[0167] The temporal magnetic flux change rate construction module is used to organize the magnetic response data of the tobacco sample to be tested according to the window structure, with each window bound to a corresponding timestamp, to generate a temporal magnetic flux change rate curve;
[0168] The local magnetic anomaly response feature extraction module is used to perform traversal analysis on the time-series magnetic flux change rate curve, identify local magnetic anomaly regions, and extract local magnetic anomaly response features.
[0169] The nonlinear time registration deviation trajectory generation module is used to perform time registration between the local magnetic anomaly response characteristics and the magnetic response characteristics of the standard tobacco sample based on the FastDTW algorithm, construct a three-layer time series structure, and generate the response deviation trajectory.
[0170] The multi-level magnetic spectrum structure reconstruction module is used to reconstruct the multi-level magnetic spectrum structure of the magnetic response data of the tobacco sample under test based on the response deviation trajectory, and generate the global average magnetic spectrum, local magnetic anomaly spectrum and response mutation point spectrum.
[0171] The magnetic spectrum qubit state encoding module is used to perform frequency axis discrete sampling on the global average magnetic spectrum, local magnetic anomaly spectrum and response mutation point spectrum, and to perform superposition state encoding using a qubit-like state encoding method to generate magnetic spectrum encoded data.
[0172] The quality classification module is used to input magnetic spectrum encoded data into the improved SRU model for classification. The improved SRU model introduces a synaptic dynamic gating mechanism to dynamically modulate the hidden state and obtain the classification confidence of the tobacco sample to be tested belonging to each quality grade.
[0173] The results output module is used to output the final quality grade of the tobacco sample to be tested based on the classification confidence level.
[0174] Example 1:
[0175] To verify the feasibility of this invention in practice, it was applied to a tobacco quality intelligent detection task. This research task aims to solve the problems of traditional tobacco quality detection methods relying on human sensory evaluation, long detection cycles, and strong subjectivity of results. In particular, when faced with complex tobacco fermentation samples, the accuracy of traditional detection methods in identifying their intrinsic quality differences is less than 60%, and the problem of poor consistency between different batches is particularly prominent.
[0176] In this embodiment, a total of 80 batches of tobacco samples from different sources and batches were placed in a temperature-controlled chamber. A temperature gradient field (varying between 77K and 310K), an alternating weak magnetic scanning field (1μT to 100μT), and a directional electrostatic field (10²V / m to 100μT) were sequentially applied to the samples. During this process, a superconducting magnetic quantum sensor was used to continuously collect magnetic response data at a time interval of 0.5ms, completing the acquisition of highly sensitive magnetic response information under multi-physics field excitation. During the acquisition process, the number of effective magnetic response sampling points generated by each batch of samples exceeded 20,000.
[0177] The time-series magnetic flux change rate construction module is used to perform first-order difference and change rate extraction operations to generate a complete time-series magnetic flux change rate curve. A dynamic baseline is set based on the mean magnetic flux change rate, and the curve is traversed for analysis to identify local magnetic anomaly regions and extract local magnetic anomaly response features. Based on the FastDTW algorithm, the local magnetic anomaly response features are time-registered with the magnetic response features of standard tobacco samples to construct a three-layer time series structure and generate a response deviation trajectory.
[0178] Using the response deviation trajectory as the reconstruction input, three types of spectra are generated in conjunction with the magnetic response data: global average magnetic spectrum, local magnetic anomaly spectrum, and response mutation point spectrum. These are then mapped to state vectors using a qubit-like state encoding method. Superposition state construction and probability mapping are performed to form magnetic spectrum encoded data. This magnetic spectrum encoded data is then input into the improved SRU model constructed in this invention. The model extracts time-dependent features in the frequency direction through an input feature mapping layer, an SRU time-series update layer, and a synaptic weight dynamic modulation layer. Finally, the classification output layer determines the classification confidence of the tobacco sample belonging to different quality grades. The system outputs classification results including four categories: Grade 1 quality, Grade 2 quality, Grade 3 quality, and unqualified quality.
[0179] To verify the classification performance of the model of this invention, a comparative experiment was conducted with the traditional support vector machine (SVM) model and the existing SRU model. 60 batches were randomly selected from the samples for model training, and the remaining 20 batches were used for testing. The results are shown in Table 1.
[0180] Table 1. Comparison of classification effects of different models in tobacco quality detection
[0181]
[0182] As can be seen from the comparison of classification performance of different models in tobacco quality detection in Table 1 above, the improved SRU model proposed in this invention outperforms existing traditional models in multiple evaluation indicators. Specifically, the classification accuracy of the SVM model is only 74.3%, the consistency index is 0.61, and the misclassification rate is as high as 18.5%, indicating that it has significant limitations when facing complex temporal magnetic response features. The existing SRU model improves the classification accuracy to 83.9% and the consistency index to 0.74 by introducing temporal modeling capabilities, while reducing the misclassification rate to 11.6%, indicating a significant advantage in modeling frequency index sequences. However, compared with the improved SRU model proposed in this invention, which introduces qubit-like state encoding and synaptic dynamic gating mechanisms, its advantages are still not obvious. The improved SRU model of this invention further improves the accuracy to 91.6%, the consistency index to 0.84, and reduces the misclassification rate to 6.3%, significantly improving the robustness and stability of classification. This verifies the improvement effect of this invention in feature expression capability and model adaptability, providing a more reliable technical path for high-precision tobacco quality detection.
[0183] Furthermore, the stability and response time of the model in identifying different quality levels were compared across different batches. The method of this invention maintains high recognition accuracy even when faced with samples where the boundary between Grade 3 quality and non-conforming quality is blurred, with a false positive rate of less than 8%, while traditional models often exhibit misclassification. In addition, in practical deployment, the method of this invention takes an average of less than 8 seconds to test each batch of samples, far less than the time required for manual laboratory testing procedures.
[0184] Table 2 Comparison of Classification Confidence and Response Time of Samples of Different Quality Grades
[0185]
[0186] As can be seen from the comparative data in Table 2 above, the improved SRU model used in this invention exhibits superior performance in terms of classification confidence for tobacco samples of different quality grades. Specifically, the improved SRU model achieved a classification confidence of 0.94 for Grade 1 sample T-03, significantly higher than the SVM model's 0.68 and the existing SRU model's 0.86, indicating that the improved SRU model is more reliable in identifying high-quality tobacco samples. For the unqualified sample T-39, the improved SRU model still showed high discrimination ability, with a classification confidence of 0.91, higher than the SVM model's 0.43 and the existing SRU model's 0.84, reflecting its robustness in anomaly detection. Furthermore, the improved SRU model's classification response time for all samples is less than 8 seconds, demonstrating good real-time performance and meeting the requirements of actual industrial testing for response speed. It achieves a fast response speed while maintaining high classification accuracy, demonstrating significant application advantages.
[0187] This embodiment verifies the practical application effect of the invention by applying it to the quality identification task of real tobacco samples. During implementation, the intrinsic magnetic response characteristics of the tobacco samples are excited by the combined action of multiple physical fields, and high-sensitivity superconducting magnetic quantum sensors are used to achieve high-time-efficiency and high-resolution magnetic response data acquisition. High-dimensional magnetic spectrum coding data is generated through multi-level magnetic spectrum structure reconstruction and qubit-like state encoding, achieving the fusion expression of local and global information while maintaining the integrity of frequency dimension features. In the classification stage, the improved SRU model, which introduces a synaptic dynamic gating mechanism, effectively enhances the ability to capture frequency-sensitive features, significantly improving the accuracy and stability of classification. Comparative experiments with existing models show that the invention, while ensuring detection efficiency, can more accurately determine the quality grade of tobacco samples, providing intelligent and highly reliable technical support for tobacco grading and quality control.
[0188] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for detecting tobacco quality based on a superconducting magnetic quantum sensor, characterized in that, Includes the following steps: Step 1: Apply multiphysics field excitation to the tobacco sample to be tested, and collect the magnetic response data of the tobacco sample based on a superconducting magnetic quantum sensor; Step 2: Organize the magnetic response data of the tobacco sample to be tested according to the window structure, bind each window to the corresponding timestamp, and generate a time-series magnetic flux change rate curve; Step 3: Analyze the time-series magnetic flux change rate curve, identify local magnetic anomaly regions, and extract local magnetic anomaly response characteristics; Step 4: The FastDTW algorithm is used to time-register the local magnetic anomaly response characteristics with the magnetic response characteristics of the standard tobacco sample, construct a three-layer time series structure, and generate the response deviation trajectory. Step 5: Based on the response deviation trajectory, the magnetic response data of the tobacco sample to be tested is reconstructed into a multi-level magnetic spectrum structure to generate a global average magnetic spectrum, a local magnetic anomaly spectrum, and a response mutation point spectrum. A superposition state encoding method is then used to generate magnetic spectrum encoded data. Step 6: Input the magnetic spectrum encoding data into the improved SRU model for classification. The improved SRU model introduces a synaptic dynamic gating mechanism to dynamically modulate the hidden state and obtain the classification confidence of the tobacco sample to be tested belonging to each quality grade. Step 7: Output the final quality grade of the tobacco sample to be tested based on the classification confidence level.
2. The tobacco quality detection method based on a superconducting magnetic quantum sensor according to claim 1, characterized in that, Step one specifically involves: The tobacco sample to be tested is placed in a temperature-controlled chamber. A temperature gradient field is applied to the tobacco sample to be tested through a low-temperature refrigeration unit and a heating unit during the same detection process. The tobacco sample to be tested sequentially experiences a low-temperature zone and a room temperature zone, wherein the temperature range of the low-temperature zone is 77K to 120K and the temperature range of the room temperature zone is 290K to 310K. During the application of the temperature gradient field, an alternating weak magnetic scanning field is applied to the tobacco sample to be tested by a Helmholtz coil group set outside the temperature control cavity. The magnetic field strength of the alternating weak magnetic scanning field is 1μT to 100μT, the magnetic field change frequency is 0.1Hz to 100Hz, and the magnetic field direction of the alternating weak magnetic scanning field is set along the length direction of the tobacco sample to be tested. Under the simultaneous action of a temperature gradient field and an alternating weak magnetic scanning field, a directional electrostatic field is applied to the tobacco sample under test through parallel plate electrodes set on both sides of the temperature-controlled cavity. The electric field strength of the directional electrostatic field is 10²V / m to... Furthermore, the electric field direction of the directional electrostatic field is set along the width direction of the tobacco sample to be tested, and is perpendicular to the magnetic field direction of the alternating weak magnetic scanning field. During the synchronous action of a temperature gradient field, an alternating weak magnetic scanning field, and a directional electrostatic field, a superconducting magnetic quantum sensor is used to detect the magnetic response of the tobacco sample under test. The sampling time interval of the superconducting magnetic quantum sensor is 0.1ms to 5ms, and the magnetic response signal generated by the tobacco sample under test under multi-physics field excitation conditions is continuously acquired to obtain the magnetic response data of the tobacco sample under test.
3. The tobacco quality detection method based on a superconducting magnetic quantum sensor according to claim 1, characterized in that, Step two specifically involves: The magnetic response data of the tobacco samples to be tested are arranged in chronological order of sampling time to form a continuous magnetic response time series. The magnetic response time series is divided into continuous windows according to the set time window length, and time overlap intervals are set between adjacent time windows so that adjacent time windows contain some of the same magnetic response sampling points. A corresponding timestamp is assigned to each time window, and the timestamp is taken as the sampling time corresponding to the first magnetic response sampling point within the time window; Within each time window, the magnetic response sampling points in the time window are subjected to first-order difference processing according to the sampling time order to obtain a sequence of magnetic response amplitude changes. Divide each change in magnetic response amplitude in the magnetic response amplitude change sequence by the corresponding sampling time interval to obtain the rate of change sequence; The arithmetic mean of the rate of change sequence within the same time window is used to obtain the magnetic flux change rate corresponding to the time window. Arrange the magnetic flux change rate corresponding to each time window in the order of the timestamp of each time window to generate a time-series magnetic flux change rate curve.
4. The tobacco quality detection method based on a superconducting magnetic quantum sensor according to claim 1, characterized in that, Step three specifically involves: The time-series magnetic flux change rate curves are traversed and analyzed in time stamp order. The mean magnetic flux change rate of the time-series magnetic flux change rate curves is calculated, and the mean magnetic flux change rate is used as the baseline value. The flux change rate corresponding to each time point in the time-series flux change rate curve is compared with the baseline value point by point. When the deviation of the flux change rate corresponding to the time point from the baseline value exceeds the set deviation threshold, the time point is marked as an abnormal candidate point. The continuity of adjacent anomaly candidate points is judged. When multiple anomaly candidate points appear consecutively on the time axis and the number of consecutive points meets the set threshold, the corresponding time interval is determined as a local magnetic anomaly region. In each of the local magnetic anomaly regions, the corresponding magnetic flux change rate subsequence is extracted, and the magnetic flux change rate subsequence is used as the local magnetic anomaly response feature.
5. The tobacco quality detection method based on a superconducting magnetic quantum sensor according to claim 1, characterized in that, Step four specifically involves: The local magnetic anomaly response characteristics were used as the sequence to be registered, and the corresponding magnetic flux change rate sequence in the standard tobacco sample was used as the reference sequence. A three-layer time series structure is constructed based on the original resolution sequence to be registered and the reference sequence. The three-layer time series structure includes a first-layer low-resolution time series, a second-layer medium-resolution time series, and a third-layer original resolution time series. The second-layer medium-resolution time series is obtained by downsampling the third-layer original resolution time series, and the first-layer low-resolution time series is obtained by downsampling the second-layer medium-resolution time series. The sequence length of the first-layer low-resolution time series is half the sequence length of the second-layer medium-resolution time series, and the sequence length of the second-layer medium-resolution time series is half the sequence length of the third-layer original resolution time series. On the first layer of low-resolution time series, the initial time alignment path between the sequence to be registered and the reference sequence is calculated using dynamic time warping. The initial time alignment path consists of a set of time index pairs. The initial time alignment path is mapped to the second-layer medium-resolution time series. A first constraint window is constructed around the mapped time index pairs, and the time alignment path of the second-layer medium-resolution time series is calculated within the search range defined by the first constraint window. The time alignment path obtained from the second-layer medium-resolution time series is further mapped to the third-layer original resolution time series. A second constraint window is constructed at the corresponding mapping position, and the nonlinear time alignment of the third-layer original resolution time series is completed within the search range defined by the second constraint window to obtain the final time alignment path. Based on the final time alignment path, the magnetic flux change rate corresponding to each time index in the sequence to be registered is calculated point by point with the magnetic flux change rate corresponding to the time index in the reference sequence to generate the response deviation trajectory.
6. The tobacco quality detection method based on a superconducting magnetic quantum sensor according to claim 1, characterized in that, Based on the response deviation trajectory, a multi-level magnetic spectrum structure reconstruction is performed on the magnetic response data of the tobacco sample to be tested, generating a global average magnetic spectrum, a local magnetic anomaly spectrum, and a response abrupt change point spectrum, specifically as follows: Based on the response deviation trajectory, the magnetic response data of the tobacco sample to be tested is aligned with the time index so that each sampling point in the magnetic response data corresponds to the time index in the response deviation trajectory, thus obtaining a time-aligned magnetic response data sequence. The response deviation trajectory is traversed in time index order, and the difference between response deviation values at adjacent time indices is calculated to obtain the response deviation change sequence. The time index position where the absolute value of the change in response deviation is greater than a preset mutation threshold is determined as the response mutation point, where the preset mutation threshold is three times the average value of the change in response deviation. Taking the time index corresponding to each response mutation point as the center, several continuous sampling points are selected in the positive and negative directions of the time axis to form a mutation window, and the magnetic response data corresponding to the mutation window is determined as the magnetic response data of the mutation segment. The magnetic response data corresponding to the time index in the response deviation trajectory where the response deviation value is not greater than a preset stability threshold is determined as the stable segment magnetic response data, where the preset stability threshold is 10% of the mean of the response deviation trajectory. The magnetic response data corresponding to the time index in the response deviation trajectory where the response deviation value exceeds the preset stability threshold and is not determined as a response mutation point is identified as the abnormal segment magnetic response data. The stable segment magnetic response data are grouped according to their continuity on the time axis. Frequency domain transformation is performed on each group of stable segment magnetic response data to obtain the corresponding stable segment spectrum results. The frequency points of each stable segment spectrum results are averaged in the frequency domain to generate a global average magnetic spectrum consisting of multiple frequency points and corresponding average spectral amplitudes. The magnetic response data of the anomalous segment is grouped according to the continuity on the time axis. Frequency domain transformation is performed on each group of magnetic response data of the anomalous segment. The spectral amplitude of the corresponding frequency point in the same anomalous segment is accumulated point by point to generate a local magnetic anomaly spectrum characterizing the magnetic response accumulation characteristics of each anomalous time period. Frequency domain transformation is performed on the magnetic response data of the abrupt change segment to obtain a response abrupt change point spectrum consisting of multiple frequency points and corresponding spectral amplitudes.
7. The tobacco quality detection method based on a superconducting magnetic quantum sensor according to claim 1, characterized in that, The method of using a qubit-like state encoding to encode superposition states and generate magnetic spectrum encoded data is as follows: Using the global average magnetic spectrum, local magnetic anomaly spectrum, and response mutation point spectrum as input spectra, each input spectrum is discretely sampled along the frequency axis to obtain multiple frequency index positions; At each frequency index position, the spectral amplitude values of the global average magnetic spectrum, the local magnetic anomaly spectrum, and the response mutation point spectrum corresponding to the frequency index position are obtained respectively, forming a three-channel spectral amplitude vector for the corresponding frequency index position; The three-channel spectral amplitude vectors are subjected to complex number mapping processing, which maps the spectral amplitude of each channel to a complex amplitude. The magnitude of the complex amplitude is obtained by normalizing the corresponding channel spectral amplitude by dividing it by the square root of the sum of the squares of the three channel spectral amplitudes. The phase of the complex amplitude is determined by the sign of the difference between the channel spectral amplitude and the corresponding channel spectral amplitude at the adjacent frequency index position. The three complex amplitudes are assigned to three pairwise orthogonal ground state components to construct a state vector comprising three complex components. The three components of the state vector correspond to the ground state of the global average magnetic spectrum, the ground state of the local magnetic anomaly spectrum, and the ground state of the response mutation point spectrum, respectively. Perform component-wise complex addition on the state vectors corresponding to adjacent frequency index positions to obtain the superimposed state vectors at the corresponding frequency index positions; Perform a modulus square operation on each complex component in the superimposed state vector to obtain the probability component at the corresponding frequency index position; Multiple probability components corresponding to the same frequency index position are combined to form the magnetic spectrum encoding vector of the frequency index position, and the magnetic spectrum encoding vectors corresponding to each frequency index position are arranged in the order of frequency index to generate magnetic spectrum encoding data.
8. The tobacco quality detection method based on a superconducting magnetic quantum sensor according to claim 1, characterized in that, Step six specifically involves: The magnetic spectrum encoded data is input into the improved SRU model, which includes an input feature mapping layer, an SRU time-series update layer, a synaptic weight dynamic modulation layer, and a classification output layer. The input feature mapping layer receives magnetic spectrum encoded data, performs a linear mapping operation on the magnetic spectrum encoded vector corresponding to each frequency index position, and obtains an input feature vector sequence, wherein the input feature vector sequence maintains the order of the magnetic spectrum encoded data in the frequency index direction. The SRU time-series update layer is based on the SRU unit structure and updates the input feature vector sequence step by step according to the frequency index order to obtain the hidden state sequence. The synaptic weight dynamic modulation layer is set after the SRU timing update layer and introduces a synaptic-like dynamic gating mechanism, which specifically includes: Calculate the difference between the magnetic spectrum coding vectors corresponding to adjacent frequency index positions to obtain the magnetic spectrum difference vector; The magnetic spectrum difference vector is linearly transformed and processed by the Sigmoid activation function to obtain synaptic weight coefficients between 0 and 1. The synaptic weight coefficients are multiplied element-wise with the hidden states at the corresponding frequency index positions to obtain the hidden state sequence after synaptic weight modulation. The classification output layer receives the hidden state sequence modulated by synaptic weights and maps it into a single feature vector. A linear classification operation is then performed on the single feature vector. The linear classification operation uses a fully connected linear mapping function to obtain the classification score corresponding to each quality grade. Softmax normalization is then performed on the classification score to obtain the classification confidence of the tobacco sample belonging to each quality grade.
9. The tobacco quality detection method based on a superconducting magnetic quantum sensor according to claim 1, characterized in that, Step seven specifically involves: Obtain the classification confidence level corresponding to each quality grade of the tobacco sample to be tested, wherein the quality grades include first-grade quality, second-grade quality, third-grade quality, and unqualified quality; The quality grade with the highest classification confidence value is selected as the final quality grade of the tobacco sample to be tested and output.
10. A tobacco quality detection system based on a superconducting magnetic quantum sensor, comprising the tobacco quality detection method based on a superconducting magnetic quantum sensor as described in any one of claims 1 to 9, characterized in that, Includes the following modules: The multi-physics field excited magnetic response acquisition module is used to apply multi-physics field excitation to the tobacco sample under test and acquire the magnetic response data of the tobacco sample under test based on the superconducting magnetic quantum sensor. The temporal magnetic flux change rate construction module is used to organize the magnetic response data of the tobacco sample to be tested according to the window structure, with each window bound to a corresponding timestamp, to generate a temporal magnetic flux change rate curve; The local magnetic anomaly response feature extraction module is used to perform traversal analysis on the time-series magnetic flux change rate curve, identify local magnetic anomaly regions, and extract local magnetic anomaly response features. The nonlinear time registration deviation trajectory generation module is used to perform time registration between the local magnetic anomaly response characteristics and the magnetic response characteristics of the standard tobacco sample based on the FastDTW algorithm, construct a three-layer time series structure, and generate the response deviation trajectory. The multi-level magnetic spectrum structure reconstruction module is used to reconstruct the multi-level magnetic spectrum structure of the magnetic response data of the tobacco sample under test based on the response deviation trajectory, and generate the global average magnetic spectrum, local magnetic anomaly spectrum and response mutation point spectrum. The magnetic spectrum qubit state encoding module is used to perform frequency axis discrete sampling on the global average magnetic spectrum, local magnetic anomaly spectrum and response mutation point spectrum, and to perform superposition state encoding using a qubit-like state encoding method to generate magnetic spectrum encoded data. The quality classification module is used to input magnetic spectrum encoded data into the improved SRU model for classification. The improved SRU model introduces a synaptic dynamic gating mechanism to dynamically modulate the hidden state and obtain the classification confidence of the tobacco sample to be tested belonging to each quality grade. The results output module is used to output the final quality grade of the tobacco sample to be tested based on the classification confidence level.
Citation Information
Patent Citations
Superconducting weak magnetic signal detection magnetometer
CN104330754A
Matched tobacco appliance identification method and system based on metal heating inductor
CN120950988A
High frequency scanning SQUID microscope and method of measuring high frequency magnetic fields
US20050206376A1
Methods and systems for monitoring bioactive agent use
US20100280332A1
Magnetic anomaly detector
US8120355B1