Image reflection elimination method and device of embedded intelligent accelerator

By using the combination of Swin Transformer architecture and DereflectFormer module on the embedded intelligent accelerator, the accuracy and computing resource problems of image reflection elimination in the existing technology are solved, and efficient and accurate image reflection elimination is achieved, which is suitable for complex scenes and resources. Restricted environment.

CN118552433APending Publication Date: 2024-08-27SHANGHAI PROCESSOR TECH INNOVATION CENT
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410480096.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Existing technologies have problems in processing image reflection elimination tasks in complex real-world scenes, such as insufficient accuracy, high consumption of computing resources, and oversimplified assumptions about reflection characteristics, especially in environments with variable reflection characteristics and limited computing resources. situation.

Method used

It adopts an embedded intelligent accelerator based on the network architecture of Swin Transformer, uses the self-attention mechanism to capture long-distance dependencies in images, combines the DereflectFormer module and the deep multi-activation function feed-forward layer, and uses training data preparation and model optimization in the intelligent AI chip. An efficient image reflection elimination algorithm is implemented on the platform.

Benefits of technology

It improves the accuracy and robustness of image reflection elimination, significantly improves the reasoning speed and efficiency of the algorithm, reduces energy consumption, and adapts to a wider range of practical application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552433A
    Figure CN118552433A
Patent Text Reader

Abstract

The invention provides an image reflection elimination method and device for an embedded intelligent accelerator. The method comprises the following steps: acquiring a reflection image marked with an image label as training data; constructing a reflection elimination model of a network architecture based on Swin Transform, wherein the network architecture comprises a self-attention mechanism used for capturing a long-distance dependency relationship in the image; building the reflection elimination model on an intelligent AI chip platform to which the embedded intelligent accelerator belongs; the embedded intelligent accelerator performs reflection elimination on the training data through the reflection elimination model to obtain a reflection elimination image, constructs a loss function according to the reflection elimination image and the image label, and trains the reflection elimination model; and inputting the image of which the reflection is to be eliminated into the embedded intelligent accelerator, and performing reflection elimination processing on the image of which the reflection is to be eliminated through the trained reflection elimination model to obtain a reflection elimination image as an image reflection elimination result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical fields of computer vision, image processing and embedded computing systems, and in particular to a method and a device for eliminating image reflection of an embedded intelligent accelerator. Background Art

[0002] Image reflection removal is a key research direction in the field of computer vision, which is crucial to improving image quality and the accuracy of computer vision tasks. Existing technologies mainly rely on convolutional neural network (CNN) architectures, which are usually based on a series of prior assumptions about reflection properties, such as the blurry nature of reflections, ghostly image cues produced by thick glass, and the focal length difference between reflection and transmission imaging. These methods have achieved certain results under certain conditions, but they have encountered some difficulties in dealing with complex reflections in real-world scenes. For example, existing technologies may not accurately handle reflections on thin glass surfaces, or show inconsistent performance in scenes with multiple different types of reflections. Although existing image reflection removal methods have made progress in some aspects, they still face challenges in completely removing reflections in various real-world scenes. The limitations of these methods mainly lie in their overly simplified assumptions about reflection properties, which cannot adapt to the diversity and complexity of the real world, as well as the limited receptive field range of the convolutional neural network itself. In addition, these methods are also insufficient in terms of computing resource consumption, which consumes a lot of GPU computing resources. Summary of the invention

[0003] The purpose of the present invention is to improve the quality and efficiency of image processing, especially the image reflection removal task in complex environments. In order to solve the limitations of existing image reflection removal technology in processing complex real-world scenes, especially in the case of variable reflection characteristics and limited computing resources. Specifically, the technical problems to be solved by the present invention include:

[0004] 1. How to accurately identify and remove reflections from images without relying on assumptions about specific reflection properties.

[0005] 2. When the existing reflection image dataset is insufficient, how to generate reflection images that can be used for training using two different pictures.

[0006] 3. How to improve the efficiency and speed of image reflection removal algorithm under limited computing resources and energy consumption conditions.

