Image inpainting method based on automated evaluation and dynamic optimization and related devices

By combining a multimodal large model with an anomaly detection rule base, the mask boundary of the repair area is dynamically expanded and a closed-loop processing flow is formed by using an intelligent adjustment toolchain. This solves the problems of unstable repair quality and low efficiency of manual intervention in existing technologies, and achieves efficient and automated image repair results.

CN120876322BActive Publication Date: 2026-01-06深圳市睿观信息科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511383261.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2026-01-06
Estimated Expiration
2045-09-26

AI Technical Summary

Technical Problem

Existing image restoration technologies suffer from unstable restoration quality in complex scenarios, low efficiency due to manual intervention, and a lack of automated closed-loop processing mechanisms, resulting in insufficient naturalness and reasonableness of restoration results. Furthermore, the fragmented processing flow leads to efficiency fluctuations.

Method used

A multimodal large model combined with an anomaly detection rule base is used for automated quality assessment. The mask boundary of the repair area is dynamically expanded, anomaly perception is enhanced through a channel attention network, and targeted optimization is carried out in combination with an intelligent adjustment toolchain to form a closed-loop processing flow. A finite state machine is used to manage the four-stage cycle of repair-assessment-optimization, and the model parameters are dynamically adjusted to adapt to different scenarios.

Benefits of technology

It achieves stable and consistent repair quality in complex scenarios, reduces manual intervention, improves repair efficiency and reliability, ensures texture consistency, lighting matching and semantic rationality, adapts to diverse application scenarios and optimizes user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120876322B_ABST
    Figure CN120876322B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer vision and artificial intelligence, in particular to an image repairing method based on automatic evaluation and dynamic optimization and related equipment. The method comprises the following steps: acquiring an image to be repaired and a corresponding repairing area; performing repairing processing on the image to be repaired to generate an initial repairing result; performing automatic quality evaluation on the initial repairing result by using a multimodal large model in combination with an abnormality detection rule base to obtain an evaluation result; based on the evaluation result, if it is determined that the repairing quality is substandard, calling an intelligent adjustment tool chain to perform targeted optimization on the initial repairing result to generate an optimized repairing result; repeatedly performing the quality evaluation and optimization steps on the optimized repairing result until the repairing quality is up to standard, thereby forming a closed-loop processing flow. The application has the effects of improving the repairing quality in complex scenes in the image repairing technology, improving the image repairing efficiency, and increasing the automatic closed-loop processing mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer vision and artificial intelligence, and in particular to image restoration methods and related equipment based on automated evaluation and dynamic optimization. Background Technology

[0002] Current mainstream image inpainting techniques (such as deep learning models like FLUX-Controlnet-Inpainting and Stable Diffusionv2 inpainting) suffer from unstable inpainting quality in complex scenes. For example, in areas with high texture, text interference, or incomplete mask coverage, problems such as content inconsistency, color abrupt changes, or geometric distortion can easily occur, resulting in insufficient naturalness and semantic rationality of the inpainting results.

[0003] Traditional image restoration processes rely heavily on manual intervention, which has significant efficiency bottlenecks. Users need to manually check the restoration results and use professional tools such as Photoshop's generative extensions and DxO ViewPoint for secondary adjustments. This process is not only time-consuming but also highly dependent on the operator's professional skills, making it difficult to meet efficiency requirements in batch processing or real-time application scenarios.

[0004] Existing image restoration systems generally suffer from a fragmented processing flow, with restoration, quality assessment, and optimization stages operating independently. For example, while tools like Luminar Neo support some AI adjustment functions, users still need to actively trigger the operation, making it impossible to achieve real-time analysis and dynamic optimization of restoration quality, resulting in efficiency fluctuations and unstable quality.

[0005] In summary, existing technologies have significant shortcomings in terms of the naturalness and rationality of image restoration in complex scenarios, the efficiency of manual intervention, and the automated closed-loop mechanism, which urgently need to be addressed through technological innovation. Summary of the Invention

[0006] The purpose of this application is to provide an image restoration method and related equipment based on automated evaluation and dynamic optimization, aiming to solve the problems of unstable restoration quality, low efficiency of manual intervention, and lack of automated closed-loop processing mechanism in complex scenarios in image restoration technology.

[0007] The purpose of this application is to provide an image inpainting method based on automated evaluation and dynamic optimization, including:

[0008] Obtain the image to be repaired and the corresponding repair area;

[0009] The image to be repaired is processed to generate an initial repair result;

[0010] The initial repair results are automatically evaluated using a multimodal large model combined with an anomaly detection rule base to obtain the evaluation results;

[0011] Based on the evaluation results, if the repair quality is deemed substandard, the intelligent adjustment toolchain is invoked to optimize the initial repair results and generate optimized repair results.

[0012] The quality assessment and optimization steps are repeated on the optimized repair results until the repair quality meets the standards, forming a closed-loop processing flow.

[0013] By adopting the above technical solutions, the image to be repaired and the repair area can be automatically acquired and repaired. Automated quality assessment is achieved using a multimodal large model and anomaly detection rule base. When the repair quality is substandard, an intelligent adjustment toolchain is invoked for targeted optimization, forming a closed-loop processing flow. This effectively solves the problem of unstable repair quality in complex scenarios in existing technologies, ensuring the naturalness and accuracy of the repair results in terms of texture consistency, lighting matching, and semantic rationality. At the same time, it reduces the reliance on manual inspection and secondary adjustments, lowers the professional skill threshold, and improves batch processing efficiency. The automated closed-loop mechanism achieves seamless connection between repair, assessment, and optimization, avoiding efficiency fluctuations caused by fragmented processing flows, and significantly improving the reliability and processing efficiency of image restoration.

[0014] In one possible implementation, this application utilizes a multimodal large model combined with an anomaly detection rule base to perform automated quality assessment of the initial repair results, including:

[0015] A gradient-weighted region growing algorithm is used to dynamically extend the mask boundary of the repaired region to a context region that includes the edges of the text region, the texture transition region, and the boundary of the structural feature, forming an extended evaluation region.

[0016] Multi-scale feature extraction is performed on the extended evaluation region and its neighborhood, and the ability to perceive color abrupt changes, geometric distortions, and artifacts is enhanced through a channel attention network.

[0017] Based on the multimodal large model, the texture consistency, lighting matching degree and semantic rationality of the repaired area are jointly analyzed, and the defect template matching results of the anomaly detection rule base are combined to generate quality assessment indicators and defect location reports.

