A method for detecting the quality of badminton heads using Transformer deep learning model

The badminton head quality inspection method built through the Transformer deep learning model solves the problems of low quality assessment efficiency and poor consistency in existing technologies, realizes the automated inspection of cork discs, ball head roundness and leather defects, and improves the inspection accuracy and stability.

CN116452514BActive Publication Date: 2025-09-09HARBIN INST OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310284121.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2025-09-09
Estimated Expiration
2043-03-22

AI Technical Summary

Technical Problem

The existing quality assessment in badminton head production suffers from low efficiency, unstable quality, and poor consistency, especially in the lack of effective automated means for cork disc quality inspection, ball head roundness inspection, and leather defect detection.

Method used

The Transformer deep learning model is used in combination with the U2Net neural network for image preprocessing to build cork disc quality detection, ball head roundness detection, and leather defect detection models. Automated quality assessment is achieved through feature analysis and classification models.

Benefits of technology

It realizes the automation and precision detection of the badminton head quality, improves the detection efficiency and quality stability, and ensures the quality consistency of each part of the head.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116452514B_ABST
    Figure CN116452514B_ABST
Patent Text Reader

Abstract

A method for detecting the quality of badminton heads using a Transformer deep learning model belongs to the technical field of badminton quality detection. In order to solve the problems of low efficiency, unstable quality, and poor consistency in quality assessment in the current production of badminton heads in my country, the method described in this application integrates and utilizes three key automated recognition technologies: quality grading detection of cork discs, detection of the roundness of the head, and detection of leather defects. This achieves a comprehensive inspection of the entire head and ensures the accuracy of the head quality assessment. This application is mainly used as a method for detecting the quality of badminton heads.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of badminton quality detection, and specifically relates to a method for detecting the quality of badminton heads using a Transformer deep learning model. Background Art

[0002] The production of badminton heads is an important technical link in badminton production. Mid-to-high-end badmintons are made of natural cork glued and polished into shape and wrapped with PU breathable leather on the outer layer. Their quality is affected by the grade of the cork discs, the precision and accuracy of the polishing and molding, and the quality of the PU leather pasting. The existing badminton production process adopts the method of sorting and random inspection, which only manually detects obvious defects on the appearance of the head, but ignores the inspection of the components of the head, including the quality inspection of the cork discs, the roundness of the head and the leather defect inspection. The current quality assessment of badminton heads in my country's production has problems such as low efficiency, unstable quality and poor consistency. Therefore, the development of a badminton head quality inspection method can effectively overcome the shortcomings existing in badminton inspection and is in line with practical needs. Summary of the Invention

[0003] In order to solve the problems of low efficiency, unstable quality and poor consistency in the quality assessment of badminton heads in my country's current production, the present invention provides a method for detecting the quality of badminton heads using a Transformer deep learning model.

[0004] A method for detecting the quality of badminton heads using a Transformer deep learning model is implemented by the following steps:

[0005] Step 1: Based on U 2 Net neural network for image preprocessing;

[0006] Step 2: Build a quality detection model for the cork discs in badminton heads and perform feature analysis on the samples;

[0007] Step 3: Construct a badminton head roundness detection model and perform feature analysis on the sample;

[0008] Step 4: Build a badminton ball leather defect detection model and perform feature analysis on the sample;

[0009] Step 5: judging the quality of the badminton head based on the analysis results obtained by constructing the detection model in step 2, the analysis results obtained by constructing the detection model in step 3, and the analysis results obtained by constructing the detection model in step 4;

[0010] Furthermore, the construction of the quality detection model of the cork disc in the badminton head and the characteristic analysis of the sample in step 2 are achieved by the following steps:

[0011] Step 21: Build feature representation and classification models based on the Transformer deep learning model ViT;

[0012] Step 22: Based on the Transformer deep learning model results and the cork disc quality judgment logic, four quality grades are determined;

[0013] Step 23: Based on the four quality grades of the cork discs in step 22, a training set is created to perform offline training on the classification model constructed in step 21, thereby obtaining the model parameters of the deep learning model ViT;

[0014] Step 24: Create a test set to conduct online testing on the algorithm model trained in Steps 2 and 3 to verify its performance indicators;

[0015] Furthermore, the construction of the badminton head roundness detection model and the characteristic analysis of the sample in step 3 are achieved by the following steps:

[0016] Step 31: Detect the roundness of the target ball head at a single angle. The number of times for detecting the roundness of each ball head at a single angle is two, which are recorded as shooting angle A and shooting angle B respectively.

