A table tennis defect detection system and electronic device

By using a side light source and a high-resolution camera to acquire images in a ping-pong ball defect detection system, and combining deep learning algorithms and an improved convolutional neural network model, the problems of uneven lighting, background interference, and inference delay in ping-pong ball defect detection are solved, achieving fast and accurate defect detection, which is suitable for high-frequency automated production lines.

CN120259245BActive Publication Date: 2025-11-07GUANGZHOU DOUBLE FISH SPORTS GOODS GRP +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510345169.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-11-07
Estimated Expiration
2045-03-24

Smart Images

  • Figure CN120259245B_ABST
    Figure CN120259245B_ABST
Patent Text Reader

Abstract

The application provides a table tennis flaw detection system and electronic equipment, comprising: when a side light source is used to illuminate a table tennis ball at the same time, a high-resolution camera is used to collect a table tennis ball original image in parallel, a deep learning algorithm is combined to perform image capture and analysis, the system pre-processes the image, extracts features, identifies and classifies flaws, and finally outputs the results in parallel, so that automatic detection is realized, the pre-processing of the image significantly enhances the image contrast and reduces noise points, the detection accuracy in the case of small flaws and complex backgrounds is improved, the feature extraction layer of the improved model is used, a target detection algorithm in deep learning is used to accurately find out the flaws in the image, the sensitivity to slight flaws is enhanced, the problem of insufficient feature extraction of the traditional convolution layer when processing complex backgrounds is avoided, and NMS-free training is used to reduce inference delay, so that the detection accuracy and real-time performance of the overall system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of table tennis production quality control and precision detection, and in particular to a table tennis flaw detection system and an electronic device. BACKGROUND

[0002] In the prior art, color images under a single light source and multi-light source images are obtained to generate material images and surface geometry images to improve the accuracy and comprehensiveness of defect detection. The prior art usually uses an image mask method, which relies on pre-defined templates or models to identify and locate defect regions in images.

[0003] The above prior art has the following disadvantages:

[0004] ① Uneven illumination and background interference: The prior art usually requires complex image preprocessing steps to enhance image quality, but these methods often involve more image fusion, and the processing process is complex and easily affected by external environmental changes.

[0005] ② Insufficient target detection accuracy: Traditional target detection methods usually use a single image preprocessing method and model, with limited feature extraction capability and low detection accuracy when dealing with complex backgrounds or small flaws.

[0006] ③ High inference delay: Existing detection methods generally rely on the non-maximum suppression (NMS) algorithm to optimize target detection results, but NMS increases inference delay, affecting the efficiency of real-time detection, and using image segmentation causes more time loss. SUMMARY

[0007] In view of the above problems, the present application is proposed to provide a table tennis flaw detection system and an electronic device that overcome the above problems or at least partially solve the above problems.

[0008] The present application provides a table tennis flaw detection system, comprising:

[0009] a table tennis image acquisition module for acquiring a table tennis original image in parallel through a high-resolution camera when a side light source is used to illuminate the table tennis;

[0010] a table tennis image preprocessing module for image processing of the table tennis original image to obtain a table tennis image to be detected;

[0011] The flaw detection and classification module is configured to perform flaw identification on the table tennis ball image to be detected by using a flaw detection model, output a flaw prediction result of the table tennis ball, determine a quality grade of the table tennis ball according to the flaw prediction result, and store the table tennis ball in a corresponding quality grade collecting device according to the quality grade of the table tennis ball. The flaw prediction result of the table tennis ball is a flaw type of the table tennis ball or no flaw of the table tennis ball.

[0012] Optionally, the flaw type includes density, color point, glue deficiency, yellow line, indentation, fungus edge, swelling deficiency, and yin-yang ball.

[0013] Optionally, the table tennis ball image preprocessing module is further configured to:

[0014] The table tennis ball image preprocessing module is configured to perform Gaussian denoising processing, gray processing, and contrast enhancement processing on the table tennis ball original image to obtain the table tennis ball image to be detected.

