A traditional chinese medicine active ingredient mining method based on a large model

By constructing a multimodal progressive classification and mining model for active ingredients of traditional Chinese medicine and a data quality control intelligent agent, combined with a two-level game optimization model, the problem of difficulty in automatically evaluating and controlling the quality of multi-source heterogeneous data in the mining of active ingredients of traditional Chinese medicine was solved, and the simultaneous optimization of data coverage and quality control was achieved, forming a high-quality knowledge graph.

CN122266522APending Publication Date: 2026-06-23青岛国实科技集团有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
青岛国实科技集团有限公司
Filing Date
2026-03-23
Publication Date
2026-06-23

Smart Images

  • Figure CN122266522A_ABST
    Figure CN122266522A_ABST
Patent Text Reader

Abstract

The application provides a traditional Chinese medicine active ingredient mining method based on a large model, and belongs to the technical field of large models.The application constructs a traditional Chinese medicine active ingredient multi-modal data set by collecting multi-source data, performs field adaptation on a visual language basic model based on a LoRA fine-tuning strategy, and forms an artificial intelligence mining model with progressive classification capability; a heterogeneous data mining intelligent agent is constructed by driving the model to batch mine multiple types of information in PDF format documents; a quality control intelligent agent is constructed to perform fine-grained quality rating on the mined data by numerical deviation and text vector cosine similarity; a double-layer game optimization model is used to jointly optimize search parameters and quality control thresholds, solving the technical problem that mining coverage and quality control pass rate are difficult to jointly optimize due to mutual restraint; and finally, high-quality data is imported into a knowledge graph database after triple extraction and knowledge fusion processing, realizing the structured accumulation of traditional Chinese medicine active ingredient knowledge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of large model technology, specifically, it relates to a method for mining active ingredients of traditional Chinese medicine based on large models. Background Technology

[0002] The discovery of active ingredients in traditional Chinese medicine is a core part of the modernization of TCM research. Traditional methods rely on manual literature retrieval, manual database entry, and rule matching to extract information. These methods are suitable for structured data scenarios. When processing multimodal heterogeneous data such as molecular structure images, quantitative indicators of bioactivity, and text on mechanisms of action in PDF-format scientific literature, keyword-based information extraction techniques or single-modality deep learning models are commonly used, combined with manual verification processes to complete data quality control.

[0003] However, the above methods have obvious limitations when dealing with large-scale traditional Chinese medicine literature mining tasks: keyword extraction has poor robustness to non-standardized expressions, single-modal models cannot process molecular images and text descriptions at the same time, and manual quality control is inefficient and inconsistent in standards, resulting in inconsistent data quality and difficulty in directly supporting knowledge graph construction.

[0004] In particular, when there is an inherent balancing relationship between mining coverage and quality control pass rate, existing technologies lack an effective joint optimization mechanism and cannot simultaneously improve literature mining coverage while ensuring data quality. In other words, existing technologies have technical problems such as difficulty in automatically evaluating and controlling the quality of multi-source heterogeneous data during the mining of active ingredients of traditional Chinese medicine, and difficulty in jointly optimizing the mutual balancing between mining coverage and quality control pass rate. Summary of the Invention

[0005] In view of this, the present invention provides a method for mining active ingredients of traditional Chinese medicine based on a large model, which can solve the technical problems in the prior art, such as the difficulty in automatically evaluating and controlling the quality of multi-source heterogeneous data in the process of mining active ingredients of traditional Chinese medicine, and the difficulty in jointly optimizing the mutual restraint between mining coverage and quality control pass rate.

[0006] This invention is implemented as follows: This invention provides a method for mining active ingredients of traditional Chinese medicine based on a large model, including the following steps:

[0007] We collected scientific literature data, database data, and PubChem data, and after cleaning, molecular structure image processing, and format standardization, we constructed a multimodal dataset of active ingredients of traditional Chinese medicine.

[0008] Based on a multimodal dataset of active ingredients in traditional Chinese medicine, the LoRA fine-tuning strategy was used to fine-tune the visual language basic model for the domain. After verification and iterative optimization, a multimodal progressive classification and mining model for active ingredients in traditional Chinese medicine was constructed.

[0009] Based on the multimodal progressive classification and mining model of active ingredients in traditional Chinese medicine, an intelligent agent for mining heterogeneous data of active ingredients in traditional Chinese medicine is constructed to batch mine source information, basic structural information, bioactivity information, mechanism of action information and application transformation information of PDF format scientific literature.

[0010] A smart agent for quality control of active data of traditional Chinese medicine is constructed. Reference data is obtained through a biomedical database engine, deviations are calculated by a fine-grained information comparator, and the data quality evaluator is used to rate the quality of the mined data and label it with quality tags.

[0011] A two-layer game optimization model is adopted to jointly optimize the retrieval parameters of the heterogeneous data mining agent of Chinese herbal active ingredients and the quality control threshold of the quality control agent of Chinese herbal active data. The optimized retrieval parameters are then updated to the heterogeneous data mining agent of Chinese herbal active ingredients and the optimized quality control threshold is then updated to the quality control agent of Chinese herbal active data.

[0012] A knowledge graph of active ingredients in traditional Chinese medicine is constructed to build an intelligent agent. Data with quality ratings of "excellent" and "good" are extracted by triplet extraction, knowledge fusion and disambiguation processing and then imported into the Neo4J database in batches to form a knowledge graph of active ingredients in traditional Chinese medicine and linked into the large model system.

[0013] Specifically, the construction of the multimodal dataset of active ingredients of traditional Chinese medicine involves normalizing the molecular structure images to below a resolution threshold, batch processing them into JSONL format using a Python script, and each row of data includes the molecular structure image path, user query field, and model response field.

[0014] The visual language basic model consists of three parts: a visual encoder, a cross-modal fusion layer, and a language decoder. The visual encoder uses a block attention mechanism to process molecular structure images, and the cross-modal fusion layer aligns the visual feature vector sequence with the text feature vector through a cross-attention mechanism.

[0015] The multimodal progressive classification mining model for active ingredients of traditional Chinese medicine introduces a multi-scale classification optimization mechanism based on hierarchical soft maximum values. It performs progressive classification layer by layer according to four granularity levels: traditional Chinese medicine prescription layer, medicinal material layer, active ingredient layer and molecular attribute layer. The layers are connected through a gating mechanism.

[0016] The multimodal progressive classification and mining model for active ingredients of traditional Chinese medicine also introduces a dynamic weight adjustment function. The rank parameter of the LoRA low-rank fitting matrix is ​​dynamically adjusted according to the validation set loss value, the training set loss value, and the domain evaluation similarity score. The rank parameter is reduced when the adjustment factor meets the overfitting threshold and increased when it meets the underfitting threshold.

[0017] The heterogeneous data mining agent for active ingredients of traditional Chinese medicine has a data acquisition and processing module and a heterogeneous data mining module. The data acquisition and processing module combines three retrieval strategies—Boolean logic retrieval, time-limited retrieval, and journal-level filtering—to batch acquire scientific literature in PDF format.

[0018] The basic structural information includes molecular structural information and molecular comprehensive attributes. The molecular comprehensive attributes include atomic composition and connection relationships, molecular formula information, functional group identification, bond type and properties, and stereochemical information. For molecular comprehensive attributes that cannot be obtained from PDF format scientific literature, a multimodal progressive classification mining model of active ingredients of traditional Chinese medicine is used to complete the information based on the two-dimensional molecular structural information.

[0019] The intelligent agent for quality control of active Chinese medicine data consists of five parts: a data loading module, an anchor control module, a biomedical database engine, a fine-grained information comparator, and a data quality evaluator. The anchor is the scientific name, chemical structure, or unique ID number of the active ingredient in the biomedical database.

[0020] The fine-grained information comparator calculates the percentage deviation for numerical data and calculates the cosine similarity of text vectors after vectorization based on a multilingual multifunctional text embedding model for text data.

[0021] The data quality evaluator rates the data as excellent, good, or poor based on a numerical information deviation threshold and a text vector cosine similarity threshold. Data rated as poor is labeled as poor and then retained.

[0022] The upper-level model of the two-layer game optimization model aims to maximize the literature mining coverage, while the lower-level model aims to maximize the data quality control pass rate. Both objective functions contain coupling terms, reflecting the balance between the literature mining coverage and the quality control threshold.

