Defect detection method and system based on multi-factor image processing and storage medium

CN122597283APending Publication Date: 2026-08-18CHINA TOBACCO ZHEJIANG IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610664156.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-14
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0008]本发明实施例的目的是提供一种基于多因子图像处理的缺陷检测方法、系统及存储介质,以解决现有技术中没有设置多因子、多维度检测,无法打破耦合影响,无法保障检测覆盖性与准确性的问题

Benefits of technology

本发明实施方式通过采用新型的结构设计,基于可变条件成像环境与多因子数据集,同步量化视觉检测预测值,实现在线成像质量快速评价。相对于现有技术而言,无需停机和标准器件,提高检测效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597283A_ABST
    Figure CN122597283A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of detection, in particular to a defect visual detection method and system based on multi-factor image processing, a storage medium and a processor, comprising: collecting visual detection index related data sets, and constructing multi-factor image processing model training data sets; constructing a multi-factor image processing model, and training the multi-factor image processing model using the multi-factor image processing model training data sets; and using the trained multi-factor image processing model to detect defects in an image to be detected. Through the above technical solution, the present application embodiment extracts and fuses traditional physical features and deep semantic features through a double-branch structure, constructs a multi-factor image processing model, and realizes online imaging quality rapid evaluation. Compared with the prior art, the present application does not need to stop and use standard devices, solves the problem of insufficient model prediction caused by traditional single detection factor, and effectively improves the model detection efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of detection technology, and more specifically to a defect visual detection method, system, and storage medium based on multi-factor image processing. Background Technology

[0002] The core function of cigarette boxes is to protect cigarettes, facilitate storage and transportation, and also to carry brand information and warning labels, enhancing product recognition and ensuring consumer experience and safety. During the cigarette box production process, testing is necessary. Cigarette box testing can accurately identify appearance defects, dimensional deviations, and imaging-related quality issues, helping to ensure product appearance consistency and quality stability. It also assists in tobacco production quality control and efficiency improvement, maintains brand image, and meets consumer expectations.

[0003] In the visual inspection of cigarette box defects, automatic identification of scratches, stains, dimensional deviations, and other issues through defect detection algorithms requires a complete set of inspection methods and systems. Currently, the mainstream imaging quality evaluation method is based on standard device metrological traceability, which uses specialized devices such as standard white blocks and checkerboard calibration blocks to complete parameter calibration and quality assessment.

[0004] The invention with application number [202010790469.5] provides a cigarette box appearance defect detection system. The workflow includes: during the production and product conveying process, an industrial camera takes pictures of each outer surface of the cigarette box, while a lighting device provides continuous light to the industrial camera. The industrial camera transmits the photographed data to a processing device, which compares the received data with pre-stored standard data. If a deviation is found, a command is output to a logic controller, which controls a cylinder to start and push the defective cigarette box off the conveyor. At the same time, the appearance image of the defective cigarette box is transmitted to a display device to provide real-time reminders to workers in upstream processes.

[0005] The invention with application number [202510842275.8] provides a system and method for detecting defects in hard cigarette cartons. The workflow includes: using an embedded vision inspection module to perform online machine vision inspection of defects such as damage and scratches on the cartons; using an image preprocessing algorithm to determine the defects and output the detection results to the rejection mechanism and the early warning mechanism in real time, so as to prevent defective cigarette cartons from entering the next process and greatly improve the ability to control the quality problems of defective cartons.

[0006] However, current cigarette box inspection processes typically rely on a single detection factor, making it difficult to consider complex imaging characteristics. This can easily lead to the omission of key imaging defects and the neglect of the coupling effects between different imaging factors, thus failing to guarantee the coverage and accuracy of the inspection. Each imaging quality evaluation requires pausing the production line and placing standard components, resulting in a long time consumption for a single full-index inspection, which affects production efficiency. Furthermore, it can only be used for offline calibration before equipment is put into production and cannot achieve online real-time monitoring during the production process. The inspection results are highly dependent on the accuracy and condition of the standard components. Wear and contamination of the standard components can directly lead to distorted evaluation results, and standard components from different manufacturers are not interchangeable, increasing the inspection cost and complexity.