[0007] 4. How to implement a high-performance image reflection elimination algorithm on an embedded intelligent accelerator that includes an intelligent AI chip platform.

[0008] In order to solve the above problems, the present invention proposes an image reflection elimination method for an embedded intelligent accelerator, which includes: a training data preparation step, obtaining a reflection image with a marked image label as training data; a model construction step, constructing a reflection elimination model based on a network architecture of Swin Transformer, wherein the network architecture includes a self-attention mechanism for capturing long-distance dependencies in the image; building the reflection elimination model on an intelligent AI chip platform to which the embedded intelligent accelerator belongs; a model training step, wherein the embedded intelligent accelerator performs reflection elimination on the training data through the reflection elimination model to obtain a reflection eliminated image, constructs a loss function according to the reflection eliminated image and the image label, and trains the reflection elimination model on the intelligent AI chip platform; an image reflection elimination step, inputting the image to be reflected into the embedded intelligent accelerator, performing reflection elimination processing on the image to be reflected through the trained reflection elimination model, and obtaining a reflection eliminated image as an image reflection elimination result.

[0009] The algorithm uses the self-attention mechanism of the Transformer architecture to capture long-distance dependencies in images, thereby more accurately processing complex reflection scenes and improving the accuracy of reflection elimination.

[0010] The image reflection elimination method of the embedded intelligent accelerator is described, wherein the reflection elimination model includes a convolution layer and a DereflectFormer layer; the DereflectFormer module is composed of a Block, and the Block includes a windowed multi-head self-attention mechanism layer and a deep multi-activation function feedforward layer; the windowed multi-head self-attention mechanism layer uses a self-attention mechanism to capture the global dependency of the image; the deep multi-activation function feedforward layer fuses the global dependency and the input features input to the windowed multi-head self-attention mechanism layer through a deep separable convolution to obtain a first fused feature; the convolution layer is used to extract the image features of the image input to the reflection elimination model; through a jump connection, the input features are fused with the features output by the Block to obtain a second fused feature; the second fused feature and the image feature are fused to obtain a de-reflected image and combined with the image input to the reflection elimination model to obtain the reflection eliminated image.

[0011] Through the deep multi-activation function feed-forward layer, complex reflection scenes can be processed more accurately and the accuracy of reflection elimination can be improved.

[0012] The image reflection elimination method of the embedded intelligent accelerator, wherein the training data preparation step includes: obtaining a background image B and a reflection image R, blurring the reflection image R to obtain a reflection image R_blur; adding the background image B and the reflection image R_blur to obtain a composite image M as the training data, and the image label of the training data is the background image B.

[0013] By collecting new reflection image data and generating high-quality training samples, the generalization ability of the model and its adaptability to complex reflection scenes are improved.

[0014] The image reflection elimination method of the embedded intelligent accelerator, wherein the intelligent AI chip platform is the Cambrian MLU platform; the model training step includes: when the reflection elimination model is trained in parallel on the intelligent AI chip platform, the inference speed and efficiency of the reflection elimination model on the intelligent AI chip platform are improved through model quantization and operator optimization.

[0015] By optimizing algorithms based on the hardware characteristics of intelligent AI chip platforms such as the Cambrian MLU platform, including operator adaptation, model quantization, and parallel training strategies, the algorithm's reasoning speed and efficiency can be significantly improved, and computing costs can be reduced.

[0016] The present invention also proposes an image reflection elimination device for an embedded intelligent accelerator, comprising:

[0017] A training data preparation module obtains reflection images with labeled image labels as training data;

[0018] A model building module, which builds a reflection elimination model based on the Swin Transformer network architecture, which includes a self-attention mechanism for capturing long-distance dependencies in images; and builds the reflection elimination model on the intelligent AI chip platform to which the embedded intelligent accelerator belongs;

[0019] A model training module, wherein the embedded intelligent accelerator performs reflection elimination on the training data through the reflection elimination model to obtain a reflection elimination image, constructs a loss function according to the reflection elimination image and the image label, and trains the reflection elimination model on the intelligent AI chip platform;

