Advertisement design drawing detection method and device based on machine vision
Through the machine vision-based advertising design drawing detection method, efficient and accurate detection of advertising design drawings is achieved, the problem of low detection efficiency of advertising design drawings is solved, and a detailed compliance report is generated to guide corrections.
Patent Information
- Application Number
- CN202510342843.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the detection efficiency of advertising design drawings is low, manual review is time-consuming and error-prone, making it difficult to ensure compliance.
The advertising design drawing detection method based on machine vision is adopted, including image enhancement, feature extraction, adaptive weight update and compliance detection. The image quality is improved through image enhancement processing, the gradient intensity and color channel histogram features are extracted, the feature weight is adjusted using the adaptive weight update mechanism, and automatic compliance detection is carried out.
Improve the efficiency and accuracy of advertising design drawing inspection, reduce manual intervention, ensure the accuracy and consistency of the inspection process, and generate detailed compliance reports to guide correction processing.
Smart Images

Figure CN120279312A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for detecting advertising design drawings based on machine vision. Background Art
[0002] With the strengthening of the supervision of the advertising industry, especially in China, the compliance of advertising content has become the top priority of the industry. Advertisements not only need to meet various laws and regulations, but also need to comply with the specific requirements of the platform. For example, advertisements shall not contain false propaganda, prohibited content, copyrighted materials, etc., which puts higher requirements on the review of advertising design drawings.
[0003] Manual review is not only time-consuming, but also easily affected by factors such as fatigue and emotions, resulting in errors. When faced with a large number of advertising design drawings, it is easy to miss or misjudge, and it is difficult to ensure that each advertising design drawing meets the standards. Therefore, how to improve the efficiency of advertising design drawing detection has become an urgent problem to be solved. Summary of the Invention
[0004] The present invention provides a method and device for detecting advertising design drawings based on machine vision, and its main purpose is to solve the problem of low efficiency in detecting advertising design drawings based on machine vision.
[0005] To achieve the above object, a method for detecting advertising design drawings based on machine vision provided by the present invention includes:
[0006] Collect the original image of the advertising design drawing, perform image enhancement on the original image to obtain an enhanced image of the original image;
[0007] Generate the gradient intensity and color channel histogram of the enhanced image, and generate the image features of the enhanced image according to the gradient intensity and the color channel histogram;
[0008] Calculate the feature scores of the image features one by one according to a preset feature scoring algorithm, and adaptively update the feature weights corresponding to the image features according to the feature scores to obtain the updated weights of the feature weights, where the preset feature scoring algorithm is:
[0009]
[0010] Where I j is the importance score of the jth image feature, f ij is the value of the ith sample on the jth feature, is the average value of all samples on the jth image feature, w i is the feature weight corresponding to the ith sample, n is the total number of samples, i is the sample identifier, and j is the identifier of the image feature;
[0011] Adjust the enhanced image according to the updated weight, and input the adjusted enhanced image into a preset classification model to obtain the image category of the adjusted enhanced image;
[0012] Perform optical recognition on the original image, and perform compliance detection on the enhanced image according to the recognition result of the optical recognition and the image category;
[0013] Generate a compliance report for the advertisement design drawing according to the detection result of the compliance detection, and perform correction processing on the advertisement design drawing according to the compliance report.
[0014] Optionally, performing image enhancement on the original image to obtain an enhanced image of the original image, including:
[0015] Perform noise removal on the original image, and perform color enhancement on the original image after noise removal to obtain an enhanced image of the original image.
[0016] Optionally, the performing color enhancement on the original image after noise removal to obtain an enhanced image of the original image includes:
[0017] Perform hue adjustment on the original image after noise removal to obtain an adjusted image;
[0018] Perform brightness processing on the adjusted image, and perform contrast enhancement on the adjusted image after brightness processing to obtain an enhanced image.
[0019] Optionally, the generating the gradient intensity and color channel histogram of the enhanced image includes:
[0020] Generate the gradient intensity of the enhanced image according to a preset gradient generation algorithm, where the preset gradient generation algorithm is:
[0021]
[0022] where G(x,y) is the gradient intensity of the enhanced image at the point (x,y), and (I x (x,y)) is the horizontal direction gradient of the enhanced image at the point (x,y), and I y (x,y) is the vertical direction gradient of the enhanced image at the point (x,y).
[0023] Optionally, the generating the gradient intensity and color channel histogram of the enhanced image includes:
[0024] Generate the color channel histogram of the enhanced image according to a preset histogram generation algorithm, where the preset histogram generation algorithm is:
[0025]
[0026] Among them, H c (t) is the histogram value of the color channel of the point (x, y) of the enhanced image, D e is the set of pixel points after image enhancement, I e (x, y) is the color value of the pixel point (x, y) in the enhanced image, is the indicator function, and t is the identifier of the color channel.
[0027] Optionally, generating the image feature of the enhanced image according to the gradient intensity and the color channel histogram includes:
[0028] Generating the image feature of the enhanced image by using a preset weighting algorithm, the gradient intensity, and the color channel histogram, where the preset weighting algorithm is:
[0029] F(x, y) = α·G(x, y) + β·H c (t);
[0030] Among them, F(x, y) is the comprehensive image feature of the enhanced image at the position of the point (x, y), α is the weighting coefficient corresponding to the gradient intensity, β is the weighting coefficient corresponding to the histogram value in the color channel histogram, G(x, y) is the gradient intensity of the point (x, y), and H c (t) is the histogram value of the color channel of the point (x, y), and t is the identifier of the color channel.
[0031] Optionally, adaptively updating the feature weight corresponding to the image feature according to the feature score to obtain the updated weight of the feature weight includes:
[0032] Adapting and updating the feature weight corresponding to the image feature according to the feature score and a preset adaptive weight update algorithm to obtain the updated weight of the feature weight, where the preset adaptive weight update algorithm is:
[0033]
[0034] Among them, w ′ i is the updated weight of the feature weight, w i is the feature weight corresponding to the i-th sample, η is the learning rate, is the mean value of the importance score I j , I j is the importance score of the j-th image feature.
[0035] Optionally, adjusting the enhanced image according to the updated weight includes:
[0036] Determine the real-time state of the enhanced image and generate a feature score for the real-time state;
[0037] Determine the area to be adjusted of the enhanced image according to the feature score;
[0038] Adjust the enhanced image according to the area to be adjusted and the updated weight.
[0039] Optionally, performing compliance detection on the enhanced image according to the recognition result of the optical recognition and the image category includes:
[0040] When the image category is a social media advertisement graph, generate a user privacy protection rule for the enhanced image;
[0041] When the image category is a video advertisement graph, generate a content compliance rule for the enhanced image;
[0042] When the image category is a dynamic advertisement graph, generate a material source rule for the enhanced image;
[0043] When the image category is a static advertisement graph, generate a layout rule for the enhanced image;
[0044] Collect the user privacy protection rule, content compliance rule, material source rule and layout rule as the compliance rule of the enhanced image;
[0045] Perform compliance matching on the recognition result of the optical recognition according to the compliance rule.
[0046] To solve the above problems, the present invention also provides an advertisement design graph detection device based on machine vision, and the device includes:
[0047] An image enhancement module, configured to collect an original image of an advertisement design graph, perform image enhancement on the original image, and obtain an enhanced image of the original image;
[0048] An image feature generation module, configured to generate a gradient intensity and a color channel histogram of the enhanced image, and generate an image feature of the enhanced image according to the gradient intensity and the color channel histogram;
[0049] A weight update module, configured to calculate a feature score of the image feature one by one according to a preset feature scoring algorithm, adaptively update the feature weight corresponding to the image feature according to the feature score, and obtain an updated weight of the feature weight, where the preset feature scoring algorithm is:
[0050]
[0051] Among them, I j is the importance score of the j-th image feature, and f ij is the value of the i-th sample on the j-th feature, is the average value of all samples on the j-th image feature, and w i is the feature weight corresponding to the i-th sample, n is the total number of samples, i is the sample identifier, and j is the identifier of the image feature;
[0052] An image category generation module, configured to adjust the enhanced image according to the updated weight, and input the adjusted enhanced image into a preset classification model to obtain the image category of the adjusted enhanced image;
[0053] A compliance detection module, configured to perform optical recognition on the original image, and perform compliance detection on the enhanced image according to the recognition result of the optical recognition and the image category;
[0054] A design drawing correction module, configured to generate a compliance report of the advertisement design drawing according to the detection result of the compliance detection, and perform correction processing on the advertisement design drawing according to the compliance report.
[0055] The present invention improves the image quality through image enhancement processing, thereby making subsequent feature extraction more accurate. Especially when processing advertisement images with low quality or complex backgrounds, it can effectively reduce the risk of misrecognition. Then, by extracting key visual features such as gradient intensity and color channel histograms, it captures the shape, edge, and color distribution information in the image, providing strong support for subsequent detection. After feature extraction, the system adopts an adaptive weight update mechanism to dynamically adjust the weight of each feature according to its importance. This process enables the model to flexibly respond in the face of different types of advertisement images, reduce the interference of irrelevant features, and further improve the detection accuracy. After that, the enhanced image is optimized and adjusted for input into the classification model to quickly judge the category of the advertisement image, and an automated compliance detection system is used to verify whether the advertisement content complies with the regulations. Finally, the compliance detection results will generate a detailed report to correct the non-compliant design drawings, avoiding the cumbersome process of manual review. The high degree of automation and intelligence of these steps greatly improves the detection efficiency and accuracy of advertisement design drawings, reduces manual intervention, and ensures the accuracy and consistency of the detection process. Therefore, the present invention proposes a method and device for detecting advertisement design drawings based on machine vision, which can solve the problem of low detection efficiency of advertisement design drawings. Description of the Drawings
[0056] Figure 1Schematic flowchart of the method for detecting advertising design drawings based on machine vision provided by an embodiment of the present invention;
[0057] Figure 2 Functional module diagram of the device for detecting advertising design drawings based on machine vision provided by an embodiment of the present invention;
[0058] The implementation, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed implementation manners
[0059] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0060] An embodiment of the present application provides a method for detecting advertising design drawings based on machine vision. The execution subject of the method for detecting advertising design drawings based on machine vision includes, but is not limited to, at least one of electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for detecting advertising design drawings based on machine vision can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data and artificial intelligence platforms.
[0061] Refer to Figure 1 As shown, it is a schematic flowchart of the method for detecting advertising design drawings based on machine vision provided by an embodiment of the present invention. In this embodiment, the method for detecting advertising design drawings based on machine vision includes:
[0062] S1. Collect the original image of the advertising design drawing, and perform image enhancement on the original image to obtain the enhanced image of the original image.
[0063] In the embodiment of the present invention, the collection of the original image of the advertising design drawing refers to obtaining the original image data of the advertising design drawing through a device (such as a digital camera, a scanner, a camera, etc.). This is the first step of image processing, and the goal is to obtain a digital image representing the advertising design from the real world.
[0064] Specifically, an advertising design drawing refers to a flat image containing advertising content, usually composed of graphics, text, colors, etc., which is a visual display of advertising creativity.
[0065] Specifically, the original image refers to the initial digital image directly obtained from the advertising design drawing acquisition device. This image may contain problems such as noise and uneven color, so subsequent processing is required to enhance the image quality.
[0066] In the embodiment of the present invention, performing image enhancement on the original image to obtain the enhanced image of the original image includes:
[0067] Removing noise from the original image, and performing color enhancement on the original image after noise removal to obtain the enhanced image of the original image.
[0068] Specifically, image enhancement refers to processing the original image to improve the image quality so that it better meets the usage purpose. The enhanced image usually has clearer details, higher visual contrast, and more accurate color representation.
[0069] Specifically, the enhanced image refers to the image processed by image enhancement technology, usually having a clearer visual effect, more vivid colors, and more prominent details.
[0070] Specifically, noise removal refers to eliminating the unwanted random interference signals (noise) in the image. Noise is usually caused by factors such as image acquisition devices and environmental conditions, and it may make the image look blurred, unclear, or distorted.
[0071] Specifically, common types of noise include Gaussian noise, salt and pepper noise, color noise, etc.; filtering algorithms (such as mean filtering, median filtering, Gaussian filtering, etc.) can be used to remove noise and make the image smoother.
[0072] For example, when shooting an advertising design drawing, if the camera shakes or the ambient light is unstable, it may cause noise or blurring in the image. The purpose of noise removal is to restore the clarity of the image.
[0073] Furthermore, the purpose of removing noise is to make the image cleaner, reduce unnecessary interference, and facilitate precise analysis in subsequent processing steps.
[0074] More specifically, performing color enhancement on the original image after noise removal to obtain the enhanced image of the original image includes:
[0075] Adjusting the hue of the original image after noise removal to obtain an adjusted image;
[0076] Performing brightness processing on the adjusted image, and performing contrast enhancement on the adjusted image after brightness processing to obtain the enhanced image.
[0077] Specifically, color enhancement refers to processing the color information in an image through algorithms to make it more saturated and vivid. Enhancing colors can include aspects such as improving color contrast, saturation, and brightness. The purpose is to make the color performance of the image more prominent and vivid.
[0078] Furthermore, the purpose of color enhancement is to make the colors of the image more bright and vivid, thereby enhancing visual appeal. Especially in advertising design, the expressiveness of colors is particularly important.
[0079] Specifically, hue adjustment refers to changing the color tone of an image. By adjusting the hue, the overall color atmosphere of the image can be changed, which may tend towards warm tones (such as red, yellow) or cold tones (such as blue, green).
[0080] Furthermore, hue adjustment is usually carried out by calculating the RGB (red, green, blue) values of each pixel in the image or using color spaces (such as the HSL or HSV models).
[0081] For example, if the background in an advertising design image is on the cold side, it can be changed to a warm tone through hue adjustment to make the design more eye-catching.
[0082] Furthermore, the purpose of adjusting the hue is to change the overall atmosphere of the image to meet the aesthetic requirements of the designer or the advertising goal.
[0083] Specifically, brightness processing refers to adjusting the overall brightness of an image, increasing or decreasing the light and dark levels of the image. Brightness processing is usually carried out by changing the brightness values of all pixels.
[0084] Specifically, brightness processing can be accomplished by simply increasing or decreasing the RGB values of each pixel.
[0085] For example, if the overall brightness of an advertising design image is low and it looks dull, it can be made brighter through brightness processing to enhance the visual effect.
[0086] Specifically, contrast enhancement refers to increasing the difference between the bright and dark parts in an image, making the details of the image more obvious. Contrast enhancement can make the image look more vivid and distinct.
[0087] Furthermore, contrast enhancement is usually achieved by adjusting the pixel values in the bright and dark areas to make their gap more prominent.
[0088] For example: If an advertising design image looks dull and gray, it can be made such that the text and patterns in the image are more clearly visible through contrast enhancement.
[0089] Furthermore, the purpose of brightness processing and contrast enhancement is to improve the visibility of the image, make details clearer, and thus make the visual effect of the advertising design drawing better.
[0090] Generally speaking, the purpose of this image processing method is to optimize the visual effect of the advertising design drawing through a series of operations (such as noise removal, color enhancement, brightness and contrast adjustment, etc.).
[0091] S2. Generate the gradient intensity and color channel histogram of the enhanced image, and generate the image features of the enhanced image according to the gradient intensity and the color channel histogram.
[0092] In the embodiment of the present invention, the generating the gradient intensity and color channel histogram of the enhanced image includes:
[0093] Generate the gradient intensity of the enhanced image according to a preset gradient generation algorithm, where the preset gradient generation algorithm is:
[0094]
[0095] where G(x, y) is the gradient intensity of the enhanced image at the point (x, y), and I x (x, y) is the horizontal direction gradient of the enhanced image at the point (x, y), and I y (x, y) is the vertical direction gradient of the enhanced image at the point (x, y).
[0096] Specifically, G(x, y) is the gradient intensity of the enhanced image at the point (x, y), which is usually used to measure the degree of image change and is often used in applications such as edge detection.
[0097] Specifically, I x (x, y) is the horizontal direction gradient of the enhanced image at the point (x, y), and this value can be calculated by applying a horizontal edge detection filter (such as the Sobel operator) to the image, reflecting the change in the horizontal direction.
[0098] Specifically, I y (x, y) is the vertical direction gradient of the enhanced image at the point (x, y), and similarly, it is calculated by a vertical edge detection filter (such as the Sobel operator), reflecting the change in the vertical direction.
[0099] Specifically, in image processing, the gradient intensity is usually used to identify edges and changes in the image. Edges are usually the places where the image brightness or color changes the most. A large gradient value usually indicates the edge or rapidly changing area of the image.
[0100] Specifically, by calculating the gradients of each pixel in the horizontal and vertical directions, an image representing the edge intensity of the image can be obtained. This process helps to enhance the edge details in the image. Especially in advertising images, it can highlight important graphics and text.
[0101] In the embodiment of the present invention, generating the gradient intensity and color channel histogram of the enhanced image includes:
[0102] Generating the color channel histogram of the enhanced image according to a preset histogram generation algorithm, where the preset histogram generation algorithm is:
[0103]
[0104] where H c (t) is the histogram value of the color channel of the point (x, y) in the enhanced image, D e is the set of pixel points after image enhancement, I e (x, y) is the color value of the pixel point (x, y) in the enhanced image, is the indicator function, and t is the identifier of the color channel.
[0105] Specifically, H c (t) is the histogram value of the color channel of the point (x, y) in the enhanced image, representing the histogram value at the color value t of a certain color channel (such as the red channel, green channel, or blue channel) in the enhanced image, that is, how many pixel points in the enhanced image have the color value t.
[0106] Specifically, D e is the set of pixel points after image enhancement, usually an image after image processing (such as enhancement).
[0107] Specifically, I e (x, y) is the color value of the pixel point (x, y) in the enhanced image, and each pixel point of the image has a color value (in the RGB color space, this can be the color values of the red, green, and blue channels).
[0108] Specifically, is the indicator function, t is the identifier of the color channel. When the value of I e (x, y) is equal to t, the function value is 1, otherwise it is 0. This indicator function is used to count the number of pixel points with the color value t in the enhanced image.
[0109] Specifically, t is the identifier of the color channel, usually a color value in the color channel (for example, a certain value in RGB).
[0110] Specifically, the color channel histogram is used to describe the distribution of each color value in an image. By analyzing the histogram of the color channels, the color distribution of the image can be understood and further adjusted.
[0111] Specifically, the histogram is used to reflect the brightness or color distribution of a certain color channel in the image, which can help with color optimization or image enhancement. Especially in advertising images, it may be necessary to ensure the contrast and saturation of specific colors.
[0112] Specifically, the gradient intensity is used to highlight the edge parts in the image, making the image visually clearer, especially for the text and important patterns in the advertisement.
[0113] Specifically, the color channel histogram further optimizes the color performance of the image by analyzing the distribution of each color in the image, ensuring that the color effect of the image more meets the design requirements.
[0114] In the embodiment of the present invention, generating the image features of the enhanced image according to the gradient intensity and the color channel histogram includes:
[0115] Generating the image features of the enhanced image by using a preset weighting algorithm, the gradient intensity, and the color channel histogram, where the preset weighting algorithm is:
[0116] F(x,y) = α·G(x,y) + β·H c (t);
[0117] where F(x,y) is the comprehensive image feature of the enhanced image at the position (x,y), α is the weighting coefficient corresponding to the gradient intensity, β is the weighting coefficient corresponding to the histogram value in the color channel histogram, G(x,y) is the gradient intensity at the point (x,y), and H c (t) is the histogram value of the color channel at the point (x,y), and t is the identifier of the color channel.
[0118] Specifically, F(x,y) is the comprehensive image feature of the enhanced image at the position (x,y). The comprehensive image feature F(x,y) comprehensively considers the gradient intensity and the histogram information of the color channels and is used to determine the final enhancement characteristics of this point.
[0119] Specifically, G(x,y) is the gradient intensity at the point (x,y), which reflects the edge intensity or degree of change of the image at this position. The area with a higher edge intensity represents the significant features in the image, such as boundaries, object contours, etc.
[0120] Specifically, H c(t) is the histogram value of the color channel of the point (x, y), representing the frequency distribution of a certain color value t on the color channel (e.g., red, green, or blue) of this point in the image. It describes the distribution characteristics of a certain color at this position in the image.
[0121] Specifically, α is the weighting coefficient corresponding to the gradient intensity, and β is the weighting coefficient corresponding to the histogram value in the color channel histogram. α controls the influence of the gradient intensity on the image features. If α is larger, the edge and change features of the image will be more prominent; β controls the influence of the color channel histogram on the image features. If β is larger, the color distribution features of the image (such as color saturation, contrast, etc.) will contribute more to the final effect.
[0122] Specifically, H c (t) is the histogram value of the color channel of the point (x, y), representing the frequency distribution of a certain color value t on the color channel (e.g., red, green, or blue) of this point in the image. It describes the distribution characteristics of a certain color at this position in the image.
[0123] Specifically, t is the identifier of the color channel, indicating the position of the color value in this channel (e.g., a specific value in the RGB model).
[0124] Specifically, by combining the contributions of the gradient intensity and the color channel histogram and using weighting coefficients to adjust the importance of both, the following goals can be achieved during image enhancement: The gradient intensity is the change intensity of the image. Therefore, at the edge or transition region (such as the object contour), the gradient intensity is larger. By adjusting α, the significance of the edge can be increased, making the image visually clearer and sharper; the color channel histogram describes the color distribution. An appropriate weight β can adjust the color balance of the image, ensuring that the color effect of the image is more saturated or meets the design requirements; by adjusting the values of α and β, the characteristics of the image can be flexibly enhanced in different application scenarios. For example, if it is necessary to highlight the edge features of the image, α can be appropriately increased; if it is necessary to optimize the color effect of the image, β can be increased.
[0125] Generally speaking, by adjusting the values of α and β, the characteristics of the image can be flexibly enhanced in different application scenarios. For example, if it is necessary to highlight the edge features of the image, α can be appropriately increased; if it is necessary to optimize the color effect of the image, β can be increased.
[0126] S3. Calculate the feature scores of the image features one by one, and adaptively update the feature weights corresponding to the image features according to the feature scores to obtain the updated weights of the feature weights.
[0127] In the embodiment of the present invention, the calculating the feature scores of the image features one by one includes:
[0128] Calculate the feature scores of the image features one by one according to a preset feature scoring algorithm, where the preset feature scoring algorithm is:
[0129]
[0130] where I j is the importance score of the j-th image feature, and f ij is the value of the i-th sample on the j-th feature, is the average value of all samples on the j-th image feature, w i is the feature weight corresponding to the i-th sample, n is the total number of samples, i is the sample identifier, and j is the identifier of the image feature.
[0131] Specifically, I j is the importance score of the j-th image feature, reflecting the importance of the feature. The larger the value, the more discriminative or important the feature is in the samples. f ij is the value of the i-th sample on the j-th feature, which can be a numerical value of the sample on the j-th feature dimension (such as color intensity, texture feature, etc.), is the average value of all samples on the j-th image feature, w i is the feature weight corresponding to the i-th sample. This weight can be set according to the actual situation and is usually used to adjust the contribution of different samples to the score, which may be related to the importance or confidence of the samples. n is the total number of samples, that is, how many image samples participate in the score calculation. i is the sample identifier, and j is the identifier of the image feature, is the absolute difference between the value of the i-th sample on the j-th feature and the average value of all samples on this feature, indicating the degree of deviation of the sample on this feature.
[0132] Specifically, by calculating the absolute difference between the value of each sample on this feature dimension and the average value, measure how the performance of the sample on this feature differs from the overall distribution; according to the feature weight w i of each sample, sum these degrees of deviation after weighting. Samples with higher weights contribute more to the score; average the weighted degrees of deviation of all samples to obtain the final importance score I j .
[0133] Specifically, the algorithm focuses on the degree of deviation of each sample from the overall average value. The larger the degree of deviation of the sample, the more important the feature is for distinguishing samples, thereby affecting the score of the feature.
[0134] Specifically, by introducing the sample weight w i, this algorithm can handle the contributions of different samples more flexibly. For some important samples, higher weights are given so that they have a greater impact on the calculation of feature scores.
[0135] In an embodiment of the present invention, adaptively updating the feature weight corresponding to the image feature according to the feature score to obtain the updated weight of the feature weight includes:
[0136] Adaptively updating the feature weight corresponding to the image feature according to the feature score and a preset adaptive weight update algorithm to obtain the updated weight of the feature weight, where the preset adaptive weight update algorithm is:
[0137]
[0138] where, w ′ i is the updated weight of the feature weight, w i is the feature weight corresponding to the i-th sample, η is the learning rate, is the mean value of the importance score I j of, I j is the importance score of the j-th image feature.
[0139] Specifically, w ′ i is the updated weight of the feature weight, that is, the weight after adaptive update, w i is the feature weight corresponding to the i-th sample, indicating the initial contribution degree of this sample in the calculation of feature scores, η is the learning rate, indicating the step size of weight update, which determines the speed of feature weight update, I is the mean value of the importance score I j of, I j is the importance score of the j-th image feature, measuring the importance of this feature in the sample set.
[0140] Specifically, calculate the importance score of each image feature (such as the formula mentioned before), reflecting the contribution of this feature to differentiating samples; calculate the mean value of all feature scores, indicating the average importance level among all features. The calculation of the mean value helps to standardize the scores, so that the update process is not overly affected by a single feature.
[0141] Furthermore, adjust the feature weight of each sample, and the size of the update depends on: the difference between the feature score and the mean value. The difference between the feature score and the mean value indicates the relative importance of this feature in the sample. If I j > I, then this feature is more important in this sample and the weight needs to be increased; conversely, if it is less than the mean value, the weight needs to be decreased.
[0142] Specifically, the learning rate controls the amplitude of the update. When the learning rate is large, the weight update step is large; conversely, it is small. Selecting an appropriate learning rate is very important. If it is too large, it may cause excessive weight fluctuations; if it is too small, the update speed will be too slow.
[0143] Specifically, the weights are updated through multiple iterations, and finally the final weights corresponding to the features of each sample are obtained. These weights reflect the importance of each sample for feature scoring, thereby affecting the contribution of the features in subsequent tasks (such as classification, clustering, etc.).
[0144] Specifically, through the adaptive adjustment of feature weights, the system can enhance the features that are more distinguishable when differentiating samples, enabling these features to receive more attention and utilization in subsequent model training or analysis. As the learning process progresses, the feature weights will be continuously optimized according to the performance of each sample in the feature space, gradually strengthening the features that can effectively distinguish samples and ignoring those redundant or unimportant features; this algorithm is self-adaptive and can dynamically adjust the weights according to different features of the dataset, being more flexible and efficient.
[0145] S4. Adjust the enhanced image according to the updated weights, and input the adjusted enhanced image into a preset classification model to obtain the image category of the adjusted enhanced image.
[0146] In the embodiment of the present invention, the adjusting the enhanced image according to the updated weights includes:
[0147] Determine the real-time state of the enhanced image and generate a feature score for the real-time state;
[0148] Determine the area to be adjusted of the enhanced image according to the feature score;
[0149] Adjust the enhanced image according to the area to be adjusted and the updated weights.
[0150] Specifically, it is necessary to evaluate the "real-time state" of the enhanced image. Here, the "real-time state" can be understood as the state of each feature of the current image after enhancement (for example, the color, contrast, texture, etc. of the image). By analyzing these states, a feature score is generated. This step aims to quantify the influence of each feature on the overall performance of the image.
[0151] Specifically, according to the feature score, further determine the area to be adjusted in the image. These areas are usually the parts of the image with poor performance that affect the classification accuracy, such as areas with too high or too low brightness, blurred texture, or large color difference.
[0152] Specifically, for the determined area to be adjusted, further image adjustment is performed on these areas by combining the previously mentioned update weights, which can be feature scoring adjustment weights based on the real-time state, determining which areas need to be strengthened and which areas need to be weakened.
[0153] Specifically, once the image is adjusted, the next step is to input these adjusted images into a preset classification model, which can be a deep learning model such as a convolutional neural network (CNN), or other traditional machine learning models.
[0154] In the embodiment of the present invention, inputting the adjusted enhanced image into a preset classification model to obtain the image category of the adjusted enhanced image includes:
[0155] Input the adjusted enhanced image into a preset classification model, perform linear transformation on the adjusted enhanced image by using the preset classification model, and generate the image category of the enhanced image according to the image features after linear transformation.
[0156] Specifically, in the model, the adjusted image will undergo linear transformation. The purpose of this step is to convert the image data into a feature representation suitable for classification. For example, the pixel information of the image may be converted into a vector representation through a feature extraction network, or convolution operations may be performed to extract high-level image features.
[0157] Specifically, the features after linear transformation are usually low-dimensional representations of the image, containing the key information required for classification; after the linear transformation is completed, the classification model will generate the final image category according to the obtained features.
[0158] Specifically, the output result of the classification model usually generates the final prediction result through a softmax layer (for multi-class classification tasks) or a sigmoid layer (for binary classification tasks).
[0159] S5. Perform optical recognition on the original image, and perform compliance detection on the enhanced image according to the recognition result of the optical recognition and the image category.
[0160] In the embodiment of the present invention, performing optical recognition on the original image means automatically analyzing and extracting information in the image through computer vision technology.
[0161] In the present invention, through optical recognition processing of the original image, various features such as objects, texts, scenes, and people in the image can be recognized. Deep learning models such as convolutional neural networks (CNNs) can be used for feature extraction and classification, or traditional image processing algorithms can be used for feature analysis.
[0162] In an embodiment of the present invention, the compliance detection of the enhanced image according to the recognition result of the optical recognition and the image category includes:
[0163] When the image category is a social media advertisement image, generate user privacy protection rules for the enhanced image;
[0164] When the image category is a video advertisement image, generate content compliance rules for the enhanced image;
[0165] When the image category is a dynamic advertisement image, generate material source rules for the enhanced image;
[0166] When the image category is a static advertisement image, generate layout rules for the enhanced image;
[0167] Collect the user privacy protection rules, content compliance rules, material source rules, and layout rules as the compliance rules for the enhanced image;
[0168] Perform compliance matching on the recognition result of the optical recognition according to the compliance rules.
[0169] In an embodiment of the present invention, for different image categories, the compliance rules are different. The specifically generated rules include:
[0170] For social media advertisement images, generate user privacy protection rules to ensure that no personal information or sensitive data is leaked in the image, such as not containing unauthorized user photos, information, or privacy data.
[0171] For video advertisement images, generate content compliance rules to ensure that the content of the advertisement image complies with relevant laws and regulations, such as prohibiting the involvement of illegal content, misleading advertisements, etc.
[0172] For dynamic advertisement images, generate material source rules to ensure that the material sources of the used dynamic advertisement images are legal, the copyright is authorized, and the use of unauthorized materials is avoided.
[0173] For static advertisement images, generate layout rules to ensure that the layout of the advertisement image complies with relevant regulations, such as the proportion of the image content, the font size of the text, the obviousness of the advertisement statement, etc.
[0174] Furthermore, the above different types of rules will be integrated into a unified compliance rule. These rules constitute the standards and basis for the compliance review of images.
[0175] Specifically, after generating the compliance rules, the system will perform compliance matching on the enhanced image based on the results of optical recognition. That is, it checks whether the content of the enhanced image meets the requirements of the compliance rules. If the image does not meet the compliance requirements, a warning may be issued, or the image may be further modified (such as removing sensitive content, adjusting the layout, etc.).
[0176] Specifically, according to the image category and compliance rules, each element in the image will be verified one by one. For example, in the compliance matching of social media advertising images, it will check whether there is sensitive personal information in the image; in the compliance matching of video advertising images, it will verify whether the advertising content complies with advertising regulations, etc.
[0177] Generally speaking, through the combination of optical recognition and compliance rule generation and matching, the compliance detection of the enhanced image is achieved. According to different image categories, the generated compliance rules are highly targeted, which can ensure that different types of images meet the requirements of corresponding laws and regulations, thus realizing automated and accurate compliance review.
[0178] S6. Generate a compliance report for the advertisement design drawing according to the detection result of the compliance detection, and perform correction processing on the advertisement design drawing according to the compliance report.
[0179] In the embodiment of the present invention, generating the compliance report for the advertisement design drawing according to the detection result of the compliance detection means generating a compliance detection result based on the optical recognition result of the image and the matching situation with the compliance rules. These detection results will be summarized into a report, which details the compliance issues existing in the advertisement design drawing.
[0180] Specifically, for example, the advertisement copy does not meet the requirements of the advertising law, the image contains sensitive personal information, the layout does not meet the regulations, etc.; according to the severity of the problem, the problems may be classified into minor problems, important problems, and serious problems for priority processing; for each compliance issue, the report will indicate its specific location in the advertisement design drawing (such as the text, image, etc. of a certain part); the report will provide corrective suggestions or specific rectification measures according to the specific problems.
[0181] Specifically, the compliance report will also evaluate the overall compliance of the image and give a comprehensive score (for example: compliant / non-compliant or the percentage of compliance degree), which helps designers quickly judge whether the advertising image meets all the regulations. The finally generated compliance report will be output in the form of a document, email, or system interface for relevant personnel to refer to. The report can include a preview of the image, the identified problems, and improvement suggestions to help designers or advertising reviewers for subsequent processing.
[0182] In the embodiments of the present invention, the amendment process of the advertisement design drawing according to the compliance report includes: designers or automated platforms will accurately locate and mark the non-compliant parts in the advertisement design drawing based on the problem locations indicated in the compliance report; for sensitive information and privacy-infringing parts in the image (such as unauthorized photos of people, personal information, etc.), they will be removed or blurred; if the compliance detection report shows that the copywriting is misleading, illegal or does not comply with the advertising law, the designer needs to modify the copywriting content according to legal requirements, such as reducing exaggerated publicity and adding necessary disclaimers; if the report points out that the image layout does not meet the regulations (for example, the ratio of advertisement text to pictures is inappropriate), the designer will adjust the image layout to meet the compliance requirements (for example, adjusting the text size, font, color, position, etc.); if it is detected that the image material is not authorized, the designer needs to replace the material to ensure the copyright legality of the material; the modified advertisement design drawing will be subject to a second review to ensure that all compliance issues have been corrected and comply with all relevant regulations.
[0183] Further, the platform may automatically re-conduct the compliance detection to verify whether all amendments meet the compliance requirements and generate a new report. If the problems are not fully resolved, further modification is required until the compliance requirements are met.
[0184] Specifically, the modified advertisement design drawing will be submitted to relevant personnel for final confirmation. After confirmation, the modified design drawing can be officially used for release.
[0185] The present invention improves the image quality through image enhancement processing, thereby making subsequent feature extraction more accurate. Especially when dealing with advertising images with low quality or complex backgrounds, it can effectively reduce the risk of misidentification. Then, by extracting key visual features such as gradient intensity and color channel histograms, it captures the shape, edge, and color distribution information in the image, providing strong support for subsequent detection. After feature extraction, the system adopts an adaptive weight update mechanism to dynamically adjust the weight of each feature according to its importance. This process enables the model to flexibly respond in the face of different types of advertising images, reduces the interference of irrelevant features, and further improves the detection accuracy. After that, the enhanced image is optimized and adjusted for input into the classification model to quickly determine the category of the advertising image, and the compliance of the advertising content is verified through an automated compliance detection system. Finally, the compliance detection results generate a detailed report to correct the non-compliant design drawings, avoiding the cumbersome process of manual review. The high degree of automation and intelligence of these steps greatly improves the detection efficiency and accuracy of advertising design drawings, reduces manual intervention, and ensures the accuracy and consistency of the detection process. Therefore, the present invention proposes a method for detecting advertising design drawings based on machine vision, which can solve the problem of low detection efficiency of advertising design drawings.
[0186] As Figure 2 shown, it is a functional module diagram of a device for detecting advertising design drawings based on machine vision provided by an embodiment of the present invention.
[0187] The device 100 for detecting advertising design drawings based on machine vision according to the present invention can be installed in an electronic device. According to the implemented functions, the device 100 for detecting advertising design drawings based on machine vision can include an image enhancement module 101, an image feature generation module 102, a weight update module 103, an image category generation module 104, a compliance detection module 105, and a design drawing correction module 106. The modules in the present invention can also be referred to as units, which refer to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
[0188] In this embodiment, the functions of each module / unit are as follows:
[0189] The image enhancement module 101 is used to collect the original image of the advertising design drawing and perform image enhancement on the original image to obtain the enhanced image of the original image;
[0190] The image feature generation module 102 is used to generate the gradient intensity and color channel histogram of the enhanced image, and generate the image features of the enhanced image according to the gradient intensity and the color channel histogram;
[0191] The weight update module 103 is configured to calculate the feature scores of the image features one by one according to a preset feature scoring algorithm, and adaptively update the feature weights corresponding to the image features according to the feature scores to obtain the updated weights of the feature weights, where the preset feature scoring algorithm is:
[0192]
[0193] where I j is the importance score of the j-th image feature, f ij is the value of the i-th sample on the j-th feature, is the average value of all samples on the j-th image feature, w i is the feature weight corresponding to the i-th sample, n is the total number of samples, i is the sample identifier, and j is the identifier of the image feature;
[0194] The image category generation module 104 is configured to adjust the enhanced image according to the updated weights, and input the adjusted enhanced image into a preset classification model to obtain the image category of the adjusted enhanced image;
[0195] The compliance detection module 105 is configured to perform optical recognition on the original image, and perform compliance detection on the enhanced image according to the recognition result of the optical recognition and the image category;
[0196] The design drawing correction module 106 is configured to generate a compliance report of the advertisement design drawing according to the detection result of the compliance detection, and perform correction processing on the advertisement design drawing according to the compliance report.
[0197] In several embodiments provided by the present invention, it should be understood that the disclosed methods and apparatuses can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0198] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0199] In addition, in each embodiment of the present invention, each functional module may be integrated in a processing unit, may exist physically as individual units, or two or more units may be integrated in one unit. The above integrated unit may be implemented in the form of hardware, or in the form of a combination of hardware and software functional modules.
[0200] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms.
[0201] The embodiments of the present application may acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence is a theory, method, technology and application device that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0202] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. An advertisement design drawing detection method based on machine vision, characterized in that, The method includes: Collect the original image of the advertisement design drawing, perform image enhancement on the original image to obtain the enhanced image of the original image; Generate the gradient intensity and color channel histogram of the enhanced image, and generate the image features of the enhanced image according to the gradient intensity and the color channel histogram; Calculate the feature scores of the image features one by one according to a preset feature scoring algorithm, and adaptively update the feature weights corresponding to the image features according to the feature scores to obtain the updated weights of the feature weights, where the preset feature scoring algorithm is: where, I j is the importance score of the j-th image feature, f ij is the value of the i-th sample on the j-th feature, is the average value of all samples on the j-th image feature, w i is the feature weight corresponding to the i-th sample, n is the total number of samples, i is the sample identifier, and j is the identifier of the image feature; Adjust the enhanced image according to the updated weights, and input the adjusted enhanced image into a preset classification model to obtain the image category of the adjusted enhanced image; Perform optical recognition on the original image, and perform compliance detection on the enhanced image according to the recognition result of the optical recognition and the image category; Generate a compliance report for the advertisement design drawing according to the detection result of the compliance detection, and perform correction processing on the advertisement design drawing according to the compliance report.
2. The method for detecting an advertisement design drawing based on machine vision according to claim 1, wherein, Performing image enhancement on the original image to obtain the enhanced image of the original image includes: Perform noise removal on the original image, and perform color enhancement on the original image after noise removal to obtain the enhanced image of the original image.
3. The method for detecting an advertising design drawing based on machine vision according to claim 2, wherein The performing color enhancement on the original image after noise removal to obtain the enhanced image of the original image includes: Perform hue adjustment on the original image after noise removal to obtain an adjusted image; Perform brightness processing on the adjusted image, and perform contrast enhancement on the adjusted image after brightness processing to obtain the enhanced image.
4. The method for detecting an advertisement design drawing based on machine vision according to claim 1, characterized in that, The generating the gradient intensity and color channel histogram of the enhanced image includes: Generate the gradient intensity of the enhanced image according to a preset gradient generation algorithm, where the preset gradient generation algorithm is: Among them, G(x, y) is the gradient intensity of the enhanced image at the point (x, y), and (I x (x, y)) is the horizontal direction gradient of the enhanced image at the point (x, y), and I y (x, y) is the vertical direction gradient of the enhanced image at the point (x, y).
5. The method for detecting an advertising design drawing based on machine vision according to claim 1, wherein, The generating the gradient intensity and color channel histogram of the enhanced image includes: Generate the color channel histogram of the enhanced image according to a preset histogram generation algorithm, where the preset histogram generation algorithm is: Among them, H c (t) is the histogram value of the color channel of the point (x, y) of the enhanced image, D e is the set of pixel points after image enhancement, I e (x, y) is the color value of the pixel point (x, y) in the enhanced image, is the indicator function, and t is the identifier of the color channel.
6. The method for detecting an advertising design drawing based on machine vision according to claim 1, wherein The generating the image features of the enhanced image according to the gradient intensity and the color channel histogram includes: Generate the image features of the enhanced image by using a preset weighting algorithm, the gradient intensity, and the color channel histogram, where the preset weighting algorithm is: F(x, y) = α·G(x, y) + β·H c (t); Among them, F(x, y) is the comprehensive image feature of the enhanced image at the position of point (x, y), α is the weighting coefficient corresponding to the gradient intensity, β is the weighting coefficient corresponding to the histogram value in the color channel histogram, G(x, y) is the gradient intensity of point (x, y), H c (t) is the histogram value of the color channel of point (x, y), and t is the identifier of the color channel.
7. The method for detecting an advertising design drawing based on machine vision according to claim 1, wherein The adaptively updating the feature weights corresponding to the image features according to the feature scores to obtain the updated weights of the feature weights includes: Adaptively update the feature weights corresponding to the image features according to the feature scores and a preset adaptive weight update algorithm to obtain the updated weights of the feature weights, where the preset adaptive weight update algorithm is: Among them, w ′ i is the updated weight of the feature weight, w i is the feature weight corresponding to the i-th sample, η is the learning rate, is the importance score I j of the mean value, I j is the importance score of the j-th image feature.
8. The method for detecting advertisement design drawings based on machine vision according to claim 1, wherein The adjusting the enhanced image according to the updated weights includes: Determine the real-time state of the enhanced image, and generate the feature score of the real-time state; Determine the area to be adjusted of the enhanced image according to the feature score; Adjust the enhanced image according to the area to be adjusted and the updated weights.
9. The machine vision-based advertisement design drawing detection method according to any one of claims 1 to 8, characterized in that Performing compliance detection on the enhanced image according to the recognition result of the optical recognition and the image category includes: When the image category is a social media advertisement graph, generating user privacy protection rules for the enhanced image; When the image category is a video advertisement graph, generating content compliance rules for the enhanced image; When the image category is a dynamic advertisement graph, generating material source rules for the enhanced image; When the image category is a static advertisement graph, generating layout rules for the enhanced image; Collecting the user privacy protection rules, content compliance rules, material source rules, and layout rules as the compliance rules for the enhanced image; Performing compliance matching on the recognition result of the optical recognition according to the compliance rules.
10. An advertisement design drawing detection device based on machine vision, characterized in that, The device includes: An image enhancement module for collecting the original image of the advertisement design graph, performing image enhancement on the original image, and obtaining the enhanced image of the original image; An image feature generation module for generating the gradient intensity and color channel histogram of the enhanced image, and generating the image features of the enhanced image according to the gradient intensity and the color channel histogram; A weight update module for calculating the feature scores of the image features one by one according to a preset feature scoring algorithm, adaptively updating the feature weights corresponding to the image features according to the feature scores, and obtaining the updated weights of the feature weights, where the preset feature scoring algorithm is: Among them, I j is the importance score of the j-th image feature, f ij is the value of the i-th sample on the j-th feature, is the average value of all samples on the j-th image feature, w i is the feature weight corresponding to the i-th sample, n is the total number of samples, i is the sample identifier, and j is the identifier of the image feature; An image category generation module for adjusting the enhanced image according to the updated weights, inputting the adjusted enhanced image into a preset classification model, and obtaining the image category of the adjusted enhanced image; A compliance detection module for performing optical recognition on the original image, and performing compliance detection on the enhanced image according to the recognition result of the optical recognition and the image category; A design graph correction module for generating a compliance report of the advertisement design graph according to the detection result of the compliance detection, and performing correction processing on the advertisement design graph according to the compliance report.