Mobile phone shell defect detection method and system based on industrial vision
Through high-resolution imaging, image noise reduction enhancement, feature extraction of gradient direction histogram and hollow convolutional network, combined with the spatial geometric relationship modeling of Capsule Networks, the problem of difficulty in identifying small defects in traditional detection methods is solved, and efficient and accurate detection of defects in mobile phone case is achieved.
Patent Information
- Application Number
- CN202510581636.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-15
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN120495227A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of defect detection, and more particularly, in an embodiment of the present application, relates to a method and system for detecting defects in a mobile phone casing based on industrial vision. Background Art
[0002] As the consumer electronics industry places increasingly stringent demands on product appearance quality, surface defect detection for mobile phone casings has become a key step in intelligent manufacturing. Minor defects such as scratches, dents, and burrs not only affect the aesthetics of the product but may also reduce the durability of the equipment. Traditional manual visual inspections are characterized by low efficiency, strong subjectivity, and high costs. Although industrial vision-based inspection technologies have gradually replaced manual labor, they still face significant challenges in the field of minor defect detection: on the one hand, minor defects (such as sub-pixel scratches and low-contrast color differences) are easily masked by the complex background texture or imaging noise of the metal / plastic casing due to their small size and low signal-to-noise ratio; on the other hand, existing algorithms often rely on single and simple image feature extraction methods (such as edge detection or grayscale threshold segmentation), which makes it difficult to simultaneously model the local texture anomalies and global semantic associations of defects, resulting in a high missed detection rate and frequent false detections.
[0003] Therefore, an optimized solution for detecting defects in mobile phone casings is desired. Summary of the Invention
[0004] In order to solve the above technical problems, the present application is proposed. The embodiment of the present application provides a method and system for detecting defects in mobile phone shells based on industrial vision, which is based on high-resolution industrial imaging, suppresses background noise interference through image denoising and image enhancement preprocessing, and combines the complementary feature extraction of gradient directional histogram and void convolutional network to enhance the local structural characterization capability of tiny defects. Capsule Networks is further introduced to dynamically model the spatial geometric relationship of the state semantics of mobile phone shells, and the attention-driven cross-modal refined global interactive feature interaction mechanism is used to achieve fine-grained alignment and coupling association between the texture distribution features and semantic state features of the mobile phone shell. Finally, through the intelligent classification decision module, various defect types with low contrast and sub-pixel level under complex texture backgrounds are accurately identified, and the detection sensitivity and algorithm robustness are simultaneously improved.
[0005] According to one aspect of the present application, a method for detecting defects in a mobile phone casing based on industrial vision is provided, which includes:
[0006] Capture target mobile phone casing inspection images through a high-resolution industrial camera;
[0007] performing image noise reduction and image enhancement processing on the target mobile phone shell detection image to obtain an enhanced target mobile phone shell detection image;
[0008] Extracting mobile phone shell state texture features from the enhanced target mobile phone shell detection image to obtain mobile phone shell texture distribution correlation features;
[0009] Extracting mobile phone shell state semantic features from the enhanced target mobile phone shell detection image to obtain mobile phone shell state semantic features;
[0010] Performing refined global interactive correlation coding based on the shell state on the mobile phone shell texture distribution correlation feature and the mobile phone shell state semantic feature to obtain a mobile phone shell state multi-dimensional feature fine-grained interactive correlation feature;
[0011] Based on the fine-grained interactive correlation features of the multi-dimensional features of the mobile phone shell state, a defect detection result is determined, and the defect detection result is used to represent a defect type label of the target mobile phone shell surface.
[0012] According to another aspect of the present application, a mobile phone housing defect detection system based on industrial vision is provided, which includes:
[0013] The target mobile phone shell detection image acquisition module is used to acquire the target mobile phone shell detection image through a high-resolution industrial camera;
[0014] a target mobile phone shell detection image preprocessing module, configured to perform image noise reduction and image enhancement processing on the target mobile phone shell detection image to obtain an enhanced target mobile phone shell detection image preserving granularity interaction correlation features;
[0015] The target mobile phone shell surface defect type label representation module is used to determine the defect detection result based on the fine-grained interactive correlation features of the multi-dimensional features of the mobile phone shell state, and the defect detection result is used to represent the defect type label of the target mobile phone shell surface.
[0016] Compared to existing technologies, this application provides a method and system for detecting mobile phone casing defects based on industrial vision. Based on high-resolution industrial imaging, this system suppresses background noise interference through image denoising and image enhancement preprocessing, and combines the complementary feature extraction of gradient directional histograms and dilated convolutional networks to enhance the local structural representation of small defects. Furthermore, Capsule Networks are introduced to dynamically model the spatial geometric relationships of the mobile phone casing state semantics. An attention-driven, cross-modal, refined, global interactive feature interaction mechanism is utilized to achieve fine-grained alignment and coupling between the texture distribution features and semantic state features of the mobile phone casing. Ultimately, through an intelligent classification and decision-making module, multiple low-contrast, sub-pixel defect types can be accurately identified against complex texture backgrounds, simultaneously improving detection sensitivity and algorithm robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other purposes, features, and advantages of the present application will become more apparent through a more detailed description of the embodiments of the present application in conjunction with the accompanying drawings. The accompanying drawings are intended to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the drawings, the same reference numerals generally represent the same components or steps.
[0018] Figure 1 This is a flowchart of a method for detecting defects in a mobile phone casing based on industrial vision according to an embodiment of the present application.
[0019] Figure 2 Schematic diagram of data flow of a method for detecting defects in a mobile phone casing based on industrial vision according to an embodiment of the present application.
[0020] Figure 3 The present invention provides a flowchart for performing refined global interactive correlation coding based on the shell state in the mobile phone shell defect detection method based on industrial vision according to an embodiment of the present application to obtain fine-grained interactive correlation features of the mobile phone shell state multidimensional features.
[0021] Figure 4 This is a flowchart of a method for detecting mobile phone shell defects based on industrial vision according to an embodiment of the present application, which performs principal component analysis on the mobile phone shell texture distribution association feature vector and the mobile phone shell state semantic feature vector and then performs kernel feature encoding to obtain a set of kernel association coding vectors between the principal components of the multidimensional features of the mobile phone shell state.
[0022] Figure 5 This is a system block diagram of a mobile phone casing defect detection system based on industrial vision according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] Various exemplary embodiments, features, and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
[0024] In recent years, although deep learning-based detection methods have made progress in industrial vision, their application is still limited by two problems: first, traditional convolutional neural networks (CNNs) have a fixed receptive field and cannot effectively distinguish between small defects and subtle differences in background texture; second, existing feature fusion strategies mostly use simple splicing or weighting, which fails to fully explore the fine-grained interactions between multimodal features (such as gradient direction distribution and semantic state).
[0025] In response to the above technical problems, the technical solution of this application proposes a method for detecting defects in mobile phone casings based on industrial vision. This method, based on high-resolution industrial imaging, suppresses background noise interference through image denoising and image enhancement preprocessing, and combines the complementary feature extraction of the Histogram of Oriented Gradients (HOG) and the dilated convolutional network to enhance the local structural representation of tiny defects. Capsule Networks are further introduced to dynamically model the spatial geometric relationship of the state semantics of the mobile phone casing, and an attention-driven cross-modal refined global interactive feature interaction mechanism is utilized to achieve fine-grained alignment and coupling between the texture distribution features and semantic state features of the mobile phone casing. Finally, through a global context-aware intelligent classification decision module, various low-contrast, sub-pixel-level defect types in complex texture backgrounds are accurately identified, simultaneously improving detection sensitivity and algorithm robustness.
[0026] In response to the above technical problems, this application proposes a mobile phone casing defect detection method based on industrial vision. Figure 1 This is a flowchart of a method for detecting defects in a mobile phone casing based on industrial vision according to an embodiment of the present application. Figure 2 Schematic diagram of data flow of the method for detecting mobile phone shell defects based on industrial vision according to an embodiment of the present application. Figure 1 and Figure 2 As shown, the mobile phone shell defect detection method based on industrial vision according to the embodiment of the present application includes: S110, collecting the target mobile phone shell detection image through a high-resolution industrial camera; S120, performing image denoising and image enhancement processing on the target mobile phone shell detection image to obtain an enhanced target mobile phone shell detection image; S130, performing mobile phone shell state texture feature extraction on the enhanced target mobile phone shell detection image to obtain mobile phone shell texture distribution association features; S140, performing mobile phone shell state semantic feature extraction on the enhanced target mobile phone shell detection image to obtain mobile phone shell state semantic features; S150, performing refined global interactive correlation encoding on the mobile phone shell texture distribution association features and the mobile phone shell state semantic features based on the shell state to obtain mobile phone shell state multidimensional feature fine-grained interactive correlation features; S160, determining the defect detection result based on the mobile phone shell state multidimensional feature fine-grained interactive correlation features, and the defect detection result is used to represent the defect type label of the target mobile phone shell surface.
[0027] In the aforementioned industrial vision-based method for detecting mobile phone casing defects, step S110 captures an image of the target mobile phone casing using a high-resolution industrial camera. It should be understood that using a high-resolution industrial camera ensures that the captured image contains sufficient detail, which is crucial for accurately identifying and classifying various minor defects. Specifically, high-resolution imaging technology can capture extremely subtle changes on the surface of the mobile phone casing, such as sub-pixel scratches and low-contrast color differences, which are often difficult to detect with the naked eye or traditional low-resolution equipment. Furthermore, high-quality image input provides a solid foundation for subsequent processing steps, such as image noise reduction and enhancement, which helps improve the performance of the final defect detection algorithm. High-resolution cameras not only enhance the visibility of key details in the image but also reduce information loss caused by insufficient resolution, thereby ensuring the integrity and accuracy of the data in the subsequent analysis phase. Especially in the presence of complex background textures or imaging noise, the rich information provided by high-resolution images enables the algorithm to more effectively extract truly useful features amidst numerous interfering factors. Specifically, in practice, industrial cameras are mounted in specific locations to ensure their field of view covers the entire area of the phone casing being inspected. The camera's angle and focal length are adjusted based on specific needs to achieve optimal imaging. Furthermore, to ensure a consistent and stable shooting environment, the light source must be strictly controlled, using a uniform and brightly lit lighting system to eliminate shadow interference and enhance image contrast, ensuring that even the slightest defects are clearly visible. After the preparation phase is complete, the industrial camera is triggered by a computer control system to capture images. This allows for automated operation, including timed capture or triggering capture in response to external signals, to accommodate varying production line speeds and inspection rhythms. The sensor in the industrial camera converts the received light signal into an electrical signal, which is then processed by an analog-to-digital converter (ADC) to form a digital image. During this process, the raw image data is typically pre-processed to minimize noise interference. This includes employing hardware-level noise reduction techniques to suppress random noise, while correction algorithms compensate for lens distortion and other factors that may affect image quality. Furthermore, given the significant differences in the reflective properties of mobile phone cases of different materials and colors, it is necessary to flexibly adjust the exposure time and gain settings to ensure that the acquired image is neither overexposed nor underexposed, thereby accurately reflecting the true condition of the case surface. For certain special application scenarios, such as when the inspection object is a mobile phone case with complex curves or highly reflective properties, it is necessary to utilize multi-angle or multi-viewpoint imaging strategies, that is, taking multiple shots of the same target from different directions, or combining them with special lighting devices such as ring lights and polarized light sources to overcome the visual blind spots caused by light reflections. Doing so not only helps to fully capture all the detailed information on the case surface, but also effectively avoids hidden defects that are difficult to detect under a single viewing angle or ordinary lighting conditions.At the same time, 3D imaging technologies such as structured light scanning or laser triangulation will be introduced to work with high-resolution industrial cameras to generate three-dimensional images containing depth information, further enhancing the understanding of the geometric shape and surface state of the mobile phone case.
[0028] In an embodiment of the present application, step S120, performing image noise reduction and image enhancement processing on the target mobile phone shell detection image to obtain an enhanced target mobile phone shell detection image, includes: S121, performing wavelet noise reduction processing on the target mobile phone shell detection image to obtain a noise-reduced target mobile phone shell detection image; S122, performing contrast enhancement and edge sharpening processing on the noise-reduced target mobile phone shell detection image to obtain the enhanced target mobile phone shell detection image. It should be understood that to address the problem that tiny defects on the surface of mobile phone shells are easily obscured by the complex background texture of metal / plastic materials or imaging noise in images, this solution uses wavelet noise reduction, contrast enhancement, and edge sharpening processing as core preprocessing steps. Specifically, image noise reduction and image enhancement processing are performed on the target mobile phone shell detection image to obtain an enhanced target mobile phone shell detection image. Among them, because the industrial imaging process is easily disturbed by factors such as ambient light fluctuations and sensor noise, wavelet noise reduction selectively filters out high-frequency noise components through multi-scale decomposition, which can suppress the random interference of background texture while preserving the subtle defect edge structure; contrast enhancement stretches the grayscale difference between the defect area and the normal area through adaptive histogram equalization, significantly improving the recognizability of low-contrast defects (such as color difference and shallow scratches); and edge sharpening processing uses the Laplace operator to enhance the high-frequency information of the defect contour to compensate for the edge weakening caused by imaging blur. This combined strategy aims to synergistically optimize the input image quality from three dimensions: noise suppression, feature enhancement, and edge recovery, providing basic data with high signal-to-noise ratio and high discrimination for subsequent HOG feature extraction and multi-scale analysis of mobile phone shell status features, thereby solving the problems of missed detection and false detection caused by insufficient image quality in traditional methods.
[0029] Specifically, step S121 performs wavelet denoising on the target mobile phone casing inspection image to obtain a denoised target mobile phone casing inspection image. It should be understood that due to the inevitable interference from factors such as ambient light fluctuations and sensor noise during the imaging process, the originally acquired target mobile phone casing inspection image often contains various types of noise, which can obscure or confuse actual minor defect features, such as sub-pixel scratches or low-contrast chromatic aberration. Wavelet denoising, as a widely used and highly effective method, can effectively remove background noise while preserving image edge structure information, providing high-quality basic data for subsequent feature extraction and defect detection. Specifically, wavelet denoising first decomposes the target mobile phone casing inspection image into coefficient representations of different frequency subbands through multi-scale decomposition based on wavelet transform theory. This process leverages the localized nature of wavelet basis functions, flexibly adapting to the different frequency components of the signal and establishing a balanced relationship between the spatial and frequency domains. Here, appropriate wavelet basis functions (such as Daubechies, Symlets, and Coiflets) and an appropriate number of decomposition levels are typically selected to ensure that both detailed image information is fully captured and high-frequency noise components are effectively suppressed. Once the above parameter settings are determined, a two-dimensional discrete wavelet transform (DWT) is performed on the input target mobile phone case inspection image, decomposing it into several approximate components (LL) and detail components (LH, HL, and HH) at different scales. The approximate components represent the main contour information of the image, while the detail components contain high-frequency information such as edges and texture, as well as potential noise components. Next, thresholding is performed on the coefficients of each subband obtained after decomposition. Depending on the noise characteristics and the desired noise reduction effect, either hard thresholding or soft thresholding can be used to adjust the values of each subband coefficient. The hard thresholding method directly sets coefficients below the set threshold to zero, while leaving coefficients above the threshold unchanged. In contrast, the soft thresholding method not only sets coefficients below the threshold to zero but also shrinks coefficients above the threshold according to a specific rule, thereby further smoothing the image and reducing artifacts. The choice of threshold is crucial, as it directly affects the quality of the noise reduction results: if the threshold is too low, the noise cannot be effectively removed; conversely, if the threshold is too high, the useful signal may also be filtered out, resulting in image blur and distortion. In practice, the Stein's Unbiased Risk Estimate (SURE) criterion or other adaptive methods are often combined to dynamically determine the optimal threshold to ensure that the influence of noise is eliminated to the greatest extent possible while retaining the important features of the original image as completely as possible. After completing the threshold processing, the modified subband coefficients need to be recombined and the denoised target mobile phone case inspection image reconstructed through the inverse two-dimensional discrete wavelet transform (IDWT).In this process, although some high-frequency noise components have been weakened or removed, the key edges and subtle structures in the image are still retained due to the adoption of a reasonable threshold strategy and wavelet basis function selection. This allows the final output denoised image to maintain high clarity and contrast while significantly reducing false features caused by noise. In addition, compared with traditional linear or nonlinear smoothing techniques such as mean filtering and median filtering, wavelet denoising is more flexible and targeted. It can take differentiated processing measures based on the specific conditions of the local area of the image, avoiding the over-smoothing or under-smoothing problems that may be caused by one-size-fits-all global processing. Especially for objects with complex texture backgrounds such as mobile phone cases, wavelet denoising can better distinguish the difference between normal textures and abnormal defects, laying a solid foundation for subsequent accurate defect location and classification.
[0030] Specifically, step S122 performs contrast enhancement and edge sharpening on the denoised target mobile phone case detection image to obtain the enhanced target mobile phone case detection image. It should be understood that although the denoised target mobile phone case detection image has removed most of the background noise interference, its contrast and edge clarity may still be insufficient to meet the needs of subsequent complex feature extraction and defect detection. Performing contrast enhancement and edge sharpening on the denoised image can significantly improve the overall quality of the image, making tiny defect features more prominent and providing more reliable basic data for subsequent analysis. Specifically, since mobile phone cases usually have a complex texture background and the grayscale differences of some defects (such as shallow scratches or low-contrast color differences) in the original image are very weak, it makes it extremely challenging to accurately identify these defects directly from the denoised image. Contrast enhancement technology can effectively stretch the grayscale value distribution range of different areas in the image, thereby increasing the distinction between normal areas and defective areas. Among these, methods such as adaptive histogram equalization (AHE) or contrast-constrained adaptive histogram equalization (CLAHE) can significantly improve contrast in local image regions without introducing excessive noise amplification. These methods remap the grayscale histogram within each pixel's neighborhood, making the previously flat grayscale distribution more uniform and enhancing the visibility of detailed information. Furthermore, the degree of contrast enhancement can be adjusted according to actual needs to balance the relationship between image brightness and contrast, avoiding information distortion caused by excessive enhancement. This refined contrast adjustment strategy not only effectively improves overall image readability and detail, but also helps the algorithm more accurately capture subtle defect features hidden within complex backgrounds. Furthermore, in industrial visual inspection scenarios, many types of defects (such as scratches and dents) manifest as edge changes or sudden changes in contours in specific directions. However, during the imaging process, lens blur or other factors can weaken this important edge information, making it difficult to accurately capture the relevant features in the subsequent feature extraction stage. Therefore, edge sharpening has become an important method for improving image edge clarity. Classic edge sharpening methods include gradient operators based on first-order derivatives (such as the Sobel and Prewitt operators) and the Laplace operator based on second-order derivatives. These operators highlight edge locations by calculating the gradient strength or curvature change at each pixel in the image. In recent years, with the development of deep learning technology, convolutional neural networks (CNNs) have also been widely used in edge detection tasks. Compared with traditional methods, CNN-based methods can better adapt to different types of edge features and reduce the occurrence of false edge phenomena. Regardless of the specific edge sharpening algorithm used, in actual operation, it is necessary to carefully balance the relationship between the degree of sharpening and noise suppression to avoid excessive sharpening that exacerbates the effects of noise.At the same time, considering the diverse materials and surface conditions of mobile phone cases, appropriate parameter configurations should be selected for different application scenarios to ensure that true edge information is restored to the maximum extent possible while maintaining the overall smoothness and consistency of the image. This not only helps reveal subtle defects hidden in complex backgrounds, but also provides a strong technical foundation for efficient and accurate automated inspection.
[0031] In an embodiment of the present application, step S130, extracting phone case state texture features from the enhanced target phone case detection image to obtain phone case texture distribution correlation features, includes: S131, extracting HOG features from the enhanced target phone case detection image to obtain a phone case gradient direction histogram; S132, passing the phone case gradient direction histogram through a phone case texture distribution feature extractor based on a dilated convolutional neural network model to obtain a phone case texture distribution correlation feature vector as the phone case texture distribution correlation feature. It should be understood that to address the problem that existing algorithms relying on a single feature extraction method (such as edge detection or grayscale threshold segmentation) are unable to effectively capture minor defects and local texture anomalies, this solution adopts a cascade processing strategy of HOG feature extraction and a dilated convolutional network. Specifically, because the gradient direction distribution features of defects such as scratches and dents on the phone case surface are easily assimilated by the complex background texture of the metal / plastic material, the technical solution of the present application further extracts HOG features from the enhanced target phone case detection image to obtain a phone case gradient direction histogram. It is worth mentioning that HOG can explicitly characterize the geometric structure of the defect edge by calculating the statistical histogram of the gradient direction of the local area, but its single scale characteristic makes it difficult to distinguish the subtle differences between small defects and background noise. To this end, a hole convolutional neural network is further introduced to perform multi-scale context-aware modeling on the HOG feature. That is, the gradient direction histogram of the mobile phone shell is passed through a mobile phone shell texture distribution feature extractor based on a hole convolutional neural network model to obtain a mobile phone shell texture distribution associated feature vector. In particular, it is worth mentioning that the hole convolutional neural network model expands the receptive field by adjusting the expansion rate (such as 2 / 4 / 8), capturing a wider range of texture association patterns without reducing the resolution, thereby suppressing local background interference and enhancing the multi-scale texture consistency of the defect area. This combined strategy aims to solve the problems of missed detection and false detection caused by the insufficient local structural characterization of small defects in the state of the mobile phone shell by the traditional method through the collaborative analysis of gradient direction distribution and multi-scale texture context.
[0032] Specifically, step S131 extracts HOG features from the enhanced target phone case detection image to obtain a histogram of oriented gradients of the phone case. It should be understood that, given the various types of defects that may exist on the surface of a phone case, such as scratches and dents, these defects typically manifest as edge variations or texture anomalies within a localized area. However, traditional image feature extraction methods often struggle to effectively capture these subtle variations, especially in contexts with complex background textures, which can easily lead to misjudgments or missed detections. The HOG (Histogram of Oriented Gradients) feature calculates and statistically analyzes the distribution of gradient directions between pixels within a localized area, providing a method that is relatively robust to illumination variations and effectively describes object shape and edge information. Specifically, to extract HOG features and obtain a histogram of oriented gradients from the enhanced target phone case detection image, the input image must first be segmented into multiple small, overlapping or non-overlapping cells. This segmentation approach not only helps improve the resolution of feature description but also better adapts to detail variations at different scales. For each pixel within a cell, the horizontal and vertical gradient values are calculated. This step can be achieved by applying the Sobel operator or other similar gradient filters. This method obtains the gradient magnitude and direction information at each pixel. It is worth noting that in practice, to avoid noise interference and improve algorithm stability, the calculated gradient values are often smoothed, for example, by preprocessing the original gradient image using Gaussian blurring. Next, within each cell, a histogram is constructed based on the calculated gradient direction information. The key here lies in how to properly set the direction bins and assign weights. Generally, the 360-degree direction range is evenly divided into several bins (bins). A common practice is to divide it into nine bins, each covering a 40-degree angle range. For each pixel, its corresponding gradient direction is assigned to a corresponding bin, and the count values in that bin are weighted and accumulated based on the magnitude of the gradient. This results in a histogram that reflects the overall distribution of the gradient directions for all pixels within the cell. Because of the weighted accumulation approach, even in the presence of noise or gradient estimation errors, these errors can be compensated to a certain extent, ensuring the stability and reliability of feature description. To further enhance feature description capabilities, several adjacent cells are typically combined into a larger block, and the histogram vectors of each cell within the block are normalized. This block-based normalization strategy not only effectively reduces the impact of varying lighting conditions but also further improves the discriminability of feature descriptions.Specifically, by applying L2 norm normalization or other forms of standardization to the histogram vector within each block, the feature vector can be made more compact and representative. This also provides a more favorable data foundation for subsequent machine learning model learning. Throughout the HOG feature extraction process, block design and size selection are crucial, directly impacting the quality and efficiency of the final feature description. A reasonable block size setting ensures sufficiently detailed feature descriptions while avoiding excessive computational costs. Furthermore, to ensure that the extracted HOG features fully reflect the surface conditions of the mobile phone case, parameter configuration needs to be adjusted based on the specific inspection task requirements. For example, parameters such as cell size, block size, and the number of gradient direction intervals can be flexibly adjusted based on the characteristics of the defect type being detected. For smaller and more complex defects, appropriately reducing the cell size can improve the resolution of the feature description; for larger defects, increasing the cell size can reduce computational complexity. Thus, through a carefully designed and optimized HOG feature extraction process, a set of feature descriptors with rich detail and good stability can be obtained from the enhanced target mobile phone case inspection image.
[0033] Specifically, step S132 involves passing the mobile phone shell gradient direction histogram through a mobile phone shell texture distribution feature extractor based on a dilated convolutional neural network model to obtain a mobile phone shell texture distribution correlation feature vector as the mobile phone shell texture distribution correlation feature. It should be understood that, given the challenges faced by traditional image processing techniques in capturing subtle defects, particularly subtle changes such as sub-pixel scratches and low-contrast color differences, simple edge detection or grayscale threshold segmentation methods often fail to provide sufficient accuracy and reliability. Dilated Convolutional Neural Networks (DCNs) can expand the receptive field without reducing resolution, thereby better capturing texture patterns at different scales. Specifically, to achieve the conversion from the mobile phone shell gradient direction histogram to the mobile phone shell texture distribution correlation feature vector, it is first necessary to construct a DCN architecture suitable for this task. This architecture typically includes multiple layers of dilated convolutional layers, each configured with a different dilation rate to capture texture information at different scales. The dilation rate determines the receptive field size of each convolution kernel and the spacing between adjacent convolution kernels. By properly setting the dilation rate, the network's receptive field can be significantly increased while maintaining the original input resolution, enabling the model to simultaneously focus on local details and global context. For example, a small dilation rate might be used in the first layer to focus on extracting local texture features, while the dilation rate is gradually increased in subsequent layers to encompass a wider range of background information. This ensures sensitivity to small defects while maintaining an understanding of the overall structure. Next, before inputting the gradient direction histogram of the phone case into the dilated convolutional neural network, it undergoes appropriate preprocessing to adapt it to the network's input format requirements. This step may include resizing and normalization to ensure data consistency and stability. Once prepared, the gradient direction histogram is fed into the network for feature extraction. Within the network, the dilated convolution operation in each layer scans the input feature map according to the set dilation rate and calculates the corresponding activation response. Due to the use of a non-zero dilation rate, the actual spacing between the convolution kernels involved in the operation increases, meaning that each convolution operation not only considers directly adjacent pixels but also information from pixels at a certain distance. This property is particularly suitable for processing scenes with repetitive patterns or complex textures, such as brushed metal surfaces or frosted plastic materials, because their texture distribution often spans multiple scales, which makes it difficult for single-scale feature extraction methods to fully cover them. As data is passed layer by layer in the network, each layer generates new feature representations, which gradually evolve from the original gradient direction information to more abstract and context-rich texture descriptors.During this process, dilated convolutional neural networks may also incorporate other mechanisms, such as skip connections, to mitigate the vanishing gradient problem and enhance information flow efficiency. Skip connections allow shallower features to directly participate in the combination of deeper features, which is crucial for preserving important local details. Furthermore, to further enhance the model's expressiveness, regularization techniques such as batch normalization and dropout can be introduced to improve stability and generalization during training. Ultimately, after a series of dilated convolution operations, the network outputs feature vectors associated with the texture distribution of the phone case, which collectively reflect the key characteristics of the texture distribution at various scales in the input image. Notably, while these features appear to be merely numerically encoded, they actually contain rich semantic information, accurately characterizing the microstructural features of the phone case's surface. For example, a very fine scratch may reveal a gradient anomaly in a specific direction, while an area with low-contrast color differences may reveal a unique texture pattern within the color transition range. The texture distribution correlation feature vector of the mobile phone case obtained in this way not only has a high degree of discrimination, but also has strong robustness to factors such as changes in lighting conditions and noise interference.
[0034] In an embodiment of the present application, the step S140, performing mobile phone shell state semantic feature extraction on the enhanced target mobile phone shell detection image to obtain mobile phone shell state semantic features, includes: passing the enhanced target mobile phone shell detection image through a mobile phone shell state semantic feature extractor based on CapsNets to obtain a mobile phone shell state semantic feature vector as the mobile phone shell state semantic feature. It should be understood that in order to address the problem that traditional convolutional neural networks (CNNs) lose spatial hierarchical information of defects due to fixed receptive fields and pooling operations, in the technical solution of the present application, the enhanced target mobile phone shell detection image is further passed through a mobile phone shell state semantic feature extractor based on CapsNets to obtain a mobile phone shell state semantic feature vector. It is worth mentioning that this solution adopts a mobile phone shell state semantic feature extractor based on Capsule Networks (CapsNets), which aims to break through the limitations of traditional models in their ability to model the geometric attributes and spatial distribution of tiny defects, thereby capturing the semantic feature information of the mobile phone shell state. Since surface defects on mobile phone cases (such as deformation and burrs) often exhibit non-rigid geometric features (such as changes in orientation and depth), the translation invariance characteristics of traditional CNNs tend to ignore their spatial relationships. CapsNets, on the other hand, probabilistically couple low-level feature capsules with high-level semantic capsules through a dynamic routing algorithm, explicitly modeling the geometric transformations of defects (such as rotation and deformation) and the spatial topological relationships between their components (such as the adaptability of scratch direction to the case surface). This allows them to accurately distinguish subtle differences between background textures and real defects, thus resolving the problem of misjudgment caused by the lack of spatial information about defects in complex texture backgrounds.
[0035] Figure 3 The present invention provides a flowchart of a method for detecting mobile phone shell defects based on industrial vision according to an embodiment of the present invention, wherein the mobile phone shell texture distribution correlation feature and the mobile phone shell state semantic feature are subjected to refined global interactive correlation coding based on the shell state to obtain the mobile phone shell state multi-dimensional feature fine-grained interactive correlation feature. Figure 3As shown, in an embodiment of the present application, the step S150 performs refined global interactive correlation coding based on the shell state on the texture distribution association feature of the mobile phone shell and the semantic feature of the mobile phone shell state to obtain the fine-grained interactive correlation feature of the multidimensional feature of the mobile phone shell state, including: S151, performing principal component analysis on the texture distribution association feature vector of the mobile phone shell and the semantic feature vector of the mobile phone shell state and then performing kernel feature coding to obtain a set of kernel correlation coding vectors between the principal components of the multidimensional feature of the mobile phone shell state; S152, calculating the principal components of the multidimensional feature of the mobile phone shell state The kernel correlation dynamic performance characterization between each two kernel correlation coding vectors of the principal components of the multidimensional features of the mobile phone shell state in the set of inter-kernel correlation coding vectors is used to obtain the correlation topology matrix of the multidimensional kernel correlation dynamic performance characterization of the mobile phone shell state; S153, based on the correlation topology matrix of the multidimensional kernel correlation dynamic performance characterization of the mobile phone shell state, the set of kernel correlation coding vectors of the principal components of the multidimensional features of the mobile phone shell state is subjected to graph-structured correlation coding to obtain the fine-grained interactive correlation feature matrix of the multidimensional features of the mobile phone shell state as the fine-grained interactive correlation feature of the multidimensional features of the mobile phone shell state. It should be understood that in the actual production scenario of mobile phone shells, the complex surface texture of brushed metal or frosted plastic materials often causes visual confusion with tiny defects (such as sub-pixel scratches and shallow dents in curved surface areas). For example, the regular directional gradient feature of the brushed metal texture easily masks the edge response of the same-direction scratch, and the traditional method that relies only on a single feature will cause the background texture to be mistakenly judged as a defect. In addition, since the detection of surface defects of mobile phone cases needs to take into account both local texture anomalies (such as scratch gradient distribution) and global semantic states (such as deformation space geometry), traditional methods ignore the potential cross-modal association rules between features, which easily leads to feature conflicts or information redundancy. Therefore, in order to address the problem of insufficient multimodal feature interaction caused by the use of single features or simple feature fusion strategies (such as direct splicing or weighting) in existing algorithms, this solution performs a refined global interactive correlation encoding based on the shell state on the mobile phone case texture distribution association feature vector and the mobile phone case state semantic feature vector to obtain a fine-grained interactive correlation feature matrix of the multi-dimensional features of the mobile phone case state, aiming to solve the challenge of nonlinear coupling between texture distribution and semantic state features, thereby more fully and accurately representing the mobile phone case state and assisting in the subsequent defect detection of the mobile phone case surface.
[0036] Specifically, in the process of refined global interaction-correlation coding based on the shell state, this solution first performs principal component analysis on the mobile phone shell texture distribution correlation feature vector and the mobile phone shell state semantic feature vector. Through orthogonal transformation, it decouples multicollinearity and extracts a set of low-dimensional, linearly independent principal component encoding vectors, thereby stripping out the collinear interference between the brushed metal texture and the real defects (for example, filtering out redundant gradient components that are highly correlated with the background texture), providing a de-redundancy basis for subsequent association modeling. Furthermore, through principal component kernel association coding, feature pairs between the linearly inseparable principal components of the mobile phone shell texture distribution and the semantic principal components of the mobile phone shell state (such as weak color difference and normal texture under a brushed metal background) are mapped to a high-dimensional space. A deep network is then used to learn their nonlinear coupling relationships and nonlinear interaction patterns (for example, the spectral reflectance anomaly pattern of the color difference region under specific illumination angles). On this basis, a correlation topology matrix of the kernel correlation dynamic performance characterization is constructed to quantify the synergistic strength between the scratch gradient distribution and the dent geometric state (such as the spatial matching degree between the scratch direction and the curvature of the shell surface), and a graph convolutional neural network (GCN) is introduced to combine multi-hop correlation information (such as the correlation between the burrs at the corners of the metal shell and the texture mutations in the adjacent areas), perform multi-hop message aggregation on the global correlation pattern, and finally output a fine-grained interactive correlation feature matrix of the multi-dimensional features of the mobile phone shell state.
[0037] Figure 4 This is a flowchart of the method for detecting mobile phone shell defects based on industrial vision according to an embodiment of the present application, which performs principal component analysis on the mobile phone shell texture distribution correlation feature vector and the mobile phone shell state semantic feature vector and then performs kernel feature encoding to obtain a set of kernel correlation coding vectors between the principal components of the mobile phone shell state multidimensional feature. Figure 4 As shown, in an embodiment of the present application, the step S151, performing principal component analysis on the mobile phone shell texture distribution association feature vector and the mobile phone shell state semantic feature vector and then performing kernel feature encoding to obtain a set of kernel association coding vectors between principal components of the multidimensional feature of the mobile phone shell state, includes: S1511, performing feature principal component analysis on the mobile phone shell texture distribution association feature vector and the mobile phone shell state semantic feature vector respectively to obtain a set of mobile phone shell texture distribution feature principal component coding vectors and a set of mobile phone shell state semantic feature principal component coding vectors; S1512, performing principal component kernel association coding on each group of corresponding mobile phone shell texture distribution feature principal component coding vectors and mobile phone shell state semantic feature principal component coding vectors in the set of mobile phone shell texture distribution feature principal component coding vectors and the set of mobile phone shell state semantic feature principal component coding vectors to obtain a set of kernel association coding vectors between principal components of the multidimensional feature of the mobile phone shell state.
[0038] Specifically, in step S1511, principal component analysis is performed on the mobile phone shell texture distribution association feature vector and the mobile phone shell state semantic feature vector to obtain a set of mobile phone shell texture distribution feature principal component coding vectors and a set of mobile phone shell state semantic feature principal component coding vectors, which are expressed as follows using the mobile phone shell feature principal component analysis formula:
[0039]
[0040] Among them, V1 is the associated feature vector of the mobile phone shell texture distribution, V2 is the semantic feature vector of the mobile phone shell state, PCA(·) is the feature principal component analysis, C1 and C2 are the mobile phone shell texture distribution covariance matrix and the mobile phone shell state covariance matrix respectively, X is the set of the principal component coding vectors of the mobile phone shell texture distribution feature, Y is the set of the principal component coding vectors of the mobile phone shell state semantic feature, x1, x2, x m are the first, second and mth principal component coding vectors of the mobile phone shell texture distribution feature in the set of principal component coding vectors of the mobile phone shell texture distribution feature, y1, y2, y m are the first, second and mth principal component coding vectors of the state semantic features of the mobile phone shell in the set of principal component coding vectors of the state semantic features of the mobile phone shell, Λ1 is the diagonal matrix of the texture distribution feature of the mobile phone shell, λ 11 and λ 1m x1 and x m The corresponding eigenvalue, Λ2 is the diagonal matrix of the semantic features of the mobile phone shell state, λ 21 and λ 2m y1 and y mCorresponding eigenvalues. It should be understood that the core motivation for principal component analysis (PCA) is to address the ubiquitous multicollinearity problem between raw features. Because texture features and semantic features may exhibit significant linear correlation when describing the state of a mobile phone case (for example, gradient direction distribution and local deformation features may exhibit homologous responses under specific defect patterns), this redundancy directly impacts the stability and interpretability of subsequent correlation analysis. Through PCA's orthogonal transformation mechanism, the original high-dimensional feature space is decoupled into several linearly independent principal component dimensions, effectively extracting the low-dimensional structure that characterizes the defect's essential characteristics while suppressing interfering components such as background noise and material texture. The essential goal of this step is to construct a de-redundant feature basis, enabling subsequent principal component-based kernel correlation dynamic performance representation and graph structure encoding to more accurately capture the nonlinear coupling relationship between texture anomalies and semantic states. Effectively, principal component analysis compresses feature dimensions into a physically meaningful low-dimensional space while preserving the original information. This significantly improves the computational efficiency of cross-modal feature interaction and, through feature decoupling, enhances the model's ability to jointly characterize local structural anomalies and global geometric changes in small defects.
[0041] Specifically, in step S1512, each corresponding group of the mobile phone shell texture distribution feature principal component coding vectors and the mobile phone shell state semantic feature principal component coding vectors in the set of the mobile phone shell texture distribution feature principal component coding vectors and the set of the mobile phone shell state semantic feature principal component coding vectors are respectively subjected to principal component kernel association coding to obtain a set of kernel association coding vectors between principal components of the mobile phone shell state multidimensional feature, which is expressed as the mobile phone shell principal component kernel association coding formula:
[0042]
[0043] Among them, x i is the i-th mobile phone shell texture distribution feature principal component coding vector in the set of mobile phone shell texture distribution feature principal component coding vectors, y i is the i-th mobile phone shell state semantic feature principal component encoding vector in the set of mobile phone shell state semantic feature principal component encoding vectors, ||·‖ represents the vector norm, α and β represent trainable weighted hyperparameters respectively, v iis the kernel correlation encoding vector for the i-th principal component of the multidimensional features of the mobile phone case state in the set of kernel correlation encoding vectors. It should be understood that because the directional distribution of texture gradients and semantic geometric features may have complex nonlinear correlations when describing defects (for example, the periodic directional characteristics of brushed metal textures and the surface deformation characteristics of dents exhibit an implicit coupling relationship in spatial distribution), traditional linear correlation methods have difficulty effectively capturing such patterns. By introducing a kernel function to map features to a high-dimensional space, it is possible to explicitly construct nonlinear interactions between features while preserving their original physical meaning. This allows defect patterns that were originally difficult to distinguish in low-dimensional space to form separable feature pairs in high-dimensional space. The essential goal of this step is to dynamically optimize feature correlation weights through the adaptive kernel learning mechanism of deep neural networks, so that principal component pairs with strong semantic connections produce a synergistic response in the encoding space, while irrelevant or weakly related pairs are suppressed. In this way, the decoupling characteristics of principal component analysis are retained, and the nonlinear modeling capability of feature interaction is given through kernel techniques, providing an intermediate representation with both geometric meaning and semantic association for subsequent graph structure encoding, significantly improving the effectiveness of cross-modal feature fusion.
[0044] Specifically, step S152 calculates the kernel correlation dynamic efficiency representation between each two kernel correlation coding vectors between the principal components of the multidimensional features of the mobile phone shell state in the set of the kernel correlation coding vectors to obtain the kernel correlation dynamic efficiency representation topology matrix of the multidimensional kernel correlation dynamic efficiency representation of the mobile phone shell state, which is expressed as the kernel correlation dynamic efficiency representation formula of the mobile phone shell:
[0045]
[0046] Among them, v i,k and v j,k are the eigenvalues of the kth position in the kernel correlation coding vector between the principal components of the multidimensional features of the mobile phone shell state, respectively. n is the number of eigenvalues in the kernel correlation coding vector between the principal components of the multidimensional features of the mobile phone shell state. i ,v j ) is v i and v j The multi-dimensional kernel correlation dynamic performance characterization of the mobile phone shell state, M Ais the correlation topology matrix of the multidimensional kernel correlation dynamic performance representation of the mobile phone shell state. It should be understood that by quantifying the nonlinear interaction strength between the kernel correlation encoding vector feature pairs between each two principal components of the multidimensional features of the mobile phone shell state, the problem of insufficient modeling of cross-modal feature correlation patterns by traditional methods can be solved. Because the local texture anomalies (such as scratch gradient distribution) and global semantic states (such as dent surface deformation) of mobile phone shell defects often exhibit an implicit coupling relationship, relying solely on linear correlation analysis is difficult to capture such complex patterns. The kernel correlation dynamic performance representation maps features to a high-dimensional space through a kernel function. While retaining the original physical meaning, it explicitly constructs a nonlinear similarity measure between features, so that defect patterns that were originally difficult to distinguish in low-dimensional space form separable feature pairs in high-dimensional space. The essential goal of this step is to screen out feature pairs with strong semantic associations for defect classification by dynamically adjusting the association weights, and suppress the interference of irrelevant or weakly associated features. The resulting correlation topology matrix of the multidimensional kernel-correlated dynamic performance representation of the phone case state serves as the adjacency matrix of the graph neural network. Its element values directly reflect the strength of the synergy between feature pairs, providing a clear message passing path for subsequent graph convolution operations. This design allows the model to focus on key feature interactions, reducing redundant computations while enhancing the ability to jointly characterize small defects, local structural anomalies, and global geometric changes, thereby improving the detection algorithm's adaptability and interference resistance to complex textured backgrounds.
[0047] In an embodiment of the present application, the step S153, based on the mobile phone shell state multidimensional kernel correlation dynamic performance characterization quantity correlation topology matrix, performs graph structure-based correlation coding on the set of kernel correlation coding vectors between principal components of the mobile phone shell state multidimensional features to obtain a mobile phone shell state multidimensional feature fine-grained interactive correlation feature matrix as the mobile phone shell state multidimensional feature fine-grained interactive correlation feature, including: S1531, performing mobile phone shell state multidimensional feature spatial distribution consistency calibration on each mobile phone shell state multidimensional feature principal component kernel correlation coding vector in the set of mobile phone shell state multidimensional feature principal component kernel correlation coding vectors to obtain a set of optimized mobile phone shell state multidimensional feature principal component kernel correlation coding vectors; S1532, inputting the set of optimized mobile phone shell state multidimensional feature principal component kernel correlation coding vectors and the mobile phone shell state multidimensional kernel correlation dynamic performance characterization quantity correlation topology matrix into a graph convolutional neural network model to obtain the mobile phone shell state multidimensional feature fine-grained interactive correlation feature matrix.
[0048] Specifically, the step S1531 performs a calibration on the consistency of the spatial distribution of the multidimensional features of the mobile phone shell state for each kernel correlation coding vector between the principal components of the multidimensional features of the mobile phone shell state in the set of the kernel correlation coding vector between the principal components of the multidimensional features of the mobile phone shell state to obtain a set of kernel correlation coding vectors between the principal components of the multidimensional features of the mobile phone shell state after optimization. It should be understood that in the operation process of the graph convolutional neural network model, the kernel correlation coding vector between the principal components of the multidimensional features of the mobile phone shell state is used as the topological architecture space, and each kernel correlation coding vector between the principal components of the multidimensional features of the mobile phone shell state will follow the spatial distribution law as a graph node. Since there is a dimensional mismatch between the kernel correlation coding vector between the principal components of the multidimensional features of the mobile phone shell state and the correlation topology matrix, it is necessary to construct an initial multidimensional feature cross-section function matrix of the mobile phone shell state as the spatial normative mapping matrix. At the same time, it is necessary to correct the distribution disorder of the initial matrix caused by the initial random perturbation. First, the kernel correlation coding vector v between the principal components of the multidimensional features of the mobile phone shell state is used as the topological architecture space. i The corresponding initial mobile phone shell state multidimensional characteristic cross-section function matrix M Bi Perform matrix multiplication to obtain the multidimensional characteristic cross-section compactification vector v of the mobile phone shell state Bi , and then the kernel correlation coding vector v between the principal components of the multidimensional features of each mobile phone shell state i The corresponding multi-dimensional characteristic cross-section compactification vector v of the mobile phone shell state Bi Two-dimensional splicing to obtain the multi-dimensional characteristic cross-section compactification matrix M of the mobile phone shell state C :
[0049]
[0050] M C =(v B1 T ,v B2 T ,…)
[0051] Among them, v i is the kernel correlation coding vector between principal components of the multidimensional features of the mobile phone shell state of the i-th mobile phone shell state multidimensional features principal components, M Bi is the multidimensional characteristic cross-section function matrix of the initial mobile phone shell state, is matrix multiplication, v Bi is the i-th mobile phone shell state multidimensional feature cross-section compactification vector in the sequence of mobile phone shell state multidimensional feature cross-section compactification vectors, (·,·,…) is the two-dimensional splicing processing, M C It is the compactification matrix of the multi-dimensional characteristic cross section of the mobile phone shell state.
[0052] In this way, the multi-dimensional characteristic cross-section compactification matrix M of the mobile phone shell state can be calculatedC The topological matrix M associated with the multidimensional core dynamic performance characterization quantity of the mobile phone shell state A The Gaussian correlation coefficient between them is made to approach zero to iterate the initial mobile phone shell state multidimensional characteristic cross-section function matrix M Bi To obtain the multi-dimensional characteristic cross-section function matrix M of the optimized mobile phone shell state Bi ':
[0053]
[0054] in, For positional subtraction, ||·|| F is the F norm of the matrix, σ 2 It's M C With M A The variance of the set of all matrix values composed of , exp is the natural exponential function value with the natural constant e as the base.
[0055] Therefore, by optimizing the multidimensional characteristic cross-section function matrix M of the mobile phone shell state Bi 'To optimize the kernel correlation coding vector between the principal components of the multidimensional features of the mobile phone shell state:
[0056]
[0057] Among them, M Bi 'To optimize the multidimensional characteristic cross-section function matrix of the mobile phone shell state, v' i is the optimized kernel correlation coding vector between principal components of the multidimensional features of the i-th mobile phone shell state corresponding to the kernel correlation coding vector between principal components of the multidimensional features of the i-th mobile phone shell state.
[0058] During the operation of the graph convolutional neural network model, the kernel correlation encoding vectors between the principal components of the multidimensional features of the phone case state under the influence of a random potential field are topologically constrained by optimizing the spatial canonical mapping matrix. This effectively eliminates the topological spatial disorder caused by the disordered initial matrix distribution, thereby improving the accuracy of the graph neural network's analysis of defect feature correlations. Specifically, this mechanism iterates the kernel correlation encoding vectors between the principal components of the multidimensional features of the phone case state. While maintaining the nonlinear interaction capability of multimodal features, it suppresses topological structural instability caused by random noise, enabling the model to more accurately capture the fine-grained geometric features and texture anomaly patterns of phone case surface defects, ultimately achieving a systematic enhancement in the stability of detection results.
[0059] Specifically, in step S1532, the set of kernel correlation coding vectors between principal components of the optimized mobile phone shell state multidimensional features and the correlation topology matrix of the mobile phone shell state multidimensional kernel correlation dynamic effectiveness representation are input into the graph convolutional neural network model to obtain the mobile phone shell state multidimensional feature fine-grained interactive correlation feature matrix, which is expressed as the mobile phone shell state multidimensional feature fine-grained interactive correlation formula:
[0060]
[0061] Among them, GCN(·,·) represents the graph convolutional neural network model, M c The optimized kernel correlation encoding vectors for the multidimensional features of the mobile phone case state map the low-dimensional linearly inseparable features to a high-dimensional space using kernel functions. However, the long-range dependencies and spatial topology between features still need to be explicitly modeled through a graph structure. The topological matrix of the dynamic performance representation of the multidimensional kernel correlation of the mobile phone case state serves as the adjacency matrix of the graph neural network, defining the dynamic interaction weights between feature pairs. The optimized kernel correlation encoding vectors for the multidimensional features of the mobile phone case state provide an initial representation for the graph nodes that incorporates multi-scale semantic information. Through multi-layer convolution operations, graph convolutional neural networks, while aggregating information from neighboring nodes, not only capture the synergistic effects of local feature pairs (such as the adaptability of scratch gradient direction and dent deformation) but also integrate global feature associations (such as the association between burrs at the corners of metal cases and surrounding texture mutations) through a multi-hop propagation mechanism. This mechanism enables the model to decouple the local anomalies and global semantic states of defects at a fine-grained level. The final output of the fine-grained interactive correlation feature matrix of the multi-dimensional features of the mobile phone shell state not only retains the nonlinear interaction pattern of the multimodal features, but also strengthens the spatial geometric consistency of the defect pattern, thereby significantly improving the detection sensitivity and classification accuracy of tiny defects in complex texture backgrounds.
[0062] In an embodiment of the present application, the step S160 determines the defect detection result based on the fine-grained interactive correlation feature of the multidimensional feature of the mobile phone shell state, and the defect detection result is used to represent the defect type label of the target mobile phone shell surface, including: passing the fine-grained interactive correlation feature matrix of the multidimensional feature of the mobile phone shell state through a defect detector based on a classifier to obtain a defect detection result, and the defect detection result is used to represent the defect type label of the target mobile phone shell surface. It should be understood that although the fine-grained interactive correlation feature matrix of the multidimensional feature of the mobile phone shell state has deeply integrated the texture distribution (such as the gradient direction statistics of scratches) and semantic state (such as the three-dimensional geometric level of dents) of the mobile phone shell state, it needs to be further mapped to a specific defect type label, so as to be used to automatically identify various defects on the shell surface. Therefore, the fine-grained interactive correlation feature matrix of the multidimensional feature of the mobile phone shell state is further passed through a defect detector based on a classifier to obtain a defect detection result, and the defect detection result is used to represent the defect type label of the target mobile phone shell surface, and the defect type label includes scratches, dents, dirt, color difference, deformation, burrs, etc.
[0063] In summary, the industrial vision-based mobile phone case defect detection method described in the embodiments of this application is illustrated. Based on high-resolution industrial imaging, it suppresses background noise interference through image denoising and image enhancement preprocessing, and combines the complementary feature extraction of gradient directional histograms and dilated convolutional networks to enhance the local structural characterization of small defects. Capsule Networks are further introduced to dynamically model the spatial geometric relationships of the mobile phone case state semantics. An attention-driven cross-modal, refined global interactive feature interaction mechanism is utilized to achieve fine-grained alignment and coupling between the texture distribution features and semantic state features of the mobile phone case. Ultimately, through an intelligent classification and decision-making module, multiple low-contrast, sub-pixel defect types in complex texture backgrounds are accurately identified, simultaneously improving detection sensitivity and algorithm robustness.
[0064] Figure 5 FIG is a system block diagram of a mobile phone housing defect detection system based on industrial vision according to an embodiment of the present application. Figure 5As shown, according to an embodiment of the present application, a mobile phone case defect detection system 100 based on industrial vision includes: a target mobile phone case detection image acquisition module 110, which is used to acquire a target mobile phone case detection image through a high-resolution industrial camera; a target mobile phone case detection image preprocessing module 120, which is used to perform image denoising and image enhancement processing on the target mobile phone case detection image to obtain an enhanced target mobile phone case detection image with good granularity interaction correlation features; a target mobile phone case surface defect type label representation module 130, which is used to determine a defect detection result based on the fine-grained interaction correlation features of the multi-dimensional features of the mobile phone case state, and the defect detection result is used to represent the defect type label of the target mobile phone case surface.
[0065] Here, those skilled in the art will understand that the specific operations of each step in the above-mentioned mobile phone shell defect detection system based on industrial vision have been referred to above. Figures 1 to 4 The description of the mobile phone case defect detection method based on industrial vision has been introduced in detail, and therefore, its repeated description will be omitted.
[0066] In summary, the industrial vision-based mobile phone case defect detection system based on the embodiments of this application is described. Based on high-resolution industrial imaging, it suppresses background noise interference through image denoising and image enhancement preprocessing, and combines the complementary feature extraction of gradient directional histograms and dilated convolutional networks to enhance the local structural representation of small defects. Capsule Networks are further introduced to dynamically model the spatial geometric relationships of the mobile phone case state semantics. An attention-driven cross-modal, refined global interactive feature interaction mechanism is utilized to achieve fine-grained alignment and coupling between the texture distribution features and semantic state features of the mobile phone case. Ultimately, through an intelligent classification and decision-making module, multiple low-contrast, sub-pixel defect types in complex texture backgrounds are accurately identified, simultaneously improving detection sensitivity and algorithm robustness.
Claims
1. A method for detecting defects in mobile phone casings based on industrial vision, characterized in that: include: Capture target mobile phone casing inspection images through a high-resolution industrial camera; performing image noise reduction and image enhancement processing on the target mobile phone shell detection image to obtain an enhanced target mobile phone shell detection image; Extracting mobile phone shell state texture features from the enhanced target mobile phone shell detection image to obtain mobile phone shell texture distribution correlation features; Extracting mobile phone shell state semantic features from the enhanced target mobile phone shell detection image to obtain mobile phone shell state semantic features; Performing refined global interactive correlation coding based on the shell state on the mobile phone shell texture distribution correlation feature and the mobile phone shell state semantic feature to obtain a mobile phone shell state multi-dimensional feature fine-grained interactive correlation feature; Based on the fine-grained interactive correlation features of the multi-dimensional features of the mobile phone shell state, a defect detection result is determined, and the defect detection result is used to represent a defect type label of the target mobile phone shell surface.
2. The method for detecting defects in a mobile phone casing based on industrial vision according to claim 1, characterized in that: Performing image noise reduction and image enhancement processing on the target mobile phone shell detection image to obtain an enhanced target mobile phone shell detection image, including: Performing wavelet noise reduction processing on the target mobile phone shell detection image to obtain a noise-reduced target mobile phone shell detection image; Contrast enhancement and edge sharpening processing are performed on the noise-reduced target mobile phone shell detection image to obtain the enhanced target mobile phone shell detection image.
3. The method for detecting defects in a mobile phone casing based on industrial vision according to claim 2, characterized in that: Extracting mobile phone shell state texture features from the enhanced target mobile phone shell detection image to obtain mobile phone shell texture distribution correlation features includes: Extracting HOG features from the enhanced target mobile phone shell detection image to obtain a mobile phone shell gradient direction histogram; The mobile phone shell gradient direction histogram is passed through a mobile phone shell texture distribution feature extractor based on a void convolutional neural network model to obtain a mobile phone shell texture distribution associated feature vector as the mobile phone shell texture distribution associated feature.
4. The method for detecting defects in a mobile phone casing based on industrial vision according to claim 3 is characterized in that: Performing mobile phone case state semantic feature extraction on the enhanced target mobile phone case detection image to obtain a mobile phone case state semantic feature, including: passing the enhanced target mobile phone case detection image through a mobile phone case state semantic feature extractor based on CapsNets to obtain a mobile phone case state semantic feature vector as the mobile phone case state semantic feature.
5. The method for detecting defects in a mobile phone casing based on industrial vision according to claim 4, characterized in that: The mobile phone shell texture distribution correlation feature and the mobile phone shell state semantic feature are subjected to refined global interactive correlation coding based on the shell state to obtain a mobile phone shell state multi-dimensional feature fine-grained interactive correlation feature, including: Performing principal component analysis on the mobile phone shell texture distribution correlation feature vector and the mobile phone shell state semantic feature vector and then performing kernel feature coding to obtain a set of kernel correlation coding vectors between principal components of multi-dimensional features of the mobile phone shell state; Calculating a kernel correlation dynamic efficiency representation between every two kernel correlation coding vectors between principal components of the multidimensional features of the mobile phone shell state in the set of the kernel correlation coding vectors between principal components of the multidimensional features of the mobile phone shell state to obtain a kernel correlation dynamic efficiency representation topology matrix of the multidimensional kernel correlation dynamic efficiency representation of the mobile phone shell state; Based on the association topology matrix of the multidimensional kernel correlation dynamic effectiveness characterization quantity of the mobile phone shell state, the set of kernel correlation coding vectors between the principal components of the multidimensional features of the mobile phone shell state is subjected to graph-structured association coding to obtain a fine-grained interactive correlation feature matrix of the multidimensional features of the mobile phone shell state as the fine-grained interactive correlation feature of the multidimensional features of the mobile phone shell state.
6. The method for detecting defects in a mobile phone casing based on industrial vision according to claim 5, characterized in that: The mobile phone shell texture distribution correlation feature vector and the mobile phone shell state semantic feature vector are subjected to principal component analysis and then kernel feature coding to obtain a set of kernel correlation coding vectors between principal components of the mobile phone shell state multidimensional feature, including: Performing feature principal component analysis on the mobile phone shell texture distribution association feature vector and the mobile phone shell state semantic feature vector respectively to obtain a set of mobile phone shell texture distribution feature principal component coding vectors and a set of mobile phone shell state semantic feature principal component coding vectors; Each corresponding group of mobile phone shell texture distribution feature principal component coding vectors and mobile phone shell state semantic feature principal component coding vectors in the set of the mobile phone shell texture distribution feature principal component coding vectors and the set of the mobile phone shell state semantic feature principal component coding vectors are respectively subjected to principal component kernel association coding to obtain a set of kernel association coding vectors between principal components of the mobile phone shell state multidimensional feature.
7. The method for detecting defects of mobile phone casings based on industrial vision according to claim 6, characterized in that: Based on the association topology matrix of the multidimensional kernel association dynamic performance characterization quantity of the mobile phone shell state, a graph-structure-based association encoding is performed on a set of kernel association coding vectors between principal components of the multidimensional features of the mobile phone shell state to obtain a fine-grained interactive association feature matrix of the multidimensional features of the mobile phone shell state as the fine-grained interactive association feature of the multidimensional features of the mobile phone shell state, including: Performing a mobile phone shell state multidimensional feature space distribution consistency calibration on each mobile phone shell state multidimensional feature principal component kernel correlation coding vector in the set of mobile phone shell state multidimensional feature principal component kernel correlation coding vectors to obtain an optimized set of mobile phone shell state multidimensional feature principal component kernel correlation coding vectors; The set of kernel correlation coding vectors between principal components of the optimized mobile phone shell state multidimensional features and the correlation topology matrix of the mobile phone shell state multidimensional kernel correlation dynamic effectiveness characterization quantity are input into a graph convolutional neural network model to obtain a fine-grained interactive correlation feature matrix of the mobile phone shell state multidimensional features.
8. The method for detecting defects in a mobile phone casing based on industrial vision according to claim 7, characterized in that: Based on the fine-grained interactive correlation features of the multidimensional features of the mobile phone shell state, a defect detection result is determined, and the defect detection result is used to represent the defect type label of the target mobile phone shell surface, including: passing the fine-grained interactive correlation feature matrix of the multidimensional features of the mobile phone shell state through a classifier-based defect detector to obtain a defect detection result, and the defect detection result is used to represent the defect type label of the target mobile phone shell surface.
9. A mobile phone casing defect detection system based on industrial vision, characterized in that: include: The target mobile phone shell detection image acquisition module is used to acquire the target mobile phone shell detection image through a high-resolution industrial camera; a target mobile phone shell detection image preprocessing module, configured to perform image noise reduction and image enhancement processing on the target mobile phone shell detection image to obtain an enhanced target mobile phone shell detection image preserving granularity interaction correlation features; The target mobile phone shell surface defect type label representation module is used to determine the defect detection result based on the fine-grained interactive correlation features of the multi-dimensional features of the mobile phone shell state, and the defect detection result is used to represent the defect type label of the target mobile phone shell surface.
10. The mobile phone casing defect detection system based on industrial vision according to claim 9 is characterized in that: The target mobile phone shell detection image preprocessing module is used to: Performing wavelet noise reduction processing on the target mobile phone shell detection image to obtain a noise-reduced target mobile phone shell detection image; Contrast enhancement and edge sharpening processing are performed on the noise-reduced target mobile phone shell detection image to obtain the enhanced target mobile phone shell detection image.
Citation Information
Cited By
Road green vision rate monitoring method and system based on vehicle-mounted visual sensor
CN120375311A
Fan running state intelligent control system based on multi-source data
CN120384839A
Chip surface intelligent detection method and system based on machine vision
CN121415041A