[0017] Step 32: Perform quality grading on the two single-angle roundness test results obtained in step 31. Intersect the determination results of all angle images. If all are 1, it is judged as a good product, otherwise it is a defective product.

[0018] Step 33: Use single image roundness detection and multi-angle image comprehensive detection to determine the accuracy of the ball head roundness detection model;

[0019] Furthermore, in step 31, the single-angle roundness detection of the target ball head is performed by extracting the edge of the single-angle captured image and calculating the error between the edge and the standard ball head edge using Fourier descriptors. The specific steps are as follows:

[0020] Step a: Extract the closed boundary contour points (x i ,y i ), i=0,1,2,···,K-1, K is the number of extracted contour points, and the coordinates of the center point of the ball head are calculated as:

[0021]

[0022] Step b: Perform a centering operation on the ball head, that is, subtract the coordinates of the ball head's center point from each contour coordinate to facilitate analysis. Since different shooting angles result in different curvatures on the bottom edge of the ball head, which will affect the quality identification of the ball head to a certain extent, it is necessary to cut it off, retaining only the upper half of the ball head. If N% of the ball head length L is retained, the cut position is (N%-50%)×L below the ball head center point, and the part above it is retained as the identified ball head contour point, and it is represented as a discrete coordinate sequence c(k)={(x(k),y(k)),k=0,1,2,···,K′-1} with a total length of K′;

[0023] Step c: Starting from any point (x0, y0), when moving counterclockwise on the boundary, the boundary contour points of the ball head can be represented by complex numbers. The contour features are transformed from the spatial domain to the frequency domain, and the frequency domain information is extracted as the feature vector of the contour shape. In this way, the two-dimensional problem is simplified to one-dimensional, that is:

[0024] c(k)=x(k)+jy(k) (2)

[0025] The discrete Fourier transform of c(k) is:

[0026]

[0027] Step d: The Fourier descriptor is directly related to the starting point position, shape size, and direction of the boundary contour curve. Assuming that a(0) represents the 0th order coefficient and is 1, the amplitude value of the Fourier coefficient is independent of the starting point, rotation, and translation of the curve. The Fourier descriptor is normalized, that is:

[0028]

[0029] Step e: Calculate the Fourier descriptor f of the captured spherical head n With the standard spherical head Fourier descriptor f n s The calculation method of similarity distance is:

[0030]

[0031] Select the shooting angle of the ball head as A or B. If the distance d between the ball head photographed at any angle A or B and the standard ball head is similar FD >T, the ball head is considered defective. If the distance d between the ball head photographed at angles A and B and the standard ball head is similar FD ≤T, the ball head is considered to be good. T is the set detection threshold. When n≥100, the energy value is close to 0. Therefore, K m =100, select the part with n≤100 when calculating the Fourier descriptor of the ball head contour shape;

[0032] Furthermore, the specific steps of constructing a badminton ball leather defect detection model and performing feature analysis on the sample in step 4 are as follows:

[0033] Step 41: Shoot and collect images from two opposite angles;

[0034] Step 42: Build a model framework and input the image obtained in step 41 into the built model to perform defect detection on a single image;

[0035] Step 43: Collect ball head leather images on the prototype system and manually annotate them to obtain labels to construct a training set. Use the constructed training set to perform offline model training on the model framework constructed in step 42, thereby obtaining model parameters of the deep learning model.

[0036] Step 44: Create a test set to conduct online testing on the algorithm model trained in step 43 to verify its performance indicators;

[0037] Furthermore, the specific steps of constructing the model framework in step 42 and inputting the image obtained in step 41 into the constructed model to perform defect detection on a single image are as follows:

[0038] Step A: Image serialization: First, the input image is preprocessed. The image is divided into small blocks and projected into the embedding space to make it a set of flattened patches.

[0039] Step B: Embedding: Obtain a potential d-dimensional embedding space vector by trainable linear mapping and position embedding;

[0040] Step C: Transformer encoding: The feature representation of the image is obtained by the Transformer encoder, which contains L layers of multi-head self-attention (MSA) and multi-layer perceptron (MLP) blocks;

[0041] Step D: Part Selection Module: Apply a Part Selection Module (PSM) to select tokens corresponding to discriminative image patches and use only these selected tokens as input;

[0042] The beneficial effects of this application compared to the prior art are as follows:

[0043] This application proposes a method for detecting the quality of badminton club heads using a Transformer deep learning model, and develops automatic quality grading technology for club head cork discs, automatic identification technology for club head roundness, and identification technology for club head leather defects. Each part includes the design of an image acquisition device and the construction, training, and verification of a visual recognition model. The image acquisition device is designed to capture single-frame images or multi-frame, multi-angle images, and different classification models, training data sets, training methods, and deployment plans are designed according to different detection targets. It realizes the collection of club head data, the training of deep learning models based on club head images, and the online image quality detection based on pre-trained models, and designs and constructs a reasonable and efficient automated pipeline detection and control process;

[0044] This application uses an artificial intelligence-based machine vision method to solve three key automated identification technologies and sorting devices in the quality assurance of badminton products: quality grading detection of cork discs, roundness detection of ball heads, and leather defect detection. Among them, in the cork disc quality grading, this application has completed a supervised cork disc sorting detection algorithm based on deep learning, which effectively solves the automatic identification and classification of the quality grade of cork discs; in the ball head roundness detection, this application has completed an algorithm based on ball head cutting plane edge detection and single-angle roundness recognition, which effectively solves the ball head roundness recognition detection and automated sorting problem; in leather defect detection, this application has completed an enhanced fine-grained detection model based on Transformer, which effectively solves the ball head leather defect detection and automated sorting problem. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is a schematic diagram of image binarization using the triangular threshold method in the method described in this application;

[0046] Figure 2 This is a schematic diagram of the ViT model in the method described in this application;

[0047] Figure 3 This is a binary image of the ball head detected by the method described in this application (image resolution: 1000×3072);

[0048] Figure 4 Schematic diagram of the ball head contour points detected by the method described in this application;

[0049] Figure 5 The normalized Fourier descriptor of the ball head detected by the method described in this application;

[0050] Figure 6 Images of defective products taken by the ball head at three viewing angles according to the method described in this application;

[0051] Figure 7 Images of good products taken by the ball head at three viewing angles according to the method described in this application;

[0052] Figure 8 This is the opposite image of a good quality ball head leather product tested by the method described in this application;

[0053] Figure 9 This is an opposite image of a defective ball head leather product detected by the method described in this application;

[0054] Figure 10 The method described in this application is nothing more than a neural network model based on a fine-grained Transformer. DETAILED DESCRIPTION

[0055] Specific implementation method 1: Combination Figures 1 to 10 This embodiment describes a method for detecting the quality of a badminton head using a Transformer deep learning model. The method is implemented by the following steps:

[0056] Step 1: Based on U 2 Net neural network for image preprocessing;

[0057] Step 2: Build a quality detection model for the cork discs in badminton heads and perform feature analysis on the samples;

[0058] Step 3: Construct a badminton head roundness detection model and perform feature analysis on the sample;

[0059] Step 4: Build a badminton ball leather defect detection model and perform feature analysis on the sample;

[0060] Step 5: Determine the quality of the badminton head based on the analysis results obtained by constructing the detection model in step 2, the analysis results obtained by constructing the detection model in step 3, and the analysis results obtained by constructing the detection model in step 4.

[0061] In this embodiment, in step 1, based on U 2 Net neural network is used for image preprocessing, which mainly includes foreground extraction after image acquisition. The method used is the deep learning model U 2 Net. The model architecture is as follows:

[0062] The network uses a residual Ublock (RSU) to capture multi-scale features within the stage. RSU mainly consists of three parts: input convolution layer, which converts the input feature map x(H×W×Cin) into a channel C outThe intermediate map F1(x) is a standard convolutional layer for local feature extraction. It has a U-net-like symmetric encoder-decoder structure of height L. This structure takes intermediate feature maps as input and learns to extract and encode multi-scale contextual information. Multi-scale features are extracted from progressively downsampled feature maps and encoded into high-resolution feature maps through progressive upsampling, concatenation, and convolution. This process mitigates the loss of detail caused by direct large-scale upsampling, and uses residual connections to fuse local and multi-scale features.

[0063] U 2 Net mainly consists of three parts: a six-level encoder, a five-level decoder, and a saliency map fusion module connected to the decoder and encoder levels. 2 Net design allows for a deep architecture with rich multi-scale features and relatively low computational and memory costs. In addition, due to the 2 Net architecture is simply built on RSU blocks without using any pre-trained backbone from image classification, so it is very flexible and easy to adapt to different working environments with little performance loss;