[0023] The knowledge graph construction agent for the active ingredients of traditional Chinese medicine establishes a knowledge graph schema layer, with the active ingredients of traditional Chinese medicine as the first-level node, and source information, basic structural information, bioactivity information, mechanism of action and application conversion information as the second-level nodes, which are then refined to a four-level node structure.

[0024] Among them, the intelligent agent for heterogeneous data mining of active ingredients of traditional Chinese medicine, the intelligent agent for quality control of active data of traditional Chinese medicine, and the intelligent agent for constructing knowledge graph of active ingredients of traditional Chinese medicine are all encapsulated in the form of MCP Server, and deployed and published in the cloud using ModelScope.

[0025] The main hyperparameters of the LoRA fine-tuning strategy were determined through ablation experiments. The strategy was trained and evaluated on a validation set under all combinations of candidate values ​​for learning rate, batch size, and number of training epochs. The hyperparameter combination with the best overall score on the validation set was used as the final setting.

[0026] The candidate values ​​for the weighting coefficient in the dynamic weighting adjustment function range from 0.1 to 1.0, with an optimal value of 0.5. The overfitting threshold for the adjustment factor is 1.5, the underfitting threshold is 0.8, the rank parameter adjustment ratio is 0.75 times for overfitting, and 1.25 times for underfitting. The upper limit of the threshold for excellent numerical information deviation rating is 10%, and the upper limit of the threshold for good is 50%. The lower limit of the threshold for excellent text vector cosine similarity rating is 90%, and the lower limit of the threshold for good is 50%.

[0027] This invention constructs a multimodal progressive classification and mining model for active ingredients in traditional Chinese medicine, enabling high-precision batch mining of multimodal heterogeneous data in PDF-format scientific literature. It also introduces a quality control agent for active Chinese medicine data to perform fine-grained automatic quality rating of the mining results.

[0028] Traditional methods rely on manual verification or simple rule matching, which cannot take into account the recognition of synonyms across languages ​​and expression modes, nor do they have the ability to classify and control numerical deviations and text semantic deviations. This invention establishes quantitative rating standards for numerical and text data respectively through the synergistic effect of numerical information comparators and text information comparators based on vector cosine similarity, making the quality control process objective and repeatable.

[0029] Furthermore, this invention employs a two-layer game optimization model to jointly optimize the retrieval parameters of the mining agent and the threshold of the quality control agent. By explicitly modeling the balance between coverage and pass rate through the coupling terms in the upper and lower objective functions, it ensures that both tend to optimize synchronously under constraints from a mathematical structure perspective. In summary, this invention solves the technical problems mentioned in the background art, such as the difficulty in automatically evaluating and controlling the quality of multi-source heterogeneous data in the mining of active ingredients of traditional Chinese medicine, and the difficulty in jointly optimizing the mutual balance between mining coverage and quality control pass rate. Attached Figure Description

[0030] Figure 1 This is a flowchart of the method of the present invention.

[0031] Figure 2 This is a distribution chart showing the data quality control rating of active ingredients in heat-clearing and detoxifying formulas.

[0032] Figure 3 This is a graph showing the changes in dynamic weight adjustment factors during the training of a multimodal progressive classification and mining model for active ingredients in traditional Chinese medicine. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below.

[0034] like Figure 1 The diagram shown is a flowchart of a method for mining active ingredients of traditional Chinese medicine based on a large model, provided by this invention. This method includes the following steps:

[0035] S01. Collect scientific literature data, database data and PubChem data, and after cleaning, molecular structure image processing and format standardization, construct a multimodal dataset of active ingredients of traditional Chinese medicine.

[0036] S02. Based on the multimodal dataset of active ingredients of traditional Chinese medicine, the LoRA fine-tuning strategy was used to fine-tune the Qwen3-VL 235B visual language basic model in the domain. After verification and iterative optimization, a multimodal progressive classification and mining model of active ingredients of traditional Chinese medicine was constructed.

[0037] S03. Based on the multimodal progressive classification and mining model of active ingredients of traditional Chinese medicine, construct an intelligent agent for mining heterogeneous data of active ingredients of traditional Chinese medicine, and mine source information, basic structural information, bioactivity information, mechanism of action information and application conversion information in batches from PDF format scientific literature.

[0038] S04. Construct an intelligent agent for quality control of active data of traditional Chinese medicine. Obtain reference data through a biomedical database engine, calculate the deviation through a fine-grained information comparator, and use a data quality evaluator to rate the quality of the mined data and label it with quality tags.

[0039] S05. A two-layer game optimization model is adopted to jointly optimize the retrieval parameters of the heterogeneous data mining agent of Chinese medicine active ingredients and the quality control threshold of the quality control agent of Chinese medicine active data. The optimized retrieval parameters are updated to the heterogeneous data mining agent of Chinese medicine active ingredients, and the optimized quality control threshold is updated to the quality control agent of Chinese medicine active data.

[0040] S06. Construct a knowledge graph of active ingredients in traditional Chinese medicine. Construct an intelligent agent and import data with quality ratings of "excellent" and "good" into the Neo4J database in batches after ternary extraction, knowledge fusion and disambiguation processing to form a knowledge graph of active ingredients in traditional Chinese medicine and link it into the large model system.

[0041] The original data sources for the multimodal dataset of active ingredients of traditional Chinese medicine (TCM) include three categories: scientific literature data, database data, and PubChem data. Scientific literature data consists of Chinese and English papers covering information on active ingredients of TCM, sourced from PubMed, Wanfang Database, VIP Database, and CNKI. Database data comes from TCMSP, TCMID, and HERB databases. PubChem data comprises relevant data on active ingredients of TCM from the PubChem database. The core objective of data cleaning is to construct a complete and accurate data link between TCM, medicinal materials, active ingredients, molecular structure, and molecular comprehensive attributes. This primarily involves manual methods to effectively extract information from the collected scientific literature and database data, with Python scripts used to assist in batch operations when necessary. Molecular structure image data is normalized to a resolution of 448×448 and processed in batches using Python scripts into a JSONL format dataset. Each row of data includes the molecular structure image path, user query fields, and model response fields.

[0042] The specific structure of the multimodal progressive classification and mining model for active ingredients of traditional Chinese medicine is as follows: Based on the Qwen3-VL 235B visual-language basic model, the backbone model consists of three parts: a visual encoder, a cross-modal fusion layer, and a language decoder. The visual encoder uses a block attention mechanism to process molecular structure images, dividing the image into a fixed-scale sequence of patches. A multi-head attention mechanism is used to extract spatial correlation features between patches, outputting a sequence of visual feature vectors. The cross-modal fusion layer uses a cross-attention mechanism to deeply align the visual feature vector sequence with the text feature vector, achieving effective fusion of molecular image semantics and textual descriptions of active ingredients of traditional Chinese medicine. The language decoder performs autoregressive text generation based on the fused features, outputting information related to active ingredients of traditional Chinese medicine. In the classification output layer, a multi-scale classification optimization mechanism based on hierarchical soft maximum values ​​is introduced to construct a hierarchical classifier structure, progressively classifying the ingredients layer according to four granularities: traditional Chinese medicine formula layer, medicinal material layer, active ingredient layer, and molecular attribute layer. At each granularity level, a soft decision boundary is used instead of a hard threshold decision. Temperature parameters are superimposed on the classification probability distribution at each level to quantify the uncertainty of low-confidence predictions. The soft-maximum function outputs the normalized probability vectors for each category at each level. High-confidence outputs are passed to the next granularity level, while low-confidence outputs trigger uncertainty labeling and retain multiple candidate outputs. The hierarchical classifier layers are connected by a gating mechanism. The gating signal is determined by the classification confidence of the upper layer, ensuring that fine-grained classification is activated only when the coarse-grained classification is correct, preventing erroneous coarse-grained classification results from propagating to the fine-grained classification layer. During the fine-tuning phase, a LoRA low-rank adaptation matrix is ​​introduced only into the attention layer of the Qwen3-VL235B visual language basic model. Low-rank matrix decomposition controls the scale of trainable parameters, enabling the multimodal progressive classification and mining model of traditional Chinese medicine active ingredients to recognize active ingredients while retaining the general multimodal understanding capabilities of the Qwen3-VL235B visual language basic model.

