Drug delivery process anomaly detection method based on sea squirt group optimization algorithm
By using a multi-scale anomaly detection model based on a squirt swarm optimization algorithm and an MLP-Mixer fusion network, the challenge of anomaly detection during drug delivery was solved, enabling real-time and accurate anomaly identification and intervention in the drug delivery process, thereby improving the safety and accuracy of the drug delivery system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-04-07
AI Technical Summary
Existing methods for detecting anomalies in drug delivery processes are insufficient to achieve true abnormal path extraction and dynamic process modeling. They are unable to identify abnormal events in drug delivery processes within sub-second time windows or micrometer-level spatial regions, especially sparse and nonlinear anomalies such as carrier aggregation, local leakage, and blood flow reversal.
A multi-scale anomaly detection model was constructed using the tunicate swarm optimization algorithm. By synchronously collecting multimodal signals, a time-space data cube was built. The tunicate swarm optimization algorithm was used to search the structure and the MLP-Mixer fusion network for end-to-end training. Combined with a dynamic freezing strategy and an anomaly focusing mechanism, real-time anomaly detection in the drug delivery process was achieved.
It reduces the false negative rate of low-density anomaly identification, improves the accuracy and real-time performance of anomaly detection during drug delivery, enables the identification of minute anomalies and real-time intervention, and enhances the safety and accuracy of drug delivery systems.
Smart Images

