Medical reagent validity period intelligent monitoring method based on artificial intelligence

By introducing semantic modal labels and multi-channel embedding strategies, a two-stage collaborative optimization framework and hierarchical diffusion modeling, the problems of poor information fusion capability and single feature weight adjustment in the expiration date detection of medical reagents are solved, and efficient identification and accurate prediction of life cycle changes are achieved.

CN120766901AInactive Publication Date: 2025-10-10YINGTAN MATERNAL & CHILD HEALTH HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510869754.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-10-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing methods for detecting the shelf life of medical reagents have poor multimodal information fusion capabilities, a single feature weight adjustment mechanism, difficulty in adapting to the complexity of information changes during the life cycle, inability to effectively distinguish long-term trends from short-term fluctuations, and poor graph neural network propagation strategies, resulting in low prediction accuracy and limited semantic expression capabilities.

Method used

Semantic modal labels such as environment, behavior and state are introduced, and a multi-channel vector representation is constructed by combining principal component analysis and multi-channel embedding strategy; a two-stage collaborative optimization framework is constructed to adaptively adjust feature weights; STL sequence decomposition technology and multi-scale GRU model are introduced to distinguish long-term and short-term changes; a heterogeneous graph is constructed to explicitly represent semantic connection relationships, and a hierarchical diffusion modeling mechanism is used to realize the layer-by-layer evolution and fusion of life cycle information.

Benefits of technology

It improves the semantic coverage of lifecycle data, enhances the ability to identify and fit different change forms, and improves the global consistency and accuracy of predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120766901A_ABST
    Figure CN120766901A_ABST
Patent Text Reader

Abstract

The invention relates to the field of medical information processing, in particular to a medical reagent validity period intelligent monitoring method based on artificial intelligence, which comprises the steps of data acquisition, construction of an input feature sequence, graph embedding generation based on a feature matrix, validity period prediction and continuous optimization. A multi-channel vector representation fusing static and dynamic information is constructed in combination with principal component analysis and a multi-channel embedding strategy, and the semantic coverage capability of life cycle data is improved from the source; weight factors of various semantic features in an attention mechanism are adaptively adjusted by constructing a double-stage collaborative optimization framework, and cross-modal information aggregation quality is improved; an STL sequence decomposition technology is introduced, a fused semantic feature time sequence is split into a trend term, a period term and a residual term, a multi-scale GRU model is constructed to achieve independent modeling, and the recognition and fitting ability of the model to different life cycle change forms is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical information processing, and specifically to an intelligent monitoring method for the validity period of medical reagents based on artificial intelligence. Background Art

[0002] With the development of informatization and intelligence in the medical industry, the management of medical reagents has gradually shifted from manual registration and static labeling to automatic monitoring and intelligent prediction. However, the existing reagent expiration date detection method has the problem of poor multimodal information fusion capability. The expiration date is only calculated based on static information such as the factory date and the opening time, ignoring multimodal dynamic factors such as the environment, usage behavior and reagent status, resulting in incomplete life cycle modeling and low prediction accuracy. At present, in the process of modeling factors such as environment and behavior, fixed or manually set feature weights are often used, which makes it difficult to automatically adjust the importance of various factors according to actual data. There is a problem of a single reagent feature weight adjustment mechanism, which is difficult to adapt to information changes in the reagent life cycle. The complexity leads to low efficiency of information fusion; the existing prediction methods are based on complete feature sequence modeling, which cannot effectively distinguish long-term trends and short-term fluctuations in the reagent life cycle, which easily makes it difficult for the prediction model to focus on the key changes in the life cycle, affecting the overall judgment accuracy; there is a problem of insufficient utilization of feature semantic relationships in the reagent life cycle modeling process, and the graph structure relationship between the various factors of the reagent life cycle is not explicitly constructed in the representation layer, resulting in limited semantic expression capabilities of downstream prediction models; at the same time, although some existing solutions have introduced graph neural networks to assist in analyzing the life cycle, their propagation strategy is shallow and cannot achieve aggregation and abstraction of life cycle information at different scales, which is not conducive to long-term deployment. Summary of the Invention