[0018] By adopting the above technical solution, the gradient-weighted region growing algorithm is used to dynamically expand the mask boundary of the repair area to the text area edge, texture transition area and other context areas, which can comprehensively cover the potential impact range and avoid evaluation omissions. Multi-scale feature extraction is performed on the expanded evaluation area and its neighborhood, and the perception ability of anomalies such as color mutations is enhanced by channel attention network, which can accurately capture the subtle defects of the repair area. Combined with the joint analysis of texture consistency, lighting matching degree and semantic rationality by multimodal large model and defect template matching of anomaly detection rule base, quantitative quality assessment indicators and accurate defect location reports can be generated from visual features and semantic level. This significantly improves the comprehensiveness, accuracy and semantic understanding of repair quality assessment, provides accurate basis for subsequent targeted optimization, and effectively solves the problems of incomplete assessment and inaccurate anomaly detection in the existing technology.

[0019] In one possible implementation of this application, the step of invoking the intelligent adjustment toolchain to perform targeted optimization of the initial repair result includes:

[0020] By using a knowledge graph-based problem decomposition engine, the repair requirements are decomposed into a sequence of atomic operations, which includes at least denoising operations, edge alignment operations, and texture synthesis operations.

[0021] Based on the atomic operation sequence, an optimized tool call order is generated;

[0022] Dynamically invoke dedicated tools within the intelligent adjustment toolchain;

[0023] Using a spectrum segmentation-based erasure tool, text frequency bands are located through wavelet transform to achieve traceless erasure;

[0024] The mask range is dynamically optimized by using a mask adjustment tool that supports smearing gestures, combined with a graph cut algorithm.

[0025] By using prompt word tools to perform semantic parsing of repair instructions, targeted optimization instructions that drive the generation model are generated;

[0026] The parameters of the specialized tools in the intelligent adjustment toolchain are automatically adjusted using a Bayesian optimization algorithm.

[0027] By adopting the above technical solutions, and leveraging a knowledge graph-based problem decomposition engine, the repair requirements are broken down into a sequence of atomic operations, including denoising, edge alignment, and texture synthesis. This allows complex repair tasks to be broken down into standardized processes. Combined with an optimized tool call sequence, intelligent task scheduling is achieved. When dynamically calling specialized tools, the spectrum segmentation-based erasing tool uses wavelet transform to accurately locate text frequency bands for seamless erasing. The mask adjustment tool, which supports smearing gestures, dynamically optimizes the mask range using graph cut algorithms. The prompt word tool performs semantic parsing of repair instructions to generate targeted optimized instructions. At the same time, a Bayesian optimization algorithm is used to automatically adjust tool parameters. This not only automates and refines the repair process, solving the problem of low efficiency caused by manual intervention, but also accurately handles complex scenarios such as text interference and inaccurate masks, improving the naturalness and consistency of the repair results. Automatic parameter optimization reduces the cost of manual trial and error, significantly improving the efficiency and quality of image repair.

[0028] In one possible implementation of this application, the closed-loop processing flow includes:

[0029] A finite state machine is used to manage a four-stage loop, which includes an evaluation state, a decision state, an execution state, and a verification state, wherein:

[0030] The assessment status is used to receive quality assessment indicators. If the repair quality does not meet the standards, the process will proceed to the decision-making status.

[0031] The decision state is used to invoke strategies based on the defect location report generation tool and transition to the execution state;

[0032] The execution state is used to invoke the intelligent adjustment toolchain to implement repairs and then transition to the verification state.

[0033] The verification status is used to compare the optimization and repair results with the preset quality threshold. If it fails, it returns to the evaluation status.

[0034] The intermediate results generated from each state processing in the four-stage loop are cached and persisted.

[0035] By adopting the above technical solution, a four-stage cycle including evaluation, decision-making, execution, and verification is managed using a finite state machine. This ensures that each step of the repair process is seamlessly connected. In the evaluation stage, optimization is initiated based on quality assessment indicators. In the decision-making stage, a precise tool invocation strategy is generated based on the defect location report. In the execution stage, the toolchain is invoked to implement the repair. In the verification stage, the repair effect is ensured by comparing with preset quality thresholds. If the quality does not meet the standards, the process automatically returns to the evaluation stage for re-optimization. At the same time, intermediate results of each stage are cached and persisted to avoid redundant calculations. This not only achieves an automated closed loop for repair quality assessment and optimization, solving the problem of fragmented processes in existing technologies, but also improves the controllability and stability of the process through state machine control. The caching mechanism effectively improves batch processing efficiency, ensuring a high success rate of repair while reducing quality fluctuations, and significantly improving the automation level and processing efficiency of image repair.

[0036] In one possible implementation of this application, the method further includes:

[0037] Obtain user feedback on the final repair result and manual adjustment data to build a reward model, wherein the final repair result is a repair result that has been verified to meet the standards through a closed-loop processing flow;

[0038] Based on the reward model, the evaluation weight of the multimodal large model and the defect matching threshold of the anomaly detection rule base are dynamically adjusted.

[0039] For special scenarios where the repair difficulty exceeds a preset complexity threshold, a lightweight model parameter adjustment technique is used to optimize the parameters of a multimodal large model with small samples, generating a scenario-specific evaluation model.

[0040] By adopting the above technical solutions, user feedback on the final repair results and manual adjustment data are obtained, and a reward model is constructed. This enables dynamic optimization of the system's decision-making logic based on actual application scenarios. The evaluation weights of the multimodal large model and the defect matching thresholds of the anomaly detection rule base are adaptively adjusted according to user preferences and repair needs, improving the flexibility and accuracy of the evaluation criteria. For special scenarios with high repair difficulty, lightweight model parameter adjustment technology is used to optimize parameters in small samples and generate scenario-specific evaluation models. This effectively solves the problem of insufficient model generalization ability in long-tail scenarios, reduces the dependence on large-scale labeled data, and enables the model to quickly adapt to scenarios with complex textures and special styles. This significantly improves the system's repair effect and self-evolution ability in diverse application scenarios, continuously optimizes the user experience, and expands the scope of technology application.

[0041] In one possible implementation, after obtaining the image to be repaired and the corresponding repair area, this application further includes:

[0042] The target area protection module modifies the repair area at the pixel level while keeping the pixel values ​​of the non-repair areas of the image to be repaired unchanged.

[0043] The boundary of the repaired region is identified based on the edge perception algorithm, and a mask containing only the repaired region is generated to reduce the computational resource consumption of subsequent processing. The edge perception algorithm locates the boundary between the repaired region and the non-repaired region by calculating the pixel gradient change rate.

[0044] By adopting the above technical solution, the repair area is precisely modified at the pixel level using the target area protection module, while keeping the pixel values ​​of the non-repair areas of the image unchanged. This avoids interference from the repair operation on the normal areas of the original image, ensuring the consistency of the overall image structure and style. The pixel gradient change rate is calculated based on the edge perception algorithm to identify the boundary of the repair area and generate a mask that only contains the repair area. This effectively reduces the computational resource consumption of subsequent processing and improves processing efficiency. This solution not only solves the problem that the repair operation easily affects non-target areas in the existing technology, but also achieves a dual improvement in repair accuracy and computational efficiency through precise area limitation and mask generation. It is suitable for application scenarios with high requirements for image quality and processing speed.