[0043] The technical effects of the multimodal progressive classification mining model for active ingredients of traditional Chinese medicine are as follows: The multi-scale classification optimization mechanism based on hierarchical soft maximum values ​​refines the classification from the macroscopic level of traditional Chinese medicine formulas to the microscopic level of molecular attributes through a hierarchical classifier structure. Coarse-grained classification results provide prior constraints for fine-grained classification, effectively avoiding the accumulation of ambiguity caused by an excessively large category space when directly performing fine-grained classification. The soft decision boundary adjusts the output probability distribution through temperature parameters, enabling proactive labeling of low-confidence prediction results and reducing the transmission of erroneous information to the downstream knowledge graph. The gated connection mechanism ensures that fine-grained classification is activated only when the coarse-grained classification is reliable, structurally guaranteeing the reliability of information transmission during the progressive classification process. The LoRA fine-tuning strategy retains the general multimodal representation capability of the Qwen3-VL 235B visual language basic model while controlling the scale of trainable parameters, enabling the multimodal progressive classification mining model for active ingredients of traditional Chinese medicine to maintain strong generalization ability when processing non-standard molecular images.

[0044] The steps for establishing the training dataset for the multimodal progressive classification and mining model of active ingredients in traditional Chinese medicine specifically include: pairing the molecular structure diagrams formed after data cleaning with molecular comprehensive attribute data to form molecular structure diagram-molecular comprehensive attribute data pairs; batch processing the molecular structure images to normalize the image resolution to below 448×448; batch processing the molecular structure diagram-molecular comprehensive attribute data pairs into JSONL format using Python scripts, with each row of data containing the molecular structure image path, user query fields, and model response fields; and using the LLaMA-Factory framework to complete the organization and management of the multimodal dataset of active ingredients in traditional Chinese medicine.

[0045] The specific steps for training the multimodal progressive classification and mining model for active ingredients of traditional Chinese medicine include: using the LLaMA-Factory software tool, fine-tuning the Qwen3-VL 235B visual language basic model based on the LoRA fine-tuning strategy, with the main hyperparameters set as follows: LoRA rank ranging from 8 to 64, and learning rate. The batch size is 256, and the number of training rounds is 3. During training, training logs containing the current loss value and training progress are output periodically according to the log step size parameter. After fine-tuning, the Qwen3-VL 235B visual language basic model is merged with the LoRA weight file to form a multimodal progressive classification mining model for active ingredients of traditional Chinese medicine. 8-bit or 4-bit quantization methods are used to reduce the model size and reduce inference memory usage. The basic capabilities of the multimodal progressive classification mining model for active ingredients of traditional Chinese medicine are evaluated using the TextVQA visual language model performance evaluation dataset and the GQA visual language model performance evaluation dataset. Accuracy, BLEU index, ROUGE index, and CIDEr index are used to quantify the performance of the multimodal progressive classification mining model for active ingredients of traditional Chinese medicine in visual understanding, language generation, and cross-modal inference. The model's performance in OCR recognition was evaluated. Several PDF documents in the field of TCM active ingredient mining were randomly selected. After being recognized by the TCM active ingredient multimodal progressive classification mining model, the recognition results were manually compared with real PDF data to verify the accuracy of the TCM active ingredient multimodal progressive classification mining model. If the basic ability evaluation was not up to standard, the number of training rounds and weights were reduced and the relevant parameters were saved in batches. If the TCM active ingredient mining performance was not up to standard, the number of training rounds was appropriately increased and the quality of the TCM active ingredient multimodal dataset was screened. After multiple rounds of optimization and iteration, the best-performing TCM active ingredient multimodal progressive classification mining model was selected.

[0046] The learning rate The specific values ​​for batch size 256 and training epochs 3 were determined through multiple rounds of ablation experiments: [The text abruptly ends here, likely due to an incomplete sentence or missing information.] Batch size candidate values and candidate values ​​for training rounds We train on all possible combinations and evaluate the BLEU metric and accuracy on the validation set. The hyperparameter combination with the best overall score on the validation set is used as the final setting.

[0047] The multimodal progressive classification and mining model for active ingredients of traditional Chinese medicine also introduces a dynamic weight adjustment function. This function dynamically adjusts the rank parameter of the LoRA low-rank adaptation matrix based on the validation set performance during training. The input to the dynamic weight adjustment function includes the validation set loss value. Compared with the benchmark loss value The ratio, training set loss value Compared with the benchmark loss value The ratio and the domain similarity score Similarity score to benchmark The ratio is output as a dimensionless adjustment factor. The formula is expressed as follows:

[0048] ;

[0049] in, To balance the coefficients, the optimal value was obtained through multiple rounds of experiments on the validation set. Experimental results show that... When the value is 0.5, the multimodal progressive classification and mining model for active ingredients in traditional Chinese medicine exhibits optimal convergence and generalization. The value 0.5 is determined by the candidate value... The baseline loss value is determined after the combined scores of each training session and evaluation. and benchmark similarity score The result is obtained by taking the validation set loss and the domain evaluation similarity score at the end of the first round of initial training on a small pre-training dataset. (When a dimensionless adjustment factor is used...) At this time, it indicates that the multimodal progressive classification and mining model of active ingredients in traditional Chinese medicine has an overfitting tendency, so the LoRA rank parameter is reduced to 0.75 times the current value; when the dimensionless adjustment factor When the training state of the multimodal progressive classification and mining model for active ingredients of traditional Chinese medicine is normal, the LoRA rank parameter remains unchanged; when the dimensionless regulating factor is present... When the result indicates that the multimodal progressive classification mining model for active ingredients of traditional Chinese medicine is underfitting, the LoRA rank parameter is increased to 1.25 times the current value. The boundary values ​​of 1.5, 0.8, and adjustment ratios of 0.75 and 1.25 are determined through iterative experiments on the sensitivity of the adjustment range of the LoRA rank parameter at different training stages. The boundary combination with the most stable decrease in validation set loss and the highest final accuracy is selected.

[0050] The LoRA fine-tuning strategy works as follows: A low-rank decomposition matrix is ​​appended to the attention layer parameter matrix of the Qwen3-VL 235B visual language base model. This decomposes the parameter update into the product of two low-rank matrices. By limiting the rank of the low-rank matrix, the number of trainable parameters is controlled, significantly reducing the number of fine-tuned parameters while preserving the general representational capabilities of the Qwen3-VL 235B visual language base model. In the construction of a multimodal progressive classification and mining model for active ingredients in traditional Chinese medicine (TCM), the LoRA fine-tuning strategy enables domain adaptation to be completed using only a small amount of TCM domain data without retraining all parameters of the Qwen3-VL 235B visual language base model. This significantly reduces memory usage and training time. Simultaneously, by controlling the rank, it prevents overfitting of the multimodal progressive classification and mining model for TCM active ingredients on small-scale domain data, ensuring the model's generalization ability in TCM active ingredient mining tasks.

[0051] The described intelligent agent for heterogeneous data mining of active ingredients in traditional Chinese medicine has two main functional modules: a data acquisition and processing module and a heterogeneous data mining module. The data acquisition and processing module, by setting basic keywords, active ingredient keywords, and specific ingredient keywords, combines three retrieval strategies—Boolean logic retrieval, time-limited retrieval, and journal-level filtering—and develops a Python script for batch data downloading. It retrieves PDF-format scientific literature from CNKI and PubMed databases in batches; the retrieved PDF-format scientific literature is then filtered for completeness, text quality, relevance, and timeliness, eliminating low-quality data. The heterogeneous data mining module, driven by a multimodal progressive classification mining model for active ingredients in traditional Chinese medicine, performs batch mining of source information, basic structural information, bioactivity information, mechanism of action information, and application transformation information, storing the results in batches to Excel spreadsheets.

