Mobile phone volume key flaw detection method

Through the improved Mask R-CNN network model, combined with VoVNet and RPN, the RoIAlign pooling layer is used to process in parallel, the problem of detecting small defects in mobile phone volume keys is solved, efficient and accurate defect identification and classification is achieved, and quality control is improved. Production line automation.

CN119048507AInactive Publication Date: 2024-11-29NEW MAINENG INTELLIGENT TECHNOLOGY (NANJING) CO LTD

Patent Information

Application Number
CN202411529564.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2024-11-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately detect and identify small defects in mobile phone volume keys, and traditional feature extraction methods are difficult to cope with multi-scale and small-scale defective features, and cannot be efficiently detected on the production line, affecting mobile phone quality control.

Method used

The improved Mask R-CNN network model is adopted, combined with the backbone network VoVNet, the regional suggestion network RPN and RoIAlign pooling layers, and the identification of the categories, locations and shapes of defect targets is achieved through feature extraction, candidate box generation and parallel processing. The preprocessing steps include median filtering and discrete Fourier transform to enhance image features.

Benefits of technology

It realizes intelligent detection and classification of mobile phone volume key defects, improves detection accuracy and efficiency, reduces the defective yield rate, and promotes the intelligent transformation of production line automation and electronic manufacturing industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048507A_ABST
    Figure CN119048507A_ABST
Patent Text Reader

Abstract

The invention discloses a mobile phone volume key defect detection method, and belongs to the field of electronic material detection, and the method comprises the steps: obtaining a to-be-detected mobile phone volume key defect image, inputting the to-be-detected mobile phone volume key defect image into an improved Mask R-CNN network model, and outputting the type, position and shape of a defect target; the data processing process of the improved Mask R-CNN network model comprises the steps of replacing a backbone network ResNet of an original Mask R-CNN network model with VoVNet, performing feature extraction on a mobile phone volume key defect image to obtain a mobile phone volume key defect feature map, inputting a region suggestion network RPN, generating a large number of defect candidate frames, and performing classification and regression correction processing to form suggestion candidate regions; according to the suggested candidate area and the mobile phone volume key defect feature map, obtaining a suggested feature block with a fixed size through a RoIAlign pooling layer; and performing parallel processing on the proposed feature blocks, and outputting a classification result of the proposed feature blocks. And intelligent flaw detection and classification of the mobile phone volume key image are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of electronic material detection and relates to a method for detecting defects in a volume key of a mobile phone. Background Art

[0002] The Faster R-CNN network model is a popular two-stage object detection model that divides the object detection problem into two stages: candidate region generation and classification. In the first stage, the Faster R-CNN network model uses the region proposal network RPN to generate candidate boxes that may contain objects. In the second stage, the features of the candidate boxes are extracted through the RoI pooling layer and sent to the fully connected layer for classification and bounding box regression.

[0003] With the rapid development of the smartphone market, mobile phone manufacturers are facing severe challenges in improving product quality and appearance. Among them, the volume button of the mobile phone is a part that users frequently touch, and the integrity of its appearance and function directly affects the user experience. Traditional mobile phone volume button defect detection mainly relies on manual visual inspection, that is, workers visually check whether the volume button has defects such as broken edges, scratches, discoloration, and bumps. However, this method has obvious limitations, such as the limited visible range of the human eye, insufficient effect on the detection of tiny defects, and low detection efficiency, which is difficult to meet the needs of large-scale production.

[0004] In order to overcome the shortcomings of manual visual inspection, automatic inspection technology based on machine vision has gradually emerged. This technology obtains the image of the volume button through an image acquisition device, uses computer vision and image processing algorithms to perform pre-processing such as denoising, enhancement, and segmentation on the image, and then extracts features to identify defects. Compared with manual recognition, machine vision technology has greatly improved detection efficiency and accuracy. In particular, with the development of deep learning technology, machine vision inspection systems based on deep learning have performed well in processing multi-scale and small-scale complex features, and have gradually become a research hotspot.

[0005] Although automatic detection technology based on machine vision has achieved certain results in the detection of defects in mobile phone volume buttons, there are still some problems. First, traditional machine vision technology usually relies on preset feature extraction methods, and may not be able to effectively identify certain complex or unknown defect features. Secondly, due to the diversity of shapes, materials and manufacturing processes of mobile phone volume buttons, defect features often have multi-scale and small-scale characteristics, which makes traditional feature extraction methods difficult to cope with. In addition, existing technologies cannot detect problems with volume buttons in a timely manner, including broken edges, scratches, discoloration, bumps, etc., nor can they be efficiently detected on the production line to ensure the quality of mobile phones. Summary of the invention

[0006] The technical problem to be solved by the present invention is: how to quickly detect and identify tiny defects of a volume button of a mobile phone and output the category, position and shape of the defect target.

[0007] In order to solve the above technical problems, the present invention is implemented by adopting the following technical solutions.

[0008] The present invention provides a method for detecting defects of a volume key of a mobile phone, comprising: Obtain the volume button defect image of the mobile phone to be detected; Input the mobile phone volume key defect image to be detected into the improved Mask R-CNN network model, and output the category, location and shape of the defect target; The data processing process of the improved Mask R-CNN network model includes: The backbone network VoVNet is used to extract features from the defective image of the volume button of the mobile phone, and a defective feature map of the volume button of the mobile phone is obtained; Input the defect feature map of the volume button of the mobile phone into the region proposal network RPN to obtain the proposed candidate region; According to the proposed candidate area and the defect feature map of the volume button of the mobile phone, a proposed feature block of a fixed size is obtained through the RoIAlign pooling layer; The proposed feature blocks are processed in parallel, including determining the category of the defect target to which the proposed feature blocks belong, the location and shape of the defect target, and obtaining the category of the defect target and a mobile phone volume key defect image with the location and shape of the defect target marked. Further, the improved Mask R-CNN network model includes: The backbone network VoVNet is used to preliminarily process the defective images of the mobile phone volume button and perform feature extraction; The region proposal network RPN is used to generate defect candidate boxes based on the features extracted by the backbone network VoVNet; The RoIAlign pooling layer is used to map defect candidate boxes of different sizes to proposed feature blocks of fixed size.