[0003] In view of the above, in order to overcome the defects of the prior art, the present application provides an intelligent monitoring method for the effective period of medical reagents based on artificial intelligence. In view of the poor multi-modal information fusion capability, the present application introduces environmental, behavioral and state semantic modal labels, combines principal component analysis and multi-channel embedding strategy, and constructs a multi-channel vector representation that fuses static and dynamic information, thereby improving the semantic coverage capability of life cycle data from the source; in view of the single reagent feature weight adjustment mechanism, the present application constructs a two-stage collaborative optimization framework, uses candidate weight generation, behavior evaluation driving, structure disturbance guidance and collaborative screening mechanism to adaptively adjust the weight factors of various semantic features in the attention mechanism, and improves the cross-modal information aggregation quality; in order to solve the problem of distinguishing long-term trends and short-term fluctuations in the life cycle, the present application introduces STL sequence decomposition technology, splits the fused semantic feature time sequence into trend items, periodic items and residual items, and respectively constructs multi-scale GRU models to realize independent modeling, thereby enhancing the recognition and fitting capability of the model to different life cycle change patterns; in view of the problem of missing reagent life cycle semantic structure, the present application constructs a heterogeneous graph for the enhanced high-order time sequence feature, explicitly represents the semantic connection relationship between the features, and realizes deep semantic modeling through the bidirectional aggregation mechanism of entity nodes and relationship nodes, thereby improving the life cycle structure expression; in view of the poor propagation strategy of graph neural network, the present application introduces a hierarchical diffusion modeling mechanism based on graph embedding, constructs a multi-stage feature propagation path, realizes layer-by-layer evolution and fusion of life cycle information in the graph through local aggregation and global guidance strategy, and enhances the global consistency of feature representation and prediction.

[0004] The technical scheme adopted by the present application is as follows: the intelligent monitoring method for the effective period of medical reagents based on artificial intelligence provided by the present application comprises the following steps:

[0005] Step S1: data acquisition, collecting reagent information data, environmental data and use data, structuring the information field, and obtaining a life cycle data set;

[0006] Step S2: constructing an input feature sequence, performing principal component analysis on the life cycle data set, embedding semantic modal labels as bias information, the semantic modal labels including environment, behavior and state, constructing a multi-channel embedding vector sequence, and obtaining a feature matrix;

[0007] Step S3: based on the feature matrix, introducing an attention mechanism to fuse multi-modal semantic information, combining STL sequence decomposition and multi-scale GRU modeling to learn high-order time sequence features, and constructing a heterogeneous graph taking structure-enhanced representation as an entity node and a semantic modal label as a relationship node;

[0008] Step S4: graph embedding generation, generating an overall graph embedding vector using a readout operation based on the heterogeneous graph obtained in step S3, and the readout operation adopts a global pooling strategy.

[0009] Step S5: Validity period prediction: constructing a validity period prediction model based on the overall graph embedding vector to obtain a prediction result vector;

[0010] Step S6: Continuously optimize and periodically calibrate the feature construction parameters in step S2 and the parameters in the validity period prediction model in step S5.

[0011] Furthermore, step S3 specifically includes the following steps:

[0012] Step S31: semantic fusion, introducing the attention mechanism combined with progressive noise reduction technology to perform cross-modal feature fusion modeling on the multi-channel embedding vector sequence, designing a two-stage collaborative optimization framework to adjust the weight factor in the attention mechanism, and outputting the fused semantic feature time series;

[0013] Step S32: sequence decomposition, using the STL algorithm to decompose the fused semantic feature time series to obtain three types of subsequences, including trend terms, period terms, and residual terms;

[0014] Step S33: Multi-scale trend modeling, constructing three sets of multi-scale GRU networks, independently modeling the three types of subsequences, and outputting three sets of preliminary time series feature representations, including trend modeling output, period modeling output, and residual modeling output;

[0015] Step S34: perturbation enhancement, constructing a counterfactual generator in each multi-scale GRU network, performing perturbation enhancement, and obtaining three sets of enhanced time series representations;

[0016] Step S35: Time series feature fusion, fusing the three sets of enhanced time series representations obtained in step S34 through cascade splicing to obtain a structurally enhanced time series high-order representation;

[0017] Step S36: Construct a heterogeneous graph, decompose the structure-enhanced temporal high-order representation into semantic dimensions as entity nodes, and semantic modal labels as relationship nodes, and connect entity nodes and relationship nodes as edges;

[0018] Step S37: Entity node update: aggregate the relationship nodes adjacent to each entity node and update the entity node;

[0019] Step S38: updating the relationship nodes, aggregating the entity nodes adjacent to each relationship node, and updating the relationship nodes;