[0052] The source information includes the literature title, author, affiliation, DOI number, traditional Chinese medicine formula, medicinal materials, pharmacological effects, and efficacy. The basic structural information includes molecular structure information and comprehensive molecular attributes, including atomic composition and connectivity, molecular formula, functional group identification, bond type and properties, and stereochemical information. For comprehensive molecular attributes that the multimodal progressive classification mining model for active ingredients of traditional Chinese medicine cannot obtain from PDF-format scientific literature, the model is used to complete the information based on the two-dimensional molecular structure information. The bioactivity information includes physicochemical properties and pharmacokinetic parameters, pharmacological action type information, and quantitative bioactivity indicators. The physicochemical properties and pharmacokinetic parameters include lipid-water partition coefficient, solubility, stability, and oral bioavailability. The quantitative bioactivity indicators include half-maximal inhibitory concentration (IC50). Suppression constant dissociation constant The minimum inhibitory concentration (MIC) is specified; the mechanism of action information includes the target site, pathway, and mechanism of action; the application conversion information includes clinical application value information, structural modification and optimization potential information, and marketization conversion information. The clinical application value information includes indication positioning, clinically effective dose range, bioavailability data, combination therapy stage, clinical trial stage, patient population characteristics, and safety assessment. The structural modification and optimization potential information includes modification sites, physicochemical property improvement, targeted enhancement, and synthetic feasibility assessment. The marketization conversion information includes large-scale production processes, quality control standards, and supply chain management.

[0053] The atomic composition and connectivity information includes the composition of C, H, O, N, S, and P atoms in the molecule, the intermolecular connectivity, and the type of chemical bonds; the molecular formula information includes the molecular formula, molecular weight, and degree of unsaturation; the functional group identification includes hydroxyl groups. ,carboxyl amino carbonyl Aldehyde group The group includes ketones, aromatic structures, halogens, nitro groups, and sulfonic acid groups; the types and properties of the bonds include single bonds, double bonds, triple bonds, aromatic bonds, hydrogen bond donor positions, and hydrogen bond acceptor positions; the stereochemical information includes the chiral center R / S configuration, the double bond cis-trans isomer E / Z configuration, the cyclic structure conformation, and the steric hindrance effect.

[0054] The described heterogeneous data mining agent for active ingredients of traditional Chinese medicine is packaged in the form of an MCP Server. It integrates the scripts and tools of the data acquisition and processing module and the heterogeneous data mining module. The dependent environment is specified in the requirement.txt file. The file is uploaded to GitHub, and an MCP Server is created using ModelScope. The service name, basic information and hosting type are filled in. The source code is pulled from GitHub, and the service is released after cloud deployment and functional testing.

[0055] The intelligent agent for quality control of TCM active ingredient data consists of five parts: a data loading module, an anchor control module, a biomedical database engine, a fine-grained information comparator, and a data quality evaluator. The data loading module loads bioactivity information, mechanism of action information, and application conversion information generated by the TCM active ingredient heterogeneous data mining intelligent agent. The anchor control module sets the detailed parameters to be controlled and the source of the biomedical database. The anchor point is the scientific name, chemical structure, or unique ID number of the active ingredient in the biomedical database. The biomedical database engine dynamically obtains reference data from authoritative databases in the field of TCM and biomedical databases. Authoritative databases in the field of TCM include the TCMSP database, the TCMID database, and the ETCM database. Biomedical databases include the UniProt database, the ChEMBL database, the CHEBI database, and the DrugBank database. Python code is written for databases with open data access interfaces. The system employs several methods: A data acquisition tool automatically retrieves corresponding data from the database based on the parameters and anchor points to be controlled for quality. For databases supporting data download, a data parsing tool is built to parse the TCM entities, relationships, and attributes in XML, CSV, and OWL formats. Based on the quality control parameters and anchor points, corresponding data is selected from the parsed data. For databases where data cannot be directly acquired, an incremental crawler is developed to crawl data in a targeted manner. If no data is acquired, subsequent quality control is not performed. A fine-grained information comparator calculates percentage deviation for numerical data and calculates cosine similarity of text vectors based on the bge-m3 model for text data. A data quality evaluator performs quality rating based on the comparison results, including numerical information deviation. satisfy The rating is excellent, meeting the requirements. The rating is good, which meets the requirements. The time rating is poor; the text vector cosine similarity is... satisfy The rating is excellent, meeting the requirements. The rating is good, which meets the requirements. Data with a poor rating will be retained after being tagged as poor. If either the data obtained from the biomedical database engine or the data obtained from the heterogeneous data mining agent of traditional Chinese medicine active ingredients is empty, no further quality control will be performed.

[0056] The numerical information deviation thresholds of 10% and 50%, and the text vector cosine similarity thresholds of 90% and 50%, were determined through multiple rounds of expert verification experiments. Experts in the field of traditional Chinese medicine were invited to conduct manual quality assessments on a batch of known correct data on active ingredients of traditional Chinese medicine, which were labeled as excellent, good, and poor. Based on the labeling results, the classification accuracy of the data quality evaluator was calculated under the candidate threshold combinations, and the threshold combination with the highest classification accuracy was selected as the final set value.

[0057] The bge-m3 model is a multilingual, multifunctional text embedding model. Its core principle is to train on large-scale text pairs by contrasting learning objectives, making semantically similar texts closer in the vector space and texts with large semantic differences farther apart. In the scenario of quality control of TCM active ingredient data, the bge-m3 model embeds the text information generated by the heterogeneous data mining agent of TCM active ingredients and the reference text information obtained by the biomedical database engine into high-dimensional vectors respectively. By calculating the cosine similarity of the two vectors to measure semantic consistency, it overcomes the problem of the insensitivity of literal matching methods to synonyms and near-synonyms, enabling cross-language and cross-expression synonymous information to be correctly identified as high-quality data, significantly improving the accuracy and robustness of text-based TCM active ingredient data quality assessment.

[0058] The intelligent agent for quality control of active Chinese medicine data is also encapsulated in the form of MCP Server. It integrates the scripts and tools of the data loading module, anchor control module, biomedical database engine, fine-grained information comparator, and data quality evaluator. The dependent environment is specified in the requirements.txt file, uploaded to GitHub, and MCP Server is created using ModelScope. The source code is pulled from GitHub, and the service is released after cloud deployment and functional testing.

[0059] The two-layer game optimization model has an upper-layer model that aims to maximize document mining coverage, and a lower-layer model that aims to maximize data quality control pass rate. The two models are mutually constrained by coupling terms. The objective function of the upper-layer model is used to maximize the document mining coverage given the retrieval parameters and the optimal quality control threshold output by the lower-layer model. The input includes the current document mining coverage. Compared with benchmark coverage The ratio and the optimal quality control threshold output by the lower-level model Compared with the baseline threshold The ratio is output as the value of the upper-level objective function. The formula is expressed as follows:

[0060] ;

[0061] The constraints of the upper-level model are: ,in The minimum coverage ratio constraint threshold, These are the upper-level tradeoff coefficients. The objective function of the lower-level model maximizes the data quality control pass rate given a quality control threshold and the current literature mining coverage. Inputs include the quality control threshold. Compared with the baseline threshold The ratio and current literature mining coverage Compared with benchmark coverage The ratio is output as the value of the lower-level objective function. The formula is expressed as follows:

[0062] ;

[0063] in, To meet the quality control threshold The number of data entries that pass quality control. The baseline number of data entries, The lower-level coupling coefficient is denoted by ; the constraint condition of the lower-level model is . ,in The minimum pass rate constraint threshold; both objective functions contain coupling terms. This reflects the balance between literature mining coverage and quality control thresholds; maximizing the value of the upper-level objective function. The obtained optimal search parameters are updated to the data mining agent for heterogeneous active ingredients in traditional Chinese medicine to maximize the value of the lower-level objective function. The obtained optimal quality control threshold Updated to the intelligent agent for quality control of traditional Chinese medicine activity data; the benchmark coverage. , benchmark threshold and the number of baseline data entries The data was obtained by running a data mining agent for heterogeneity of active ingredients in traditional Chinese medicine and a data quality control agent for active ingredients in traditional Chinese medicine on small-scale preliminary experimental data, and the initial results were used as a benchmark; the upper-level weighting coefficients were obtained. and lower layer coupling coefficient In preliminary experiments involving multiple combinations of retrieval parameters and quality control thresholds, the optimal value of both the upper-level and lower-level objective functions was determined using a grid search iterative method; the minimum coverage ratio constraint threshold was used. and minimum pass rate constraint threshold Sensitivity analysis of the lower limits of coverage and pass rate in multiple rounds of preliminary experiments determined the most stringent constraint combination that does not significantly decrease coverage and pass rate.