[0045] In one possible implementation, this application decomposes repair requirements into a sequence of atomic operations using a knowledge graph-based problem decomposition engine, including:

[0046] Construct a semantic network containing defect type nodes, repair tool nodes, and operation step nodes, with the correlation strength between nodes represented by dynamic weighted edges;

[0047] Based on the defect type in the defect location report, the corresponding node is activated and topologically sorted to generate an atomic operation sequence. The semantic network updates the edge weights in real time using a Bayesian optimization algorithm, optimizes the tool call order to match the current repair needs, and dynamically adjusts the edge weight updates based on feedback data of historical repair effects.

[0048] By employing the aforementioned technical solution, a semantic network is constructed that includes nodes representing defect types, repair tools, and operation steps. Dynamically weighted edges represent the strength of associations between nodes, transforming complex image restoration needs into a structured and quantifiable knowledge system. Based on defect location reports, corresponding nodes are activated and topologically sorted to generate atomic operation sequences. This allows for precise matching of repair steps according to actual defects, avoiding redundant operations. The semantic network uses a Bayesian optimization algorithm combined with historical restoration effect feedback data to update edge weights in real time, continuously optimizing the tool invocation order, enabling the restoration process to dynamically adapt to the restoration needs of different images. This not only achieves intelligent decomposition and precise execution of restoration tasks but also continuously improves the adaptability and efficiency of restoration strategies through a dynamic learning mechanism. It effectively solves the problems of traditional restoration processes relying on human experience and being unable to handle diverse defects, significantly improving the automation level and processing effect of image restoration.

[0049] The second objective of this application is to provide an image inpainting system based on automated evaluation and dynamic optimization, the system comprising:

[0050] Image to be repaired acquisition module: Acquires the image to be repaired and the corresponding repair area;

[0051] Initial Repair Result Generation Module: Performs repair processing on the image to be repaired and generates initial repair results;

[0052] Evaluation result generation module: Utilizes a multimodal large model combined with an anomaly detection rule base to automatically evaluate the quality of the initial repair results and obtain the evaluation results;

[0053] Optimized Repair Result Generation Module: Based on the evaluation results, if the repair quality is determined to be substandard, the intelligent adjustment toolchain is invoked to perform targeted optimization on the initial repair result and generate an optimized repair result;

[0054] Closed-loop processing flow formation module: Repeat the quality assessment and optimization steps on the optimized repair results until the repair quality meets the standards, thus forming a closed-loop processing flow.

[0055] By adopting the above technical solutions, the image to be repaired and the repair area can be automatically acquired and repaired. Automated quality assessment is achieved using a multimodal large model and anomaly detection rule base. When the repair quality is substandard, an intelligent adjustment toolchain is invoked for targeted optimization, forming a closed-loop processing flow. This effectively solves the problem of unstable repair quality in complex scenarios in existing technologies, ensuring the naturalness and accuracy of the repair results in terms of texture consistency, lighting matching, and semantic rationality. At the same time, it reduces the reliance on manual inspection and secondary adjustments, lowers the professional skill threshold, and improves batch processing efficiency. The automated closed-loop mechanism achieves seamless connection between repair, assessment, and optimization, avoiding efficiency fluctuations caused by fragmented processing flows, and significantly improving the reliability and processing efficiency of image restoration.

[0056] The third objective of this application is to provide an image restoration device based on automated evaluation and dynamic optimization, the device comprising:

[0057] The memory and processor, wherein the memory stores a computer program that can be loaded by the processor and executed by the above-described image restoration method based on automated evaluation and dynamic optimization.

[0058] The fourth objective of this application is to provide a storage medium.

[0059] The fourth objective of this application is achieved through the following technical solution:

[0060] A storage medium storing a computer program capable of being loaded by a processor and executing the aforementioned image inpainting method based on automated evaluation and dynamic optimization.

[0061] In summary, this application includes at least one of the following beneficial technical effects:

[0062] 1. It can automatically acquire the image to be repaired and the repair area and perform repair processing. It uses a multimodal large model and anomaly detection rule base to achieve automated quality assessment. When the repair quality does not meet the standards, it calls the intelligent adjustment toolchain for targeted optimization, forming a closed-loop processing flow. This effectively solves the problem of unstable repair quality in complex scenarios in existing technologies, ensuring the naturalness and accuracy of the repair results in terms of texture consistency, lighting matching degree, and semantic rationality. At the same time, it reduces the reliance on manual inspection and secondary adjustment, lowers the professional skill threshold, and improves batch processing efficiency. Through the automated closed-loop mechanism, it achieves seamless connection between repair, assessment and optimization, avoids efficiency fluctuations caused by fragmented processing flow, and significantly improves the reliability and processing efficiency of image repair.

[0063] 2. By dynamically expanding the mask boundary of the repair area to the text region edge, texture transition region, and other contextual regions using a gradient-weighted region growing algorithm, the potential impact range can be fully covered, avoiding evaluation omissions. Multi-scale feature extraction is performed on the expanded evaluation area and its neighborhood, and the perception of anomalies such as color mutations is enhanced through a channel attention network, which can accurately capture subtle defects in the repair area. Combined with the joint analysis of texture consistency, illumination matching degree, and semantic rationality by a multimodal large model and defect template matching of the anomaly detection rule base, quantitative quality assessment indicators and accurate defect location reports can be generated from visual features and semantic levels. This significantly improves the comprehensiveness, accuracy, and semantic understanding of the repair quality assessment, providing a precise basis for subsequent targeted optimization and effectively solving the problems of incomplete assessment and inaccurate anomaly detection in existing technologies. Attached Figure Description

[0064] Figure 1This is a flowchart illustrating the image inpainting method based on automated evaluation and dynamic optimization provided in the embodiments of this application;

[0065] Figure 2 This is a schematic diagram of the virtual structure of the image restoration system based on automated evaluation and dynamic optimization provided in the embodiments of this application. Detailed Implementation

[0066] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0067] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0068] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.

[0069] This application provides an image inpainting method based on automated evaluation and dynamic optimization, referring to... Figure 1 The main process of the method is described as follows:

[0070] S1: Obtain the image to be repaired and the corresponding repair area;

[0071] The images to be repaired can be acquired in various ways, including uploading from local devices (supporting common image formats such as JPG, PNG, and BMP); real-time acquisition via connection to hardware devices such as cameras and scanners; and retrieval from cloud storage platforms, image databases, or other software systems via API interfaces. The repair area can be determined manually by the user through a graphical interface using tools such as brushes, rectangles, and lasso to draw a mask; or automatically identified using image recognition technology and object detection algorithms, such as scratches, stains, and damage, marking them as repair areas; or reused historically labeled repair area templates for batch processing of images with similar characteristics. After acquiring the image to be repaired and the repair area, the system preprocesses the image, including adjusting the image size to a uniform specification and performing normalization. Simultaneously, the repair area information is stored in the form of a mask matrix, where "1" represents a repair area and "0" represents a non-repair area.

