Fungaltoxin detection system based on machine learning and biosensor
By combining a multimodal masked autoencoder and a ConvNeXtV2 feature enhancement network with channel and cross-modal attention mechanisms, the problem of identifying multiple toxins coexisting in complex matrices by biosensors was solved, achieving toxin detection with high accuracy and real-time calibration.
Patent Information
- Application Number
- CN202511763709.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-11-27
AI Technical Summary
Existing biosensors struggle to accurately distinguish weak signals in complex matrices where multiple toxins coexist at low concentrations. Furthermore, they are prone to baseline drift and response distortion during long-term operation. Existing models also suffer from insufficient generalization ability, resulting in high false alarm and false negative rates.
By employing a multimodal masked autoencoder and a ConvNeXtV2 feature enhancement network, combined with channel attention guidance and cross-modal attention mechanisms, and through self-supervised reconstruction and dynamic calibration mechanisms, fine resolution and real-time calibration of multi-toxin signals are achieved.
It improves the selectivity and robustness of toxin quantification in complex matrices, reduces quantitative interference when multiple toxins coexist, achieves simultaneous differentiation of multiple toxins, improves recognition accuracy in extreme signal-to-noise ratio environments, and has real-time online calibration capability.
Smart Images

Figure CN121580356A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mycotoxin technology, and in particular to a mycotoxin detection system based on machine learning and biosensors. Background Technology
[0002] With increasingly stringent food safety requirements in grain storage, transportation, and processing, biosensors are widely used in the detection of trace mycotoxins in grains. Currently, multi-channel biosensors based on electrochemical or optical signals, combined with intelligent analysis algorithms, have become one of the main technical approaches for rapid screening and quantitative analysis of various mycotoxins. In practical detection scenarios, the matrix composition of grain samples is complex, and changes in moisture, oil, polyphenols, and metal ions in different batches of samples can easily interfere with sensor responses, leading to unstable signal baselines, increased noise levels, and overlapping signals from multiple toxins. Traditional threshold methods or analysis methods based on manual features struggle to accurately distinguish weak signals under conditions of low concentration and coexistence of multiple toxins.
[0003] Existing machine learning and deep learning methods have been attempted to be introduced into the field of biosensor data analysis, such as classification and regression models based on traditional convolutional neural networks or transfer learning. However, these methods usually rely on large amounts of labeled data and are difficult to cope with the dynamic changes of complex matrix and signal noise.
[0004] In addition, sensors are prone to baseline drift and response distortion during long-term online operation. Existing technologies often rely on manual shutdown for recalibration, which limits the real-time performance and monitoring continuity of the system. Furthermore, for cross-domain adaptation to different sensor batches, different grain types, and different environmental conditions, existing models generally suffer from insufficient generalization ability and high false alarm and false negative rates. Summary of the Invention
[0005] One objective of this invention is to propose a fungal toxin detection system based on machine learning and biosensors. This invention suppresses matrix effects and non-target interference, improves the selectivity and robustness of toxin quantification, and enables simultaneous differentiation of multiple toxins in scenarios where multiple toxins coexist and their response spectra overlap, thereby reducing quantitative interference between toxins.
[0006] A fungal toxin detection system based on machine learning and biosensors according to an embodiment of the present invention includes:
[0007] The acquisition module constructs a multimodal biosensor array, acquires the original multimodal biosensor response signals, and performs signal normalization, time alignment, and noise suppression processing to generate standardized multimodal biosensor input signals.
[0008] The multimodal masking random masking guidance module inputs the standardized multimodal biosensor input signal into the multimodal masking random masking guidance module, performs channel attention-guided random masking on the electrochemical biosensing channel signal and the optical biosensing channel signal, and obtains the masked multimodal biosensor input signal;
[0009] The multimodal masking autoencoder module performs baseline reconstruction on the input signal of the masked multimodal biosensor, outputs a MAE reconstruction representation and a MAE reconstruction residual map, and performs channel splicing on the MAE reconstruction representation and the MAE reconstruction residual map to generate a reconstruction enhancement characterization tensor.
[0010] The ConvNeXtV2 feature enhancement module inputs the reconstructed enhanced representation tensor into the ConvNeXtV2 feature enhancement module to obtain the enhanced feature tensor;
[0011] The multi-task detection module, based on the enhanced feature tensor, uses a multi-task recognition network to generate toxin presence classification results, toxin concentration regression results, and detection uncertainty estimation results, thus forming multi-task detection results.
[0012] The calibration module calculates the online reconstruction error index based on the multi-task detection results and the MAE reconstruction residual map, and generates an online calibration trigger signal in combination with environmental parameters. When the online calibration trigger signal meets a preset threshold, the low-order calibration parameters of the ConvNeXtV2 feature enhancement module are updated to generate a calibration model version.
[0013] Optionally, the construction of the multimodal biosensor array includes:
[0014] The multimodal biosensor array consists of electrochemical biosensing channels and optical biosensing channels. The sensitive layers of the electrochemical biosensing channels and optical biosensing channels are modified with aptamers or antibody recognition elements and interface functional materials to generate multi-channel response signals for aflatoxin, zearalenone, vomitoxin, and ochratoxin in grain samples. Through constant flow injection, sample purification, and flow path distribution operations, the grain sample extract flows sequentially through the multimodal biosensor array, and the original multimodal biosensor response signals are collected simultaneously.
[0015] Optionally, the multimodal masking random masking guidance module includes:
[0016] The standardized multimodal biosensor input signal is represented as a tensor containing the electrochemical biosensing channel signal matrix and the optical biosensing channel signal matrix;
[0017] A channel attention-guided masking probability function is constructed for tensors, and channel attention-guided masking weights are assigned to each electrochemical biosensing channel and each optical biosensing channel;
[0018] A distributed random masking mechanism is adopted to randomly mask the signal of each channel of the input tensor at each time step: if the random number of the current time step of the channel is less than the product of the channel attention-guided masking weight and the basic masking rate, the signal of the corresponding channel at the current time step is set to zero; otherwise, it remains unchanged.
[0019] The tensor obtained after masking is used as the input signal for the masked multimodal biosensor.
[0020] Optionally, the multimodal masking autoencoder module includes:
[0021] The input signal of the masked multimodal biosensor is represented as a masked multimodal biosensor input signal tensor;
[0022] The input signal tensor of the masked multimodal biosensor is encoded using a multimodal masked autoencoder to obtain the latent representation tensor;
[0023] The latent representation tensor is decoded using a multimodal masked autoencoder decoder to obtain the MAE reconstructed representation;
[0024] The difference between the standardized multimodal biosensor input signal tensor and the MAE reconstructed representation is calculated on the corresponding elements to obtain the MAE reconstructed residual map;
[0025] The MAE reconstruction representation and the MAE reconstruction residual map are spliced together in the channel dimension to generate the reconstruction enhancement representation tensor.
[0026] Optionally, the ConvNeXtV2 feature enhancement module includes:
[0027] A global average pooling operation is performed on the reconstructed and enhanced representation tensor in the time dimension to obtain the channel convergence vector;
[0028] The channel convergence vector is input into the linear transformation unit to obtain the channel feature vector. For each target mycotoxin, a mycotoxin embedding vector is set. The embedding vector of each mycotoxin and the channel feature vector are calculated by the inner product operation. The matching scores of all mycotoxins are normalized to obtain the mycotoxin attention weight vector. Each element of the mycotoxin attention weight vector represents the attention weight coefficient of the corresponding mycotoxin.
[0029] By using the attention weight coefficients of all mycotoxins, the pointwise convolution kernel weights of each mycotoxin are summed in a weighted manner to generate a kernel modulation matrix.
[0030] The reconstructed and enhanced representation tensor is combined with the kernel modulation matrix, and a pointwise convolution operation with kernel modulation is performed. After passing through a nonlinear activation unit, the intermediate representation tensor is output.
[0031] The intermediate representation tensor is divided into electrochemical biological sensing group tensor and optical biological sensing group tensor according to the channel group. The attention weight matrix of electrochemical biological sensing group to optical biological sensing group and optical biological sensing group to electrochemical biological sensing group is calculated by bidirectional cross-modal attention mechanism, and then concatenated in the channel dimension to obtain cross-modal weighted tensor.
[0032] The cross-modal weighted tensor is input into a multi-scale depth-separable convolutional layer and a channel normalization layer. Convolution is performed with different kernel sizes, strides, and padding. The tensor results after convolution are stacked in the same channel dimension, and channel normalization is performed on the convolution results to output an enhanced feature tensor.
[0033] Optionally, the multi-task detection module includes:
[0034] Global average pooling is performed on the enhanced feature tensor in the time dimension to obtain sample-level feature vectors;
[0035] The sample-level feature vectors are input into the toxin presence classification subnetwork in the multi-task recognition network to generate toxin presence classification results.
[0036] The sample-level feature vector is input into the toxin concentration regression subnetwork to generate toxin concentration regression results.
[0037] The sample-level feature vectors are input into the detection uncertainty estimation subnetwork to generate uncertainty estimation results;
[0038] The results of toxin presence classification, toxin concentration regression, and uncertainty estimation are combined according to the fungal toxin type to form a multi-task detection result.
[0039] Optionally, the toxin presence classification subnetwork includes:
[0040] Each element of the sample-level feature vector is multiplied one-to-one with each element of the classification weight vector corresponding to each fungal toxin species to be detected. All product results are summed element-wise to obtain the weighted sum of each fungal toxin species. The corresponding classification bias is added to form the classification score of each fungal toxin species. The classification score of each fungal toxin species is input into the Sigmoid activation unit to obtain the existence probability of each fungal toxin species. The existence probabilities of all fungal toxin species constitute the toxin existence classification result.
[0041] Optionally, the toxin concentration regression subnetwork includes:
[0042] For each fungal toxin species to be detected, the sample-level feature vector is multiplied element-wise with the regression weight vector corresponding to the fungal toxin species, and then summed. The regression bias of the fungal toxin species is added to obtain the predicted concentration value of the fungal toxin species. The predicted concentration values of all fungal toxin species are combined in order to form the toxin concentration regression result.
[0043] Optionally, the detection uncertainty estimation subnetwork includes:
[0044] The sample-level feature vectors are weighted and summed with the uncertainty estimation weight vectors corresponding to each type of mycotoxin to be detected. The uncertainty estimation bias corresponding to the type of mycotoxin is then added. The weighted sum and the bias are input into the Softplus activation function for transformation to obtain the model prediction uncertainty corresponding to the type of mycotoxin.
[0045] Optionally, the calibration module includes:
[0046] The reconstruction mean square error is obtained by summing the squared differences between the standardized response values of the standardized multimodal biosensor input signal tensors at all time steps of the channel and the standardized response values represented by MAE reconstruction, and then dividing by the number of time steps. The reconstruction mean square errors of all channels are arranged in order to form an online reconstruction error index vector.
[0047] Collect environmental parameters for the current sample;
[0048] The online reconstruction error index vector and the environmental parameter vector are input together into the calibration trigger function, which outputs a calibration trigger scalar.
[0049] The calibration trigger scalar is compared with the preset calibration threshold. When the calibration trigger scalar is greater than the preset calibration threshold, it is determined that model self-calibration is required.
[0050] During the model self-calibration process, the current enhanced feature tensor is obtained as the output of the teacher model, and the low-order convolutional layer output feature tensor of the current ConvNeXtV2 feature enhancement module is obtained as the current output of the student model.
[0051] The feature distillation loss is obtained by summing the squared differences between the enhanced feature tensor of the teacher model and the output feature tensor of the low-order convolutional layer of the student model over all channels and all time steps, and then dividing the sum by the product of the number of channels and the time step.
[0052] The low-order calibration parameters of the student model are optimized by gradient descent based on the feature distillation loss, and a new set of low-order calibration parameters is obtained after the update. The optimized set of low-order calibration parameters is used as the low-order parameters of the calibration model version.
[0053] The beneficial effects of this invention are:
[0054] This invention employs a multimodal masked autoencoder to perform self-supervised reconstruction of the original multi-channel biosensor signals. By introducing a channel attention-guided dynamic masking and reconstruction mechanism, it effectively separates the background noise of complex grain matrices from trace fungal toxin signals, solving the problem that traditional methods struggle to reliably identify and quantify in scenarios with strong interference and low concentrations. By stitching the reconstructed representation of the multimodal masked autoencoder with the reconstructed residual map in the channel dimension, it deeply preserves anomalous features and significantly improves the sensitivity of downstream detection models to trace features. Even in extreme environments with low signal-to-noise ratios (<3dB), the toxin identification accuracy of this invention is improved compared to traditional convolutional networks.
[0055] This invention introduces a dynamic kernel modulation mechanism combining mycotoxin biofeedback into the ConvNeXtV2 feature enhancement network. By adaptively modulating the pointwise convolution kernel weights based on the matching score between the mycotoxin embedding vector and channel features, precise feature enhancement targeting specific toxins is achieved. Furthermore, a bidirectional cross-modal attention mechanism is designed between the electrochemical and optical biosensing channels. This mechanism automatically models the structured correlations and complementarities between different signal modes, accurately decouples the superimposed responses of multiple toxins, suppresses matrix effects and non-target interference, and improves the selectivity and robustness of toxin quantification. Even in scenarios with multiple toxins coexisting and overlapping response spectra, it enables simultaneous differentiation of multiple toxins, reducing quantitative interference between toxins.
[0056] This invention is based on a multimodal masked autoencoder reconstruction residual and environmental parameter dynamic monitoring system health status. Through an adaptive calibration trigger mechanism, it uses a feature distillation algorithm to quickly adapt the low-order parameters of the ConvNeXtV2 feature enhancement module to the domain and update the model. It can perceive model performance drift in real time and automatically perform low-sample, high-efficiency calibration under conditions such as grain variety switching, environmental changes, and probe aging. It does not require large-scale labeled data and manual calibration during downtime, which significantly improves the system's intelligence and continuous online capability. Attached Figure Description
[0057] 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:
[0058] Figure 1 This is a flowchart of a fungal toxin detection system based on machine learning and biosensors proposed in this invention. Detailed Implementation
[0059] Example 1: Reference Figure 1A fungal toxin detection system based on machine learning and biosensors, comprising:
[0060] The acquisition module constructs a multimodal biosensor array, acquires the original multimodal biosensor response signals, and performs signal normalization, time alignment, and noise suppression processing to generate standardized multimodal biosensor input signals.
[0061] In this embodiment, a multimodal biosensor array is constructed, including:
[0062] The multimodal biosensor array consists of electrochemical biosensing channels and optical biosensing channels. The sensitive layers of the electrochemical biosensing channels and optical biosensing channels are modified with aptamers or antibody recognition elements and interface functional materials to generate multi-channel response signals for aflatoxin, zearalenone, vomitoxin and ochratoxin in grain samples. Through constant flow injection, sample purification and flow path distribution operations, the grain sample extract flows through the multimodal biosensor array in sequence, and the original multimodal biosensor response signals are collected simultaneously.
[0063] The multimodal masking random masking guidance module inputs the standardized multimodal biosensor input signal into the multimodal masking random masking guidance module, performs channel attention-guided random masking on the electrochemical biosensor channel signal and the optical biosensor channel signal, and obtains the masked multimodal biosensor input signal;
[0064] In this embodiment, the multimodal masking random masking guidance module includes:
[0065] The standardized multimodal biosensor input signal is represented as a tensor containing the electrochemical biosensing channel signal matrix and the optical biosensing channel signal matrix;
[0066] The electrochemical biosensor channel signal matrix consists of the standardized response values of each electrochemical biosensor channel at all time steps, and the optical biosensor channel signal matrix consists of the standardized response values of each optical biosensor channel at all time steps. The number of electrochemical biosensor channels and the number of optical biosensor channels represent the total number of electrochemical biosensor channels and the total number of optical biosensor channels, respectively. The standardized response values of the electrochemical biosensor channels and the standardized response values of the optical biosensor channels represent the standardized output results of the corresponding channels at a certain time point.
[0067] A channel attention-guided masking probability function is constructed for tensors, and channel attention-guided masking weights are assigned to each electrochemical biosensing channel and each optical biosensing channel;
[0068] In Example 1, the normalized response values of each electrochemical biosensing channel and each optical biosensing channel at all time steps are subjected to mean pooling. Mean pooling is performed by summing the normalized response values of each channel at all time steps and dividing by the number of time steps to obtain the mean feature of each channel. The mean feature of each channel is input into a single-layer fully connected perceptron. The single-layer fully connected perceptron outputs an attention score for each channel. The attention score is processed by a nonlinear activation function to obtain the activated attention score. The activated attention scores of all channels are normalized to obtain the channel attention-guided masking weight for each channel. The channel attention-guided masking weight reflects the importance of the channel to the overall representation and serves as the basis for the masking probability of random masking operations.
[0069] A distributed random masking mechanism is adopted to randomly mask the signal of each channel of the input tensor at each time step: if the random number of the current time step of the channel is less than the product of the channel attention-guided masking weight and the basic masking rate, the signal of the corresponding channel at the current time step is set to zero; otherwise, it remains unchanged.
[0070] Random numbers are generated from a uniform distribution. The base masking rate is a fixed hyperparameter. The product of the channel attention-guided masking weight and the base masking rate is the adaptive masking probability threshold of the current channel at the current time step.
[0071] The tensor obtained after masking is used as the input signal for the masked multimodal biosensor.
[0072] The masking of the input signal of the multimodal biosensor is composed of the masking results of the electrochemical biosensing channel and the masking results of the optical biosensing channel.
[0073] The multimodal masking autoencoder module performs baseline reconstruction on the input signal of the masked multimodal biosensor, outputs the MAE reconstruction representation and MAE reconstruction residual map, and performs channel splicing on the MAE reconstruction representation and MAE reconstruction residual map to generate the reconstruction enhancement characterization tensor.
[0074] In this embodiment, the multimodal masking autoencoder module includes:
[0075] The input signal of the masked multimodal biosensor is represented as a masked multimodal biosensor input signal tensor;
[0076] The masked multimodal biosensor input signal tensor uses the sum of the total number of electrochemical biosensing channels and the total number of optical biosensing channels as its channel dimension. Each element of the masked multimodal biosensor input signal tensor is a standardized response value, and the tensor's dimensions are consistent with those of the standardized multimodal biosensor input signal.
[0077] The input signal tensor of the masked multimodal biosensor is encoded using a multimodal masked autoencoder to obtain the latent representation tensor;
[0078] In Example 1, the input signal tensor of the masked multimodal biosensor is input into the multimodal masking autoencoder. The multimodal masking autoencoder consists of multiple ordered stacked neural network encoding layers, each including linear transformation, nonlinear activation, normalization, and residual connection operations. During the first layer encoding, the normalized response value of each channel at all time steps is input into the linear transformation unit. The linear transformation unit performs feature mapping on the input signal tensor of the masked multimodal biosensor. The result of the linear transformation is input into the nonlinear activation unit, which performs nonlinear feature extraction on the signal. The process involves inputting the output of the nonlinear activation unit into a normalization unit, which standardizes the signal amplitude. The output of the normalization unit is then weighted and summed with the original input signal to form a residual connection output. This process is repeated, and through a multi-layer coding structure, the high-dimensional features of each channel and each time step are progressively compressed into low-dimensional abstract features. By fusing inter-channel correlation features, time-series variation features, and masking information features, a latent representation tensor is output. Each element of the latent representation tensor is a standardized representation quantity after encoding, and the dimensions of the latent representation tensor are consistent with the input signal tensor of the masked multimodal biosensor.
[0079] The latent representation tensor is decoded using a multimodal masked autoencoder decoder to obtain the MAE reconstructed representation;
[0080] MAE reconstruction is represented as a tensor of the same dimension as the input signal of the normalized multimodal biosensor, with each element of the MAE reconstruction being a normalized response value.
[0081] The difference between the standardized multimodal biosensor input signal tensor and the MAE reconstructed representation is calculated on the corresponding elements to obtain the MAE reconstructed residual map;
[0082] In Example 1, each element of the standardized multimodal biosensor input signal tensor is subtracted one-to-one from the corresponding element in the MAE reconstruction representation. All the subtraction results are arranged according to the original tensor structure to form the MAE reconstruction residual map. Each element of the MAE reconstruction residual map is equal to the standardized response value of the standardized multimodal biosensor input signal tensor at that position minus the standardized response value of the MAE reconstruction representation at the same position.
[0083] The MAE reconstruction representation and the MAE reconstruction residual map are spliced together in the channel dimension to generate the reconstruction enhancement representation tensor.
[0084] The channel dimension of the reconstructed reinforcement characterization tensor is twice the sum of the total number of electrochemical biosensing channels and the total number of optical biosensing channels, and the time dimension is the total time step of the signal sequence. Each element of the reconstructed reinforcement characterization tensor is a joint representation of the standardized response value and its differences.
[0085] The ConvNeXtV2 feature enhancement module inputs the reconstructed enhanced representation tensor into the ConvNeXtV2 feature enhancement module to obtain the enhanced feature tensor;
[0086] In this embodiment, the ConvNeXtV2 feature enhancement module includes:
[0087] A global average pooling operation is performed on the reconstructed and enhanced representation tensor in the time dimension to obtain the channel convergence vector;
[0088] In Example 1, a global average pooling operation is performed on the reconstruction enhancement characterization tensor in the time dimension to obtain the channel convergence vector. Each element of the channel convergence vector represents the average level of the response values of the electrochemical biosensing channel and the optical biosensing channel over all time steps.
[0089] The channel convergence vector is input into the linear transformation unit to obtain the channel feature vector. For each target mycotoxin, a mycotoxin embedding vector is set. The embedding vector of each mycotoxin and the channel feature vector are calculated by the inner product operation. The matching scores of all mycotoxins are normalized to obtain the mycotoxin attention weight vector. Each element of the mycotoxin attention weight vector represents the attention weight coefficient of the corresponding mycotoxin.
[0090] By using the attention weight coefficients of all mycotoxins, the pointwise convolution kernel weights of each mycotoxin are summed in a weighted manner to generate a kernel modulation matrix.
[0091] The function of the kernel modulation matrix is to modulate the input tensor according to the attention of different mycotoxins. The channel dimension of the kernel modulation matrix is the number of temporary channels of the convolution output, and the input dimension is twice the sum of the total number of electrochemical biosensing channels and the total number of optical biosensing channels.
[0092] The reconstructed and enhanced representation tensor is combined with the kernel modulation matrix, and a pointwise convolution operation with kernel modulation is performed. After passing through a nonlinear activation unit, the intermediate representation tensor is output.
[0093] The middle dimension represents the channel dimension of the tensor, which is the number of temporary channels in the convolution output, and the time dimension is the total time step of the signal sequence.
[0094] The intermediate representation tensor is divided into electrochemical biological sensing group tensor and optical biological sensing group tensor according to the channel group. The attention weight matrix of electrochemical biological sensing group to optical biological sensing group and optical biological sensing group to electrochemical biological sensing group is calculated by bidirectional cross-modal attention mechanism, and then concatenated in the channel dimension to obtain cross-modal weighted tensor.
[0095]
[0096] ;
[0097] ;
[0098] in, Let tensor be the intermediate representation. These are the query vector for the electrochemical biosensor group and the bond vector and value vector for the optical biosensor group, respectively. These are the query vector for the optical biosensor group and the bond vector and value vector for the electrochemical biosensor group, respectively. This is the attention weight matrix for the electrochemical biosensor group on the optical biosensor group, used to capture cross-modal feature dependencies between different channels. This is the attention weight matrix of the optical biosensor group to the electrochemical biosensor group. Scaling factor Scaling the dimensions for attention For cross-modal weighted tensors, This is for channel splicing operations.
[0099] The cross-modal weighted tensor is input into a multi-scale depth-separable convolutional layer and a channel normalization layer. Convolution is performed with different kernel sizes, strides, and padding. The tensor results after convolution are stacked in the same channel dimension, and channel normalization is performed on the convolution results to output an enhanced feature tensor.
[0100] ;
[0101] in, For depthwise separable convolution operations, The kernel size is [size]. Step size, For fill size, To enhance the feature tensor.
[0102] The multi-task detection module, based on the enhanced feature tensor, uses a multi-task recognition network to generate toxin presence classification results, toxin concentration regression results, and detection uncertainty estimation results, thus forming multi-task detection results.
[0103] In this embodiment, the multi-task detection module includes:
[0104] Global average pooling is performed on the enhanced feature tensor in the time dimension to obtain sample-level feature vectors;
[0105] Each element of the sample-level feature vector is the average response value of the corresponding feature channel over all time steps. The sample-level feature vector is used to represent the overall characteristics of a single grain sample.
[0106] The sample-level feature vectors are input into the toxin presence classification subnetwork in the multi-task recognition network to generate toxin presence classification results.
[0107] Each element in the toxin presence classification result represents the probability of the presence of the corresponding fungal toxin.
[0108] The sample-level feature vector is input into the toxin concentration regression subnetwork to generate toxin concentration regression results.
[0109] Each element in the toxin concentration regression result represents the predicted concentration value of the corresponding fungal toxin.
[0110] In this embodiment, the toxin concentration regression subnetwork includes:
[0111] For each fungal toxin species to be detected, the sample-level feature vector is multiplied element-wise with the regression weight vector corresponding to the fungal toxin species, and then summed. The regression bias of the fungal toxin species is added to obtain the predicted concentration value of the fungal toxin species. The predicted concentration values of all fungal toxin species are combined in order to form the toxin concentration regression result.
[0112] The sample-level feature vectors are input into the detection uncertainty estimation subnetwork to generate uncertainty estimation results;
[0113] Each element of the uncertainty estimation result is the model prediction uncertainty for the corresponding mycotoxin detection. The classification bias, regression bias, and uncertainty estimation bias are designed according to actual needs.
[0114] In this embodiment, the uncertainty estimation subnetwork includes:
[0115] The sample-level feature vectors are weighted and summed with the uncertainty estimation weight vectors corresponding to each type of mycotoxin to be detected. The uncertainty estimation bias corresponding to the type of mycotoxin is then added. The weighted sum and the bias are input into the Softplus activation function for transformation to obtain the model prediction uncertainty corresponding to the type of mycotoxin.
[0116] The results of toxin presence classification, toxin concentration regression, and uncertainty estimation are combined according to the fungal toxin type to form a multi-task detection result.
[0117] In this embodiment, the toxin presence classification subnetwork includes:
[0118] Each element of the sample-level feature vector is multiplied one-to-one with each element of the classification weight vector corresponding to each fungal toxin species to be detected. All product results are summed element-wise to obtain the weighted sum of each fungal toxin species. The corresponding classification bias is added to form the classification score of each fungal toxin species. The classification score of each fungal toxin species is input into the Sigmoid activation unit to obtain the existence probability of each fungal toxin species. The existence probabilities of all fungal toxin species constitute the toxin existence classification result.
[0119] The calibration module calculates the online reconstruction error index based on the multi-task detection results and the MAE reconstruction residual map, and generates an online calibration trigger signal in combination with environmental parameters. When the online calibration trigger signal meets the preset threshold, the low-order calibration parameters of the ConvNeXtV2 feature enhancement module are updated to generate a calibration model version.
[0120] In this embodiment, the calibration module includes:
[0121] The reconstruction mean square error is obtained by summing the squared differences between the standardized response values of the standardized multimodal biosensor input signal tensors at all time steps of the channel and the standardized response values represented by MAE reconstruction, and then dividing by the number of time steps. The reconstruction mean square errors of all channels are arranged in order to form an online reconstruction error index vector.
[0122] Each element of the online reconstruction error index vector is used to measure the degree of deviation between the current channel's sensing signal and the baseline model.
[0123] Collect environmental parameters for the current sample;
[0124] The environmental parameter vector includes the actual measured physical environmental variables such as temperature, humidity, and dust concentration. Each environmental parameter is expressed as a standard physical quantity, and the environmental parameter represents the current state of the sensor's operating environment.
[0125] The online reconstruction error index vector and the environmental parameter vector are input together into the calibration trigger function, which outputs a calibration trigger scalar.
[0126] The calibration trigger function can be a linear weighted, gated neural network, or other mapping method. The calibration trigger scalar indicates whether the current model needs parameter calibration.
[0127] The calibration trigger scalar is compared with the preset calibration threshold. When the calibration trigger scalar is greater than the preset calibration threshold, it is determined that model self-calibration is required.
[0128] During the model self-calibration process, the current enhanced feature tensor is obtained as the output of the teacher model, and the low-order convolutional layer output feature tensor of the current ConvNeXtV2 feature enhancement module is obtained as the current output of the student model.
[0129] The feature distillation loss is obtained by summing the squared differences between the enhanced feature tensor of the teacher model and the output feature tensor of the low-order convolutional layer of the student model over all channels and all time steps, and then dividing the sum by the product of the number of channels and the time step.
[0130] The low-order calibration parameters of the student model are optimized by gradient descent based on the feature distillation loss, and a new set of low-order calibration parameters is obtained after the update. The optimized set of low-order calibration parameters is used as the low-order parameters of the calibration model version.
[0131] The optimized low-order calibration parameters are equal to the original low-order calibration parameters minus the learning rate multiplied by the gradient of the feature distillation loss with respect to the low-order calibration parameters. After the update, a new set of low-order calibration parameters is obtained.
[0132] The low-order parameters of the calibration model version are saved synchronously and updated in real time to the actual execution link of the edge model to complete the online adaptive calibration operation of the current round.
[0133] Example 2: On the corn receiving quality inspection line of a large grain processing and storage base, the system implementer used the present invention to deploy a multi-channel electrochemical and optical biosensor array to perform fully automated continuous detection of the extract of each batch of grain samples.
[0134] During a nighttime batch warehousing operation, the detection system automatically collected a set of sample data, numbered Sample-A10012, with a data acquisition cycle of 8 seconds. The raw signal data showed that the normalized response value of the electrochemical channel 3 suddenly increased from 0.16 to 0.79 between the 5th and 7th seconds, while the response value of the optical channel 1 fluctuated from 0.08 to 0.61 during the same period. The system detected the short-term surge in the electrochemical channel and the synchronous change in the optical channel, and automatically input all raw signals into the MAE self-supervised reconstruction module.
[0135] The MAE reconstruction residual map showed that the reconstruction residuals of the electrochemical channel 3 and the optical channel 1 at the 6-second mark were 0.47 and 0.42, respectively, which were much higher than the historical baseline average (0.06). The system determined that this channel was in an abnormally high residual range and further decomposed the signal structure by reconstructing and strengthening the characterization of the tensor and dynamic nuclear modulation mechanism.
[0136] After entering the cross-modal attention-enhanced ConvNeXt V2 model, the matching scores of the channel feature vectors with the embedding vectors of zearalenone and ochratoxin were significantly higher than those of other toxins, with attention weight coefficients of 0.46 and 0.39, respectively. The bidirectional cross-modal attention mechanism showed that the weighted influence of the optical channel 1 on the electrochemical channel 3 reached 0.35, and the system output the enhanced feature tensor and input it into the multi-task detection head.
[0137] The multi-task identification network results showed that the probability of zearalenone presence in the sample was 0.94, the predicted concentration was 18.7 ppb, and the model uncertainty was 0.06; the probability of ochratoxin presence was 0.91, the predicted concentration was 12.3 ppb, and the uncertainty was 0.08. The system automatically generated a positive risk report and pushed it to the quality and safety monitoring platform in real time.
[0138] The system continuously monitors the MAE reconstruction residuals and ambient temperature and humidity data of Sample-A10012, and finds that the ambient humidity briefly rises to 82% during the shift. Compared with the historical baseline, the mean square error of online reconstruction for all channels increases from 0.04 to 0.18 within 5 minutes, triggering the calibration trigger function. The calibration trigger scalar reaches 0.37, exceeding the preset threshold of 0.32, and automatically enters the small sample domain adaptive distillation calibration process.
[0139] During the calibration process, the system selects the 24 most recent samples as a small sample set and constructs a feature distillation loss between the teacher model's enhanced feature tensor and the student model's output tensor with the current low-order calibration parameters. The single-round loss value is 0.027. After two rounds of iterative optimization, the calibration parameters converge, the reconstruction mean square error drops back to 0.05, and the detection accuracy of Sample-A10013 and Sample-A10014 recovers to over 98%.
[0140] Compared with the performance of traditional detection systems during the same period, Sample-A10012, using manual feature extraction and fixed threshold method, output a zearalenone concentration of 11.2 ppb, with no detectable ochratoxin, indicating a single toxin positive result. Manual verification revealed a missed detection. Statistical analysis of all samples from the night batch showed that the traditional system had a positive detection rate of 78% and a false alarm rate of 7.9%, while the system of this invention had a positive detection rate of 96.5% and a false alarm rate of 2.1%. The accurate uncertainty estimation aided subsequent retesting, significantly improving monitoring effectiveness.
[0141] During the subsequent 72 hours of fully automated operation, the system detected 11 similar high-risk samples, all of which successfully completed dynamic calibration and accurate identification. All detection anomalies, model self-calibration, concentration regression and uncertainty assessment results were automatically recorded, forming traceable quality control data.
[0142] 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 fungal toxin detection system based on machine learning and biosensors, characterized in that, include: The acquisition module constructs a multimodal biosensor array, acquires the original multimodal biosensor response signals, and performs signal normalization, time alignment, and noise suppression processing to generate standardized multimodal biosensor input signals. The multimodal masking random masking guidance module inputs the standardized multimodal biosensor input signal into the multimodal masking random masking guidance module, performs channel attention-guided random masking on the electrochemical biosensing channel signal and the optical biosensing channel signal, and obtains the masked multimodal biosensor input signal; The multimodal masking autoencoder module performs baseline reconstruction on the input signal of the masked multimodal biosensor, outputs a MAE reconstruction representation and a MAE reconstruction residual map, and performs channel splicing on the MAE reconstruction representation and the MAE reconstruction residual map to generate a reconstruction enhancement characterization tensor. The ConvNeXtV2 feature enhancement module inputs the reconstructed enhanced representation tensor into the ConvNeXtV2 feature enhancement module to obtain the enhanced feature tensor; The multi-task detection module, based on the enhanced feature tensor, uses a multi-task recognition network to generate toxin presence classification results, toxin concentration regression results, and detection uncertainty estimation results, thus forming multi-task detection results. The calibration module calculates the online reconstruction error index based on the multi-task detection results and the MAE reconstruction residual map, and generates an online calibration trigger signal in combination with environmental parameters. When the online calibration trigger signal meets a preset threshold, the low-order calibration parameters of the ConvNeXtV2 feature enhancement module are updated to generate a calibration model version.
2. The mycotoxin detection system based on machine learning and biosensors according to claim 1, characterized in that, The construction of the multimodal biosensor array includes: The multimodal biosensor array consists of electrochemical biosensing channels and optical biosensing channels. The sensitive layers of the electrochemical biosensing channels and optical biosensing channels are modified with aptamers or antibody recognition elements and interface functional materials to generate multi-channel response signals for aflatoxin, zearalenone, vomitoxin, and ochratoxin in grain samples. Through constant flow injection, sample purification, and flow path distribution operations, the grain sample extract flows sequentially through the multimodal biosensor array, and the original multimodal biosensor response signals are collected simultaneously.
3. The mycotoxin detection system based on machine learning and biosensors according to claim 2, characterized in that, The multimodal masking random masking guidance module includes: The standardized multimodal biosensor input signal is represented as a tensor containing the electrochemical biosensing channel signal matrix and the optical biosensing channel signal matrix; A channel attention-guided masking probability function is constructed for tensors, and channel attention-guided masking weights are assigned to each electrochemical biosensing channel and each optical biosensing channel; A distributed random masking mechanism is adopted to randomly mask the signal of each channel of the input tensor at each time step: if the random number of the current time step of the channel is less than the product of the channel attention-guided masking weight and the basic masking rate, the signal of the corresponding channel at the current time step is set to zero; otherwise, it remains unchanged. The tensor obtained after masking is used as the input signal for the masked multimodal biosensor.
4. The mycotoxin detection system based on machine learning and biosensors according to claim 3, characterized in that, The multimodal masking autoencoder module includes: The input signal of the masked multimodal biosensor is represented as a masked multimodal biosensor input signal tensor; The input signal tensor of the masked multimodal biosensor is encoded using a multimodal masked autoencoder to obtain the latent representation tensor; The latent representation tensor is decoded using a multimodal masked autoencoder decoder to obtain the MAE reconstructed representation; The difference between the standardized multimodal biosensor input signal tensor and the MAE reconstructed representation is calculated on the corresponding elements to obtain the MAE reconstructed residual map; The MAE reconstruction representation and the MAE reconstruction residual map are spliced together in the channel dimension to generate the reconstruction enhancement representation tensor.
5. A fungal toxin detection system based on machine learning and biosensors according to claim 4, characterized in that, The ConvNeXtV2 feature enhancement module includes: A global average pooling operation is performed on the reconstructed and enhanced representation tensor in the time dimension to obtain the channel convergence vector; The channel convergence vector is input into the linear transformation unit to obtain the channel feature vector. For each target mycotoxin, a mycotoxin embedding vector is set. The embedding vector of each mycotoxin and the channel feature vector are calculated by the inner product operation. The matching scores of all mycotoxins are normalized to obtain the mycotoxin attention weight vector. Each element of the mycotoxin attention weight vector represents the attention weight coefficient of the corresponding mycotoxin. By using the attention weight coefficients of all mycotoxins, the pointwise convolution kernel weights of each mycotoxin are summed in a weighted manner to generate a kernel modulation matrix. The reconstructed and enhanced representation tensor is combined with the kernel modulation matrix, and a pointwise convolution operation with kernel modulation is performed. After passing through a nonlinear activation unit, the intermediate representation tensor is output. The intermediate representation tensor is divided into electrochemical biological sensing group tensor and optical biological sensing group tensor according to the channel group. The attention weight matrix of electrochemical biological sensing group to optical biological sensing group and optical biological sensing group to electrochemical biological sensing group is calculated by bidirectional cross-modal attention mechanism, and then concatenated in the channel dimension to obtain cross-modal weighted tensor. The cross-modal weighted tensor is input into a multi-scale depth-separable convolutional layer and a channel normalization layer. Convolution is performed with different kernel sizes, strides, and padding. The tensor results after convolution are stacked in the same channel dimension, and channel normalization is performed on the convolution results to output an enhanced feature tensor.
6. The mycotoxin detection system based on machine learning and biosensors according to claim 5, characterized in that, The multi-task detection module includes: Global average pooling is performed on the enhanced feature tensor in the time dimension to obtain sample-level feature vectors; The sample-level feature vectors are input into the toxin presence classification subnetwork in the multi-task recognition network to generate toxin presence classification results. The sample-level feature vector is input into the toxin concentration regression subnetwork to generate toxin concentration regression results. The sample-level feature vectors are input into the detection uncertainty estimation subnetwork to generate uncertainty estimation results; The results of toxin presence classification, toxin concentration regression, and uncertainty estimation are combined according to the fungal toxin type to form a multi-task detection result.
7. A fungal toxin detection system based on machine learning and biosensors according to claim 6, characterized in that, The toxin presence classification subnetwork includes: Each element of the sample-level feature vector is multiplied one-to-one with each element of the classification weight vector corresponding to each fungal toxin species to be detected. All product results are summed element-wise to obtain the weighted sum of each fungal toxin species. The corresponding classification bias is added to form the classification score of each fungal toxin species. The classification score of each fungal toxin species is input into the Sigmoid activation unit to obtain the existence probability of each fungal toxin species. The existence probabilities of all fungal toxin species constitute the toxin existence classification result.
8. A fungal toxin detection system based on machine learning and biosensors according to claim 6, characterized in that, The toxin concentration regression subnetwork includes: For each fungal toxin species to be detected, the sample-level feature vector is multiplied element-wise with the regression weight vector corresponding to the fungal toxin species, and then summed. The regression bias of the fungal toxin species is added to obtain the predicted concentration value of the fungal toxin species. The predicted concentration values of all fungal toxin species are combined in order to form the toxin concentration regression result.
9. A fungal toxin detection system based on machine learning and biosensors according to claim 6, characterized in that, The detection uncertainty estimation subnetwork includes: The sample-level feature vectors are weighted and summed with the uncertainty estimation weight vectors corresponding to each type of mycotoxin to be detected. The uncertainty estimation bias corresponding to the type of mycotoxin is then added. The weighted sum and the bias are input into the Softplus activation function for transformation to obtain the model prediction uncertainty corresponding to the type of mycotoxin.
10. A mycotoxin detection system based on machine learning and biosensors according to claim 6, characterized in that, The calibration module includes: The reconstruction mean square error is obtained by summing the squared differences between the standardized response values of the standardized multimodal biosensor input signal tensors at all time steps of the channel and the standardized response values represented by MAE reconstruction, and then dividing by the number of time steps. The reconstruction mean square errors of all channels are arranged in order to form an online reconstruction error index vector. Collect environmental parameters for the current sample; The online reconstruction error index vector and the environmental parameter vector are input together into the calibration trigger function, which outputs a calibration trigger scalar. The calibration trigger scalar is compared with the preset calibration threshold. When the calibration trigger scalar is greater than the preset calibration threshold, it is determined that model self-calibration is required. During the model self-calibration process, the current enhanced feature tensor is obtained as the output of the teacher model, and the low-order convolutional layer output feature tensor of the current ConvNeXtV2 feature enhancement module is obtained as the current output of the student model. The feature distillation loss is obtained by summing the squared differences between the enhanced feature tensor of the teacher model and the output feature tensor of the low-order convolutional layer of the student model over all channels and all time steps, and then dividing the sum by the product of the number of channels and the time step. The low-order calibration parameters of the student model are optimized by gradient descent based on the feature distillation loss, and a new set of low-order calibration parameters is obtained after the update. The optimized set of low-order calibration parameters is used as the low-order parameters of the calibration model version.
Citation Information
Patent Citations
Mycotoxin six-in-one detection card intelligent interpretation system and method based on multi-dimensional data analysis
CN119418782A
System and method for classifying and identifying epilepsy in electroencephalogram signal based on time sequence
CN120611239A
Method for predicting human carcinogenic toxicity parameters of chemicals based on dynamic weight multitask graph neural network
CN120690324A
Article identification system based on computer vision
CN120747459A
Memory device for repairing a neighborhood of rows in a memory array using a patch table
US20080285365A1