[0020] The image reflection elimination module inputs the image to be reflected into the embedded intelligent accelerator, performs reflection elimination processing on the image to be reflected through the trained reflection elimination model, and obtains the reflection eliminated image as the image reflection elimination result.

[0021] The image reflection elimination device of the embedded intelligent accelerator, wherein the reflection elimination model includes a convolution layer and a DereflectFormer layer; the DereflectFormer module is composed of a Block, and the Block includes a windowed multi-head self-attention mechanism layer and a deep multi-activation function feedforward layer;

[0022] The windowed multi-head self-attention mechanism layer uses the self-attention mechanism to capture the global dependency of the image; the deep multi-activation function feed-forward layer fuses the global dependency and the input features input to the windowed multi-head self-attention mechanism layer through a deep separable convolution to obtain a first fused feature;

[0023] The convolution layer is used to extract image features of the image input into the reflection elimination model;

[0024] Through the jump connection, the input feature is fused with the feature output by the block to obtain the second fused feature;

[0025] The second fusion feature and the image feature are fused to obtain a de-reflected image, and the de-reflected image is combined with the image input into the reflection elimination model to obtain the reflection elimination image.

[0026] The image reflection elimination device of the embedded intelligent accelerator, wherein the training data preparation module comprises:

[0027] A background image B and a reflection image R are obtained, and the reflection image R is blurred to obtain a reflection image R_blur; the background image B and the reflection image R_blur are added to obtain a composite image M as the training data, and the image label of the training data is the background image B.

[0028] The image reflection elimination device of the embedded intelligent accelerator, wherein the intelligent AI chip platform is the Cambrian MLU platform.

[0029] The present invention also provides an electronic device, which includes the image reflection elimination device of the embedded intelligent accelerator.

[0030] The present invention also proposes a storage medium for storing a computer program of the image reflection elimination method of the embedded intelligent accelerator.

[0031] It can be seen from the above scheme that the advantages of the present invention are:

[0032] 1. Improved the accuracy and robustness of image reflection removal, especially when dealing with changing and complex reflection scenes.

[0033] 2. An efficient image reflection elimination algorithm was implemented on the Cambrian MLU platform, which improved the algorithm's reasoning speed and reduced energy consumption.

[0034] 3. By optimizing the construction and enhancement of the dataset, the training quality of the model is improved, enabling the algorithm to play a role in a wider range of practical application scenarios.

[0035] The invention not only solves the shortcomings of the prior art in eliminating image reflections, but also provides a new technical path for the application of intelligent AI chip platforms, and has important practical application value and market prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of the architecture of the algorithm model of the present invention;

[0037] Figure 2 Synthesize a flow chart for the data;

[0038] Figure 3 is a sample image;

[0039] Figure 4 Porting flowchart for MLU algorithm. DETAILED DESCRIPTION

[0040] It should be noted that the processor described in the present invention is the control center of the electronic device, which can be a processor or a general term for multiple processing elements. For example, it can be one or more central processing units (CPUs), or application specific integrated circuits (ASICs), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs).

[0041] Optionally, the processor can perform various functions of the electronic device by running or executing a software program stored in the memory, and calling data stored in the memory.

[0042] In a specific implementation, as an embodiment, the processor may include one or more CPUs. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions). Electronic devices may include: servers, desktop computers, laptops, smart phones, tablet computers, embedded computers, etc., wherein the embedded computers include vehicles and robots, etc.

[0043] The memory is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment, which will not be repeated here.

[0044] It should be noted that the structure of the electronic device shown in the drawings of the present invention does not constitute a limitation thereto, and the actual knowledge structure recognition device may include more or fewer components than shown in the drawings, or a combination of certain components, or a different arrangement of components.