[0020] Step S39: Graph embedding output, outputting the updated heterogeneous graph.

[0021] Furthermore, in step S31, a two-stage collaborative optimization framework is designed to adjust the weight factors in the attention mechanism, which specifically includes the following steps:

[0022] Step S311: candidate weight generation, set the initial weight solution space, including weight vector individual, calculate the cross-channel statistical covariance matrix of the multi-channel embedding vector sequence, fuse the structure prior and the noise disturbance mechanism, generate the candidate solution individual set;

[0023] Step S312: attention adaptation evaluation, embed the attention mechanism module for each candidate solution individual, aggregate the features of the multi-channel embedding vector sequence through the attention weighting mechanism, and construct the candidate solution behavior evaluation matrix by calculating the representation ability evaluation index;

[0024] Step S313: behavior-driven update, according to the candidate solution behavior evaluation matrix, introduce a dynamic behavior guidance mechanism, adaptively adjust the feature selection direction, update step and local disturbance range of the candidate solution individual, and obtain the reconstructed individual set ;

[0025] Step S314: structure-guided reconstruction mechanism, construct a gradient disturbance vector using the cross-channel covariance matrix, perform individual mutation operation, and obtain the reconstructed individual set ;

[0026] Step S315: double-path collaborative screening, merging the reconstructed individual set and , construct a joint candidate set, calculate the attention weighted feature aggregation result for each candidate solution individual in the joint candidate set, select a scoring function for scoring and sorting, and select the top candidate solution individuals as the optimal solution set according to the sorting;

[0027] Step S316: convergence judgment, set the convergence condition, iterate steps S313-S315 until the convergence condition is reached, output the optimal candidate solution individual as the final weight factor.

[0028] Further, step S5 specifically includes the following steps:

[0029] Step S51: graph feature coding, input the overall-based graph embedding vector into the coding network, the coding network is composed of convolution structure units composed of deep separable convolution layers and weight normalization mechanisms, perform multi-scale feature extraction, and obtain graph embedding high-order feature representation;

[0030] Step S52: diffusion modeling, use a diffusion model as a basic architecture to construct an effective period prediction model, input the graph embedding high-order feature representation, and obtain a prediction result vector;

[0031] Step S53: Extract key indicators, extract indicator information based on the prediction result vector, including the validity period interval boundary value, life cycle trend direction, fluctuation range indicator and threshold discriminant function output.

[0032] Furthermore, step S52 specifically includes the following steps:

[0033] Step S521: Initialize the hierarchical mapping, perform multi-scale division on the graph embedding high-order feature representation, construct a layer-by-layer propagation path, set the feature propagation state of each layer, and initialize the feature state matrix;

[0034] Step S522: Stage feature evolution, using a layer-by-layer evolution strategy. In each propagation stage, the feature state evolution results are extracted through local aggregation and global guidance mechanisms to obtain a multi-stage intermediate state set.

[0035] Step S523: Feature integration and reconstruction: constructing a feature fusion path based on a multi-stage state set, introducing a cross-layer connection strategy, and performing cascade splicing and weighted synthesis on the outputs of each stage to obtain a fused feature representation;

[0036] Step S524: The result generates a mapping, and the fused feature representation is input into the regression calculation unit to obtain a prediction result vector.

[0037] The beneficial effects achieved by the present invention using the above scheme are as follows:

[0038] (1) To address the problem of poor multimodal information fusion capabilities, this paper introduces semantic modal labels such as environment, behavior, and state, combines principal component analysis with a multi-channel embedding strategy, and constructs a multi-channel vector representation that integrates static and dynamic information, thereby improving the semantic coverage capability of lifecycle data from the source;

[0039] (2) To address the problem of a single reagent feature weight adjustment mechanism, the present invention constructs a two-stage collaborative optimization framework, which uses candidate weight generation, behavior evaluation drive, structural perturbation guidance, and collaborative screening mechanisms to adaptively adjust the weight factors of various semantic features in the attention mechanism, thereby improving the quality of cross-modal information aggregation;

[0040] (3) To solve the problem of distinguishing long-term trends from short-term fluctuations in the life cycle, this paper introduces the STL sequence decomposition technology to split the fused semantic feature time series into trend terms, period terms, and residual terms, and constructs multi-scale GRU models for independent modeling, thereby enhancing the model's ability to identify and fit different life cycle change patterns;