[0009] Furthermore, before the mobile phone volume key defect image to be detected is input into the improved Mask R-CNN network model, the mobile phone volume key defect image to be detected is preprocessed, including: Preprocessing the volume key defect image of the mobile phone to be detected by using an improved median filtering method to obtain the volume key defect image of the mobile phone after filtering; The mobile phone volume key defect image after the image pair filtering is preprocessed using discrete Fourier transform to obtain a preprocessed mobile phone volume key defect image.

[0010] Furthermore, the method of preprocessing the defective image of the mobile phone volume key to be detected by using the improved median filtering method comprises: Grayscale the volume key defect image of the mobile phone to be detected to obtain a grayscale image of the volume key defect of the mobile phone; The neighborhood range of the preset target pixel point (x, y) and the set fluctuation range k are used to identify the edge of the grayscale image of the volume button defect of the mobile phone. p is defined to represent the grayscale value at the target pixel point (x, y), and Max represents the grayscale maximum value in the neighborhood of the pixel point (x, y); Traverse each pixel in the grayscale image of the volume button defect on the mobile phone, and perform the following operations on each pixel: Get the neighborhood pixel values ​​of the target pixel point (x, y) and calculate the grayscale maximum value Max in the neighborhood of the target pixel point (x, y); When the gray value p of the target pixel (x, y) satisfies (p+k)>Max, keep the current pixel value p; When the gray value p of the target pixel point (x, y) does not satisfy (p+k)>Max, the pixel values ​​in the neighborhood of the pixel point (x, y) are sorted, and the middle value after sorting is selected as the new gray value of the pixel point (x, y); After traversing and processing all the pixels in the mobile phone volume key defect grayscale image, a filtered mobile phone volume key defect image is obtained.

[0011] Further, the step of preprocessing the image of the volume key defect of the mobile phone after the filtering process using discrete Fourier transform includes: Performing discrete Fourier transform on the filtered mobile phone volume key defect image, converting the filtered mobile phone volume key defect image from the spatial domain to the frequency domain, and obtaining the mobile phone volume key defect image in the frequency domain; Perform low-pass filtering on the defective image of the mobile phone volume key in the frequency domain, remove high-frequency defects and convert it back to the original spatial domain to obtain the defective image of the mobile phone volume key after removing high-frequency defects; The defect image of the volume key of the mobile phone after high-frequency defects are removed is differentiated from the defect image of the volume key of the mobile phone after filtering to obtain the defect enhanced image of the volume key of the mobile phone; A transmission transformation is performed on the defect image of the volume button of the mobile phone after defect enhancement, and the size of the defect image of the volume button of the mobile phone after defect enhancement is uniformly set to 638×1350 pixels.

[0012] Furthermore, the method of inputting the defect feature map of the volume button of the mobile phone into the region proposal network RPN to obtain the proposed candidate region includes: Input the training set containing the defect feature map of the volume button of the mobile phone into the region proposal network RPN, define and optimize the region proposal network RPN loss function to adjust the network parameters, and obtain the trained region proposal network RPN; Input the defect feature map of the volume button of the mobile phone into the trained region proposal network RPN to generate a large number of defect candidate boxes; The classification branch of the region proposal network RPN is used to calculate the probability that each defect candidate box belongs to the defect target through the softmax function, and then compared with the preset threshold to obtain the defect target candidate box; The regression branch of the region proposal network (RPN) uses the loss function smooth to perform border regression correction on each defect target candidate box to further adjust the position and size of the defect target candidate box to obtain the proposed candidate area.

[0013] Furthermore, the loss function of the region proposal network RPN includes the classification loss function and the modified regression loss function. The total loss value of the region proposal network RPN is expressed as: ; in, The loss value of the classification layer of the regional proposal network RPN; Correct the loss value of the regression layer for the region proposal network RPN; It is the total loss value of the region proposal network RPN.

[0014] Furthermore, the loss value of the classification layer of the region proposal network RPN is The calculation formula is expressed as: ; in, Suggest box numbers for targets; For the The probability that a target box is a positive sample; For the The actual probability of a target box is 1 for positive samples and 0 for negative samples; is the number of samples in the classification layer; log [] indicates taking the logarithm; the loss value of the regression layer of the region proposal network RPN is corrected The calculation formula is expressed as: ; in, For the The deviation between the predicted coordinates and the actual coordinates of the target box; For the A set of predicted coordinates of target boxes; For the The actual coordinate set of the target box; SmoothL1Loss is the smooth L1 loss function, N The number of suggested boxes for the target.

[0015] Furthermore, according to the proposed candidate area and the defect feature map of the volume button of the mobile phone, a method for obtaining a proposed feature block of a fixed size through a RoIAlign pooling layer includes: Calculate the area corresponding to the suggested candidate area on the mobile phone volume key defect feature map according to the coordinates and size of the suggested candidate area on the mobile phone volume key defect feature map, and the scaling ratio of the mobile phone volume key defect feature map relative to the mobile phone volume key defect image; Input the mobile phone volume key defect feature map and the area corresponding to the suggested candidate area on the mobile phone volume key defect feature map into the RoIAlign pooling layer, and use the RoIAlign pooling layer to receive the coordinates and size of the suggested candidate area; Set the target size of the output feature block of the RoIAlign pooling layer; The RoIAlign pooling layer is used to divide the area corresponding to each proposed candidate area on the mobile phone volume key defect feature map into multiple sub-areas corresponding to the target size of the output feature block; In each sub-area, sampling points are evenly set according to the set number of sampling points; Using the bilinear interpolation method, the feature value of each sampling point on the defect feature map of the mobile phone volume button is calculated and weighted average aggregation is performed to convert each proposed candidate area into a proposed feature block of a fixed size.