[0072] S2: Perform repair processing on the image to be repaired to generate an initial repair result;

[0073] The restoration process relies on deep learning models, typically classic restoration models or neural network architectures tailored to project requirements. The image to be restored, along with a mask of the restoration area, is input into the model. The model first extracts features from the image using a multi-layer convolutional neural network, extracting low-level features such as edges, textures, and colors. Then, using an encoder-decoder structure, the decoder incorporates the mask of the restoration area to gradually restore the missing or damaged image content. To ensure the restored result maintains stylistic and semantic consistency with the original image, the model incorporates a context-aware mechanism. This mechanism learns image features surrounding the restoration area through an attention mechanism, ensuring a natural transition in texture, color, and structure after restoration. When processing high-resolution images, a block-based restoration strategy is employed to reduce computational resource consumption and improve processing efficiency. The image is divided into multiple sub-blocks, each of which is restored separately. Finally, the restored sub-blocks are stitched together, and the stitching is fused to eliminate stitching artifacts. After restoration, an initial restored image is output in RGB format, containing complete color information.

[0074] S3: Automated quality assessment of the initial repair results is performed using a multimodal large model combined with an anomaly detection rule base to obtain the assessment results;

[0075] First, a gradient-weighted region growing algorithm is used to process the repair area. Based on the repair area mask, the gradient value of each pixel is calculated. According to the preset gradient threshold and growth rules, the mask boundary is dynamically expanded to include context areas such as text region edges, texture transition areas, and structural feature boundaries, forming an expanded evaluation area. The expansion range is generally 5-20 pixels, dynamically adjusted according to the image resolution. Next, multi-scale feature extraction is performed on the expanded evaluation area and its neighborhood. A network model is used to extract visual features at different scales, including low-level edge and corner features, mid-level texture and shape features, and high-level semantic features. At the same time, a channel attention network is used to enhance the model's ability to perceive anomalies such as color abrupt changes, geometric distortions, and artifacts, highlighting key feature channels. Then, based on a multimodal large model, the extracted visual features are fused with the text description. The repair area is jointly analyzed from multiple dimensions such as texture consistency, illumination matching degree, and semantic rationality to determine whether the repair result meets expectations. During this process, an anomaly detection rule base is queried simultaneously. This rule base pre-stores a large number of defect templates, such as templates for missing strokes and distortions in text restoration, and templates for repetitive and discontinuous textures in image texture restoration. Through template matching algorithms, specific defects in the restoration results are located. Finally, by combining the multimodal analysis results and defect template matching results, a quantitative quality assessment index is generated, such as a score of 0-100, where a higher score indicates better restoration quality. At the same time, a defect location report is output, which records in detail the defect type, location coordinates, confidence level, and other information.

[0076] S4: Based on the evaluation results, if the repair quality is determined to be substandard, the intelligent adjustment toolchain is invoked to optimize the initial repair results in a targeted manner, generating optimized repair results;

[0077] When the quality assessment result falls below a preset threshold (e.g., 80 points), the intelligent adjustment toolchain is triggered. First, a knowledge graph-based problem decomposition engine breaks down the repair requirements. The knowledge graph constructs a semantic network containing defect type nodes, repair tool nodes, and operation step nodes. The strength of the association between nodes is represented by dynamic weighted edges, the values ​​of which are set based on the matching success rate and usage frequency of tools with defect types and operation steps in historical repair data. Based on the defect location report generated by the quality assessment, the corresponding defect type node in the knowledge graph is activated. Then, a topological sorting algorithm is used to generate an atomic operation sequence based on the weight and dependency relationships between nodes. This sequence includes at least denoising, edge alignment, and texture synthesis operations. For example, if noise and texture discontinuities are detected in the repair area, an operation sequence of "denoising → texture synthesis → edge alignment" might be generated. Next, based on the atomic operation sequence and combined with a Bayesian optimization algorithm, the calling order of specialized tools in the intelligent adjustment toolchain is optimized. The Bayesian optimization algorithm dynamically adjusts the tool calling order and parameter settings based on historical repair effect feedback data to improve the repair success rate. During the tool execution phase, a spectrum-segmentation-based erasing tool decomposes the image into different frequency bands using wavelet transform, accurately locating the text frequency band to achieve seamless erasing of text and other interfering elements. A mask adjustment tool supporting smearing gestures, combined with a graph cut algorithm, allows users to intuitively and dynamically optimize the mask range, making the definition of the repair area more accurate. A prompt word tool performs semantic parsing of the user-input repair commands, transforming natural language instructions into targeted optimization instructions to drive the generative model; for example, "make the sky bluer" is parsed as "a deep blue sky," guiding subsequent image generation or adjustment. After processing by the toolchain, the optimized repair result is generated.

[0078] S5: Repeat the quality assessment and optimization steps for the optimized repair results until the repair quality meets the standards, forming a closed-loop processing flow.

[0079] The closed-loop process is managed using a finite state machine, which consists of four cyclical phases: evaluation, decision, execution, and verification. In the evaluation phase, the system receives quality assessment metrics generated from the optimization and repair results. If the repair quality score is lower than a set threshold (e.g., 85 points), it transitions to the decision phase. In the decision phase, the system analyzes the problems with the current repair results based on the defect location report and generates corresponding tool invocation strategies, such as determining which tools need to be invoked again and their parameter settings. Then, it transitions to the execution phase. In the execution phase, the system invokes the intelligent adjustment toolchain again to perform the repair operation according to the tool invocation strategy generated in the decision phase. During execution, the system records and caches the tool's input and output data. After execution, it enters the verification phase, comparing the newly generated repair results with preset quality thresholds. Comparison metrics include, but are not limited to, Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index (SSIM), and manually set semantic reasonableness scores. If the verification fails, it returns to the evaluation phase to re-evaluate and optimize the repair results. Throughout the four-stage loop, intermediate results generated at each stage, such as feature vectors for each quality assessment and parameter configurations for tool calls, are cached and persistently stored. High-efficiency caching databases like Redis can be used for storage to facilitate reuse in subsequent processes, reduce redundant calculations, and improve processing efficiency. When the repair result passes verification and meets the preset quality standards, the closed-loop processing ends, and the final repair result is output.

[0080] Specifically, in some possible embodiments, an automated quality assessment of the initial repair results is performed using a multimodal large model combined with an anomaly detection rule base, including:

[0081] A gradient-weighted region growing algorithm is used to dynamically extend the mask boundary of the repaired region to a context region that includes the edges of the text region, the texture transition region, and the boundary of the structural feature, forming an extended evaluation region.