[0041] (4) To address the problem of missing semantic structure of reagent life cycle, the present invention constructs a heterogeneous graph based on the enhanced high-order temporal features, explicitly represents the semantic connection relationship between features, and realizes deep semantic modeling through a bidirectional aggregation mechanism of entity nodes and relationship nodes, thereby improving the expressiveness of the life cycle structure;

[0042] (5) To address the problem of poor propagation strategy of graph neural networks, this paper introduces a hierarchical diffusion modeling mechanism based on graph embedding, constructs a multi-stage feature propagation path, and realizes the layer-by-layer evolution and fusion of lifecycle information in the graph through local aggregation and global guidance strategies, thereby enhancing the global consistency of feature representation and prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a schematic diagram of the process of the artificial intelligence-based intelligent monitoring method for the expiration date of medical reagents provided by the present invention.

[0044] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION

[0045] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0046] In the description of the present invention, it should be understood that terms such as "upper", "lower", "front", "back", "left", "right", "top", "bottom", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, they should not be understood as limiting the present invention.

[0047] Example 1, see Figure 1 The present invention provides an artificial intelligence-based intelligent monitoring method for the validity period of medical reagents, which includes the following steps:

[0048] Step S1: Data collection, collecting reagent information data, environmental data and usage data, structuring the information fields, and obtaining a life cycle data set;

[0049] Step S2: Construct an input feature sequence, perform principal component analysis on the lifecycle dataset, embed semantic modal labels as bias information. Semantic modal labels include environment, behavior, and state, construct a multi-channel embedding vector sequence, and obtain a feature matrix.

[0050] Step S3: Based on the feature matrix, an attention mechanism is introduced to fuse multimodal semantic information. STL sequence decomposition and multi-scale GRU modeling are combined to learn high-order temporal features, and a heterogeneous graph is constructed with structural enhancement representations as entity nodes and semantic modality labels as relationship nodes.

[0051] Step S4: Graph embedding generation. Based on the heterogeneous graph obtained in step S3, a readout operation is used to generate the overall graph embedding vector. The readout operation adopts a global pooling strategy.

[0052] Step S5: Validity period prediction: constructing a validity period prediction model based on the overall graph embedding vector to obtain a prediction result vector;

[0053] Step S6: Continuously optimize and periodically calibrate the feature construction parameters in step S2 and the parameters in the validity period prediction model in step S5.

[0054] Embodiment 2, based on the above embodiment, step S3 specifically includes the following steps:

[0055] Step S31: semantic fusion, introducing the attention mechanism combined with progressive noise reduction technology to perform cross-modal feature fusion modeling on the multi-channel embedding vector sequence, designing a two-stage collaborative optimization framework to adjust the weight factor in the attention mechanism, and outputting the fused semantic feature time series;

[0056] Step S32: sequence decomposition, using the STL algorithm to decompose the fused semantic feature time series to obtain three types of subsequences, including trend terms, period terms, and residual terms;

[0057] Step S33: Multi-scale trend modeling, constructing three sets of multi-scale GRU networks, independently modeling the three types of subsequences, and outputting three sets of preliminary time series feature representations, including trend modeling output, period modeling output, and residual modeling output;

[0058] Step S34: perturbation enhancement, constructing a counterfactual generator in each multi-scale GRU network, performing perturbation enhancement, and obtaining three sets of enhanced time series representations;

[0059] Step S35: Time series feature fusion, fusing the three sets of enhanced time series representations obtained in step S34 through cascade splicing to obtain a structurally enhanced time series high-order representation;

[0060] Step S36: Construct a heterogeneous graph, decompose the structure-enhanced temporal high-order representation into semantic dimensions as entity nodes, and semantic modal labels as relationship nodes, and connect entity nodes and relationship nodes as edges;

[0061] Step S37: Entity node update: aggregate the relationship nodes adjacent to each entity node and update the entity node;

[0062] Step S38: updating the relationship nodes, aggregating the entity nodes adjacent to each relationship node, and updating the relationship nodes;

[0063] Step S39: Graph embedding output, outputting the updated heterogeneous graph.

[0064] In this example, a total of 6,450 reagent usage records from the pharmacy department of a tertiary general hospital between January 2023 and March 2024 were selected, covering 41 reagent categories, including the following fields:

[0065] Reagent information data: type, batch, production date, specifications, manufacturer;