[0016] Furthermore, the proposed feature blocks are processed in parallel, including a method for determining the category of the defect target to which the proposed feature block belongs, and the location and shape of the defect target, including: Use the RoI classifier to determine the category of the defect target to which each proposed feature block belongs; Use the RoI regressor to fine-tune the bounding box position and locate the defect target; Use the segmentation mask module to generate pixel-level masks to divide the shape of the defect target.

[0017] Compared with the prior art, the present invention has the following beneficial effects: The present invention proposes a method for detecting defects in a volume button of a mobile phone, wherein an improved Mask R-CNN network model not only inherits the advantages of the Faster R-CNN network model in target detection, but also realizes target category recognition, precise positioning of bounding boxes, and pixel-level instance segmentation.

[0018] In addition, the improved Mask R-CNN network model is used to perform three tasks in parallel: using the RoI classifier to determine the target category, using the RoI regressor to fine-tune the bounding box position, and using the segmentation mask module to generate accurate pixel-level masks to achieve fine division of the defect area.

[0019] The present invention realizes intelligent defect detection and classification of mobile phone volume key defect images, improves quality control, reduces defective product rate, solves the problem of instant and accurate identification of mobile phone volume key defects, and promotes production line automation and intelligent transformation of the electronic manufacturing industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a flow chart of a method for detecting defects of a volume key of a mobile phone provided by an embodiment of the present invention; Figure 2 is a schematic diagram of a flow chart of an improved median filtering algorithm provided by an embodiment of the present invention; Figure 3 It is a flow chart of performing an image enhancement operation on a mobile phone volume key defect image after image filtering using discrete Fourier transform according to an embodiment of the present invention; Figure 4 Schematic diagram of the network architecture of the original Mask R-CNN network model backbone network ResNet provided by an embodiment of the present invention; Figure 5 It is a schematic diagram of the network architecture of the improved Mask R-CNN network model backbone network VoVNet provided by an embodiment of the present invention. DETAILED DESCRIPTION Example

[0021] This embodiment introduces a method for detecting defects in a volume button of a mobile phone, including the following steps: Obtain the volume button defect image of the mobile phone to be detected; The mobile phone volume key defect image to be detected is input into the improved Mask R-CNN network model, and the category, position and shape of the defect target are output.

[0022] The powerful feature extraction and recognition capabilities of the deep learning model are used to automatically detect defects in the volume button defect image of the mobile phone. The improved Mask R-CNN model is suitable for tasks that require simultaneous recognition of target category, location, and shape. Automated processing reduces manual intervention and improves detection efficiency. The improved Mask R-CNN model has higher detection accuracy and faster processing speed.

[0023] The data processing process of the improved Mask R-CNN network model includes: The backbone network VoVNet is used to extract features from the defective image of the volume button of the mobile phone, and a defective feature map of the volume button of the mobile phone is obtained; like Figure 4 This is a schematic diagram of the ResNet network architecture. Figure 5 This is a schematic diagram of the network architecture of VoVNet. The backbone network is the basic network responsible for extracting image features in the deep learning model. Replacing ResNet with VoVNet enables the improved MaskR-CNN network model to extract key features from the defective image of the mobile phone volume button more quickly and accurately.

[0024] Input the defect feature map of the volume button of the mobile phone into the region proposal network RPN to obtain the proposed candidate region; The region proposal network (RPN) is a key component in the Mask R-CNN network model. It is responsible for generating a series of candidate regions that may contain target objects from the feature map. It can efficiently screen out candidate regions that may contain defects. The region proposal network will be further processed to determine the specific location and category of the defect. Inputting the defect feature map of the volume button of the mobile phone into the region proposal network (RPN) reduces the amount of data for subsequent processing and improves the overall detection efficiency.

[0025] According to the proposed candidate area and the defect feature map of the volume button of the mobile phone, a proposed feature block of a fixed size is obtained through the RoIAlign pooling layer; The RoIAlign pooling layer ensures that each proposed feature block can correspond to the defect area in the original mobile phone volume button defect image with higher accuracy, so that the improved Mask R-CNN network model can understand the content of each candidate area more accurately.

[0026] The proposed feature blocks are processed in parallel, including determining the category of the defect target to which the proposed feature blocks belong, the position and shape of the defect target, and obtaining the category of the defect target and a mobile phone volume key defect image with the position and shape of the defect target marked.

[0027] After obtaining the fixed-size proposed feature block, the improved Mask R-CNN network model needs to further process the proposed feature block to determine the category, location and shape of the defect target. Parallel processing improves the detection speed and efficiency of the model.

[0028] Through the trained classifier and regressor, the improved Mask R-CNN network model can accurately identify the category of defect targets and give the precise position and shape of the defect targets in the image. Example

[0029] This embodiment introduces a method for detecting defects in a volume button of a mobile phone. Figure 1 As shown, the specific steps include: Step 1: Build an image acquisition and verification experimental platform for defect detection and obtain the defect image of the volume button of the mobile phone.

[0030] In order to facilitate data collection, identification of defective targets and subsequent defect detection experiments, this embodiment has built an image acquisition and verification experimental platform that integrates image acquisition and verification functions. The image acquisition and verification experimental platform is built based on the combination of area array cameras and line array cameras, and is used for defect detection of volume keys and their components or other related parts.

[0031] The image acquisition and verification experimental platform includes a white light source, a camera, an acquisition platform and a high-performance workstation.

[0032] In terms of the selection of light sources, considering the characteristics of different light source types, this embodiment uses a special structured light modulated by a display - a white light source as illumination. The above light source has distinct characteristics and is suitable for defect detection of various components such as volume key components.

[0033] In order to obtain high-definition images and meet the subsequent requirements for judging concave and convex defects, this embodiment makes comprehensive considerations in the selection of cameras. The area array camera uses a CCD type camera because it has high image quality and stability; the line array camera uses a CMOS camera to take advantage of its high transmission speed. In addition, the LCD display screen uses a display with a resolution of 1920*1080 to ensure the clarity of the image display.

[0034] The object detection platform is a motion control console whose movement is controlled by a motor. The linear array camera and the area array camera are connected to work together to ensure the stability and efficiency of the acquisition process.