[0082] Multi-scale feature extraction is performed on the extended evaluation region and its neighborhood, and the ability to perceive color abrupt changes, geometric distortions, and artifacts is enhanced through a channel attention network.

[0083] Based on the multimodal large model, the texture consistency, lighting matching degree and semantic rationality of the repaired area are jointly analyzed, and the defect template matching results of the anomaly detection rule base are combined to generate quality assessment indicators and defect location reports.

[0084] In the process of automating the quality assessment of the initial repair results using a multimodal large model combined with an anomaly detection rule base, a gradient-weighted region growing algorithm is first employed to dynamically expand the mask boundary of the repair region based on the pixel gradient change rate: for text region edges, the mask is expanded outward by 8-12 pixels based on pixels with a gradient change rate exceeding a set threshold; for texture transition regions, it is expanded by 10-15 pixels based on areas with significant local pixel differences; and for structural feature boundaries, it is expanded by 5-8 pixels based on edge detection results. The expanded mask is then smoothed through morphological processing and merged with the original mask to form an expanded evaluation region that covers contextual information. Next, multi-scale feature extraction is performed on the expanded evaluation region and its neighborhood. Visual features of different sizes are extracted using a pyramid-structured convolutional neural network, and semantic features are obtained by combining this with a semantic model. Simultaneously, a channel attention network is used to assign weights to each feature channel, enhancing the perception of channels corresponding to color abrupt changes, geometric distortions, and artifacts, while suppressing irrelevant channels. During feature extraction, the image is normalized, and random deactivation is used to avoid overfitting. Finally, based on the multimodal large model, the visual features of the repaired area are fused with the preset evaluation text. The joint analysis is carried out from three dimensions: texture consistency (using structural similarity index), illumination matching degree (calculating color space difference), and semantic rationality (quantified by text and image similarity). Combined with the anomaly detection rule library of pre-stored defect templates, the defect is located by feature matching algorithm. Finally, an evaluation report containing comprehensive score and defect location, type, and confidence level is generated and stored in a specific format.

[0085] After completing the automated quality assessment described above, an intelligent learning feedback mechanism is introduced. When the system processes the same type of image multiple times, it automatically records frequently occurring problems in each assessment, along with effective optimization strategies for these problems, forming a dedicated repair strategy library. When encountering similar images subsequently, the system prioritizes historically validated optimization methods to quickly complete the repair. Simultaneously, users can evaluate the final repair results. Whether it's positive feedback like "likes" or suggestions for improvement, the system will adjust the weight given to different issues during the assessment accordingly. For example, if users frequently report color inconsistencies in a certain type of image, the system will increase the intensity of color dimension detection in subsequent assessments, continuously optimizing the assessment criteria to make the repair results more tailored to the user's personalized needs.

[0086] Specifically, in some possible embodiments, the invocation of the intelligent tuning toolchain to specifically optimize the initial repair result includes:

[0087] By using a knowledge graph-based problem decomposition engine, the repair requirements are decomposed into a sequence of atomic operations, which includes at least denoising operations, edge alignment operations, and texture synthesis operations.

[0088] Based on the atomic operation sequence, an optimized tool call order is generated;

[0089] Dynamically invoke dedicated tools within the intelligent adjustment toolchain;

[0090] Using a spectrum segmentation-based erasure tool, text frequency bands are located through wavelet transform to achieve traceless erasure;

[0091] The mask range is dynamically optimized by using a mask adjustment tool that supports smearing gestures, combined with a graph cut algorithm.

[0092] By using prompt word tools to perform semantic parsing of repair instructions, targeted optimization instructions that drive the generation model are generated;

[0093] The parameters of the specialized tools in the intelligent adjustment toolchain are automatically adjusted using a Bayesian optimization algorithm.

[0094] When the intelligent adjustment toolchain is invoked to optimize the initial repair results, a semantic network containing defect types, repair tools, and operation step nodes is first constructed. Based on the defect location report, the corresponding nodes are activated and topologically sorted to generate an atomic operation sequence that includes at least denoising, edge alignment, and texture synthesis. The correlation strength between nodes is updated in real time using a Bayesian optimization algorithm combined with historical repair effect feedback data. Next, an optimized tool invocation order is generated based on this sequence to ensure the repair process is efficient and conforms to image characteristics. Then, dedicated tools in the intelligent adjustment toolchain are dynamically invoked. Among them, the spectral segmentation-based erasing tool decomposes the image into different frequency bands using wavelet transform for precise... The system locates high-frequency bands of text to achieve seamless erasure. A mask adjustment tool that supports smearing gestures allows users to interactively modify the mask range. Combined with a graph cut algorithm, the boundary is dynamically optimized to improve repair accuracy. A prompt word tool performs semantic parsing on the repair instructions entered by the user and transforms them into targeted prompt text to drive the generation model. Finally, a Bayesian optimization algorithm is used to automatically adjust tool parameters, such as denoising intensity and texture synthesis scale, based on historical repair results. During the parameter search process, a probabilistic model is built and the most promising parameter combination is selected for trial to achieve the optimal repair effect with the fewest iterations. At the same time, intermediate results during the optimization process are cached and persisted to provide a reference for subsequent repair tasks.

[0095] When processing various image restoration tasks, the system quickly identifies the feature distribution of the current task through a meta-learning algorithm and transfers the most relevant tool combination strategies from historical tasks to improve the restoration efficiency of new tasks. Simultaneously, a real-time visual feedback system is developed to generate multiple versions of restoration previews during tool execution. Users can adjust parameters (such as denoising level and texture fusion strength) in real time by sliding control bars. The system records user preferences and automatically optimizes the initial parameter values ​​for subsequent tasks. Furthermore, for complex scenarios (such as multi-target restoration), a hierarchical restoration planner is designed to decompose the global restoration objective into a sub-task tree. Through reinforcement learning, task priorities are dynamically adjusted to ensure that resources are allocated preferentially to key restoration areas, significantly improving restoration quality while reducing computational resource consumption.

[0096] Specifically, in some possible embodiments, the closed-loop processing flow includes:

[0097] A finite state machine is used to manage a four-stage loop, which includes an evaluation state, a decision state, an execution state, and a verification state, wherein:

[0098] The assessment status is used to receive quality assessment indicators. If the repair quality does not meet the standards, the process will proceed to the decision-making status.

[0099] The decision state is used to invoke strategies based on the defect location report generation tool and transition to the execution state;

[0100] The execution state is used to invoke the intelligent adjustment toolchain to implement repairs and then transition to the verification state.

[0101] The verification status is used to compare the optimization and repair results with the preset quality threshold. If it fails, it returns to the evaluation status.

[0102] The intermediate results generated from each state processing in the four-stage loop are cached and persisted.