[0045] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0046] It should also be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0047] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0048] It should also be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0049] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0050] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0051] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0052] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0053] When the inventors conducted research on image reflection elimination, they found that the defects in the prior art were mainly due to the use of convolutional neural networks, which relied too much on prior knowledge and did not fully consider the diversity and complexity of reflection. For example, existing methods often ignore the different characteristics that reflection may exhibit under different materials and environments, as well as the complex relationship between reflection and transmission images. And due to the limitation of the receptive field range of convolutional neural networks, once a large area of ​​reflection appears in a picture, it is difficult for the prior art to guarantee the quality of the restored image. After in-depth research, the inventors found that these defects can be solved by a new algorithm based on Swin Transformer. The algorithm uses the self-attention mechanism of the Transformer architecture to better capture long-distance dependencies and solve the problem of limited receptive field range of convolutional neural networks, so as to more accurately process complex reflection scenes. The present invention also improves the MLP (multi-layer perceptron) module in Swin Transformer to obtain a deep multi-activation function feedforward DMFN module. In addition, the inventors also found that by transplanting the algorithm to an embedded intelligent accelerator, such as the Cambrian MLU platform, the inference speed and efficiency of the algorithm can be significantly improved, while reducing computing costs and energy consumption.

[0054] In order to make the above features and effects of the present invention more clearly and understandably described, embodiments are given below and described in detail with reference to the accompanying drawings. This specification discloses one or more embodiments that include the features of the present invention. The disclosed embodiments are only for illustration. The scope of protection of the present invention is not limited to the disclosed embodiments, and the present invention is defined by the attached claims.

[0055] The image reflection elimination method and system of the present invention include the following key steps:

[0056] The training image preparation step includes: collecting image datasets with different types of reflections, such as glass reflection, water surface reflection, etc.; and / or synthesizing new reflection images to increase the diversity and scale of images in the image dataset; and / or preprocessing the images in the collected image dataset, including cleaning, standardization and expansion, to improve data quality.

[0057] The model building steps include: designing a reflection elimination model based on the Swin Transformer network architecture, which includes a self-attention mechanism that can capture long-distance dependencies in images; implementing the reflection elimination model on an intelligent AI chip platform (such as the Cambrian MLU platform) to ensure the compatibility of the reflection elimination model with the hardware; and / or improving the multi-layer perceptron MLP module in Swin Transformer.

[0058] The model training step includes: using an appropriate loss function and / or optimizer to train the reflection elimination model through the image data set; during the training process, the model parallel training strategy can be used to improve the training efficiency and speed. The optimizer is an algorithm used to update and optimize the model parameters. It adjusts the model parameters according to the gradient calculated by the loss function to reduce the loss value. The loss function is responsible for evaluating the performance of the model, and the optimizer is responsible for updating the parameters of the model according to the result of the loss function. The two work together to improve the ability of the model. During the training process, the loss function is first calculated to obtain the loss value, and then the optimizer is used to update the model parameters according to the gradient of the loss value. This process will be repeated until the performance of the model reaches a certain level or reaches a predetermined number of training rounds. The loss function used in the training of the present invention is L1 loss (mean absolute error loss), which calculates the average of the absolute value of the difference between the predicted value and the true value. The optimizer is an AdamW optimizer, which improves the stability and efficiency of training by adjusting the weight decay.

[0059] The model optimization steps include: quantizing the reflection elimination model after training, reducing the size of the reflection elimination model, and improving the inference speed; and / or developing custom operators compatible with the intelligent AI chip platform to solve the problem of operator unsupport. Specifically, it includes algorithm development, algorithm optimization, platform adaptation, and compilation and deployment.

[0060] Algorithm Development: Describes the initial development environment for the reflection removal model, including the programming languages, frameworks, and tools used.

[0061] Algorithm optimization: Demonstrate the optimization steps for the reflection elimination model to ensure that it can run efficiently on the intelligent AI chip platform, including the adaptation of specific operators in the algorithm, model quantization, parallel processing strategies, etc.

[0062] Platform adaptation: Adapt the optimized algorithm to the Cambrian MLU platform, including hardware interface, memory management, and performance tuning.