[0015] Optionally, the table tennis ball image preprocessing module is further configured to:

[0016] In the Gaussian denoising processing, a Gaussian function is used as a weight coefficient, and for each pixel point in the table tennis ball original image, a weighted average value of pixels around the pixel point is calculated as a new pixel value to obtain a table tennis ball Gaussian denoising image.

[0017] Optionally, the table tennis ball image preprocessing module is further configured to:

[0018] The table tennis ball Gaussian denoising image is converted into a gray image.

[0019] The histogram and the cumulative distribution function of the gray image are calculated.

[0020] The cumulative distribution function is normalized to a preset gray level range.

[0021] According to the normalized cumulative distribution function, each pixel value of the histogram is replaced by a new pixel value to obtain the table tennis ball image to be detected.

[0022] Optionally, the training process of the flaw detection model includes:

[0023] Table tennis ball images without flaws and of various flaw types are collected, and each table tennis ball image is labeled with a type to which the table tennis ball image belongs, and a table tennis ball image sample data set is constructed.

[0024] The table tennis ball image sample data set is subjected to Gaussian denoising processing, gray processing, and contrast enhancement processing to obtain a table tennis ball image training data set.

[0025] The improved CSPDarknet deep convolutional neural network model is trained by using the table tennis ball image training data set to obtain the flaw detection model.

[0026] Optionally, the improved CSPDarknet deep convolutional neural network model comprises a C2PSA module that fuses a pyramid slice attention mechanism and a convolutional layer, the improved CSPDarknet deep convolutional neural network model is trained using the table tennis ball image training dataset to obtain the defect detection model, comprising:

[0027] The table tennis ball image training dataset is input into the improved CSPDarknet deep convolutional neural network model, the C2PSA module divides the original feature map of the table tennis ball training image into multiple pyramid level slices, performs a global pooling operation on each slice to obtain a global feature representation of each slice, transforms the global feature representation of each slice through a convolutional layer to obtain an attention weight, and multiplies the attention weight with the corresponding slice of the original feature map to obtain a table tennis ball deep fusion feature map.

[0028] The table tennis ball deep fusion feature map processed by the C2PSA module is continuously passed to a subsequent network layer to output a table tennis ball defect prediction result.

[0029] A loss value is calculated according to the difference between the table tennis ball defect prediction result and a true table tennis ball defect label, and the model parameters are updated through back propagation, and the model is iterated for multiple times until the model converges or a predetermined maximum number of iterations is reached to obtain the defect detection model.

[0030] Optionally, the table tennis ball defect detection system further comprises a ball diameter measurement module, the ball diameter measurement module is configured to determine whether to perform ball diameter measurement on the table tennis ball according to the quality grade of the table tennis ball; if the quality grade of the table tennis ball is a superior product, the ball diameter measurement is performed on the table tennis ball; if the quality grade of the table tennis ball is a non-superior product, the ball diameter measurement step of the table tennis ball is skipped.

[0031] Optionally, the table tennis ball image acquisition module is further configured to:

[0032] When three groups of side light sources are used to illuminate the table tennis ball at the same time, three high-resolution cameras that are uniformly distributed at 120° on the side of the table tennis ball are used to acquire the original image of the table tennis ball in parallel.

[0033] The present application also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the electronic device executes the computer program to load the table tennis ball defect detection system according to any one of the embodiments of the present application.

[0034] The present application comprises the following advantages:

[0035] The table tennis ball flaw detection system of the present application, when using a side light source to illuminate the table tennis ball at the same time, acquires the original image of the table tennis ball in parallel through a high-resolution camera, combines the deep learning algorithm in the AI vision technology for image capture and analysis, pre-processes the image, extracts features, identifies and classifies flaws, and finally outputs the results in parallel, realizing automatic detection, wherein the histogram equalization and Gaussian denoising technology in image preprocessing significantly enhances the image contrast and reduces noise, improving the detection accuracy under small flaws and complex background, secondly, the present application improves the feature extraction layer of the model, uses the improved autonomous attention convolution layer to improve the feature extraction, and the autonomous attention convolution layer further enhances the sensitivity to subtle flaws, avoiding the feature extraction deficiency problem of traditional convolution layer when processing complex background. Furthermore, NMS training is used in post-processing, eliminating the NMS process, thereby significantly reducing the inference delay. This enables the present application to process real-time image data faster and adapt to the flaw detection requirements of high-frequency production lines. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 is a structural block diagram of a table tennis ball flaw detection system provided by an embodiment of the present application;

[0037] Figure 2 is a table tennis ball image labeling schematic diagram provided by an embodiment of the present application;

[0038] Figure 3 is a table tennis ball image preprocessing schematic diagram provided by an embodiment of the present application;

[0039] Figure 4 is a table tennis ball deep fusion feature map extracted by the improved CSPDarknet deep convolutional neural network model provided by an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0041] REFERENCE Figure 1 , shows a structural block diagram of a table tennis ball flaw detection system provided by an embodiment of the present application, which can specifically include the following modules:

[0042] The table tennis ball image acquisition module is used to acquire the original image of the table tennis ball in parallel through a high-resolution camera when a side light source is used to illuminate the table tennis ball at the same time;

[0043] The table tennis ball image preprocessing module is used to process the table tennis ball original image to obtain a table tennis ball image to be detected;

[0044] The flaw detection and classification module is used for flaw recognition of the table tennis ball to be detected image through a flaw detection model, outputs a flaw prediction result of the table tennis ball, determines a quality grade of the table tennis ball according to the flaw prediction result, and stores the table tennis ball to a corresponding quality grade collecting device according to the quality grade of the table tennis ball.

[0045] The table tennis ball flaw detection system of the embodiment of the present application aims at accurate identification of table tennis ball flaws. In the system, three groups of side light sources are used to illuminate the table tennis balls at the same time, ensuring that clear and uniform images can be obtained even in complex lighting environments, for example, twelve table tennis balls are illuminated at the same time by three groups of side light sources. Three high-resolution cameras are evenly distributed at a 120° angle on the side of the table tennis ball, and the original images of the table tennis ball are collected in parallel, ensuring that the surface of the table tennis ball is fully covered from multiple angles, and the generation of shadows can be effectively avoided, improving the image quality.

[0046] In order to further improve the accuracy of flaw detection, the table tennis ball image preprocessing module in the embodiment of the present application is responsible for preprocessing the collected original images, including operations such as enhancing image contrast and reducing noise points, which significantly improves the probability of detecting small flaws in complex backgrounds.

[0047] Finally, the flaw detection and classification module uses a target detection algorithm in deep learning to perform detailed flaw recognition on the preprocessed table tennis ball images. The feature extraction layer of the model used has been improved to enhance the sensitivity to subtle flaws, and has been optimized especially for the insufficient feature extraction of traditional convolutional layers in complex backgrounds. In this process, the system can quickly and accurately locate and identify any defects in the image based on the pre-trained flaw detection model. Based on the detected flaw type or the result of confirming no flaw, the system will automatically determine the quality grade of the table tennis ball and store the table tennis balls of different grades using the corresponding collecting device.

[0048] The flaw types can include density, color points, lack of glue, yellow lines, dents, ear edges, swelling, and yin-yang balls, etc. The quality grades can include superior products, first-class products, qualified products, recreational products, and rejected balls, etc. The superior products can include super three-star, common three-star, one-star, etc.

[0049] The present application provides an end-to-end automatic detection system, which realizes automatic processing from image acquisition, preprocessing, feature extraction to flaw detection. Through deep learning algorithms and efficient image processing procedures, the system can quickly and accurately detect various flaws on the surface of table tennis balls, and is suitable for high-frequency automatic production lines.

[0050] In an embodiment of the present application, the table tennis ball image preprocessing module is further configured to:

[0051] The original table tennis ball image is subjected to Gaussian denoising processing, gray scale processing and contrast enhancement processing to obtain a table tennis ball image to be detected.

[0052] The table tennis ball flaw detection system of the present application not only has a fully automatic detection process, but also has a table tennis ball image preprocessing module that uses a series of advanced image processing techniques, including Gaussian denoising, gray scale conversion and contrast enhancement, to effectively improve the quality of the original image. These preprocessing steps ensure that the collected table tennis ball image can achieve high definition and high contrast even in a complex or changing environment, thereby providing a reliable basis for subsequent accurate flaw recognition and classification. The high-quality image processing capability is closely combined with the fully automatic detection function of the system, so that the flaw detection accuracy of the system is also improved, further ensuring product quality.

[0053] In an embodiment of the present application, the table tennis ball image preprocessing module is further configured to:

[0054] In the Gaussian denoising processing, a Gaussian function is used as a weight coefficient, and for each pixel point in the original table tennis ball image, a weighted average value of the pixels around the pixel point is calculated as a new pixel value to obtain a table tennis ball Gaussian denoising image.

[0055] In this embodiment, Gaussian blur, mean filter and other denoising methods can be used to reduce the interference of image noise. Gaussian blur is a linear filtering method that uses a Gaussian function as a weight coefficient. For each pixel point, Gaussian blur calculates the weighted average value of the pixels around it, and the weight is determined by the Gaussian function. The Gaussian blur calculation formula is:

[0056]

[0057] where I blur (x, y) is the value of the blurred image at point (x, y), I(x+u, y+v) is the value of the original image at point (x+u, y+v), and σ is the standard deviation of the Gaussian function, which controls the degree of blur.

[0058] In an embodiment of the present application, the table tennis ball image preprocessing module is further configured to:

[0059] The table tennis ball Gaussian denoising image is converted into a gray scale image.

[0060] The histogram and cumulative distribution function of the gray scale image are calculated.

[0061] The cumulative distribution function is normalized to a preset gray scale range.

[0062] According to the normalized cumulative distribution function, each pixel value of the histogram is replaced by a new pixel value to obtain a table tennis ball image to be detected.

[0063] In this embodiment, the image details are enhanced by histogram equalization and other techniques, so that the table tennis ball profile is clearer. Specifically, first, the histogram of the image is calculated, and then the cumulative distribution function is calculated.

[0064]

[0065] By normalizing the CDF to the range [0, L-1] (where L is the number of gray levels, such as 256), a new gray value is obtained:

[0066] s(i)=round((L-1)·CDF(i))

[0067] After generating the equalized image, the original image is replaced by a new pixel value s(f(x,y)) to generate an equalized image.

[0068] In one embodiment of the present application, the training process of the defect detection model comprises:

[0069] Collecting table tennis ball images without defects and various defect types and marking the types of each table tennis ball image to construct a table tennis ball image sample dataset;

[0070] The table tennis ball image sample dataset is subjected to Gaussian denoising processing, gray processing and contrast enhancement processing to obtain a table tennis ball image training dataset;

[0071] The improved CSPDarknet deep convolutional neural network model is trained using the table tennis ball image training dataset to obtain the defect detection model.

[0072] In one embodiment of the present application, the improved CSPDarknet deep convolutional neural network model comprises a C2PSA module that integrates a pyramid slice attention mechanism and a convolution layer. The improved CSPDarknet deep convolutional neural network model is trained using the table tennis ball image training dataset to obtain the defect detection model, comprising:

[0073] The table tennis ball image training dataset is used as the input of the improved CSPDarknet deep convolutional neural network model. The C2PSA module divides the original feature map of the table tennis ball training image into multiple pyramid level slices, performs global pooling operation on each slice to obtain the global feature representation of each slice, transforms the global feature representation of each slice through a convolution layer to obtain an attention weight, multiplies the attention weight with the corresponding slice of the original feature map to obtain a table tennis ball deep fusion feature map.