[0064] For image processing, the image binarization method is used. The image histogram data is used to find the optimal threshold for image binarization based on a pure geometric method. According to the characteristics of the extracted image, the maximum peak of the histogram is close to the brightest side. Then the maximum straight line distance is obtained through the triangle. The histogram grayscale level corresponding to the maximum straight line distance is the segmentation threshold. A straight line is constructed from the highest peak A to the darkest corresponding histogram pixel position B on the histogram. Starting from B to A, the vertical distance from each corresponding histogram to the straight line is calculated. The histogram position corresponding to the maximum distance is the threshold T corresponding to the image binarization.

[0065] The algorithm steps include: converting the image to grayscale; calculating the image grayscale histogram; finding the boundaries on both sides of the histogram; finding the maximum value of the histogram; calculating the threshold to obtain the threshold T; binarizing all pixels according to the threshold and saving them.

[0066] The defect detection software system relied upon by this application includes: 1 defect detection system, 2 main control host computer software and 3 two-way communication system;

[0067] The defect detection system consists of three modules: cork disc detection, ball head roundness detection, and ball head leather defect detection. Each detection module first initializes a visual acquisition camera device, captures an image of the ball head or cork disc under the coordination of the communication system, invokes a deep learning model for recognition, and then sends the results to the communication system for mechanical control. Details of the deep learning model for each module are provided in the algorithm research section of this application.

[0068] The functions implemented by the main control computer software include mechanical system motion control and coordination of equipment motion and detection process, equipment status management, simultaneous acquisition of multi-camera data, visualization of detection process and results, camera parameter acquisition and adjustment, and defect sample image storage.

[0069] In the collaborative module of mechanical system motion control and equipment movement and detection process, the corresponding command signal is sent to the control unit through the data acquisition card to coordinate the detection equipment to complete different actions. In order to ensure the detection speed and achieve a high degree of parallelism between the software execution process and the detection equipment movement process, the basic process is: when the camera is in normal status and is in the open state, the device enable signal is sent, and the detection software is in the standby state; when the detection equipment completes loading, it issues a photo-ready instruction. If the software detects the instruction, it resets the signal and triggers the camera to complete the photo, and sends a photo-taking completion instruction to the detection equipment; after receiving the signal, the detection equipment executes the unloading action. During the unloading process, the software executes the camera memory image capture and defect detection tasks in parallel. After the defect detection is completed, the detection result is sent to the control unit, and then the detection completion instruction is output to the control unit; the robotic arm completes the sorting action according to the detection result, places the good and defective products in different unloading ports respectively, and executes the next round of loading action.

[0070] In the equipment status management module, the health status of the industrial camera is monitored and the camera status is visualized. If the status is normal, the camera is turned on normally. Otherwise, the detection process is stopped and an alarm is issued. After the detection system is completed, the camera equipment is automatically turned off.

[0071] In the multi-camera simultaneous data acquisition module, the cork disc defect detection and ball head leather defect detection systems require simultaneous image acquisition from two cameras, while the ball head roundness detection system requires simultaneous image acquisition from three cameras. A separate thread is established for each camera's image acquisition process, triggered in parallel, and memory locks are used to ensure that the image data acquisition process is not interfered with by other processes. Due to the limited bandwidth of the industrial computer bus and the requirement for the camera to simultaneously capture megapixel images from multiple cameras during the inspection process, frame dropouts are prone to occur, rendering the captured images unusable. Furthermore, the real-time inspection system requires a high image acquisition speed. To address this issue, a method of delayed image capture after triggering is used to achieve time-sharing transmission of multi-camera image data.

[0072] The inspection process and results visualization module primarily includes visualization of images captured during the inspection process and inspection results. After image acquisition is complete, the images are automatically and dynamically displayed in real time within the software interface. Inspection results, including single-angle image inspection results and overall inspection results, are dynamically displayed in separate edit boxes, making it easy for operators to review inspection results. Furthermore, inspection time and system status information are displayed in separate edit boxes, allowing operators to monitor system performance.

[0073] In the camera parameter acquisition and adjustment module, the camera's exposure, gain, frame rate and other status settings are obtained. At the same time, the operator can enter different camera parameters through the edit box to set the camera to meet the requirements of the image acquisition and detection model.

[0074] In the sample image storage module, the image data generated during the detection process is stored in real time on disk using bmp, jpg and other file formats, and stored according to the detection results and time for backup. In order to ensure the efficiency of the detection, on the one hand, the detection algorithm model is simplified and the input image resolution is reduced while ensuring the detection accuracy and recall rate. On the other hand, a multi-threaded mode is used to develop the software. A separate thread is established for each camera's image acquisition and detection process, and concurrency between multiple threads is achieved. Global result variables and control variables are used to judge the overall detection results in the thread; the number of threads is kept as small as possible, and only multi-camera association threads and the main interface display thread are retained; invalid memory image capture and other operations are avoided in the thread; lightweight image display and interface display functions are used;