[0064] The specific operational steps for constructing the intelligent agent of the knowledge graph of active ingredients in traditional Chinese medicine include: establishing a knowledge graph schema layer. The schema layer uses active ingredients in traditional Chinese medicine as primary nodes, and source information, basic structural information, bioactivity information, mechanism of action, and application conversion information as secondary nodes. The source information is further divided into tertiary nodes (document name, author, affiliation, DOI number, traditional Chinese medicine prescription, medicinal material, pharmacological effects, and efficacy), basic structural information (molecular structure information and comprehensive molecular attributes), bioactivity information (physicochemical properties and pharmacokinetic parameters, pharmacological action type information, and quantitative bioactivity indicators), mechanism of action (target, pathway, and mechanism of action), and application conversion information (clinical application value information, structural modification and optimization potential information, and market transformation information). The quaternary nodes include the two-dimensional molecular structure diagram of the active ingredient, atomic composition and connection relationships, molecular formula information, functional group identification, bond type and properties, stereochemical information, lipid-water partition coefficient, solubility, stability, oral bioavailability, antitumor effect, antioxidant effect, and half-maximal inhibitory concentration. Suppression constant dissociation constant The study included: minimum inhibitory concentration (MIC), protein targets, nucleic acid targets, cellular structural targets, classical signaling pathways, cell fate pathways, metabolic and stress pathways, enzyme inhibition, protein regulation, gene expression regulation, proliferation inhibition, death induction, migration inhibition, and immune regulation; indications, clinically effective dose range, bioavailability data, combination therapy stage, clinical trial stage, patient population characteristics, safety assessment, modification sites, physicochemical property improvement, targeted enhancement, synthetic feasibility assessment, large-scale production process, quality control standards, and supply chain management. Data with poor quality ratings were removed, while data with excellent and good quality ratings were retained. The study also utilized multiple active ingredients from traditional Chinese medicine. The modal progressive classification mining model extracts four-level structural information (first-level node - second-level node - third-level node - fourth-level node) from the data generated by the TCM active ingredient data quality control agent in batches according to prompt word templates and knowledge graph schema layers. The four-level structural information is then split into pairs of triples and stored in batches in JSON or Excel format. Knowledge fusion and semantic disambiguation are performed on the triple data to avoid data redundancy caused by synonyms and aliases. A data import tool is developed to import the processed data in batches into the Neo4J database, forming a TCM active ingredient knowledge graph. An incremental update tool is developed to implement incremental updates of the TCM active ingredient knowledge graph. All of the above modules are encapsulated as an MCP Server agent service, deployed and published in the cloud using ModelScope.

[0065] The MCP Server is a Model Context Protocol Server, a service encapsulation form based on the Model Context Protocol standard. It publishes data processing scripts and tools as cloud services in the form of standardized interfaces, supporting large model systems to call the functions of various agents through the protocol, and realizing collaborative linkage and cross-platform calling between different agents.

[0066] Optionally, the present invention also provides a computer-based method for forming a large-scale model-based system for mining active ingredients of traditional Chinese medicine. The computer is equipped with a readable storage medium, which stores program instructions. When the program instructions are run on the computer, they execute the above-described method.

[0067] The specific implementation of step S01 is as follows: Technicians collect Chinese and English papers containing information on active ingredients of traditional Chinese medicine (TCM) from PubMed, Wanfang, VIP, and CNKI databases as scientific literature data; obtain structured database data from TCMSP, TCMID, and HERB databases; and download relevant data records related to active ingredients of TCM from PubChem database. The core objective of data cleaning is to construct a complete data link of TCM-medicinal materials-active ingredients-molecular structure-molecular comprehensive attributes. This is mainly achieved through manual methods to extract effective information from the raw data, with Python scripts used to assist in batch operations when necessary. Molecular structure image data is uniformly normalized to a resolution below 448×448. Using Python scripts, image paths, user query fields, and model response fields are organized into JSONL format with one record per line. Finally, the LLaMA-Factory framework is used to organize and manage the multimodal dataset of active ingredients of TCM, forming a standardized and formatted training corpus.

[0068] The specific implementation of step S02 is as follows: The visual language basic model consists of three parts: a visual encoder, a cross-modal fusion layer, and a language decoder. The visual encoder uses a block attention mechanism to segment the molecular structure image into a fixed-scale sequence of patches, and extracts spatial correlation features between patches through a multi-head attention mechanism, outputting a sequence of visual feature vectors. The cross-modal fusion layer uses a cross-attention mechanism to deeply align the sequence of visual feature vectors with the text feature vectors, achieving the fusion of molecular image semantics and active ingredient text descriptions. The language decoder performs autoregressive text generation based on the fused features. In the classification output layer, a multi-scale classification optimization mechanism based on hierarchical soft maximum values ​​progressively classifies the data layer by layer according to four granularities: traditional Chinese medicine formula layer, medicinal material layer, active ingredient layer, and molecular attribute layer. Each layer is connected by a gating mechanism, activating fine-grained classification only when the confidence of coarse-grained classification meets the gating signal threshold, preventing coarse-grained errors from propagating to lower layers. The LoRA fine-tuning strategy introduces a low-rank adaptation matrix only in the attention layer, controlling the scale of trainable parameters through low-rank matrix decomposition. Training was performed using the LLaMA-Factory tool, and the main hyperparameters were determined through ablation experiments, specifically the learning rate. Batch size 256, number of training epochs 3. During training, the dynamic weight adjustment function is based on the validation set loss value. Training set loss value and domain similarity score Calculate the dimensionless adjustment factor ,when When the LoRA rank parameter is reduced to 0.75 times its current value, When the LoRA rank parameter is increased to 1.25 times its current value, The rank parameter is kept constant to achieve adaptive control during training. After fine-tuning, the base model and LoRA weights are merged, and 8-bit or 4-bit quantization is used to reduce the model size. The basic capabilities are verified using TextVQA and GQA evaluation datasets. The recognition results are manually compared with randomly selected PDF documents in the field. If the indicators do not meet the standards, the parameters are iteratively adjusted. After multiple rounds of optimization and screening, the best-performing multimodal progressive classification and mining model for active ingredients of traditional Chinese medicine is obtained.

[0069] The specific implementation of step S03 is as follows: The data acquisition and processing module sets basic keywords, active ingredient keywords, and specific ingredient keywords, and combines three retrieval strategies—Boolean logic retrieval, time-limited retrieval, and journal-level filtering—to write a Python batch data download script to obtain PDF-format scientific literature from CNKI and PubMed databases. Subsequently, it performs integrity filtering, text quality filtering, relevance filtering, and timeliness filtering to eliminate low-quality data. The heterogeneous data mining module is driven by a multimodal progressive classification mining model for active ingredients of traditional Chinese medicine. It constructs prompt word templates for source information, basic structural information, bioactivity information, mechanism of action information, and application conversion information, and batch calls the model to perform inference on PDF-format literature. The mining results are batch stored in Excel spreadsheets. For molecular comprehensive attributes that cannot be directly obtained from the literature, the model completes the information based on the two-dimensional molecular structure information. The entire intelligent agent is encapsulated in the form of MCPServer and deployed in the cloud through ModelScope.

[0070] The specific implementation of step S04 is as follows: The anchor point control module uses the scientific name, chemical structure, or unique ID number of the active ingredient in traditional Chinese medicine as the anchor point. The biomedical database engine dynamically obtains reference data from databases such as TCMSP, TCMID, ETCM, UniProt, ChEMBL, CHEBI, and DrugBank based on the anchor point, adapting to different database access methods through concurrent acquisition tools, data parsing tools, and incremental crawling tools. The fine-grained information comparison device uses percentage deviation measurement for numerical data and a multilingual multifunctional text embedding model for text data to embed the text into a high-dimensional vector and calculate cosine similarity, overcoming the defect of literal matching being insensitive to synonyms. The data quality evaluator rates the data as excellent, good, or poor based on deviation thresholds and similarity thresholds. A numerical deviation of no more than 10% or a text similarity of no less than 90% is rated as excellent; a numerical deviation between 10% and 50% or a text similarity between 50% and 90% is rated as good; and data outside these ranges is rated as poor. Data rated as poor is tagged and retained. If any item in the reference data or mined data is empty, quality control will not be performed.