Figure CN121808613A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of drug delivery technology, and in particular to a method for detecting anomalies in the drug delivery process based on a sea squirt swarm optimization algorithm. Background Technology
[0002] With the rapid development of intelligent medical technology, targeted drug delivery systems based on drug-loaded nanoparticles or microspheres have been widely used in the treatment of major diseases such as cancer and vascular diseases. Against this background, dynamic monitoring of the spatial distribution, release path and abnormal state of drugs during delivery has become a core link to ensure the accuracy and safety of treatment. Drug delivery process has significant temporal dynamics and multimodal complexity. Abnormal events, including carrier aggregation, local leakage and blood flow reversal, often only appear in sub-second time windows or micrometer-level spatial regions. Abnormal signals have extremely strong sparsity, nonlinearity and cross-modal interaction characteristics.
[0003] In existing technologies, anomaly detection in drug delivery processes still mainly relies on offline analysis modes based on single-scale image changes, fixed rule judgments, or signal mutation thresholds. There is a lack of a unified spatiotemporal-modal integration framework, making it difficult to achieve true PAT anomaly path extraction and dynamic process modeling. Although some studies have attempted to use convolutional neural networks or attention mechanism models to process multi-source data, their identification of process states is essentially still limited to local classification judgment of discrete frames, and cannot achieve complete path tracking and mechanism tracing of anomalies from occurrence and evolution to pre-intervention. Summary of the Invention
[0004] One objective of this invention is to propose a method for detecting anomalies in drug delivery processes based on an optimization algorithm for tunicate swarms. This invention reduces the average false negative rate in low-density anomaly identification.
[0005] A method for detecting anomalies in drug delivery processes based on a sea squirt swarm optimization algorithm according to an embodiment of the present invention includes the following steps: S1. Simultaneously acquire optical imaging signals, drug concentration signals, and electrochemical detection signals to construct a set of original signals for the multimodal drug delivery process. Perform time alignment, spatial registration, and normalization processing on the set of original signals for the multimodal drug delivery process to generate a time-space data cube for the multimodal drug delivery process. S2. Divide the time-space data cube of the multimodal drug delivery process into a multi-scale patch set according to the preset time window length and spatial receptive field size; S3. Construct the search structure for the sea squirt optimization algorithm, initialize the sea squirt individual population, encode the multi-scale patch set parameter combination, channel embedding dimension and network layer depth for each sea squirt individual, perform drifting, aggregation and fixation iterations in the sea squirt optimization algorithm search structure, construct the fitness function based on the average accuracy of anomaly detection, inference delay and energy consumption, update the sea squirt individual population, and obtain the optimal multi-scale parameter combination; S4. Design a multi-scale residual mixing block based on the optimal multi-scale parameter combination, and embed the multi-scale residual mixing block into the MLP-Mixer backbone network to construct a multi-scale anomaly detection model based on the fusion of the tunicate swarm optimization algorithm and MLP-Mixer. S5. Using a multimodal drug delivery process time-space data cube as training input, the multiscale anomaly detection model based on the fusion of the tunicate swarm optimization algorithm and MLP-Mixer is trained end-to-end to obtain the trained multiscale anomaly detection model. S6. Apply a dynamic freezing strategy to freeze low-contribution channels in the trained multi-scale anomaly detection model to form a fixed multi-scale anomaly detection model. S7. A fixed multi-scale anomaly detection model is used to infer the time-space data cube of the multimodal drug delivery process, outputting anomaly probability distribution map and anomaly confidence score set. Based on the anomaly probability distribution map and anomaly confidence score set, the real-time state analysis of the drug delivery process is performed using PAT. Through the anomaly probability distribution map and anomaly confidence score set output by the fixed multi-scale anomaly detection model, the abnormal spatiotemporal evolution trajectory of the drug delivery process is reconstructed, and the set of abnormal events in the drug delivery process is identified. S8. Input the set of abnormal events in the drug delivery process into the drug delivery control system. The drug delivery control system is a preset existing system that drives the drug delivery device to perform dose adjustment, path replanning or pump shutdown operations, and generates drug delivery adjustment results.
[0006] Optionally, S2 includes the following steps: S21. Construct a multimodal drug delivery process time-space data cube. The multimodal drug delivery process time-space data cube is composed of normalized four-dimensional data, which includes time dimension, spatial horizontal dimension, spatial vertical dimension and modal channel dimension. Each data point represents the normalized signal value of the drug delivery process at a specific time, spatial location and modal channel. S22. Set up a multi-scale segmentation parameter set, which includes multiple time window lengths, multiple spatial lateral receptive field sizes, and multiple spatial longitudinal receptive field sizes. Each set of time window lengths, spatial lateral receptive field sizes, and spatial longitudinal receptive field sizes constitutes a set of scale parameter combinations. The scale parameter combinations are used to guide the multi-scale segmentation operation of the time-space data cube of the drug delivery process. S23. Based on the multi-scale segmentation parameter set, the time-space data cube of the multimodal drug delivery process is slid segmented to obtain a multi-scale patch set. Each multi-scale patch in the multi-scale patch set contains a fixed-length time window, a fixed-size spatial horizontal region, a fixed-size spatial vertical region, and a complete modal channel structure. Each multi-scale patch in the multi-scale patch set retains the local expressive power of the original time-space features. S24. Set the time sliding step, the spatial horizontal sliding step, and the spatial vertical sliding step. The time sliding step, the spatial horizontal sliding step, and the spatial vertical sliding step are used to control the sliding granularity of the multi-scale patch in the time dimension, the spatial horizontal dimension, and the spatial vertical dimension, respectively. The sliding step is less than or equal to the minimum receptive field of the corresponding dimension, so that there are local overlapping areas between the multi-scale patches. The local overlapping areas are used to enhance the coverage and recognition of small anomalies in the anomaly detection process. S25. Assign a scale label vector to each multiscale patch in the multiscale patch set. The scale label vector consists of the time window length, spatial horizontal receptive field size, and spatial vertical receptive field size corresponding to the multiscale patch. The scale label vector is used to identify the scale characteristics of the patch.
[0007] Optionally, S3 includes the following steps: S31. Construct the search structure for the sea squirt optimization algorithm, setting the total number of sea squirt individuals to be [value missing]. Initialize the population of tunicates, with each tunicate represented as a parameter vector. ,in Indicates the first The combination of multi-scale patch parameters selected for each individual sea squirt This indicates the channel embedding dimension, expressed in terms of the number of channels. This indicates the layer depth of the MLP-Mixer network, in layers. This represents the individual ID, and the initialization range is set based on the training resource boundaries and modeling resolution requirements. S32. The drift phase of the tunic swarm optimization algorithm is executed. During the drift phase, all tunic individuals update their parameter vectors in the global search space through a high-dimensional uniform random drift. The drift process is expressed as follows: ; in, Indicates the first The first individual sea squirt was in the... The parameter vector in the next iteration. For the drift step length factor, For the current iteration The drift direction vector of an individual sea squirt, with each dimension of the drift direction vector randomly sampled within its domain; S33. Execute the aggregation phase of the tunic swarm optimization algorithm. In the aggregation phase, all tunic individuals undergo guided convergence based on fitness and affinity. The convergence method is expressed as follows: ; in, This is the aggregation convergence rate factor. Indicates the first The parameter vector of the tunicate individual with the highest fitness in the next iteration; S34. Constructing the fitness function The fitness function integrates the average accuracy of anomaly detection, inference latency, and model energy consumption. ; in, Indicates by the first The average anomaly detection accuracy of the model trained with parameter combinations encoding individual sea squirts on the validation set. This represents the average inference time of the corresponding model. For the maximum acceptable inference delay, This represents the average power consumption of the model during each inference iteration. For the maximum acceptable power consumption, , , These are the weighting coefficients corresponding to the three evaluation indicators; S35. Execute the fixation phase of the tunicate swarm optimization algorithm. During the fixation phase, if the change in the fitness function is less than a preset threshold in consecutive iterations... At that time, the low-contribution parameter dimensions of each individual sea squirt are frozen, and the freezing rule is: if Then freeze the parameter vector. For dimensions whose changes are below a fixed threshold, the parameter vector is frozen and remains unchanged in subsequent iterations. The freezing operation is used to achieve convergence stability and reduce computational burden. Indicates the first In the nth iteration The fitness function value corresponding to each individual sea squirt The fitness change threshold; S36. Perform multiple drifting, aggregation, and fixation iterations on all tunicate individuals, and after each iteration, base the results on the fitness function. Update the individual population until the maximum number of iterations or the fitness convergence condition is met, and output the optimal parameter vector. ,in For the optimal multi-scale patch parameter combination, For the optimal channel embedding dimension, This represents the optimal network layer depth.
[0008] Optionally, S4 includes the following steps: S41. Construct a multi-scale residual mixing block with scale awareness and anomaly focusing mechanism. The multi-scale residual mixing block consists of a scale awareness token mixing sublayer and anomaly focusing channel mixing sublayer. The scale awareness token mixing sublayer uses a scale adaptive attention mechanism to fuse abnormal correlation information of drug delivery process at different scales and outputs a scale awareness mixing feature tensor. The scale awareness mixing feature tensor is used to capture abnormal dynamic changes of drug-loaded nanoparticles in different scale windows. S42. Calculate the scale-aware weight matrix in the scale-aware token hybrid sublayer. Scale-aware weight matrix The weights of feature channels and spatial locations that exhibit high anomalous probability during drug delivery are determined by the global anomalous activation level of each scale label vector in the current multi-scale patch set and the anomalous feature tensor of the drug delivery process at the corresponding scale. S43. The output scale-aware hybrid feature tensor of the scale-aware token hybrid sublayer is used as the input of the anomaly-focusing channel hybrid sublayer. The anomaly-focusing channel hybrid sublayer calculates the channel anomaly confidence score vector. Anomaly importance is evaluated for each channel in the scale-aware mixed feature tensor, resulting in a channel anomaly confidence score vector. The ratio of the variance of abnormal features in each channel to the overall variance of features in the drug delivery process is obtained by calculating the ratio of the variance of abnormal features in each channel to the variance of features in the overall drug delivery process. This ratio is used to adaptively adjust the weight of the feature channels and highlight key information that is directly related to abnormal events in the drug delivery process. S44. Scale-aware weight matrix Channel anomaly confidence score vector The co-modulated drug delivery process anomaly focusing mechanism recalibrates the scale-aware hybrid feature tensor input to the hybrid sublayer of the anomaly focusing channel to generate anomaly focusing feature tensor. The anomaly focusing feature tensor is used to more accurately distinguish key abnormal events such as abnormal aggregation of drug-loaded nanoparticles, local leakage, and blood flow reversal in anomalous signals of drug delivery process at different scales. S45. Optimize the multi-scale residual mixing block with the optimal network layer depth. Stacking them together forms an MLP-Mixer backbone network that integrates scale perception and anomaly focusing mechanisms, outputting a multi-scale anomaly detection model for the drug delivery process.
[0009] Optionally, S5 includes the following steps: S51. Construct a multimodal drug delivery process training dataset, which consists of multiple drug delivery process time-space data cubes. The composition of each sample includes a normalized representation of optical imaging signals, drug concentration signals, and electrochemical detection signals, among which... Indicates the length of the time frame. , These represent the horizontal and vertical resolutions of the space, respectively. This indicates the number of modal channels, expressed in channel count. Number the sample; S52. Construct a set of labels for abnormal events in the drug delivery process corresponding to the training dataset. ,in Indicates the first Each sample in the time index Spatial Index If an abnormal event exists, the value is 0; otherwise, it is used to supervise the generation and optimization of abnormal probabilities during training. S53. An MLP-Mixer backbone network integrating scale awareness and anomaly focusing mechanisms is used as the structure of the multi-scale anomaly detection model, with the input being a cube of time-space data of the drug delivery process. The output is an anomaly probability graph. Anomaly probability maps are used to predict the spatiotemporal anomaly distribution probability of the drug delivery process; S54. Constructing the Anomaly Detection Supervision Loss Function The anomaly detection supervised loss function is based on the difference between the anomaly probability map of each sample and its corresponding label: ; in, This indicates that the multi-scale anomaly detection model is applicable to the first... One sample in the index Anomaly probability map prediction at the location; S55. A dynamic anomaly weight adjustment mechanism is introduced during training, and the anomaly weight coefficient is calculated based on the sparsity of the anomaly region distribution in each batch of samples. : ; in, For weighted loss function, Indicates the first The abnormal sparsity weight of each sample, the larger the value, the sparser the abnormal distribution, which is used to amplify the intensity of the supervision signal in weak abnormal areas during training and improve the ability of the multi-scale anomaly detection model to identify local leakage and drug-loaded nanoparticle aggregation sparse anomalies. S56. Introduce a structure regularization term during training. This is used to constrain the static channels in the multi-scale anomaly detection model parameters, which are determined by the fixation and freezing mechanism, from participating in the update: ; in, This represents the set of parameters for the frozen channel. Indicates the first The gradient of the parameters of each frozen channel, and the regularization term are used to prevent backpropagation updates of frozen channels, thereby improving the structural stability and inference efficiency of the multi-scale anomaly detection model. S57. Weighted loss function With structure regularization term By combining these elements, we can construct the final training objective function: ; in, Freeze the coefficients of the regularization term; S58. Based on the final training objective function The multi-scale anomaly detection model that integrates optimized parameter configuration of sea squirt swarms with multi-scale residual hybrid blocks is trained end-to-end until the loss function converges or the set number of rounds is reached, and the trained multi-scale anomaly detection model is output.
[0010] Optionally, S6 includes the following steps: S61. Extract the set of channel feature response tensors for all network layers in the trained multi-scale anomaly detection model. For each layer, embed features at the channel level for all multi-scale patches, where Indicates the network layer number. The dimension is ,in For the number of patches, Embedded dimension for channel; S62. Calculate the channel contribution of all channels in each layer to the anomaly detection performance in the drug delivery process. The channel contribution is expressed as the ratio of the variance of the channel's characteristic response in the abnormal region to the variance of its characteristic response in the normal region, where... This represents the channel number. If a channel has a strong response in the abnormal region and a weak response in the normal region, its contribution is relatively high. This value is used to measure the channel's ability to detect anomalies. S63. Set the channel freeze threshold. The channel freeze threshold is used to determine the minimum allowable value of a channel contribution in a specified network layer. If the value is less than the channel freezing threshold, the channel is identified as a low contribution channel, and its layer and channel index are added to the frozen channel set. S64. Construct a dynamic freeze mask matrix. The dynamic freeze mask matrix is a binary vector used to identify whether each channel is frozen. If a channel is in the frozen channel set, the mask value is set to 0, indicating that the channel will no longer participate in subsequent calculations. If a channel is not in the frozen channel set, the mask value is set to 1, indicating that the channel is retained and active. The freeze mask matrix is used to clear the feature response values of low contribution channels to zero during inference, thereby reducing the inference computation of the multi-scale anomaly detection model. S65. During network training and fine-tuning, the set of frozen channels is registered into the multi-scale anomaly detection model structure. If the backpropagation of the multi-scale anomaly detection model involves frozen channels during training, the gradient value of the corresponding channel is forcibly set to zero. That is, all parameters corresponding to the frozen channel do not participate in gradient updates. The rule ensures that after the structure is fixed, low-contribution channels in the multi-scale anomaly detection model are no longer activated or tuned, thereby improving the stability of the structure and saving computational resources in the training and inference stages. S66. Output a fixed multi-scale anomaly detection model after dynamic freezing. The fixed multi-scale anomaly detection model has the characteristics of simplified channel structure, reduced inference energy consumption and improved stability. It can be directly deployed in the drug delivery process for real-time detection of various abnormal events such as nanodrug aggregation, blood flow reversal and local leakage.
[0011] Optionally, S7 includes the following steps: S71. Input the time-space data cube of the multimodal drug delivery process into the fixed multi-scale anomaly detection model, and obtain the anomaly probability distribution map output by the model. The anomaly probability distribution map is represented as follows: A higher probability of anomaly indicates that the area is more likely to experience abnormal drug delivery events at the corresponding time. S72. Synchronously output the set of anomaly confidence scores, which is represented as a set of spatially aggregated confidence score vectors arranged in chronological order. ,in Indicates the first The overall anomaly confidence of the frame across all spatial locations is calculated by... The anomaly probability distribution map corresponding to the frame is spatially weighted and averaged, with the unit being normalized probability score, which is used to measure the overall anomaly risk intensity of the current frame. S73. Extract the set of abnormal events in the drug delivery process based on the abnormal probability distribution map and the set of abnormal confidence scores. The set of abnormal events in the drug delivery process is a set of abnormal event area information, including abnormal type, occurrence time, spatial location and confidence score. S74. Output a set of abnormal events in the drug delivery process. The set of abnormal events in the drug delivery process consists of abnormal patterns in the reasoning results that have practical intervention significance.
[0012] Optionally, the abnormal event is classified according to the following rules: When the probability of anomalies in a certain region within a continuous time frame Furthermore, the region exhibits a high-density clustering distribution in space, which is identified as an abnormal aggregation event of drug-loaded nanoparticles. When a certain area has scattered but high probability values of abnormality within a spatial range greater than the threshold, and is accompanied by short-term abrupt changes in electrochemical signal channels, it is determined to be a local leakage abnormality event. When a certain region has a strip structure in space, and the corresponding time frame confidence score Furthermore, the drug concentration signal suddenly dropped, which was determined to be an abnormal event of blood flow reversal.
[0013] Optionally, the real-time status analysis of the drug delivery process using PAT specifically includes: Optical imaging signals are used to capture spatial morphological changes of drug carriers, drug concentration signals are used to monitor the stability of delivery flux, and electrochemical detection signals are used to sense sudden changes in the flow field of the microenvironment. When optical imaging signals show spatial aggregation but the drug concentration signal does not decrease, it is determined to be a physical aggregation process. When the electrochemical detection signal shows a short-term abrupt change and is accompanied by a high probability of abnormality in a local area, it is determined to be a microstructural leakage process. By verifying the interaction of multimodal signals, artifact interference under single mode is eliminated, and the true abnormal state of the drug delivery process is established.
[0014] Optionally, the real-time status analysis of the drug delivery process via PAT also includes analyzing the abnormal dynamic evolution mechanism of the drug delivery process: Based on the anomaly probability distribution map of continuous time frames, construct the spatiotemporal flow field vector of the anomaly region; Track the migration path and diffusion rate of abnormal areas within the spatial sensing domain, and calculate the process invasiveness index of abnormal events; If the process invasiveness index shows a divergent trend over time, a high-level warning will be triggered. If the process invasiveness index converges within a preset time, it is determined to be a process adaptive fluctuation, and the pump stop operation is not triggered.
[0015] The beneficial effects of this invention are: (1) This invention proposes a joint search mechanism for tunicate swarm optimization and multi-scale configuration for drug delivery anomalies, which dynamically adapts the receptive field size and model structure depth, solving the problem that traditional fixed receptive field networks are difficult to capture micro-scale anomalies. By constructing a tunicate swarm optimization algorithm search structure, the anomaly detection accuracy, inference delay and energy consumption in the drug delivery process are used as joint fitness functions for multi-objective search. The multi-scale patch parameter combination, channel embedding dimension and network layer depth are optimized. Through the three-stage collaborative mechanism of drift-aggregation-fixation, the algorithm suppresses premature convergence while ensuring global search capability. Finally, an MLP-Mixer network configuration adapted to different anomaly densities and spatial scales is constructed, and the average false negative rate is reduced in low-density anomaly identification.
[0016] (2) This invention designs a multi-scale residual mixing block that integrates scale perception and anomaly focusing mechanism to guide MLP-Mixer to achieve information extraction and localization at the level of abnormal path in cross-modal space, significantly improving the modeling ability and spatial accuracy of weak signals. Based on the original MLP-Mixer architecture, a scale perception token mixing sublayer and anomaly focusing channel mixing sublayer are introduced: the former calculates the scale weight matrix based on the multi-scale label vector of drug delivery and dynamically guides the network to focus on significant abnormal changes in different receptive fields, while the latter reconstructs the characteristic channel response through the channel anomaly confidence vector, effectively improving the response accuracy to local leakage and abnormal carrier aggregation areas.
[0017] (3) The present invention introduces a dynamic freezing strategy to realize the structural compression and energy consumption control of the multi-scale anomaly detection model after fixation, improve the practicality and continuous reasoning ability of the model in edge deployment, judge the importance of the channel according to the anomaly correlation evaluation index, construct the frozen channel set and generate the channel mask matrix to realize channel-level reasoning compression, and prevent structural degradation after training through regularization constraint terms. Attached Figure Description
[0018] 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: Figure 1 This is a flowchart of a method for detecting anomalies in drug delivery based on an optimization algorithm for sea squirt swarms, as proposed in this invention. Detailed Implementation
[0019] Example 1
[0020] refer to Figure 1 A method for detecting anomalies in drug delivery processes based on an optimization algorithm for sea squirt swarms includes the following steps: S1. Simultaneously acquire optical imaging signals, drug concentration signals, and electrochemical detection signals to construct a set of original signals for the multimodal drug delivery process. Perform time alignment, spatial registration, and normalization processing on the set of original signals for the multimodal drug delivery process to generate a time-space data cube for the multimodal drug delivery process. S2. Divide the time-space data cube of the multimodal drug delivery process into a multi-scale patch set according to the preset time window length and spatial receptive field size; S3. Construct the search structure for the sea squirt optimization algorithm, initialize the sea squirt individual population, encode the multi-scale patch set parameter combination, channel embedding dimension and network layer depth for each sea squirt individual, perform drifting, aggregation and fixation iterations in the sea squirt optimization algorithm search structure, construct the fitness function based on the average accuracy of anomaly detection, inference delay and energy consumption, update the sea squirt individual population, and obtain the optimal multi-scale parameter combination; S4. Design a multi-scale residual mixing block based on the optimal multi-scale parameter combination, and embed the multi-scale residual mixing block into the MLP-Mixer backbone network to construct a multi-scale anomaly detection model based on the fusion of the tunicate swarm optimization algorithm and MLP-Mixer. S5. Using a multimodal drug delivery process time-space data cube as training input, the multiscale anomaly detection model based on the fusion of the tunicate swarm optimization algorithm and MLP-Mixer is trained end-to-end to obtain the trained multiscale anomaly detection model. S6. Apply a dynamic freezing strategy to freeze low-contribution channels in the trained multi-scale anomaly detection model to form a fixed multi-scale anomaly detection model. S7. A fixed multi-scale anomaly detection model is used to infer the time-space data cube of the multimodal drug delivery process, outputting anomaly probability distribution map and anomaly confidence score set. Based on the anomaly probability distribution map and anomaly confidence score set, the real-time state analysis of the drug delivery process is performed using PAT. Through the anomaly probability distribution map and anomaly confidence score set output by the fixed multi-scale anomaly detection model, the abnormal spatiotemporal evolution trajectory of the drug delivery process is reconstructed, and the set of abnormal events in the drug delivery process is identified. S8. Based on the identified set of abnormal events in the drug delivery process, a process quality feedback control loop is constructed. The abnormality type and confidence score are mapped to the control command of the drug delivery device, which drives the drug delivery device to perform dynamic dose compensation, delivery path replanning or emergency pump stop operation, thereby realizing closed-loop steady-state regulation of the drug delivery process.
[0021] In this embodiment, S2 includes the following steps: S21. Construct a multimodal drug delivery process time-space data cube. The multimodal drug delivery process time-space data cube is composed of normalized four-dimensional data, which includes time dimension, spatial horizontal dimension, spatial vertical dimension and modal channel dimension. Each data point represents the normalized signal value of the drug delivery process at a specific time, spatial location and modal channel. S22. Set up a multi-scale segmentation parameter set, which includes multiple time window lengths, multiple spatial lateral receptive field sizes, and multiple spatial longitudinal receptive field sizes. Each set of time window lengths, spatial lateral receptive field sizes, and spatial longitudinal receptive field sizes constitutes a set of scale parameter combinations. The scale parameter combinations are used to guide the multi-scale segmentation operation of the time-space data cube of the drug delivery process. S23. Based on the multi-scale segmentation parameter set, the time-space data cube of the multimodal drug delivery process is slid segmented to obtain a multi-scale patch set. Each multi-scale patch in the multi-scale patch set contains a fixed-length time window, a fixed-size spatial horizontal region, a fixed-size spatial vertical region, and a complete modal channel structure. Each multi-scale patch in the multi-scale patch set retains the local expressive power of the original time-space features. S24. Set the time sliding step, the spatial horizontal sliding step, and the spatial vertical sliding step. The time sliding step, the spatial horizontal sliding step, and the spatial vertical sliding step are used to control the sliding granularity of the multi-scale patch in the time dimension, the spatial horizontal dimension, and the spatial vertical dimension, respectively. The sliding step is less than or equal to the minimum receptive field of the corresponding dimension, so that there are local overlapping areas between the multi-scale patches. The local overlapping areas are used to enhance the coverage and recognition of small anomalies in the anomaly detection process. S25. Assign a scale label vector to each multiscale patch in the multiscale patch set. The scale label vector consists of the time window length, spatial horizontal receptive field size, and spatial vertical receptive field size corresponding to the multiscale patch. The scale label vector is used to identify the scale characteristics of the patch.
[0022] In this embodiment, S3 includes the following steps: S31. Construct the search structure for the sea squirt optimization algorithm, setting the total number of sea squirt individuals to be [value missing]. Initialize the population of tunicates, with each tunicate represented as a parameter vector. ,in Indicates the first The combination of multi-scale patch parameters selected for each individual sea squirt This indicates the channel embedding dimension, expressed in terms of the number of channels. This indicates the layer depth of the MLP-Mixer network, in layers. This represents the individual ID, and the initialization range is set based on the training resource boundaries and modeling resolution requirements. S32. The drift phase of the tunic swarm optimization algorithm is executed. During the drift phase, all tunic individuals update their parameter vectors in the global search space through a high-dimensional uniform random drift. The drift process is expressed as follows: ; in, Indicates the first The first individual sea squirt was in the... The parameter vector in the next iteration. For the drift step length factor, For the current iteration The drift direction vector of an individual sea squirt, with each dimension of the drift direction vector randomly sampled within its domain; S33. Execute the aggregation phase of the tunic swarm optimization algorithm. In the aggregation phase, all tunic individuals undergo guided convergence based on fitness and affinity. The convergence method is expressed as follows: ; in, This is the aggregation convergence rate factor. Indicates the first The parameter vector of the tunicate individual with the highest fitness in the next iteration; S34. Constructing the fitness function The fitness function integrates the average accuracy of anomaly detection, inference latency, and model energy consumption. ; in, Indicates by the first The average anomaly detection accuracy of the model trained with parameter combinations encoding individual sea squirts on the validation set. This represents the average inference time of the corresponding model. For the maximum acceptable inference delay, This represents the average power consumption of the model during each inference iteration. For the maximum acceptable power consumption, , , These are the weighting coefficients corresponding to the three evaluation indicators; S35. Execute the fixation phase of the tunicate swarm optimization algorithm. During the fixation phase, if the change in the fitness function is less than a preset threshold in consecutive iterations... At that time, the low-contribution parameter dimensions of each individual sea squirt are frozen, and the freezing rule is: if Then freeze the parameter vector. For dimensions whose changes are below a fixed threshold, the parameter vector is frozen and remains unchanged in subsequent iterations. The freezing operation is used to achieve convergence stability and reduce computational burden. Indicates the first In the nth iteration The fitness function value corresponding to each individual sea squirt The fitness change threshold; S36. Perform multiple drifting, aggregation, and fixation iterations on all tunicate individuals, and after each iteration, base the results on the fitness function. Update the individual population until the maximum number of iterations or the fitness convergence condition is met, and output the optimal parameter vector. ,in For the optimal multi-scale patch parameter combination, For the optimal channel embedding dimension, This represents the optimal network layer depth.
[0023] In this embodiment, S4 includes the following steps: S41. Construct a multi-scale residual mixing block with scale awareness and anomaly focusing mechanism. The multi-scale residual mixing block consists of a scale awareness token mixing sublayer and anomaly focusing channel mixing sublayer. The scale awareness token mixing sublayer uses a scale adaptive attention mechanism to fuse abnormal correlation information of drug delivery process at different scales and outputs a scale awareness mixing feature tensor. The scale awareness mixing feature tensor is used to capture abnormal dynamic changes of drug-loaded nanoparticles in different scale windows. S42. Calculate the scale-aware weight matrix in the scale-aware token hybrid sublayer. Scale-aware weight matrix The weights of feature channels and spatial locations that exhibit high anomalous probability during drug delivery are determined by the global anomalous activation level of each scale label vector in the current multi-scale patch set and the anomalous feature tensor of the drug delivery process at the corresponding scale. S43. The output scale-aware hybrid feature tensor of the scale-aware token hybrid sublayer is used as the input of the anomaly-focusing channel hybrid sublayer. The anomaly-focusing channel hybrid sublayer calculates the channel anomaly confidence score vector. Anomaly importance is evaluated for each channel in the scale-aware mixed feature tensor, resulting in a channel anomaly confidence score vector. The ratio of the variance of abnormal features in each channel to the overall variance of features in the drug delivery process is obtained by calculating the ratio of the variance of abnormal features in each channel to the variance of features in the overall drug delivery process. This ratio is used to adaptively adjust the weight of the feature channels and highlight key information that is directly related to abnormal events in the drug delivery process. S44. Scale-aware weight matrix Channel anomaly confidence score vector The co-modulated drug delivery process anomaly focusing mechanism recalibrates the scale-aware hybrid feature tensor input to the hybrid sublayer of the anomaly focusing channel to generate anomaly focusing feature tensor. The anomaly focusing feature tensor is used to more accurately distinguish key abnormal events such as abnormal aggregation of drug-loaded nanoparticles, local leakage, and blood flow reversal in anomalous signals of drug delivery process at different scales. S45. Optimize the multi-scale residual mixing block with the optimal network layer depth. Stacking them together forms an MLP-Mixer backbone network that integrates scale perception and anomaly focusing mechanisms, outputting a multi-scale anomaly detection model for the drug delivery process.
[0024] In this embodiment, S5 includes the following steps: S51. Construct a multimodal drug delivery process training dataset, which consists of multiple drug delivery process time-space data cubes. The composition of each sample includes a normalized representation of optical imaging signals, drug concentration signals, and electrochemical detection signals, among which... Indicates the length of the time frame. , These represent the horizontal and vertical resolutions of the space, respectively. This indicates the number of modal channels, expressed in channel count. Number the sample; S52. Construct a set of labels for abnormal events in the drug delivery process corresponding to the training dataset. ,in Indicates the first Each sample in the time index Spatial Index If an abnormal event exists, the value is 0; otherwise, it is used to supervise the generation and optimization of abnormal probabilities during training. S53. An MLP-Mixer backbone network integrating scale awareness and anomaly focusing mechanisms is used as the structure of the multi-scale anomaly detection model, with the input being a cube of time-space data of the drug delivery process. The output is an anomaly probability graph. Anomaly probability maps are used to predict the spatiotemporal anomaly distribution probability of the drug delivery process; S54. Constructing the Anomaly Detection Supervision Loss Function The anomaly detection supervised loss function is based on the difference between the anomaly probability map of each sample and its corresponding label: ; in, This indicates that the multi-scale anomaly detection model is applicable to the first... One sample in the index Anomaly probability map prediction at the location; S55. A dynamic anomaly weight adjustment mechanism is introduced during training, and the anomaly weight coefficient is calculated based on the sparsity of the anomaly region distribution in each batch of samples. : ; in, For weighted loss function, Indicates the first The abnormal sparsity weight of each sample, the larger the value, the sparser the abnormal distribution, which is used to amplify the intensity of the supervision signal in weak abnormal areas during training and improve the ability of the multi-scale anomaly detection model to identify local leakage and drug-loaded nanoparticle aggregation sparse anomalies. S56. Introduce a structure regularization term during training. This is used to constrain the static channels in the multi-scale anomaly detection model parameters, which are determined by the fixation and freezing mechanism, from participating in the update: ; in, This represents the set of parameters for the frozen channel. Indicates the first The gradient of the parameters of each frozen channel, and the regularization term are used to prevent backpropagation updates of frozen channels, thereby improving the structural stability and inference efficiency of the multi-scale anomaly detection model. S57. Weighted loss function With structure regularization term By combining these elements, we can construct the final training objective function: ; in, Freeze the coefficients of the regularization term; S58. Based on the final training objective function The multi-scale anomaly detection model that integrates optimized parameter configuration of sea squirt swarms with multi-scale residual hybrid blocks is trained end-to-end until the loss function converges or the set number of rounds is reached, and the trained multi-scale anomaly detection model is output.
[0025] In this embodiment, S6 includes the following steps: S61. Extract the set of channel feature response tensors for all network layers in the trained multi-scale anomaly detection model. For each layer, embed features at the channel level for all multi-scale patches, where Indicates the network layer number. The dimension is ,in For the number of patches, Embedded dimension for channel; S62. Calculate the channel contribution of all channels in each layer to the anomaly detection performance in the drug delivery process. The channel contribution is expressed as the ratio of the variance of the channel's characteristic response in the abnormal region to the variance of its characteristic response in the normal region, where... This represents the channel number. If a channel has a strong response in the abnormal region and a weak response in the normal region, its contribution is relatively high. This value is used to measure the channel's ability to detect anomalies. S63. Set the channel freeze threshold. The channel freeze threshold is used to determine the minimum allowable value of a channel contribution in a specified network layer. If the value is less than the channel freezing threshold, the channel is identified as a low contribution channel, and its layer and channel index are added to the frozen channel set. S64. Construct a dynamic freeze mask matrix. The dynamic freeze mask matrix is a binary vector used to identify whether each channel is frozen. If a channel is in the frozen channel set, the mask value is set to 0, indicating that the channel will no longer participate in subsequent calculations. If a channel is not in the frozen channel set, the mask value is set to 1, indicating that the channel is retained and active. The freeze mask matrix is used to clear the feature response values of low contribution channels to zero during inference, thereby reducing the inference computation of the multi-scale anomaly detection model. S65. During network training and fine-tuning, the set of frozen channels is registered into the multi-scale anomaly detection model structure. If the backpropagation of the multi-scale anomaly detection model involves frozen channels during training, the gradient value of the corresponding channel is forcibly set to zero. That is, all parameters corresponding to the frozen channel do not participate in gradient updates. The rule ensures that after the structure is fixed, low-contribution channels in the multi-scale anomaly detection model are no longer activated or tuned, thereby improving the stability of the structure and saving computational resources in the training and inference stages. S66. Output a fixed multi-scale anomaly detection model after dynamic freezing. The fixed multi-scale anomaly detection model has the characteristics of simplified channel structure, reduced inference energy consumption and improved stability. It can be directly deployed in the drug delivery process for real-time detection of various abnormal events such as nanodrug aggregation, blood flow reversal and local leakage.
[0026] In this embodiment, S7 includes the following steps: S71. Input the time-space data cube of the multimodal drug delivery process into the fixed multi-scale anomaly detection model, and obtain the anomaly probability distribution map output by the model. The anomaly probability distribution map is represented as follows: A higher probability of anomaly indicates that the area is more likely to experience abnormal drug delivery events at the corresponding time. S72. Synchronously output the set of anomaly confidence scores, which is represented as a set of spatially aggregated confidence score vectors arranged in chronological order. ,in Indicates the first The overall anomaly confidence of the frame across all spatial locations is calculated by... The anomaly probability distribution map corresponding to the frame is spatially weighted and averaged, with the unit being normalized probability score, which is used to measure the overall anomaly risk intensity of the current frame. S73. Extract the set of abnormal events in the drug delivery process based on the abnormal probability distribution map and the set of abnormal confidence scores. The set of abnormal events in the drug delivery process is a set of abnormal event area information, including abnormal type, occurrence time, spatial location and confidence score. S74. Output a set of abnormal events in the drug delivery process. The set of abnormal events in the drug delivery process consists of abnormal patterns in the reasoning results that have practical intervention significance.
[0027] In this implementation, the category of an abnormal event is determined according to the following rules: When the probability of anomalies in a certain region within a continuous time frame Furthermore, the region exhibits a high-density clustering distribution in space, which is identified as an abnormal aggregation event of drug-loaded nanoparticles. When a certain area has scattered but high probability values of abnormality within a spatial range greater than the threshold, and is accompanied by short-term abrupt changes in electrochemical signal channels, it is determined to be a local leakage abnormality event. When a certain region has a strip structure in space, and the corresponding time frame confidence score Furthermore, the drug concentration signal suddenly dropped, which was determined to be an abnormal event of blood flow reversal.
[0028] In this embodiment, the real-time status analysis of the drug delivery process using PAT specifically includes: Optical imaging signals are used to capture spatial morphological changes of drug carriers, drug concentration signals are used to monitor the stability of delivery flux, and electrochemical detection signals are used to sense sudden changes in the flow field of the microenvironment. When optical imaging signals show spatial aggregation but the drug concentration signal does not decrease, it is determined to be a physical aggregation process. When the electrochemical detection signal shows a short-term abrupt change and is accompanied by a high probability of abnormality in a local area, it is determined to be a microstructural leakage process. By verifying the interaction of multimodal signals, artifact interference under single mode is eliminated, and the true abnormal state of the drug delivery process is established.
[0029] In this embodiment, the real-time status analysis of the drug delivery process via PAT also includes analyzing the abnormal dynamic evolution mechanism of the drug delivery process: Based on the anomaly probability distribution map of continuous time frames, construct the spatiotemporal flow field vector of the anomaly region; Track the migration path and diffusion rate of abnormal areas within the spatial sensing domain, and calculate the process invasiveness index of abnormal events; If the process invasiveness index shows a divergent trend over time, a high-level warning will be triggered. If the process invasiveness index converges within a preset time, it is determined to be a process adaptive fluctuation, and the pump stop operation is not triggered.
[0030] Example 2
[0031] In operating room No. 5 of the interventional center at Hospital A, doctors performed transcatheter arterial chemoembolization on a 68-year-old male liver cancer patient. During the process of delivering drug-loaded nanospheres to the blood supply artery of the right lobe of the liver via the catheter, the system of this invention was connected to the system to monitor abnormal events during the drug delivery process in real time.
[0032] After the surgery began, the system received three types of synchronous data inputs: a 60fps intraoperative fluorescence imaging stream, a 200Hz drug concentration curve, and flow velocity electrical signals acquired by a microelectrode array. These signals constituted a temporal-spatial multimodal data cube with a 1-second window. This data was segmented into multi-scale patches of size 32×32×15 and used for real-time inference through a previously trained post-fixation multi-scale anomaly detection model.
[0033] The system detected a persistent, irregular, high-intensity spot in a small area of the right middle lobe of the liver in the fluorescence image. The probability of the system identifying this area as abnormal exceeded 0.82 consecutively between frame indices 37 and 41, peaking at 0.91 in frame 39. Simultaneously, the electrical signal in the corresponding frame exhibited continuous fluctuations within 13 ms, with an amplitude 1.74 times higher than the average amplitude of the previous 15 frames, and the local gradient of the concentration channel abnormally increased to 1.9 times the original baseline.
[0034] In the channel anomaly confidence score vector calculated by the anomaly focusing mechanism in frame 38, channel 7 (corresponding to the voltage change channel) scored 0.87. Based on this, the system determined the event to be an abnormal drug carrier aggregation and output the coordinates of the abnormal region as (h=214–245, w=172–205), with a time period of frames 37–41 (approximately 0.08 seconds). An anomaly event report was automatically generated and pushed to the main control terminal. At the same time, the system confidence threshold was adjusted through a reinforcement learning feedback mechanism, and a temporary pause mechanism for the drug injection device was triggered.
[0035] Upon receiving the notification, the doctor immediately examined the area under DSA imaging and confirmed that there was significant contrast agent retention in the area, confirming the system's accurate identification. The doctor then manually adjusted the catheter position and injection rate, and the abnormal area gradually subsided, with the image signal returning to stability.
[0036] In a later stage of the same surgery, the system detected a long, strip-shaped abnormal flow structure in the S4 region of the left lobe of the liver. The average probability of this abnormality was 0.79 between frames 83 and 89, and the structure exhibited directional stretching characteristics. The corresponding flow velocity signal dropped sharply by more than 42% in frame 85, while the concentration signal showed bidirectional jumps. The system identified this as a blood flow reversal abnormality using a spatial anisotropy recognition module. The anomaly scoring report showed that the abnormal path length was approximately 21 pixels, corresponding to an actual anatomical length of 6.3 mm, and the path origin did not match the direction of the arterial inlet.
[0037] The system automatically reports a blood flow reversal warning based on the continuity and confidence score (the highest confidence point reaches 0.89) of the anomaly on the anomaly probability map. The anomaly path coordinate sequence is as follows: Frame 83: (h=101–116, w=274–285); Frame 84: (h=103–117, w=265–280); Frame 85: (h=104–119, w=253–270); Based on this, the doctor immediately administered a local vasoconstrictor injection, successfully controlling the blood flow and restoring its direction.
[0038] To evaluate system performance, a comparative analysis was conducted postoperatively with a traditional convolutional model. Key performance indicators for both methods were statistically analyzed in five surgical cases involving identifiable abnormal events. The data are as follows: Table 1. Comparative Analysis of the Invention and Traditional Convolutional Models Exception types Case Number This invention identifies time Confidence score of this invention Traditional Confidence Scoring Positioning deviation (mm) of this invention Deviation of traditional method (mm) Nano-aggregates TACE-2024-019 0.32 seconds 0.91 0.67 1.4 5.7 Blood flow reversal TACE-2024-024 0.21 seconds 0.89 0.58 2.1 6.9 Local leakage TACE-2024-027 0.36 seconds 0.86 0.62 2.8 4.3 Furthermore, the test results show that, across all test frames, the average false negative rate of the model of this invention is 3.2%, while that of the traditional method is 15.8%. The inference latency of the model of this invention is controlled at 41ms / frame, while that of the traditional method is 76ms / frame. The false positive rate (FPR) of the model of this invention is as low as 4.5%, while that of the traditional method is 11.2%.
[0039] This embodiment verifies that the present invention possesses the following capabilities in real intraoperative scenarios: (1) accurate detection of abnormal events with high spatiotemporal resolution; (2) dynamic tracking and modeling of weak abnormal paths; and (3) low-latency real-time inference and equipment linkage control. Through a complete closed-loop process of anomaly identification—event output—equipment control—effect feedback, the safety and precision control capabilities of intraoperative drug delivery are significantly improved.
[0040] 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 anomalies in drug delivery processes based on an optimization algorithm for sea squirt swarms, characterized in that, Includes the following steps: S1. Construct the original signal set of the multimodal drug delivery process and preprocess it to generate a time-space data cube of the multimodal drug delivery process; S2. Divide the time-space data cube of the multimodal drug delivery process into a multi-scale patch set according to the preset time window length and spatial receptive field size; S3. Construct the search structure of the sea squirt optimization algorithm. Encode the multi-scale patch set parameter combination, channel embedding dimension and network layer depth for each sea squirt individual. Construct a fitness function based on the average accuracy of anomaly detection, inference latency and energy consumption to obtain the optimal multi-scale parameter combination. S4. Design a multi-scale residual mixing block based on the optimal multi-scale parameter combination, and embed the multi-scale residual mixing block into the MLP-Mixer backbone network to construct a multi-scale anomaly detection model based on the fusion of the tunicate swarm optimization algorithm and MLP-Mixer. S5. End-to-end training is performed on the multi-scale anomaly detection model based on the fusion of the tunic group optimization algorithm and MLP-Mixer to obtain the trained multi-scale anomaly detection model. S6. Apply a dynamic freezing strategy to freeze low-contribution channels in the trained multi-scale anomaly detection model to form a fixed multi-scale anomaly detection model. S7. A fixed multi-scale anomaly detection model is used to infer the time-space data cube of the multimodal drug delivery process, and PAT real-time status analysis is performed on the drug delivery process. By using the anomaly probability distribution map and anomaly confidence score set output by the fixed multi-scale anomaly detection model, the anomaly spatiotemporal evolution trajectory in the drug delivery process is reconstructed, and the set of abnormal events in the drug delivery process is identified. S8. Based on the identified set of abnormal events in the drug delivery process, a process quality feedback control loop is constructed. The abnormality type and confidence score are mapped to the control command of the drug delivery device, which drives the drug delivery device to perform dynamic dose compensation, delivery path replanning or emergency pump stop operation, thereby realizing closed-loop steady-state regulation of the drug delivery process.
2. The method for detecting anomalies in drug delivery processes based on a sea squirt swarm optimization algorithm according to claim 1, characterized in that, S2 includes the following steps: S21. Construct a time-space data cube for multimodal drug delivery process. The time-space data cube for multimodal drug delivery process consists of normalized four-dimensional data, which includes time dimension, spatial horizontal dimension, spatial vertical dimension and modal channel dimension. S22. Set up a multi-scale segmentation parameter set, which includes multiple time window lengths, multiple spatial lateral receptive field sizes, and multiple spatial longitudinal receptive field sizes. Each set of time window lengths, spatial lateral receptive field sizes, and spatial longitudinal receptive field sizes together constitutes a set of scale parameter combinations. S23. Sliding segmentation of the time-space data cube of the multimodal drug delivery process is performed according to the multi-scale segmentation parameter set to obtain a multi-scale patch set. Each multi-scale patch in the multi-scale patch set contains a time window of fixed length, a spatial horizontal region of fixed size, a spatial vertical region of fixed size, and a complete modal channel structure. S24. Set the time sliding step, the spatial horizontal sliding step, and the spatial vertical sliding step; S25. Assign a scale label vector to each multiscale patch in the multiscale patch set.
3. The method for detecting anomalies in drug delivery based on a sea squirt swarm optimization algorithm according to claim 2, characterized in that, S3 includes the following steps: S31. Construct the search structure for the sea squirt optimization algorithm, setting the total number of sea squirt individuals to be [value missing]. Initialize the population of tunicates, with each tunicate represented as a parameter vector. ,in Indicates the first The combination of multi-scale patch parameters selected for each individual sea squirt Indicates the channel embedding dimension. Indicates the depth of the MLP-Mixer network layers. Indicates the individual ID; S32. Execute the drift phase of the tunic group optimization algorithm. During the drift phase, all tunic individuals update their parameter vectors in the global search space by high-dimensional uniform random drift. S33. Execute the aggregation phase of the tunic swarm optimization algorithm. In the aggregation phase, all tunic individuals undergo guided convergence based on fitness and affinity. S34. Constructing the fitness function The fitness function integrates the average accuracy of anomaly detection, inference latency, and model energy consumption. S35. During the fixation phase of the tunicate swarm optimization algorithm, when the change in the fitness function during consecutive iterations is less than a preset threshold... At that time, the low-contribution parameter dimensions of each individual sea squirt are frozen, and the freezing rule is: if Then freeze the parameter vector. The dimensions whose change is below a fixed threshold are included. Indicates the first In the nth iteration The fitness function value corresponding to each individual sea squirt The fitness change threshold; S36. Perform multiple drifting, aggregation, and fixation iterations on all tunicate individuals, and after each iteration, base the results on the fitness function. Update the individual population until the maximum number of iterations or the fitness convergence condition is met, and output the optimal parameter vector. ,in For the optimal multi-scale patch parameter combination, For the optimal channel embedding dimension, This represents the optimal network layer depth.
4. The method for detecting anomalies in drug delivery processes based on a sea squirt swarm optimization algorithm according to claim 3, characterized in that, S4 includes the following steps: S41. Construct a multi-scale residual mixing block with scale awareness and anomaly focusing mechanism. The multi-scale residual mixing block consists of a scale awareness token mixing sub-layer and anomaly focusing channel mixing sub-layer. The scale awareness token mixing sub-layer uses a scale adaptive attention mechanism to fuse abnormal correlation information of drug delivery process at different scales and outputs a scale awareness mixing feature tensor. S42. Calculate the scale-aware weight matrix in the scale-aware token hybrid sublayer. Scale-aware weight matrix It is jointly determined by the global anomalous activation level of the label vector of each scale in the current multi-scale patch set and the anomalous feature tensor of the drug delivery process at the corresponding scale. S43. Use the output scale-aware hybrid feature tensor of the scale-aware token hybrid sublayer as the input of the anomaly-focusing channel hybrid sublayer; S44. Scale-aware weight matrix Channel anomaly confidence score vector The co-modulated drug delivery process anomaly focusing mechanism recalibrates the scale-aware hybrid feature tensor input to the hybrid sublayer of the anomaly focusing channel by weight recalibrating, and generates anomaly focusing feature tensor. S45. Optimize the multi-scale residual mixing block with the optimal network layer depth. Stacking them together forms an MLP-Mixer backbone network that integrates scale perception and anomaly focusing mechanisms, outputting a multi-scale anomaly detection model for the drug delivery process.
5. The method for detecting anomalies in drug delivery processes based on a sea squirt swarm optimization algorithm according to claim 4, characterized in that, S5 includes the following steps: S51. Construct a multimodal drug delivery process training dataset, which consists of multiple drug delivery process time-space data cubes. The composition of each sample includes a normalized representation of optical imaging signals, drug concentration signals, and electrochemical detection signals, among which... Indicates the length of the time frame. , These represent the horizontal and vertical resolutions of the space, respectively. Indicates the number of modal channels. Number the sample; S52. Construct a set of labels for abnormal events in the drug delivery process corresponding to the training dataset. ,in Indicates the first Each sample in the time index Spatial Index If an abnormal event exists, the value is 0; otherwise, the value is 0. S53. An MLP-Mixer backbone network integrating scale awareness and anomaly focusing mechanisms is used as the structure of the multi-scale anomaly detection model, with the input being a cube of time-space data of the drug delivery process. The output is an anomaly probability graph. ; S54. Constructing the Anomaly Detection Supervision Loss Function The anomaly detection supervised loss function is based on the difference between the anomaly probability map of each sample and its corresponding label; S55. A dynamic anomaly weight adjustment mechanism is introduced during training, and the anomaly weight coefficient is calculated based on the sparsity of the anomaly region distribution in each batch of samples. ; S56. Introduce a structure regularization term during training. This is used to constrain the static channels in the multi-scale anomaly detection model parameters, which are determined by the fixation and freezing mechanism, from participating in the update. S57. Weighted loss function With structure regularization term The weighted combination is used to construct the final training objective function. ; S58. Based on the final training objective function The multi-scale anomaly detection model that integrates optimized parameter configuration of sea squirt swarms with multi-scale residual hybrid blocks is trained end-to-end until the loss function converges or the set number of rounds is reached, and the trained multi-scale anomaly detection model is output.
6. The method for detecting anomalies in drug delivery based on a sea squirt swarm optimization algorithm according to claim 5, characterized in that, S6 includes the following steps: S61. Extract the set of channel feature response tensors for all network layers in the trained multi-scale anomaly detection model. Embed features at the channel level for all multi-scale patches in each layer; S62. Calculate the channel contribution of all channels in each layer to the anomaly detection performance in the drug delivery process. The channel contribution is expressed as the ratio of the characteristic response variance of a channel in the abnormal region to its characteristic response variance in the normal region, where... Indicates the channel number; S63. Set the channel freeze threshold. The channel freeze threshold is used to determine the minimum allowable value of a channel contribution in a specified network layer. If the value is less than the channel freezing threshold, the channel is identified as a low contribution channel, and its layer and channel index are added to the frozen channel set. S64. Construct a dynamic freeze mask matrix. The dynamic freeze mask matrix is a binary vector used to identify whether each channel is frozen. If a channel is in the frozen channel set, the mask value is set to 0, indicating that the channel will no longer participate in subsequent calculations. If a channel is not in the frozen channel set, the mask value is set to 1, indicating that the channel remains active. S65. During network training and fine-tuning, the set of frozen channels is registered into the multi-scale anomaly detection model structure. If the backpropagation of the multi-scale anomaly detection model involves frozen channels during training, the gradient value of the corresponding channel is forcibly set to zero, that is, all parameters corresponding to the frozen channel do not participate in gradient updates. S66. Output the fixed multi-scale anomaly detection model after dynamic freezing.
7. The method for detecting anomalies in drug delivery processes based on a sea squirt swarm optimization algorithm according to claim 6, characterized in that, S7 includes the following steps: S71. Input the time-space data cube of the multimodal drug delivery process into the fixed multi-scale anomaly detection model and obtain the anomaly probability distribution map output by the model; S72. Synchronously output the set of anomaly confidence scores, which is represented as a set of spatially aggregated confidence score vectors arranged in chronological order. ,in Indicates the first The overall anomaly confidence of the frame across all spatial locations; S73. Extract the set of abnormal events in the drug delivery process based on the abnormal probability distribution map and the set of abnormal confidence scores. The set of abnormal events in the drug delivery process is a set of abnormal event area information, including abnormal type, occurrence time, spatial location and confidence score. S74. Output a set of abnormal events in the drug delivery process. The set of abnormal events in the drug delivery process consists of abnormal patterns in the reasoning results that have practical intervention significance.
8. The method for detecting anomalies in drug delivery based on a sea squirt swarm optimization algorithm according to claim 7, characterized in that, The abnormal event is classified according to the following rules: When the probability of anomalies in a certain region within a continuous time frame Furthermore, the region exhibits a high-density clustering distribution in space, which is identified as an abnormal aggregation event of drug-loaded nanoparticles. When a certain area has scattered but high probability values of abnormality within a spatial range greater than a threshold, and is accompanied by short-term abrupt changes in electrochemical signal channels, it is determined to be a local leakage abnormality event. When a certain region has a strip structure in space, and the corresponding time frame confidence score Furthermore, the drug concentration signal suddenly dropped, which was determined to be an abnormal event of blood flow reversal.
9. The method for detecting anomalies in drug delivery processes based on a sea squirt swarm optimization algorithm according to claim 1, characterized in that, The PAT real-time status analysis of the drug delivery process specifically includes: Optical imaging signals are used to capture spatial morphological changes of drug carriers, drug concentration signals are used to monitor the stability of delivery flux, and electrochemical detection signals are used to sense sudden changes in the flow field of the microenvironment. When optical imaging signals show spatial aggregation but the drug concentration signal does not decrease, it is determined to be a physical aggregation process. When the electrochemical detection signal shows a short-term abrupt change and is accompanied by a high probability of abnormality in a local area, it is determined to be a microstructural leakage process. By verifying the interaction of multimodal signals, artifact interference under single mode is eliminated, and the true abnormal state of the drug delivery process is established.
10. The method for detecting anomalies in drug delivery processes based on a sea squirt swarm optimization algorithm according to claim 1, characterized in that, The PAT real-time status analysis of the drug delivery process also includes the analysis of the abnormal dynamic evolution mechanism of the drug delivery process: Based on the anomaly probability distribution map of continuous time frames, construct the spatiotemporal flow field vector of the anomaly region; Track the migration path and diffusion rate of abnormal areas within the spatial sensing domain, and calculate the process invasiveness index of abnormal events; If the process invasiveness index shows a divergent trend over time, a high-level warning will be triggered. If the process invasiveness index converges within a preset time, it is determined to be a process adaptive fluctuation, and the pump stop operation is not triggered.