Marine vessel image defogging method and system based on semantic guidance and knowledge base enhancement
By employing a generative large model approach with semantic guidance and knowledge base enhancement, this method addresses the lack of high-level semantic information and domain knowledge in dehazing images of ships at sea. It achieves high-fidelity dehazing and accurate structural restoration of these images, improving image clarity and semantic consistency, and enhancing the model's generalization ability and performance in downstream tasks.
Patent Information
- Application Number
- CN202511728719.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-11-24
AI Technical Summary
Existing technologies for dehazing images of ships at sea lack guidance from advanced semantic information and support from domain knowledge bases, resulting in insufficient generalization of image restoration results in specialized scenarios and failing to meet the needs of maritime visual surveillance for high-precision restoration and recognition of ship targets.
We employ a generative large model approach based on semantic guidance and knowledge base enhancement. We use an unconditional diffusion model for coarse dehazing and combine it with a pre-built knowledge base of maritime vessels for semantic similarity matching and conditional refinement generation through cross-modal attention mechanisms to ensure high image clarity and structural consistency.
It achieves high-fidelity dehazing and accurate structural restoration of images of ships at sea, improves the professional semantic consistency of images and the ability to restore details in complex scenes, enhances the model's generalization and adaptability to the real world, and improves the performance of downstream vision tasks.
Smart Images