[0007] Therefore, there is an urgent need for an online visual inspection method for cigarette boxes based on a multi-factor imaging network (MFINet) model, which breaks the coupling effect of multiple detection factors and realizes the synchronous and rapid detection of multiple imaging quality indicators without downtime and with standard parts and single-frame image input of a single model. Summary of the Invention

[0008] The purpose of this invention is to provide a defect detection method, system, and storage medium based on multi-factor image processing, in order to solve the problems in the prior art that do not set up multi-factor and multi-dimensional detection, cannot break the coupling effect, and cannot guarantee the detection coverage and accuracy.

[0009] To achieve the above objectives, embodiments of the present invention provide a defect detection method based on multi-factor image processing, comprising: Collect datasets related to visual detection metrics and construct training datasets for multi-factor image processing models. A multi-factor image processing model is constructed, and the multi-factor image processing model is trained using the training dataset of the multi-factor image processing model. A trained multi-factor image processing model is used to detect defects in the images to be tested.

[0010] Optionally: Constructing a multi-factor image processing model, and training the multi-factor image processing model using the training dataset of the multi-factor image processing model, including: The training dataset of the multi-factor image processing model is preprocessed; A feature extraction module is used to extract features from the preprocessed multi-factor image processing model training dataset to obtain traditional physical features and deep semantic features. Feature fusion processing is performed based on the traditional physical features and deep semantic features to obtain fused features; Based on the fusion features, the predicted values ​​of the visual detection indicators are obtained; Based on the predicted and actual values ​​of the visual detection indicators, the performance evaluation index of the multi-factor image processing model is obtained. The parameters of the multi-factor image processing model are optimized based on the performance evaluation metrics.

[0011] Optionally: Preprocessing the training dataset of the multi-factor image processing model includes: The training dataset of the multi-factor image processing model is normalized. Obtain the pixel normalization value according to formula (1). (1) in, For pixel normalization values, These are the normalized pixel values. The average of the RGB three channels. The standard deviation is for the RGB three channels.

[0012] Optionally: A feature extraction module is used to extract features from the preprocessed multi-factor image processing model training dataset to obtain traditional physical features and deep semantic features, including: The brightness distribution statistics of the training dataset of the multi-factor image processing model are performed in multiple color spaces to obtain color features; Edge gradient operations and texture response statistics operations are performed on the training dataset of the multi-factor image processing model to obtain texture features; Global statistics on the grayscale and gradient distribution of the entire image in the training dataset of the multi-factor image processing model are performed to obtain global statistical features; The color features, texture features, and global statistical features are fused together to obtain traditional physical features.

[0013] Optionally: A feature extraction module is used to extract features from the preprocessed multi-factor image processing model training dataset to obtain traditional physical features and deep semantic features, including: A pre-trained ResNet50 convolutional neural network was used as the backbone for feature extraction, and the ResNet50 convolutional neural network was optimized and trained in two stages. Feature extraction is performed based on the optimized ResNet50 convolutional neural network to obtain high-order semantic features; Global average pooling is performed on the extracted high-order semantic features to obtain global statistical values; The global statistics are flattened to obtain deep semantic features.

[0014] Optionally: Feature fusion processing is performed based on the traditional physical features and deep semantic features to obtain fused features, including: The traditional physical features and the deep semantic features are reduced in dimensionality using formula (2). (2) in, Main component characteristics, Principal component analysis operation, The original high-dimensional features; The two types of features after dimensionality reduction are processed independently using formula (3) to obtain standardized feature values. (3) in, For standardized features, These are the original features after dimensionality reduction. This represents the mean of the feature in this dimension on the training set. This represents the standard deviation of the feature in this dimension on the training set. Channel splicing is performed on the traditional physical features after dimensionality reduction and standardization and the deep semantic features to obtain fused features.

[0015] Optionally: Obtaining the predicted value of the visual detection index based on the fusion features includes: A random forest regressor is used to construct the prediction branch for each visual detection metric to obtain a multi-metric independent random forest regression model. Based on the fusion features, a prediction branch for each visual detection metric is trained. Based on the trained multi-index independent random forest regression model, the fusion features of the image to be detected are input to obtain the predicted values ​​of the visual detection index.

