A live cell analysis method and system based on large models and formal verification
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SAIL SPACE (SUZHOU) INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-02-26
- Publication Date
- 2026-06-09
AI Technical Summary
Existing live-cell microscopic image analysis software suffers from problems such as difficulty in module selection, reliance on human experience, lack of logical verification, inability to output high-order biological indicators, and fragmented analysis processes when facing complex biological research, leading to misleading conclusions and inefficient automation.
A large language model is used for context injection and intent reasoning. Combined with formal verification and conflict self-healing mechanism, analysis code is generated and logical verification is performed to build an end-to-end analysis pipeline.
It enables the automated generation of analysis code from natural language requirements, ensuring the logical rationality of the analysis pipeline, avoiding misleading conclusions, lowering the research threshold, and promoting in-depth data exploration.
Smart Images

Figure CN122176699A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of bioinformatics and artificial intelligence, and in particular to a live cell analysis method and system based on large models and formal verification. Background Technology
[0002] In the field of live-cell microscopy image analysis, to address the diversity of biological experiments, the industry currently widely adopts a "modular pipeline" approach. Examples include open-source tools (such as CellProfiler, KNIME, and Icy) and commercial software (such as Imaris and Arivis). Although the user interfaces of different software vary (some use linear lists, others use connected nodes), their core technical logic remains consistent: the software comes pre-loaded with a "tool library" containing numerous image processing algorithms. Users need to manually select several modules from the tool library according to experimental requirements, and define the execution order and parameters of these modules to assemble an analysis pipeline for processing image data.
[0003] This approach solves some general analytical problems, but when faced with complex and exploratory biological research, this type of technical architecture has the following inherent limitations. Firstly, existing software toolkits typically contain hundreds of functionally subdivided algorithm modules (e.g., various thresholding, filtering, and morphological processing modules), each involving a large number of specialized parameters. For biological researchers lacking computational backgrounds, the trial-and-error cost of finding the correct combination from a massive number of modules is extremely high, often leading to a dilemma of "not knowing which to choose or how much to fill in." Secondly, existing modular assembly relies heavily on human experience, and the software can only perform basic data type checks (e.g., whether the input is an image). The system cannot understand the user's biological intent and lacks an automatic verification mechanism for the logical rationality of the pipeline. For example, when a user incorrectly combines conflicting modules, or the constructed process fails to derive the expected biological conclusions, the software often fails to issue a warning, resulting in invalid data output or even misleading research conclusions. Furthermore, existing software typically only outputs low-level physical feature data (e.g., pixel intensity, object coordinates, trajectory points), and cannot directly output high-level biological indicators (e.g., contact inhibition rate, cell division cycle, etc.). After obtaining the software output, users still need to perform tedious data cleaning and logic reprogramming in external software, which leads to a break in the analysis process and makes it impossible to achieve end-to-end automated analysis. Summary of the Invention
[0004] To overcome the above-mentioned shortcomings, the present invention aims to provide a live cell analysis method and system based on large models and formal verification, which utilizes large language models to generate analysis code and combines formal methods for logical verification to analyze live cell microscopic images.
[0005] To achieve the above objectives, the technical solution adopted by this invention is: a live cell analysis method based on large models and formal verification, comprising:
[0006] Context injection and intent reasoning: receive natural language and analyze the natural language using a large language model, infer the required algorithm modules and output a candidate configuration file; Formal logical verification involves reading the candidate configuration file and converting it into standardized logical constraint code, then verifying the logical constraint code using a solver. Conflict self-healing and iteration: If the solver verification fails, the conflict core is taken, and the connection method of the candidate configuration file or the algorithm module is modified according to the arbitration strategy and the logical constraint code is updated until the solver verification passes. The analysis pipeline is instantiated and constructed. If the solver verification is successful, an executable analysis pipeline is constructed to perform live cell analysis based on the finally determined candidate configuration file.
[0007] Furthermore, the aforementioned conflict self-healing and iteration specifically include: Extract the minimum core set that leads to the conflict and mark the source of the conflict components, including objective facts, user instructions and biological common sense; The arbitrator routes the conflict to different processing paths based on the priority logic among the objective facts, the user instructions, and the biological common sense.
[0008] Furthermore, the processing path includes an automatic repair path and a human-machine negotiation path; When the biological common sense contradicts the objective facts or the biological common sense conflicts with the user instructions, the automatic repair path is entered to correct the connection method of the candidate configuration file or the algorithm module and update the logical constraint code, and the logical formal verification is performed again. When the user instruction violates the objective facts or the user instruction is logically mutually exclusive, the human-computer negotiation path is entered, and the user is presented to the user through a front-end interactive card. Based on the user's decision feedback, a new context is formed, which re-triggers the context injection and intent reasoning.
[0009] Furthermore, when the biological common sense contradicts the objective facts, the arbitration strategy is to automatically suppress the biological common sense and force the objective facts to prevail; when the biological common sense conflicts with the user command, the arbitration strategy is to automatically comply with the user command and ignore the biological common sense; when the user command contradicts the objective facts, the arbitration strategy is to generate a correction proposal; when the user command is logically mutually exclusive, the arbitration strategy is to generate ambiguous options.
[0010] Furthermore, the priority logic is that the priority of the objective facts is greater than the priority of the user instructions, and the priority of the user instructions is greater than the priority of the biological common sense.
[0011] Furthermore, the context injection and intent reasoning specifically include: It receives the user's natural language, performs a hybrid retrieval of tools / knowledge bases, and forms an enhanced context pool; The large language model analyzes user needs based on the context in the enhanced context pool and performs intent decomposition; Determine if any key information in the intent is missing; If no missing modules are found, the required algorithm modules are inferred and a candidate configuration file is output.
[0012] Furthermore, if the missing key information is detected, the type of missing key information is determined. If the user's instruction intent is ambiguous, the user is questioned and natural language is received again. If objective facts or biological common sense are missing, it is determined whether the number of searches for objective facts or biological common sense is less than a set threshold. If so, the enhanced context pool is queried and searched again. If not, the required algorithm module is inferred and a candidate configuration file is output.
[0013] Furthermore, the solver is a Z3 solver.
[0014] Furthermore, the system terminates when the solver outputs a system error.
[0015] This invention also discloses a live-cell analysis system based on a large model and formal verification, employing the above-described method. The system includes: The context construction and intent reasoning module receives natural language, analyzes it using a large language model, infers the required algorithm modules, and outputs a candidate configuration file. The formal verification module reads the candidate configuration file and converts it into standardized logical constraint code, and then verifies the logical constraint code through a solver. The conflict resolution and arbitration module, if the solver verification fails, takes the conflict core, modifies the connection method of the candidate configuration file or the algorithm module according to the arbitration strategy and updates the logical constraint code until the solver verification passes; The analysis pipeline construction module, if the solver verification is successful, constructs an executable analysis pipeline for live cell analysis based on the finally determined candidate configuration file.
[0016] The beneficial effects of this invention are as follows: By employing large language model intent recognition technology, it solves the problem of users struggling to choose from a vast array of algorithmic tools, achieving automated generation from natural language requirements to analysis code, significantly lowering the threshold for scientific research. It introduces a formal verification mechanism (solver) to address the logical self-consistency verification problem in the analysis pipeline construction process, ensuring that the generated analysis pipeline strictly conforms to the user's biological intent logically, avoiding the risk of the program running successfully but arriving at incorrect conclusions. By constructing a priority conflict self-healing and iterative procedure, it solves the problem of automatic attribution and repair when multi-source information is inconsistent. It utilizes a large language model to generate analysis code and combines it with formal methods for logical verification to analyze live cell microscopic images. Attached Figure Description
[0017] Figure 1 The flow of the method in the embodiments of the present invention Figure 1 ; Figure 2 The flow of the method in the embodiments of the present invention Figure 2 ; Figure 3 The flow of the method in the embodiments of the present invention Figure 3 ; Figure 4 The flow of the method in the embodiments of the present invention Figure 4 . Detailed Implementation
[0018] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby providing a clearer and more explicit definition of the scope of protection of the present invention.
[0019] This invention provides a live-cell analysis method based on a large model and formal verification, see appendix. Figure 1 As shown, it includes: S100, Context Injection and Intent Reasoning.
[0020] Step S100 involves receiving natural language and analyzing it using a large language model to infer the required algorithm modules and output a candidate configuration file. The algorithm model is stored in the tool and database. Through natural language analysis, the user's intent is understood, the required algorithm modules are inferred, and a candidate configuration file is output. The candidate configuration file only describes what to do and does not contain the specific execution code.
[0021] See appendix Figure 2 As shown, step S100 specifically includes: S101. Receive the user's natural language, perform a hybrid search on the tools / knowledge base, and form an enhanced context pool.
[0022] The retrieval process executes vector retrieval and keyword retrieval in parallel. Retrieval results are reordered and injected into an enhanced context pool. Tools are predefined and include specific usage methods. To address the issue of context explosion caused by injecting a large number of tools at once, all tools use hybrid retrieval (keyword matching + vector retrieval). Specifically, an object-relational database management system (PostgreSQL) is used for storage, combined with an extension of the vector database PGVector to support vector search. Vector generation uses the Qwen3-Embedding-0.6B model. During retrieval, a hybrid retrieval strategy is adopted, generating search terms from a large language model while simultaneously performing keyword matching and vector similarity search. Finally, the number of topk1 results (e.g., 20) from the initial screening is reordered using Qwen3-Reranker-0.6B. A specified number of topk2 results (e.g., 10) and results with vector matching scores exceeding a specified threshold (e.g., 0.75) are then selected as the final returned retrieval results.
[0023] The knowledge base also employs a hybrid search approach, but instead of storing tools, it stores various related documents. Specifically, these include hardware, software, operational information, and related biological knowledge.
[0024] For example, if a user wants to conduct an experiment and needs to see the cell segmentation results of a phase contrast map, the large language model will automatically analyze keywords such as "cell segmentation" and "phase contrast map cell segmentation" to search for relevant tools and knowledge base information through the above process.
[0025] S102. The large language model analyzes user needs based on the context in the enhanced context pool and performs intent decomposition.
[0026] For example, for complex intent requirements, such as a user requesting segmentation, then counting the number of cells based on the segmentation results, and finally outputting a report, the large language model will break it down into multiple tasks: 1. Segmenting cells; 2. Counting the segmentation results; 3. Exporting the counting results into a table.
[0027] S103. Determine if any key information in the intent is missing.
[0028] S104. If there are no missing modules, infer the required algorithm modules and output a candidate configuration file.
[0029] For example, if the intent is cell segmentation → counting → reporting, then the information of the required functional modules retrieved is shown in Table 1. The final output is a candidate configuration file assembled based on the retrieved functional module information.
[0030] Table 1
[0031] S105. If key information is detected to be missing, determine the type of missing key information.
[0032] S106. If the user's instruction is ambiguous, then ask the user and re-receive the user's natural language.
[0033] S107. If objective facts or biological common sense are lacking, determine whether the number of searches is less than the set threshold.
[0034] If yes, then query again and return to step 102; if no, then return to step S104.
[0035] If key information is detected to be missing, the system will automatically generate a query and execute a search. For example, the threshold is 3, and the loop has a maximum number of retries to prevent infinite loops.
[0036] S200, Logical Formal Verification.
[0037] The candidate configuration file is read and converted into standardized logical constraint code, which is then verified by the solver. The candidate configuration file output in step S100 is converted into standardized logical constraint code, adapted to the solver standard. The solver core solves the logical constraint code.
[0038] In one embodiment, the solver is a Z3 solver or another SMT solver.
[0039] S300, Conflict Self-Healing and Iteration.
[0040] If the solver verification fails, the conflict core is identified, and the connection method of the candidate configuration file or algorithm module is modified according to the arbitration strategy, and the logical constraint code is updated until the solver verification passes. In this embodiment, by constructing a priority-based conflict self-healing and iteration mechanism, the problem of automatic attribution and repair when there is inconsistency in multi-source information is solved.
[0041] See appendix Figure 3 As shown, step S300 specifically includes: S301. Extract the minimum core set that leads to the conflict and mark the source of the conflict components. The source marks include objective facts, user instructions and biological common sense.
[0042] User commands are represented by U, objective facts by T, and common biological knowledge by M.
[0043] S302, the arbitrator routes conflicts to different processing paths based on priority logic among objective facts, user instructions, and biological common sense.
[0044] The priority logic is that objective facts have a higher priority than user instructions, and user instructions have a higher priority than biological common sense, that is, T > U > M. The priority is set manually.
[0045] In one embodiment, the processing path includes an automatic repair path and a human-machine negotiation path.
[0046] See appendix Figure 4 As shown, when biological common sense contradicts objective facts or conflicts with user instructions, the system enters the automatic repair path, corrects the connection method of candidate configuration files or algorithm modules, updates the logical constraint code, and re-performs logical formal verification. When user instructions contradict objective facts or are logically mutually exclusive, the system enters the human-computer negotiation path, displays the information to the user through front-end interactive cards, and generates a new context based on the user's decision feedback, re-triggers context injection and intent reasoning.
[0047] When common biological knowledge contradicts objective facts, such as when a specific experimental sample (T) does not conform to general biological characteristics (M), the arbitration strategy is to automatically suppress common biological knowledge and force the objective facts to prevail. When common biological knowledge conflicts with user instructions, such as when a user specifically seeks out cells with "abnormal morphology," the arbitration strategy is to automatically comply with the user instructions and ignore common biological knowledge.
[0048] When user instructions contradict objective facts, such as a user requesting analysis of non-existent image channels, the arbitration strategy is to generate a correction proposal. For example, a correction proposal might be: "Only two channels have been detected; parameter modification is recommended." When the task is impossible to complete, such as when a user requests image analysis but no image is provided, the solver's solution will certainly be unsatisfactory. In this case, the large language model will automatically generate a correction proposal based on feedback and submit it to the user.
[0049] When user commands are logically mutually exclusive, the arbitration strategy is to generate ambiguous options. For example, the ambiguous options are: either option A or option B. The user requests to find the correct phase difference map for segmentation, then count the segmentation results, and finally find the map with more than 100 cells but less than 50 cells and output it to a specified folder. The two conditions of more than 100 cells and less than 50 cells cannot be met at the same time. It is recommended that the user change to filtering for cells with more than 100 cells or less than 50 cells.
[0050] For example, if the conflict type is T vs M, then during the processing: Source tracing: Extracting the core conflict and component markers, where: [T] Truth (facts / search results): 2; -T_Segment_output_is_TensorHW1_int8 (Fact: The Segment module outputs int8); -T_Count_input_is_TensorHW1_int32 (Fact: The Count module requires int32 input); [M] Model (Common Sense / LLM Decision Making): 2 -M_LLM_connects_Segment_to_Count (Common sense: LLM assumes that a segment should be connected to a count); -M_LLM_expects_Count_type_match (Common sense: LLM assumes that Count can handle mask).
[0051] Then, conflict type routing is arbitrated. If the large language model considers it concatenable versus the actual type mismatch, the policy is to automatically suppress it, with the actual type mismatch (T) taking precedence over the LLM's consideration of concatenation (M). Here, the large language model will determine that the tools are insufficient, try to re-query the int8 to int32 module in the tool library, then update the functional assumptions and target state, and re-run the formal verification process to generate new logical constraint code.
[0052] S400, analyze pipeline instantiation construction.
[0053] If the solver passes verification, an executable analysis pipeline for live cell analysis is constructed based on the finalized candidate configuration file. The large language model generates an analysis pipeline in JSON format, similar to the following, based on the formally solved code. A dedicated parsing module then parses this JSON and automatically constructs the relevant analysis pipeline.
[0054] In existing technologies, verifying a new biological hypothesis often requires users to manually dismantle old connections, find new modules, and reconfigure parameters. This cumbersome engineering reconstruction stifles many exploratory attempts. This embodiment achieves semantic-level modification of the analysis process rather than operational-level reconstruction through natural language-driven dynamic orchestration and automated parameter alignment technology. When users need to adjust experimental logic, there is no need for manual intervention in the underlying complex module topology. The system can automatically replace underlying algorithm modules, reorganize connection relationships, and adaptively adjust parameter thresholds based on new semantic instructions. This mechanism frees users from inefficient software debugging, allowing them to focus on the deduction and verification of biological logic, greatly promoting the high-frequency iteration of the "hypothesis-verification-correction" cycle in scientific research, and enabling scientists without programming backgrounds to conduct in-depth data exploration.
[0055] In this embodiment, a large language model intent recognition technology is used to address the difficulty users face in choosing from a vast array of algorithmic tools, enabling automated generation of analysis code from natural language requirements and significantly lowering the barrier to scientific research. A formal verification mechanism (solver) is introduced to address the logical self-consistency verification problem during the analysis pipeline construction process, ensuring that the generated analysis pipeline strictly conforms to the user's biological intent logically, avoiding the risk of the program running but arriving at incorrect conclusions. By constructing a priority conflict self-healing and iterative procedure, the problem of automatic attribution and repair when multi-source information is inconsistent is solved. Analysis code is generated using a large language model and logically verified using formal methods to analyze live cell microscopic images.
[0056] In one embodiment, the system terminates when the solver outputs a system error.
[0057] In one embodiment, a live cell analysis system based on a large model and formal verification is also disclosed. Using the above-described method, the system includes: a context construction and intent reasoning module, a formal verification module, a conflict resolution and arbitration module, and an analysis pipeline construction module.
[0058] The Context Construction and Intent Inference module receives natural language and analyzes it using a large language model to infer the required algorithm modules and output a candidate configuration file. This module includes a Context Construction and Enhancement unit and an Intent Inference and Configuration Generation unit. The Context Construction and Enhancement unit receives user commands and image metadata, uses RAG technology to retrieve tool libraries, constructs enhanced context, and provides accurate tool descriptions for the large model. The Intent Inference and Configuration Generation unit uses the large language model to map natural language requirements to specific combinations of algorithm modules and parameter settings based on the context. The large language model does not directly generate code but outputs an intermediate representation (IR) or configuration file (such as JSON / YAML format) in a specific format. This file describes the module's topology, parameter thresholds, and data flow logic.
[0059] The formal verification module reads candidate configuration files and transforms them into standardized logical constraint code, which is then verified by the solver. The formal verification module converts the generated configuration files into logical constraints recognizable by the SMT solver. Based on preset axiomatic assumptions (such as biological common sense) and tool contracts (input / output constraints), it deduces the process described in the configuration file. If logical conflicts exist (such as type mismatches or violations of common sense), it returns "unsatisfiable" and blocks execution.
[0060] The conflict resolution and arbitration module is used to extract the core conflict when the solver verification fails, and to modify the connection method of the candidate configuration file or algorithm module and update the logical constraint code according to the arbitration strategy until the solver verification passes.
[0061] The analysis pipeline construction module, if the solver verification is successful, constructs an executable analysis pipeline for live cell analysis based on the finalized candidate configuration file. This module includes a parser and a heterogeneous execution kernel. The parser receives the verified configuration file and parses it into a specific task instruction graph. The heterogeneous execution kernel, as the system's computational entity, schedules computational resources according to the parser's instructions. This kernel can integrate various computational backends, including but not limited to traditional image processing algorithm libraries (for morphological operations), deep learning inference engines (for high-precision segmentation / denoising), or high-performance numerical computation libraries. It is responsible for executing specific image processing and logistic statistical tasks and outputting the final analysis results.
[0062] The system utilizes a large language model to transform users' unstructured requirements into structured pipelined configuration files, rather than uncontrollable executable code. Before execution, the system formally verifies the logical consistency and data constraints of the configuration file using a solver. Verified configuration files are read by a dedicated parser, which then schedules the underlying high-performance computing kernel to complete the computation, thus ensuring both computational efficiency and the reliability of the analysis logic.
[0063] The above embodiments are only for illustrating the technical concept and features of the present invention. Their purpose is to enable those skilled in the art to understand the content of the present invention and implement it. They should not be used to limit the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A live-cell analysis method based on large models and formal verification, characterized in that: include: Context injection and intent reasoning: receive natural language and analyze the natural language using a large language model, infer the required algorithm modules and output a candidate configuration file; Formal logical verification involves reading the candidate configuration file and converting it into standardized logical constraint code, then verifying the logical constraint code using a solver. Conflict self-healing and iteration: If the solver verification fails, the conflict core is taken, and the connection method of the candidate configuration file or the algorithm module is modified according to the arbitration strategy and the logical constraint code is updated until the solver verification passes. The analysis pipeline is instantiated and constructed. If the solver verification is successful, an executable analysis pipeline is constructed to perform live cell analysis based on the finally determined candidate configuration file.
2. The method according to claim 1, characterized in that: The conflict self-healing and iteration specifically include: Extract the minimum core set that leads to the conflict and mark the source of the conflict components, including objective facts, user instructions and biological common sense; The arbitrator routes the conflict to different processing paths based on the priority logic among the objective facts, the user instructions, and the biological common sense.
3. The method according to claim 2, characterized in that: The processing path includes an automatic repair path and a human-machine negotiation path; When the biological common sense contradicts the objective facts or the biological common sense conflicts with the user instructions, the automatic repair path is entered to correct the connection method of the candidate configuration file or the algorithm module and update the logical constraint code, and the logical formal verification is performed again. When the user instruction violates the objective facts or the user instruction is logically mutually exclusive, the human-computer negotiation path is entered, and the user is presented to the user through a front-end interactive card. Based on the user's decision feedback, a new context is formed, which re-triggers the context injection and intent reasoning.
4. The method according to claim 3, characterized in that: When the biological common sense contradicts the objective facts, the arbitration strategy is to automatically suppress the biological common sense and force the objective facts to prevail; when the biological common sense conflicts with the user command, the arbitration strategy is to automatically comply with the user command and ignore the biological common sense; when the user command contradicts the objective facts, the arbitration strategy is to generate a correction proposal; when the user command is logically mutually exclusive, the arbitration strategy is to generate ambiguous options.
5. The method according to claim 2, characterized in that: The priority logic is that the priority of the objective facts is greater than the priority of the user instructions, and the priority of the user instructions is greater than the priority of the biological common sense.
6. The method according to claim 1, characterized in that: The context injection and intent reasoning specifically include: It receives the user's natural language, performs a hybrid retrieval of tools / knowledge bases, and forms an enhanced context pool; The large language model analyzes user needs based on the context in the enhanced context pool and performs intent decomposition; Determine if any key information in the intent is missing; If no missing modules are found, the required algorithm modules are inferred and a candidate configuration file is output.
7. The method according to claim 6, characterized in that: If the missing key information is detected, the type of missing key information is determined. If the user's instruction intent is ambiguous, the user is questioned and natural language is received again. If objective facts or biological common sense are missing, it is determined whether the number of searches for objective facts or biological common sense is less than a set threshold. If so, the enhanced context pool is queried and searched again. If not, the required algorithm module is inferred and a candidate configuration file is output.
8. The method according to claim 1, characterized in that: The solver is the Z3 solver.
9. The method according to claim 1, characterized in that: The system terminates when the solver outputs a system error.
10. A live-cell analysis system based on large models and formal verification, characterized in that: The system comprising the method according to any one of claims 1-9, wherein the system includes: The context construction and intent reasoning module receives natural language, analyzes it using a large language model, infers the required algorithm modules, and outputs a candidate configuration file. The formal verification module reads the candidate configuration file and converts it into standardized logical constraint code, and then verifies the logical constraint code through a solver. The conflict resolution and arbitration module, if the solver verification fails, takes the conflict core, modifies the connection method of the candidate configuration file or the algorithm module according to the arbitration strategy and updates the logical constraint code until the solver verification passes; The analysis pipeline construction module, if the solver verification is successful, constructs an executable analysis pipeline for live cell analysis based on the finally determined candidate configuration file.