[0074] The ping-pong ball deep fusion feature map processed by the C2PSA module is continuously passed to subsequent network layers to output a ping-pong ball defect prediction result.

[0075] A loss value is calculated according to the difference between the ping-pong ball defect prediction result and the real ping-pong ball defect label, and the model parameters are updated through back propagation. After multiple iterations until the model converges or reaches a predetermined maximum number of iterations, the defect detection model is obtained.

[0076] In the embodiments of the present application, a model capable of efficiently and accurately identifying and classifying ping-pong ball surface defects is constructed and trained. Specifically, ping-pong ball images without defects and of various types of defects are collected to ensure the diversity and representativeness of the training data set, and these images are accurately labeled to determine their specific types, as described in Figure 2 After the ping-pong ball image sample data set is constructed, the system pre-processes the ping-pong ball image samples, as described in Figure 3 Through histogram equalization and Gaussian noise reduction techniques in image preprocessing, the image contrast is significantly enhanced and noise is reduced, improving the detection accuracy in the presence of small defects and complex backgrounds. These preprocessing steps not only enhance the visual effect of the image, but also improve the sensitivity of the model to subtle defects. The images processed in this way are integrated into the ping-pong ball image training data set, providing high-quality learning samples for the subsequent model training.

[0077] The improved CSPDarknet deep convolutional neural network model is one of the invention points of the present application. The C2PSA self-attention mechanism module is introduced into the feature extraction layer of the CSPDarknet deep convolutional neural network model. The C2PSA module combines the pyramid slice attention mechanism with the traditional convolutional layer. The C2PSA module divides the input ping-pong ball training image original feature map into multiple pyramid level slices of different scales, and each slice represents the feature information at a specific scale. For each slice, the system performs global pooling operation to obtain global feature representation, and further transforms these representations through convolutional layer to calculate attention weights. The attention weights are then multiplied with the corresponding slice of the original feature map to generate a deep fusion feature map, as described in Figure 4 , improving the model's ability to capture subtle or complex defect features. The deep fusion feature map is continuously passed to subsequent network layers to finally output the ping-pong ball defect prediction result. A loss value is calculated according to the difference between the prediction result and the real label, and the model parameters are continuously updated through the back propagation algorithm. The preliminary effect of the model after training is evaluated according to the results, and finally the model is trained through multiple iterations to obtain a high-precision defect detection model.

[0078] The table tennis ball flaw detection system of the present application not only has a fully automated detection process, but also realizes efficient identification and classification of surface flaws of table tennis balls through the flaw detection model of the flaw detection and classification module. These improvements ensure that the model can accurately detect subtle flaws in a complex background. The improved and trained flaw detection model of the present application is closely combined with the fully automatic detection function of the system, so that while realizing the full automation of the system, various flaws on the surface of the table tennis ball can be quickly and accurately detected, and the product quality can be ensured in real time.

[0079] In an embodiment of the present application, the table tennis ball flaw detection system further comprises a ball diameter measurement module for determining whether to perform ball diameter measurement on the table tennis ball according to the quality grade of the table tennis ball; if the quality grade of the table tennis ball is superior product, the ball diameter measurement is performed on the table tennis ball; if the quality grade of the table tennis ball is non-superior product, the ball diameter measurement step is skipped.

[0080] In an embodiment, the table tennis ball flaw detection system can further integrate a ball diameter measurement module to ensure that superior table tennis balls not only meet high standards in surface quality, but also strictly comply with the requirements of international competition rules. The design of this module aims to decide whether to perform the ball diameter measurement step according to the quality grade of the table tennis ball. Specifically, when the flaw detection and classification module completes the analysis of the surface flaws of the table tennis ball and determines that the table tennis ball is superior product, the system will automatically trigger the ball diameter measurement module to perform accurate diameter measurement on these high-quality table tennis balls. This process is realized through high-precision sensors or visual measurement technology, ensuring that each table tennis ball marked as superior product can meet strict size standards. For those table tennis balls classified as non-superior product, the ball diameter measurement step can be directly skipped, avoiding unnecessary resource consumption and improving the overall detection efficiency of the system. In this way, the present application realizes comprehensive coverage of table tennis ball quality control, from surface flaws to size specifications, ensuring that each table tennis ball leaving the factory meets the production standards.