[0066] Environmental data: storage temperature (0~40℃), relative humidity (20%~90%), and light exposure;

[0067] Usage data: time of first activation, frequency of use, unit dose, opening time, usage status label (e.g., "within 7 days after opening", "completed use");

[0068] Temperature, humidity and light are normalized and embedded into environmental channel vectors;

[0069] Use BERT to embed agent labels and state labels as semantic behavior channels;

[0070] Construct a three-channel embedding vector sequence, each record dimension is T × 64, T represents the time step, 64 is the total channel dimension;

[0071] Initialize the weight solution space and generate 50 sets of candidate weight vectors (dimension 64);

[0072] Introducing the BOA+SITSO fusion optimization strategy, setting the maximum iteration step to 50, integrating gradient perturbation and behavior guidance mechanism;

[0073] The characterization ability score (reverse-calculated by the reagent degradation curve prediction error RMSE) was used as the scoring indicator;

[0074] Output the optimal weighted fusion result to form a fusion semantic feature time series;

[0075] Use the STL algorithm to decompose the fused feature sequence into three types of subsequences:

[0076] Trend items;

[0077] Periodic items;

[0078] Residual term;

[0079] The dimension of each subsequence is kept as T×64;

[0080] Construct a 3-layer GRU network for each type of sequence:

[0081] Number of layers: 3 layers (window sizes are 5 days, 15 days, and 30 days respectively);

[0082] Output dimension: T×32 output per category, three categories in total;

[0083] Build the counterfactual generator:

[0084] The original input vector "temperature + 1°C", "humidity + 5%", and "unsealing time 2 days in advance" are used as disturbances;

[0085] Inject disturbances before model prediction and observe the changes in time series output;

[0086] Use KL divergence to control the perturbation amplitude and select the output after perturbation enhancement;

[0087] The three groups of GRU outputs are combined into a group of structure-enhanced features by splicing:

[0088] The output dimension is T×96;

[0089] Dimension compression is performed through 1×1 convolution, and the final output is T×64;

[0090] Node settings:

[0091] Entity node: 64 feature dimensions;

[0092] Relationship nodes: 3 types of semantic modal labels (environment, behavior, state) × 3 keywords per type, a total of 9 relationship nodes;

[0093] Edge establishment basis: semantic channel ownership and field index mapping.

[0094] Figure update:

[0095] Use GAT network for bidirectional information propagation, update node representation, and iterate 2 layers.

[0096] Activation function: LeakyReLU;

[0097] Aggregation strategy: attention weighted summation;

[0098] Use global pooling (average pooling) to extract the final graph embedding;

[0099] The output is a global graph vector of 1×128, which serves as the input of the validity period prediction model.

[0100] Example 3: This example is based on the above example. In step S31, a two-stage collaborative optimization framework is designed to adjust the weight factors in the attention mechanism. Specifically, the following steps are included:

[0101] Step S311: Candidate weight generation, setting the initial weight solution space, including individual weight vectors, calculating the cross-channel statistical covariance matrix of the multi-channel embedding vector sequence, integrating the structural prior and the noise perturbation mechanism, and generating a set of candidate solution individuals;

[0102] Step S312: Attention adaptation evaluation: embed each candidate solution into an attention mechanism module, perform feature aggregation on the multi-channel embedding vector sequence through the attention weighting mechanism, and construct a candidate solution behavior evaluation matrix by calculating the representation ability evaluation index;

[0103] Step S313: Behavior driven update, based on the candidate solution behavior evaluation matrix, introduces a dynamic behavior guidance mechanism, and adaptively adjusts the feature selection direction, update step size and local disturbance range of the candidate solution individual to obtain the reconstructed individual set ;

[0104] Step S314: The structure-guided reconstruction mechanism uses the cross-channel covariance matrix to construct a gradient perturbation vector, performs individual mutation operations, and obtains a reconstructed individual set. ;

[0105] Step S315: Dual-path collaborative screening, merging and reconstructing individual sets and , build a joint candidate set, calculate the attention weighted feature aggregation result for each candidate solution in the joint candidate set, select the scoring function for scoring and sorting, and select the top candidate solution according to the sorting. The candidate solution individuals are regarded as the optimal solution set;

[0106] Step S316: Convergence judgment, set the convergence condition, iterate steps S313-S315 until the convergence condition is reached, and output the optimal candidate solution individual as the final weight factor.