[0016] Optionally: The two-stage optimization training includes: The parameters of the low-level general feature extraction layer of the ResNet50 convolutional neural network are frozen. The parameters of the high-level scene adaptation layer of the ResNet50 convolutional neural network are optimized, including: The calibration truth value based on visual detection metrics serves as an implicit supervision signal; Mean squared error is used as the loss function for feature fitting; The Adam optimizer is used to optimize the high-level scene adaptation layer of the ResNet50 convolutional neural network.

[0017] On the other hand, the present invention also provides a defect detection system based on multi-factor image processing, the detection system comprising: The image data acquisition module is used to collect datasets related to visual detection indicators and construct training datasets for multi-factor image processing models. The image feature extraction module is used to extract traditional physical features and deep semantic features respectively based on the training dataset of the multi-factor image processing model, and to obtain fused features based on the traditional physical features and deep semantic features. The prediction model building module constructs a multi-factor image processing model and trains the multi-factor image processing model using the training dataset of the multi-factor image processing model. The image defect detection module uses a trained multi-factor image processing model to detect defects in the image to be detected. A processor is connected to the image data acquisition module, the image feature extraction module, the prediction model construction module, and the image defect detection module, and the processor is configured to perform any of the methods described above.

[0018] In another aspect, the present invention provides a machine-readable storage medium storing instructions that cause a machine to perform any of the detection methods described above in this application.

[0019] The beneficial effects of this invention are: This invention employs a novel structural design, based on variable-condition imaging environments and multi-factor datasets, to simultaneously quantify visual detection prediction values, enabling rapid online imaging quality evaluation. Compared to existing technologies, it eliminates the need for downtime and standard components, thus improving detection efficiency.

[0020] The embodiments of the present invention integrate traditional physical features and deep semantic features to accurately associate the core attributes of imaging indicators and adapt to complex coupled scenarios. Compared with existing technologies, it solves the problem of insufficient model prediction caused by relying on a single detection factor and effectively improves the detection accuracy of the model.

[0021] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0022] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a defect detection method based on multi-factor image processing according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a specific method for collecting datasets related to visual detection indicators and constructing a training dataset for a multi-factor image processing model according to an embodiment of the present invention. Figure 3This is a flowchart illustrating a specific method for constructing a multi-factor image processing model according to an embodiment of the present invention, and for training the multi-factor image processing model using a training dataset. Figure 4 This is a structural diagram of a multi-factor image processing model constructed according to an embodiment of the present invention; Figure 5 This is a structural block diagram of a defect detection system based on multi-factor image processing according to an embodiment of the present invention. Detailed Implementation

[0023] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.

[0024] It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of this application all comply with relevant laws and regulations. In the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.

[0025] like Figure 1 The diagram shows a flowchart of a defect detection method based on a multi-factor image processing model according to an embodiment of the present invention. Figure 1 The detection method may include the following steps: In step S10, a dataset related to visual detection indicators is collected to construct a training dataset for a multi-factor image processing model. In step S11, a multi-factor image processing model is constructed, and the multi-factor image processing model is trained using the training dataset of the multi-factor image processing model. In step S12, the trained multi-factor image processing model is used to detect defects in the image to be detected.

[0026] In such Figure 1 In the defect detection method based on a multi-factor image processing model, step S10 is used to collect a dataset related to visual detection indicators and construct a training dataset for the multi-factor image processing model. In this embodiment, the visual detection indicators can be illumination uniformity, image sharpness, and image distortion rate.

[0027] In this embodiment, the specific method for collecting the visual detection index-related dataset and constructing the multi-factor image processing model training dataset in step S10 can be of various forms known to those skilled in the art. In this embodiment, step S10 can be as follows:Figure 2 The steps shown are described in this. Figure 2 In this context, step S10 may include: In step S20, a variable-condition imaging device is designed; In step S21, a standard block is designed; In step S22, based on the variable condition imaging device and the standard block, the parameters are adjusted by gradient, the calibration values ​​of the visual detection index are collected and associated with the real imaging features, and a precise mapping between the image and the visual detection index is established.