[0075] PLC communication, control, and signal synchronization are implemented between the main control software, defect detection system, and mechanical equipment motion control system. First, the software and hardware systems complete their initialization phases, completing the initialization synchronization protocol within the bidirectional communication system. The main program then initializes camera parameters, loads models, and loads the interface. The bidirectional communication system then begins the main photo detection cycle, maintaining synchronization between the software and hardware. Furthermore, the bidirectional communication system monitors the status of the software and hardware and handles any anomalies.

[0076] Specific implementation method 2: Combination Figures 1 to 10 This embodiment is described. The difference between this embodiment and the first embodiment is that the construction of the quality detection model of the cork disc in the badminton head and the characteristic analysis of the sample in step 2 are achieved by the following steps:

[0077] Step 21: Build feature representation and classification models based on the Transformer deep learning model ViT;

[0078] Step 22: Based on the Transformer deep learning model results and the cork disc quality judgment logic, four quality grades are determined;

[0079] Step 23: Based on the four quality grades of the cork discs in step 22, a training set is created to perform offline training on the classification model constructed in step 21, thereby obtaining the model parameters of the deep learning model ViT;

[0080] Step 24: Create a test set to conduct online testing on the algorithm model trained in Step 2 and 3 to verify its performance indicators. Other components and connection methods are the same as those in the first embodiment.

[0081] In this embodiment, a Transformer-based deep learning model ViT is used to construct a feature representation and classification model. The Transformer model is different from traditional convolutional neural networks and recurrent neural networks. The entire network is composed entirely of a self-attention mechanism. Due to its excellent performance, friendliness to downstream tasks, and good adaptability, it is widely used in various fields. ViT is a typical model of Transformer used in the image field. ViT directly divides the image into fixed-size blocks, and then obtains block embeddings through linear transformation, which is similar to word and word vector embeddings in NLP, and uses them to calculate the input of self-attention. Since the input of the Transformer is a series of word / word vector combinations, the blocks of the image are embedded into the input and the corresponding classification features are extracted. The principle of the ViT model is as follows Figure 2 As shown in Figure 2, the ViT model only uses the encoder part of the Transformer to extract and parse the required image features.

[0082] Because the self-attention mechanism cannot record spatial position relationships, in addition to the block embedding of the input, the ViT model also needs a position embedding that represents the relative position information encoding. Unlike CNN, position encoding is required to correspond to the block or word position information of each block input, that is, disrupting the order of the block embeddings in the sequence will not change the result. If this information is missing and the model is required to learn, the learning cost will increase. ViT cleverly solves the problem of long-distance feature correlation in CNN through position encoding. Regardless of the distance between pixels, the calculation process of the correlation degree is relatively fixed, so it has the ability to learn global features. The self-attention can produce a more interpretable model;

[0083] Based on the results of the deep learning model and the judgment logic of the cork disc quality, four quality grades are determined: 1) Side A is good, Side B is good; 2) Side A is good, Side B is bad; 3) Side A is bad, Side B is good; 4) Side A is bad, Side B is bad. The judgment logic is as follows:

[0084] IflabelA==good&&labelB==good

[0085] Label=good

[0086] Else IflabelA==good&&labelB==bad

[0087] Label=goodA

[0088] Else IflabelA==bad&&labelB==good

[0089] Label=goodB

[0090] Else IflabelA==bad&&labelB==bad

[0091] Label=bad

[0092] This embodiment uses images captured on a prototype system and manually annotated to construct a training set. Offline training is then used to determine the parameters of the deep learning model. Images of cork discs are captured to construct a negative sample set. Images of good products are also captured to construct a positive sample set. Negative samples are also enhanced to mitigate the often insufficient number of defective products, striving to achieve a balance between positive and negative samples. The sample expansion strategy employed in this application is to use 50% of all sampled image fragments as training data without any transformation, and to perform random transformations on them with a 50% probability. Within this 50% of sampled data, 80% of the sampled data is subjected to random noise addition, 70% of the sampled data is subjected to random grayscale transformation, 70% of the sampled data is converted to HSI color space and perturbed, 40% of the sampled data is subjected to random rotation, and 40% of the sampled data is subjected to mirroring.

