Intelligent visual detection method and system
Through intelligent visual detection methods and mixed depth convolution model, the subjectivity and inaccuracy of traditional glass bottle quality inspection methods are solved, and a more efficient and accurate quality inspection management system is achieved, and the production quality and products of glass bottles are improved. Retrospective.
Patent Information
- Application Number
- CN202410725666.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-11-12
AI Technical Summary
Traditional glass bottle quality inspection methods rely on manual visual inspection and physical testing, which are subjective, inaccurate and labor-intensive, making it difficult to provide detailed records and data to support root traceability, and cannot fundamentally solve the problem.
Using intelligent visual detection method, by acquiring historical data sets, building a hybrid depth convolution model, designing a numbering system and performing multi-angle image detection, combining image processing and deep learning models, quality inspection reports are generated and model optimized to form a comprehensive quality Inspection management system.
It improves the comprehensiveness and accuracy of glass bottle quality inspection, reduces the rate of unqualified products, enhances the traceability and detailedness of production quality, promptly detects and deals with abnormalities, and adapts to changes in the production environment.
Smart Images

Figure CN118941494A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent detection technology, and in particular to an intelligent visual detection method and system. Background Art
[0002] Glass bottle processing plants play an important role and influence in quality inspection of glass bottles. Quality inspection ensures that each glass bottle produced meets specifications and quality standards, prevents bottles with cracks, bubbles, flaws or other defects from entering the market, and helps improve the overall quality and performance of the product.
[0003] Traditional methods of quality inspection of glass bottles usually involve manual visual inspection and some physical testing-based methods. Visual inspection by workers is one of the most basic quality inspection methods. Workers will check the appearance of the glass bottles to find cracks, bubbles, flaws, stains and other problems. This method relies on human observation, which may be subjective and inaccurate due to fatigue, and consumes a lot of manpower. A traditional method of detecting whether there are cracks or air bubbles in glass bottles is to tap the bottle and listen to the sound to determine whether there is any abnormality. This requires experienced workers to perform, but it is not accurate enough.
[0004] In addition, manual quality inspection has some challenges in root cause tracing, because human factors may introduce subjectivity and inconsistency, and it is difficult to provide detailed records and data to support tracing the root cause of the problem, and the problem cannot be solved fundamentally. Summary of the invention
[0005] The present application aims to solve at least one of the technical problems in the related art to a certain extent. To this end, one purpose of the present application is to propose an intelligent visual inspection method and system, which integrates data acquisition, image processing, deep learning model detection, production process traceability and quality inspection report generation to form a comprehensive quality inspection management system, improve the comprehensiveness and accuracy of quality inspection, make the glass bottle quality inspection process more complete, intelligent and efficient, and have significant advantages in improving production quality and reducing the rate of unqualified products.
[0006] The first aspect disclosed in the present application provides an intelligent visual detection method, the method comprising:
[0007] Acquire a historical data set, wherein the historical data set is data of n unqualified glass bottles, and n is a positive integer greater than zero;
[0008] Constructing a hybrid deep convolutional model, and training the hybrid deep convolutional model using the historical data;
[0009] Designing a numbering system to number N glass bottles and record the production process of the N glass bottles, wherein N is a positive integer greater than zero;
[0010] The N glass bottles are photographed at multiple angles in sequence to obtain multiple N glass bottle images and pre-process the images, and the images are input into the hybrid deep convolution model for detection;
[0011] Record the test results of N glass bottles and generate a quality inspection report. If there are any abnormalities in the quality inspection report, perform corresponding abnormal processing;
[0012] According to the feedback information of the quality inspection results, the hybrid deep convolutional model is optimized.
[0013] The step of obtaining the historical data set includes:
[0014] Obtain glass bottles marked as unqualified in historical quality inspection records;
[0015] Equipped with high-quality camera equipment, take pictures of n unqualified glass bottles at different angles, distances and lighting conditions, obtain images of unqualified glass bottles and perform pre-processing;
[0016] Identify the types of unqualified glass bottles that need to be labeled, including cracks, bubbles and defects, and develop detailed labeling standards to ensure consistency and accuracy of labeling;
[0017] Establish a quality control mechanism for annotation, including spot checks and audits of annotation results, to ensure accuracy and consistency of annotations;
[0018] The labeled images of unqualified glass bottles form a historical data set.
[0019] The hybrid deep convolutional model is a mixture of a deep convolutional network and a TransFormer, including an input layer, a convolutional layer, a local perception layer, a deep convolutional network and a TransFormer mixed layer, and an output layer;
[0020] The input layer receives N images of glass bottles to be detected, preprocesses the images of the N glass bottles to be detected, and obtains X i , where X i is the image of the i-th glass bottle to be detected, 1≤i≤N;
[0021] The convolution layer extracts the features of the image and performs a convolution operation on the image of the glass bottle to be detected through the convolution kernel. The formula is:
[0022]
[0023] Among them, Conv 3×3 (·) represents a 3×3 convolution operation, GeLU(·) represents an activation function, and BN(·) represents a batch normalization function. is the image feature of the i-th glass bottle to be detected extracted by the first convolution layer, for is the i-th glass bottle image feature to be detected extracted by the second convolution layer;
[0024] The local perception layer uses convolution to extract local information, adopts 3×3 depth separation convolution, and uses residual connection to stabilize the training of hybrid depth convolution model;
[0025] The hybrid layer of deep convolutional network and TransFormer consists of two layers of normalization, lightweight multi-head attention and reverse residual feedforward network;
[0026] The output layer outputs the results of glass bottle detection.
[0027] The local perception layer extracts local information by convolution, adopts 3×3 depth separation convolution, and uses residual connection to stabilize the mixed depth convolution model training, including;
[0028]
[0029] Where DWConv(·) represents depthwise separable convolution.
[0030] The deep convolutional network and TransFormer hybrid layer consists of a fully connected layer, two layer normalization, a lightweight multi-head attention and a reverse residual feedforward network, including:
[0031]
[0032] Among them, LN(·) represents the layer normalization function, LMHSA(·) represents the lightweight multi-head attention function, IRFFN(·) represents the inverse residual feedforward network function, The results of the representation layer normalization function and the lightweight multi-head attention function, Represents the output of a mixed layer of a deep convolutional network and a Transformer.
[0033] The lightweight multi-head attention calculation and reverse residual feedforward network include:
[0034] The lightweight multi-head attention formula is:
[0035]
[0036] LN(·) represents the layer normalization function, FC(·) represents the fully connected function, Q represents the query, K represents the key, and V represents the value;
[0037] K′=DWConv(K);
[0038] V′=DWConv(V);
[0039]
[0040] Where DWConv(·) represents depthwise separable convolution, K′ is the key after depthwise separable convolution, V′ is the value after depthwise separable convolution, Softmax(·) represents the activation function, and d represents the number of channels.
[0041] The reverse residual feedforward network formula is:
[0042]
[0043] Among them, DWConv(·) represents deep separable convolution, Conv(·) represents convolution, and BN(·) represents batch normalization function.
[0044] The design numbering system is used to number N glass bottles and record the steps of the production process of the N glass bottles, including:
[0045] Establish numbering rules to ensure that the generated numbers are unique;
[0046] Add a bar to each glass bottle, containing the number information of the glass bottle;
[0047] Establish production process records for each glass bottle, including: manufacturing date and time, batch number of raw materials used, use of manufacturing equipment, information of manufacturing personnel, key steps and parameters of each production stage;
[0048] Store production process information in a professional database.
[0049] The step of obtaining a plurality of N glass bottle images and performing preprocessing includes:
[0050] Organize the images of each glass bottle into a folder, making sure each folder corresponds to multiple angle images of a glass bottle;
[0051] For each glass bottle's image folder, batch preprocessing was performed using an image processing library, including resizing, normalization, and denoising;
[0052] Save the preprocessed images into a new folder, making sure that each multi-angle image of the glass bottle has a corresponding preprocessing result.
[0053] The second aspect disclosed in the present application provides an intelligent visual inspection system, the system comprising:
[0054] A module for obtaining a historical data set is used to obtain a historical data set, wherein the historical data set is data of n unqualified glass bottles, and n is a positive integer greater than zero;
[0055] A hybrid deep convolutional model module, used to construct a hybrid deep convolutional model, and train the hybrid deep convolutional model using the historical data;
[0056] A numbering module, used to design a numbering system, number N glass bottles, and record the production process of the N glass bottles, wherein N is a positive integer greater than zero;
[0057] A detection module, used to sequentially photograph the N glass bottles from multiple angles to obtain multiple N glass bottle images and perform preprocessing, and input the images into the hybrid deep convolution model for detection;
[0058] The processing module is used to record the test results of N glass bottles and generate a quality inspection report. If there is an abnormality recorded in the quality inspection report, the corresponding abnormality processing is performed;
[0059] The feedback module is used to optimize the hybrid deep convolutional model according to the feedback information of the quality inspection results.
[0060] The third aspect disclosed in the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the intelligent visual detection method are implemented.
[0061] The fourth aspect disclosed in the present application provides a readable storage medium, wherein the readable storage medium stores a computer program, and the computer program is suitable for loading by a processor to execute the steps of the intelligent visual detection method.
[0062] Compared with the prior art, the present invention discloses an intelligent visual detection method and system, which has the following advantages:
[0063] This application obtains data on unqualified glass bottles from historical data sets and establishes a hybrid deep convolutional model. This fully utilizes historical quality inspection data, allowing the model to learn and understand the characteristics of unqualified glass bottles from multiple perspectives, thereby improving the robustness of the model.
[0064] This application designs a numbering system and records the production process, and establishes detailed production process records for each glass bottle, which helps to trace the manufacturing history of each product, improve product traceability, and make quality inspection reports more detailed and credible;
[0065] This application generates a quality inspection report, records the quality inspection results, and handles the exceptions accordingly when an exception is found, which helps to promptly detect and handle unqualified products and ensure product quality;
[0066] This application optimizes the hybrid deep convolutional model based on the feedback information of the quality inspection results. Through the iterative process, the model is continuously optimized to adapt to changes in the production environment and improve the detection accuracy and generalization ability of the model;
[0067] This application integrates multiple links such as data collection, image processing, deep learning model detection, production process traceability and quality inspection report generation to form a comprehensive quality inspection management system, which improves the comprehensiveness and accuracy of quality inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 It is a flow chart of an intelligent visual detection method provided by this application;
[0069] Figure 2 This is a schematic diagram of the process of obtaining historical data sets provided by this application;
[0070] Figure 3 It is a schematic diagram of the structure of a hybrid deep convolutional model provided by this application;
[0071] Figure 4 It is a schematic diagram of the structure of extracting image features by the convolution layer provided in this application;
[0072] Figure 5 It is a schematic diagram of the local perception layer structure provided by this application;
[0073] Figure 6 This is a schematic diagram of the mixed layer structure of the deep convolutional network and TransFomer provided by this application;
[0074] Figure 7 It is a schematic diagram of the reverse residual feedforward network structure provided by this application;
[0075] Figure 8 It is the number provided by this application and records the flow chart of the glass bottle production process;
[0076] Fig. 9 It is a schematic diagram of the preprocessing process of multiple N glass bottle images provided by this application;
[0077] Fig.10 It is a schematic diagram of an intelligent visual inspection system provided by this application;
[0078] Fig.11 It is a schematic diagram of the structure of an electronic device provided by this application;
[0079] Fig.12 It is a schematic diagram of the computer-readable storage medium structure provided by this application. DETAILED DESCRIPTION
[0080] In order to better understand the present application, a more detailed description will be made of various aspects of the present application with reference to the accompanying drawings. It should be understood that these detailed descriptions are only descriptions of exemplary embodiments of the present application, and are not intended to limit the scope of the present application in any way. Throughout the specification, the same reference numerals refer to the same elements. The expression "and / or" includes any and all combinations of one or more of the associated listed items.
[0081] As used herein, the terms "substantially", "approximately" and similar terms are used as terms of approximation rather than as terms of degree, and are intended to account for inherent deviations in measurements or calculations that would be recognized by a person of ordinary skill in the art. In addition, in this application, the order in which the processing of each step is described does not necessarily represent the order in which these processes occur in actual operation, unless otherwise clearly defined or inferred from the context.
[0082] It should also be understood that expressions such as "including", "comprising", "having", "containing" and / or "comprising" are open rather than closed expressions in this specification, which indicate the presence of the stated features, elements and / or components, but do not exclude the presence of one or more other features, elements, components and / or combinations thereof. In addition, when expressions such as "at least one of..." appear after a list of listed features, they modify the entire list of features rather than just the individual elements in the list. In addition, when describing embodiments of the present application, "may" is used to mean "one or more embodiments of the present application". And, the term "exemplary" is intended to refer to an example or illustration.
[0083] Unless otherwise specified, all words (including engineering terms and scientific and technological terms) used in this article have the same meaning as those commonly understood by ordinary technicians in the field to which this application belongs. It should also be understood that, unless clearly stated in this application, words defined in common dictionaries should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and should not be interpreted in an idealized or overly formal sense.
[0084] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0085] Example 1
[0086] like Figures 1 to 9 As shown, the present application provides an intelligent visual detection method.
[0087] like Figure 1 As shown, a schematic diagram of a process flow of an intelligent visual detection method provided by the present application includes:
[0088] S1: Obtain a historical data set, wherein the historical data set is data of n unqualified glass bottles, and n is a positive integer greater than zero;
[0089] like Figure 2 As shown, the step of obtaining the historical data set includes:
[0090] Obtain glass bottles marked as unqualified in historical quality inspection records;
[0091] Equipped with high-quality camera equipment, take pictures of n unqualified glass bottles at different angles, distances and lighting conditions, obtain images of unqualified glass bottles and perform pre-processing;
[0092] Identify the types of unqualified glass bottles that need to be labeled, including cracks, bubbles and defects, and develop detailed labeling standards to ensure consistency and accuracy of labeling;
[0093] Establish a quality control mechanism for annotation, including spot checks and audits of annotation results, to ensure accuracy and consistency of annotations;
[0094] The labeled images of unqualified glass bottles form a historical data set.
[0095] Among them, by obtaining glass bottles marked as unqualified in historical quality inspection records, the data set is more authentic and practical, because it is composed of quality inspection records in actual production; configuring high-quality camera equipment to take images of unqualified glass bottles from different angles, distances and lighting conditions makes the data set more diverse, which helps the hybrid deep convolutional model to better adapt to images under different production environments and conditions, and improves the generalization ability of the hybrid deep convolutional model; confirming the types of unqualified glass bottles that need to be labeled, formulating detailed labeling standards, and establishing a labeling quality control mechanism will help improve the accuracy and consistency of labeling. Ensuring the quality of labeling is a key factor in ensuring the effectiveness of hybrid deep convolutional model training; establishing a labeling quality control mechanism, including spot checks and audits of labeling results, will help ensure the quality of labeling. The labeling quality control mechanism will help to promptly discover and correct possible problems and improve the quality of the data set.
[0096] The obtaining and preprocessing of the images of the unqualified glass bottles includes adjusting the unqualified glass bottle images to the same size, normalizing the unqualified glass bottle images, using Gaussian filtering to reduce noise on the unqualified glass bottle images, and adjusting the contrast and brightness of the unqualified glass bottle images.
[0097] Among them, the images of unqualified glass bottles are adjusted to the same size to ensure that the images input into the hybrid deep convolutional model have consistent sizes so that the hybrid deep convolutional model can better learn image features; the images of unqualified glass bottles are normalized and the pixel values are scaled to a specific range of -1 to 1, which helps the hybrid deep convolutional model to be trained more stably; Gaussian filtering is a commonly used method for smoothing images, which blurs the image by reducing the difference between the value of each pixel in the image and the surrounding pixels; the contrast and brightness of the images of unqualified glass bottles are adjusted, and the visible features of the image are enhanced through histogram equalization and contrast stretching methods.
[0098] S2: constructing a hybrid deep convolutional model, and training the hybrid deep convolutional model using the historical data;
[0099] like Figure 3 As shown, the hybrid deep convolutional model is a mixture of a deep convolutional network and a TransFormer, including an input layer, a convolutional layer, a local perception layer, a deep convolutional network and a TransFormer mixed layer, and an output layer;
[0100] The input layer receives N images of glass bottles to be detected, preprocesses the images of the N glass bottles to be detected, and obtains X i , where X i is the image of the i-th glass bottle to be detected, 1≤i≤N;
[0101] like Figure 4 As shown in the figure, the convolution layer extracts the features of the image and performs a convolution operation on the image of the glass bottle to be detected through the convolution kernel. The formula is:
[0102]
[0103] Among them, Conv 3×3 (·) represents a 3×3 convolution operation, GeLU(·) represents an activation function, and BN(·) represents a batch normalization function. is the image feature of the i-th glass bottle to be detected extracted by the first convolution layer, for is the i-th glass bottle image feature to be detected extracted by the second convolution layer;
[0104] The local perception layer uses convolution to extract local information, adopts 3×3 depth separation convolution, and uses residual connection to stabilize the training of hybrid depth convolution model;
[0105] The hybrid layer of deep convolutional network and TransFormer consists of two layers of normalization, lightweight multi-head attention and reverse residual feedforward network;
[0106] The output layer outputs the results of glass bottle detection.
[0107] like Figure 5 As shown, the local perception layer uses convolution to extract local information, adopts 3×3 depth separation convolution, and uses residual connection to stabilize the mixed depth convolution model training, including;
[0108]
[0109] Where DWConv(·) represents depthwise separable convolution.
[0110] like Figure 6 As shown, the deep convolutional network and TransFormer hybrid layer consists of a fully connected layer, two layer normalizations, a lightweight multi-head attention, and a reverse residual feedforward network, including:
[0111]
[0112] Among them, LN(·) represents the layer normalization function, LMHSA(·) represents the lightweight multi-head attention function, IRFFN(·) represents the inverse residual feedforward network function, The results of the representation layer normalization function and the lightweight multi-head attention function, Represents the output of the mixed layer of the deep convolutional network and TransFormer;
[0113] The lightweight multi-head attention calculation and reverse residual feedforward network include:
[0114] The lightweight multi-head attention formula is:
[0115]
[0116] LN(·) represents the layer normalization function, FC(·) represents the fully connected function, Q represents the query, K represents the key, and V represents the value;
[0117] K′=DWConv(K);
[0118] V′=DWConv(V);
[0119]
[0120] Where DWConv(·) represents depthwise separable convolution, K′ is the key after depthwise separable convolution, V′ is the value after depthwise separable convolution, Soffmax(·) represents the activation function, and d represents the number of channels.
[0121] like Figure 7 As shown, the reverse residual feedforward network formula is:
[0122]
[0123] Among them, DWConv(·) represents depthwise separable convolution, and Conv(·) represents convolution.
[0124] S3: designing a numbering system, numbering N glass bottles, and recording the production process of the N glass bottles, wherein N is a positive integer greater than zero;
[0125] like Figure 8 As shown, the design numbering system is used to number N glass bottles and record the steps of the production process of the N glass bottles, including:
[0126] Establish numbering rules to ensure that the generated numbers are unique;
[0127] Add a bar to each glass bottle, containing the number information of the glass bottle;
[0128] Establish production process records for each glass bottle, including: manufacturing date and time, batch number of raw materials used, use of manufacturing equipment, information of manufacturing personnel, key steps and parameters of each production stage;
[0129] Store production process information in a professional database.
[0130] Among them, detailed production process records help trace the manufacturing history of each glass bottle, locate possible problems, conduct quality analysis, and promptly discover and resolve potential quality problems; database storage provides efficient data management and retrieval methods, supports tracing, analyzing and monitoring the production process, and helps to adjust production strategies in a timely manner to improve production efficiency and quality levels.
[0131] S4: photographing the N glass bottles in sequence from multiple angles to obtain a plurality of N glass bottle images and preprocessing them, and inputting the images into the hybrid deep convolution model for detection;
[0132] like Fig. 9 As shown, the step of obtaining a plurality of N glass bottle images and performing preprocessing includes:
[0133] Organize the images of each glass bottle into a folder, making sure each folder corresponds to multiple angle images of a glass bottle;
[0134] For each glass bottle's image folder, batch preprocessing was performed using an image processing library, including resizing, normalization, and denoising;
[0135] Save the preprocessed images into a new folder, making sure that each multi-angle image of the glass bottle has a corresponding preprocessing result.
[0136] Among them, batch preprocessing ensures the consistency of images so that the images have similar feature representations; resizing and normalization help maintain the consistency of images before inputting into the model, and denoising helps improve the model's learning effect on image features.
[0137] S5: Record the test results of N glass bottles and generate a quality inspection report. If there is an abnormality in the quality inspection report, perform corresponding abnormal processing;
[0138] The step of recording the test results of N glass bottles, generating a quality inspection report, and performing corresponding exception handling if an abnormality is recorded in the quality inspection report includes:
[0139] Record the test results of each glass bottle, including whether the glass bottle is qualified. If it is unqualified, record the defect type of the glass bottle;
[0140] Generate a quality inspection report based on the recorded test results, including the serial number of each glass bottle, the test results and the detailed information of the defect type;
[0141] If an abnormality is recorded in the quality inspection report, that is, an unqualified glass bottle, the corresponding abnormal handling measures will be implemented, including: removing the unqualified glass bottles from the production line to ensure that they do not enter the market; if the test results show that the problem is caused by the production equipment, maintenance and repair are required; according to the quality inspection results, the production parameters are adjusted to prevent similar problems from happening again. The advantage is that unqualified products can be discovered and handled in a timely manner, ensuring that only qualified products enter the market, improving product quality and customer satisfaction, and at the same time, by recording the abnormal handling process, reducing the occurrence of quality problems, it helps to maintain the stability and reliability of the production process.
[0142] S6: Optimize the hybrid deep convolutional model according to the feedback information of the quality inspection results.
[0143] Among them, through repeated iterations and optimization processes, the hybrid deep convolutional model can gradually improve its ability to recognize different defects, better adapt to changes in the production environment, and thus achieve stable quality inspection results.
[0144] Example 2
[0145] like Fig.10 As shown, a schematic diagram of an intelligent visual inspection system provided by the present application includes:
[0146] A module for obtaining a historical data set is used to obtain a historical data set, wherein the historical data set is data of n unqualified glass bottles, and n is a positive integer greater than zero;
[0147] A hybrid deep convolutional model module, used to construct a hybrid deep convolutional model, and train the hybrid deep convolutional model using the historical data;
[0148] A numbering module, used to design a numbering system, number N glass bottles, and record the production process of the N glass bottles, wherein N is a positive integer greater than zero;
[0149] A detection module, used to sequentially photograph the N glass bottles from multiple angles to obtain multiple N glass bottle images and perform preprocessing, and input the images into the hybrid deep convolution model for detection;
[0150] The processing module is used to record the test results of N glass bottles and generate a quality inspection report. If there is an abnormality recorded in the quality inspection report, the corresponding abnormality processing is performed;
[0151] The feedback module is used to optimize the hybrid deep convolutional model according to the feedback information of the quality inspection results.
[0152] Example 3
[0153] Fig.11 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Fig.11 As shown, according to another aspect of the present application, an electronic device 500 is also provided. The electronic device 500 may include one or more processors and one or more memories. The memories store computer readable codes, and when the computer readable codes are run by one or more processors, an intelligent visual detection method can be executed.
[0154] The method or system according to the embodiment of the present application can also be used Fig.11 The electronic device architecture shown in FIG. Fig. 9As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, a read-only memory (ROM) 503, a random access memory (RAM) 504, a communication port 505 connected to a network, an input / output component 506, a hard disk 507, etc. The storage device in the electronic device 500, such as the ROM 503 or the hard disk 507, may store an intelligent visual detection method provided by the present application. An intelligent visual inspection method may, for example, include: obtaining a historical data set, wherein the historical data set is data of n unqualified glass bottles, and n is a positive integer greater than zero; constructing a hybrid deep convolution model, and using the historical data to train the hybrid deep convolution model; designing a numbering system, numbering the N glass bottles, and recording the production process of the N glass bottles, wherein N is a positive integer greater than zero; photographing the N glass bottles in turn from multiple angles to obtain multiple N glass bottle images and preprocessing them, and inputting the images into the hybrid deep convolution model for inspection; recording the inspection results of the N glass bottles, generating a quality inspection report, and if an abnormality is recorded in the quality inspection report, performing corresponding abnormality processing; and optimizing the hybrid deep convolution model based on the feedback information of the quality inspection results. Of course, Fig.11 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Fig.11 One or more components of an electronic device are shown.
[0155] Example 4
[0156] Fig.12 Schematic diagram of a computer-readable storage medium structure provided by an embodiment of the present application. Fig.12 As shown, a computer-readable storage medium 600 according to an embodiment of the present application is shown. Computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by the processor, an intelligent visual detection method according to an embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, for example, a volatile memory and / or a non-volatile memory. Volatile memory may include, for example, a random access memory (RAM) and a cache memory (cache), etc. Non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc.
[0157] The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present application may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers a recording medium storing a program for executing the method according to the present application.
[0158] In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0159] The specific implementation modes as described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An intelligent visual detection method, characterized in that: The steps include: Acquire a historical data set, wherein the historical data set is data of n unqualified glass bottles, and n is a positive integer greater than zero; Constructing a hybrid deep convolutional model, and training the hybrid deep convolutional model using the historical data; Designing a numbering system to number N glass bottles and record the production process of the N glass bottles, wherein N is a positive integer greater than zero; The N glass bottles are photographed at multiple angles in sequence to obtain multiple N glass bottle images and pre-process the images, and the images are input into the hybrid deep convolution model for detection; Record the test results of N glass bottles and generate a quality inspection report. If there are any abnormalities in the quality inspection report, perform corresponding abnormal processing; According to the feedback information of the quality inspection results, the hybrid deep convolutional model is optimized.
2. According to claim 1, an intelligent visual detection method is characterized in that: The step of obtaining the historical data set includes: Obtain glass bottles marked as unqualified in historical quality inspection records; Equipped with high-quality camera equipment, take pictures of n unqualified glass bottles at different angles, distances and lighting conditions, obtain images of unqualified glass bottles and perform pre-processing; Identify the types of unqualified glass bottles that need to be labeled, including cracks, bubbles and defects, and develop detailed labeling standards to ensure consistency and accuracy of labeling; Establish a quality control mechanism for annotation, including spot checks and audits of annotation results, to ensure accuracy and consistency of annotations; The labeled images of unqualified glass bottles form a historical data set.
3. According to claim 1, an intelligent visual detection method is characterized in that: The hybrid deep convolutional model is a mixture of a deep convolutional network and a TransFormer, including an input layer, a convolutional layer, a local perception layer, a deep convolutional network and a TransFormer mixed layer, and an output layer; The input layer receives N images of glass bottles to be detected, preprocesses the images of the N glass bottles to be detected, and obtains X i , where X i is the image of the i-th glass bottle to be detected, 1≤i≤N; The convolution layer extracts the features of the image and performs a convolution operation on the image of the glass bottle to be detected through the convolution kernel. The formula is: Among them, Conv 3×3 (·) represents a 3×3 convolution operation, GeLU(·) represents an activation function, and BN(·) represents a batch normalization function. is the image feature of the i-th glass bottle to be detected extracted by the first convolution layer, for is the i-th glass bottle image feature to be detected extracted by the second convolution layer; The local perception layer uses convolution to extract local information, adopts 3×3 depth separation convolution, and uses residual connection to stabilize the training of hybrid depth convolution model; The hybrid layer of deep convolutional network and TransFormer consists of two layers of normalization, lightweight multi-head attention and reverse residual feedforward network; The output layer outputs the results of glass bottle detection.
4. An intelligent visual detection method according to claim 3, characterized in that: The local perception layer extracts local information by convolution, adopts 3×3 depth separation convolution, and uses residual connection to stabilize the mixed depth convolution model training, including; Where DWConv(·) represents depthwise separable convolution.
5. The intelligent visual detection method according to claim 3, characterized in that: The deep convolutional network and TransFormer hybrid layer consists of a fully connected layer, two layer normalization, a lightweight multi-head attention and a reverse residual feedforward network, including: Among them, LN(·) represents the layer normalization function, LMHSA(·) represents the lightweight multi-head attention function, IRFFN(·) represents the inverse residual feedforward network function, The results of the representation layer normalization function and the lightweight multi-head attention function, Represents the output of a mixed layer of a deep convolutional network and a Transformer.
6. An intelligent visual detection method according to claim 5, characterized in that: The lightweight multi-head attention calculation and reverse residual feedforward network include: The lightweight multi-head attention formula is: LN(·) represents the layer normalization function, FC(·) represents the fully connected function, Q represents the query, K represents the key, and V represents the value; K′=DWConv(K); V′=DWConv(V); Where DWConv(·) represents depthwise separable convolution, K′ is the key after depthwise separable convolution, V′ is the value after depthwise separable convolution, Softmax(·) represents the activation function, and d represents the number of channels; The reverse residual feedforward network formula is: Among them, DWConv(·) represents deep separable convolution, Conv(·) represents convolution, and BN(·) represents batch normalization function.
7. The intelligent visual detection method according to claim 1, characterized in that: The design numbering system is used to number N glass bottles and record the steps of the production process of the N glass bottles, including: Establish numbering rules to ensure that the generated numbers are unique; Add a bar to each glass bottle, containing the number information of the glass bottle; Establish production process records for each glass bottle, including: manufacturing date and time, batch number of raw materials used, use of manufacturing equipment, information of manufacturing personnel, key steps and parameters of each production stage; Store production process information in a professional database.
8. The intelligent visual detection method according to claim 1, characterized in that: The step of obtaining a plurality of N glass bottle images and performing preprocessing includes: Organize the images of each glass bottle into a folder, making sure each folder corresponds to multiple angle images of a glass bottle; For each glass bottle's image folder, batch preprocessing was performed using an image processing library, including resizing, normalization, and denoising; Save the preprocessed images into a new folder, making sure that each multi-angle image of the glass bottle has a corresponding preprocessing result.
9. An intelligent visual inspection system, implemented based on an intelligent visual inspection method according to any one of claims 1 to 8, characterized in that: The system comprises: A module for obtaining a historical data set is used to obtain a historical data set, wherein the historical data set is data of n unqualified glass bottles, and n is a positive integer greater than zero; A hybrid deep convolutional model module, used to construct a hybrid deep convolutional model, and train the hybrid deep convolutional model using the historical data; A numbering module, used to design a numbering system, number N glass bottles, and record the production process of the N glass bottles, wherein N is a positive integer greater than zero; A detection module, used to sequentially photograph the N glass bottles from multiple angles to obtain multiple N glass bottle images and perform preprocessing, and input the images into the hybrid deep convolution model for detection; The processing module is used to record the test results of N glass bottles and generate a quality inspection report. If there is an abnormality recorded in the quality inspection report, the corresponding abnormality processing is performed; The feedback module is used to optimize the hybrid deep convolutional model according to the feedback information of the quality inspection results.
Citation Information
Patent Citations
Transparent container defect detection method and device based on multi-angle and target detection
CN113538417A
Glass bottle defect identification method and system
CN117351314A