[0103] When forming a closed-loop processing flow, the specific operating logic of each state of the finite state machine is as follows: In the evaluation state, the system receives quality evaluation indicators output from the quality evaluation module, such as the structural similarity score and peak signal-to-noise ratio of the repair result, and compares them with preset quality standards. If the set threshold is not reached (e.g., the structural similarity score is below 0.85), the state transition condition is triggered, and the process switches to the decision state. After entering the decision state, the system searches for matching information in the pre-stored strategy library based on the defect type (e.g., blurred text, discontinuous texture) and location coordinates recorded in the defect location report. The tool invocation strategy, for example, generates a strategy to "invoke the text sharpening tool with the parameter set to intensity level 3" for blurry text, and passes this strategy to the execution state. After receiving the strategy, the execution state invokes the corresponding tool in the intelligent adjustment toolchain, such as activating the text sharpening tool to process the repair result. After the repair operation is completed, the optimized repair result is transmitted to the verification state. The verification state compares the optimized repair result with the preset quality threshold in a comprehensive manner. In addition to numerical indicators, it also verifies the semantic rationality and other dimensions. If it still does not meet the requirements, the process returns to the evaluation state for quality assessment again. At the same time, throughout the entire four-stage loop, the original quality assessment data of the evaluation state, the strategy content generated by the decision state, the input and output data of the execution state toolchain, and the comparison results of the verification state are all persistently stored through a distributed caching system (such as Redis) for easy subsequent querying and reuse.

[0104] The system uses reinforcement learning algorithms to assign dynamic weights to the state transition conditions in the four-stage loop based on the final repair effect of each closed-loop process (such as user satisfaction scores and feedback from real-world application scenarios). For example, if multiple repair failures occur due to poor strategies generated by the decision state, the weight of the strategy generation logic in that state is increased in the overall evaluation, prompting the system to prioritize optimization of this step. Furthermore, a multi-version parallel verification module is added. In the verification state, the optimized repair results are simultaneously verified using multiple different versions of the quality assessment model (such as historical stable versions and the latest iteration). A voting mechanism is used to comprehensively judge whether the results meet the standards, effectively reducing the risk of misjudgment by a single assessment model and improving the reliability and stability of the closed-loop process.

[0105] Specifically, in some possible embodiments, the method further includes:

[0106] Obtain user feedback on the final repair result and manual adjustment data to build a reward model, wherein the final repair result is a repair result that has been verified to meet the standards through a closed-loop processing flow;

[0107] Based on the reward model, the evaluation weight of the multimodal large model and the defect matching threshold of the anomaly detection rule base are dynamically adjusted.

[0108] For special scenarios where the repair difficulty exceeds a preset complexity threshold, a lightweight model parameter adjustment technique is used to optimize the parameters of a multimodal large model with small samples, generating a scenario-specific evaluation model.

[0109] The process begins by acquiring user feedback on the final repair result and manual adjustment data through interactive interfaces (such as rating buttons, feedback boxes, and adjustment operation logs). This includes user ratings, written suggestions, and records of manual adjustments such as modifying the repair area mask and intensity. After cleaning and structuring this data, a reward model is constructed. This model uses positive user feedback (such as high scores and praise) as reward signals and negative feedback (low scores and criticisms) as penalty signals. Next, based on the output of the reward model, the weights of evaluation dimensions such as texture consistency, lighting matching, and semantic rationality in the multimodal large model are dynamically adjusted, as well as the matching thresholds for various defect templates in the anomaly detection rule base. For example, if users repeatedly report poor texture repair results, the weight of texture consistency evaluation is increased, and the matching threshold for texture defects is decreased. For special scenarios where the repair difficulty exceeds the preset complexity threshold (such as those containing rare textures, complex structures, or special lighting conditions), a lightweight model parameter adjustment technique is used to extract key features from a small number of labeled samples and optimize some key parameters of the multimodal large model to generate a dedicated evaluation model suitable for the scenario, thereby reducing computational resource consumption while improving evaluation accuracy.

[0110] Furthermore, a cross-scenario transfer learning and active learning fusion mechanism can be introduced. The features of scenario-specific evaluation models generated under different special scenarios can be fused. Through transfer learning, the model can learn from the optimization experience of previous scenarios when dealing with new special scenarios, quickly adapting to the repair evaluation needs of new scenarios. Combined with an active learning strategy, the system proactively selects the most valuable unlabeled data samples and requests users to label them, thereby continuously expanding the training data of the reward model. This allows the reward model to more accurately capture user preferences and evaluation standards in complex scenarios. In addition, a dynamic interpretability display module can be constructed. When adjusting evaluation weights and defect matching thresholds, the system displays the basis for the adjustment and the expected results to the user. For example, visual charts can be used to compare the repair results before and after adjusting the weights of different evaluation dimensions, as well as the impact of changes in defect matching thresholds on the detection results. This enhances the user's understanding and trust in the system's decisions, while allowing users to directly intervene in the adjustment process, further improving the system's interactivity and usability.

[0111] Specifically, in some possible embodiments, after obtaining the image to be repaired and the corresponding repair area, the process further includes:

[0112] The target area protection module modifies the repair area at the pixel level while keeping the pixel values ​​of the non-repair areas of the image to be repaired unchanged.

[0113] The boundary of the repaired region is identified based on the edge perception algorithm, and a mask containing only the repaired region is generated to reduce the computational resource consumption of subsequent processing. The edge perception algorithm locates the boundary between the repaired region and the non-repaired region by calculating the pixel gradient change rate.

[0114] After acquiring the image to be repaired and the corresponding repair area, the system employs isolated image processing technology when making pixel-level modifications to the repair area through the target area protection module. Specifically, image masking technology is used to logically isolate the repair area from the non-repair area. Within the repair area, the local feature extraction and generation mechanism of a deep learning model (such as U-Net) is used to modify each pixel in a targeted manner, ensuring that the repaired content remains consistent with the surrounding environment in terms of color, texture, and structure. In the non-repair area, pixel values ​​are directly locked, prohibiting any modification operations to preserve the original image information. When identifying the boundary of the repair area based on the edge perception algorithm, the boundary between the repair area and the non-repair area is located by calculating the pixel gradient change rate: First, the Sobel operator is used to calculate the gradient value of each pixel in the image, and a gradient change rate threshold (such as 0.6) is set. When the gradient value change of adjacent pixels exceeds this threshold, this is determined to be the boundary of the area. Then, morphological closing operations are used to smooth the boundary, generating a mask that only contains the repair area. This mask is then applied to subsequent image repair, quality assessment, and other processing steps, reducing the computational load of unnecessary areas and significantly improving processing efficiency.