[0035] The modulated light source and the area array camera work together to capture the overall image of the volume button of the mobile phone to obtain the location of the defective target; the coaxial parallel linear light source and the line array camera work together to collect high-definition images and transmit the data to the computer for subsequent algorithm processing to determine the type of defect. The coordination between the two uses FPGA technology to achieve multi-channel collaboration and efficiently obtain the defective image of the volume button of the mobile phone.

[0036] The experimental platform built by this embodiment provides an efficient and accurate solution for defect detection of volume keys and their components or other related parts. The platform not only meets the needs of data collection and defect identification, but also makes full preparations for subsequent defect image processing and classification.

[0037] Step 2: Preprocess the acquired defective image of the volume button of the mobile phone.

[0038] When processing the defective image of the volume button of a mobile phone, the preprocessing step is particularly critical. Effective preprocessing can not only reduce the interference of noise, but also provide clear and accurate image data of the defective volume button of a mobile phone for subsequent image enhancement and segmentation.

[0039] The research on image enhancement started quite early, and the current image enhancement methods mainly include the following: grayscale transformation method, denoising filter method, edge display method, histogram equalization, convolution operation method, etc. Among them, the grayscale transformation method includes linear, nonlinear, and segmented grayscale transformation, the denoising filter method includes low-pass filtering, median filtering, mean filtering and other methods, and the edge display method can also be divided into high-pass, Sobel operator, Roberts operator and other methods according to its different operators.

[0040] This embodiment uses an improved median filtering method and a discrete Fourier transform image preprocessing and enhancement method to preprocess the defective image of the volume button of a mobile phone.

[0041] Step 2.1: Preprocess the volume key defect image of the mobile phone to be detected using an improved median filtering method: Commonly used filtering methods include time domain filtering and frequency domain filtering, and currently there are mainly the following types: mean filtering, box filtering, bilateral filtering, Gaussian filtering, and median filtering. With respect to the noise data of the defective image of the mobile phone volume key, it is known that the median filter can effectively remove the influence of noise points on the image, but the median filter will also process the useful edge information of the image. It is an overall processing for the entire image, which will affect the clarity of the processed image. Although the noise will be effectively removed, the reduction in clarity and the loss of edge information will cause troubles for subsequent image enhancement and segmentation. Therefore, in the process of filtering and denoising the defective image, this embodiment uses a median filtering algorithm with conditional judgment to pre-process the noise problem of the defective image of the mobile phone volume key. While retaining the advantages of median filtering denoising, the above algorithm avoids the excessive processing of the target defect and its edge by the classic median filter by introducing new judgment conditions.

[0042] like Figure 2 The figure is a schematic flow chart of the improved median filtering algorithm of this embodiment, and the specific steps include: The volume key defect image of the mobile phone to be detected is grayed to obtain a volume key defect grayscale image of the mobile phone.

[0043] The neighborhood range of the preset target pixel point (x, y) and the set fluctuation range k are used to identify the edge of the grayscale image of the volume button defect of the mobile phone. p is defined to represent the grayscale value at the target pixel point (x, y), and Max represents the grayscale maximum value in the neighborhood of the pixel point (x, y).

[0044] In image processing, when dealing with defect detection or edge detection, you may encounter a situation where the target point pixel value is not the local grayscale maximum value due to the similar grayscale value of the defect edge, but is still regarded as part of the defect edge. In order to deal with this situation, a fluctuation range is usually set to allow a certain grayscale value fluctuation. In this embodiment, k is used to represent the fluctuation range. The fluctuation range k value is determined based on multiple experiments and the grayscale distribution of the mobile phone volume key defect image and the characteristics of the defect.

[0045] (3) Traverse each pixel in the grayscale image of the volume button defect of the mobile phone and perform the following operations on each pixel: Get the neighborhood pixel values ​​of the target pixel point (x, y) and calculate the grayscale maximum value Max in the neighborhood of the target pixel point (x, y); If the gray value p of the target pixel (x, y) satisfies (p+k)>Max, the pixel is considered to be the edge of the defect, and no filtering is performed, and the current pixel value p is retained; If the gray value p of the target pixel point (x, y) does not satisfy (p+k)>Max, sort the pixel values ​​in the neighborhood of the pixel point (x, y), and select the middle value after sorting as the new gray value of the pixel point (x, y); (4) After traversing and processing all the pixels in the grayscale image of the mobile phone volume button defect, a filtered image of the mobile phone volume button defect is obtained.

[0046] By preprocessing the defective image of the volume button of the mobile phone through the above-mentioned improved median filtering algorithm, the information loss caused by image filtering can be significantly reduced, and more useful edge information can be retained.

[0047] Step 2.2: Use discrete Fourier transform to pre-process the image of the volume button defect of the mobile phone after filtering: Considering that the background accounts for a large proportion in the defective image of the mobile phone volume key and does not change drastically, it belongs to the low-frequency component; and the high-frequency component represents the edges and defective parts. In order to highlight these key information, this embodiment uses discrete Fourier transform to re-process the mobile phone volume key defective image after filtering. Through Fourier transform, the filtered mobile phone volume key defective image can be converted from the spatial domain to the frequency domain, and then the low-frequency and high-frequency components can be processed separately to enhance the edges and defective parts of the mobile phone volume key defective image and improve the contrast of the mobile phone volume key defective image.

[0048] The filtered image of the volume button defect of the mobile phone The two-dimensional discrete Fourier transform DFT formula is expressed as: ; In the formula The volume button defect image of the mobile phone after filtering is at position The pixel value of This is the frequency domain representation of the volume button defect image of the mobile phone after filtering and discrete Fourier transform. is the coordinate in the frequency domain, M Indicates the length of the defective image of the volume button of the mobile phone. N Indicates the width of the defect image of the volume button of the mobile phone. MN Indicates the total number of pixels in the image, that is, the size of the image, j Is an imaginary unit.