[0063] Compilation and deployment: Describes the algorithm compilation process on the intelligent AI chip platform, including the compiler used and optimization options. Shows the steps for deploying the algorithm to the hardware platform, including resource allocation and configuration settings.

[0064] The image reflection elimination step includes: optimizing and deploying the trained reflection elimination model or the optimized reflection elimination model on the intelligent AI chip platform, and performing reflection elimination processing on the input image. The self-attention mechanism of the model is used to identify and separate the reflection and transmission components in the image. The image with the reflection removed is output to improve the image quality.

[0065] The present invention may also include performance evaluation steps: benchmarking on standard data sets to evaluate the performance of the model; comparing the impact of different data sets and data enhancement techniques on model performance; testing the performance of custom operators, and the performance improvement of model quantization and parallel training. Specifically, the model can be tested on an intelligent AI chip platform to verify its performance and accuracy. The test content may include unit testing, integration testing, and performance benchmarking.

[0066] The present invention uses a deep learning model to accurately identify and eliminate reflections in images. Figure 1 As shown, the following is the specific processing process of the reflection elimination model:

[0067] Input image processing: The input image I is subjected to preliminary feature extraction through a 3x3 convolutional layer. Next, the image passes through a DereflectFormer layer, which contains multiple blocks, each of which contains a Windowed Multi-Head Self-Attention (W-MHSA) layer and a Depthwise Multi-Activation Feed-Forward Network (DMFN) layer.

[0068] Feature extraction and fusion: In each DereflectFormer Block, the W-MHSA module uses the self-attention mechanism to capture the global dependencies of the image, while the DMFN module performs feature fusion through depthwise separable convolution. Through skip connections, the input features are fused with the features processed by DereflectFormerBlock to retain more image details.

[0069] Downsampling and upsampling: Use 1x1 convolutional layers for downsampling to reduce the spatial dimension of the feature map while increasing the number of channels. Upsampling is performed through 3x3 depthwise separable convolution (Dconv) to restore the spatial resolution of the feature map.

[0070] Reflection elimination and output: In the final stage of DereflectFormer, feature fusion is performed through a 1x1 convolutional layer, which corresponds to the element-by-element addition of two tensors of the same shape in deep learning, and finally the dereflected image J is output. The output image J is added element-by-element to the original image I tensor through Element-wiseAddition to eliminate reflections and preserve the original structure of the image.

[0071] The following is the specific process of training and optimizing the reflection elimination model:

[0072] On the intelligent AI chip platform, the DereflectFormer model is trained and the model parameters are optimized to improve the accuracy of reflection elimination. Through model quantization and operator optimization, the inference speed and efficiency of the model on the intelligent AI chip platform are improved.

[0073] This data preparation step may include synthesizing new reflectance images, such as Figure 2 and Figure 3 As shown in the figure, the reflection image data synthesis process starts with selecting the background image B and the reflection image R. The two images are first converted into NumPy arrays and normalized. NumPy is a basic library for scientific computing in Python, which provides a wealth of mathematical functions and operations to process arrays. After converting the image to a NumPy array, these functions can be easily used to perform numerical calculations and transformations of the image (such as subsequent normalization). Converting the image to a NumPy array can take advantage of the powerful functions and performance advantages provided by the NumPy library to process image data more efficiently and consistently, especially when performing image synthesis.

[0074] Next, create a Gaussian kernel proportional to a randomly generated sigma value in a predefined range. This Gaussian kernel is convolved with the reflection image R to generate a blurred reflection image R_blur. Then, we add the background image B to R_blur to get the synthesized image M. If the value of the synthesized image M exceeds the standardized range, necessary corrections are required to ensure the validity of the image value. Finally, the synthesized image M is saved for training and testing of the model.

[0075] The following is a system embodiment corresponding to the above method embodiment. This embodiment can be implemented in conjunction with the above embodiment. The relevant technical details mentioned in the above embodiment are still valid in this embodiment. In order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiment.

[0076] The present invention also proposes an image reflection elimination device for an embedded intelligent accelerator, comprising:

[0077] A training data preparation module obtains reflection images with labeled image labels as training data;

