Rubber seal automatic production line and method thereof
The acquisition of rubber seal images through industrial cameras and automated inspections using deep learning technology, solving the problems of low efficiency and inconsistency in traditional manual detection, achieving accurate identification of complex defects and efficient quality inspection in mass production.
Patent Information
- Application Number
- CN202410885747.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-07-03
AI Technical Summary
Traditional rubber seal production methods rely on manual testing, which has problems of inconsistency and low efficiency, especially in large-scale production, which is difficult to accurately identify complex defects such as tiny bubbles and fine scratches.
Industrial cameras are used to collect product images, and automated quality inspection is performed through image enhancement based on contrast normalization, multi-level feature extraction, collaborative attention module and feature multi-scale focus fusion processing, combined with deep learning classifier generators.
Automatic detection and identification of rubber seal defects is realized, the intelligent level of the production line is improved, and detection errors caused by human factors are reduced.
Smart Images

Figure CN118688206B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated production, and in particular to an automated production line for rubber seals and a method thereof. Background Art
[0002] Rubber seals are widely used in many fields such as automobiles, aerospace, construction, electronics and industrial production. Their function is to provide sealing between connected parts, prevent liquid or gas leakage, and ensure the normal operation and safety of equipment. However, due to the complex manufacturing process of rubber seals, product quality is often affected by many factors, such as raw material quality, production process, human operation, etc., resulting in defects such as bubbles, scratches, and inconsistent dimensions. Therefore, effective product quality testing of manufactured rubber seals is required during the production process of rubber seals.
[0003] However, traditional rubber seal production methods often rely on manual product quality testing, and the test results are easily affected by individual subjective factors. Different inspectors may have different judgment criteria, resulting in inconsistent test results. In addition, the level of intelligence of manual visual inspection is low, and it takes a lot of manpower and time. Especially for mass production, manual inspection efficiency is very low and cannot meet the needs of rapid production. In addition, rubber seals may have various complex defects, such as tiny bubbles, fine scratches, etc. It is difficult for manual visual inspection to accurately identify and classify these complex defects.
[0004] Therefore, an optimized rubber seal production solution is desired. Summary of the invention
[0005] This application is made in view of the above problems. One object of this application is to provide an automated production line for rubber seals and a method thereof.
[0006] An embodiment of the present application provides an automated production method for a rubber seal, which comprises:
[0007] Acquire a product surface image of the rubber seal to be inspected captured by an industrial camera;
[0008] Performing image enhancement based on contrast normalization on the product surface image of the rubber seal to be inspected to obtain an enhanced surface image of the rubber seal;
[0009] Performing multi-level feature extraction based on the appearance of the rubber seal on the surface image of the enhanced rubber seal to obtain a rubber seal surface shallow feature map and a rubber seal surface deep feature map;
[0010] Inputting the rubber seal apparent shallow feature map and the rubber seal apparent deep feature map into a collaborative attention module to obtain a collaborative attention rubber seal apparent shallow feature map and a collaborative attention rubber seal apparent deep feature map;
[0011] Performing feature enhancement fusion processing based on feature multi-scale focusing and balanced threshold mechanism on the collaboratively focused rubber seal surface shallow feature map and the collaboratively focused rubber seal surface deep feature map to obtain a rubber seal surface multi-scale focusing fusion feature vector;
[0012] The rubber seal surface multi-scale focused fusion feature vector is input into a quality inspection result generator based on a classifier to obtain a quality inspection result, and the quality inspection result is used to indicate whether the rubber seal to be inspected has defects.
[0013] For example, according to the automated production method of rubber seals of the embodiment of the present application, the enhanced rubber seal surface image is subjected to multi-level feature extraction based on the appearance of the rubber seal to obtain a rubber seal surface shallow feature map and a rubber seal surface deep feature map, including:
[0014] The enhanced rubber seal surface image is input into an appearance multi-scale feature extractor based on a hollow pyramid network to obtain the rubber seal surface shallow feature map and the rubber seal surface deep feature map.
[0015] For example, according to the automated production method of rubber seals of an embodiment of the present application, the rubber seal apparent shallow feature map and the rubber seal apparent deep feature map are input into a collaborative attention module to obtain a collaborative attention rubber seal apparent shallow feature map and a collaborative attention rubber seal apparent deep feature map, including:
[0016] Reshape the rubber seal component appearance deep feature map and the rubber seal component appearance shallow feature map to obtain a rubber seal component appearance semantic feature matrix and a rubber seal component appearance shallow feature matrix;
[0017] Performing global mean pooling along the channel dimension on the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map to obtain a rubber seal apparent semantic full-channel feature vector and a rubber seal apparent shallow full-channel feature vector;
[0018] Calculating the product between the transposed matrix of the rubber seal apparent semantic feature matrix and the rubber seal apparent shallow feature matrix to obtain a rubber seal apparent full-channel feature similarity matrix between the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map;
[0019] Normalizing the rubber seal component apparent full-channel feature similarity matrix to obtain a normalized rubber seal component apparent full-channel feature similarity matrix;
[0020] Calculating the matrix product between the normalized rubber seal appearance full-channel feature similarity matrix and the rubber seal appearance semantic full-channel feature vector to obtain the rubber seal appearance semantic collaborative attention weight vector;
[0021] Calculating the matrix product between the normalized rubber seal apparent full-channel feature similarity matrix and the rubber seal apparent shallow full-channel feature vector to obtain the rubber seal apparent shallow collaborative attention weight vector;
[0022] The rubber seal apparent semantic collaborative attention weight vector and the rubber seal apparent shallow collaborative attention weight vector are used as weight vectors to weight the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map respectively to obtain the collaboratively attended rubber seal apparent deep feature map and the collaboratively attended rubber seal apparent shallow feature map.
[0023] For example, according to the automated production method of rubber seals of an embodiment of the present application, the rubber seal apparent full-channel feature similarity matrix is normalized to obtain a normalized rubber seal apparent full-channel feature similarity matrix, including:
[0024] Taking each eigenvalue in the rubber seal component apparent full-channel feature similarity matrix as an exponent of a natural constant to calculate an exponential function value based on the natural constant according to position to obtain a rubber seal component apparent full-channel feature similarity class support matrix;
[0025] Calculating the sum of each column vector in the rubber seal component apparent full-channel feature similarity class support matrix to obtain a rubber seal component apparent full-channel feature similarity class support column global vector composed of multiple column vector global sum values;
[0026] The positional division between each eigenvalue in the rubber seal apparent full-channel feature similarity class support matrix and the corresponding column vector global sum value in the rubber seal apparent full-channel feature similarity class support column global vector is calculated to obtain the normalized rubber seal apparent full-channel feature similarity matrix.
[0027] For example, according to the automated production method for rubber seals of an embodiment of the present application, the collaboratively focused rubber seal apparent shallow feature map and the collaboratively focused rubber seal apparent deep feature map are subjected to feature enhancement fusion processing based on feature multi-scale focusing and balanced threshold mechanism to obtain the rubber seal apparent multi-scale focusing fusion feature vector, including:
[0028] Inputting the collaboratively focused rubber seal apparent shallow feature map and the collaboratively focused rubber seal apparent deep feature map into a feature multi-scale focusing module to obtain a collaboratively focused rubber seal apparent shallow focused feature vector and a collaboratively focused rubber seal apparent deep focused feature vector;
[0029] The collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector are input into an equalization threshold feature vector adaptive fusion module to obtain the rubber seal apparent multi-scale focus fusion feature vector.
[0030] For example, according to the automated production method of rubber seals of an embodiment of the present application, the collaborative attention to the rubber seal apparent shallow feature map and the collaborative attention to the rubber seal apparent deep feature map are input into a feature multi-scale focusing module to obtain a collaborative attention to the rubber seal apparent shallow focus feature vector and a collaborative attention to the rubber seal apparent deep focus feature vector, including:
[0031] Upsampling the collaboratively focused rubber seal apparent shallow feature map to obtain an upsampled collaboratively focused rubber seal apparent shallow feature map;
[0032] Performing global mean pooling processing on each feature matrix along the channel dimension in the up-sampled collaboratively focused rubber seal apparent shallow feature map to obtain an up-sampled collaboratively focused rubber seal apparent shallow flow channel feature vector;
[0033] Performing point convolution encoding on the upsampled collaboratively focused rubber seal apparent shallow channel feature vector to obtain a collaboratively focused rubber seal global apparent shallow feature vector;
[0034] Performing point convolution encoding on the up-sampled collaboratively focused rubber seal apparent shallow feature map to obtain a channel modulated up-sampled collaboratively focused rubber seal apparent shallow feature map;
[0035] Performing two-dimensional convolution encoding on the channel modulated up-sampled collaboratively focused rubber seal apparent shallow feature map to obtain a collaboratively focused rubber seal local apparent shallow feature vector;
[0036] The global apparent shallow feature vector of the collaboratively focused rubber seal and the local apparent shallow feature vector of the collaboratively focused rubber seal are fused to obtain the apparent shallow focused feature vector of the collaboratively focused rubber seal.
[0037] For example, according to the automated production method of rubber seals of an embodiment of the present application, the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector are input into an adaptive fusion module of a balanced threshold feature vector to obtain the rubber seal apparent multi-scale focus fusion feature vector, including:
[0038] Cascading the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector to obtain a first rubber seal apparent multi-level correlation feature vector;
[0039] After calculating the matrix multiplication of the first rubber seal apparent multi-level correlation feature vector and the first transformation matrix, the obtained feature vector is added to the first bias vector by position to obtain the first linear transformation rubber seal apparent multi-level correlation feature vector;
[0040] use The activation function activates the first linear transformation rubber seal apparent multi-level correlation feature vector to obtain a first activated linear transformation rubber seal apparent multi-level correlation feature vector;
[0041] Adding the apparent shallow focus feature vector of the collaboratively concerned rubber seal and the apparent deep focus feature vector of the collaboratively concerned rubber seal by position to obtain a second rubber seal apparent multi-level correlation feature vector;
[0042] After calculating the matrix multiplication of the second rubber seal apparent multi-level correlation feature vector and the second transformation matrix, the obtained feature vector is added to the second bias vector by position to obtain the second linear transformation rubber seal apparent multi-level correlation feature vector;
[0043] use The activation function activates the second linear transformation rubber seal apparent multi-level correlation feature vector to obtain a second activated linear transformation rubber seal apparent multi-level correlation feature vector;
[0044] Multiplying the apparent shallow focus feature vector of the collaboratively concerned rubber seal and the apparent deep focus feature vector of the collaboratively concerned rubber seal by position points to obtain a third apparent multi-level correlation feature vector of the rubber seal;
[0045] After calculating the matrix multiplication of the third rubber seal apparent multi-level correlation feature vector and the third transformation matrix, the obtained feature vector is added to the third bias vector by position to obtain a third linear transformation rubber seal apparent multi-level correlation feature vector;
[0046] use The activation function activates the third linear transformation rubber seal apparent multi-level correlation feature vector to obtain a third activated linear transformation rubber seal apparent multi-level correlation feature vector;
[0047] Taking the respective position feature values in the first activated linear transformation rubber seal apparent multi-level associated feature vector as the first threshold value, taking the respective position feature values in the second activated linear transformation rubber seal apparent multi-level associated feature vector as the second threshold value, taking the respective position feature values in the third activated linear transformation rubber seal apparent multi-level associated feature vector as the third threshold value, the weighted sum of the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector is calculated to obtain the rubber seal apparent multi-scale focused fusion feature vector.
[0048] For example, according to the automated production method of rubber seals of the embodiment of the present application, each position feature value in the first activated linear transformation rubber seal apparent multi-level associated feature vector is used as a first threshold value, each position feature value in the second activated linear transformation rubber seal apparent multi-level associated feature vector is used as a second threshold value, and each position feature value in the third activated linear transformation rubber seal apparent multi-level associated feature vector is used as a third threshold value, and the weighted sum of the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector is calculated to obtain the rubber seal apparent multi-scale focused fusion feature vector, including:
[0049] Calculating the average of the first threshold value, the second threshold value and the third threshold value to obtain a threshold average;
[0050] Calculate the product of the feature value of each position in the collaborative attention rubber seal apparent shallow focus feature vector and one minus the threshold mean to obtain a weighted collaborative attention rubber seal apparent shallow focus feature vector;
[0051] Calculate the product of the feature value of each position in the collaborative attention rubber seal apparent deep focusing feature vector and the threshold mean to obtain a weighted collaborative attention rubber seal apparent deep focusing feature vector;
[0052] The weighted item collaboratively focusing on the rubber seal apparent shallow focus feature vector and the weighted item collaboratively focusing on the rubber seal apparent deep focus feature vector are added by position to obtain the rubber seal apparent multi-scale focusing fusion feature vector.
[0053] For example, according to the automated production method of rubber seals of the embodiment of the present application, it also includes a training step: for training the appearance multi-scale feature extractor based on the hollow pyramid network, the collaborative attention module, the feature multi-scale focusing module, the balanced threshold feature vector adaptive fusion module and the classifier-based quality inspection result generator;
[0054] Wherein, the training step includes:
[0055] Acquire training data, wherein the training data includes training product appearance images of the rubber seal to be inspected collected by an industrial camera and actual quality inspection results;
[0056] Performing image enhancement based on contrast normalization on the training product appearance image of the rubber seal to be inspected to obtain a training enhanced rubber seal appearance image;
[0057] Inputting the training enhanced rubber seal surface image into the appearance multi-scale feature extractor based on the hollow pyramid network to obtain a training rubber seal surface shallow feature map and a training rubber seal surface deep feature map;
[0058] Inputting the training rubber seal apparent shallow feature map and the training rubber seal apparent deep feature map into the collaborative attention module to obtain the training collaborative attention rubber seal apparent shallow feature map and the training collaborative attention rubber seal apparent deep feature map;
[0059] Inputting the training collaborative attention rubber seal apparent shallow feature map and the training collaborative attention rubber seal apparent deep feature map into the feature multi-scale focusing module to obtain the training collaborative attention rubber seal apparent shallow focusing feature vector and the training collaborative attention rubber seal apparent deep focusing feature vector;
[0060] Inputting the training collaborative attention rubber seal apparent shallow focus feature vector and the training collaborative attention rubber seal apparent deep focus feature vector into the balanced threshold feature vector adaptive fusion module to obtain the training rubber seal apparent multi-scale focus fusion feature vector;
[0061] Inputting the training rubber seal surface multi-scale focused fusion feature vector into the classifier-based quality inspection result generator to obtain a training quality inspection result;
[0062] Calculating a cross entropy loss function value between the training quality inspection result and the real quality inspection result to obtain a classification loss function value;
[0063] Based on the classification loss function value, the appearance multi-scale feature extractor based on the hollow pyramid network, the collaborative attention module, the feature multi-scale focusing module, the balanced threshold feature vector adaptive fusion module and the classifier-based quality inspection result generator are trained.
[0064] The embodiment of the present application also provides an automated production line for rubber seals, which comprises:
[0065] An image acquisition module, used for acquiring a product surface image of the rubber seal to be inspected acquired by an industrial camera;
[0066] An image enhancement module, used for performing image enhancement based on contrast normalization on the product surface image of the rubber seal to be inspected to obtain an enhanced surface image of the rubber seal;
[0067] A multi-level feature extraction module, used for performing multi-level feature extraction based on the appearance of the rubber seal on the surface image of the enhanced rubber seal to obtain a rubber seal surface shallow feature map and a rubber seal surface deep feature map;
[0068] An attention module, used for inputting the rubber seal surface superficial feature map and the rubber seal surface deep feature map into a collaborative attention module to obtain a collaborative attention rubber seal surface superficial feature map and a collaborative attention rubber seal surface deep feature map;
[0069] A feature enhancement fusion module is used to perform feature enhancement fusion processing on the collaboratively focused rubber seal surface shallow feature map and the collaboratively focused rubber seal surface deep feature map based on feature multi-scale focusing and balanced threshold mechanism to obtain a rubber seal surface multi-scale focusing fusion feature vector;
[0070] The quality inspection result generating module is used to input the rubber seal surface multi-scale focused fusion feature vector into the classifier-based quality inspection result generator to obtain a quality inspection result, and the quality inspection result is used to indicate whether the rubber seal to be inspected has defects.
[0071] According to the rubber seal automated production line and method of the embodiment of the present application, it collects images of the rubber seal products to be inspected to obtain product surface images, and introduces image processing and analysis algorithms based on artificial intelligence and deep learning at the back end to analyze the product surface images, so as to learn and capture the surface multi-scale focusing features of the rubber seals to be inspected, thereby automatically detecting and identifying the defects of the rubber seals to be inspected. In this way, it is possible to realize automatic quality inspection of rubber seal products during the production process of rubber seals, thereby improving the intelligence level of the rubber seal production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings of the embodiments of the present application are briefly introduced below. Obviously, the drawings described below only relate to some embodiments of the present application, and are not intended to limit the present application.
[0073] Figure 1 A schematic diagram of the application architecture of the automated production method for rubber seals in an embodiment of the present application is shown;
[0074] Figure 2 A flow chart showing an automated production method for rubber seals in an embodiment of the present application is shown;
[0075] Figure 3 A flowchart of sub-step S540 of the method for automated production of rubber seals in an embodiment of the present application is shown;
[0076] Figure 4 A flowchart of sub-step S550 of the method for automated production of rubber seals in an embodiment of the present application is shown;
[0077] Figure 5 A schematic diagram of the structure of an automated production line for rubber seals in an embodiment of the present application is shown;
[0078] Figure 6 An application scenario diagram of the automated production method of rubber seals in an embodiment of the present application is shown; and
[0079] Figure 7 A schematic diagram of a storage medium according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0080] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work also fall within the scope of protection of the present application.
[0081] The terms used in this specification are those common terms currently widely used in the art in consideration of the functions of the present application, but these terms may vary according to the intention of a person of ordinary skill in the art, precedents, or new technologies in the art. In addition, specific terms may be selected by the applicant, and in this case, their detailed meanings will be described in the detailed description of the present application. Therefore, the terms used in the specification should not be understood as simple names, but rather as a general description based on the meaning of the terms and the present application.
[0082] Although the present application makes various references to certain modules in the system according to the embodiments of the present application, any number of different modules can be used and run on the user terminal and / or server. The modules are only illustrative, and different aspects of the system and method can use different modules.
[0083] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps may be processed in reverse order or simultaneously as required. At the same time, other operations may also be added to these processes, or a certain step or several steps of operations may be removed from these processes.
[0084] Figure 1 A schematic diagram of the application architecture of the automated production method for rubber seals in an embodiment of the present application is shown, including a server 100 and a terminal device 200.
[0085] The terminal device 200 and the server 100 can be connected via the Internet to achieve mutual communication. Optionally, the above-mentioned Internet uses standard communication technology and / or protocol. The Internet is usually the Internet, but it can also be any network, including but not limited to any combination of a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or a virtual private network. In some embodiments, the data exchanged through the network can be represented by technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec), etc. can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above-mentioned data communication technologies.
[0086] The server 100 can provide various network services for the terminal device 200, wherein the server 100 can be a single server, a server cluster consisting of several servers, or a cloud computing center. Specifically, the server 100 may include a processor 110 (Center Processing Unit, CPU), a memory 120, an input device 130, and an output device 140, etc. The input device 130 may include a keyboard, a mouse, a touch screen, etc., and the output device 140 may include a display device, such as a liquid crystal display (Liquid Crystal Display, LCD), a cathode ray tube (Cathode Ray Tube, CRT), etc.
[0087] The memory 120 may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor 110 with program instructions and data stored in the memory 120. In the embodiment of the present application, the memory 120 may be used to store the program of the automatic production method of rubber seals in the embodiment of the present application.
[0088] The processor 110 calls the program instructions stored in the memory 120, and the processor 110 is used to execute the steps of any one of the automated production methods for rubber seals in the embodiments of the present application according to the obtained program instructions.
[0089] In addition, the application architecture diagram in the embodiment of the present application is intended to more clearly illustrate the technical solution in the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. Of course, for other application architectures and business applications, the technical solution provided in the embodiment of the present application is also applicable to similar problems.
[0090] The following is a non-restrictive description of the automated production method of rubber seals provided according to at least one embodiment of the present application through several examples or embodiments. As described below, different features in these specific examples or embodiments can be combined with each other without conflicting with each other to obtain new examples or embodiments, and these new examples or embodiments also fall within the scope of protection of the present application.
[0091] With the development of artificial intelligence and computer vision technology, automated detection methods based on image recognition and deep learning have gradually been applied, bringing new solutions to the product quality inspection of rubber seals. Based on this, in the technical solution of the present application, an automated production method for rubber seals is proposed, which can perform image acquisition on the rubber seal products to be inspected to obtain the product surface image during the production process of rubber seals, and introduce an image processing and analysis algorithm based on artificial intelligence and deep learning at the back end to analyze the product surface image, so as to learn and capture the apparent multi-scale focusing features of the rubber seals to be inspected, thereby automatically detecting and identifying the defects of the rubber seals to be inspected. In this way, automatic quality inspection of rubber seal products can be achieved during the production process of rubber seals, thereby improving the intelligence level of the rubber seal production line.
[0092] Figure 2 The flowchart of the automatic production method of rubber seals in the embodiment of the present application is shown. For example, the automatic production method of rubber seals can be executed by a server, which can be Figure 1 The server 100 shown in FIG. Figure 2 As shown, according to the embodiment of the present application, the automated production method of rubber seals includes the following steps: S510, acquiring a product surface image of the rubber seal to be detected collected by an industrial camera; S520, performing image enhancement based on contrast normalization on the product surface image of the rubber seal to be detected to obtain an enhanced surface image of the rubber seal; S530, performing multi-level feature extraction based on the appearance of the rubber seal on the enhanced surface image of the rubber seal to obtain a surface shallow feature map of the rubber seal and a surface deep feature map of the rubber seal; S540, combining the surface shallow feature map of the rubber seal and the surface deep feature map of the rubber seal The feature map is input into the collaborative attention module to obtain a collaborative attention rubber seal apparent shallow feature map and a collaborative attention rubber seal apparent deep feature map; S550, the collaborative attention rubber seal apparent shallow feature map and the collaborative attention rubber seal apparent deep feature map are subjected to feature enhancement fusion processing based on feature multi-scale focusing and balanced threshold mechanism to obtain a rubber seal apparent multi-scale focusing fusion feature vector; S560, the rubber seal apparent multi-scale focusing fusion feature vector is input into a quality inspection result generator based on a classifier to obtain a quality inspection result, and the quality inspection result is used to indicate whether the rubber seal to be inspected has defects.
[0093] Specifically, in the technical solution of the present application, first, the product appearance image of the rubber seal to be inspected collected by the industrial camera is obtained. It should be understood that in the actual process of quality inspection of rubber seal products, the appearance image of the rubber seal may be affected by factors such as lighting conditions and camera equipment, resulting in insufficient image contrast or unclear details. Therefore, in the technical solution of the present application, the product appearance image of the rubber seal to be inspected is subjected to image enhancement based on contrast normalization to obtain an enhanced rubber seal appearance image. Through contrast normalized image enhancement processing, the local contrast features of the image can be extracted, the influence of global contrast changes in the image can be reduced, and the details and texture information about the appearance of the rubber seal in the image can be highlighted, so that the appearance features of the rubber seal are more obvious and prominent. Specifically, the contrast normalization can be achieved by subtracting the local mean from each pixel value of the product appearance image and dividing it by the local standard deviation.
[0094] Next, considering that the defects of rubber seals may be manifested at different levels and scales, such as surface scratches and bubble texture features of rubber seals and semantic features of different sizes. Therefore, in order to better capture the feature information of the rubber seal appearance at different levels, in the technical solution of the present application, the enhanced rubber seal appearance image is input into the appearance multi-scale feature extractor based on the hollow pyramid network for feature extraction, so as to capture the multi-level perceptual feature information about the appearance of the rubber seal in the enhanced rubber seal appearance image, thereby obtaining the rubber seal appearance shallow feature map and the rubber seal appearance deep feature map. It should be understood that the hollow pyramid network has the characteristics of multi-scale and multi-level receptive fields, and can effectively capture and perceive the shallow and semantic feature information in the image at different levels. Through the processing of the appearance multi-scale feature extractor based on the hollow pyramid network, rich multi-level features about the surface of the rubber seal in the image can be obtained, which is conducive to the comprehensive expression and analysis of the shallow and semantic features in the rubber seal appearance image, so as to better support the subsequent defect recognition tasks.
[0095] Correspondingly, in step S530, a multi-level feature extraction based on the appearance of the rubber seal is performed on the surface image of the reinforced rubber seal to obtain a rubber seal surface shallow feature map and a rubber seal surface deep feature map, including: inputting the reinforced rubber seal surface image into an appearance multi-scale feature extractor based on a hollow pyramid network to obtain the rubber seal surface shallow feature map and the rubber seal surface deep feature map.
[0096] Then, since the rubber seal apparent shallow feature map and the rubber seal apparent deep feature map respectively contain the apparent shallow and deep feature information about the rubber seal, these two kinds of feature information will influence and work together, and play a key role in the subsequent defect recognition and detection tasks. Based on this, in order to achieve effective interaction and fusion between features at different levels, so as to better capture the important feature information about the apparent quality of the rubber seal in the image, and improve the accuracy and robustness of defect recognition, in the technical solution of the present application, the rubber seal apparent shallow feature map and the rubber seal apparent deep feature map are further input into the collaborative attention module to obtain the collaborative attention rubber seal apparent shallow feature map and the collaborative attention rubber seal apparent deep feature map. Through the processing of the collaborative attention module, the surface shallow features and deep features of the rubber seal can be interacted and collaboratively analyzed, so as to learn and capture the implicit correlation relationship between the shallow features and deep features of the rubber seal, and highlight the key features therein. In this way, the system can better focus on and utilize the different levels of feature information on the surface of rubber seals, help improve the expressiveness and representation effect of features, and provide stronger support for subsequent defect identification.
[0097] Accordingly, if Figure 3As shown, in step S540, the rubber seal apparent shallow feature map and the rubber seal apparent deep feature map are input into the collaborative attention module to obtain the collaborative attention rubber seal apparent shallow feature map and the collaborative attention rubber seal apparent deep feature map, including: S541, reshaping the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map to obtain the rubber seal apparent semantic feature matrix and the rubber seal apparent shallow feature matrix; S542, performing global mean pooling along the channel dimension on the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map to obtain the rubber seal apparent semantic full-channel feature vector and the rubber seal apparent shallow full-channel feature vector; S543, calculating the product between the transposed matrix of the rubber seal apparent semantic feature matrix and the rubber seal apparent shallow feature matrix to obtain the rubber seal apparent full-channel feature matrix between the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map. feature similarity matrix; S544, normalizing the rubber seal apparent full-channel feature similarity matrix to obtain a normalized rubber seal apparent full-channel feature similarity matrix; S545, calculating the matrix product between the normalized rubber seal apparent full-channel feature similarity matrix and the rubber seal apparent semantic full-channel feature vector to obtain the rubber seal apparent semantic collaborative attention weight vector; S546, calculating the matrix product between the normalized rubber seal apparent full-channel feature similarity matrix and the rubber seal apparent shallow full-channel feature vector to obtain the rubber seal apparent shallow collaborative attention weight vector; S547, using the rubber seal apparent semantic collaborative attention weight vector and the rubber seal apparent shallow collaborative attention weight vector as weight vectors to weight the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map respectively to obtain the collaboratively-attended rubber seal apparent deep feature map and the collaboratively-attended rubber seal apparent shallow feature map.
[0098] Among them, in step S544, the rubber seal apparent full-channel feature similarity matrix is normalized to obtain a normalized rubber seal apparent full-channel feature similarity matrix, including: taking each eigenvalue in the rubber seal apparent full-channel feature similarity matrix as an exponent of a natural constant to calculate a position-based exponential function value with the natural constant as the base to obtain a rubber seal apparent full-channel feature similarity class support matrix; calculating the sum of each column vector in the rubber seal apparent full-channel feature similarity class support matrix to obtain a rubber seal apparent full-channel feature similarity class support column global vector composed of multiple column vector global sum values; calculating the position-based division between each eigenvalue in the rubber seal apparent full-channel feature similarity class support matrix and the corresponding column vector global sum value in the rubber seal apparent full-channel feature similarity class support column global vector to obtain the normalized rubber seal apparent full-channel feature similarity matrix.
[0099] In a specific example, the rubber seal apparent shallow feature map and the rubber seal apparent deep feature map are input into the collaborative attention module to obtain the collaborative attention rubber seal apparent shallow feature map and the collaborative attention rubber seal apparent deep feature map, including: inputting the rubber seal apparent shallow feature map and the rubber seal apparent deep feature map into the collaborative attention module for processing with the following collaborative attention formula to obtain the collaborative attention rubber seal apparent shallow feature map and the collaborative attention rubber seal apparent deep feature map; wherein the collaborative attention formula is: ;in, is the apparent deep characteristic diagram of the rubber seal, is the superficial characteristic diagram of the rubber seal, Represents the feature matrix of the feature map reshaped into a shape, where , , , , and are the number of channels, height and width of the feature map, respectively. is the apparent semantic feature matrix of rubber seals, is the superficial characteristic matrix of the rubber seal, Indicates that the feature map is globally averaged pooled. is the apparent semantic full-channel feature vector of the rubber seal, is the apparent shallow full-channel eigenvector of the rubber seal, is the apparent full-channel feature similarity matrix of rubber seals, and are all the eigenvalues of each position in the apparent full-channel feature similarity matrix of the rubber seal, is the exponential function operation, is the number of row vectors in the rubber seal apparent full-channel feature similarity matrix, is the eigenvalue of each position in the normalized full-channel feature similarity matrix of the rubber seal, is the normalized user fingerprint reference full channel feature similarity matrix, is the apparent semantic co-attention weight vector of rubber seals, is the apparent shallow collaborative attention weight vector of the rubber seal, In order to use the eigenvalues at each position in the eigenvector to perform weighted multiplication on the feature map along the channel dimension, and They are respectively the apparent deep feature map of the collaboratively focused rubber seal and the apparent shallow feature map of the collaboratively focused rubber seal.
[0100] It should be understood that the defects of rubber seals may appear at different scales, such as tiny scratches or larger bubbles. In order to ensure that the model can pay attention to the surface feature information of rubber seals at different scales, thereby achieving more comprehensive and accurate defect identification and detection, in the technical solution of the present application, the collaboratively focused rubber seal apparent shallow feature map and the collaboratively focused rubber seal apparent deep feature map are further input into the feature multi-scale focusing module to obtain the collaboratively focused rubber seal apparent shallow focused feature vector and the collaboratively focused rubber seal apparent deep focused feature vector. Through the processing of the feature multi-scale focusing module, the apparent local features and global feature information of the injected rubber seal can be learned and perceived, and the two features can be effectively integrated to form a more comprehensive feature representation, which helps the model capture defect features at different scales and enhance the distinguishability of features to better support the defect identification and quality inspection tasks of rubber seals.
[0101] Furthermore, since the apparent shallow focus feature vector of the collaboratively focused rubber seal and the apparent deep focus feature vector of the collaboratively focused rubber seal respectively contain the apparent shallow focus feature and deep focus feature information of the rubber seal after being enhanced by features of different scales and different levels, there is a hidden association and mutual influence between the two features. Moreover, considering that the apparent shallow features and deep features of the rubber seal have different contributions in the actual defect detection task of the rubber seal, therefore, in order to effectively fuse the feature information from different levels and scales to obtain a more comprehensive and accurate representation of the apparent features of the rubber seal, in the technical solution of the present application, the apparent shallow focus feature vector of the collaboratively focused rubber seal and the apparent deep focus feature vector of the collaboratively focused rubber seal are further input into the equalization threshold feature vector adaptive fusion module to obtain the apparent multi-scale focused fusion feature vector of the rubber seal. Through the processing of the balanced threshold feature vector adaptive fusion module, the implicit correlation relationship and interaction characteristics between the apparent shallow focus features and deep focus features of rubber seals can be automatically learned and characterized, and the features of the two can be effectively fused, so as to comprehensively utilize the advantages of features at different levels and improve the expression ability and discrimination of the apparent features of rubber seals. In particular, the balanced threshold feature vector adaptive fusion module can use the balanced threshold mechanism to highlight and strengthen the expression of features that contribute more to subsequent defect recognition tasks during the fusion process of shallow and deep features, thereby helping to better describe the apparent features of rubber seals, improve the accuracy and robustness of feature representation, and provide more powerful support for subsequent defect recognition and quality inspection tasks.
[0102] Accordingly, if Figure 4 As shown, in step S550, the collaboratively focused rubber seal apparent shallow feature map and the collaboratively focused rubber seal apparent deep feature map are subjected to feature enhancement fusion processing based on feature multi-scale focusing and balanced threshold mechanism to obtain the rubber seal apparent multi-scale focused fusion feature vector, including: S551, inputting the collaboratively focused rubber seal apparent shallow feature map and the collaboratively focused rubber seal apparent deep feature map into the feature multi-scale focusing module to obtain the collaboratively focused rubber seal apparent shallow focused feature vector and the collaboratively focused rubber seal apparent deep focused feature vector; S552, inputting the collaboratively focused rubber seal apparent shallow focused feature vector and the collaboratively focused rubber seal apparent deep focused feature vector into the balanced threshold feature vector adaptive fusion module to obtain the rubber seal apparent multi-scale focused fusion feature vector.
[0103] Wherein, in step S551, the collaboratively focused rubber seal apparent shallow feature map and the collaboratively focused rubber seal apparent deep feature map are input into a feature multi-scale focusing module to obtain a collaboratively focused rubber seal apparent shallow focusing feature vector and a collaboratively focused rubber seal apparent deep focusing feature vector, including: upsampling the collaboratively focused rubber seal apparent shallow feature map to obtain an upsampled collaboratively focused rubber seal apparent shallow feature map; performing global mean pooling processing on each feature matrix along the channel dimension in the upsampled collaboratively focused rubber seal apparent shallow feature map to obtain an upsampled collaboratively focused rubber seal apparent shallow flow channel feature vector; and performing global mean pooling processing on the upsampled collaboratively focused rubber seal apparent shallow feature map. The apparent shallow channel feature vector of the collaboratively focused rubber seal is point-convolutionally encoded to obtain the global apparent shallow feature vector of the collaboratively focused rubber seal; the upsampled collaboratively focused rubber seal apparent shallow feature map is point-convolutionally encoded to obtain the channel-modulated upsampled collaboratively focused rubber seal apparent shallow feature map; the channel-modulated upsampled collaboratively focused rubber seal apparent shallow feature map is two-dimensionally convolutionally encoded to obtain the collaboratively focused rubber seal local apparent shallow feature vector; the collaboratively focused rubber seal global apparent shallow feature vector and the collaboratively focused rubber seal local apparent shallow feature vector are fused to obtain the collaboratively focused rubber seal apparent shallow focusing feature vector.
[0104] Wherein, in step S552, the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector are input into an equalization threshold feature vector adaptive fusion module to obtain the rubber seal apparent multi-scale focusing fusion feature vector, including: cascading the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector to obtain a first rubber seal apparent multi-level correlation feature vector; calculating the matrix multiplication of the first rubber seal apparent multi-level correlation feature vector and a first transformation matrix, and then adding the obtained feature vector to the first bias vector by position to obtain a first linearly transformed rubber seal apparent multi-level correlation feature vector; using The activation function activates the first linear transformation rubber seal apparent multi-level correlation feature vector to obtain a first activated linear transformation rubber seal apparent multi-level correlation feature vector; the collaborative attention rubber seal apparent shallow focus feature vector and the collaborative attention rubber seal apparent deep focus feature vector are added by position to obtain a second rubber seal apparent multi-level correlation feature vector; after calculating the matrix multiplication of the second rubber seal apparent multi-level correlation feature vector and the second transformation matrix, the obtained feature vector is added by position to the second bias vector to obtain a second linear transformation rubber seal apparent multi-level correlation feature vector; using The activation function activates the second linear transformation rubber seal apparent multi-level correlation feature vector to obtain the second activated linear transformation rubber seal apparent multi-level correlation feature vector; the collaborative attention rubber seal apparent shallow focus feature vector and the collaborative attention rubber seal apparent deep focus feature vector are multiplied by position point to obtain a third rubber seal apparent multi-level correlation feature vector; after calculating the matrix multiplication of the third rubber seal apparent multi-level correlation feature vector and the third transformation matrix, the obtained feature vector is added to the third bias vector by position to obtain the third linear transformation rubber seal apparent multi-level correlation feature vector; using The activation function activates the third linear transformation rubber seal apparent multi-level correlation feature vector to obtain the third activated linear transformation rubber seal apparent multi-level correlation feature vector; using the respective position feature values in the first activated linear transformation rubber seal apparent multi-level correlation feature vector as the first threshold value, using the respective position feature values in the second activated linear transformation rubber seal apparent multi-level correlation feature vector as the second threshold value, using the respective position feature values in the third activated linear transformation rubber seal apparent multi-level correlation feature vector as the third threshold value, calculating the weighted sum of the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector to obtain the rubber seal apparent multi-scale focused fusion feature vector.
[0105] Specifically, taking each position feature value in the first activated linear transformation rubber seal apparent multi-level associated feature vector as a first threshold value, taking each position feature value in the second activated linear transformation rubber seal apparent multi-level associated feature vector as a second threshold value, taking each position feature value in the third activated linear transformation rubber seal apparent multi-level associated feature vector as a third threshold value, calculating a weighted sum of the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector to obtain the rubber seal apparent multi-scale focused fusion feature vector, including: calculating the first threshold value, the second threshold value and the third threshold value The mean between the limit values is obtained to obtain the threshold mean; the product of the eigenvalue of each position in the collaborative attention to rubber seal apparent shallow focus feature vector and one minus the threshold mean is calculated to obtain the weighted collaborative attention to rubber seal apparent shallow focus feature vector; the product of the eigenvalue of each position in the collaborative attention to rubber seal apparent deep focus feature vector is calculated to obtain the weighted collaborative attention to rubber seal apparent deep focus feature vector; the weighted collaborative attention to rubber seal apparent shallow focus feature vector and the weighted collaborative attention to rubber seal apparent deep focus feature vector are added by position to obtain the rubber seal apparent multi-scale focusing fusion feature vector.
[0106] In a specific example, the collaborative attention to the rubber seal apparent shallow focus feature vector and the collaborative attention to the rubber seal apparent deep focus feature vector are input into the equalization threshold feature vector adaptive fusion module to obtain the rubber seal apparent multi-scale focus fusion feature vector, including: inputting the collaborative attention to the rubber seal apparent shallow focus feature vector and the collaborative attention to the rubber seal apparent deep focus feature vector into the equalization threshold feature vector adaptive fusion module to process them with the following adaptive equalization fusion formula to obtain the rubber seal apparent multi-scale focus fusion feature vector; wherein the adaptive equalization fusion formula is: ;in, and are respectively the apparent shallow focus feature vector of the collaboratively focused rubber seal and the apparent deep focus feature vector of the collaboratively focused rubber seal, and are the apparent shallow focusing feature vectors of the collaboratively focused rubber seal and the collaborative focus on the rubber seal surface deep focusing feature vector The eigenvalues at each position in , is the eigenvalue of each position in the apparent multi-scale focused fusion eigenvector of the rubber seal, represents the concatenation of vectors, , and is the transformation matrix, , and is the bias vector, is the first activated linear transformation rubber seal appearance multi-level correlation feature vector, represents vector addition by position, It means vector multiplication by position. is the second activated linear transformation rubber seal appearance multi-level correlation feature vector, is the third activated linear transformation rubber seal appearance multi-level correlation feature vector, is the first activated linear transformation rubber seal surface multi-level correlation feature vector The threshold value of each position in is the second activation linear transformation rubber seal appearance multi-level correlation feature vector The threshold value of each position in is the third activated linear transformation rubber seal apparent multi-level correlation feature vector The threshold value of each position in , express Activation function.
[0107] Then, the rubber seal surface multi-scale focusing fusion feature vector is input into the quality inspection result generator based on the classifier to obtain the quality inspection result, which is used to indicate whether the rubber seal to be inspected has defects. In other words, the rubber seal surface multi-scale focusing fusion feature information is used for classification processing, so as to automatically detect and identify the defects of the rubber seal to be inspected, such as bubbles, scratches or inconsistent sizes. Through the automated rubber seal quality inspection, the intelligent level of inspection is improved and the inspection error caused by human factors is reduced.
[0108] It should be understood that the role of the classifier is to use the given categories and known training data to learn classification rules and classifiers, and then classify (or predict) unknown data. Logistic regression, SVM, etc. are often used to solve binary classification problems. For multi-class classification problems, logistic regression or SVM can also be used, but multiple binary classifications are required to form a multi-classification, but this is prone to errors and inefficient. Commonly used multi-classification methods include the Softmax classification function.
[0109] Furthermore, in the technical solution of the present application, the automated production method for rubber seals also includes a training step: for training the appearance multi-scale feature extractor based on the hollow pyramid network, the collaborative attention module, the feature multi-scale focusing module, the balanced threshold feature vector adaptive fusion module and the classifier-based quality inspection result generator.
[0110] Wherein, the training step includes: obtaining training data, wherein the training data includes the training product appearance image of the rubber seal to be inspected collected by an industrial camera and the real quality inspection result; performing image enhancement based on contrast normalization on the training product appearance image of the rubber seal to be inspected to obtain a training enhanced rubber seal appearance image; inputting the training enhanced rubber seal appearance image into the appearance multi-scale feature extractor based on the hollow pyramid network to obtain a training rubber seal appearance shallow feature map and a training rubber seal appearance deep feature map; inputting the training rubber seal appearance shallow feature map and the training rubber seal appearance deep feature map into the collaborative attention module to obtain a training collaborative attention rubber seal appearance shallow feature map and a training collaborative attention rubber seal appearance deep feature map; inputting the training collaborative attention rubber seal appearance shallow feature map and the training collaborative attention rubber seal appearance deep feature map into the feature multi-scale focusing module. The module is used to obtain the apparent shallow focusing feature vector of the trained collaboratively-attended rubber seal and the apparent deep focusing feature vector of the trained collaboratively-attended rubber seal; the apparent shallow focusing feature vector of the trained collaboratively-attended rubber seal and the apparent deep focusing feature vector of the trained collaboratively-attended rubber seal are input into the balanced threshold feature vector adaptive fusion module to obtain the apparent multi-scale focusing fusion feature vector of the trained rubber seal; the apparent multi-scale focusing fusion feature vector of the trained rubber seal is input into the quality inspection result generator based on the classifier to obtain the training quality inspection result; the cross entropy loss function value between the training quality inspection result and the true quality inspection result is calculated to obtain the classification loss function value; based on the classification loss function value, the appearance multi-scale feature extractor based on the hollow pyramid network, the collaborative attention module, the feature multi-scale focusing module, the balanced threshold feature vector adaptive fusion module and the quality inspection result generator based on the classifier are trained.
[0111] The method of inputting the training rubber seal surface multi-scale focused fusion feature vector into the classifier-based quality inspection result generator to obtain the training quality inspection result includes:
[0112] The training rubber seal apparent multi-scale focusing fusion feature vector is clustered and optimized to obtain the optimized training rubber seal apparent multi-scale focusing fusion feature vector. The process is expressed by the clustering optimization formula as follows: ;in, represents the total number of eigenvalues of the multi-scale focused fusion feature vector for training the rubber seal surface, represents the number of features within a class, represents the multi-scale focused fusion feature vector of the training rubber seal surface, represents the weight hyperparameter, It means point multiplication by position. represents positional addition, It means to perform exponential operation on the eigenvalues at each position in the vector. The optimized training rubber seal apparent multi-scale focusing fusion feature vector is input into the classifier-based quality inspection result generator to obtain the training quality inspection result.
[0113] That is, the training rubber seal apparent multi-scale focused fusion feature vector is input into the classifier-based quality inspection result generator to obtain the training quality inspection result, including: performing a clustering operation on the training rubber seal apparent multi-scale focused fusion feature vector, for example, performing a clustering operation based on a distance between eigenvalues, and determining the number of features within the class; dividing the total number of eigenvalues of the training rubber seal apparent multi-scale focused fusion feature vector by the number of features within the class to obtain a class importance value, and calculating the inverse of the class importance value to obtain a class constraint value; calculating the difference between the total number of eigenvalues and the number of features within the class, and dividing the total number of eigenvalues by the difference to obtain an out-of-class proportion value; calculating each eigenvalue of the training rubber seal apparent multi-scale focused fusion feature vector to obtain the value of the class constraint; The class importance value is an exponential power function, and is added to an exponential value with a natural function as the base and the class constraint value as the exponent, and then multiplied by the out-of-class proportion value to obtain a training rubber seal apparent multi-scale focusing fusion modulation vector; the training rubber seal apparent multi-scale focusing fusion feature vector is point multiplied with the class importance value to obtain a training rubber seal apparent multi-scale focusing fusion ontology vector; the weighted sum of the training rubber seal apparent multi-scale focusing fusion modulation vector and the training rubber seal apparent multi-scale focusing fusion ontology vector is calculated to obtain an optimized training rubber seal apparent multi-scale focusing fusion feature vector; the optimized training rubber seal apparent multi-scale focusing fusion feature vector is input into the classifier-based quality inspection result generator to obtain a training quality inspection result.
[0114] Here, with regard to the feature distribution difference caused by the cross-scale and cross-depth image semantic features of the training enhanced rubber seal appearance image expressed by the training collaboratively-attended rubber seal appearance shallow focus feature vector and the training collaboratively-attended rubber seal appearance deep focus feature vector after collaboratively-attended and multi-scale focusing, the distribution discretization of the training rubber seal appearance multi-scale focus fusion feature vector existing after balanced threshold adaptive fusion is performed, and the applicant of the present application clusters the eigenvalues of the training rubber seal appearance multi-scale focus fusion feature vector while performing clustering operation on the training rubber seal appearance multi-scale focus fusion feature vector. The combination of the importance metric and the class constraint metric of the clustering operation is further modulated in a responsive manner with the out-of-class scale factor, and based on the clustering scaling of the feature ontology representation of the training rubber seal surface multi-scale focusing fusion feature vector, the clustering operation is used to establish the simplicity and effectiveness of the overall feature purification of the feature set of the training rubber seal surface multi-scale focusing fusion feature vector, and to suppress the inconsistency of the convergence logic of the probability density distribution caused by the clustering operation, so as to improve the classification iteration effect of the quality inspection result generator based on the classifier of the feature set input of the training rubber seal surface multi-scale focusing fusion feature vector, that is, to improve the speed of classification training and the accuracy of classification results. In this way, the automatic quality inspection of rubber seal products can be more accurately realized in the production process of rubber seals, thereby improving the intelligence level of rubber seal production lines.
[0115] Based on the above embodiments, see Figure 5As shown, it is a schematic diagram of the structure of an automated production line 800 for rubber seals in an embodiment of the present application. The automated production line 800 for rubber seals includes: an image acquisition module 810, which is used to obtain a product appearance image of the rubber seal to be detected acquired by an industrial camera; an image enhancement module 820, which is used to perform image enhancement based on contrast normalization on the product appearance image of the rubber seal to be detected to obtain an enhanced rubber seal appearance image; a multi-level feature extraction module 830, which is used to perform multi-level feature extraction based on the appearance of the rubber seal on the enhanced rubber seal appearance image to obtain a rubber seal appearance shallow feature map and a rubber seal appearance deep feature map; an attention module 840, which is used to combine the rubber seal appearance shallow feature map and the rubber seal appearance deep feature map. The feature map is input into the collaborative attention module to obtain a collaborative attention rubber seal apparent shallow feature map and a collaborative attention rubber seal apparent deep feature map; the feature enhancement fusion module 850 is used to perform feature enhancement fusion processing on the collaborative attention rubber seal apparent shallow feature map and the collaborative attention rubber seal apparent deep feature map based on feature multi-scale focusing and balanced threshold mechanism to obtain a rubber seal apparent multi-scale focused fusion feature vector; the quality inspection result generation module 860 is used to input the rubber seal apparent multi-scale focused fusion feature vector into a classifier-based quality inspection result generator to obtain a quality inspection result, and the quality inspection result is used to indicate whether the rubber seal to be inspected has defects.
[0116] Here, those skilled in the art will appreciate that the specific functions and operations of each module in the above-mentioned rubber seal automated production line 800 have been described in detail above. Figures 2 to 4 The description of the automated production method of rubber seals has been described in detail, and therefore, its repeated description will be omitted.
[0117] Figure 6 FIG. 1 is an application scenario diagram of the method for automatically producing rubber seals according to an embodiment of the present application. Figure 6 As shown, in this application scenario, first, a product surface image of the rubber seal to be inspected is acquired by an industrial camera (for example, Figure 6 D), then, the product appearance image of the rubber seal to be inspected is input to a server (for example, Figure 6 In S) as shown in , the server can use the rubber seal automated production algorithm to process the product surface image of the rubber seal to be inspected to obtain a quality inspection result indicating whether the rubber seal to be inspected has defects.
[0118] Based on the above embodiments, another exemplary embodiment of an electronic device is also provided in the embodiments of the present application. In some possible implementations, the electronic device in the embodiments of the present application may include a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can implement the steps of the automated production method of rubber seals in the above embodiments when executing the program.
[0119] For example, in the case of electronic equipment Figure 1 Taking the server 100 in the example as an example, the processor in the electronic device is the processor 110 in the server 100, and the memory in the electronic device is the memory 120 in the server 100.
[0120] An embodiment of the present application also provides a computer-readable storage medium. Figure 7 1 shows a schematic diagram of a computer-readable storage medium 1000 according to an embodiment of the present application. Figure 7 As shown, the computer-readable storage medium 1000 stores computer-executable instructions 1001. When the computer-executable instructions 1001 are executed by the processor, the automatic production method of rubber seals according to the embodiment of the present application described with reference to the above figures can be executed. The computer-readable storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc.
[0121] The embodiment of the present application also provides a computer program product or a computer program, which includes computer executable instructions, and the computer executable instructions are stored in a computer readable storage medium. The processor of the computer device reads the computer executable instructions from the computer readable storage medium, and the processor executes the computer executable instructions, so that the computer device executes the automatic production method of rubber seals according to the embodiment of the present application.
[0122] Those skilled in the art will appreciate that the contents disclosed in this application may be subject to various modifications and improvements. For example, the various devices or components described above may be implemented by hardware, or by software, firmware, or a combination of some or all of the three.
[0123] In addition, although the present application makes various references to certain units in the system according to embodiments of the present application, any number of different units can be used and run on the client and / or server. The units are illustrative only, and different aspects of the system and method can use different units.
[0124] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits. Accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of software function modules. The present application is not limited to any particular form of combination of hardware and software.
[0125] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art to which this application belongs. It should also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or extremely formal sense, unless explicitly defined as such herein.
[0126] The above is an explanation of the present application and should not be considered as a limitation thereof. Although several exemplary embodiments of the present application have been described, it will be readily understood by those skilled in the art that many modifications may be made to the exemplary embodiments without departing from the novel teachings and advantages of the present application. Therefore, all of these modifications are intended to be included within the scope of the present application as defined by the claims. It should be understood that the above is an explanation of the present application and should not be considered to be limited to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The present application is defined by the claims and their equivalents.
Claims
1. A method for automatically producing rubber seals, characterized in that: include: Acquire a product surface image of the rubber seal to be inspected captured by an industrial camera; Performing image enhancement based on contrast normalization on the product surface image of the rubber seal to be inspected to obtain an enhanced surface image of the rubber seal; Performing multi-level feature extraction based on the appearance of the rubber seal on the surface image of the enhanced rubber seal to obtain a rubber seal surface shallow feature map and a rubber seal surface deep feature map; Inputting the rubber seal apparent shallow feature map and the rubber seal apparent deep feature map into a collaborative attention module to obtain a collaborative attention rubber seal apparent shallow feature map and a collaborative attention rubber seal apparent deep feature map; Performing feature enhancement fusion processing based on feature multi-scale focusing and balanced threshold mechanism on the collaboratively focused rubber seal surface shallow feature map and the collaboratively focused rubber seal surface deep feature map to obtain a rubber seal surface multi-scale focusing fusion feature vector; Inputting the rubber seal surface multi-scale focused fusion feature vector into a quality inspection result generator based on a classifier to obtain a quality inspection result, wherein the quality inspection result is used to indicate whether the rubber seal to be inspected has defects; The rubber seal surface superficial feature map and the rubber seal surface deep feature map are input into the collaborative attention module to obtain the collaborative attention rubber seal surface superficial feature map and the collaborative attention rubber seal surface deep feature map, including: Reshape the rubber seal component appearance deep feature map and the rubber seal component appearance shallow feature map to obtain a rubber seal component appearance semantic feature matrix and a rubber seal component appearance shallow feature matrix; Performing global mean pooling along the channel dimension on the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map to obtain a rubber seal apparent semantic full-channel feature vector and a rubber seal apparent shallow full-channel feature vector; Calculating the product between the transposed matrix of the rubber seal apparent semantic feature matrix and the rubber seal apparent shallow feature matrix to obtain a rubber seal apparent full-channel feature similarity matrix between the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map; Normalizing the rubber seal component apparent full-channel feature similarity matrix to obtain a normalized rubber seal component apparent full-channel feature similarity matrix; Calculating the matrix product between the normalized rubber seal appearance full-channel feature similarity matrix and the rubber seal appearance semantic full-channel feature vector to obtain the rubber seal appearance semantic collaborative attention weight vector; Calculating the matrix product between the normalized rubber seal apparent full-channel feature similarity matrix and the rubber seal apparent shallow full-channel feature vector to obtain the rubber seal apparent shallow collaborative attention weight vector; The rubber seal apparent semantic collaborative attention weight vector and the rubber seal apparent shallow collaborative attention weight vector are used as weight vectors to weight the rubber seal apparent deep feature map and the rubber seal apparent shallow feature map respectively to obtain the collaboratively-attended rubber seal apparent deep feature map and the collaboratively-attended rubber seal apparent shallow feature map; The collaborative attention rubber seal surface shallow feature map and the collaborative attention rubber seal surface deep feature map are subjected to feature enhancement fusion processing based on feature multi-scale focusing and balanced threshold mechanism to obtain the rubber seal surface multi-scale focusing fusion feature vector, including: Inputting the collaboratively focused rubber seal apparent shallow feature map and the collaboratively focused rubber seal apparent deep feature map into a feature multi-scale focusing module to obtain a collaboratively focused rubber seal apparent shallow focused feature vector and a collaboratively focused rubber seal apparent deep focused feature vector; Inputting the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector into a balanced threshold feature vector adaptive fusion module to obtain the rubber seal apparent multi-scale focus fusion feature vector; The method of inputting the collaborative attention rubber seal apparent shallow focus feature vector and the collaborative attention rubber seal apparent deep focus feature vector into the balanced threshold feature vector adaptive fusion module to obtain the rubber seal apparent multi-scale focus fusion feature vector includes: Cascading the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector to obtain a first rubber seal apparent multi-level correlation feature vector; After calculating the matrix multiplication of the first rubber seal apparent multi-level correlation feature vector and the first transformation matrix, the obtained feature vector is added to the first bias vector by position to obtain the first linear transformation rubber seal apparent multi-level correlation feature vector; use The activation function activates the first linear transformation rubber seal apparent multi-level correlation feature vector to obtain a first activated linear transformation rubber seal apparent multi-level correlation feature vector; Adding the apparent shallow focus feature vector of the collaboratively concerned rubber seal and the apparent deep focus feature vector of the collaboratively concerned rubber seal by position to obtain a second rubber seal apparent multi-level correlation feature vector; After calculating the matrix multiplication of the second rubber seal apparent multi-level correlation feature vector and the second transformation matrix, the obtained feature vector is added to the second bias vector by position to obtain the second linear transformation rubber seal apparent multi-level correlation feature vector; use The activation function activates the second linear transformation rubber seal apparent multi-level correlation feature vector to obtain a second activated linear transformation rubber seal apparent multi-level correlation feature vector; Multiplying the apparent shallow focus feature vector of the collaboratively concerned rubber seal and the apparent deep focus feature vector of the collaboratively concerned rubber seal by position points to obtain a third apparent multi-level correlation feature vector of the rubber seal; After calculating the matrix multiplication of the third rubber seal apparent multi-level correlation feature vector and the third transformation matrix, the obtained feature vector is added to the third bias vector by position to obtain a third linear transformation rubber seal apparent multi-level correlation feature vector; use The activation function activates the third linear transformation rubber seal apparent multi-level correlation feature vector to obtain a third activated linear transformation rubber seal apparent multi-level correlation feature vector; Taking the respective position feature values in the first activated linear transformation rubber seal apparent multi-level associated feature vector as the first threshold value, taking the respective position feature values in the second activated linear transformation rubber seal apparent multi-level associated feature vector as the second threshold value, taking the respective position feature values in the third activated linear transformation rubber seal apparent multi-level associated feature vector as the third threshold value, the weighted sum of the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector is calculated to obtain the rubber seal apparent multi-scale focused fusion feature vector.
2. The automated production method for rubber seals according to claim 1, characterized in that: The enhanced rubber seal surface image is subjected to multi-level feature extraction based on the appearance of the rubber seal to obtain a rubber seal surface shallow feature map and a rubber seal surface deep feature map, including: The enhanced rubber seal surface image is input into an appearance multi-scale feature extractor based on a hollow pyramid network to obtain the rubber seal surface shallow feature map and the rubber seal surface deep feature map.
3. The automated production method for rubber seals according to claim 2, characterized in that: The rubber seal apparent full-channel feature similarity matrix is normalized to obtain a normalized rubber seal apparent full-channel feature similarity matrix, including: Taking each eigenvalue in the rubber seal component apparent full-channel feature similarity matrix as an exponent of a natural constant to calculate an exponential function value based on the natural constant according to position to obtain a rubber seal component apparent full-channel feature similarity class support matrix; Calculating the sum of each column vector in the rubber seal component apparent full-channel feature similarity class support matrix to obtain a rubber seal component apparent full-channel feature similarity class support column global vector composed of multiple column vector global sum values; The positional division between each eigenvalue in the rubber seal apparent full-channel feature similarity class support matrix and the corresponding column vector global sum value in the rubber seal apparent full-channel feature similarity class support column global vector is calculated to obtain the normalized rubber seal apparent full-channel feature similarity matrix.
4. The automated production method for rubber seals according to claim 3, characterized in that: Inputting the collaborative attention rubber seal apparent shallow feature map and the collaborative attention rubber seal apparent deep feature map into a feature multi-scale focusing module to obtain a collaborative attention rubber seal apparent shallow focusing feature vector and a collaborative attention rubber seal apparent deep focusing feature vector, including: Upsampling the collaboratively focused rubber seal apparent shallow feature map to obtain an upsampled collaboratively focused rubber seal apparent shallow feature map; Performing global mean pooling processing on each feature matrix along the channel dimension in the up-sampled collaboratively focused rubber seal apparent shallow feature map to obtain an up-sampled collaboratively focused rubber seal apparent shallow flow channel feature vector; Performing point convolution encoding on the upsampled collaboratively focused rubber seal apparent shallow channel feature vector to obtain a collaboratively focused rubber seal global apparent shallow feature vector; Performing point convolution encoding on the up-sampled collaboratively focused rubber seal apparent shallow feature map to obtain a channel modulated up-sampled collaboratively focused rubber seal apparent shallow feature map; Performing two-dimensional convolution encoding on the channel modulated up-sampled collaboratively focused rubber seal apparent shallow feature map to obtain a collaboratively focused rubber seal local apparent shallow feature vector; The global apparent shallow feature vector of the collaboratively focused rubber seal and the local apparent shallow feature vector of the collaboratively focused rubber seal are fused to obtain the apparent shallow focused feature vector of the collaboratively focused rubber seal.
5. The automated production method for rubber seals according to claim 4, characterized in that: Taking each position feature value in the first activated linear transformation rubber seal apparent multi-level associated feature vector as the first threshold value, taking each position feature value in the second activated linear transformation rubber seal apparent multi-level associated feature vector as the second threshold value, taking each position feature value in the third activated linear transformation rubber seal apparent multi-level associated feature vector as the third threshold value, calculating the weighted sum of the collaboratively focused rubber seal apparent shallow focus feature vector and the collaboratively focused rubber seal apparent deep focus feature vector to obtain the rubber seal apparent multi-scale focused fusion feature vector, including: Calculating the average of the first threshold value, the second threshold value and the third threshold value to obtain a threshold average; Calculate the product of the feature value of each position in the collaborative attention rubber seal apparent shallow focus feature vector and one minus the threshold mean to obtain a weighted collaborative attention rubber seal apparent shallow focus feature vector; Calculate the product of the feature value of each position in the collaborative attention rubber seal apparent deep focusing feature vector and the threshold mean to obtain a weighted collaborative attention rubber seal apparent deep focusing feature vector; The weighted item collaboratively focusing on the rubber seal apparent shallow focus feature vector and the weighted item collaboratively focusing on the rubber seal apparent deep focus feature vector are added by position to obtain the rubber seal apparent multi-scale focusing fusion feature vector.
6. The automated production method for rubber seals according to claim 5, characterized in that: It also includes a training step: for training the appearance multi-scale feature extractor based on the hollow pyramid network, the collaborative attention module, the feature multi-scale focusing module, the balanced threshold feature vector adaptive fusion module and the classifier-based quality inspection result generator; Wherein, the training step includes: Acquire training data, wherein the training data includes training product appearance images of the rubber seal to be inspected collected by an industrial camera and actual quality inspection results; Performing image enhancement based on contrast normalization on the training product appearance image of the rubber seal to be inspected to obtain a training enhanced rubber seal appearance image; Inputting the training enhanced rubber seal surface image into the appearance multi-scale feature extractor based on the hollow pyramid network to obtain a training rubber seal surface shallow feature map and a training rubber seal surface deep feature map; Inputting the training rubber seal apparent shallow feature map and the training rubber seal apparent deep feature map into the collaborative attention module to obtain the training collaborative attention rubber seal apparent shallow feature map and the training collaborative attention rubber seal apparent deep feature map; Inputting the training collaborative attention rubber seal apparent shallow feature map and the training collaborative attention rubber seal apparent deep feature map into the feature multi-scale focusing module to obtain the training collaborative attention rubber seal apparent shallow focusing feature vector and the training collaborative attention rubber seal apparent deep focusing feature vector; Inputting the training collaborative attention rubber seal apparent shallow focus feature vector and the training collaborative attention rubber seal apparent deep focus feature vector into the balanced threshold feature vector adaptive fusion module to obtain the training rubber seal apparent multi-scale focus fusion feature vector; Inputting the training rubber seal surface multi-scale focused fusion feature vector into the classifier-based quality inspection result generator to obtain a training quality inspection result; Calculating a cross entropy loss function value between the training quality inspection result and the real quality inspection result to obtain a classification loss function value; Based on the classification loss function value, the appearance multi-scale feature extractor based on the hollow pyramid network, the collaborative attention module, the feature multi-scale focusing module, the balanced threshold feature vector adaptive fusion module and the classifier-based quality inspection result generator are trained.
7. An automated production line for rubber seals, using the automated production method for rubber seals according to claim 1, characterized in that: include: An image acquisition module, used for acquiring a product surface image of the rubber seal to be inspected acquired by an industrial camera; An image enhancement module, used for performing image enhancement based on contrast normalization on the product surface image of the rubber seal to be inspected to obtain an enhanced surface image of the rubber seal; A multi-level feature extraction module, used for performing multi-level feature extraction based on the appearance of the rubber seal on the surface image of the enhanced rubber seal to obtain a rubber seal surface shallow feature map and a rubber seal surface deep feature map; An attention module, used for inputting the rubber seal surface superficial feature map and the rubber seal surface deep feature map into a collaborative attention module to obtain a collaborative attention rubber seal surface superficial feature map and a collaborative attention rubber seal surface deep feature map; A feature enhancement fusion module is used to perform feature enhancement fusion processing on the collaboratively focused rubber seal surface shallow feature map and the collaboratively focused rubber seal surface deep feature map based on feature multi-scale focusing and balanced threshold mechanism to obtain a rubber seal surface multi-scale focusing fusion feature vector; The quality inspection result generating module is used to input the rubber seal surface multi-scale focused fusion feature vector into the classifier-based quality inspection result generator to obtain a quality inspection result, and the quality inspection result is used to indicate whether the rubber seal to be inspected has defects.