[0028] In such Figure 2 In the method shown, step S20 is used to simulate the actual imaging scenario of visual inspection equipment in tobacco industrial production, and to reproduce the imaging differences under different equipment and working conditions. The variable-condition imaging device can be designed in various ways known to those skilled in the art. In this embodiment, the device can be designed to include three imaging mechanisms and one independent variable imaging mechanism. The imaging mechanisms are used to photograph the five outer surfaces of the packaged cigarettes from different angles; the variable imaging mechanism includes three main components: a camera, a light source support, and a cantilever. The camera can be a GX-505-36U3C, equipped with 3mm, 4mm, 6mm, and 10mm multi-focal-length lenses; the rotation mechanism is used to adjust the camera's imaging angle, and the slide above the cantilever is used to adjust the imaging distance; the light source support carries a strip light source, a ring light source, and a dome light source; the illumination angles of the strip light source and the ring light source are finely adjusted by the adjusting arm, and the various light sources include different specifications, with brightness adjusted by the controller. Through the combined adjustment of the above parameters, the imaging differences caused by changes in key factors such as illumination uniformity, imaging angle, imaging distance, and light source type can be systematically reproduced, ensuring that the collected dataset can comprehensively cover different imaging conditions.

[0029] Step S21 is used to provide accurate and repeatable quantitative benchmark values ​​for visual inspection indicators, ensuring the accuracy and consistency of indicator calibration values ​​during dataset collection. The standard block design can be any design method known to those skilled in the art. In this embodiment, it includes three standard blocks: a white block for illumination uniformity, a sharpness standard block, and a standard checkerboard grid block. Because polytetrafluoroethylene (PTFE) material has high diffuse reflectance and stable physicochemical properties, it can ensure uniform and repeatable brightness output under different lighting conditions. Therefore, the white block for illumination uniformity can be designed as a PTFE cuboid with the same size as a conventional cigarette box.

[0030] The clarity standard block can be designed to be the same size as a regular cigarette box, with a line pair count ranging from 200 to 450, each line pair containing 16 vertical line patterns, and a cuboid with a gradient marker for every 50 line pairs.

[0031] The standard checkerboard grid can be designed with an 11×8 inner corner point specification. The physical size of a single checkerboard grid is 4mm, and the checkerboard grid area is 48mm×36mm, which is an acrylic cuboid with the same size as a regular cigarette box.

[0032] Step S22 is used to collect calibration values ​​of visual inspection indicators and associate them with real imaging features to establish a precise mapping between the image and the visual inspection indicators. In this embodiment, the specific method for collecting calibration values ​​of visual inspection indicators and associating them with real imaging features to establish a precise mapping between the image and the visual inspection indicators in step S22 can be various acquisition methods known to those skilled in the art. In this embodiment, the acquisition of the illumination uniformity dataset can be as follows: construct multiple sets of different illumination uniformity gradients by adjusting the light source type and angle parameters, acquire multiple illumination uniformity white block images under each gradient, use the HPCS330pro wireless spectrometer to measure the illuminance of multiple uniformly distributed feature points in the cigarette box imaging area, calculate the ratio of the standard deviation of the luminance value to the average value as the illumination uniformity Ip calibration value, and then collect cigarette box images and associate them with the corresponding Ip calibration values ​​while keeping the gradient parameters unchanged.

[0033] The acquisition of the image sharpness dataset can be carried out by: constructing multiple sets of different sharpness gradients by adjusting the lens focal length, covering 200-450 line pairs; acquiring multiple image sharpness standard block images under each gradient; outputting sharpness T values ​​as calibration values ​​using ImageJ software according to the ISO 12233 standard; and then acquiring cigarette box images and associating them with the corresponding T values ​​while keeping the parameters unchanged.

[0034] The acquisition of the imaging distortion rate dataset can be carried out by: constructing multiple sets of different distortion rate gradients based on the combination of lens and tilt angle, using the checkerboard calibration method, calculating the distortion rate Od by the deviation rate between the actual distance and the image calculated distance, and then collecting cigarette box images with the parameters unchanged and associating them with the Od calibration values.