[0049] like Figure 3 As shown, a method for performing discrete Fourier transform on the filtered mobile phone volume key defect image, converting the filtered mobile phone volume key defect image from the spatial domain to the frequency domain, and obtaining the mobile phone volume key defect image in the frequency domain includes: Perform low-pass filtering on the defective image of the mobile phone volume key in the frequency domain, remove high-frequency defects and convert it back to the original spatial domain to obtain the defective image of the mobile phone volume key after removing high-frequency defects; The defect image of the volume key of the mobile phone after high-frequency defects are removed is differentiated from the defect image of the volume key of the mobile phone after filtering to obtain the defect enhanced image of the volume key of the mobile phone; A transmission transformation is performed on the defect image of the volume button of the mobile phone after defect enhancement, and the size of the defect image of the volume button of the mobile phone after defect enhancement is uniformly set to 638×1350 pixels.

[0050] The above preprocessing steps use the median filter method with conditional judgment and discrete Fourier transform operation to enhance the image, thus achieving effective preprocessing and enhancement of the defective image of the mobile phone volume key. It can not only remove the noise of the defective image of the mobile phone volume key, but also retain more edge information, providing clear and accurate image data for subsequent image segmentation and defect recognition.

[0051] Step 3: Build a dataset based on the preprocessed mobile phone volume button defect images.

[0052] Step 3.1: Annotate the preprocessed mobile phone volume button defect image.

[0053] First, based on the preprocessed mobile phone volume key image, the Labelme annotation tool is used to accurately annotate the preprocessed mobile phone volume key defect image, specifically drawing a bounding box for each component defect in the mobile phone volume key image or performing pixel-level segmentation annotation. Ensure that the bounding box or segmentation annotation of each defect accurately covers the target area to obtain the original data set.

[0054] During the marking process, we strictly follow the manual inspection factory standards, mainly considering the three factors of defect size, length and area, and make judgments by quantitatively estimating the relationship between the number of elements and the standard threshold. According to statistics, the main types of defects include edge collapse, scratches, discoloration and bumps, among which edge collapse, scratches and bumps have irreversible effects on the performance of parts.

[0055] Step 3.2: Dataset expansion In order to improve the generalization ability of the improved Mask R-CNN network model, this embodiment expands the original data set through data enhancement technology. The methods used include but are not limited to geometric transformation, color transformation and noise perturbation of the image. The specific implementation method is as follows: (1) Geometric transformation Flip transformation: mirror-flip the defective image of the mobile phone volume button in the original dataset along the horizontal or vertical axis; Rotation transformation: Rotate the defective image of the volume button of the mobile phone in the original dataset at a random angle; Translation transformation: perform an appropriate amount of translation in the horizontal or vertical direction of the mobile phone volume button defect image in the original data set; Scaling transformation: Scale the defective image of the mobile phone volume button in the original dataset according to a certain ratio.

[0056] (2) Color transformation Contrast adjustment: Change the brightness of the pixels in the defective image of the volume button of the mobile phone in the original data set to increase the difference between pixels; Saturation adjustment: Adjust the transparency and saturation of the mobile phone volume button defect image in the original dataset.

[0057] (3) Noise disturbance Salt and pepper noise or Gaussian noise is randomly added to the mobile phone volume button defect images in the original dataset.

[0058] In addition, in view of the characteristics of the mobile phone volume key defect, this embodiment also specially designs a method of transforming only the defect target and randomly pasting the transformed defect target to other positions of the mobile phone volume key defect image to balance the data volume of different defect categories. Finally, according to the experimental requirements, the expanded original data set is divided into a training set and a test set in a ratio of 9:1.

[0059] Step 4: Build an improved Mask R-CNN network model.

[0060] The improved Mask R-CNN network model includes: The backbone network VoVNet is used to preliminarily process the defective images of the mobile phone volume button and perform feature extraction; The region proposal network RPN is used to generate defect candidate boxes based on the features extracted by the backbone network VoVNet; The RoIAlign pooling layer is used to map defect candidate boxes of different sizes to proposed feature blocks of fixed size.

[0061] Step 4.1: Replace the backbone network ResNet of the original Mask R-CNN network model with VoVNet.

[0062] Create a Mask R-CNN network model and define the VoVNet model as the backbone network of the Mask R-CNN network model, including replacing the convolutional and pooling layers of ResNet, loading the pre-trained weights of VoVNet, fine-tuning VoVNet, and adjusting the learning rate, optimizer type, and other hyperparameters.

[0063] As the basic feature extractor of convolutional neural networks, the backbone network plays a vital role in image recognition. The diversity and complexity of the defects of the volume button of mobile phones put forward higher requirements on the backbone network of the model. Although the backbone network ResNet of the original MaskR-CNN network model solves the problems of gradient vanishing and gradient explosion in deep networks by introducing residual connections, there is still an information bottleneck problem. In this embodiment, the backbone network ResNet of the original Mask R-CNN network model is replaced with VoVNet, and the receptive field of the network is effectively increased by introducing a one-shot aggregation module (OSA), which can extract more global and semantically rich features. At the same time, the backbone network VoVNet adopts a multi-scale information fusion strategy to perform feature fusion at different levels of the network, capture low-level and high-level features at the same time, and improve the expression ability of the Mask R-CNN network model.

[0064] Step 4.2: Use the backbone network VoVNet of the Mask R-CNN network model to extract features of the input mobile phone volume key defect image to obtain a mobile phone volume key defect feature map; Step 4.3: Input the volume button defect feature map of the mobile phone into the region proposal network RPN to obtain the proposed candidate area: Input the training set containing the defect feature map of the volume button of the mobile phone into the region proposal network RPN, define and optimize the region proposal network RPN loss function to adjust the network parameters, and obtain the trained region proposal network RPN; Input the defect feature map of the volume button of the mobile phone into the trained region proposal network RPN to generate a large number of defect candidate boxes; The classification branch of the region proposal network RPN is used to calculate the probability that each defect candidate box belongs to the defect target through the softmax function, and then compared with the preset threshold to obtain the defect target candidate box; The regression branch of the region proposal network (RPN) uses the loss function smooth to perform border regression correction on each defect target candidate box to further adjust the position and size of the defect target candidate box to obtain the proposed candidate area.

