Printer casing defect detection method and device based on deep convolutional neural network
By using deep convolutional neural networks and dynamically routed deep capsule neural networks, the problem of poor detection performance of traditional methods in printer shell inspection is solved, achieving efficient defect recognition for complex shapes and textures, and improving detection accuracy and robustness.
Patent Information
- Application Number
- CN202410782717.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-06-18
AI Technical Summary
Traditional machine vision methods struggle to accurately capture defect information in complex shapes and textures when detecting defects in printer casings, resulting in poor detection performance and high rates of missed or false detections.
A method based on deep convolutional neural networks, combined with adaptive filtering algorithms and dynamic routing deep capsule neural networks, is used to denoise and detect defects in printer shell images. Defect features are extracted through multiple capsule layers and downsampling layers.
The detection model's ability to extract defect features has been improved, enhancing its robustness and detection accuracy, enabling more accurate identification of damage and wear on the printer casing.
Smart Images

Figure CN118351118B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a printer casing defect detection method and device based on a deep convolutional neural network. Background Art
[0002] In printer housing defect detection, traditional machine vision methods often use image recognition technology for defect detection. This method has limitations when facing printer housings with complex shapes and variable surface textures. Since printer housings may have various shapes and textures, traditional machine vision systems find it difficult to accurately capture and analyze defect information in these irregular images, resulting in poor detection results.
[0003] Existing technologies do not have ideal solutions to this problem. Some technologies attempt to use feature extraction and classification algorithms, but due to the diversity and complexity of shell defects, these methods often fail to fully capture the characteristics of the defective area, resulting in a high rate of missed detection or false detection.
[0004] Therefore, there is an urgent need for a technical solution that can enhance the detection model's ability to extract defect features, improve the model's detection accuracy, and enhance the robustness of the detection model. Summary of the invention
[0005] In order to solve the deficiencies of the prior art, the embodiment of the present application provides a printer housing defect detection method and device based on a deep convolutional neural network. The present application solves the technical problems of the existing printer housing defect detection method, such as poor feature extraction capability, low detection accuracy, and low model robustness.
[0006] The embodiment of the present application provides a printer housing defect detection method based on a deep convolutional neural network, comprising: obtaining a printer housing picture; wherein the picture includes an image of the printer housing; using an adaptive filtering algorithm to reduce noise on the printer housing picture to obtain a filtered picture; wherein the filtered picture includes the printer housing information; and using a dynamic routing deep capsule neural network to perform defect detection on the filtered picture to obtain a target result; wherein the deep capsule neural network includes multiple capsule layers and downsampling layers; the capsule layer includes one or more groups of vector neurons; the vector neurons include one or more groups of scalar neurons; the operation process of the vector neurons includes: the first step, multiplying the vector neurons with weights to obtain a prediction vector: ,in, represents the output vector of the i-th lower-layer vector neuron in the capsule layer, represents the weight matrix between the low-level vector neuron i and the high-level vector neuron j, Represents the prediction vector of the low-level vector neuron i to the high-level vector neuron j after weight transformation; in the second step, the prediction vector is weighted and summed by multiplying it with the weight coefficient to obtain the output vector: ,in, represents the connection weight coefficient from the low-level vector neuron i to the high-level vector neuron j, represents the summation symbol of i vector neurons, represents the output vector of the high-level vector neuron j obtained by weighted summation, and the weight coefficient is determined by the dynamic routing algorithm, which transfers the low-level vector features to the corresponding high-level vector neurons. The calculation methods include: , ,in, represents the output vector of high-level vector neuron j, Represents the coupling coefficient of the prior probability between the i-th output vector and the j-th output vector, which is used to calculate and The third step is to input the output vector into a nonlinear activation function to obtain the final output: ,in, Represents the output vector The Euclidean norm of is the modulus of length.
[0007] In a possible implementation, the adaptive filtering algorithm includes: obtaining pixel values of pixel points in a preset area in the printer housing image; filtering the pixel values according to preset rules to obtain regional target values; and changing the preset area to obtain all of the regional target values.
[0008] In one possible implementation, filtering the pixel values according to preset rules to obtain the regional target value includes: sorting the order of the pixel points based on the size of the pixel values; when the number of the pixel points is an even number, selecting the average value of the two pixel points in the middle position as the regional target value; and when the number of the pixel points is an odd number, selecting the value of the pixel point in the middle position as the regional target value.
[0009] In a possible implementation, the preset area includes a pixel area of 3x3 size.
[0010] In a possible implementation, the capsule layer includes one or more capsule cores and bias parameters, wherein the capsule core includes a plurality of neurons with shared parameters.
[0011] In a possible implementation, the size of the capsule core includes 6×6 and 12×12.
[0012] In a possible implementation, the downsampling layer includes a mean dimensionality reduction layer, a weighted summation layer, a bias layer and a nonlinear regression layer, wherein the nonlinear regression layer includes a Sigmoid function.
[0013] In a possible implementation, the training process of the deep capsule neural network includes training based on a dynamic routing algorithm.
[0014] In a possible implementation, the dynamic routing algorithm includes: each output node uses the same weight matrix to extract features from pixels in the window by weight multiplication and accumulation; wherein the operation of the convolution layer in the dynamic routing algorithm includes: ,in, Represented as the output of the jth node of the capsule core, represents the capsule core width, represents the weight from the i-th input node to the j-th output node of the capsule core, represents the input data of the i-th node operation, represents the bias value of the j-th output node, and the network parameter amount of the capsule core is K×K.
[0015] An embodiment of the present application also provides a printer casing defect detection device based on a deep convolutional neural network, comprising: a processor, a memory, and a system bus; wherein the processor and the memory are connected via the system bus; the memory is used to store one or more programs, and the one or more programs include instructions, and when the instructions are executed by the processor, the processor executes any one of the above methods.
[0016] Through the printer housing defect detection method and device based on deep convolutional neural network provided above, the embodiment of the present application can enhance the detection model's ability to extract defect features by introducing filtering to process the image. Further, in some embodiments, the detection accuracy of the model can be improved by setting up multiple capsule layers. Further, in other embodiments, the robustness of the detection model can be enhanced by introducing a dynamic routing algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1A schematic diagram of a flow chart of a printer housing defect detection method based on a deep convolutional neural network provided in an embodiment of the present application;
[0019] Figure 2 A schematic diagram of a vector neuron provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a printer housing defect detection model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present application.
[0022] Those skilled in the art will appreciate that the terms "first", "second" and the like in the embodiments of the present application are only used to distinguish different steps, devices or modules, etc., and do not represent any specific technical meaning, nor do they represent the necessary logical order between them. It should also be understood that in the embodiments of the present application, "multiple" may refer to two or more, and "at least one" may refer to one, two or more. It should also be understood that for any component, data or structure mentioned in the embodiments of the present application, in the absence of explicit limitation or contrary revelation given in the context, it can generally be understood as one or more. In addition, the term "and / or" in the present application is only a kind of association relationship describing the associated objects, indicating that there can be three kinds of relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present application generally indicates that the associated objects before and after are an "or" relationship. It should also be understood that the description of each embodiment in the present application emphasizes the differences between the embodiments, and the same or similar parts can refer to each other. For the sake of brevity, they will not be repeated one by one.
[0023] At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present application and its application or use. The techniques, methods and devices known to ordinary technicians in the relevant fields may not be discussed in detail, but where appropriate, the techniques, methods and devices should be considered part of the specification. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] The present application provides a printer casing defect detection method and device based on a deep convolutional neural network, and more specifically provides a printer casing defect detection method and device based on a deep capsule neural network, which can enhance the detection model's ability to extract defect features, improve the model's detection accuracy, and enhance the robustness of the detection model.
[0026] Figure 1 The present invention provides a flowchart of a printer housing defect detection method based on a deep convolutional neural network. Figure 1 As shown, at step S101, a printer housing image is obtained, wherein the image includes an image of the printer housing. First, it should be clarified that the image of the printer housing refers to an image or photo including the printer housing. The printer housing generally refers to an external protective cover or housing covering the outside of the internal mechanical structure of the printer, which is used to protect the internal mechanical parts, electronic components and provide an aesthetically pleasing external part. The printer housing image can be used to detect and analyze defects, damage or wear on the surface of the housing.
[0027] Furthermore, it is necessary to explain that the printer housing pictures may have various forms and sources. These pictures may be real-time images acquired by a camera, scanner or other image acquisition device, or digital image files stored in a database or cloud server. In addition, the printer housing pictures may include multiple images at different viewing angles and different lighting conditions to fully display the various parts and details of the printer housing.
[0028] return Figure 1 In step S102, the printer housing image is subjected to noise reduction using an adaptive filtering algorithm to obtain a filtered image, wherein the filtered image contains edge information of the printer housing. Specifically, a filtering algorithm is a specific digital image processing technology that aims to reduce noise and enhance image features by filtering an image, and can be optimized for specific application scenarios. In the present application, an adaptive filtering algorithm is used to perform noise reduction on the printer housing image to improve image quality and highlight the edge information of the housing.
[0029] Secondly, the adaptive filtering algorithm can be Gaussian filtering, median filtering, etc. to achieve the effect of noise reduction. The adaptive filtering algorithm is predetermined and designed for the image noise and edge information of the printer housing type, and its parameter setting meets the actual needs. The filtered image refers to the image processed by the adaptive filtering algorithm, in which the edge information of the printer housing is retained and the noise is effectively reduced. These edge information can help identify the outline, structural features and design details of the housing, which is helpful for subsequent image analysis, feature extraction and pattern recognition.
[0030] In one embodiment, the printer housing image is filtered, and the noise thereof may be filtered using a median filter. First, the pixel values of the pixels in a preset area of the printer housing image are obtained. The pixel values are filtered according to preset rules to obtain a regional target value. Specifically, the order of the pixels is sorted based on the size of the pixel values; when the number of the pixels is an even number, the average value of the two pixels in the middle position is selected as the regional target value; and when the number of the pixels is an odd number, the value of the pixel in the middle position is selected as the regional target value.
[0031] In another embodiment, a capsule network may be used to obtain the target value. Specifically, based on the size of the pixel value, the low-level vector feature It needs to be passed to the appropriate high-level vector neuron through a dynamic routing algorithm The capsule network will predict the lower layers close to Gathering at the top In a cluster, the prediction deviation will be far away from this cluster, and the weight will be automatically adjusted through the dynamic routing mechanism. . The meaning of is clustering. Then the preset area is changed to obtain all the regional target values. The preset area includes a pixel area of 3×3 size.
[0032] return Figure 1 In step S103, a dynamic routed deep capsule neural network is used to perform defect detection on the filtered image to obtain a target result; wherein the deep capsule neural network includes a plurality of capsule layers and a downsampling layer; the capsule layer includes one or more groups of vector neurons; the vector neurons include one or more groups of scalar neurons; the operation process of the vector neurons includes:
[0033] The first step is to multiply the vector neuron by the weight to get the prediction vector:
[0034] ,
[0035] in, Represents the output vector of the i-th low-level vector neuron in the capsule layer. This is the representation of the input data after it is processed by the previous layer of the network, and usually contains some features of the input data. Represents the weight matrix between the low-level vector neuron i and the high-level vector neuron j. This weight matrix is learnable and is used to adjust the information passed to the next layer. Represents the prediction vector of the low-level vector neuron i to the high-level vector neuron j after weight transformation, which is obtained by multiplying the i-th output vector with a specific weight matrix.
[0036] In the second step, the prediction vector is weighted and summed by multiplying it with the weight coefficient to obtain the output vector:
[0037] ,
[0038] in, represents the connection weight coefficient from the low-level vector neuron i to the high-level vector neuron j, represents the output vector of the high-level vector neuron j obtained by weighted summation. This vector is obtained by weighted summation of the prediction vectors of all relevant vector neurons and the corresponding weight coefficients. Represents the summation symbol for i, where i represents different vector neurons. In the capsule network, The computation of depends on the contributions of multiple input capsules, where each contribution is represented by the corresponding prediction vector and routing weight This mechanism enables the network to learn the mapping of parts to the whole of features at multiple levels, thereby improving the model's ability to identify important features.
[0039] The weight coefficient is determined by a dynamic routing algorithm, which transfers low-level vector features to corresponding high-level vector neurons to determine the contribution of each input capsule to the output capsule. The calculation methods include:
[0040] ,
[0041] ,
[0042] in, represents the output vector of the high-level vector neuron j, which is the result of weight adjustment and aggregation of the prediction vectors of all input capsules. Represents the coupling coefficient of the prior probability between the i-th output vector and the j-th output vector, which is used to calculate and It is used for weight adjustment in the dynamic routing process. Initially, it can be set to 0 or a small random value to indicate no prior preference. The larger the value, the greater the contribution of the i-th capsule to the j-th capsule.
[0043] In the dynamic routing algorithm of capsule network, by updating value to iterate repeatedly to optimize This ensures that the network can transmit information more effectively and enhances the network's ability to learn and represent features.
[0044] The third step is to input the output vector into a nonlinear activation function to obtain the final output:
[0045] ,
[0046] in, Represents the output vector The Euclidean norm of . In this formula, The calculation of is divided into two parts. First, a scalar factor is calculated , this factor increases with The modulus increases with the increase of the modulus length, but the growth rate gradually slows down to prevent the modulus length from being too large. Divide by its modulus , so that the output vector The goal of this manipulation is to maintain the direction of the vector while controlling its magnitude to emphasize the most important features.
[0047] This activation function processing ensures that the length (amplitude) of the output vector can represent a certain probability or existence, while maintaining the directionality of the output data. This processing method helps the network to more effectively retain and transmit important spatial level information when performing deep feature recognition.
[0048] In one implementation scenario, a deep capsule neural network is used to perform defect detection on the filtered image to obtain a target result; wherein the deep capsule neural network includes one or more capsule layers and downsampling layers, and when the number of capsule layers is greater than a target threshold, one or more dynamic routing algorithms are included between two capsule layers, and the calculation of the attention score in the dynamic routing algorithm includes: ,in, Indicates multiple granularity sizes, which can be 3, 5, and 7. Represents preset multi-granularity information, and its value is related to the amount of information after segmentation based on the aforementioned multi-granularity size.
[0049] In combination with the above-mentioned embodiments, specifically, in the printer housing defect detection task, the following steps can be used to construct a deep capsule neural network:
[0050] First, define the input layer and use the filtered image as the input of the network. This input layer can accept multi-channel image data to capture richer feature information.
[0051] Next, one or more capsule layers are constructed. Each capsule layer consists of multiple capsule cores, which are used to extract local features in the image. Through capsule operations, capsule cores can be slid at different positions to calculate the local feature response of the image. These capsule cores can learn features of different scales and directions, thereby better capturing defect information in the image.
[0052] Finally, the feature map after a series of capsule and downsampling operations is input into the fully connected layer for further processing and classification. The fully connected layer can learn feature representations of different categories, thereby achieving defect classification and location.
[0053] Through the above steps, the deep capsule neural network can effectively detect defects in filtered images. The network can automatically learn features and optimize parameters through training data, thereby achieving accurate detection and identification of different types of defects.
[0054] The following will be combined Figure 2 and Figure 3 To further explain the architecture of the printer housing defect detection model, it is important to understand that: Figure 2 and Figure 3 The following figure shows the exemplary architecture of the printer casing defect detection model. These images are intended to illustrate the components and working principles of the model, and are not specific restrictions on the model structure. In these two figures, the main components of the model are shown, including the input layer, capsule layer, downsampling layer, dynamic routing algorithm, and fully connected layer.
[0055] Figure 2 A schematic diagram of a vector neuron provided in an embodiment of the present application. It should be noted that the capsule layer is composed of vector neurons, which are a group of vector neurons composed of scalar neurons. Capsule neurons encode input data to obtain output vectors. These vectors can represent multiple attributes of an image or object, such as the position, direction, and size of spots in an image, the texture, hue, phase, and frequency distribution of scratches in an image, etc. Figure 2 As shown in the figure, the vector neuron takes a vector as input, weights the input vector with a weight matrix to obtain a new input vector, then inputs the weighted vector into the activation function, and finally the activation function outputs a vector.
[0056] Figure 3A schematic diagram of a printer housing defect detection model provided in an embodiment of the present application. Figure 3 As shown, the model may include one or more capsule layers and downsampling layers, wherein the capsule layer includes one or more capsule cores and bias parameters. The capsule core includes a parameter-sharing capsule core. The downsampling layer includes: a mean dimensionality reduction layer, a weighted sum layer, a bias layer and a nonlinear regression layer, wherein the nonlinear regression layer includes a Sigmoid function.
[0057] It is important to understand that the capsule layer is a key component in a deep neural network that is used to extract features from an input image. The capsule layer consists of one or more capsule kernels and bias parameters. These capsule kernels can be viewed as a set of filters that capture local features in an image by performing capsule operations on the input image. Among them, parameter-sharing capsule kernels means that the same capsule kernel performs capsule calculations at different locations to effectively extract local features of the image. The size of the capsule kernel determines the size of the receptive field of the capsule operation, that is, the size of the input image region that each capsule kernel focuses on. Here, the sizes of the capsule kernels are 6×6 and 12×12, indicating that two different sizes of capsule kernels are used to capture features of different scales at the same time. Through capsule operations, the model can identify features such as edges and textures in the image, thereby learning and representing local information of the printer housing.
[0058] In one implementation scenario, when the number of capsule layers reaches the target threshold, a dynamic routing algorithm can be added between capsule layers to fuse deep features. The dynamic routing algorithm plays an important role in guiding the network to focus on key areas in the model. It can dynamically adjust weights according to feature information at different scales to enhance the perception of defective areas of the printer casing.
[0059] The training process of the deep capsule neural network includes training based on a dynamic routing algorithm.
[0060] It should be understood that the dynamic routing algorithm is a structural design that aims to improve the neural network's ability to focus on features of different scales. In deep learning models, as the number of capsule layers increases, the network may face challenges such as information loss and feature sparsity. In order to effectively fuse feature information of different scales and enhance the network's perception of specific areas, introducing a dynamic routing algorithm between capsule layers is an effective solution.
[0061] In an embodiment of the application, the dynamic routing algorithm includes: each output node uses the same weight matrix to extract features from pixels in the window by weight multiplication and accumulation; wherein the operation of the convolution layer in the dynamic routing algorithm includes:
[0062] ,
[0063] in, Represented as the output of the jth node of the capsule core, represents the capsule core width, represents the weight from the i-th input node to the j-th output node of the capsule core, represents the input data of the i-th node generation operation, represents the bias value of the j-th output node, and the network parameter amount of the capsule core is K×K.
[0064] This formula represents the accumulation of all input nodes from 1 to K-1. The data of each input node is multiplied by the corresponding weight, then all are added together, and finally the bias value is added. Here K×K represents the total number of parameters of each capsule core, including all weights and biases, so each output node is calculated through the same weight matrix (shared weights) and different input node data, which helps the model maintain consistency when processing similar features at different positions. This weight sharing mechanism enables the network to effectively reduce the number of parameters while enhancing the model's robustness to changes in feature positions in the input data.
[0065] Specifically, the dynamic routing algorithm dynamically adjusts the weights of features of different scales at various locations, allowing the network to better focus on key areas and accurately capture the details of the target object. This mechanism is similar to the way the human visual system adjusts its attention according to the different distances and sizes of the object when observing an object in order to more fully understand the overall scene. In the application of printer casing defect detection tasks, the introduction of the dynamic routing algorithm can help the neural network more effectively identify defective areas on the casing. By dynamically adjusting the weights of features of different scales, the network can more accurately capture the location, shape, and detail features of the defect, thereby improving detection accuracy and robustness.
[0066] Specifically, when designing a dynamic routing algorithm, the specific model parameter settings have an important impact on network performance and efficiency. The following describes the settings of these model parameters in combination with specific numerical values in an embodiment.
[0067] The input of the dynamic routing algorithm is a multi-granularity feature map size, the input feature tensor The size is ,in , , . Set two scale levels, the first level feature map size is , the second level feature map size is Then set the feature map depth, where the first level feature map depth can be , the second level feature map depth Finally, the dimensions of the query, key, and value capsule kernels are calculated and set to the square root of the feature depth, i.e. , The attention weight can be normalized by using the softmax function, and the regularization strategy can be L2 regularization.
[0068] Combination of the above Figure 2 and Figure 3 The design of the model architecture has been explained, and the model training process will be further described next. It should be understood that the training process of the deep capsule neural network is to optimize the model by continuously adjusting the network parameters to minimize the loss function. Among them, the back propagation algorithm is a commonly used optimization method, which calculates the gradient and updates the parameters in the opposite direction of the gradient so that the network gradually converges to the optimal solution.
[0069] Specifically, the dynamic routing algorithm includes the following steps: calculating the intra-class similarity metric : This metric is used to measure the similarity between samples in the same category, and its calculation formula is: ,in represents the network output based on the dynamic routing algorithm, Indicates The first in the category samples, represents the center of the category, Intra-class similarity metric is used to measure the similarity between samples in the same category. This is a summation symbol, which means to add up all categories (from 1 to m). This is an inner sum symbol, which means to add up all samples (from 1 to n) in the same category. Represents the network output function based on the dynamic routing algorithm, where w and b are the weight and bias of the network respectively, and Fisher can be a special regularization or optimization technique used by the network. Represents the input data of the jth sample in the i-th class. Represents the center of the i-th class of samples, which is usually determined by averaging the features of all samples in this class. Represents the square of the Euclidean norm, which is used to calculate the square of the distance between two vectors. Constant coefficient used to adjust the scale of the summation result.
[0070] Compute inter-class similarity measure : This metric is used to measure the distance between the centers of different categories. The calculation formula is: ,in and Represent two different categories of central capsule cores, Inter-class similarity metric is used to measure the distance between the centers of different classes. Indicates the accumulation of all categories. This is an inner summation symbol, which means that the centers of all different categories from i+1 to n are accumulated to ensure that the comparisons between categories are not repeated. and Represent the center capsule cores of different categories i and j respectively. These centers are the representative feature vectors of their respective categories. Same as above, representing the square of the Euclidean norm.
[0071] These two metrics provide quantification of intra-class closeness and inter-class separation, and are important tools for evaluating classifier performance. Focus on consistency within the same category, while Focusing on the distinction between different categories, these metrics help adjust and optimize the parameters of the classification model to improve the generalization ability and classification accuracy of the model.
[0072] As a feature extractor based on the principle of deep learning, capsule neural network can capture the local features of the data and perform weighted fusion of features at different levels, so that the model pays more attention to important features, thereby improving the ability of feature expression.
[0073] In summary, there are many advantages to combining capsules with dynamic routing algorithms. This combination can make full use of multi-scale feature information to improve the model's discriminative performance and classification accuracy. The dynamic routing algorithm can more effectively optimize the deep capsule neural network and improve the model's discriminative and generalization capabilities. This dynamic routing algorithm shows good performance when processing complex data sets and classification problems, and helps improve the training effect of deep learning models.
[0074] Furthermore, an embodiment of the present application also provides a printer casing defect detection device based on a deep convolutional neural network, comprising: a processor, a memory, and a system bus; the processor and the memory are connected via the system bus; the memory is used to store one or more programs, and the one or more programs include instructions, which, when executed by the processor, enable the processor to execute any one of the implementation methods of the above method.
[0075] Furthermore, an embodiment of the present application also provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any one of the implementation methods of the above method.
[0076] It can be known from the description of the above implementation mode that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0077] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0078] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0079] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A printer housing defect detection method based on a deep convolutional neural network, characterized in that: include: Obtain a printer housing picture; wherein the picture includes an image of the printer housing; Using an adaptive filtering algorithm to reduce noise on the printer housing image to obtain a filtered image; wherein the filtered image contains the printer housing information; and Perform defect detection on the filtered image using a dynamic routing deep capsule neural network to obtain a target result; The input of the dynamic routing algorithm is a multi-granularity feature map; The deep capsule neural network includes one or more capsule layers and downsampling layers. When the number of capsule layers is greater than a target threshold, one or more dynamic routing algorithms are included between two capsule layers. The calculation of the attention score in the dynamic routing algorithm includes: ,in, Indicates multiple granularity sizes, with values of 3, 5 and 7. Represents preset multi-granularity information; wherein the input of the dynamic routing algorithm is a multi-granularity feature map, which includes setting two scale levels, and the size of the first level feature map is , the second level feature map size is ; The dynamic routing algorithm comprises the following steps: Compute the intra-class similarity measure: ,in represents the network output based on the dynamic routing algorithm, Indicates The first in the category samples, represents the center of the category, It means to accumulate all categories (from 1 to m). represents the accumulation of all samples in the same category (from 1 to n), w and b represent the weight and bias of the network respectively, Fisher represents a special regularization or optimization technique used by the network, represents the square of the Euclidean norm; Compute the inter-class similarity measure: ,in and Represent two different categories of central capsule cores, Indicates the accumulation of all categories. It means that the centers of all different categories from i+1 to n are accumulated. and Represent the central capsule cores of different categories i and j respectively, represents the square of the Euclidean norm; The deep capsule neural network includes multiple capsule layers and downsampling layers; the capsule layer includes one or more groups of vector neurons; the vector neurons include one or more groups of scalar neurons; the operation process of the vector neurons includes: The first step is to multiply the vector neuron by the weight to get the prediction vector: , in, represents the output vector of the i-th lower-layer vector neuron in the capsule layer, represents the weight matrix between the low-level vector neuron i and the high-level vector neuron j, Represents the prediction vector from low-level vector neuron i to high-level vector neuron j after weight transformation; In the second step, the prediction vector is weighted and summed by multiplying it with the weight coefficient to obtain the output vector: , in, represents the connection weight coefficient from the low-level vector neuron i to the high-level vector neuron j, represents the summation symbol of i vector neurons, represents the output vector of the high-level vector neuron j obtained by weighted summation, and the weight coefficient is determined by the dynamic routing algorithm, which transfers the low-level vector features to the corresponding high-level vector neurons. The calculation methods include: , , in, represents the output vector of high-level vector neuron j, Represents the coupling coefficient of the prior probability between the i-th output vector and the j-th output vector, which is used to calculate and relevance; The third step is to input the output vector into a nonlinear activation function to obtain the final output: , in, Represents the output vector The Euclidean norm of is the modulus of length.
2. The method according to claim 1, characterized in that in, The adaptive filtering algorithm comprises: Obtain pixel values of pixel points in a preset area of the printer housing image; Filter the pixel values according to preset rules to obtain a regional target value; and The preset area is changed to obtain all the area target values.
3. The method according to claim 2, characterized in that in, Filtering the pixel values according to preset rules to obtain the regional target value includes: Sorting the order of the pixel points based on the size of the pixel values; When the number of the pixel points is an even number, selecting an average value of two pixel points at a middle position as the regional target value; and When the number of the pixel points is an odd number, the value of the pixel point at the middle position is selected as the area target value.
4. The method according to claim 2, characterized in that: in, The preset area includes a pixel area of 3x3 size.
5. The method according to claim 1, characterized in that in, The capsule layer includes one or more capsule cores and bias parameters, wherein the capsule core includes a plurality of neurons with shared parameters.
6. The method according to claim 5, characterized in that in, The sizes of the capsule core include 6×6 and 12×12.
7. The method according to claim 1, characterized in that in, The downsampling layer includes a mean dimension reduction layer, a weighted summation layer, a bias layer and a nonlinear regression layer; the nonlinear regression layer includes a Sigmoid function.
8. The method according to claim 1, characterized in that: The training process of the deep capsule neural network includes training based on a dynamic routing algorithm.
9. The method according to claim 8, characterized in that in, The dynamic routing algorithm includes: Each output node uses the same weight matrix to extract features from pixels in the window by weight multiplication and accumulation; wherein the operation of the convolution layer in the dynamic routing algorithm includes: , in, Represented as the output of the jth node of the capsule core, represents the capsule core width, represents the weight from the i-th input node to the j-th output node of the capsule core, represents the input data of the i-th node operation, represents the bias value of the j-th output node, and the network parameter amount of the capsule core is K×K.
10. A printer housing defect detection device based on a deep convolutional neural network, characterized in that: include: A processor, a memory, and a system bus; wherein the processor and the memory are connected via the system bus; The memory is used to store one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 9.