[0035] Step S11 is used to construct a multi-factor image processing model and train the model using the training dataset. In this embodiment, the specific method for constructing the multi-factor image processing model and training it using the training dataset in step S11 can be of various forms known to those skilled in the art. In this embodiment, step S11 can be as follows: Figure 3 The steps shown indicate that the constructed multi-factor image processing model structure diagram can be as follows: Figure 4 As shown. In this Figure 3 In this context, step S11 may include: In step S30, the training dataset of the multi-factor image processing model is preprocessed; In step S31, the feature extraction module is used to extract features from the preprocessed multi-factor image processing model training dataset to obtain traditional physical features and deep semantic features. In step S32, feature fusion processing is performed based on traditional physical features and deep semantic features to obtain fused features; In step S33, the predicted values ​​of visual detection indicators are obtained based on the fusion features; In step S34, the performance evaluation index of the multi-factor image processing model is obtained based on the predicted and true values ​​of the visual detection index. In step S35, the parameters of the multi-factor image processing model are optimized based on performance evaluation metrics.

[0036] In such Figure 3 In the method shown, step S30 is used to preprocess the acquired images. Since the amount of acquired original image data is large and the size does not match the input requirements of the pre-trained model, the input images need to be uniformly scaled to the input size required by the model, thereby reducing the loss during model training; at the same time, the pixel value of different images fluctuates due to differences in illumination intensity, so the images need to be normalized and standardized. In this embodiment, the normalization process is performed according to the following formula (1): (1) in, These are the normalized pixel values. These are the pixel values ​​of the original image.

[0037] To further reduce the interference of irrelevant factors such as lighting changes and device noise, and to ensure that traditional physical features and deep semantic features are on the same level, the standardization process can be, for example, converting pixel values ​​into a distribution with a mean of 0 and a variance of 1. This standardization process can be performed according to the following formula (2): (2) in, For pixel normalization values, These are the normalized pixel values. The average of the RGB three channels. This represents the standard deviation of the RGB three channels. In this embodiment, It can be , It can be Standardization eliminates irrelevant interference and unifies data formats.

[0038] Step S31 is used to extract traditional physical features and deep semantic features, thereby fully covering the core physical standard dimensions of imaging indicators and effectively compensating for high-order correlation information in complex imaging scenarios. In this embodiment, traditional physical features are extracted through a manually designed structured feature extraction logic to construct a 296-dimensional feature vector. Among them, the 216-dimensional color features accurately correlate illumination uniformity indicators through the statistical analysis of brightness distribution in multiple color spaces; the 65-dimensional texture features correspond to imaging sharpness indicators through the statistical analysis of edge gradients and texture responses; and the 5-dimensional global statistical features assist in characterizing the geometric contour change law related to imaging distortion rate through the global statistics of grayscale and gradient distribution across the entire image. By fusing the three types of features, traditional physical features are obtained, fully covering the core physical representation dimensions of imaging indicators. In this embodiment, a ResNet50 convolutional neural network pre-trained on the ImageNet large-scale general image dataset can be used as the backbone for extracting deep semantic features. The ResNet50 convolutional neural network undergoes two-stage optimization training: In the first stage, the four layers Conv1, Conv2_x, Conv3_x, and Conv4_x are designated as the bottom-level general feature extraction layer, and the parameters of this layer are frozen. In the second stage, the last layer, Conv5_x, is designated as the high-level scene adaptation layer. The ground truth value of the visual detection metric is used as the implicit supervision signal, and the mean squared error is used as the loss function for feature adaptation. The Adam optimizer is used to optimize the high-level scene adaptation layer of the ResNet50 convolutional neural network. To avoid slow convergence due to an excessively small learning rate or the destruction of pre-trained general features due to an excessively large learning rate, an initial learning rate of 1e-4 is set in this embodiment. High-order semantic feature extraction is performed based on the optimized ResNet50 convolutional neural network. After feature extraction, the fully connected layers of ResNet50 originally used for the ImageNet 1000 classification task are removed. Global average pooling is performed on the 4-dimensional feature tensor output by the Conv5_x layer to compress the spatial dimension into global statistical values. Finally, the deep semantic features with 2048 dimensions are output through flattening.