[0093] Specific implementation method three: Combination Figures 1 to 10 This embodiment is described. The difference between this embodiment and the second embodiment is that the badminton head roundness detection model is constructed and the characteristic analysis of the sample is performed in step three by the following steps:

[0094] Step 31: Detect the roundness of the target ball head at a single angle. The number of times for detecting the roundness of each ball head at a single angle is two, which are recorded as shooting angle A and shooting angle B respectively.

[0095] Step 32: Perform quality grading on the two single-angle roundness test results obtained in step 31. Intersect the determination results of all angle images. If all are 1, it is judged as a good product, otherwise it is a defective product.

[0096] Step 33: Use single image roundness detection and multi-angle image comprehensive detection to determine the accuracy of the ball head roundness detection model. Other components and connection methods are the same as those in the second embodiment.

[0097] In this embodiment, the goal of the ball head roundness detection is to determine whether the outer contour meets the standard based on the ball head appearance image. The idea of ​​the detection method adopted in this project is to use multiple industrial cameras to simultaneously shoot multi-angle images of the ball head (which can be dynamically adjusted according to the actual detection accuracy requirements. Three angles are used during the implementation of this project, and up to 6 angles are supported). After image processing, the outer contour of the ball head is obtained, and the edge feature representation methods such as Fourier descriptors are used to evaluate the difference between the outer contour of the ball head and the standard ball head. When the difference is less than a certain threshold, the angle is considered to meet the roundness standard; when the image detection results taken at all angles are qualified, the outer contour roundness is judged to be qualified, otherwise it is unqualified.

[0098] Specific implementation method four: Combination Figures 1 to 10 This embodiment differs from the third embodiment in that, in step 31, the single-angle roundness detection of the target ball head is performed by extracting the edge of the single-angle captured image and then calculating the error between the edge and the standard ball head edge using the Fourier descriptor. The specific steps are as follows:

[0099] Step a: Extract the closed boundary contour points (x i ,y i ), i=0,1,2,···,K-1, K is the number of extracted contour points, and the coordinates of the center point of the ball head are calculated as:

[0100]

[0101] Step b: Perform a centering operation on the ball head, that is, subtract the coordinates of the ball head's center point from each contour coordinate to facilitate analysis. Since different shooting angles result in different curvatures on the bottom edge of the ball head, which will affect the quality identification of the ball head to a certain extent, it is necessary to cut it off, retaining only the upper half of the ball head. If N% of the ball head length L is retained, the cut position is (N%-50%)×L below the ball head center point, and the part above it is retained as the identified ball head contour point, and it is represented as a discrete coordinate sequence c(k)={(x(k),y(k)),k=0,1,2,···,K′-1} with a total length of K′;

[0102] Step c: Starting from any point (x0, y0), when moving counterclockwise on the boundary, the boundary contour points of the ball head can be represented by complex numbers. The contour features are transformed from the spatial domain to the frequency domain, and the frequency domain information is extracted as the feature vector of the contour shape. In this way, the two-dimensional problem is simplified to one-dimensional, that is:

[0103] c(k)=x(k)+jy(k) (2)

[0104] The discrete Fourier transform of c(k) is:

[0105]

[0106] Step d: The Fourier descriptor is directly related to the starting point position, shape size, and direction of the boundary contour curve. Assuming that a(0) represents the 0th order coefficient and is 1, the amplitude value of the Fourier coefficient is independent of the starting point, rotation, and translation of the curve. The Fourier descriptor is normalized, that is:

[0107]

[0108] Step e: Calculate the Fourier descriptor f of the captured spherical head n With the standard spherical head Fourier descriptor f n s The calculation method of similarity distance is:

[0109]

[0110] Select the shooting angle of the ball head as A or B. If the distance d between the ball head photographed at any angle A or B and the standard ball head is similar FD >T, the ball head is considered defective. If the distance d between the ball head photographed at angles A and B and the standard ball head is similar FD ≤T, the ball head is considered to be good. T is the set detection threshold. When n≥100, the energy value is close to 0. Therefore, K m =100, and when calculating the Fourier descriptor of the ball head contour shape, the part where n≤100 is selected. Other components and connection methods are the same as those in the third embodiment.

[0111] In this embodiment, the size of the normalized Fourier descriptor is independent of the scale. In this case, the Fourier descriptor has translation invariance, rotation invariance, and scale transformation invariance, and its value is independent of the starting point of the closed curve. One characteristic of the Fourier coefficient is that the energy is concentrated in the low frequency and the high frequency is mixed with noise. Therefore, only a few parameter values ​​K are used to calculate the value of the Fourier descriptor. m , it is possible to fully describe the closed curve shape and complete the contour shape feature recognition of the ball head.