[0115] An adaptive multi-scale boundary perception and dynamic protection mechanism can be introduced. During boundary recognition, the computational scale of the edge perception algorithm is dynamically adjusted based on image resolution and the complexity of the restoration area: for high-resolution or complex texture images, a multi-scale pyramid structure (such as a Gaussian pyramid) is adopted to perform boundary detection at different resolution levels, avoiding misjudgment or missed judgment of boundaries caused by single-scale detection; at the same time, based on the semantic information of the restoration area (such as "text region" and "figure outline"), different protection priorities are assigned to the boundaries. For example, a stricter protection strategy is adopted for the figure outline boundary to prevent structural deformation during the restoration process. In addition, an interactive boundary fine-tuning module is added, allowing users to manually correct the automatically generated boundaries through simple brush strokes or dragging operations. The system updates the mask in real time according to the user's operation and automatically optimizes subsequent processing parameters (such as the sampling range of the restoration model and the key areas for quality assessment) based on the corrected boundaries, forming a human-machine collaborative intelligent restoration mode, further improving the accuracy of restoration and user autonomy.

[0116] Specifically, in some possible embodiments, a knowledge graph-based problem decomposition engine is used to break down the repair requirements into a sequence of atomic operations, including:

[0117] Construct a semantic network containing defect type nodes, repair tool nodes, and operation step nodes, with the correlation strength between nodes represented by dynamic weighted edges;

[0118] Based on the defect type in the defect location report, the corresponding node is activated and topologically sorted to generate an atomic operation sequence. The semantic network updates the edge weights in real time using a Bayesian optimization algorithm, optimizes the tool call order to match the current repair needs, and dynamically adjusts the edge weight updates based on feedback data of historical repair effects.

[0119] When decomposing repair requirements into atomic operation sequences using a knowledge graph-based problem decomposition engine, a semantic network is first constructed, comprising defect type nodes (e.g., "blurred text," "texture discontinuity," "uneven lighting"), repair tool nodes (e.g., "text sharpening tool," "texture synthesis tool," "lighting adjustment tool"), and operation step nodes (e.g., "preprocessing," "main repair," "postprocessing"). The strength of the association between nodes is represented by dynamic weighted edges. These weights are initially set based on expert experience; for example, the edge weight between the "blurred text" node and the "text sharpening tool" node is relatively high. Based on the defect type in the defect location report, the system activates the corresponding defect type node in the semantic network and then uses a topological sorting algorithm to generate an atomic operation sequence according to the weight relationships and dependencies between nodes. For example, if blurred text and texture discontinuity are detected in the repair area, an operation sequence of "text sharpening tool → texture synthesis tool → edge alignment tool" might be generated. The semantic network updates the edge weights in real time using a Bayesian optimization algorithm, which dynamically adjusts the weights based on feedback data of historical repair results (e.g., repair success rate, user satisfaction rating). For example, if a tool is effective in fixing a specific defect, the edge weight between the tool node and the corresponding defect type node is increased, and the tool call order is optimized to match the current repair needs.

[0120] In semantic networks, besides updating edge weights based on historical restoration results, cross-domain knowledge transfer techniques can be used to draw on restoration experience from other fields. For example, edge detection techniques from medical image processing can be transferred to text restoration scenarios, or texture synthesis methods from art restoration can be applied to natural image restoration. Simultaneously, an active exploration mechanism is added, where the system periodically tries low-probability but potentially effective tool combinations, evaluates their effectiveness through A / B testing, and quickly updates the edge weights of the semantic network if new, efficient combinations are discovered, enabling the self-evolution of the knowledge graph. Furthermore, an interactive semantic network editor is built, allowing expert users to directly intervene in the structure and weights of the semantic network, adding new nodes or adjusting edge weights, forming a human-machine collaborative intelligent restoration decision-making system, further enhancing the flexibility and adaptability of restoration solutions.

[0121] Another embodiment of this application provides an image inpainting system based on automated evaluation and dynamic optimization, wherein, see reference Figure 2 Image inpainting systems based on automated evaluation and dynamic optimization include:

[0122] Image acquisition module 100: Acquires the image to be repaired and the corresponding repair area;

[0123] Initial Repair Result Generation Module 200: Performs repair processing on the image to be repaired and generates an initial repair result;

[0124] Evaluation result generation module 300: Automated quality assessment of the initial repair results is performed using a multimodal large model combined with an anomaly detection rule base to obtain the evaluation results;

[0125] Optimized Repair Result Generation Module 400: Based on the evaluation results, if it is determined that the repair quality is substandard, the intelligent adjustment toolchain is invoked to perform targeted optimization on the initial repair results and generate optimized repair results;

[0126] Closed-loop processing module 500: Repeatedly perform quality assessment and optimization steps on the optimized repair results until the repair quality meets the standards, thus forming a closed-loop processing flow.

[0127] The image restoration system based on automated evaluation and dynamic optimization provided in this embodiment can achieve the steps of the aforementioned embodiments due to the functions of each module and the logical connections between them. Therefore, it can achieve the same technical effect as the aforementioned embodiments. For the principle analysis, please refer to the relevant description of the steps of the image restoration method based on automated evaluation and dynamic optimization, which will not be repeated here.

[0128] This application also provides an image restoration device based on automated evaluation and dynamic optimization, including a memory and a processor. The memory stores a computer program that can be loaded by the processor and executed by the above-described image restoration method based on automated evaluation and dynamic optimization.

[0129] This application also provides a storage medium storing a computer program that can be loaded by a processor and executed by the above-described image restoration method based on automated evaluation and dynamic optimization.

[0130] The storage medium provided in this embodiment can achieve the same technical effect as the aforementioned embodiments because the computer program therein, after being loaded and run on the processor, will implement the various steps of the aforementioned embodiments. For the principle analysis, please refer to the relevant description of the aforementioned method steps, which will not be repeated here.

[0131] The storage medium includes, for example, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0132] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0133] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0134] Furthermore, features defined by the terms "first" and "second" may explicitly or implicitly include at least one of those features. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., and unless otherwise explicitly specified, is used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.

[0135] Therefore, any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0136] The embodiments described in this specific implementation are preferred embodiments of this application and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.

Claims