[0107] In this example, the usage records of "insulin injection" reagents in the hospital's intelligent drug storage system are selected as the modeling object. When performing multimodal modeling on the environmental behavior embedding vector sequence, it is necessary to dynamically adjust the weight factor in the attention module to improve the model's ability to recognize weak patterns. The data dimensions are:

[0108] Input embedding vector sequence dimensions: T=20, C=64;

[0109] Multi-channels include environment (temperature and humidity), usage behavior (unsealing, frequency), and status tags;

[0110] Initialize the weight vector individual: set the initial candidate set size to M=30;

[0111] Solution space dimension: Each individual is a 64-dimensional weight vector , the weight initialization range is [0.1, 0.9];

[0112] Covariance calculation: for the original embedding sequence Cross-channel covariance analysis was performed to extract statistical correlations between channel pairs;

[0113] Perturbation injection: When generating weighted individuals, zero-mean Gaussian noise is introduced , simulate real data fluctuations;

[0114] Structural priors are introduced: Based on the prior knowledge that temperature and humidity channels are strongly correlated, the corresponding channel weights are increased by 20%;

[0115] The code used is as follows:

[0116] import numpy as np

[0117] import torch

[0118] import torch.nn as nn

[0119] # ---------------------

[0120] # Basic simulation parameter settings

[0121] # ---------------------

[0122] T, C = 20, 64 # Sequence length (time step) and number of channels

[0123] M = 30 # Number of candidate solutions

[0124] top_k = 10

[0125] X = torch.randn(T, C) # multi-channel embedding vector sequence

[0126] y_true = torch.randint(0, 2, (1,)) # simulate target label (e.g., whether it is due)

[0127] # ---------------------

[0128] # Simple classification network (used to evaluate the performance after weight aggregation)

[0129] # ---------------------

[0130] class SimpleClassifier(nn.Module):

[0131] def __init__(self, input_dim):

[0132] super().__init__()

[0133] self.fc = nn.Linear(input_dim, 2)

[0134] def forward(self, x):

[0135] x = x.mean(dim=0) # Time series aggregation

[0136] return self.fc(x)

[0137] # ---------------------

[0138] # Generate a set of candidate solution individuals

[0139] # ---------------------

[0140] def generate_initial_population():

[0141] return [torch.clamp(torch.randn(C) * 0.2 + 0.5, 0.1, 0.9) for _in range(M)]

[0142] # ---------------------

[0143] # Attention Adaptation Evaluation

[0144] # ---------------------

[0145] def evaluate_individual(w, X, y_true, classifier):

[0146] with torch.no_grad():

[0147] weighted_input = X * w.unsqueeze(0)

[0148] logits = classifier(weighted_input)

[0149] pred = torch.argmax(logits, dim=1)

[0150] acc = (pred == y_true).float().mean().item()

[0151] return acc

[0152] # ---------------------

[0153] # Behavior-driven updates: introducing random perturbations

[0154] # ---------------------

[0155] def behavior_update(top_weights):

[0156] new_pop = []

[0157] for w in top_weights:

[0158] noise = torch.randn_like(w) * 0.05

[0159] new_w = torch.clamp(w + noise, 0.1, 0.9)

[0160] new_pop.append(new_w)

[0161] return new_pop

[0162] # ---------------------

[0163] # Structure-guided perturbation: using cross-channel covariance

[0164] # ---------------------

[0165] def structure_mutation(w, X):

[0166] cov = torch.cov(X.T)

[0167] grad_approx = torch.sign(cov.mean(dim=1)) * 0.03

[0168] mutated_w = torch.clamp(w + grad_approx, 0.1, 0.9)

[0169] return mutated_w

[0170] # ---------------------

[0171] # 协同优化主循环

[0172] # ---------------------

[0173] def optimize_attention_weights(X, y_true, max_iter=20, threshold=0.002):

[0174] classifier = SimpleClassifier(C)

[0175] classifier.eval()

[0176] population = generate_initial_population()

[0177] last_top_score = 0

[0178] for it in range(max_iter):

[0179] scores = [evaluate_individual(w, X, y_true, classifier) for win population]

[0180] sorted_idx = np.argsort(scores)[::-1]

[0181] top_weights = [population[i] for i in sorted_idx[:top_k]]

[0182] top_score = np.mean([scores[i] for i in sorted_idx[:top_k]])

[0183] print(f"Iter {it}, top mean score: {top_score:.4f}")