[0065] The loss function of the region proposal network RPN usually contains two main parts: classification loss function and rectified regression loss function.

[0066] The total loss value of the region proposal network RPN is expressed as: (1); in, The loss value of the classification layer of the regional proposal network RPN; Correct the loss value of the regression layer for the region proposal network RPN; It is the total loss value of the region proposal network RPN.

[0067] The loss value of the classification layer of the region proposal network RPN The calculation formula is expressed as: (2); in, Suggest box numbers for targets; For the The probability that a target box is a positive sample; For the The actual probability of a target box is 1 for positive samples and 0 for negative samples; is the number of samples in the classification layer; log [] indicates taking the logarithm.

[0068] The loss value of the regression layer will be corrected The calculation formula is expressed as: (3); in, For the The deviation between the predicted coordinates and the actual coordinates of the target box; For the A set of predicted coordinates of target boxes; For the The actual coordinate set of the target box; SmoothL1Loss is the smooth L1 loss function, N The number of suggested boxes for the target.

[0069] During the training process, the loss function of the region proposal network RPN is calculated based on the real labeled data, and the parameters of the region proposal network RPN are corrected through the back propagation algorithm based on the calculated loss value. As the training progresses, the region proposal network RPN gradually learns to generate more accurate candidate regions for the defective target of the mobile phone volume button, thereby improving the accuracy and efficiency of target detection.

[0070] Step 4.4: Based on the proposed candidate area and the defect feature map of the mobile phone volume button, a fixed-size proposed feature block is obtained through the RoIAlign pooling layer: Calculate the area corresponding to the suggested candidate area on the mobile phone volume key defect feature map according to the coordinates and size of the suggested candidate area on the mobile phone volume key defect feature map, and the scaling ratio of the mobile phone volume key defect feature map relative to the mobile phone volume key defect image; Input the mobile phone volume key defect feature map and the area corresponding to the suggested candidate area on the mobile phone volume key defect feature map into the RoIAlign pooling layer, and use the RoIAlign pooling layer to receive the coordinates and size of the suggested candidate area; Set the target size of the output feature block of the RoIAlign pooling layer; The RoIAlign pooling layer is used to divide the area corresponding to each proposed candidate area on the mobile phone volume key defect feature map into multiple sub-areas corresponding to the target size of the output feature block; In each sub-area, sampling points are evenly set according to the set number of sampling points; Using the bilinear interpolation method, the feature value of each sampling point on the defect feature map of the mobile phone volume button is calculated and weighted average aggregation is performed to convert each proposed candidate area into a proposed feature block of a fixed size.

[0071] In the Mask R-CNN network model, the RoIAlign pooling layer is used to obtain a fixed-size proposed feature block corresponding to the defect candidate box generated by the region proposal network RPN. Compared with the traditional RoI Pooling pooling layer, the RoIAlign pooling layer can significantly reduce the position deviation caused by the quantization operation, thereby improving the accuracy of target detection and segmentation. The RoIPooling pooling layer will perform rounding operations during the mapping process, while the RoIAlign pooling layer will not perform rounding operations during the mapping process, but will retain the original floating-point coordinate position, which can ensure that the position correspondence between the original image and the feature map is more accurate. With the introduction of the RoIAlign pooling layer, the Mask R-CNN network model can more accurately realize the combination of target detection and segmentation while ensuring good detection performance, especially when dealing with delicate tasks such as mobile phone volume button defects.

[0072] Step 4.5: Classification, bounding box regression and segmentation of the proposed feature blocks are processed in parallel.

[0073] Use the RoI classifier to determine the category of the defect target to which each proposed feature block belongs; Use the RoI regressor to fine-tune the bounding box position and locate the defect target; Use the segmentation mask module to generate pixel-level masks to divide the shape of the defect target.

[0074] The proposed feature block is passed through a fully connected layer network to perform bounding box regression, classification, and object segmentation, and output the category, location, and shape of the mobile phone volume key defect.

[0075] Finally, the validation set is used to test and verify the improved Mask R-CNN network model to ensure that the detection and segmentation performance is consistent with expectations.

[0076] Step 4.6: Evaluate the performance of the improved Mask R-CNN network model: In order to accurately evaluate the performance of the improved Mask R-CNN network model, the currently popular deep learning evaluation index is introduced, which mainly consists of two parts: one is an index for judging the detection and classification accuracy, which uses the confusion matrix, and the other is an index for judging the detection and positioning accuracy, which is evaluated using the intersection over union (IoU).

[0077] Step 4.6.1: Use the confusion matrix to evaluate the classification performance of the improved Mask R-CNN network model; The calculation formulas are: (4); (5); (6); (7); Among them, TP represents true positive, which is the positive category correctly predicted by the Mask R-CNN network model, such as correctly detecting the defective target and giving the correct mask; FN represents false negative, which is the positive category mistakenly predicted by the Mask R-CNN network model as the negative category, such as there is a defective target in the defective image of the mobile phone volume key, but the Mask R-CNN network model failed to detect it correctly; FP represents false positive, which is the negative category mistakenly predicted by the Mask R-CNN network model as the positive category, such as the mobile phone volume key defective image does not contain defects, but the Mask R-CNN network model incorrectly gives a mask; TN represents true negative, which is the negative category correctly predicted by the Mask R-CNN network model, such as the mobile phone volume key defective image does not contain defects, and the Mask R-CNN network model does not give a mask.

[0078] P It represents the precision rate, which refers to the proportion of samples that are actually positive among all samples predicted as positive by the Mask R-CNN network model; R Recall refers to the proportion of samples that are correctly predicted as positive by the Mask R-CNN network model among all samples that are actually positive. mAP Represents an indicator that measures how well the classifier performs on multiple categories. Among them, N is the number of object categories, i represents the i-th category, Represents the detection accuracy of the algorithm for the i-th category of objects. It is the accuracy of all categories. AP The average value of AP It refers to the average precision of a single category, which indicates the detection accuracy of the algorithm for this type of object. mAP The higher the value, the better the algorithm performs in detecting objects of different categories.