[0081] The present application has the following advantages:

[0082] The application provides an end-to-end automatic detection system, which realizes automatic processing in the whole process from image acquisition, pretreatment, feature extraction to flaw detection. Through a deep learning algorithm and an efficient image processing process, the system can quickly and accurately detect various flaws on the surface of a table tennis ball, and is suitable for a high-frequency automatic production line. The target detection algorithm used in the application generally does not involve processing of multi-light-source images, and is different from the image pretreatment method adopted in the prior art, that is, the image pretreatment used in the prior art is to construct data by image fusion using different light sources, and the application is to pretreat and improve the contrast of the picture by histogram equalization, and to remove noise in the picture by using a Gaussian convolution kernel. Through the histogram equalization and Gaussian noise removal technology in image pretreatment, the image contrast is significantly enhanced and the noise is reduced, the detection accuracy in the presence of small flaws and complex backgrounds is improved, and secondly, the feature extraction layer of the model is improved, the improved autonomous attention convolution layer is used to improve the feature extraction, the autonomous attention convolution layer further enhances the sensitivity to slight flaws, and avoids the feature extraction deficiency problem of the traditional convolution layer when processing complex backgrounds. Furthermore, NMS training is used in post-processing, which eliminates the NMS process, thereby significantly reducing the inference delay. This enables the application to process real-time image data faster, ensures that the system can maintain high efficiency in real-time detection tasks, and meets the flaw detection requirements of high-frequency production lines with extremely high real-time requirements.

[0083] Based on the same inventive concept, another embodiment of the application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to load the table tennis ball flaw detection system according to any one of the embodiments of the application.

[0084] Specifically, the electronic device comprises a memory and a processor, the memory and the processor are communicatively connected through a bus, the memory stores a computer program, the computer program can run on the processor, and then loads the table tennis ball flaw detection system according to any one of the first aspect of the embodiments of the application.

[0085] The memory can include a random access memory (RAM) and can also include a non-volatile memory, such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0086] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0087] Based on the same inventive concept, another embodiment of the present application provides a computer readable storage medium, which stores computer programs / instructions, and the computer programs / instructions are executed by a processor to load the table tennis flaw detection system according to any one of the first aspect of the embodiments of the present application.

[0088] Each of the embodiments in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts of each embodiment can be referred to each other.

[0089] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device, electronic equipment, storage medium or computer program product. Therefore, the embodiments of the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can be in 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 codes.

[0090] Although the embodiments of the present application have been shown and described, those skilled in the art can understand that various changes, modifications, replacements and variations can be made to the embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the claims and their equivalents.

[0091] Finally, it is to be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0092] The ping ball flaw detection system and electronic device provided by the present application are described in detail above, and the principles and implementation manners of the present application are described by using specific examples in the present document. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, according to the idea of the present application, the specific implementation manners and application ranges can be changed by those skilled in the art. In summary, the content of the present description should not be understood as a limitation of the present application. The above embodiments are only preferred embodiments used to fully describe the present application, and the protection scope of the present application is not limited thereto. Equivalent replacements or changes made by those skilled in the art on the basis of the present application are within the protection scope of the present application.

Claims

