Method and device for generating camouflage pattern based on CAM-GAN
By introducing CAM-GAN technology in camouflage pattern generation, using the three-party game between the generator and the two discriminators to generate camouflage patterns with higher compatibility, the camouflage pattern generation efficiency and adaptability in the existing technology is solved. The problem is to realize the effective disguise of the target detection system and the human eye.
Patent Information
- Application Number
- CN202510036099.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing camouflage pattern generation method cannot quickly, targeted, end-to-end generation of camouflage patterns of target backgrounds, and the generated camouflage patterns need to be regenerated when the season changes. Traditional camouflage has poor camouflage effect on neural network image classification models. .
Using the method of camouflage camouflage pattern generation based on CAM-GAN, through the three-party game between the generator and two different discriminators, a camouflage pattern with higher compatibility can be generated, which can achieve good camouflage effect in both the physical and digital domains. .
The compatibility of the target detection system and the human eye is realized, the efficiency and adaptability of the camouflage pattern generation is improved, and the success rate of camouflage for the intelligent recognition system is enhanced.
Smart Images

Figure CN119444910A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image generation, and in particular relates to a camouflage pattern generation method and device based on CAM-GAN. Background Art
[0002] Autonomous driving has attracted worldwide attention since it was first proposed. Autonomous driving means that during driving, a car can receive relevant information about the external driving environment through on-board sensors, input the detected road, vehicle position, obstacles and other information into the on-board processor for logical reasoning and calculation, and then output the result instructions to the actuator, and then control the operation of the vehicle by changing the steering and speed of the car, so that the car can replace the human driver under limited or unlimited conditions, and perform partially automatic or fully automatic safe and reliable driving. Autonomous driving vehicles can autonomously perceive the traffic driving environment, make ideal plans for global trajectories and local expected trajectories, reduce the driver's driving burden, effectively improve vehicle driving safety, and reduce the incidence of traffic safety accidents. The core technology of autonomous driving is the detection and classification of pedestrians and other objects during driving, which provides a basis for driving decisions.
[0003] Object detection in autonomous driving refers to finding all vehicles or pedestrians in an image and determining their categories and locations. Object detection is divided into two major series: the RCNN series and the YOLO series. The RCNN series is a representative algorithm based on region detection, and YOLO is a representative algorithm based on region extraction. Among them, YOLO v3 is more common in autonomous driving. It is a convolutional neural network (CNN) used for real-time object detection. It divides the image into grids, predicts a certain number of bounding boxes in each grid unit, and then uses a 1*1 convolutional layer for prediction. It uses multi-scale feature extraction for object detection.
[0004] Therefore, target detection has high requirements for the captured images. Some visible or invisible disturbances in the image may cause errors in the target detection system. Some camouflage that can confuse the human eye can also interfere with the driver during manual driving. Existing camouflage pattern generation methods can be divided into traditional camouflage and intelligent camouflage. Traditional camouflage pattern camouflage generation generates camouflage patterns by extracting main color features and texture features, and finally coloring them. Among them, the main color extraction methods mainly include K-means clustering algorithm, peak point algorithm, FCM clustering algorithm, etc., and the texture feature extraction methods mainly include threshold segmentation method, region segmentation method, edge segmentation method, etc. Jia Qi et al. proposed a camouflage generation method based on Markov random field and pyramid model, and obtained a two-dimensional texture matrix by calculating Markov random field. Li Yuanyuan et al. proposed a digital camouflage texture generation method based on curve fusion characteristics. The watershed algorithm extracts the background contour, calculates the mosaic size using visual principles, and generates texture by curve fusion of the background contour and mosaic blocks. Cai Yunxiang et al. proposed a method for generating digital camouflage patterns based on the fractal Brownian model. The image is converted into a grayscale image and then low-resolution. The image texture is extracted by the pyramid structure layer-by-layer FCM algorithm. In the Lab color space, the background main color and its area ratio are extracted by the layer-by-layer FCM algorithm. The texture and texture coloring are generated by the DS algorithm. Although the generated digital camouflage pattern is excellent, it is still impossible to quickly, specifically, and end-to-end generate camouflage patterns for the target background. In addition, most of the generated digital camouflage patterns are time-sensitive. Even in the same location, when the season changes, the camouflage pattern needs to be regenerated according to the above steps. At the same time, traditional camouflage mainly targets the camouflage of images to the human eye. When facing the neural network image classification model, it may not be able to guarantee an effective camouflage effect.
[0005] Intelligent camouflage mainly generates target patterns through style transfer through intelligent generation systems. Teng Xu et al. proposed a digital camouflage generation method based on generative adversarial networks. In the generation model, DenseNet is used instead of ResNet for feature extraction, exponential linear units are used as the activation function of the generator, and scaled exponential linear units are used as the activation function of the discriminator to optimize the end-to-end problem of camouflage generation. Teng Xu et al. proposed an adversarial digital camouflage generation method based on disentangled representation. Two images are passed through their respective content encoders and style encoders to obtain content and style features, and multiple camouflages are generated by sharing content features. Traditional camouflage generation methods can effectively interfere with intelligent recognition models, but they are not very targeted at human eye recognition problems. At the same time, the images generated by GAN are too smooth.
[0006] The present invention proposes a method, which introduces a generative adversarial network and traditional digital detection, and proposes a new generative adversarial network architecture. The three-party game between the generator and two different discriminators is used to ensure that the output photos can reduce the recognition rate of the human eye while improving the camouflage success rate of the intelligent recognition system. The method takes into account the advantages of both traditional camouflage and intelligent camouflage, has good compatibility, and can be compatible with the camouflage capabilities of the physical domain and the digital domain in practical applications. Summary of the invention
[0007] The purpose of the present invention is to address the deficiencies of the prior art and provide a camouflage pattern generation method and device based on CAM-GAN.
[0008] The objective of the present invention is achieved through the following technical solution: A camouflage pattern generation method based on CAM-GAN, comprising the following steps: (1) A camouflage pattern generation model is constructed using a generative adversarial network as a framework. The training network of the model includes a generator , the first discriminator and the second discriminator ; (2) Obtaining a real image collection and the corresponding tag set ; (3) Generated as random noise ; Then the real image set Each real image and random noise Output to the generator In the above example, we get a set of traditional camouflage images. ; (4) For real image collection Each real image in the image is used to generate a corresponding grayscale image, and then the grayscale image is Gaussian filtered to obtain the filtered image; then the gradient amplitude and gradient direction in the filtered image are calculated, and all the pixels in the filtered image are traversed according to the non-maximum suppression method to obtain an image with updated gradient amplitude; then the double threshold detection method is applied to process the image with updated gradient amplitude to obtain a camouflage image, and a set of intelligent camouflage images is obtained. ; (5) Then the color camouflage pattern generation model is trained. During the training, the generator is first fixed. The parameters of the first discriminator are updated and the second discriminator Then fix the parameters of the first discriminator and the second discriminator Parameters to update the fixed generator The parameters of , Traditional Camouflage Image Collection and Smart Camouflage Image Collection For the generator and the first discriminator and the second discriminator Through alternating optimization training, when the first discriminator and the second discriminator When the confidences of are all stable, the training of the color camouflage pattern generation model is terminated to obtain the optimized color camouflage pattern generation model; (6) Finally, the generator in the optimized camouflage pattern generation model is used to generate the corresponding camouflage image for the test image.
[0009] Furthermore, the generator is composed of a convolutional neural network.
[0010] Furthermore, the step (2) is specifically as follows: obtaining a real image set : and the corresponding tag set : ,in, represents any real image, Represents a real image collection There are A real image; Represents a real image The corresponding image label; ; Each real image The image size is 32*32.
[0011] Furthermore, the step (3) is specifically as follows: using a professional camera to capture random road scenes or environmental images as random noise ; Label any image With random noise Input to the generator , generate the corresponding traditional camouflage image : ,in, Representation Generator Output of the traditional camouflage image set : .
[0012] Furthermore, the step (4) specifically includes the following sub-steps: (4.1) For real image collection Any real image in , by processing the values of the three RGB channels, the corresponding grayscale image is generated , the calculation formula is as follows: ; in, Represents grayscale image Middle Row, No. The grayscale value of the pixel in the column, Represents a real image Middle Row, No. Column pixels The value of the channel, Represents a real image Middle Row, No. Column pixels The value of the channel, Represents a real image Middle Row, No. Column pixels The value of the channel, , ; (4.2) Then the grayscale image Perform filtering and obtain the grayscale image through Gaussian filtering function The weight value of each pixel in , the Gaussian filter function is: ; in, Represents grayscale image Middle Row, No. The weight value of the pixel in the column, is the standard deviation; Then use a Gaussian kernel of size 3*3 and combine the weight value Filter the pixel values to get the filtered image ; (4.3) Set the 3*3 kernel of the Sobel operator in the horizontal direction to , and set the 3*3 kernel of the Sobel operator vertical method to ; The filtered image is then calculated The gradient amplitude of each pixel is , the calculation formula is as follows: ; ; ; in, The filtered image Middle Row, No. The pixel value of the pixel point in the column; Represents the filtered image Middle Row, No. The gradient value of the pixel points in the column in the horizontal direction; Represents the filtered image Middle Row, No. The gradient value of the pixel points in the column in the vertical direction; And calculate the filtered image Calculate the gradient direction of each pixel as : ; (4.4) Traverse the filtered image according to the non-maximum suppression method All the pixels in: For each pixel, find the two adjacent pixels of the pixel in the edge direction according to the gradient direction of the pixel. If the gradient value of the pixel is not the maximum value among the three pixels, set the gradient amplitude of the pixel to 0, otherwise the gradient amplitude of the pixel remains unchanged. After completing this traversal, get the image with the updated gradient amplitude ; (4.5) Set the maximum grayscale value threshold and the minimum grayscale value threshold, and then apply the double threshold detection method to traverse the image to update the gradient amplitude All the pixels in: For each pixel, if the gradient amplitude of the pixel is greater than the maximum gray value threshold, the pixel value of the pixel is set to 1; if the gradient amplitude of the pixel is less than the minimum gray value threshold, the pixel value of the pixel is set to 0; otherwise, check whether there is a pixel with a gradient amplitude greater than the maximum gray value threshold among the 8 surrounding pixels of the pixel. If so, the pixel value of the pixel is set to 1; if not, the pixel value of the pixel is set to 0; after completing this traversal, the intelligent camouflage image is obtained. ; (4.6) For a real image collection Repeat steps (4.1) to (4.5) for each real image in the image to obtain a set of intelligent camouflage images. : .
[0013] Furthermore, the step (5) specifically includes the following sub-steps: (5.1) Then the color camouflage pattern generation model is trained. During the training, the generator is first fixed. The weight of the first discriminator and the second discriminator Using the Sigmoid activation function, by maximizing the first discriminator and the second discriminator To update the first discriminator and the second discriminator The parameters of this training are optimized as follows: ; in, Indicates smart camouflage image Middle Row, No. The gradient magnitude of the pixel points in the column, Represents a real image Middle Row, No. The gradient magnitude of the pixel points in the column; Represents the first discriminator The judgment result of represents the second discriminator The judgment result of Represents the probability distribution of real images About real images Expected value; Represents the probability distribution of traditional camouflage images About Traditional Camouflage Images Expected value; Represents the probability distribution of smart camouflage images About Smart Camouflage Images Expected value; (5.2) Then fix the first discriminator and the second discriminator Parameters of the generator Using a linear activation function, the fixed generator is updated by minimizing the generator The parameters of this training are optimized as follows: ; (5.3) Then the generator and the first discriminator and the second discriminator Through alternating optimization training, when the first discriminator and the second discriminator When the confidence levels of the color camouflage pattern generation model are all stable at 0.45-0.55, the training of the color camouflage pattern generation model is terminated, and the optimized color camouflage pattern generation model is obtained.
[0014] The present invention also includes a CAM-GAN-based camouflage pattern generation device, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used for the above-mentioned CAM-GAN-based camouflage pattern generation method.
[0015] The present invention also includes a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned CAM-GAN-based camouflage pattern generation method is implemented.
[0016] The beneficial effects of the present invention are as follows: the present invention designs camouflage generation based on CAM-GAN, and performs a three-party game through two different discriminators and generators, thereby generating camouflage images for target detection systems while taking into account camouflage performance for human eyes. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of a camouflage pattern generation method based on CAM-GAN; Figure 2 This is a structural diagram of a camouflage pattern generation device based on CAM-GAN. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical scheme and advantages of the present invention more clear, the present invention is further described in detail in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0019] In order to overcome the shortcomings of existing traditional camouflage, such as poor generalization and inability to generate target patterns end-to-end, and intelligent camouflage in human eye identification, the present invention provides a camouflage pattern generation method that is compatible with both the human eye and a neural network model, and generates a more compatible camouflage pattern through a three-party game between a generator and two discriminators.
[0020] A camouflage pattern adversarial sample generation method based on compatible camouflage, CAM-GAN, mainly generates camouflage patterns with better compatibility through the game and checks and balances between an image generator and two different discriminators. It can achieve good camouflage effects in both the physical and digital domains, and can deceive target detection models and human visual analysis.
[0021] The content of the present invention aims to generate a camouflage pattern that is compatible with the physical domain and the digital domain. By generating a game within the model, a camouflage pattern that can confuse the car target detection system is generated. By physically printing it on objects near the road, it is used to simulate the complex vehicle conditions during real driving. It is photographed by the on-board camera and input into the detection model to achieve the purpose of successful camouflage under the target detection system. The purpose is to find out the loopholes and deficiencies of the detection system, and then promote the development of autonomous driving technology.
[0022] Example 1: Figure 1 As shown, the present invention provides a camouflage pattern generation method based on CAM-GAN, comprising the following steps: (1) A camouflage pattern generation model is constructed using a generative adversarial network as a framework. The training network of the model includes a generator , the first discriminator and the second discriminator .
[0023] The generator consists of a convolutional neural network.
[0024] (2) Obtaining a real image collection and the corresponding tag set .
[0025] The step (2) is specifically as follows: obtaining a real image set : and the corresponding tag set : ,in, represents any real image, Represents a real image collection There are A real image; Represents a real image The corresponding image label; ; Each real image The image size is 32*32.
[0026] (3) Generated as random noise ; Then the real image set Each real image and random noise Output to the generator In the above example, we get a set of traditional camouflage images. .
[0027] The step (3) is specifically as follows: using a professional camera to capture random road scenes or environmental images as random noise ; Label any image With random noise Input to the generator , generate the corresponding traditional camouflage image : ,in, Representation Generator Output of the traditional camouflage image set : .
[0028] In the present invention, random noise With image tags Input to the generator , connected through the fully connected layer to form the input of the hidden layer, which is converted into a scalar value through linear calculation, and finally the sigmoid function is used to normalize the scalar value to the [0, 1] interval to generate a label image Related fake images as traditional camouflage images .
[0029] (4) For real image collection Each real image in the image is used to generate a corresponding grayscale image, and then the grayscale image is Gaussian filtered to obtain the filtered image; then the gradient amplitude and gradient direction in the filtered image are calculated, and all the pixels in the filtered image are traversed according to the non-maximum suppression method to obtain an image with updated gradient amplitude; then the double threshold detection method is applied to process the image with updated gradient amplitude to obtain a camouflage image, and a set of intelligent camouflage images is obtained. .
[0030] The step (4) specifically includes the following sub-steps: (4.1) For real image collection Any real image in , by processing the values of the three RGB channels, the corresponding grayscale image is generated , the calculation formula is as follows: ; in, Represents grayscale image Middle Row, No. The grayscale value of the pixel in the column, Represents a real image Middle Row, No. Column pixels The value of the channel, Represents a real image Middle Row, No. Column pixels The value of the channel, Represents a real image Middle Row, No. Column pixels The value of the channel, , .
[0031] (4.2) After generating the grayscale image, the image needs to be filtered to make it smoother.
[0032] Then the grayscale image Perform filtering and obtain the grayscale image through Gaussian filtering function The weight value of each pixel in , the Gaussian filter function is: ; in, Represents grayscale image Middle Row, No. The weight value of the pixel in the column, is the standard deviation; Then use a Gaussian kernel of size 3*3 and combine the weight value Filter the pixel values to get the filtered image .
[0033] (4.3) In an image, an edge is a collection of pixels with large changes in grayscale values, and the gradient is used to represent the degree and direction of the change in grayscale values.
[0034] Set the 3*3 kernel of the Sobel operator in the horizontal direction to , and set the 3*3 kernel of the Sobel operator vertical method to ; Then the filtered image is calculated The gradient amplitude of each pixel is , the calculation formula is as follows: ; ; ; in, The filtered image Middle Row, No. The pixel value of the pixel point in the column; Represents the filtered image Middle Row, No. The gradient value of the pixel points in the column in the horizontal direction; Represents the filtered image Middle Row, No. The gradient value of the pixel points in the column in the vertical direction; And calculate the filtered image Calculate the gradient direction of each pixel as : .
[0035] (4.4) If the edge of the detected image changes gently, the gradient value change will become smaller, which will affect the final edge detection accuracy. This can be controlled by using the non-maximum suppression method.
[0036] Traverse the filtered image according to the non-maximum suppression method All the pixels in: For each pixel, find the two adjacent pixels of the pixel in the edge direction according to the gradient direction of the pixel. If the gradient value of the pixel is not the maximum value among the three pixels, set the gradient amplitude of the pixel to 0, otherwise the gradient amplitude of the pixel remains unchanged. After completing this traversal, get the image with the updated gradient amplitude .
[0037] (4.5) In order to enlarge the gap between edge pixels and non-edge pixels and make edge detection more obvious, a double threshold detection method can be used.
[0038] Set the maximum gray value threshold and the minimum gray value threshold, and then apply the double threshold detection method to traverse the image to update the gradient amplitude All the pixels in: For each pixel, if the gradient amplitude of the pixel is greater than the maximum gray value threshold, the pixel value of the pixel is set to 1; if the gradient amplitude of the pixel is less than the minimum gray value threshold, the pixel value of the pixel is set to 0; otherwise, check whether there is a pixel with a gradient amplitude greater than the maximum gray value threshold among the 8 surrounding pixels of the pixel. If so, the pixel value of the pixel is set to 1; if not, the pixel value of the pixel is set to 0; after completing this traversal, the intelligent camouflage image is obtained. ; (4.6) For a real image collection Repeat steps (4.1) to (4.5) for each real image in the image to obtain a set of intelligent camouflage images. : .
[0039] (5) Then the color camouflage pattern generation model is trained. During the training, the generator is first fixed. The parameters of the first discriminator are updated and the second discriminator Then fix the parameters of the first discriminator and the second discriminator Parameters to update the fixed generator The parameters of , Traditional Camouflage Image Collection and Smart Camouflage Image Collection For the generator and the first discriminator and the second discriminator Through alternating optimization training, when the first discriminator and the second discriminator When the confidence levels of the color camouflage pattern generation model are all stable, the training of the color camouflage pattern generation model is terminated to obtain the optimized color camouflage pattern generation model.
[0040] The step (5) specifically includes the following sub-steps: (5.1) Then the color camouflage pattern generation model is trained. During the training, the generator is first fixed. The weight of the first discriminator and the second discriminator Using the Sigmoid activation function, by maximizing the first discriminator and the second discriminator To update the first discriminator and the second discriminator The parameters of this training are optimized as follows: ; in, Indicates smart camouflage image Middle Row, No. The gradient magnitude of the pixel points in the column, Represents a real image Middle Row, No. The gradient magnitude of the pixel points in the column; Represents the first discriminator The judgment result of represents the second discriminator The judgment result of Represents the probability distribution of real images About real images Expected value; Represents the probability distribution of traditional camouflage images About Traditional Camouflage Images Expected value; Represents the probability distribution of smart camouflage images About Smart Camouflage Images expected value.
[0041] (5.2) Then fix the first discriminator and the second discriminator Parameters of the generator Using a linear activation function, the fixed generator is updated by minimizing the generator The parameters of this training are optimized as follows: .
[0042] (5.3) Then the generator and the first discriminator and the second discriminator Through alternating optimization training, when the first discriminator and the second discriminator When the confidence levels of the color camouflage pattern generation model are all stable at 0.45-0.55, the training of the color camouflage pattern generation model is terminated, and the optimized color camouflage pattern generation model is obtained.
[0043] During the training process, the generator , the first discriminator and the second discriminator A three-party non-cooperative game is played between the generators. For the first discriminator Implementing an effective attack, the second discriminator Effectively limit the disturbance. Here is the generator -First Discriminator and generator -Second Discriminator An alternating adversarial training strategy is designed, in which the generator Directly with the first discriminator and the second discriminator Interaction, first discriminator and the second discriminator Through the generator Indirectly affect each other. In the three-party game process, the generator and the first discriminator The game design between them is to generate disturbances similar to the real data distribution while ensuring the optimization of the disturbance; the generator and the second discriminator The game between is to generate camouflage adversarial samples with strong attack capabilities. There is a necessary trade-off between these conflicting goals, so an alternating adversarial training algorithm is designed for the first discriminator. and the second discriminator The indirect synergy between them enables large-scale generation of camouflage adversarial samples with small perturbations and strong attack capabilities.
[0044] (6) Finally, the generator in the optimized camouflage pattern generation model is used to generate the corresponding camouflage image for the test image.
[0045] Application scenario: In the existing autonomous driving technology, target detection technology is particularly important. It is one of the core technologies for realizing autonomous driving to obtain external environment information through cameras, millimeter wave radars, laser radars, etc., and to detect the positions of pedestrians, obstacles, and roads and perform corresponding classification operations on the images sent back. It has high requirements for the images sent back by the on-board camera. If the images sent back have interference that cannot be shielded, the target detection system in the autonomous driving may make mistakes, and then issue wrong operation instructions, which poses a huge threat to passengers and surrounding pedestrians and vehicles. For the target detection system in the autonomous driving process, the content of the present invention generates a camouflage pattern that is more compatible with the physical environment. The generated camouflage pattern is printed and covered to camouflage and interfere with the surrounding environment, thereby interfering with the target detection system of the autonomous driving. At the same time, it also takes into account the target detection habits of the driver when driving manually, and the camouflage success rate is improved. This can be used to test the detection ability of the autonomous driving, find its loopholes and provide optimization directions.
[0046] Embodiment 2: This embodiment relates to a camouflage pattern generation device based on CAM-GAN, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used for a camouflage pattern generation method based on CAM-GAN in the above-mentioned embodiment 1; the device embodiment can be applied to any device with data processing capabilities, and the any device with data processing capabilities can be a device or apparatus such as a computer.
[0047] like Figure 2 At the hardware level, the knowledge distillation device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, the present invention does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0048] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0049] The controller can be implemented in any suitable manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0050] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0051] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0052] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0053] The present invention may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0054] Embodiment 3: The embodiment of the present invention further provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, a camouflage pattern generation method based on CAM-GAN of the above embodiment 1 is implemented.
[0055] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A camouflage pattern generation method based on CAM-GAN, characterized in that: The following steps are involved: (1) A camouflage pattern generation model is constructed using a generative adversarial network as a framework. The training network of the model includes a generator , the first discriminator and the second discriminator ; (2) Obtaining a real image collection and the corresponding tag set ; (3) Generated as random noise ; Then the real image set Each real image and random noise Output to the generator In the above example, we get a set of traditional camouflage images. ; (4) For real image collection Generate a corresponding grayscale image for each real image, and then perform Gaussian filtering on the grayscale image to obtain the filtered image; Then, by calculating the gradient magnitude and gradient direction in the filtered image and traversing all the pixel points in the filtered image according to the non-maximum suppression method, an image with updated gradient magnitude is obtained; Then, the double threshold detection method is applied to process the image with updated gradient amplitude to obtain the camouflage image, and the intelligent camouflage image set is obtained. ; (5) Then the color camouflage pattern generation model is trained. During the training, the generator is first fixed. The parameters of the first discriminator are updated and the second discriminator Then fix the parameters of the first discriminator and the second discriminator Parameters to update the fixed generator The parameters of , Traditional Camouflage Image Collection and Smart Camouflage Image Collection For the generator and the first discriminator and the second discriminator Through alternating optimization training, when the first discriminator and the second discriminator When the confidences of are all stable, the training of the color camouflage pattern generation model is terminated to obtain the optimized color camouflage pattern generation model; (6) Finally, the generator in the optimized camouflage pattern generation model is used to generate the corresponding camouflage image for the test image.
2. The CAM-GAN-based camouflage pattern generation method according to claim 1, characterized in that: The generator consists of a convolutional neural network.
3. The camouflage pattern generation method based on CAM-GAN according to claim 1, characterized in that: The step (2) is specifically as follows: obtaining a real image set : and the corresponding tag set : ,in, represents any real image, Represents a real image collection There are A real image; Represents a real image The corresponding image label; ; Each real image The image size is 32*32.
4. The CAM-GAN-based camouflage pattern generation method according to claim 3, characterized in that: The step (3) is specifically as follows: using a professional camera to capture random road scenes or environmental images as random noise ; Label any image With random noise Input to the generator , generate the corresponding traditional camouflage image : ,in, Representation Generator Output of the traditional camouflage image set : .
5. The CAM-GAN-based camouflage pattern generation method according to claim 4, characterized in that: The step (4) specifically includes the following sub-steps: (4.1) For real image collection Any real image in , by processing the values of the three RGB channels, the corresponding grayscale image is generated , the calculation formula is as follows: ; in, Represents grayscale image Middle Row, No. The grayscale value of the pixel in the column, Represents a real image Middle Row, No. Column pixels The value of the channel, Represents a real image Middle Row, No. Column pixels The value of the channel, Represents a real image Middle Row, No. Column pixels The value of the channel, , ; (4.2) Then the grayscale image Perform filtering and obtain the grayscale image through Gaussian filtering function The weight value of each pixel in , the Gaussian filter function is: ; in, Represents grayscale image Middle Row, No. The weight value of the pixel in the column, is the standard deviation; Then use a Gaussian kernel of size 3*3 and combine the weight value Filter the pixel values to get the filtered image ; (4.3) Set the 3*3 kernel of the Sobel operator in the horizontal direction to , and set the 3*3 kernel of the Sobel operator vertical method to ; The filtered image is then calculated The gradient amplitude of each pixel is , the calculation formula is as follows: ; ; ; in, The filtered image Middle Row, No. The pixel value of the pixel point in the column; Represents the filtered image Middle Row, No. The gradient value of the pixel points in the column in the horizontal direction; Represents the filtered image Middle Row, No. The gradient value of the pixel points in the column in the vertical direction; And calculate the filtered image Calculate the gradient direction of each pixel as : ; (4.4) Traverse the filtered image according to the non-maximum suppression method All the pixels in: For each pixel, find the two adjacent pixels of the pixel in the edge direction according to the gradient direction of the pixel. If the gradient value of the pixel is not the maximum value among the three pixels, set the gradient amplitude of the pixel to 0, otherwise the gradient amplitude of the pixel remains unchanged. After completing this traversal, get the image with the updated gradient amplitude ; (4.5) Set the maximum grayscale value threshold and the minimum grayscale value threshold, and then apply the double threshold detection method to traverse the image to update the gradient amplitude All the pixels in: For each pixel, if the gradient amplitude of the pixel is greater than the maximum gray value threshold, the pixel value of the pixel is set to 1; if the gradient amplitude of the pixel is less than the minimum gray value threshold, the pixel value of the pixel is set to 0; otherwise, check whether there is a pixel with a gradient amplitude greater than the maximum gray value threshold among the 8 surrounding pixels of the pixel. If so, the pixel value of the pixel is set to 1; if not, the pixel value of the pixel is set to 0; after completing this traversal, the intelligent camouflage image is obtained. ; (4.6) For a real image collection Repeat steps (4.1) to (4.5) for each real image in the image to obtain a set of intelligent camouflage images. : .
6. The CAM-GAN-based camouflage pattern generation method according to claim 5, characterized in that: The step (5) specifically includes the following sub-steps: (5.1) Then the color camouflage pattern generation model is trained. During the training, the generator is first fixed. The weight of the first discriminator and the second discriminator Using the Sigmoid activation function, by maximizing the first discriminator and the second discriminator To update the first discriminator and the second discriminator The parameters of this training are optimized as follows: ; in, Indicates smart camouflage image Middle Row, No. The gradient magnitude of the pixel points in the column, Represents a real image Middle Row, No. The gradient magnitude of the pixel points in the column; Represents the first discriminator The judgment result of represents the second discriminator The judgment result of Represents the probability distribution of real images About real images Expected value; Represents the probability distribution of traditional camouflage images About Traditional Camouflage Images Expected value; Represents the probability distribution of smart camouflage images About Smart Camouflage Images Expected value; (5.2) Then fix the first discriminator and the second discriminator Parameters of the generator Using a linear activation function, the fixed generator is updated by minimizing the generator The parameters of this training are optimized as follows: ; (5.3) Then the generator and the first discriminator and the second discriminator Through alternating optimization training, when the first discriminator and the second discriminator When the confidence levels of the color camouflage pattern generation model are all stable at 0.45-0.55, the training of the color camouflage pattern generation model is terminated, and the optimized color camouflage pattern generation model is obtained.
7. A camouflage pattern generation device based on CAM-GAN, characterized in that: It includes a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used to implement a camouflage pattern generation method based on CAM-GAN as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, a camouflage pattern generation method based on CAM-GAN as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Guideboard identification attack defense method based on multi-target path optimization
CN110175513A
Ultra-wideband radar target identification method based on edge detection and region segmentation
CN115797773A
Construction method and system of double-discriminator generative adversarial network model
CN116091884A
Method for generating face recognition antagonistic pattern with visual camouflage
CN118279430A
Cited By
Novel anti-coating generation method, system and device for target detector in aerial image of unmanned aerial vehicle and medium
CN120783115A