[0079] Step 4.6.2: Use IoU to evaluate the defect localization accuracy of the Mask R-CNN network model.

[0080] The intersection over union (IoU) is often used to measure the degree of overlap between the defect range predicted by the model and the actual defect range. The calculation method of IoU is: first calculate the area of ​​the intersection of the predicted bounding box and the actual bounding box, then calculate the area of ​​the union of the two bounding boxes, and finally divide the area of ​​the intersection by the area of ​​the union. The ratio obtained is IoU. The value of IoU is between 0 and 1. The larger the value, the better the overlap between the predicted bounding box and the actual bounding box, and the better the performance of the model.

[0081] The calculation formula of intersection over union (IoU) is expressed as: (8); Among them, A represents the area of ​​the predicted bounding box area, B represents the area of ​​the actual bounding box area, ∩ represents the intersection, and ∪ represents the union.

[0082] The defective target candidate frames of the mobile phone volume button are filtered and marked using the following rules: (1) Calculate the IoU value between each defect target candidate box and the true bounding box; (2) Setting a threshold. When the IoU value between the defect target candidate box and any real bounding box is greater than the set threshold, the defect target candidate box is marked as a positive sample; otherwise, it is marked as a negative sample. (3) Input all defective target candidate boxes into the target detection model, obtain the confidence score of the target detection model, and sort them in descending order according to the confidence score of the target detection model; (4) Perform non-grayscale maximum value suppression operations on all defect target candidate boxes. For example, starting from the defect target candidate box with the highest score, other candidate boxes whose IoU values ​​with it are greater than a certain threshold (for example, 0.3) are removed in sequence.

[0083] The above rules can help filter out most of the irrelevant candidate boxes, and the retained candidate boxes are more likely to contain real defect targets.

[0084] Step 5: Use the improved Mask R-CNN network model to identify and detect defects on the volume button of the mobile phone.

[0085] The improved Mask R-CNN network model can be configured for use on a computer device, and other control operations can be performed through the QT interface.

[0086] The defective image of the mobile phone volume key to be detected is input into the improved Mask R-CNN network model to identify the image of the mobile phone volume key component, obtain the category of the defective target and the defective image of the mobile phone volume key with the position and shape of the defective target marked.

[0087] In summary, the present invention proposes a method for detecting defects in a volume key of a mobile phone, wherein the improved Mask R-CNN network model not only inherits the advantages of the Faster R-CNN network model in target detection, but also realizes target category recognition, precise positioning of bounding boxes, and pixel-level instance segmentation. The improved Mask R-CNN network model includes: a backbone network VoVNet for preliminarily processing images and extracting key features; a region proposal network RPN for generating candidate bounding boxes based on the key features extracted by the backbone network VoVNet; and a RoIAlign pooling layer for mapping candidate bounding boxes of different sizes to feature maps of uniform size. In addition, the improved Mask R-CNN network model is used to perform three tasks in parallel: using the RoI classifier to determine the target category, using the RoI regressor to fine-tune the bounding box position, and using the segmentation mask module to generate an accurate pixel-level mask to achieve fine division of the defective area. The present invention realizes intelligent defect detection and classification of defective images of mobile phone volume keys, improves quality control, reduces the defective rate, solves the problem of instantly and accurately identifying defects in mobile phone volume keys, and promotes the automation of production lines and the intelligent transformation of the electronic manufacturing industry.

[0088] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0089] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.

Claims

1. A method for detecting defects in a volume button of a mobile phone, characterized in that: include: Obtain the volume button defect image of the mobile phone to be detected; Input the mobile phone volume key defect image to be detected into the improved Mask R-CNN network model, and output the category, location and shape of the defect target; The data processing process of the improved Mask R-CNN network model includes: The backbone network VoVNet is used to extract features from the defective image of the volume button of the mobile phone, and a defective feature map of the volume button of the mobile phone is obtained; Input the defect feature map of the volume button of the mobile phone into the region proposal network RPN to obtain the proposed candidate region; According to the proposed candidate area and the defect feature map of the volume button of the mobile phone, a proposed feature block of a fixed size is obtained through the RoIAlign pooling layer; The proposed feature blocks are processed in parallel, including determining the category of the defect target to which the proposed feature blocks belong, the position and shape of the defect target, and obtaining the category of the defect target and a mobile phone volume key defect image with the position and shape of the defect target marked.

2. The method for detecting defects of a mobile phone volume button according to claim 1, characterized in that: The improved Mask R-CNN network model includes: The backbone network VoVNet is used to preliminarily process the defective images of the mobile phone volume button and perform feature extraction; The region proposal network RPN is used to generate defect candidate boxes based on the features extracted by the backbone network VoVNet; The RoIAlign pooling layer is used to map defect candidate boxes of different sizes to proposed feature blocks of fixed size.

3. The method for detecting defects of a volume key of a mobile phone according to claim 1, characterized in that: Before inputting the mobile phone volume key defect image to be detected into the improved Mask R-CNN network model, the mobile phone volume key defect image to be detected is preprocessed, including: Preprocessing the volume key defect image of the mobile phone to be detected by using an improved median filtering method to obtain the volume key defect image of the mobile phone after filtering; The mobile phone volume key defect image after the image pair filtering is preprocessed using discrete Fourier transform to obtain a preprocessed mobile phone volume key defect image.