1. A table tennis defect detection system, characterized by, The system comprises: a table tennis ball image acquisition module, configured to acquire original table tennis ball images in parallel through a high-resolution camera while illuminating the table tennis ball with a side light source; a table tennis ball image preprocessing module, configured to perform image processing on the original table tennis ball images to obtain table tennis ball images to be detected; a defect detection and classification module, configured to perform defect identification on the table tennis ball images to be detected through a defect detection model, output a defect prediction result of the table tennis ball, determine a quality grade of the table tennis ball according to the defect prediction result, and store the table tennis ball in a corresponding quality grade collecting device according to the quality grade of the table tennis ball; the defect prediction result of the table tennis ball is a defect type of the table tennis ball or no defect of the table tennis ball; the training process of the defect detection model comprises: collecting table tennis ball images without defects and of various defect types and marking the types of the table tennis ball images to construct a table tennis ball image sample data set; performing Gaussian denoising processing, grayscale processing and contrast enhancement processing on the table tennis ball image sample data set to obtain a table tennis ball image training data set; training an improved CSPDarknet deep convolutional neural network model using the table tennis ball image training data set to obtain the defect detection model; the improved CSPDarknet deep convolutional neural network model comprises a C2PSA module, the C2PSA module fuses a pyramid slice attention mechanism and a convolutional layer, the defect detection model is obtained by training the improved CSPDarknet deep convolutional neural network model using the table tennis ball image training data set, and the defect detection model comprises: the table tennis ball image training data set is taken as an input of the improved CSPDarknet deep convolutional neural network model, the C2PSA module divides original feature maps of the table tennis ball training images into multiple pyramid level slices, performs a global pooling operation on each slice to obtain a global feature representation of each slice, transforms the global feature representation of each slice through a convolutional layer to obtain an attention weight, multiplies the attention weight with a corresponding slice of the original feature maps to obtain a table tennis ball deep fusion feature map; the table tennis ball deep fusion feature map processed through the C2PSA module is further transmitted to a subsequent network layer to output a table tennis ball defect prediction result; a loss value is calculated according to a difference between the table tennis ball defect prediction result and a real defect label of the table tennis ball, and model parameters are updated through back propagation, and the defect detection model is obtained through multiple iterations until the model converges or a predetermined maximum number of iterations is reached.

2. The table tennis ball defect detection system according to claim 1, wherein the defect types comprise density, color points, glue deficiency, yellow lines, dents, ear edges, swelling deficiency and yin-yang balls.

3. The table tennis ball defect detection system according to claim 1, wherein the table tennis ball image preprocessing module is further configured to: perform Gaussian denoising processing, grayscale processing and contrast enhancement processing on the original table tennis ball images to obtain the table tennis ball images to be detected.

4. The table tennis ball defect detection system according to claim 3, wherein the table tennis ball image preprocessing module is further configured to: ​ ​ ​ In the Gaussian denoising processing, a Gaussian function is used as a weight coefficient, and a weighted average value of pixels around each pixel point in the table tennis original image is calculated as a new pixel value to obtain a table tennis Gaussian denoising image. 5.The table tennis flaw detection system according to claim 4, characterized in that, the table tennis image preprocessing module is further configured to: convert the table tennis Gaussian denoising image into a gray-scale image; calculate a histogram and a cumulative distribution function of the gray-scale image; normalize the cumulative distribution function to a preset gray-scale range; replace each pixel value of the histogram with a new pixel value according to the normalized cumulative distribution function to obtain a table tennis image to be detected. 6.The table tennis flaw detection system according to claim 1, characterized in that, the table tennis flaw detection system further comprises a ball diameter measurement module configured to determine whether to measure the ball diameter of the table tennis according to the quality grade of the table tennis; if the quality grade of the table tennis is a superior grade, the ball diameter of the table tennis is measured; if the quality grade of the table tennis is a non-superior grade, the ball diameter measurement of the table tennis is skipped. 7.The table tennis flaw detection system according to claim 1, characterized in that, the table tennis image acquisition module is further configured to: acquire the table tennis original image in parallel through three high-resolution cameras which are uniformly distributed at 120° on the side of the table tennis when the three sets of side light sources are used to illuminate the table tennis at the same time.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The electronic device loads the table tennis flaw detection system according to any one of claims 1 to 7 when executing the computer program.

Citation Information

Patent Citations

  • Glass bead surface appearance defect detection method based on deep learning

    CN116342491A

  • Part surface quality detection method and system based on machine vision

    CN118608504A