[0071] The specific implementation of step S05 is as follows: The upper-level model of the two-layer game optimization model takes into input the ratio of the current literature mining coverage to the benchmark coverage and the ratio of the optimal quality control threshold to the benchmark threshold output by the lower-level model, and outputs the upper-level objective function value. The constraint condition is that the coverage ratio is not lower than the minimum coverage ratio constraint threshold. The lower-level model takes into input the ratio of the quality control threshold to the benchmark threshold and the ratio of the current coverage to the benchmark coverage, and outputs the lower-level objective function value. The denominator includes a coupling exponent term, and the constraint condition is that the pass rate ratio is not lower than the minimum pass rate constraint threshold. Both objective functions contain coupling terms, explicitly modeling the trade-off relationship between coverage and threshold. The upper and lower-level trade-off coefficients and coupling coefficients are determined through grid search, and the benchmark value is obtained through the initial run results of a small-scale pre-experiment. The optimized retrieval parameters are updated to the data mining agent for heterogeneous active ingredients of traditional Chinese medicine, and the optimized quality control threshold is updated to the data quality control agent for active Chinese medicine.

[0072] The specific implementation of step S06 is as follows: The knowledge graph schema layer uses active ingredients of traditional Chinese medicine as first-level nodes, and source information, basic structural information, bioactivity information, mechanism of action, and application conversion information as second-level nodes, progressively refining to third-level and fourth-level nodes to form a complete hierarchical ontology structure. After removing data with poor quality ratings, a multimodal progressive classification mining model for active ingredients of traditional Chinese medicine is used to extract fourth-level structural information in batches from the quality-controlled data according to prompt word templates. This information is then split into pairs of triplets and stored in JSON or Excel format. Knowledge fusion and semantic disambiguation are performed on the triplet data to avoid data redundancy caused by synonyms and aliases. A data import tool is developed to import the processed data in batches into the Neo4J database, and an incremental update tool is developed to support the continuous expansion of the knowledge graph. Finally, the knowledge graph is linked into a large model system, and the entire module is encapsulated as an MCP Server intelligent agent service and published through ModelScope.

[0073] It should be noted that the key technologies of this invention include: a multi-scale progressive classification mechanism based on hierarchical soft maximum values ​​decomposes the task of identifying active ingredients in traditional Chinese medicine into a four-layer structure from coarse to fine. Gated connections ensure that fine-grained classification is activated only when the coarse-grained classification is reliable, thereby compressing the candidate space for fine-grained classification from the root and avoiding the accumulation of ambiguity caused by an excessively large category space during direct fine-grained classification. At the same time, the soft decision boundary actively labels low-confidence outputs through temperature parameters, reducing the transmission of erroneous information to the knowledge graph. The fine-grained information comparison mechanism designs measurement methods for numerical and textual data respectively. For textual data, a multilingual and multifunctional text embedding model is used to achieve cross-language and cross-expression semantic consistency measurement, solving the problem of literal matching being insensitive to synonyms, and making the quality rating of heterogeneous data objective and robust. The two-layer game optimization model explicitly incorporates the balance between coverage and quality control threshold into the objective function through coupling terms, enabling the upper and lower layers to converge collaboratively under their respective constraints. These three key technologies support each other and jointly ensure the quality and integrity of the mined data.

[0074] It should be noted that this invention also solves the following technical problem: In existing research on the mining of active ingredients in traditional Chinese medicine, due to the lack of a dynamic perception mechanism for overfitting and underfitting states of visual language models during domain adaptation, the LoRA rank parameter is usually manually set once before training, leading to overfitting or underfitting problems on small-scale domain data due to insufficient rank parameters. This invention introduces a dynamic weight adjustment function, using the validation set loss value, training set loss value, and domain evaluation similarity score as inputs, to calculate a dimensionless adjustment factor. Based on the comparison between the adjustment factor and a preset threshold, the LoRA rank parameter is automatically increased or decreased, enabling the model to adaptively adjust the parameter capacity during training. This improves the stability of domain adaptation while preserving the general representation capability of the basic visual language model, thus solving the technical problem of insufficient adaptation stability caused by the static setting of rank parameters during the domain fine-tuning of visual language models.

[0075] Specifically, the principle of this invention is as follows: The fundamental reason this invention can solve the aforementioned core technical problems lies in the complete closed-loop mechanism formed from three levels: data mining, quality control, and parameter optimization. At the mining level, a multi-scale progressive classification structure based on hierarchical soft maximum values ​​refines the category space layer by layer. A gating mechanism prevents coarse-grained errors from propagating to fine-grained errors, ensuring the extraction quality of multimodal heterogeneous data. At the quality control level, percentage deviation is used for numerical data, and vector cosine similarity is used for textual data. These two measurement methods are designed specifically for their data characteristics, avoiding the mismatch problem of a single evaluation standard for heterogeneous data. At the optimization level, the upper layer of the two-layer game model aims to maximize coverage, while the lower layer aims to maximize pass rate. The two layers are mutually constrained by coupling terms, ensuring that optimization of either layer cannot ignore the feedback from the other, thus mathematically guaranteeing the rationality of joint optimization. These three mechanisms support each other, forming the logical closed loop for solving the core technical problems of this invention.

[0076] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.

[0077] The specific implementation of step S01 is as follows: Scientific literature data, database data, and PubChem data are collected. The raw data is cleaned, molecular structure images are processed, and the format is standardized to construct a multimodal dataset of active ingredients in traditional Chinese medicine. Data cleaning is primarily done manually, with Python scripts used to assist in batch operations when necessary. The core objective is to construct a complete data link between traditional Chinese medicine, medicinal materials, active ingredients, molecular structure, and molecular comprehensive attributes. Molecular structure images are normalized to a resolution below 448×448 and batch-processed into JSONL format using Python scripts. Each row of data includes the molecular structure image path, user query fields, and model response fields.

[0078] The specific implementation of step S02 is as follows: Using the Qwen3-VL 235B visual language basic model as the backbone, the backbone model consists of three parts: a visual encoder, a cross-modal fusion layer, and a language decoder. The visual encoder employs a block attention mechanism to segment the input molecular structure image into a fixed-scale patch sequence, denoted as [the patch sequence is missing here]. ,in For the first Feature vectors of each patch The total number of tiles, For the tile feature dimension, a multi-head attention mechanism is used to extract spatial association features between tiles, and the attention weight matrix is ​​used. The calculation formula is as follows:

[0079]

[0080] In the formula, For visual encoder query matrix, For the visual encoder key matrix, The visual encoder can learn the query and key projection matrix. The dimension of the key vector. For normalized exponential functions, As the transpose symbol, the visual encoder outputs a sequence of visual feature vectors. ,in For the visual encoder value projection matrix, For the dimension of the value vector, The cross-modal fusion layer uses a cross-attention mechanism to combine visual feature vector sequences. With text feature vectors Perform depth alignment, where The length of the text sequence. These are the query, key, and value projection matrices of the cross-modal fusion layer, and the matrix in the visual encoder. They are independent of each other and their parameters are not shared. , , fusion features The calculation formula is as follows:

[0081]

[0082] Language decoder in feature fusion Based on this, autoregressive text generation is performed to output information related to the active ingredients of traditional Chinese medicine. In the classification output layer, a multi-scale classification optimization mechanism based on hierarchical soft maximum is introduced, progressively classifying at four granular levels: traditional Chinese medicine formula layer, medicinal material layer, active ingredient layer, and molecular attribute layer. Layer input features By fusion features After the first The result is obtained through a linear mapping of layers, i.e. , For the first Layer mapping matrix, The granularity level is numbered, with values ​​ranging from 1 to 4, the first... Layer normalized probability vector The calculation formula is as follows:

[0083]

[0084] In the formula, For the first Layer classification weight matrix, for The Column vector, For category numbering, For the first Total number of layer categories For the first Layer temperature parameters are output with high confidence and passed to the next granularity level; low confidence outputs trigger uncertainty labeling and retain multiple candidate outputs. Layers are connected via a gating mechanism, with gating signals... Confidence of upper-level classification The decision is made, and the calculation formula is as follows:

[0085]