[0078] A model building module, which builds a reflection elimination model based on the SwinTransformer network architecture, which includes a self-attention mechanism for capturing long-distance dependencies in images; and builds the reflection elimination model on the intelligent AI chip platform to which the embedded intelligent accelerator belongs;

[0079] A model training module, wherein the embedded intelligent accelerator performs reflection elimination on the training data through the reflection elimination model to obtain a reflection elimination image, constructs a loss function according to the reflection elimination image and the image label, and trains the reflection elimination model on the intelligent AI chip platform;

[0080] The image reflection elimination module inputs the image to be reflected into the embedded intelligent accelerator, performs reflection elimination processing on the image to be reflected through the trained reflection elimination model, and obtains the reflection eliminated image as the image reflection elimination result.

[0081] The image reflection elimination device of the embedded intelligent accelerator, wherein the reflection elimination model includes a convolution layer and a DereflectFormer layer; the DereflectFormer module is composed of a Block, and the Block includes a windowed multi-head self-attention mechanism layer and a deep multi-activation function feedforward layer;

[0082] The windowed multi-head self-attention mechanism layer uses the self-attention mechanism to capture the global dependency of the image; the deep multi-activation function feed-forward layer fuses the global dependency and the input features input to the windowed multi-head self-attention mechanism layer through a deep separable convolution to obtain a first fused feature;

[0083] The convolution layer is used to extract image features of the image input into the reflection elimination model;

[0084] Through the jump connection, the input feature is fused with the feature output by the block to obtain the second fused feature;

[0085] The second fusion feature and the image feature are fused to obtain a de-reflected image, and the de-reflected image is combined with the image input into the reflection elimination model to obtain the reflection elimination image.

[0086] The image reflection elimination device of the embedded intelligent accelerator, wherein the training data preparation module comprises:

[0087] A background image B and a reflection image R are obtained, and the reflection image R is blurred to obtain a reflection image R_blur; the background image B and the reflection image R_blur are added to obtain a composite image M as the training data, and the image label of the training data is the background image B.

[0088] The image reflection elimination device of the embedded intelligent accelerator, wherein the intelligent AI chip platform is the Cambrian MLU platform.

[0089] The present invention also provides an electronic device, which includes the image reflection elimination device of the embedded intelligent accelerator.

[0090] The present invention also proposes a storage medium for storing a computer program of the image reflection elimination method of the embedded intelligent accelerator. It should be understood that the storage medium in the embodiment of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0091] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. A method for eliminating image reflection of an embedded intelligent accelerator, characterized in that: include: A training data preparation step, obtaining reflection images with labeled image labels as training data; Model building step: building a reflection elimination model based on the Swin Transformer network architecture, which includes a self-attention mechanism for capturing long-distance dependencies in images; building the reflection elimination model on the intelligent AI chip platform to which the embedded intelligent accelerator belongs; A model training step, wherein the embedded intelligent accelerator performs reflection elimination on the training data through the reflection elimination model to obtain a reflection elimination image, constructs a loss function according to the reflection elimination image and the image label, and trains the reflection elimination model; In the image reflection elimination step, the image to be reflected is input into the embedded intelligent accelerator, and the image to be reflected is subjected to reflection elimination processing by the trained reflection elimination model to obtain a reflection eliminated image as the image reflection elimination result.

2. The image reflection elimination method of the embedded intelligent accelerator according to claim 1, characterized in that: The reflection elimination model includes a convolutional layer and a DereflectFormer layer; the DereflectFormer module is composed of a Block, which includes a windowed multi-head self-attention mechanism layer and a deep multi-activation function feedforward layer; The windowed multi-head self-attention mechanism layer uses the self-attention mechanism to capture the global dependency of the image; the deep multi-activation function feed-forward layer fuses the global dependency and the input features input to the windowed multi-head self-attention mechanism layer through a deep separable convolution to obtain a first fused feature; The convolution layer is used to extract image features of the image input into the reflection elimination model; Through the jump connection, the input feature is fused with the feature output by the block to obtain the second fused feature; The second fusion feature and the image feature are fused to obtain a de-reflected image, and the de-reflected image is combined with the image input into the reflection elimination model to obtain the reflection elimination image.