[0039] Step S32 is used to eliminate the dimensional differences and numerical fluctuations between the two types of features caused by different extraction methods, while retaining the core effective information of both types of features. In this embodiment, the following formula (3) can be used to perform dimensionality reduction on traditional physical features and deep semantic features: (3) in, Main component characteristics, Principal component analysis operation, These are the original high-dimensional features.

[0040] Since the two types of features differ in size and magnitude due to different extraction methods, it is necessary to standardize the two types of features after dimensionality reduction. Standardization can be achieved using various methods known to those skilled in the art. In this embodiment of the invention, the Z-Score standardization method can be used, i.e., the standardized feature values ​​are obtained using the following formula (4): (4) in, For standardized features, These are the original features after dimensionality reduction. This represents the mean of the feature in this dimension on the training set. This represents the standard deviation of the feature in this dimension on the training set. The traditional physical features and deep semantic features after dimensionality reduction and standardization are directly spliced ​​together in the feature channel dimension to obtain the fused features.

[0041] Step S33 is used to output the quantitative predicted value of the visual detection index. Since multiple index predictions interfere with each other, to ensure the prediction accuracy of the visual detection index, this embodiment adopts a multi-task regression architecture of "single input - three branches independent parallel output". For the illumination uniformity coefficient Ip, imaging sharpness T value, and imaging distortion rate Od, three prediction branches are designed that are structurally independent, do not share parameters, do not interfere with each other during training, and execute in parallel during inference. Each branch corresponds to the regression prediction of one index. The regression prediction can be of various types known to those skilled in the art. In this embodiment, a Random Forest regressor can be selected. During training, a multi-factor integrated feature vector is used as a unified input, and each branch is trained independently according to its respective index label, thus ensuring no parameter sharing and no gradient interference between branches. During prediction and inference, the fused features are simultaneously input into the three trained independent Random Forest regressors, and each branch synchronously outputs the quantitative predicted value of the corresponding index.

[0042] Step S34 is used to comprehensively evaluate the model's predictive performance. Performance evaluation metrics can be of various types known to those skilled in the art. In this embodiment, three types of quantitative metrics are used to evaluate the model's predictive performance: root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R²). The root mean square error (RMSE) can be calculated using the following formula (5): (5); The mean absolute error (MAE) can be calculated using the following formula (6): (6); The coefficient of determination R² can be calculated using the following formula (7): (7) in, This represents the true value of the i-th sample. Let represent the predicted value of the i-th sample, and n be the number of samples.

[0043] Step S35 is used to iteratively optimize the multi-factor image processing model based on the obtained model performance evaluation index.

[0044] Step S12 is used to perform defect detection on the image to be detected using the trained multi-factor image processing model. In this embodiment, the specific method for performing defect detection on the image to be detected using the trained multi-factor image processing model in step S12 can be of various forms known to those skilled in the art. In this embodiment, it may include the following steps: In step S40, images of the cigarette box are acquired online; In step S41, the image is input into the trained MFINet model; In step S42, the model automatically completes feature extraction, fusion, and inference; In step S43, the quantification results of visual detection indicators are output simultaneously to achieve rapid evaluation of imaging quality.

[0045] Steps S40 to S43 use the trained multi-factor image processing model to detect defects in the image to be detected, thereby achieving rapid online evaluation of imaging quality.

[0046] On the other hand, embodiments of the present invention also provide a defect detection system based on multi-factor image processing. The structural block diagram of this detection system is shown below. Figure 5 As shown. In this Figure 5 The detection system comprises an image data acquisition module, an image feature extraction module, a prediction model construction module, and an image defect detection module. The image data acquisition module collects datasets related to visual inspection metrics and constructs a training dataset for a multi-factor image processing model. The image feature extraction module extracts traditional physical features and deep semantic features from the multi-factor image processing model training dataset to obtain fused features. The prediction model construction module builds the multi-factor image processing model and trains it using the multi-factor image processing model training dataset. The image defect detection module uses the trained multi-factor image processing model to detect defects in the images to be inspected.