[0086] In the formula, It is a logical stethoscope function, i.e. ,in For the input variables of the logistic function, For the first Layer confidence threshold, when The first step is activated only when the activation threshold is exceeded. Fine-grained classification at the layer level. In the LoRA fine-tuning stage, a low-rank adaptation matrix is ​​introduced only at the attention layer, reducing parameter update complexity. ,in The left matrix of the LoRA low-rank decomposition. The right matrix is ​​a low-rank LoRA decomposition. Let LoRA be the rank parameter. The input dimension for the attention layer has a learning rate of [value]. The batch size was 256, the training epochs were 3, and the hyperparameters were determined through ablation experiments to achieve the optimal comprehensive score on the validation set across all candidate value combinations. Dynamic weight adjustment function. Used to dynamically adjust the LoRA rank parameter based on validation set performance. The formula is as follows:

[0087]

[0088] In the formula, This is the current validation set loss value. This is the current training set loss value. The baseline loss value, all three have the same dimensions, and the ratio is... and All are dimensionless quantities. To evaluate the similarity score in the current domain, The baseline similarity score is used, and both scores have the same dimensions. The ratio is... It is a dimensionless quantity. The dimensionless tradeoff coefficient is set to 0.5. It was determined by training and evaluating the comprehensive scores on candidate values ​​of 0.1, 0.3, 0.5, 0.8, and 1.0. and The result is obtained by taking the validation set loss value and the domain evaluation similarity score at the end of the first round of initial training on a small pre-trained dataset. At that time, Reduce to 0.75 times the current value; when At that time, maintain Unchanged; when At that time, The value was increased to 1.25 times the current value. The boundary values ​​of 1.5 and 0.8, and the adjustment ratios of 0.75 and 1.25 were determined iteratively through sensitivity experiments.

[0089] The specific implementation of step S03 is as follows: An intelligent agent for heterogeneous data mining of active ingredients in traditional Chinese medicine is constructed. The data acquisition and processing module uses three strategies—Boolean logic retrieval, time-limited retrieval, and journal-level filtering—to batch acquire PDF-format scientific literature from CNKI and PubMed databases. Completeness filtering, text quality filtering, relevance filtering, and timeliness filtering are then performed sequentially to eliminate low-quality data. The heterogeneous data mining module is driven by a multimodal progressive classification mining model for active ingredients in traditional Chinese medicine, performing batch mining of source information, basic structural information, bioactivity information, mechanism of action information, and application transformation information. The results are then batch-stored in Excel spreadsheets. The intelligent agent is encapsulated in the form of an MCP Server and deployed and published in the cloud using ModelScope.

[0090] The specific implementation of step S04 is as follows: A smart agent for quality control of active data of traditional Chinese medicine is constructed; a biomedical database engine dynamically obtains reference data from authoritative databases; and a fine-grained information comparator calculates the percentage deviation for numerical data using a numerical information comparator. For text-based data, a text information comparator is used to vectorize the text vectors using the bge-m3 model and then calculate the cosine similarity of the text vectors. Let the mined text vector be... The reference text vector is , To embed dimensions into the bge-m3 model, then... The calculation formula is as follows:

[0091]

[0092] In the formula, and They are vectors and of Norm, The cosine similarity is dimensionless, and its value ranges from 1 to 1. In the context of quality control of active data in traditional Chinese medicine, the actual range of values ​​is: The data quality assessor assigns a quality rating based on the comparison results: numerical information bias. satisfy The rating is excellent, meeting the requirements. The rating is good, which meets the requirements. The time rating is poor; the text vector cosine similarity is... satisfy The rating is excellent, meeting the requirements. The rating is good, which meets the requirements. Data with a rating of "poor" was determined through multiple rounds of expert validation experiments, using the combination of thresholds that yielded the highest classification accuracy. Data with a "poor" rating were labeled "poor" and retained for future reference.

[0093] The specific implementation of step S05 is as follows: a two-layer game optimization model is used to jointly optimize the retrieval parameters and quality control threshold. The upper-layer model aims to maximize the literature mining coverage, and the objective function is... The formula is as follows:

[0094]

[0095] In the formula, To achieve the current literature mining coverage, The baseline coverage rate is used, and both have the same dimensions; the ratio is... It is a dimensionless quantity. This is the optimal quality control threshold output by the lower-level model. As the baseline threshold, both have the same dimensions, and the ratio is... It is a dimensionless quantity. The dimensionless upper-level tradeoff coefficients are determined through grid search iteration. The objective function value is a dimensionless upper-level function, and the constraint condition is... , This represents the minimum proportion constraint threshold for dimensionless coverage. The lower-level model aims to maximize the data quality control pass rate, with the objective function... The formula is as follows:

[0096]

[0097] In the formula, This is the current quality control threshold. To meet the quality control threshold The number of data entries that pass quality control. The baseline data number is used, and both have the same units; the ratio is... It is a dimensionless quantity. The dimensionless lower-level coupling coefficients are determined through grid search iteration. The objective function value is a dimensionless lower-level function, and the constraint condition is... , This is a dimensionless minimum pass rate constraint threshold. Both objective functions contain coupling terms. This coupling term is a dimensionless quantity, reflecting the balance between literature mining coverage and quality control threshold. , and The results were obtained by initially running the two-agent system on small-scale pre-experimental data. and Determined through grid search iterations. and Determined through sensitivity analysis. Maximize. The obtained optimal search parameters are updated to the data mining agent for heterogeneous data of active ingredients in traditional Chinese medicine, maximizing... income Updated to the intelligent system for quality control of active data of traditional Chinese medicine.

[0098] The specific implementation of step S06 is as follows: Construct an intelligent agent to build a knowledge graph of active ingredients in traditional Chinese medicine (TCM). Establish a four-level knowledge graph schema layer, with active ingredients as first-level nodes, and five types of information, including source information, as second-level nodes. Each type of information has third-level and fourth-level nodes. Remove data with a poor quality rating, retaining data with excellent and good ratings. Use a multimodal progressive classification mining model for active ingredients in TCM to batch extract fourth-level structural information according to prompt word templates and split it into triples. Batch store the information in JSON or Excel format. After knowledge fusion and semantic disambiguation processing, write a data import tool to batch import the data into the Neo4J database, forming a knowledge graph of active ingredients in TCM. Write an incremental update tool to implement incremental updates of the knowledge graph. Finally, encapsulate the above modules into an MCP Server intelligent agent service, deploy and publish the service in the cloud using ModelScope, and link it to the large model system.

[0099] To better understand and implement this invention, the following is a specific application scenario of the invention, embodiment 2: In order to verify the effect of the invention, the technicians set up a test environment and systematically tested the complete technical process of the invention by selecting relevant literature on heat-clearing and detoxifying traditional Chinese medicine prescriptions as the research object.

[0100] Technicians first followed step S01 to collect scientific literature and database records related to heat-clearing and detoxifying formulas from PubMed, CNKI, and TCMSP databases. They compiled several records of active ingredients from herbs such as Coptis chinensis, Scutellaria baicalensis, Lonicera japonica, and Forsythia suspensa. After extracting molecular structure images, they normalized them to a resolution of 448×448 or lower and organized them into JSONL format training data. The dataset was then managed using the LLaMA-Factory framework.

[0101] Following step S02, using the Qwen3-VL 235B visual language basic model as the backbone, a LoRA fine-tuning strategy is employed for domain adaptation. The LoRA rank parameter is initially set to 32, and the learning rate is set to... Batch size 256, training epochs 3. During training, a dynamic weight adjustment function continuously monitors the ratio of validation set loss to training set loss, as well as the domain evaluation similarity score and the tradeoff coefficient. Take 0.5. For example... Figure 3 As shown, at the end of the second round of training, the adjustment factor The calculated result was 1.62, exceeding the overfitting threshold of 1.5. The system automatically adjusted the LoRA rank parameter from 32 to 24 (0.75 times the current value). During subsequent training, the adjustment factor returned to the normal range, and the model ultimately achieved a satisfactory evaluation result on the TextVQA evaluation set. The multimodal progressive classification mining model for active ingredients of traditional Chinese medicine showed good accuracy in the molecular structure image recognition of active ingredients such as berberine, baicalin, and chlorogenic acid, indicating that the progressive classification mechanism effectively compressed the candidate space for fine-grained recognition.