4. The method for detecting defects in a volume key of a mobile phone according to claim 3, characterized in that: The method for preprocessing the defective image of the mobile phone volume key to be detected by using an improved median filtering method comprises: Grayscale the volume key defect image of the mobile phone to be detected to obtain a grayscale image of the volume key defect of the mobile phone; The neighborhood range of the preset target pixel point (x, y) and the set fluctuation range k are used to identify the edge of the grayscale image of the volume button defect of the mobile phone. p is defined to represent the grayscale value at the target pixel point (x, y), and Max represents the grayscale maximum value in the neighborhood of the pixel point (x, y); Traverse each pixel in the grayscale image of the volume button defect on the mobile phone, and perform the following operations on each pixel: Get the neighborhood pixel values ​​of the target pixel point (x, y) and calculate the grayscale maximum value Max in the neighborhood of the target pixel point (x, y); When the grayscale value p of the target pixel (x, y) satisfies (p+k)> Max, keep the current pixel value p; When the gray value p of the target pixel point (x, y) does not satisfy (p+k)> Max, the pixel values ​​in the neighborhood of the pixel point (x, y) are sorted, and the middle value after sorting is selected as the new gray value of the pixel point (x, y); After traversing and processing all the pixels in the mobile phone volume key defect grayscale image, a filtered mobile phone volume key defect image is obtained.

5. The method for detecting defects of a volume button of a mobile phone according to claim 3 or 4, characterized in that: The steps of preprocessing the mobile phone volume key defect image after the image filtering by using discrete Fourier transform include: Performing discrete Fourier transform on the filtered mobile phone volume key defect image, converting the filtered mobile phone volume key defect image from the spatial domain to the frequency domain, and obtaining the mobile phone volume key defect image in the frequency domain; Perform low-pass filtering on the defective image of the mobile phone volume key in the frequency domain, remove high-frequency defects and convert it back to the original spatial domain to obtain the defective image of the mobile phone volume key after removing high-frequency defects; The defect image of the volume key of the mobile phone after high-frequency defects are removed is differentiated from the defect image of the volume key of the mobile phone after filtering to obtain the defect enhanced image of the volume key of the mobile phone; A transmission transformation is performed on the defect image of the volume button of the mobile phone after defect enhancement, and the size of the defect image of the volume button of the mobile phone after defect enhancement is uniformly set to 638×1350 pixels.

6. The method for detecting defects of a volume key of a mobile phone according to claim 1, characterized in that: The method of inputting the defect feature map of the volume button of the mobile phone into the region proposal network RPN to obtain the proposed candidate area includes: Input the training set containing the defect feature map of the volume button of the mobile phone into the region proposal network RPN, define and optimize the region proposal network RPN loss function to adjust the network parameters, and obtain the trained region proposal network RPN; Input the defect feature map of the volume button of the mobile phone into the trained region proposal network RPN to generate a large number of defect candidate boxes; The classification branch of the region proposal network RPN is used to calculate the probability that each defect candidate box belongs to the defect target through the softmax function, and then compared with the preset threshold to obtain the defect target candidate box; The regression branch of the region proposal network (RPN) uses the loss function smooth to perform border regression correction on each defect target candidate box to further adjust the position and size of the defect target candidate box to obtain the proposed candidate area.

7. The method for detecting defects in a volume key of a mobile phone according to claim 6, characterized in that: The loss function of the region proposal network RPN includes a classification loss function and a modified regression loss function. The total loss value of the region proposal network RPN is expressed as: ; in, The loss value of the classification layer of the regional proposal network RPN; Correct the loss value of the regression layer for the region proposal network RPN; It is the total loss value of the region proposal network RPN.

8. The method for detecting defects of a volume key of a mobile phone according to claim 7, characterized in that: The loss value of the classification layer of the region proposal network RPN The calculation formula is expressed as: ; in, Suggest box numbers for targets; For the The probability that a target box is a positive sample; For the The actual probability of a target box is 1 for positive samples and 0 for negative samples; is the number of samples in the classification layer; log [] indicates taking the logarithm; the loss value of the regression layer of the region proposal network RPN is corrected The calculation formula is expressed as: ; in, For the The deviation between the predicted coordinates and the actual coordinates of the target box; For the A set of predicted coordinates of target boxes; For the The actual coordinate set of the target box; SmoothL1Loss is the smooth L1 loss function, N The number of suggested boxes for the target.

9. The method for detecting defects of a volume key of a mobile phone according to claim 1, characterized in that: The method of obtaining a fixed-size proposed feature block through a RoIAlign pooling layer according to the proposed candidate area and the defect feature map of the volume button of the mobile phone includes: Calculate the area corresponding to the suggested candidate area on the mobile phone volume key defect feature map according to the coordinates and size of the suggested candidate area on the mobile phone volume key defect feature map, and the scaling ratio of the mobile phone volume key defect feature map relative to the mobile phone volume key defect image; Input the mobile phone volume key defect feature map and the area corresponding to the suggested candidate area on the mobile phone volume key defect feature map into the RoIAlign pooling layer, and use the RoIAlign pooling layer to receive the coordinates and size of the suggested candidate area; Set the target size of the output feature block of the RoIAlign pooling layer; The RoIAlign pooling layer is used to divide the area corresponding to each proposed candidate area on the mobile phone volume key defect feature map into multiple sub-areas corresponding to the target size of the output feature block; In each sub-area, sampling points are evenly set according to the set number of sampling points; Using the bilinear interpolation method, the feature value of each sampling point on the defect feature map of the mobile phone volume button is calculated and weighted average aggregation is performed to convert each proposed candidate area into a proposed feature block of a fixed size.

10. The method for detecting defects of a volume key of a mobile phone according to claim 1, characterized in that: The proposed feature blocks are processed in parallel, including a method for determining the category of the defect target to which the proposed feature blocks belong, and the location and shape of the defect target, including: Use the RoI classifier to determine the category of the defect target to which each proposed feature block belongs; Use the RoI regressor to fine-tune the bounding box position and locate the defect target; Use the segmentation mask module to generate pixel-level masks to divide the shape of the defect target.

Citation Information

Patent Citations

  • An edge protection denoising method

    CN109377450A

  • Special metal defect detection system based on deep learning

    CN110992318A

  • Mobile phone glass cover plate window area defect detection method based on symmetry

    CN114881915A

  • Image instance segmentation method based on enhanced one-time aggregation network

    CN117422876A

  • Apparatus and Method for Detection defect of sewer pipe based on Deep Learning

    KR102008973B1

Cited By

  • Mobile phone side key defect detection method based on image intelligent identification

    CN120563821A