[0184] # 收敛判断

[0185] if abs(top_score - last_top_score) < threshold:

[0186] break

[0187] last_top_score = top_score

[0188] # 双路径生成新候选集

[0189] P1 = behavior_update(top_weights)

[0190] P2 = [structure_mutation(w, X) for w in top_weights]

[0191] population = P1 + P2

[0192] return top_weights[0]

[0193] # ---------------------

[0194] # 执行优化

[0195] # ---------------------

[0196] best_attention_weight = optimize_attention_weights(X, y_true)

[0197] print("Best optimized attention weight vector (前5维):", best_attention_weight[:5])。

[0198] In the fourth embodiment, based on the above-mentioned embodiment, step S5, the following steps are specifically included:

[0199] Step S51: graph feature coding, input the overall graph embedding vector into a coding network composed of a convolution structure unit combined by a deep separable convolution layer and a weight normalization mechanism, perform multi-scale feature extraction to obtain a graph embedding high-order feature representation;

[0200] Step S52: diffusion modeling, use a diffusion model as a basic architecture to build an effective period prediction model, input the graph embedding high-order feature representation to obtain a prediction result vector;

[0201] Step S53: key indicator extraction, extract indicator information based on the prediction result vector, including effective period interval boundary value,

[0202] life cycle trend direction, fluctuation range indicator and threshold discriminant function output.

[0203] In the fifth embodiment, based on the above-mentioned embodiment, step S52, the following steps are specifically included:

[0204] Step S521: hierarchical mapping initialization, perform multi-scale division on the graph embedding high-order feature representation, construct a layer-by-layer propagation path, set the feature propagation state of each layer, and initialize the feature state matrix;

[0205] Step S522: stage feature evolution, adopt a layer-by-layer evolution strategy, in each propagation stage, extract feature state evolution results through local aggregation and global guidance mechanism to obtain a multi-stage intermediate state set;

[0206] Step S523: feature integration reconstruction, construct a feature fusion path based on the multi-stage state set, introduce a cross-layer connection strategy, cascade splice and weighted synthesis the outputs of each stage to obtain a fused feature representation;

[0207] Step S524: result generation mapping, input the fused feature representation into a regression calculation unit to obtain a prediction result vector

[0208] It should be noted that in this paper, relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment.

[0209] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

[0210] The present invention and its embodiments are described above. This description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if a person skilled in the art is inspired by this and, without departing from the purpose of the present invention, designs structures and embodiments similar to this technical solution without inventiveness, they shall fall within the scope of protection of the present invention.

Claims

1. An artificial intelligence-based intelligent monitoring method for the expiration date of medical reagents, characterized by: The method comprises the following steps: Step S1: Data collection, collecting reagent information data, environmental data and usage data, structuring the information fields, and obtaining a life cycle data set; Step S2: Construct an input feature sequence, perform principal component analysis on the life cycle dataset, embed the semantic modality label as bias information, construct a multi-channel embedding vector sequence, and obtain a feature matrix; Step S3: Based on the feature matrix, an attention mechanism is introduced to fuse multimodal semantic information. STL sequence decomposition and multi-scale GRU modeling are combined to learn high-order temporal features, and a heterogeneous graph is constructed with structural enhancement representations as entity nodes and semantic modality labels as relationship nodes. Step S4: Graph embedding generation. Based on the heterogeneous graph obtained in step S3, a readout operation is used to generate the overall graph embedding vector. The readout operation adopts a global pooling strategy. Step S5: Validity period prediction: constructing a validity period prediction model based on the overall graph embedding vector to obtain a prediction result vector; Step S6: Continuously optimize and periodically calibrate the feature construction parameters in step S2 and the parameters in the validity period prediction model in step S5.