Figure CN121190361B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and in particular to a method and system for dehazing images of ships at sea based on semantic guidance and knowledge base enhancement. Background Technology
[0002] Maritime visual surveillance systems play a crucial role in safeguarding maritime rights, managing maritime traffic, and monitoring fishery resources. Their core task is to achieve accurate perception of vessel targets. However, the maritime imaging environment is chronically affected by sea fog, which leads to decreased image contrast, color distortion, and the obscuring of critical details, severely limiting the performance of downstream visual tasks such as vessel detection and identification. The formation of blurred images is typically modeled using atmospheric scattering models.
[0003]
[0004] in Represents a blurred image. This indicates its clear corresponding image. Parameters and These represent global atmospheric light and transmission maps, respectively.
[0005] Existing image dehazing methods are mainly divided into two categories, but both have significant limitations:
[0006] The first category is traditional methods based on physical models and their derived shallow learning models. These methods typically rely on atmospheric scattering models to achieve reconstruction by estimating transmittance maps and atmospheric light. However, this model suffers from an ill-conditioned problem, as many of the handcrafted priors it relies on (such as dark channel priors) often fail in complex sea surface scenes. More importantly, these methods only perform filtering and contrast enhancement at the pixel level, lacking guidance from high-level semantic information. When key features of a vessel (such as masts, cranes, and hull outlines) are completely obscured by fog, the physical model, lacking modeling of the vessel's target category features and structural priors, often only improves background transmittance without reconstructing target details. It may even mistakenly identify noise as texture and enhance it, leading to irreversible loss of important target information and ultimately reducing detection and recognition accuracy.
[0007] The second category is dehazing methods based on large generative models. With the development of generative models such as diffusion models and generative adversarial networks (GANs), researchers have attempted to incorporate semantic information to assist image restoration. However, these methods have two shortcomings when applied to the specific application of maritime vessels:
[0008] Insufficient semantic guidance granularity: The guidance information of existing methods usually stays at the task level, which is a simple description or low-level image features. It fails to make full use of high-level semantic information such as ship type, structural layout, and component relationship to strictly constrain the generation process. This results in a lack of accurate semantic prior constraints when reconstructing fog-covered areas. The generated results may be visually clear but semantically distorted, such as incorrect ship shape or abnormal number of components.
[0009] Lack of domain knowledge base support: Maritime vessels possess rich domain priors, such as the unique morphological features and structural patterns of ships, cargo ships, and fishing boats. However, most existing generative models are general-purpose models with messy training data and lack embedded domain knowledge bases related to vessels. Therefore, the models cannot utilize specialized knowledge to assist reasoning during reconstruction, such as inferring the ship type from a fuzzy outline and reconstructing the deck or radar structure accordingly. This results in insufficient generalization of reconstruction performance in specialized scenarios.
[0010] In summary, traditional methods struggle to guarantee the integrity of the target structure due to a lack of semantic understanding. While generative models possess reconstruction potential, their restoration results are often unreliable and lack professionalism due to insufficient high-level semantic guidance and the absence of ship knowledge base enhancement, failing to meet the demands of high-precision restoration and identification of ship targets in maritime visual surveillance. Therefore, this invention proposes a generative large-scale model method based on semantic guidance and knowledge base enhancement to simultaneously ensure image clarity and accurate restoration of the target structure. Summary of the Invention
[0011] The technical problem to be solved and the technical task proposed by this invention is to improve and refine existing technical solutions, and to provide a method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement, so as to achieve high-fidelity dehazing and accurate structural restoration of maritime vessel images. To this end, this invention adopts the following technical solution.
[0012] A method for dehazing images of ships at sea based on semantic guidance and knowledge base enhancement includes the following steps:
[0013] For the input image of a ship in the sea to be processed, a coarse dehazing generation is performed using a pre-trained unconditional diffusion model. The coarse dehazing generation includes: performing the reverse denoising process of the diffusion model, stopping at a preset early time step to obtain the global structural information of the image, and using a statistical alignment mechanism to align the preliminary denoising result with the local statistical features of the input haze image, and outputting a coarsely dehazed image with a reasonable structure.
[0014] Semantic guidance signal generation: Feature extraction is performed on the coarse dehazing image to obtain initial high-level semantic information; combined with a pre-built maritime vessel domain knowledge base, the most relevant vessel semantic templates to the initial high-level semantic information are retrieved through semantic similarity matching, and the initial information is completed and corrected to form a knowledge base-enhanced semantic guidance signal;
[0015] Conditional refinement generation: The coarse dehazed image and the semantic guidance signal are input into a pre-trained conditional diffusion model; the conditional diffusion model uses a cross-modal attention mechanism to inject the semantic guidance signal as a condition into the denoising process, focusing on repairing key detail areas of the ship, and outputting a final dehazed image with high definition and structural consistency.
[0016] This technical solution first employs an "unconditional coarse dehazing" stage, leveraging the powerful generative priors of the diffusion model to quickly restore the overall structure and physically plausible scene layout of the image, ensuring the correctness of the dehazing result at the macroscopic level. The subsequent "conditional refinement" stage then focuses on repairing local details. This two-stage strategy of "overall first, then local" effectively avoids structural distortions or global inconsistencies that may occur in traditional methods. This solution first understands the image content from the coarse dehazing result (acquiring high-level semantic information), then actively invokes domain knowledge (knowledge base) to clarify "what should be generated." This makes the dehazing process a knowledge-based, purposeful restoration, suitable for specific targets such as ships with strong structural priors, and can effectively reconstruct key components that are completely obscured by dense fog but whose existence is known based on knowledge. Because the final refinement process is strictly constrained by semantic signals from the knowledge base, the dehazed ship targets are more consistent with the real world in terms of shape, structure and component relationships. This reduces the probability of generating images that are "visually clear but semantically distorted" (such as strange ship shapes, incorrect number or position of components). This ensures that the dehazed results not only look clear, but more importantly, are structurally correct, providing highly reliable input for subsequent automated tasks such as ship detection and recognition.
[0017] As a preferred technical approach, the maritime vessel domain knowledge base is constructed by: collecting high-resolution images and expert knowledge of various types of vessels, constructing knowledge entries containing semantic templates and structured knowledge vectors, and using a pre-trained text encoder to build a fast retrieval index for semantic vectors.
[0018] This technical solution transforms previously scattered and subjective domain experiences (such as the appearance and structural patterns of ships) into structured, machine-readable knowledge entries by collecting high-resolution images and injecting expert knowledge. This creates a professional "ship atlas" for the model, enabling the computer to understand and utilize this highly specialized prior knowledge, providing a reliable data foundation for subsequent semantic guidance. By combining "natural language semantic templates" with "structured knowledge vectors," the semantic templates retain the richness and contextual information of human expert descriptions, while the structured vectors provide precise and quantifiable machine semantics. This bimodal design eliminates the ambiguity of natural language while preserving semantic flexibility, allowing for more accurate and reliable structured prior information during retrieval and matching. A pre-trained text encoder encodes the semantic templates into dense vectors and establishes a fast retrieval index (such as FAISS). This transforms the massive amount of domain knowledge from a static database into a computable, dynamic resource. The system can match fuzzy semantic information extracted from images with the most relevant professional templates in the knowledge base at millisecond speeds, enabling real-time and efficient retrieval of knowledge in complex reasoning processes and meeting the real-time requirements of image processing tasks.
[0019] As a preferred technical means: the semantic template is written by maritime experts and includes the overall characteristics of the ship, information on key components, and spatial topological relationships between components; the structured knowledge vector encodes the semantic template into a dense vector through a pre-trained text encoding model; the fast retrieval index is constructed using an approximate nearest neighbor algorithm.
[0020] Semantic templates are directly injected with professional and verified prior knowledge, ensuring that the descriptions of the ship's overall characteristics, key components, and spatial relationships in the knowledge base are highly accurate and realistic. This provides a reliable and professional semantic foundation for the entire defogging system from the source, avoiding noise and errors that may arise from automatic mining from unstructured data. By converting natural language descriptions into dense vectors (i.e., structured knowledge vectors) through a pre-trained text encoding model, qualitative descriptions are essentially mapped to a precise and computable mathematical space. This eliminates the ambiguity inherent in natural language, transforming vague descriptions like "tall mast" into a definite vector representation. This allows computers to "understand" and "compare" these semantic concepts in a consistent and quantitative way, greatly improving the accuracy and reliability of subsequent semantic matching. The use of the Approximate Nearest Neighbor (ANN) algorithm to build a fast retrieval index is a key optimization for large-scale knowledge base applications. It overcomes the computational bottleneck of precise retrieval from tens of thousands of knowledge entries, achieving rapid semantic similarity matching. This enables real-time querying and retrieval of relevant knowledge during image dehazing inference, meeting the stringent speed requirements of practical applications (such as maritime monitoring) and making complex knowledge-enhanced dehazing processes engineering feasible. This technical solution combines expert writing to ensure authority, vector encoding to ensure accuracy, and ANN indexing to ensure efficiency, collectively constructing a professional, reliable, and highly efficient intelligent knowledge base core that can be used by computers at high speed and precision, providing high-quality semantic-driven capabilities for upper-layer applications.
[0021] As a preferred technical means, the pre-trained unconditional diffusion model and the pre-trained conditional diffusion model are trained using haze image data synthesized through a hybrid training and hybrid sampling strategy.
[0022] This technical solution combines the accuracy of synthetic data with the complexity of real-world data. Using paired synthetic haze images ensures the model learns a precise mapping from haze to clarity, providing a clear learning objective for dehazing. Simultaneously, introducing unlabeled real haze images forces the model to adapt to the complex and irregular optical characteristics of real-world haze, preventing overfitting to idealized synthetic haze and avoiding the domain shift problem of "good lab results, poor real-world performance." This allows the model to learn standard answers from "textbooks" while simultaneously honing its ability to handle complex situations in "practice," ultimately significantly improving its robustness and generalization performance in real-world, unknown scenarios. The "hybrid sampling" strategy introduces randomness and flexibility in the data synthesis stage. By fusing unconditional predictions during denoising, the generator can, to some extent, escape the strict constraints of clear image conditions, generating more diverse and random haze textures and shapes. This ensures that the final synthetic haze dataset used to train the diffusion model not only corresponds to clear content but also has richer and more realistic visual representations, avoiding overfitting caused by a single data pattern and enabling it to handle haze scenarios of various concentrations and types. The haze image data synthesized using the above strategies are aligned with clear images in terms of content and closely resemble real haze in terms of visual characteristics. Using such data to train the dehazing diffusion model is equivalent to providing the model with a standardized and realistic "training environment," ensuring that the model can learn physically reasonable and visually realistic dehazing rules from the beginning, thus laying a solid data foundation for the final generation of high-quality dehazing results.
[0023] As a preferred technical means: the hybrid training involves alternating the use of pairs of synthetic haze images and unlabeled real haze images as training targets; the hybrid sampling involves fusing the unconditional prediction output and the conditional prediction result of the model at a preset ratio in each denoising iteration of the generative model.
[0024] Using clear original images and their corresponding synthetic haze images as paired data provides the model with explicit "question-answer" pairs. This allows the generator to accurately learn the deterministic mapping between the haze degradation process and clear content, ensuring that the generated haze images maintain a high degree of consistency with the clear images in terms of content, providing a reliable data foundation for subsequent dehazing tasks. Training with unlabeled real haze images forces the model to learn and mimic the complex and irregular optical properties and textural statistical features of real haze scenes (such as non-uniform fog, variations in fog thickness, and halos at the sea-sky boundary). This effectively prevents the model from over-relying on idealized synthetic haze physical models, thus avoiding "synthetic data overfitting" and significantly enhancing the model's adaptability and generalization ability to complex real-world scenarios. Conditional prediction based on clear images ensures that the generated haze images are faithful to the original clear images in terms of macroscopic structure and main content, avoiding content distortion. Unconditional prediction does not rely on clear image conditions, but relies entirely on the "haze prior" learned by the model itself. Integrating this prior into the sampling process can introduce richer, more random, and more realistic haze textures and local variations into the generated results, breaking the problem that the generated results may be monotonous and too rigid due to a single condition path.
[0025] As a preferred technical means, the specific implementation of the statistical alignment mechanism includes: dividing the early denoising result of the diffusion model and the input haze image into the same local blocks, and calculating the mean and standard deviation of each local block; performing a linear transformation on each local block of the preliminary denoising result so that its statistical characteristics are aligned with the corresponding local block of the input haze image.
[0026] The statistical alignment mechanism does not perform global, one-size-fits-all image enhancement. Instead, it effectively transfers the brightness (mean) and contrast (standard deviation) distribution characteristics of each small region in the input hazy image to the initial denoising result through local block-level statistical alignment. This ensures that while restoring the macroscopic structure, the subtle textures and local features in the original image that were not completely obscured by the haze are preserved. This prevents the coarse dehazing result from losing valuable information due to over-smoothing, providing a richer foundation for subsequent refinement stages. As a generative model, the diffusion model's early denoising results may be more biased towards the "generally clear image" learned from its training data, which may deviate from the physical characteristics of the specific input image. The statistical alignment mechanism, as an adaptive post-processing step, forces the generated result to be "anchored" back to the input image in terms of statistical characteristics. This essentially introduces a physically-based strong constraint into the generation process, making the coarse dehazing result not only visually clear but also consistent with the original scene in terms of local illumination and contrast distribution, avoiding a sense of disconnect between the generated result and the input image at the physical level. This technical solution achieves its purpose through simple image segmentation and linear transformation (alignment of mean and standard deviation), with extremely low computational overhead and without involving any trainable parameters. It compensates for the lack of detail restoration capability of diffusion models in early denoising, and significantly improves the visual quality and information fidelity of coarse dehazing results at minimal cost.
[0027] As a preferred technical means, the conditional diffusion model injects two guiding signals simultaneously during the denoising process: the semantic guiding signal is injected as a textual condition; the transmission map estimated from the haze image is injected as a spatial condition; and the model fuses these two conditions through a cross-modal attention mechanism.
[0028] This technical solution innovatively combines two different dimensions of guiding signals: textual conditions (semantic guiding signals) answer the question of "what should be generated," ensuring from a high-level semantic level that reconstructed details (such as masts and cranes) conform to domain knowledge in terms of category, shape, and structural relationships, preventing semantic distortion. Spatial conditions (transmission maps) answer the question of "where to focus on generation," identifying areas with different fog concentrations in the image from a low-level physical level, providing the model with pixel-level spatial inpainting weights. By simultaneously injecting these two signals, the model no longer blindly enhances the entire image but can selectively generate semantically correct details in areas with more severe physical degradation, achieving a leap from "uniform dehazing" to "intelligent inpainting." The core function of the cross-modal attention mechanism is to enable the model to "learn" how to weigh and integrate textual and spatial information. Under this mechanism, the model can dynamically calculate the correlation between different regions of the image and various keywords in the text description. For example, for the bow region obscured by dense fog, the model will assign higher attention weights to related textual features such as "anchor" and "hull," thereby guiding the generation process to concentrate more computational resources on repairing these semantically critical and physically degraded areas. This adaptive, focus-oriented repair method is more efficient and intelligent than simply splicing together conditional signals. In dense fog or uneven fog scenes, key components of a ship may be completely obscured, resulting in the complete loss of texture information. A single physical guide (transmission map) can only point out the problem area but cannot know what to generate; while a single semantic guide (text) knows what to generate but cannot accurately locate the repair position. This solution combines the two, enabling the model to perform "rational" detailed reasoning and pixel reconstruction based on the location of the transmission map and the blueprint of the textual conditions, even in areas with severely missing information, greatly improving the success rate of restoration under extremely poor imaging conditions.
[0029] As a preferred technical means: the loss function used to train the conditional diffusion model is a combined loss function, which includes pixel-level reconstruction loss and semantic consistency loss; the semantic consistency loss constrains the accuracy of the generated results in terms of ship category and structure by comparing the similarity between the generated image and the guidance signal in the high-level semantic feature space.
[0030] This technical solution no longer relies solely on traditional pixel-level reconstruction loss as the only optimization objective. In areas with severe texture loss or completely obscured by dense fog, pixel-level loss can lead the model to generate seemingly smooth but semantically incorrect content due to a lack of reliable supervision signals. By introducing semantic consistency loss, the optimization objective is elevated from low-level pixel similarity to high-level semantic similarity. The generated results are directly constrained to maintain consistency with the real prior in key semantic dimensions such as "ship type" and "structural layout," thereby effectively avoiding semantic distortions such as distorted ship shape, incorrect number or position of parts, and ensuring the professional credibility of the dehazing results. In low-visibility conditions such as dense fog, local pixel information in an image may be completely unreliable. Single pixel loss would "blindly" require the model to fit these unreliable or even harmful signals. However, semantic consistency loss, by comparing in a high-dimensional semantic feature space, eliminates the direct dependence on low-level degraded pixels, providing the model with a more stable and higher-level optimization direction. It guides the model to "ignore" local pixel noise and instead focus on reconstructing image content that is semantically consistent with the correct target. This allows the model to maintain strong recovery ability and exhibit excellent robustness even when faced with severe degradation. Pixel-level reconstruction loss ensures the clarity and smoothness of the generated image at a low level of vision, while semantic consistency loss ensures the rationality and structure of the image at a high level of semantics. Combining the two into a unified optimization objective means that the model is required to meet both levels of requirements during training. This drives the model to find an optimal solution that makes the dehazing result as close as possible to the real clear image at the pixel level, while also conforming to the constraints of domain knowledge in terms of semantic concepts, ultimately outputting high-quality results in both visual and semantic aspects.
[0031] Another technical solution of the present invention is: providing a maritime vessel image dehazing system based on semantic guidance and knowledge base enhancement, which is used to execute the aforementioned maritime vessel image dehazing method based on semantic guidance and knowledge base enhancement; the system includes:
[0032] The knowledge base module is used to store semantic templates and structured knowledge vectors for various types of ships, and provides a fast retrieval function for semantic vectors;
[0033] The unconditional dehazing module is configured to perform coarse dehazing generation on the input haze image of ships at sea. This includes performing the reverse denoising process of the unconditional diffusion model, stopping at a preset early time step to obtain the global structural information of the image, and using a statistical alignment mechanism to align the preliminary denoising result with the local statistical features of the input haze image, outputting a coarsely dehazed image with a reasonable structure.
[0034] The semantic guidance generation module is configured to extract features from the coarse dehazing image to obtain initial high-level semantic information, and in conjunction with the knowledge base module, retrieve the ship semantic template most relevant to the initial high-level semantic information through semantic similarity matching, and complete and correct the initial information to form a knowledge base-enhanced semantic guidance signal.
[0035] The conditional refinement module is configured to input the coarse dehazed image and the semantic guidance signal into a pre-trained conditional diffusion model. Through a cross-modal attention mechanism, the semantic guidance signal is injected as a condition into the denoising process to focus on repairing key detail areas of the ship and output a final dehazed image with high definition and structural consistency.
[0036] The knowledge base module specifically stores "semantic templates and structured knowledge vectors for various types of ships," comprehensively covering the appearance features, geometric structures, and component relationships of different ship types such as cargo ships, fishing boats, and warships. It can adapt to defogging scenarios for different types of ships at sea, avoiding the problem of missing semantic constraints when defogging specific ship types due to limited knowledge coverage. At the same time, its built-in "semantic vector fast retrieval function" can quickly match the ship template most relevant to the initial high-level semantic information during the semantic guidance generation stage, without waiting for a long time for knowledge retrieval. This effectively ensures the real-time performance of the overall system processing flow and avoids the impact of knowledge retrieval delays on image defogging efficiency. The unconditional dehazing module, through its "early time step stopping in the diffusion model's reverse denoising" design, fully leverages the diffusion model's ability to capture the macroscopic structure of an image early in the denoising process. This allows for the rapid generation of a preliminary dehazing result with accurate global structure, avoiding global structural distortion (such as warping of the ship's overall shape) caused by excessive denoising. This ensures that the core structure of the coarse dehazing image is consistent with that of the real ship. Simultaneously, its "statistical alignment mechanism" aligns the preliminary denoising result with the local statistical features (such as local mean and standard deviation) of the input haze image. While ensuring the correct global structure, it preserves local details in the input image (such as ship texture and the outline of small parts) to the greatest extent possible. This avoids the problem of "overall clarity but loss of local details" in the coarse dehazing stage, providing the subsequent conditional refinement module with processing objects that combine structural integrity and detail. The semantic guidance generation module selects to extract initial high-level semantic information from the "coarse dehazing image". Compared with extracting semantics directly from the blurry haze image, it can avoid semantic extraction deviations caused by haze interference (such as misidentifying fog as ship parts), and the accuracy of the initial semantic information is higher. At the same time, through "knowledge base semantic similarity matching and information completion correction", it can make up for the incompleteness (such as semantic loss due to some parts still being blurry in the coarse dehazing image) or deviation problems that may exist in the initial high-level semantic information. The final "knowledge base enhanced semantic guidance signal" has both completeness and accuracy, and can serve as the core constraint basis for subsequent condition refinement modules, avoiding semantic distortion (such as abnormal number of ship parts or incorrect structural layout) during the detail repair process. The conditional refinement module adopts a design of "pre-trained conditional diffusion model + cross-modal attention mechanism". It injects semantic guidance signals as conditions into the denoising process. Through the cross-modal attention mechanism, the model can accurately focus on key detail areas of the ship (such as mast, deck equipment, and ship outline), achieving "targeted repair" rather than global uniform dehazing, effectively improving the clarity of key areas. At the same time, the strong constraint of the semantic guidance signal can ensure that the repaired key details are consistent with the structural features of the real ship (such as the mast height matching the hull ratio and the correct relative position of components). The final output dehazed image can meet the requirements of high definition and strictly guarantee structural consistency, avoiding invalid dehazing results that are "visually clear but semantically structurally incorrect".
[0037] As a preferred technical approach, the system also includes a model training module, which comprises:
[0038] The data synthesis unit employs a learnable generative model based on a hybrid training and hybrid sampling strategy to generate large-scale, realistic images of smog on ships at sea. Hybrid training is performed, alternating between pairs of synthesized smog images and unlabeled real smog images as training targets. Hybrid sampling is performed, in each denoising iteration of the generative model, the unconditional prediction output and the conditional prediction result of the model are fused according to a preset ratio.
[0039] The model training unit uses synthesized haze image data to train the unconditional diffusion model in the unconditional defogging module and the conditional diffusion model in the conditional refinement module.
[0040] The statistical alignment mechanism in the unconditional dehazing module is configured as follows: the early denoising results of the diffusion model and the input haze image are divided into the same local blocks; the mean and standard deviation of each local block are calculated; and a linear transformation is performed on each local block of the preliminary denoising results to align its statistical characteristics with the corresponding local block of the input haze image.
[0041] The data synthesis unit adopts a "hybrid training" strategy, alternating between "paired synthetic haze images" and "unlabeled real haze images" as training targets. The former allows the learnable generative model to accurately learn the content mapping relationship of "clear ship image → haze image", ensuring the structural correlation between synthetic data and real ships. The latter allows the model to learn the texture and concentration variation patterns of natural haze from real scene data, avoiding "overfitting" of the model due to learning only synthetic data (such as the generated haze texture being stiff and differing greatly from real sea haze), and significantly improving the realism of the synthetic data. Meanwhile, its "hybrid sampling" strategy integrates "unconditional prediction output" and "conditional prediction results" in each denoising iteration of the generative model: on the one hand, unconditional prediction can make up for the generation defects that may exist in conditional prediction (such as the distortion of haze concentration simulation in some areas), and improve the quality of a single synthesized image; on the other hand, the fusion of the two prediction results according to a preset ratio can break the limitations of a single generation mode and generate diverse training data covering different haze concentrations (dense fog, light fog), different lighting conditions, and different ship attitudes, avoiding the poor adaptability of the model to complex real scenes due to the single training data scene, and providing a data source with a wide coverage and high quality for subsequent model training.
[0042] The model training unit directly utilizes "large-scale realistic images of ships at sea with haze" generated by the data synthesis unit to provide dedicated training data for both the "unconditional diffusion model" and the "conditional diffusion model." Compared to using general image dehazing datasets (including non-maritime scenes and non-ship targets), dedicated data allows the model to focus on learning the degradation patterns and restoration logic of the specific scenario of "ships at sea + haze," avoiding the "insufficient targeting" of the model for dehazing tasks of ships at sea due to mixed data scenarios (such as incorrectly applying dehazing logic for land scenes to the sea). Through this targeted training, the unconditional diffusion model can accurately master the ability to "extract the global structure of images of ships at sea with haze," and the conditional diffusion model can learn the "restoration logic of key details of ships at sea" in advance. This ensures that the subsequent unconditional dehazing module and conditional refinement module can quickly adapt to the ship at sea scenario during actual dehazing, avoiding the problem of "general models but weak specific performance," and providing core model support for the overall dehazing effect of the system.
[0043] The statistical alignment mechanism achieves precise optimization of the initial denoising results through a refined design of "local block partitioning → statistical calculation → linear transformation alignment": The first step, "partitioning identical local blocks," decomposes the image into multiple small regions for targeted processing, avoiding the neglect of statistical features of local regions (such as small parts of the ship's hull or ship's side texture) due to "global alignment," ensuring that the alignment operation covers every detailed area of the image; The second step, "calculating the mean and standard deviation of each local block," provides objective data for alignment, avoiding alignment deviations caused by subjective experience judgments, and ensuring that the statistical characteristics of each local block are matched based on... The third step, "linear transformation alignment," ensures that the statistical characteristics of each local block are consistent with the input haze image without disrupting the global structure of the initial denoising result. This retains the advantage of "correct global structure" obtained from the early denoising of the diffusion model while maximizing the preservation of originally clear local details in the input image (such as ship markings and small equipment outlines). This avoids the problem of "clear overall structure but blurred / lost local details" that occurs in the coarse dehazing stage, providing a high-quality coarse dehazing image with "complete structure and traceable details" for the subsequent conditional refinement module, reducing the difficulty and cost of subsequent refinement and repair.
[0044] Beneficial effects:
[0045] (1) Significantly improves the professional semantic consistency of dehazed images: By introducing a domain knowledge base and performing deep fusion, this invention effectively solves the problem of lack of prior knowledge for specific domain targets in existing dehazing technologies. During the restoration process, the model not only performs pixel-level texture restoration, but also provides semantic guidance and correction based on prior information such as ship geometry and component relationships stored in the knowledge base. This ensures that the dehazed ship target conforms to the physical constraints of the real world in terms of shape, proportion, and key structural features, avoiding distortions such as structural distortion, missing components, or semantic inconsistencies that occur in common dehazing methods, and ensuring the high credibility of the restoration results in professional applications.
[0046] (2) Achieving high-fidelity detail restoration in complex scenes: The two-stage generation strategy of "unconditional coarse dehazing - conditional guided refinement" adopted in this invention combines the robustness of macroscopic restoration with the accuracy of microscopic detail generation. The first stage utilizes the powerful prior of the diffusion model to quickly reconstruct a physically reasonable and structurally correct overall image framework; the second stage, under the strong semantic constraints of the knowledge base, performs targeted enhancement and refined reconstruction of key local features of the ship (such as the ship's side, deck equipment, mast, etc.). This strategy can effectively cope with complex degradation scenes such as dense fog and uneven fog, comprehensively improving image clarity while ensuring the super-resolution restoration and edge sharpness of high-value target details.
[0047] (3) Enhancing the model's generalization and adaptability to the real world: Based on a haze data synthesis framework that integrates hybrid training and hybrid sampling strategies, this invention generates massive amounts of high-quality training data covering a wide range of haze concentrations, lighting conditions, and scene types. This strategy greatly expands the model's cognitive boundaries, enabling it to fully learn the complex statistical characteristics of real haze. Therefore, this dehazing model exhibits excellent generalization performance and environmental robustness when facing unknown real-world maritime scenarios not present in the training set, overcoming the problem of performance degradation in real-world maritime scenarios caused by the heavy reliance on synthetic data in traditional methods.
[0048] (4) Improved performance of downstream vision tasks: The dehazed images produced by this invention are characterized by rich details, accurate structure, and semantic consistency, providing higher quality input for subsequent advanced computer vision tasks. The dehazed images can significantly improve the accuracy and reliability of downstream tasks such as ship detection, pose estimation, and identity re-identification, thereby creating greater application value in professional fields such as maritime supervision, port scheduling, and autonomous shipping. Attached Figure Description
[0049] Figure 1 This is an overview diagram of the implementation method of the present invention;
[0050] Figure 2 This is a diffusion process diagram of the model of the present invention;
[0051] Figure 3 This is a qualitative comparison chart of the results generated by this invention with other methods. Detailed Implementation
[0052] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings.
[0053] Example 1:
[0054] This paper presents a method for dehazing images of ships at sea based on semantic guidance and knowledge base enhancement, such as... Figure 1 , Figure 2 As shown, it includes the following steps:
[0055] 1. For the input image of a ship at sea to be processed, a coarse dehazing generation is performed using a pre-trained unconditional diffusion model. The coarse dehazing generation includes: performing the reverse denoising process of the diffusion model, stopping at a preset early time step to obtain the global structural information of the image, and using a statistical alignment mechanism to align the preliminary denoising result with the local statistical features of the input haze image, and outputting a coarsely dehazed image with a reasonable structure.
[0056] II. Semantic Guidance Signal Generation: Feature extraction is performed on the coarse dehazing image to obtain initial high-level semantic information; combined with a pre-built maritime vessel domain knowledge base, the most relevant vessel semantic templates to the initial high-level semantic information are retrieved through semantic similarity matching, and the initial information is supplemented and corrected to form a knowledge base-enhanced semantic guidance signal;
[0057] 3. Conditional Refinement Generation: The coarse dehazed image and the semantic guidance signal are input into the pre-trained conditional diffusion model. The conditional diffusion model uses a cross-modal attention mechanism to inject the semantic guidance signal as a condition into the denoising process, focusing on repairing the key detail areas of the ship, and outputting a final dehazed image with high definition and structural consistency.
[0058] In the image dehazing process, a knowledge base is used to constrain and enhance semantic vectors, thereby ensuring that the dehazed image conforms to the structural and appearance features of a real ship. This invention, by introducing a knowledge base, enables the model to leverage prior knowledge of ship structure and geometry during generation, improving its ability to restore key structures and details, and reducing the loss of morphological information caused by haze interference.
[0059] To achieve data synthesis of realistic haze images, this embodiment adopts an advanced framework based on a learnable generator. Its core lies in introducing two strategies: Hybrid Training and Blended Sampling, to collaboratively optimize the generation effect.
[0060] Specifically, during the model training phase, we employ a hybrid training objective function, alternating between pairs of synthetic haze images and unlabeled real haze images. The former ensures that the generator learns the content mapping relationship between the input clear image and the output haze image, while the latter is used to maintain and enhance the rich generative priors learned by the model from real data, effectively preventing overfitting to low-quality synthetic data and the degradation of generative ability.
[0061] In the image generation sampling stage, we adopted a hybrid sampling strategy. This strategy integrates the model's unconditional prediction output into the conditional prediction path at a certain proportion in each denoising iteration. This approach has two advantages: firstly, it utilizes the complete generative capabilities of the unconditional prediction to compensate for potential defects and biases learned in the conditional path; secondly, it significantly improves the diversity and visual realism of the generated results, ensuring that the final synthesized haze image is both highly correlated with clear content and possesses realistically intricate textures and spatial variations.
[0062] Unconditionally Guided Dehazing Generation Stage: Utilizing the inherent prior of the diffusion model, a physically reasonable and structurally correct coarse dehazing estimate is quickly generated, laying a high-quality foundation for subsequent refinement. We observed that although the diffusion model fails to generate fine details in the early stages of denoising, it accurately captures the macroscopic structural layout and global color distribution of the image. This characteristic makes it very suitable for generating preliminary dehazing estimates. Therefore, this stage adaptively fuses the local statistical features of the haze image with the "clear image prior" implied in the early predictions of the diffusion model through an efficient statistical alignment mechanism. This process is essentially an inverse approximation of the atmospheric scattering physics model, effectively reversing the degradation effect of haze while preserving the details of the input image. Finally, a coarse dehazing result that is generally clear, retains good details, and has clear physical meaning is output. This result, as a powerful content-aware prior, significantly accelerates and improves the stability and fidelity of subsequent sampling processes, ensuring the structural correctness of the final dehazing result.
[0063] Conditional Guided Refinement Generation Stage: The coarse dehazing result obtained from the unconditional guided dehazing generation stage is input into a semantic guidance module. The semantic guidance module first parses the semantic information of the image, generating an initial semantic mapping or feature vector. Then, it queries and integrates a domain knowledge base, utilizing ship features, structural priors, and geometric rules to enhance, verify, and correct the initial semantic vector, forming a precise conditional guidance signal rich in domain knowledge. Finally, a conditional diffusion model receives this signal and the coarse dehazing result, performing refined dehazing generation under strong semantic constraints. This accurately restores the ship's key structures, edge details, and appearance features, producing the final high-definition, high-fidelity dehazed image.
[0064] The following specific embodiments further illustrate the above steps:
[0065] S1: Building a knowledge base for the maritime vessel domain
[0066] This step aims to build an intelligent domain knowledge base. Its core function is to receive the initial semantic description generated from the image, retrieve the most suitable professional ship template through semantic similarity matching, and use the precise structured knowledge in the template to complete, correct and enhance the original semantic description, thereby providing a high-precision and strongly constrained guiding signal for subsequent image generation.
[0067] S1.1, Data Acquisition and Expert Knowledge Injection:
[0068] 1) Multi-source data acquisition: Collect high-definition, fog-free images covering major ship types such as cargo ships, fishing boats, warships, yachts, oil tankers, and container ships, with no less than 800 images for each type, ensuring diversity in perspective, lighting, and sea conditions.
[0069] 2) Expert-written semantic templates: Invite maritime experts to write 5-10 standard natural language description templates for each type of vessel. These templates must include:
[0070] Overall characteristics: hull shape, length-to-beam ratio, deck layout.
[0071] Key components: component name, typical quantity, relative location, approximate size.
[0072] Structural relationships: Spatial topological relationships between components.
[0073] S1.2, Constructing a "semantic-structural" bimodal knowledge entry: Each expert-written semantic template is bound to its corresponding structured data to form a complete knowledge entry. Each entry contains two core parts:
[0074] A. Natural Language Semantic Template: Descriptive text written by experts.
[0075] B. Structured Knowledge Vector: Extracts key information from text into machine-readable structured data.
[0076] S1.3, Establish a semantic vector index library:
[0077] 1) Semantic encoding: Using the pre-trained CLIP Text Encoder model, each "semantic template" text is encoded into a 768-dimensional dense vector.
[0078] 2) Building the FAISS Index: Import the vectors of all semantic templates into the FAISS (Facebook AI SimilaritySearch) library to build an efficient Approximate Nearest Neighbor (ANN) index. This index supports finding the Top-K results most similar to the query statement from tens of thousands of templates within milliseconds.
[0079] S1.4 Defines the "Semantic Refinement" interface function
[0080] Define a core function in the system, whose workflow is as follows:
[0081] 1) Input: Receive the initial semantic description generated by the S4 stage semantic parsing module.
[0082] 2) Semantic encoding: Using the same CLIP Text Encoder model as S1.3, the initial semantic description is encoded into a query vector.
[0083] 3) Knowledge base retrieval: Search the FAISS index for the top-3 semantic templates that are most similar to the query vector and return their complete knowledge entries.
[0084] 4) Similarity ranking and selection: Calculate the cosine similarity between the initial semantic description and each candidate template, and select the template with the highest score as the matching result.
[0085] 5) Semantic Refinement and Output: Information Completion: Completes the ambiguous description in the initial semantic description with precise information from the matching template. Structure Enhancement: Outputs the matched structural information as additional, precise spatial constraints.
[0086] S2: Realistic Haze Image Data Synthesis
[0087] This step aims to build a learnable haze image generator called "HazeGen". Through innovative "hybrid training" and "hybrid sampling" strategies, it solves the domain shift problem caused by traditional physical synthesis methods, thereby generating high-quality synthetic data that is highly consistent with clear images in content and visually indistinguishable from real haze images.
[0088] Hybrid Training: The conditional generation objective uses synthetic image pairs to guide the model in establishing content relationships between generated blurred images and their corresponding clean images. Conversely, the unconditional objective uses unlabeled real-world haze images to help HazeGen maintain and further enhance its realistic haze generation capabilities, thus preventing catastrophic forgetting. Combining these two objectives, the hybrid training loss is:
[0089]
[0090] Among them, the encoded synthetic image pairs are composed of The encoded real-world blurred image is represented as... . Add real noise for each step. For neural networks (parameters are) Predicted noise, and They are at the time step At that time, there are synthetic images and real-world foggy images. P is a trade-off parameter for determining the probability of applying the conditional target.
[0091] Hybrid sampling: This strategy incorporates a small portion of unconditional predictions into the conditional noise predictions at each sampling step. Hybrid sampling has two advantages: (1) Unconditional predictions, by utilizing full generative capabilities, can effectively compensate for the deficiencies learned in conditional predictions; (2) The overall diversity of generated images is significantly improved.
[0092] Specific steps of the hybrid sampling algorithm:
[0093] 1) Encode the sharp image as a latent variable z_0.
[0094] 2) Add noise to obtain z_T.
[0095] 3) For time step t from T to 1:
[0096] a. Calculate conditional predictions
[0097] b. Calculate unconditional prediction
[0098] c. Core fusion steps: Calculate the mixed noise prediction, perform standard diffusion model backsampling, and update z_{t-1}.
[0099] 4) Decode z_0 to obtain the final synthetic haze image I_hazy.
[0100] S3: Unconditionally Guided Defogging Generation Phase
[0101] The core objective of this stage is to leverage the powerful general image priors of the pre-trained diffusion model to quickly generate a coarsely dehazed image with correct global structure and clear physical meaning, providing a high-quality and stable starting point for the refined semantic-guided inpainting in stage S4. The core idea is to stop the denoising process early, utilizing the macroscopic structural information already recovered by the model at this point, and preserving the local details of the original haze image through a statistical alignment mechanism.
[0102] Specific implementation steps:
[0103] S3.1: Model Loading and Initialization. Load the pre-trained model, encode the input image, and set the denoising starting point.
[0104] S3.2: Perform unconditional inverse denoising.
[0105] 1) Unconditional Denoising: Performs the standard inverse denoising process of the diffusion model. In this process, no text prompts or semantic conditions are input, relying solely on the general "sharp image" prior learned by the model itself.
[0106] 2) Stop in the early stage: In the reverse denoising loop, when the time step t decreases to T_coarse, the denoising process stops and the potential variables at this time are recorded.
[0107] 3) Implement statistical alignment mechanism: This step is crucial to ensuring that I_coarse retains the global structure while not losing valuable local details in I_hazy.
[0108] a. Decoding the coarse dehazed image: The latent variable z_{T_coarse} is decoded by the VAE decoder D to obtain the preliminary coarse dehazed image I_coarse_raw.
[0109] b. Local region segmentation: Divide the original haze images I_hazy and I_coarse_raw into non-overlapping local blocks of the same size.
[0110] c. Calculate local statistics: For each local block of I_hazy, calculate its mean μ_hazy and standard deviation σ_hazy. For the corresponding local block of I_coarse_raw, calculate its mean μ_coarse and standard deviation σ_coarse.
[0111] d. Adaptive statistical alignment: Perform a linear transformation on each local block of I_coarse_raw to align its statistical properties with those of I_hazy.
[0112] e. Stitching and Output: All statistically aligned local blocks are re-stitched to obtain the final coarse dehazing result I_coarse.
[0113] S4: Condition-guided refinement generation stage
[0114] S4.1: Preliminary transmission map estimation based on the input image of the ship at sea to be processed. For computational efficiency, the dark channel prior algorithm is used to estimate the transmission map. The main function of this map is to identify which regions in the image are more severely degraded in the original haze image, so that stronger denoising and detail reconstruction can be applied to these regions in the subsequent conditional diffusion model.
[0115] S4.2: Semantic understanding based on I_coarse aims to extract high-level semantic information from I_coarse for querying and activating the knowledge base built in stage S1, and to complete and refine the semantic information.
[0116] S4.3: Integrate the transmission image and semantic information to form a composite guidance signal.
[0117] S4.4: Conditional Diffusion Refined Generation
[0118] 1) Initialize the model and encode I_coarse into the latent variable z_start through the VAE encoder as the starting point of the diffusion process.
[0119] 2) Conditional Injection: In each denoising iteration of the diffusion model, the transmission map is used as a spatial condition (injected through the Cross-Attention mechanism), and the refined semantics are used as a textual condition (injected through the TextEncoder).
[0120] 3) Refined denoising sampling: Perform the reverse denoising process of the diffusion model. In this process, the model focuses on repairing regions with blurred details or uncertain structures in I_coarse, and ensures that their shape, quantity, and position strictly conform to the prior in the knowledge base.
[0121] S4.5: Loss Function
[0122] To overcome the problem that traditional pixel-level loss methods easily lead to inaccurate optimization targets in areas lacking texture, this invention innovatively introduces a semantic consistency loss function. This loss constrains the generation process from a semantic level by comparing the matching degree between the high-level semantic features extracted by the semantic parsing module of the generated dehazed image and the input guiding semantic information (enhanced by the knowledge base). This not only ensures the integrity and accuracy of the dehazed results in key semantic dimensions such as ship type, structural layout, and component relationships, but also effectively avoids the problem of "artificially low" pixel-level loss caused by the lack of local texture information in the original hazy image, thus guiding the model to focus on semantically correct detail reconstruction rather than blindly fitting unreliable pixel values. Its total loss function is as follows:
[0123]
[0124] in, For the total loss function, It's a pixel-level loss. It is a semantic consistency loss. This loss constrains the generation process from a semantic level by comparing the matching degree between the high-level semantic features extracted by the semantic parsing module of the generated dehazed image and the input guiding semantic information (enhanced by the knowledge base).
[0125] Compared with existing technologies, this method has the advantages shown in Table 1 and... Figure 3As shown, it possesses significant advantages such as high semantic consistency, strong detail restoration capability, excellent environmental generalization, and good professional adaptability. It can achieve high-fidelity structural restoration and clear reconstruction of maritime vessel targets under single-image input conditions, providing a high-quality visual foundation for downstream tasks such as maritime monitoring and target recognition, and has significant engineering application value and broad industrial prospects.
[0126] Table 1. Quantitative Comparison with Existing Generative Methods
[0127]
[0128] Example 2:
[0129] A system for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement is provided, which is used to perform the aforementioned method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement; the system includes:
[0130] The knowledge base module stores semantic templates and structured knowledge vectors for various types of ships and provides a fast retrieval function for semantic vectors.
[0131] The unconditional dehazing module is configured to perform coarse dehazing generation on the input image of a ship at sea. This includes performing a reverse denoising process using an unconditional diffusion model, stopping at a preset early time step to obtain global structural information of the image, and using a statistical alignment mechanism to align the preliminary denoising result with the local statistical features of the input haze image, outputting a coarsely dehazed image with a reasonable structure. The statistical alignment mechanism in the unconditional dehazing module is configured as follows: dividing the early denoising result of the diffusion model and the input haze image into the same local blocks; calculating the mean and standard deviation of each local block; and performing a linear transformation on each local block of the preliminary denoising result to align its statistical properties with the corresponding local block of the input haze image.
[0132] The semantic guidance generation module is configured to extract features from the coarse dehazed image to obtain initial high-level semantic information. Combined with the knowledge base module, it retrieves the ship semantic templates most relevant to the initial high-level semantic information through semantic similarity matching, completes and corrects the initial information, and forms a knowledge base-enhanced semantic guidance signal.
[0133] The conditional refinement module is configured to input the coarse dehazed image and the semantic guidance signal into the pre-trained conditional diffusion model. Through a cross-modal attention mechanism, the semantic guidance signal is injected as a condition into the denoising process to focus on repairing the key detail areas of the ship and output a final dehazed image with high definition and structural consistency.
[0134] The model training module comprises a data synthesis unit and a model training unit. The data synthesis unit employs a learnable generative model based on a hybrid training and hybrid sampling strategy to generate large-scale, realistic images of haze on ships at sea. Hybrid training is performed, alternately using pairs of synthesized haze images and unlabeled real haze images as training targets. Hybrid sampling is performed, fusing the model's unconditional prediction output with the conditional prediction result at a preset ratio in each denoising iteration of the generative model. The model training unit uses the synthesized haze image data to train the unconditional diffusion model in the unconditional dehazing module and the conditional diffusion model in the conditional refinement module.
[0135] It is understood that the detailed functional implementation of the above modules can be found in the description of the aforementioned method embodiments, and will not be elaborated further here.
[0136] The above are merely preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and optimizations can be made to the present invention without departing from the principle of the present invention, such as expanding the knowledge base structure, replacing the semantic parsing module, and adaptively adjusting the weights of the loss function. These improvements and optimizations should all be considered within the scope of protection of the present invention. The above are merely specific embodiments of the present invention and are not intended to limit the scope of the claims of the present invention. Any modifications, equivalent substitutions, or functional extensions made by those skilled in the art to the above embodiments without departing from the core idea of the technical solution of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement, characterized in that, Includes the following steps: For the input image of a ship at sea to be processed, a coarse dehazing generation is performed using a pre-trained unconditional diffusion model; The coarse dehazing generation includes: performing a reverse denoising process of a diffusion model, stopping at a preset early time step to obtain global structural information of the image, and using a statistical alignment mechanism to align the preliminary denoising result with the local statistical features of the input haze image, and outputting a coarsely dehazing image with a reasonable structure. Semantic guidance signal generation: Feature extraction is performed on the coarse dehazing image to obtain initial high-level semantic information; combined with a pre-built maritime vessel domain knowledge base, the most relevant vessel semantic templates to the initial high-level semantic information are retrieved through semantic similarity matching, and the initial information is completed and corrected to form a knowledge base-enhanced semantic guidance signal; Conditional refinement generation: The coarse dehazed image and the semantic guidance signal are input into a pre-trained conditional diffusion model; the conditional diffusion model uses a cross-modal attention mechanism to inject the semantic guidance signal as a condition into the denoising process, focusing on repairing key detail areas of the ship, and outputting a final dehazed image with high definition and structural consistency.
2. The method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement according to claim 1, characterized in that: The maritime vessel domain knowledge base is constructed by: collecting high-resolution images and expert knowledge of various types of vessels, building knowledge entries that include semantic templates and structured knowledge vectors, and using a pre-trained text encoder to build a fast retrieval index for semantic vectors.
3. The method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement according to claim 2, characterized in that: The semantic template, written by maritime experts, includes the ship's overall characteristics, key component information, and spatial topological relationships between components; the structured knowledge vector encodes the semantic template into a dense vector using a pre-trained text encoding model; and the fast retrieval index is constructed using an approximate nearest neighbor algorithm.
4. The method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement according to claim 1, characterized in that: The pre-trained unconditional diffusion model and the pre-trained conditional diffusion model were trained using haze image data synthesized through a hybrid training and hybrid sampling strategy.
5. The method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement according to claim 4, characterized in that: The hybrid training involves alternating between pairs of synthetic haze images and unlabeled real haze images as training targets; the hybrid sampling involves fusing the unconditional prediction output and the conditional prediction result of the model at a preset ratio in each denoising iteration of the generative model.
6. The method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement according to claim 1, characterized in that: The specific implementation of the statistical alignment mechanism includes: dividing the early denoising results of the diffusion model and the input haze image into the same local blocks, and calculating the mean and standard deviation of each local block; performing a linear transformation on each local block of the preliminary denoising results to align its statistical characteristics with the corresponding local block of the input haze image.
7. The method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement according to claim 1, characterized in that: During the denoising process, the conditional diffusion model simultaneously injects two types of guiding signals: the semantic guiding signal is injected as a textual condition; and the transmission map estimated from the haze image is injected as a spatial condition. The model fuses these two conditions through a cross-modal attention mechanism.
8. A method for dehazing maritime vessel images based on semantic guidance and knowledge base enhancement according to claim 7, characterized in that: The loss function used to train the conditional diffusion model is a combined loss function, which includes pixel-level reconstruction loss and semantic consistency loss. The semantic consistency loss constrains the accuracy of the generated results in terms of ship category and structure by comparing the similarity between the generated image and the guidance signal in the high-level semantic feature space.
9. A system for dehazing images of ships at sea based on semantic guidance and knowledge base enhancement, characterized in that: The system is used to perform the semantically guided and knowledge-based enhanced method for dehazing marine vessel images according to any one of claims 1-8; the system comprises: The knowledge base module is used to store semantic templates and structured knowledge vectors for various types of ships, and provides a fast retrieval function for semantic vectors; The unconditional dehazing module is configured to perform coarse dehazing generation on the input haze image of ships at sea. This includes performing the reverse denoising process of the unconditional diffusion model, stopping at a preset early time step to obtain the global structural information of the image, and using a statistical alignment mechanism to align the preliminary denoising result with the local statistical features of the input haze image, outputting a coarsely dehazed image with a reasonable structure. The semantic guidance generation module is configured to extract features from the coarse dehazing image to obtain initial high-level semantic information, and in conjunction with the knowledge base module, retrieve the ship semantic template most relevant to the initial high-level semantic information through semantic similarity matching, and complete and correct the initial information to form a knowledge base-enhanced semantic guidance signal. The conditional refinement module is configured to input the coarse dehazed image and the semantic guidance signal into a pre-trained conditional diffusion model. Through a cross-modal attention mechanism, the semantic guidance signal is injected as a condition into the denoising process to focus on repairing key detail areas of the ship and output a final dehazed image with high definition and structural consistency.
10. A maritime vessel image dehazing system based on semantic guidance and knowledge base enhancement according to claim 9, characterized in that: It also includes a model training module, which includes: The data synthesis unit employs a learnable generative model based on a hybrid training and hybrid sampling strategy to generate large-scale, realistic images of smog on ships at sea. Hybrid training is performed, alternating between pairs of synthesized smog images and unlabeled real smog images as training targets. Hybrid sampling is performed, in each denoising iteration of the generative model, the unconditional prediction output and the conditional prediction result of the model are fused according to a preset ratio. The model training unit uses synthesized haze image data to train the unconditional diffusion model in the unconditional defogging module and the conditional diffusion model in the conditional refinement module. The statistical alignment mechanism in the unconditional dehazing module is configured as follows: the early denoising results of the diffusion model and the input haze image are divided into the same local blocks; the mean and standard deviation of each local block are calculated; and a linear transformation is performed on each local block of the preliminary denoising results to align its statistical characteristics with the corresponding local block of the input haze image.
Citation Information
Patent Citations
Ship defogging method and system based on atmospheric scattering prior diffusion model
CN117789041A
Image defogging method, device and equipment based on diffusion model
CN120430970A