[0047] In another aspect, the present invention provides a machine-readable storage medium storing instructions that cause a machine to perform any of the detection methods described above in this application.

[0048] The beneficial effects of this invention are: The embodiments of this invention employ a novel structural design. By constructing a variable-condition imaging environment and a multi-factor dataset, the MFINet model integrates traditional physical features and deep semantic features. After PCA dimensionality reduction, random forest regression is used. Inputting a cigarette box image allows for simultaneous quantification of illumination uniformity, sharpness, and distortion rate, enabling rapid online detection without downtime or the use of standard devices, resulting in high detection efficiency. It exhibits excellent prediction accuracy for cigarette boxes made of mainstream materials, with good stability and generalization, reducing missed detections and false positives, assisting in tobacco production quality control, and providing a new technological solution for industrial visual inspection.

[0049] This invention presents an online defect visual detection method based on a multi-factor image processing model. By clearly defining core evaluation indicators such as the sample being detected, the equipment, and the uniformity of illumination, a solid foundation for detection is laid. A variable-condition imaging environment is constructed, a dedicated standard block is designed, and a multi-factor dataset covering multiple gradients is collected. This provides comprehensive data support for model training that aligns with actual production scenarios. The unified detection benchmark ensures the accuracy and diversity of the data, effectively adapting to different imaging conditions and cigarette box materials. This lays a solid foundation for subsequent model construction and accurate detection, guaranteeing the scientific validity and reliability of the detection method.

[0050] This invention presents an online defect visual detection method based on a multi-factor image processing model. By constructing an MFINet model, a dual-branch structure is used to extract traditional physical features and deep semantic features. These features are then fused after PCA dimensionality reduction optimization and combined with a random forest regressor to achieve simultaneous prediction of multiple indicators. This approach not only accurately captures the core attributes of imaging indicators using traditional physical features but also adapts to complex coupled scenarios through deep semantic features, effectively improving the model's detection accuracy. The independent prediction branch design enables simultaneous quantification and output of illumination uniformity, sharpness, and distortion rate, solving the problem of insufficient prediction by traditional single-feature models. This provides high-performance, highly generalizable model support for subsequent rapid evaluation, ensuring the scientific rigor and efficiency of the detection process.

[0051] This invention presents an online defect visual detection method based on a multi-factor image processing model. Utilizing the well-trained MFINet model, it rapidly evaluates image quality without requiring system downtime or standard components. Simply inputting the original image of the cigarette box acquired online quickly outputs quantitative results for illumination uniformity, sharpness, and distortion rate, significantly simplifying the detection process, avoiding the complex operations of traditional methods, and significantly improving the efficiency of production and inspection collaboration. Leveraging the model's excellent accuracy and stability, it can accurately identify imaging problems related to appearance defects, reducing missed detections and false positives. Adaptable to various mainstream cigarette box materials, it meets the needs of industrial online real-time quality control, providing efficient and convenient technical support for tobacco production quality assurance.

[0052] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0054] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0055] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0056] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0057] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0058] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0059] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0060] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A defect detection method based on multi-factor image processing, characterized in that, The method includes: Collect datasets related to visual detection metrics and construct training datasets for multi-factor image processing models. A multi-factor image processing model is constructed, and the multi-factor image processing model is trained using the training dataset of the multi-factor image processing model. A trained multi-factor image processing model is used to detect defects in the images to be tested.

2. The method according to claim 1, characterized in that, Constructing a multi-factor image processing model and training the multi-factor image processing model using the training dataset of the multi-factor image processing model includes: The training dataset of the multi-factor image processing model is preprocessed; A feature extraction module is used to extract features from the preprocessed multi-factor image processing model training dataset to obtain traditional physical features and deep semantic features. Feature fusion processing is performed based on the traditional physical features and deep semantic features to obtain fused features; Based on the fusion features, the predicted values ​​of the visual detection indicators are obtained; Based on the predicted and actual values ​​of the visual detection indicators, the performance evaluation index of the multi-factor image processing model is obtained. The parameters of the multi-factor image processing model are optimized based on the performance evaluation metrics.