[0112] Specific implementation method five: Combination Figures 1 to 10 This embodiment is described. The difference between this embodiment and the fourth embodiment is that the specific steps of constructing a badminton ball leather defect detection model and performing feature analysis on the sample in step four are as follows:

[0113] Step 41: Shoot and collect images from two opposite angles;

[0114] Step 42: Build a model framework and input the image obtained in step 41 into the built model to perform defect detection on a single image;

[0115] Step 43: Collect ball head leather images on the prototype system and manually annotate them to obtain labels to construct a training set. Use the constructed training set to perform offline model training on the model framework constructed in step 42, thereby obtaining model parameters of the deep learning model.

[0116] Step 44: Create a test set to conduct online testing on the algorithm model trained in step 43 to verify its performance indicators. Other components and connection methods are the same as those in the fourth embodiment.

[0117] In this implementation, leather defect detection uses two-angle image capture and acquisition. These images are then fed into a trained deep learning model for single-image defect detection and a comprehensive assessment based on the results of both images, resulting in a binary classification model for good and bad ball-head leather. The single-image machine learning model utilizes a Transformer-based enhanced fine-grained classification detection model.

[0118] The ball head leather images are collected on the prototype system, and the labels are obtained by manual annotation to construct a training set, and the parameters of the deep learning model are obtained by offline training. The two images of good products are both labeled as 0, and the two images of defective products are labeled according to the actual situation, that is, if there is a debonding defect in the single-angle image, it is labeled as 1, otherwise it is labeled as 0. If the two images of the defective product are marked as 0, the sample is removed. All samples marked as 0 are constructed as a negative sample set of a single-frame image, and all samples marked as 1 are constructed as a positive sample set of a single-frame image. At the same time, a ball head leather sample set is constructed, that is, the two opposite images of the ball head are both marked as 0 as a negative sample set, and the two object images of the ball head with at least one marked as 1 are marked as a positive sample set. The single image sample set is used to divide the training set and the test set to train the deep learning model and obtain the optimized parameters;

[0119] The trained model is used to judge the two surfaces of the same ball head separately. If both are good, it is judged as a good product, otherwise it is a defective product.

[0120] Specific implementation method six: combination Figures 1 to 10 This embodiment differs from the fifth embodiment in that the model framework is constructed in step 42, and the image obtained in step 41 is input into the constructed model to perform defect detection on a single image. The specific steps are as follows:

[0121] Step A: Image serialization: First, the input image is preprocessed. The image is divided into small blocks and projected into the embedding space to make it a set of flattened patches.

[0122] Step B: Embedding: Obtain a potential d-dimensional embedding space vector by trainable linear mapping and position embedding;

[0123] Step C: Transformer encoding: The feature representation of the image is obtained by the Transformer encoder, which contains L layers of multi-head self-attention (MSA) and multi-layer perceptron (MLP) blocks;

[0124] Step D: Part Selection Module: Apply a Part Selection Module (PSM) to select tokens corresponding to discriminative image patches and use only these selected tokens as input. Other components and connections are the same as those in Implementation 5.

[0125] In this implementation, the model uses contrastive loss as the objective function. The goal of contrastive loss is to minimize the similarity between classification tokens corresponding to different categories and maximize the similarity between classification tokens corresponding to the same category. To reduce the impact of simple negative samples on the loss, α is used to control the number of negative sample pairs that contribute to the loss.