1. An image inpainting method based on automated assessment and dynamic optimization, characterized in that, The method comprises the following steps: acquiring an image to be repaired and a corresponding repair region; performing repair processing on the image to be repaired to generate an initial repair result; performing automatic quality evaluation on the initial repair result by using a multi-modal large model combined with an abnormality detection rule base to obtain an evaluation result; The automatic quality evaluation on the initial repair result by using a multi-modal large model combined with an abnormality detection rule base comprises: adopting a region growing algorithm based on gradient weighting to dynamically expand the mask boundary of the repair region to a context region containing the edge of a text region, a texture transition region and a structural feature boundary to form an expanded evaluation region; performing multi-scale feature extraction on the expanded evaluation region and its neighborhood, and strengthening the perception ability of color mutation, geometric distortion and artifacts through a channel attention network; based on the multi-modal large model, the texture consistency, illumination matching degree and semantic rationality of the repair region are jointly analyzed, and the defect template matching result of the abnormality detection rule base is combined to generate a quality evaluation index and a defect positioning report; Based on the evaluation result, if the repair quality is determined to be substandard, an intelligent adjustment tool chain is called to perform targeted optimization on the initial repair result to generate an optimized repair result; the calling of the intelligent adjustment tool chain to perform targeted optimization on the initial repair result comprises: decomposing the repair requirement into an atomic operation sequence through a question decomposition engine based on a knowledge graph, the atomic operation sequence at least including a denoising operation, an edge alignment operation and a texture synthesis operation; based on the atomic operation sequence, an optimized tool calling sequence is generated; the special tools in the intelligent adjustment tool chain are dynamically called; the erasing tool based on frequency spectrum segmentation is used to realize traceless erasing by locating the text frequency band through wavelet transform; the mask adjustment tool supporting the wiping gesture is used to dynamically optimize the mask range combined with the graph cut algorithm; the semantic analysis of the repair instruction is performed by the prompt word tool to generate targeted optimization instructions for the generation model; the parameters of the special tools in the intelligent adjustment tool chain are automatically adjusted by using the Bayesian optimization algorithm; The quality evaluation and optimization steps are repeatedly performed on the optimized repair result until the repair quality meets the standard to form a closed-loop processing flow.

2. The image inpainting method based on automated evaluation and dynamic optimization of claim 1, wherein, The closed-loop processing flow comprises: a finite state machine is used to manage a four-stage cycle, and the four-stage cycle comprises an evaluation state, a decision state, an execution state and a verification state, wherein: the evaluation state is used to receive a quality evaluation index, and if the repair quality is substandard, the evaluation state is transferred to the decision state; the decision state is used to generate a tool calling strategy based on a defect positioning report, and is transferred to the execution state; the execution state is used to call the intelligent adjustment tool chain to implement repair, and is transferred to the verification state; the verification state is used to compare the optimized repair result with a preset quality threshold, and if it fails, the verification state returns to the evaluation state; The intermediate results generated in each state processing in the four-stage cycle are cached and persisted.

3. The method of claim 1, wherein, The method further comprises: acquiring feedback information and manual adjustment operation data of a user on a final repair result, and constructing a reward model, wherein the final repair result is a repair result that has passed the closed-loop processing flow verification and meets the standard; Based on the reward model, the evaluation weight of the multi-modal large model and the defect matching threshold of the anomaly detection rule base are dynamically adjusted. For special scenarios where the repair difficulty exceeds the preset complexity threshold, a small sample parameter optimization is performed on the multi-modal large model using a model parameter lightweight adjustment technique to generate a scene-specific evaluation model.

4. The method of claim 1, wherein, After obtaining the image to be repaired and the corresponding repair area, the method further includes: The pixel level modification of the repair area is performed by the target area protection module, and the pixel values of the non-repair area of the image to be repaired remain unchanged. Based on the edge perception algorithm, the boundary of the repair area is identified, and a mask mask containing only the repair area is generated to reduce the computational resource consumption of subsequent processing, wherein the edge perception algorithm locates the boundary between the repair area and the non-repair area by calculating the pixel gradient change rate.

5. The method of claim 1, wherein, The repair requirement is decomposed into an atomic operation sequence by a question splitting engine based on a knowledge graph, including: A semantic network containing defect type nodes, repair tool nodes and operation step nodes is constructed, and the correlation strength between nodes is represented by dynamic weight edges. Based on the defect type in the defect positioning report, the corresponding node is activated and topologically sorted to generate an atomic operation sequence, wherein the semantic network updates the edge weight in real time through a Bayesian optimization algorithm, optimizes the tool calling sequence to match the current repair requirement, and the edge weight update is dynamically adjusted based on the feedback data of historical repair effects.

6. An image inpainting system based on automated assessment and dynamic optimization, characterized in that, It includes: The image to be repaired acquisition module acquires the image to be repaired and the corresponding repair area. The initial repair result generation module performs repair processing on the image to be repaired to generate an initial repair result. The evaluation result generation module uses a multi-modal large model combined with an anomaly detection rule base to automatically evaluate the quality of the initial repair result and obtain an evaluation result. The automatic quality evaluation of the initial repair result using a multi-modal large model combined with an anomaly detection rule base includes: using a region growing algorithm based on gradient weighting to dynamically expand the mask boundary of the repair area to a context area containing the edge of the text area, the texture transition area and the structure feature boundary, forming an expanded evaluation area; performing multi-scale feature extraction on the expanded evaluation area and its neighborhood, and strengthening the perception ability of color mutation, geometric distortion and artifacts through a channel attention network; based on the multi-modal large model, the texture consistency, illumination matching degree and semantic rationality of the repair area are jointly analyzed, and the defect template matching result of the anomaly detection rule base is combined to generate quality evaluation indicators and a defect positioning report. An optimized repair result generation module: based on the evaluation result, if it is determined that the repair quality is not up to standard, an intelligent adjustment tool chain is called to perform targeted optimization on the initial repair result to generate an optimized repair result; the calling of the intelligent adjustment tool chain to perform targeted optimization on the initial repair result comprises: decomposing the repair requirement into an atomic operation sequence through a question splitting engine based on a knowledge graph, the atomic operation sequence at least including a denoising operation, an edge alignment operation and a texture synthesis operation; generating an optimized tool calling sequence based on the atomic operation sequence; dynamically calling a special tool in the intelligent adjustment tool chain; using an erasing tool based on frequency spectrum segmentation to realize traceless erasing through wavelet transform positioning of a character frequency band; using a mask adjustment tool supporting a smearing gesture to dynamically optimize a mask range in combination with a graph cut algorithm; using a prompt word tool to perform semantic analysis on a repair instruction to generate a targeted optimization instruction for driving a generation model; and using a Bayesian optimization algorithm to automatically adjust parameters of the special tool in the intelligent adjustment tool chain; A closed loop processing flow forming module: repeatedly performing the quality evaluation and optimization steps on the optimized repair result until the repair quality is up to standard to form a closed loop processing flow.

7. An image restoration apparatus based on automated assessment and dynamic optimization, characterized by, Comprise: A memory and a processor, the memory having stored thereon a computer program capable of being loaded and executed by the processor to perform any one of the image repair methods based on automated evaluation and dynamic optimization according to claims 1-5 above.

8. A storage medium, characterized by A memory having stored thereon a computer program capable of being loaded and executed by the processor to perform any one of the image repair methods based on automated evaluation and dynamic optimization according to claims 1-5 above.

Citation Information

Patent Citations

  • Image restoration method and device based on multi-modal large language model, and medium

    CN118691511A

  • Multi-agent automatic picture retouching system based on content analysis

    CN120612259A