3. The method according to claim 2, characterized in that, Preprocessing the training dataset of the multi-factor image processing model includes: The training dataset of the multi-factor image processing model is normalized. Obtain the pixel normalization value according to formula (1). ,(1) in, For pixel normalization values, These are the normalized pixel values. The average of the RGB three channels. The standard deviation is for the RGB three channels.

4. The method according to claim 2, characterized in that, The feature extraction module is used to extract features from the preprocessed multi-factor image processing model training dataset to obtain traditional physical features and deep semantic features, including: The brightness distribution statistics of the training dataset of the multi-factor image processing model are performed in multiple color spaces to obtain color features; Edge gradient operations and texture response statistics operations are performed on the training dataset of the multi-factor image processing model to obtain texture features; Global statistics on the grayscale and gradient distribution of the entire image in the training dataset of the multi-factor image processing model are performed to obtain global statistical features; The color features, texture features, and global statistical features are fused together to obtain traditional physical features.

5. The method according to claim 2, characterized in that, The feature extraction module is used to extract features from the preprocessed multi-factor image processing model training dataset to obtain traditional physical features and deep semantic features, including: A pre-trained ResNet50 convolutional neural network was used as the backbone for feature extraction, and the ResNet50 convolutional neural network was optimized and trained in two stages. Feature extraction is performed based on the optimized ResNet50 convolutional neural network to obtain high-order semantic features; The extracted high-order semantic features are subjected to global average pooling to obtain global statistical values; The global statistics are flattened to obtain deep semantic features.

6. The method according to claim 2, characterized in that, Based on the traditional physical features and deep semantic features, feature fusion processing is performed to obtain fused features, including: The traditional physical features and the deep semantic features are reduced in dimensionality using formula (2). ,(2) in, Main component characteristics, Principal component analysis operation, The original high-dimensional features; The two types of features after dimensionality reduction are processed independently using formula (3) to obtain standardized feature values. ,(3) in, For standardized features, These are the original features after dimensionality reduction. This represents the mean of the feature in this dimension on the training set. This represents the standard deviation of the feature in this dimension on the training set. Channel splicing is performed on the traditional physical features after dimensionality reduction and standardization and the deep semantic features to obtain fused features.

7. The method according to claim 2, characterized in that, Obtaining predicted values ​​for visual detection metrics based on the fusion features includes: A random forest regressor is used to construct the prediction branch for each visual detection metric to obtain a multi-metric independent random forest regression model. Based on the fusion features, a prediction branch for each visual detection metric is trained. Based on the trained multi-index independent random forest regression model, the fusion features of the image to be detected are input to obtain the predicted values ​​of the visual detection index.

8. The method according to claim 5, characterized in that, The two-stage optimization training includes: The parameters of the underlying general feature extraction layer of the ResNet50 convolutional neural network are frozen. The parameters of the high-level scene adaptation layer of the ResNet50 convolutional neural network are optimized, including: The calibration truth value based on visual detection metrics serves as an implicit supervision signal; Mean squared error is used as the loss function for feature fitting; The Adam optimizer is used to optimize the high-level scene adaptation layer of the ResNet50 convolutional neural network.

9. A defect detection system based on multi-factor image processing, characterized in that, The system includes: The image data acquisition module is used to collect datasets related to visual detection indicators and construct training datasets for multi-factor image processing models. The image feature extraction module is used to extract traditional physical features and deep semantic features respectively based on the training dataset of the multi-factor image processing model, and to obtain fused features based on the traditional physical features and deep semantic features. The prediction model building module constructs a multi-factor image processing model and trains the multi-factor image processing model using the training dataset of the multi-factor image processing model. The image defect detection module uses a trained multi-factor image processing model to detect defects in the image to be detected. A processor is connected to the image data acquisition module, the image feature extraction module, the prediction model construction module, and the image defect detection module, and the processor is configured to perform the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • A cigarette box appearance defect detection system

    CN111929316B

  • Cigarette hard carton damage defect detection system and method

    CN120741344A