3. The image reflection elimination method of the embedded intelligent accelerator according to claim 1, characterized in that: The training data preparation steps include: A background image B and a reflection image R are obtained, and the reflection image R is blurred to obtain a reflection image R_blur; the background image B and the reflection image R_blur are added to obtain a composite image M as the training data, and the image label of the training data is the background image B.

4. The image reflection elimination method of the embedded intelligent accelerator according to claim 1, characterized in that: The intelligent AI chip platform is the Cambrian MLU platform; the model training step includes: when training the reflection elimination model in parallel on the intelligent AI chip platform, improving the reasoning speed and efficiency of the reflection elimination model on the intelligent AI chip platform through model quantization and operator optimization.

5. An image reflection elimination device for an embedded intelligent accelerator, characterized in that: include: A training data preparation module obtains reflection images with labeled image labels as training data; A model building module, which builds a reflection elimination model based on the Swin Transformer network architecture, which includes a self-attention mechanism for capturing long-distance dependencies in images; and builds the reflection elimination model on the intelligent AI chip platform to which the embedded intelligent accelerator belongs; A model training module, wherein the embedded intelligent accelerator performs reflection elimination on the training data through the reflection elimination model to obtain a reflection elimination image, constructs a loss function according to the reflection elimination image and the image label, and trains the reflection elimination model; The image reflection elimination module inputs the image to be reflected into the embedded intelligent accelerator, performs reflection elimination processing on the image to be reflected through the trained reflection elimination model, and obtains the reflection eliminated image as the image reflection elimination result.

6. The image reflection elimination device of the embedded intelligent accelerator as claimed in claim 5, characterized in that: The reflection elimination model includes a convolutional layer and a DereflectFormer layer; the DereflectFormer module is composed of a Block, which includes a windowed multi-head self-attention mechanism layer and a deep multi-activation function feedforward layer; The windowed multi-head self-attention mechanism layer uses the self-attention mechanism to capture the global dependency of the image; the deep multi-activation function feed-forward layer fuses the global dependency and the input features input to the windowed multi-head self-attention mechanism layer through a deep separable convolution to obtain a first fused feature; The convolution layer is used to extract image features of the image input into the reflection elimination model; Through the jump connection, the input feature is fused with the feature output by the block to obtain the second fused feature; The second fusion feature and the image feature are fused to obtain a de-reflected image, and the de-reflected image is combined with the image input into the reflection elimination model to obtain the reflection elimination image.

7. The image reflection elimination device of the embedded intelligent accelerator as claimed in claim 5, characterized in that: The training data preparation module includes: A background image B and a reflection image R are obtained, and the reflection image R is blurred to obtain a reflection image R_blur; the background image B and the reflection image R_blur are added to obtain a composite image M as the training data, and the image label of the training data is the background image B.

8. The image reflection elimination device of the embedded intelligent accelerator as claimed in claim 5, characterized in that: The intelligent AI chip platform is the Cambrian MLU platform; the model training module includes: when the reflection elimination model is trained in parallel on the intelligent AI chip platform, the reasoning speed and efficiency of the reflection elimination model on the intelligent AI chip platform are improved through model quantization and operator optimization.

9. An electronic device, characterized in that: An image reflection elimination device for an embedded intelligent accelerator comprising the claims 5-8.

10. A storage medium for storing a computer program for executing the image reflection elimination method of the embedded intelligent accelerator according to claims 1-4.

Citation Information

Patent Citations

  • Multi-hardware target depth model optimization deployment architecture supporting user-defined operator

    CN113934410A

  • Construction method and system of heterogeneous computing system

    CN114116236A

  • Deep learning-based denoising and super-resolution combined low-illumination image enhancement method

    CN116051428A

  • Complex road target detection method based on multi-modal fusion aerial view

    CN117058646A