[0126] The present invention has been disclosed as above with reference to preferred embodiments, but this is not intended to limit the present invention. Any technician familiar with the present invention can make slight changes or modifications to equivalent embodiments using the above-disclosed structures and technical contents without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A method for detecting the quality of badminton heads using a Transformer deep learning model, characterized by: The method is achieved by the following steps: Step 1: Based on U 2 Net neural network for image preprocessing; Step 2: Build a quality detection model for the cork discs in badminton heads and perform feature analysis on the samples; Step 21: Build feature representation and classification models based on the Transformer deep learning model ViT; Step 22: Based on the Transformer deep learning model results and the cork disc quality judgment logic, four quality grades are determined; Step 23: Based on the four quality grades of the cork discs in step 22, a training set is created to perform offline training on the classification model constructed in step 21, thereby obtaining the model parameters of the deep learning model ViT; Step 24: Create a test set to conduct online testing on the algorithm model trained in Steps 2 and 3 to verify its performance indicators; Step 3: Construct a badminton head roundness detection model and perform feature analysis on the sample; Step 31: Detect the roundness of the target ball head at a single angle. The number of times for detecting the roundness of each ball head at a single angle is two, which are recorded as shooting angle A and shooting angle B respectively. Step 32: Perform quality grading on the two single-angle roundness test results obtained in step 31. Intersect the determination results of all angle images. If all the results are 1, it is judged as a good product, otherwise it is a defective product. Step 33: Use single image roundness detection and multi-angle image comprehensive detection to determine the accuracy of the ball head roundness detection model; Step 4: Build a badminton ball leather defect detection model and perform feature analysis on the sample; Step 41: Shoot and collect images from two opposite angles; Step 42: Build a model framework and input the image obtained in step 41 into the built model to perform defect detection on a single image; Step 43: Collect ball head leather images on the prototype system and manually annotate them to obtain labels to construct a training set. Use the constructed training set to perform offline model training on the model framework constructed in step 42, thereby obtaining model parameters of the deep learning model. Step 44: Create a test set to conduct online testing on the algorithm model trained in step 43 to verify its performance indicators; Step 5: Determine the quality of the badminton head based on the analysis results obtained by constructing the detection model in step 2, the analysis results obtained by constructing the detection model in step 3, and the analysis results obtained by constructing the detection model in step 4.

2. The method for detecting the quality of badminton heads using a Transformer deep learning model according to claim 1, characterized in that: In step 31, the single-angle roundness test of the target ball head is to extract the edge of the single-angle captured image and then use Fourier descriptors to calculate the error between the edge and the standard ball head edge. The specific steps are as follows: Step a: Extract the closed boundary contour points (x i ,y i ), i=0,1,2,···,K-1, K is the number of extracted contour points, and the coordinates of the center point of the ball head are calculated as: Step b: Perform a centering operation on the ball head, that is, subtract the center point coordinates of the ball head from each contour coordinate. This is easy to analyze. Due to different shooting angles, the bottom edge of the ball head has different curvatures, which will affect the quality identification of the ball head to a certain extent. Therefore, it is necessary to cut it off and only retain the upper half of the ball head. If N% of the ball head length L is retained, the cut position is (N%-50%)×L below the center point of the ball head. The part above it is retained as the identified ball head contour point and expressed as a discrete coordinate sequence c(k)={(x(k),y(k)),k=0,1,2,···,K′-1} with a total length of K′; Step c: Starting from any point (x0, y0), when moving counterclockwise on the boundary, the boundary contour points of the ball head can be represented by complex numbers. The contour features are transformed from the spatial domain to the frequency domain, and the frequency domain information is extracted as the feature vector of the contour shape. In this way, the two-dimensional problem is simplified to one-dimensional, that is: c(k)=x(k)+jy(k) (2) The discrete Fourier transform of c(k) is: Step d: The Fourier descriptor is directly related to the starting point position, shape size, and direction of the boundary contour curve. Assuming that a(0) represents the 0th order coefficient and is 1, the amplitude value of the Fourier coefficient is independent of the starting point, rotation, and translation of the curve. The Fourier descriptor is normalized, that is: Step e: Calculate the Fourier descriptor f of the captured spherical head n With the standard spherical head Fourier descriptor f n s The calculation method of similarity distance is: Select the shooting angle of the ball head as A or B. If the distance d between the ball head photographed at any angle A or B and the standard ball head is similar FD >T, the ball head is considered defective. If the distance d between the ball head photographed at angles A and B and the standard ball head is similar FD ≤T, the ball head is considered to be good. T is the set detection threshold. When n≥100, the energy value is close to 0. Therefore, K m =100, and select the part of n≤100 when calculating the Fourier descriptor of the ball head contour shape.

3. The method for detecting badminton head quality using a Transformer deep learning model according to claim 2, characterized in that: The specific steps of constructing the model framework in step 42 and inputting the image obtained in step 41 into the constructed model to perform defect detection on a single image are as follows: Step A: Image serialization: First, the input image is preprocessed. The image is divided into small blocks and projected into the embedding space to make it a set of flattened patches. Step B: Embedding: Obtain a potential d-dimensional embedding space vector by trainable linear mapping and position embedding; Step C: Transformer encoding: The feature representation of the image is obtained by the Transformer encoder, which contains L layers of multi-head self-attention (MSA) and multi-layer perceptron (MLP) blocks; Step D: Part Selection Module: Apply a Part Selection Module (PSM) to select tokens corresponding to discriminative image patches and use only these selected tokens as input.