2. The method for intelligent monitoring of the expiration date of medical reagents based on artificial intelligence according to claim 1, characterized in that: Step S3 specifically includes the following steps: Step S31: semantic fusion, introducing the attention mechanism combined with progressive noise reduction technology to perform cross-modal feature fusion modeling on the multi-channel embedding vector sequence, designing a two-stage collaborative optimization framework to adjust the weight factor in the attention mechanism, and outputting the fused semantic feature time series; Step S32: sequence decomposition, using the STL algorithm to decompose the fused semantic feature time series to obtain three types of subsequences, including trend terms, period terms, and residual terms; Step S33: Multi-scale trend modeling, constructing three sets of multi-scale GRU networks, independently modeling the three types of subsequences, and outputting three sets of preliminary time series feature representations, including trend modeling output, period modeling output, and residual modeling output; Step S34: perturbation enhancement, constructing a counterfactual generator in each multi-scale GRU network, performing perturbation enhancement, and obtaining three sets of enhanced time series representations; Step S35: Time series feature fusion, fusing the three sets of enhanced time series representations obtained in step S34 through cascade splicing to obtain a structurally enhanced time series high-order representation; Step S36: Construct a heterogeneous graph, decompose the structure-enhanced temporal high-order representation into semantic dimensions as entity nodes, and semantic modal labels as relationship nodes, and connect entity nodes and relationship nodes as edges; Step S37: Entity node update: aggregate the relationship nodes adjacent to each entity node and update the entity node; Step S38: updating the relationship nodes, aggregating the entity nodes adjacent to each relationship node, and updating the relationship nodes; Step S39: Graph embedding output, outputting the updated heterogeneous graph.

3. The method for intelligent monitoring of the expiration date of medical reagents based on artificial intelligence according to claim 2, characterized in that: Step S31: Design a two-stage collaborative optimization framework to adjust the weight factors in the attention mechanism, specifically including the following steps: Step S311: Candidate weight generation, setting the initial weight solution space, including individual weight vectors, calculating the cross-channel statistical covariance matrix of the multi-channel embedding vector sequence, integrating the structural prior and the noise perturbation mechanism, and generating a set of candidate solution individuals; Step S312: Attention adaptation evaluation: embed each candidate solution into an attention mechanism module, perform feature aggregation on the multi-channel embedding vector sequence through the attention weighting mechanism, and construct a candidate solution behavior evaluation matrix by calculating the representation ability evaluation index; Step S313: Behavior driven update, based on the candidate solution behavior evaluation matrix, introduces a dynamic behavior guidance mechanism, and adaptively adjusts the feature selection direction, update step size and local disturbance range of the candidate solution individual to obtain the reconstructed individual set ; Step S314: The structure-guided reconstruction mechanism uses the cross-channel covariance matrix to construct a gradient perturbation vector, performs individual mutation operations, and obtains a reconstructed individual set. ; Step S315: Dual-path collaborative screening, merging and reconstructing individual sets and , build a joint candidate set, calculate the attention weighted feature aggregation result for each candidate solution in the joint candidate set, select the scoring function for scoring and sorting, and select the top candidate solution according to the sorting. The candidate solution individuals are regarded as the optimal solution set; Step S316: Convergence judgment, set the convergence condition, iterate steps S313-S315 until the convergence condition is reached, and output the optimal candidate solution individual as the final weight factor.

4. The method for intelligent monitoring of the expiration date of medical reagents based on artificial intelligence according to claim 2, characterized in that: Step S5 specifically includes the following steps: Step S51: Graph feature encoding: inputting the overall graph embedding vector into an encoding network, which is composed of a convolutional structure unit composed of a depthwise separable convolutional layer and a weight normalization mechanism, to perform multi-scale feature extraction and obtain a high-order feature representation of the graph embedding; Step S52: Diffusion modeling, using the diffusion model as the basic architecture to build an expiration date prediction model, embedding the input graph into a high-order feature representation, and obtaining a prediction result vector; Step S53: Extract key indicators, extract indicator information based on the prediction result vector, including the validity period interval boundary value, life cycle trend direction, fluctuation range indicator and threshold discriminant function output.

5. The method for intelligent monitoring of the expiration date of medical reagents based on artificial intelligence according to claim 4, characterized in that: Step S52 specifically includes the following steps: Step S521: Initialize the hierarchical mapping, perform multi-scale division on the graph embedding high-order feature representation, construct a layer-by-layer propagation path, set the feature propagation state of each layer, and initialize the feature state matrix; Step S522: Stage feature evolution, using a layer-by-layer evolution strategy. In each propagation stage, the feature state evolution results are extracted through local aggregation and global guidance mechanisms to obtain a multi-stage intermediate state set. Step S523: Feature integration and reconstruction: constructing a feature fusion path based on a multi-stage state set, introducing a cross-layer connection strategy, and performing cascade splicing and weighted synthesis on the outputs of each stage to obtain a fused feature representation; Step S524: The result generates a mapping, and the fused feature representation is input into the regression calculation unit to obtain a prediction result vector.