[0102] Following step S03, the data mining agent for heterogeneous active ingredients of traditional Chinese medicine performs batch mining on the collected PDF documents, extracting source information, basic structural information, bioactivity information, mechanism of action information, and application conversion information. The mining results of some active ingredients are shown in Table 1.

[0103] Table 1. Example of results from the mining of active ingredients in heat-clearing and detoxifying formulas.

[0104]

[0105] Following step S04, the intelligent agent for quality control of TCM active ingredient data retrieves reference data from the ChEMBL and TCMSP databases, using the scientific names of each active ingredient as anchors. For For numerical data, the numerical information comparator calculates the percentage deviation between the mined value and the reference value. For textual data such as action targets and pathways, the text information comparator converts the mined text and the reference text into high-dimensional vectors using a multilingual, multifunctional text embedding model and then calculates the cosine similarity. The quality control results for some active ingredients are shown in Table 2.

[0106] Table 2. Example of Quality Control Results for Active Ingredient Data

[0107]

[0108] As shown in Table 2, luteolin had a numerical deviation of more than 50% and a text cosine similarity of less than 50%, so it was rated as poor and marked with a quality label for retention; the other three active ingredients all passed quality control and entered the subsequent process.

[0109] Following step S05, the two-layer game optimization model jointly optimizes the retrieval parameters and the quality control threshold, with the upper-layer tradeoff coefficient... and lower layer coupling coefficient The optimized retrieval parameters and quality control thresholds, determined through grid search, are updated to the two agents respectively, and the coverage and pass rate are improved synchronously under constraints.

[0110] According to step S06, the intelligent agent constructing the knowledge graph of active ingredients of traditional Chinese medicine extracts triplets from data with quality ratings of excellent and good based on the knowledge graph schema layer, such as... Figure 3 The progressive classification results shown provide structured node information for triple extraction. After knowledge fusion and disambiguation, the information is imported into the Neo4J database in batches to form a knowledge graph of active ingredients in heat-clearing and detoxifying formulas and linked into the large model system.

[0111] Compared to traditional manual input and rule matching methods, the technological advancements of this invention are reflected in the following aspects: The progressive classification mechanism reduces the entropy of each classification decision layer by narrowing the category space layer by layer, thereby increasing the determinism of the identification process for multimodal heterogeneous data from an information theory perspective; The dynamic weight adjustment function solves the problem of model capacity and data scale mismatch under static parameter settings by real-time sensing of training status and adaptive adjustment of rank parameters; The two-layer game optimization model explicitly incorporates the balance between coverage and quality control pass rate into the objective function, ensuring the consistency of joint optimization from a mathematical structure perspective and avoiding the problem of one indicator degrading due to optimization of another; The introduction of text vector cosine similarity enables quality assessment to identify semantically equivalent information across languages ​​and expression modes, which has an essential advantage over literal matching methods in synonym processing.

[0112] It should be noted that the variables involved in this invention are explained in detail in Table 3.

[0113] Table 3. Variable Explanation Table

[0114]

[0115] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for mining active ingredients of traditional Chinese medicine based on a large model, characterized in that, Includes the following steps: We collected scientific literature data, database data, and PubChem data, and after cleaning, molecular structure image processing, and format standardization, we constructed a multimodal dataset of active ingredients of traditional Chinese medicine. Based on a multimodal dataset of active ingredients in traditional Chinese medicine, the LoRA fine-tuning strategy was used to fine-tune the visual language basic model for the domain. After verification and iterative optimization, a multimodal progressive classification and mining model for active ingredients in traditional Chinese medicine was constructed. Based on the multimodal progressive classification and mining model of active ingredients in traditional Chinese medicine, an intelligent agent for mining heterogeneous data of active ingredients in traditional Chinese medicine is constructed to batch mine source information, basic structural information, bioactivity information, mechanism of action information and application transformation information of PDF format scientific literature. A smart agent for quality control of active data of traditional Chinese medicine is constructed. Reference data is obtained through a biomedical database engine, deviations are calculated by a fine-grained information comparator, and the data quality evaluator is used to rate the quality of the mined data and label it with quality tags. A two-layer game optimization model is adopted to jointly optimize the retrieval parameters of the heterogeneous data mining agent of Chinese herbal active ingredients and the quality control threshold of the quality control agent of Chinese herbal active data. The optimized retrieval parameters are then updated to the heterogeneous data mining agent of Chinese herbal active ingredients and the optimized quality control threshold is then updated to the quality control agent of Chinese herbal active data. A knowledge graph of active ingredients in traditional Chinese medicine is constructed to build an intelligent agent. Data with quality ratings of "excellent" and "good" are extracted by triplet extraction, knowledge fusion and disambiguation processing and then imported into the Neo4J database in batches to form a knowledge graph of active ingredients in traditional Chinese medicine and linked into the large model system.

2. The method for mining active ingredients of traditional Chinese medicine based on a large model according to claim 1, characterized in that, The construction of the multimodal dataset of active ingredients of traditional Chinese medicine involves normalizing the molecular structure images to below a resolution threshold, batch processing them into JSONL format using a Python script, and each row of data containing the molecular structure image path, user query field, and model response field.

3. The method for mining active ingredients of traditional Chinese medicine based on a large model according to claim 2, characterized in that, The visual language basic model consists of three parts: a visual encoder, a cross-modal fusion layer, and a language decoder. The visual encoder uses a block attention mechanism to process molecular structure images, and the cross-modal fusion layer aligns the visual feature vector sequence with the text feature vector through a cross attention mechanism.

4. The method for mining active ingredients of traditional Chinese medicine based on a large model according to claim 3, characterized in that, The proposed multimodal progressive classification mining model for active ingredients in traditional Chinese medicine introduces a multi-scale classification optimization mechanism based on hierarchical soft maximum values. It progressively classifies the ingredients layer by layer according to four granularity levels: traditional Chinese medicine prescription layer, medicinal material layer, active ingredient layer, and molecular attribute layer. The layers are connected by a gating mechanism.

5. The method for mining active ingredients of traditional Chinese medicine based on a large model according to claim 4, characterized in that, The multimodal progressive classification and mining model for active ingredients of traditional Chinese medicine also introduces a dynamic weight adjustment function. The rank parameter of the LoRA low-rank fitting matrix is ​​dynamically adjusted according to the validation set loss value, the training set loss value, and the domain evaluation similarity score. The rank parameter is reduced when the adjustment factor meets the overfitting threshold and increased when it meets the underfitting threshold.

6. The method for mining active ingredients of traditional Chinese medicine based on a large model according to claim 5, characterized in that, The intelligent agent for heterogeneous data mining of active ingredients in traditional Chinese medicine has a data acquisition and processing module and a heterogeneous data mining module. The data acquisition and processing module combines three retrieval strategies—Boolean logic retrieval, time-limited retrieval, and journal-level filtering—to batch acquire scientific literature in PDF format.

7. The method for mining active ingredients of traditional Chinese medicine based on a large model according to claim 6, characterized in that, The basic structural information includes molecular structural information and molecular comprehensive attributes. The molecular comprehensive attributes include atomic composition and connection relationships, molecular formula information, functional group identification, bond type and properties, and stereochemical information. For molecular comprehensive attributes that cannot be obtained from PDF format scientific literature, a multimodal progressive classification mining model of active ingredients of traditional Chinese medicine is used to complete the information based on the two-dimensional molecular structural information.

8. The method for mining active ingredients of traditional Chinese medicine based on a large model according to claim 7, characterized in that, The intelligent agent for quality control of active Chinese medicine data consists of five parts: a data loading module, an anchor point control module, a biomedical database engine, a fine-grained information comparator, and a data quality evaluator. The anchor point is the scientific name, chemical structure, or unique ID number of the active ingredient in the biomedical database.

9. The method for mining active ingredients of traditional Chinese medicine based on a large model according to claim 8, characterized in that, The fine-grained information comparator calculates the percentage deviation for numerical data using a numerical information comparator, and calculates the cosine similarity of text vectors after vectorization based on a multilingual multifunctional text embedding model for text data using a text information comparator.

10. The method for mining active ingredients of traditional Chinese medicine based on a large model according to claim 9, characterized in that, The data quality evaluator rates the data as excellent, good, or poor based on the numerical information deviation threshold and the text vector cosine similarity threshold. Data rated as poor is labeled as poor and then retained.