Vision Detection System for Rare Earth Permanent Magnet Products Based on 5G Network Cloud Computing

Through the rare earth permanent magnet product visual inspection system based on 5G network cloud computing, the data quality and resource allocation problems are solved using linear adaptive filters and model optimization technology, and the accuracy and production efficiency of the detection system are improved.

CN119375231BActive Publication Date: 2025-07-15GANZHOU FORTUNE ELECTRONICS
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411475558.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-07-15
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

The existing vision detection system of rare earth permanent magnet products does not consider using linear adaptive filters to calibrate 5G network information data, resulting in inaccurate data quality, low model training efficiency, uneven resource allocation, lack of data visualization support, and difficulty in making scientific decisions.

Method used

The rare earth permanent magnet product visual detection system based on 5G network cloud computing is adopted, and the 5G network information data is calibrated through a linear adaptive filter, combined with GBDT and MLP models for data processing and prediction, and used Pareto graph for data visualization to optimize the production process.

Benefits of technology

It improves data quality and model training efficiency, realizes scientific resource allocation, reduces network maintenance costs, and enhances the decision-making ability and team collaboration efficiency of the production department.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119375231B_ABST
    Figure CN119375231B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of machine vision. The present invention discloses a vision detection system for rare earth permanent magnet products based on 5G network cloud computing, including a data acquisition module for collecting product defect image data, 5G network information data, and transmission environment data; a data processing module for calibrating the 5G network information data according to the transmission environment data to obtain calibrated 5G network information data; preprocessing the product defect image data, calibrated 5G network information data, and transmission environment data to obtain a defect image feature data set, a calibrated 5G network information feature data set, and a transmission environment feature data set; performing weighted fusion on the defect image feature data set, calibrated 5G network information feature data set, and transmission environment feature data set to obtain a comprehensive feature data set; constructing a product defect evaluation model, inputting the comprehensive feature data set into the product quality prediction model, and predicting to obtain a product defect grade coefficient, realizing the intelligent management of the production process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision, and more specifically, to a visual inspection system for rare earth permanent magnet products based on 5G network cloud computing. Background Art

[0002] As an important strategic new material, the production, manufacturing, and quality inspection of rare earth permanent magnet materials have received much attention; as a new generation of key basic materials, the quality stability of rare earth permanent magnet products is crucial for the performance and reliability of downstream application fields.

[0003] The patent with the publication number CN116046738A discloses a rare earth distribution machine vision inspection system and method based on a variable background light source, including a variable light source, a standard sample cell and a sample cell to be measured, an image acquisition device, a calculation and logic control device, and a signal output device. The calculation and logic control device communicates with the image acquisition device and the signal output device. The light emitted by the variable light source irradiates the standard sample and the sample to be measured to generate absorption light signals and fluorescence signals, which are captured by the image acquisition device. After fitting calculation, the signal output device outputs the inspection results of the rare earth solution distribution. By using the method disclosed in the present invention, through the setting of a variable background light source, on-line distribution inspection can be realized for elements that have no obvious absorption even in the visible light band, improving the practicability and universality of the product. The inspection process does not require manual intervention, is suitable for on-line high-frequency continuous sampling, the equipment is simple and reliable, has low requirements for hardware, and is suitable for application in complex and harsh industrial production environments.

[0004] The following main problems exist in the existing visual inspection systems for rare earth permanent magnet products:

[0005] The use of a linear adaptive filter to automatically calibrate and optimize 5G network information data is not considered; the uncalibrated 5G network information data may contain significant deviations and noises caused by the transmission environment; these deviations and noises will significantly reduce the data quality, making the analysis results inaccurate, and thus affecting the network performance evaluation and optimization effects; it is difficult or even ineffective to perform network optimization based on inaccurate or low-quality data. Incorrect optimization strategies may not only fail to improve network performance but may exacerbate the problem, wasting resources and increasing maintenance costs;

[0006] Without controlling the penalty coefficients for the number of leaf nodes and leaf node scores in the tree model, the model may generate a very complex tree structure with a large number of leaf nodes and complex branches. Such a model not only has a high computational cost but is also difficult to interpret and understand, reducing the credibility and acceptability of the model; when the learning rate is not adjusted, the model may be trained using the default learning rate; however, different datasets and models may require different learning rates to achieve the best training effect; improper setting of the learning rate may lead to problems such as slow training process, difficult convergence, or unstable oscillation, thus significantly reducing the training efficiency of the model and increasing the training time and computational cost;

[0007] Lacking the data visualization support provided by the Pareto chart, the production department may only rely on scattered and unorganized data when making decisions; this leads to a lack of systematicness and scientificity in the decision-making process, making it difficult to accurately judge which defect types have the greatest impact on production costs, and thus unable to make the optimal resource allocation decision; resulting in uneven resource allocation, where some key defects are not processed in a timely manner while some minor defects occupy too many resources, causing resource waste.

[0008] In view of this, the present invention proposes a visual inspection system for rare earth permanent magnet products based on 5G network cloud computing to solve the above problems. Summary of the Invention

[0009] To overcome the above-mentioned defects of the prior art and to achieve the above object, the present invention provides the following technical solutions: A visual inspection system for rare earth permanent magnet products based on 5G network cloud computing, comprising:

[0010] A data acquisition module for collecting product defect image data, 5G network information data, and transmission environment data;

[0011] A data processing module for calibrating the 5G network information data according to the transmission environment data to obtain calibrated 5G network information data; preprocessing the product defect image data, calibrated 5G network information data, and transmission environment data to obtain a defect image feature dataset, a calibrated 5G network information feature dataset, and a transmission environment feature dataset;

[0012] Performing weighted fusion on the defect image feature dataset, the calibrated 5G network information feature dataset, and the transmission environment feature dataset to obtain a comprehensive feature dataset;

[0013] A product quality prediction module for constructing a product defect evaluation model and inputting the comprehensive feature dataset into the product quality prediction model to predict the product defect grade coefficient;

[0014] A product quality evaluation module for comparing the predicted product defect grade coefficient with a preset product defect grade coefficient threshold to determine whether the quality of the rare earth permanent magnet product is qualified;

[0015] A defect type judgment module, which is used to collect data of unqualified rare earth permanent magnet products, construct a defect type diagnosis model, input the data of unqualified rare earth permanent magnet products into the defect type diagnosis model, and predict the product defect type data;

[0016] A feedback control module, which is used to feedback the product defect type data to the production department by sending a warning instruction through a vision detection terminal, and the production department optimizes the production process in a timely manner according to the feedback product defect type data; Each module is connected in a wired and / or wireless manner.

[0017] Further, the product defect image data includes defect image parameter data, defect position and defect area; The defect image parameter data includes the resolution and color depth of the image; The 5G network information data includes the network bandwidth, latency, packet loss rate, data transmission rate, 5G signal strength and error rate in data transmission; The transmission environment data includes the temperature of the transmission environment, electromagnetic interference level, current and voltage of network equipment.

[0018] Further, the method for calibrating the 5G network information data according to the transmission environment data includes;

[0019] Calibrate the 5G network information data according to the transmission environment data through a linear adaptive filter. Define a linear adaptive filter, and its output is: where, y[k] is the output of the linear adaptive filter; x q [k] is the input of the linear adaptive filter, that is, the 5G network information data; ψ q [k] is the weight coefficient of the linear adaptive filter; M is the order of the linear adaptive filter; k is the iteration time of the linear adaptive filter; q is the number of iterations of the linear adaptive filter;

[0020] Adjust the weight coefficient of the linear adaptive filter through the least mean square error algorithm. The update of the weight coefficient at each iteration time is: ψ q [k + 1] = ψ q [k] + 2μe[k]x q [k]; where, ψ q [k + 1] is the weight coefficient updated at the k + 1 iteration time; e[k] is the error between the expected output and the actual output of the linear adaptive filter; μ is the rate of weight coefficient adjustment;

[0021] The error e[k] between the expected output and the actual output of the linear adaptive filter is: e[k] = d[k] - y[k]; where, d[k] is the expected output after calibrating the 5G network information data according to the transmission environment data; y[k] is the output of the linear adaptive filter;

[0022] Continuously adjust the rate of adjusting the weight coefficients of the adaptive filter through the model according to the error between the expected output and the actual output of the linear adaptive filter until the output is stable; the weight coefficient adjustment model is: where, μ0 is the initial rate of weight coefficient adjustment; q is the number of iterations of the linear adaptive filter; Q is the total number of iterations of the linear adaptive filter;

[0023] The preset error threshold between the expected output and the actual output of the linear adaptive filter is e[k] * , when the error between the expected output and the actual output of the linear adaptive filter is less than the error threshold e[k] * stop the adjustment, and at this time, the optimal rate of weight coefficient adjustment is obtained; use the linear adaptive filter to learn the influence of the transmission environment data on the 5G network information data, and obtain the calibrated 5G network information data through the output of the linear adaptive filter.

[0024] Furthermore, the method for preprocessing the product defect image data, the calibrated 5G network information data, and the transmission environment data to obtain the defect image feature dataset, the calibrated 5G network information feature dataset, and the transmission environment feature dataset includes:

[0025] Preprocessing of the product defect image data:

[0026] Convert the product defect image from a color image to a gray image, and the converted gray image is:

[0027] I g (x′, y′) = 0.299·R(x′, y′) + 0.587·G(x′, y′) + 0.114·B(x′, y′); where, I g (x′, y′) is the pixel value of the gray image at (x′, y′); (x′, y′) is the horizontal and vertical coordinates of each pixel; R(x′, y′) is the pixel value of the red channel of the product defect image; G(x′, y′) is the pixel value of the green channel of the product defect image; B(x′, y′) is the pixel value of the blue channel of the product defect image;

[0028] Use a Gaussian filter to denoise the gray image:

[0029] where, I gd (x′, y′) is the pixel value of the image after denoising by the Gaussian filter at the position (x′, y′); ω′(a′, b′) is the weight of the Gaussian kernel at the position (a′, b′); I g(x′ + a′, y′ + b′) is the pixel value of the original grayscale image at the position (x′ + a′, y′ + b′); (a′, b′) is the offset of the current position (x′, y′); k′ is the size of the Gaussian kernel;

[0030] The histogram equalization method is used to enhance the image contrast, the Canny edge detection is used to extract the edge information in the image, the preset image segmentation threshold is U, and the image is binarized based on the image segmentation threshold U: I ge (x′, y′) is the pixel value of the binarized image at the position (x′, y′); 255 is the product defect area; 0 is the background area;

[0031] The LOF algorithm is used to detect and eliminate the abnormal data in the product defect image data, calibrated 5G network information data, and transmission environment data, and the processed defect image feature dataset, calibrated 5G network information feature dataset, and transmission environment feature dataset are obtained;

[0032] The defect image feature dataset, calibrated 5G network information feature dataset, and transmission environment feature dataset are normalized and converted to a standard normal distribution to obtain the normalized defect image feature dataset, calibrated 5G network information feature dataset, and transmission environment feature dataset.

[0033] Furthermore, the method for weighted fusion of the defect image feature dataset, calibrated 5G network information feature dataset, and transmission environment feature dataset to obtain a comprehensive feature dataset includes:

[0034] The defect image feature dataset, calibrated 5G network information feature dataset, and transmission environment feature dataset are fused through a weighted model to form a comprehensive feature dataset; the defect image feature dataset is denoted as W1, the calibrated 5G network information feature dataset is denoted as W2, and the transmission environment feature dataset is denoted as W3;

[0035] The weighted model is: YQL = W1·β1 + W2·β2 + W3·β3; where, YQL is the comprehensive feature dataset; β1 is the weight coefficient of the defect image feature dataset; β2 is the weight coefficient of the calibrated 5G network information feature dataset; β3 is the weight coefficient of the transmission environment feature dataset.

[0036] Furthermore, the training method of the product defect evaluation model includes:

[0037] The historical comprehensive feature dataset and the corresponding output label product defect grade coefficient are used as the sample set; the sample set is used as the dataset, and the dataset is divided into a training set, a validation set, and a test set; GBDT is selected as the specific implementation of the gradient boosting machine model to handle the regression task;

[0038] Initialize the GBDT parameters and define the objective function; the GBDT parameters include the maximum number of leaf nodes in each tree, the learning rate, the number of trees, and the maximum depth of the trees; use the historical comprehensive feature dataset as the input data and the corresponding product defect level coefficient as the output label to train the product defect evaluation model; the product defect evaluation model is a gradient boosting machine model.

[0039] Use the mean squared error as the loss function to measure the difference between the predicted value and the actual value of the model; the mean squared error loss function is: where n is the number of samples in the dataset; Y b is the actual value of the b-th sample in the dataset; is the predicted value of the b-th sample in the dataset; b is the index of the sample.

[0040] In each iteration, GBDT constructs a new decision tree to fit the negative gradient of the loss function in the previous step, uses the negative gradient of the objective function as the learning target of the new tree, and adjusts the contribution of the new tree to the final result through the learning rate to minimize the loss function; use the validation set to evaluate the performance of the model, tune the model, and adjust the model parameters according to its performance feedback until the model performance no longer improves significantly or reaches the preset stopping condition.

[0041] Furthermore, the method for tuning the model includes:

[0042] Add a regularization term to the objective function of GBDT. The objective function of GBDT is: where n is the number of samples in the dataset; Y b is the actual value of the b-th sample in the dataset; is the predicted value of the b-th sample by the model at the t-th iteration; is the mean squared error loss function of the model; Ω(f t ) is the regularization term in the objective function, which is used to penalize the complexity of the model;

[0043] The regularization term Ω(f t ) is: where γ is the coefficient controlling the penalty of the number of leaf nodes; T′ is the number of leaf nodes in the tree f t ; λ is the coefficient controlling the penalty of the square of the leaf node score; ω j is the score of the j-th leaf node in the tree f t ;

[0044] Combine the loss function and the regularization term to obtain the complete objective function: where, is the cumulative predicted value at the (t - 1)-th iteration; ft (X b ) is the predicted value of the newly added tree at the t-th iteration;

[0045] In each iteration, a new decision tree f t (X) is constructed to fit the negative gradient of the loss function in the previous step: where g b is the first-order derivative of the loss function with respect to the predicted value, i.e., the gradient; where h b is the second-order derivative of the loss function with respect to the predicted value, i.e., the Hessian matrix;

[0046] Then, by optimizing the predicted value f t (X b ) of the newly added tree at the t-th iteration of the objective function, the best tree structure is found:

[0047] where Obj t is a quadratic function of f t (X);

[0048] The contribution of the new tree to the final result is adjusted by the learning rate η: where η is the learning rate, which controls the contribution of each tree to the prediction of the final model; is the predicted value of the b-th sample after the t-th iteration; f t (X b ) is the predicted value of the newly added tree at the t-th iteration;

[0049] The learning rate is dynamically adjusted by the learning rate limiting model, and the optimal learning rate is found by the optimal adjustment model;

[0050] The learning rate limiting model is: where η′ is the dynamically adjusted learning rate; η max is the maximum value of the learning rate; η min is the minimum value of the learning rate; t uo is the current iteration number; t max is the cycle length;

[0051] The preset learning rate threshold is that when the dynamically adjusted learning rate is less than the preset learning rate threshold, the iteration stops;

[0052] The optimal adjustment model is: where η * is the optimal learning rate; fo is the number of adjustments of the learning rate; t′ uo is the total number of iteration rounds;

[0053] The ratio range of the preset number of learning rate adjustments to the total number of iterations is [a, d]; when the ratio of the number of learning rate adjustments to the total number of iterations is within the range of [a, d], the model performance is the best, then the determined range is an optimal ratio, that is, the learning rate at this time is the optimal learning rate;

[0054] Use the test set to evaluate the performance of the model in the prediction task, and use the trained product defect evaluation model to predict the current comprehensive feature data set to obtain the product defect level coefficient.

[0055] Further, the method for comparing the predicted product defect level coefficient with the preset product defect level coefficient threshold to determine whether the quality of the rare earth permanent magnet product is qualified includes:

[0056] If the predicted product defect level coefficient is less than the preset product defect level coefficient threshold, it is determined that the quality of the rare earth permanent magnet product does not meet the standard;

[0057] If the predicted product defect level coefficient is greater than or equal to the preset product defect level coefficient threshold, it is determined that the quality of the rare earth permanent magnet product meets the standard.

[0058] Further, the training method of the defect type diagnosis model includes:

[0059] Divide the data set into a training set, a test set and a validation set, and construct a defect type diagnosis model. The defect type diagnosis model includes an input layer, a hidden layer and an output layer; the input layer is the historical unqualified rare earth permanent magnet product data, and the output layer is the product defect type data; the output layer is set with neurons equal to the number of product defect types, and each neuron corresponds to the prediction probability of a defect type; use the softmax function as the activation function; the defect type diagnosis model is a multi-layer perceptron MLP model;

[0060] Use multi-class cross-entropy as the loss function of the model to measure the difference between the predicted value and the actual value of the model; the multi-class cross-entropy loss function is: where L is the average loss of the data set; N is the total number of samples in the data set; C is the number of product defect type data; y ic is the true label of the i-th sample for the c-th type; p ic is the probability that the model predicts the i-th sample belongs to the c-th type;

[0061] Use the training set to train the defect type diagnosis model, update the model parameters through the backpropagation algorithm to minimize the loss function; use the validation set to evaluate the performance of the defect type diagnosis model by calculating the accuracy index;

[0062] Select the SGD optimization algorithm as the optimizer, tune the model according to the performance feedback of the validation set, and adjust the model parameters until the performance no longer improves significantly or reaches the preset stop condition; use the test set to evaluate the performance of the model in the prediction task, and use the trained defect type diagnosis model to predict the current comprehensive feature dataset to obtain product defect type data.

[0063] Further, the method of feeding back the product defect type data to the production department by the vision detection terminal issuing a warning instruction, and the production department optimizing the production process in a timely manner according to the fed-back product defect type data includes:

[0064] The product defect type data is collected in real time through the vision detection terminal, and the collected product defect type data is represented by a set as: {D1, D2,..., D i′ ,..., D n′}; where D i′ is the quantity of the i'-th defect type; n' is the total number of defect types;

[0065] Sort the product defect type data in descending order according to the impact on production costs, and use the PowerBI plotting tool to draw a Pareto chart; in the Pareto chart, the vertical axis is the quantity of product defect type data, and the horizontal axis is the type of product defect type data; draw a bar chart, and the height of each bar in the chart corresponds to the quantity of product defect type data; draw a cumulative curve, with the horizontal axis being the type of product defect type data and the vertical axis being the cumulative percentage of the quantity of product defect type data.

[0066] Preset a cumulative percentage threshold. When the cumulative percentage of the quantity of a certain product defect type data exceeds the preset cumulative percentage threshold, the vision detection terminal issues a warning instruction; the production department identifies product defect problems based on the warning instruction and the product defect type data in the Pareto chart, takes measures to optimize the production process, reduce or eliminate defect problems, and updates the Pareto chart according to the new product defect type data.

[0067] The technical effects and advantages of the rare earth permanent magnet product vision detection system based on 5G network cloud computing of the present invention:

[0068] The present invention automatically adjusts its weight coefficients through a linear adaptive filter to minimize the error between the desired output and the actual output; this dynamic adjustment ability enables the filter to quickly adapt to changing transmission environments, such as signal attenuation, increased interference, etc., thus ensuring that the calibrated 5G network information data is more accurate and reliable; by calibrating the 5G network information data, data biases and noises caused by the transmission environment can be eliminated or reduced, significantly improving the quality of the data; the calibrated 5G network information data can more accurately reflect the actual condition of the network, providing strong support for network optimization; through automatic calibration and optimization, the need for manual intervention is reduced, and the complexity and cost of network maintenance are lowered;

[0069] By adding a regularization term, overfitting of the model to the training data is effectively prevented, and the generalization ability of the model on unknown data is improved; by controlling the penalty coefficients of the number of leaf nodes and the leaf node scores, the model can be guided to generate a more reasonable and concise tree structure, thereby improving the interpretability and understandability of the model; by adjusting the learning rate, it can be flexibly adjusted according to the specific data set and model performance to achieve the best training effect, significantly improving the training efficiency of the model and reducing the training time; enabling the model to have stronger adaptability and robustness to different types of data sets and training environments;

[0070] Through the Pareto chart, the quantity and cumulative percentage of various types of defects are intuitively shown; enabling the production department to make decisions based on data and prioritize the types of defects that have the greatest impact on production costs, thus achieving the effective allocation of resources; timely identification and resolution of product defects can reduce the waste of raw materials, time, and manpower; contributing to reducing production costs, improving resource utilization rate, and increasing the profitability of the enterprise; through the close cooperation among the visual inspection terminal, the data analysis team, and the production department; by jointly solving product defect problems, the communication and cooperation among different departments are strengthened, promoting the overall cooperation ability and work efficiency of the team. Description of the Drawings

[0071] Figure 1 It is a schematic structural diagram of the visual inspection system for rare earth permanent magnet products based on 5G network cloud computing of the present invention;

[0072] Figure 2 It is a schematic flowchart of the visual inspection method for rare earth permanent magnet products based on 5G network cloud computing of the present invention. Detailed Embodiments

[0073] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0074] Embodiment 1

[0075] Please refer to Figure 1 As shown, this embodiment is based on the visual inspection of rare earth permanent magnet products in 5G network cloud computing, including: a data acquisition module for collecting product defect image data, 5G network information data, and transmission environment data;

[0076] A data processing module for calibrating the 5G network information data according to the transmission environment data to obtain calibrated 5G network information data; preprocessing the product defect image data, calibrated 5G network information data, and transmission environment data to obtain a defect image feature data set, a calibrated 5G network information feature data set, and a transmission environment feature data set;

[0077] Weightedly fusing the defect image feature data set, the calibrated 5G network information feature data set, and the transmission environment feature data set to obtain a comprehensive feature data set;

[0078] A product quality prediction module for constructing a product defect evaluation model and inputting the comprehensive feature data set into the product quality prediction model to predict the product defect grade coefficient;

[0079] A product quality evaluation module for comparing the predicted product defect grade coefficient with a preset product defect grade coefficient threshold to determine whether the quality of the rare earth permanent magnet product is qualified;

[0080] A defect type judgment module for collecting unqualified rare earth permanent magnet product data, constructing a defect type diagnosis model, and inputting the unqualified rare earth permanent magnet product data into the defect type diagnosis model to predict the product defect type data;

[0081] A feedback control module for sending a warning instruction through a visual inspection terminal to feedback the product defect type data to the production department, and the production department optimizes the production process in a timely manner according to the feedback product defect type data; each module is connected by wired and / or wireless means.

[0082] The product defect image data includes defect image parameter data, defect location, and defect area; the defect image parameter data includes the resolution and color depth of the image; the 5G network information data includes the network bandwidth, latency, packet loss rate, data transmission rate, 5G signal strength, and error rate in data transmission; the transmission environment data includes the temperature, electromagnetic interference level, current, and voltage of network devices in the transmission environment.

[0083] The product defect image data is obtained by shooting with an industrial camera; the 5G network information data is obtained by the network testing device MATLAB; the temperature of the transmission environment is obtained by a temperature sensor, the electromagnetic interference level is obtained by an electromagnetic interference sensor, and the current and voltage of network devices are obtained by a current sensor and a voltage sensor;

[0084] The method of calibrating the 5G network information data according to the transmission environment data includes;

[0085] Calibrate the 5G network information data according to the transmission environment data through a linear adaptive filter. Define a linear adaptive filter, and its output is: where, y[k] is the output of the linear adaptive filter; x q [k] is the input of the linear adaptive filter, that is, the 5G network information data; ψ q [k] is the weight coefficient of the linear adaptive filter; M is the order of the linear adaptive filter; k is the iteration time of the linear adaptive filter; q is the number of iterations of the linear adaptive filter;

[0086] Adjust the weight coefficient of the linear adaptive filter through the least mean square error algorithm. The update of the weight coefficient at each iteration time is: ψ q [k + 1] = ψ q [k] + 2μe[k]x q [k]; where, ψ q [k + 1] is the weight coefficient updated at the k + 1 iteration time; e[k] is the error between the expected output and the actual output of the linear adaptive filter; μ is the rate of weight coefficient adjustment;

[0087] The error e[k] between the expected output and the actual output of the linear adaptive filter is: e[k] = d[k] - y[k]; where, d[k] is the expected output after calibrating the 5G network information data according to the transmission environment data; y[k] is the output of the linear adaptive filter;

[0088] Continuously adjust the rate of weight coefficient adjustment of the adaptive filter through the weight coefficient adjustment model according to the error between the expected output and the actual output of the linear adaptive filter until the output is stable; the weight coefficient adjustment model is: Among them, μ0 is the initial rate of weight coefficient adjustment; q is the number of iterations of the linear adaptive filter; Q is the total number of iterations of the linear adaptive filter;

[0089] The preset error threshold between the expected output and the actual output of the linear adaptive filter is e[k] * , when the error between the expected output and the actual output of the linear adaptive filter is less than the error threshold e[k] * , stop the adjustment at this time, and the optimal rate of weight coefficient adjustment is obtained; use the linear adaptive filter to learn the influence of the transmission environment data on the 5G network information data, and obtain the calibrated 5G network information data through the output of the linear adaptive filter.

[0090] For example, assume there is the following original 5G network information data: bandwidth: 100 Mbps, latency: 50 ms, packet loss rate: 1%; the transmission environment data includes: temperature: 25 °C, electromagnetic interference level: medium, current and voltage of network equipment: normal;

[0091] The preset expected output (calibrated data) is: bandwidth: 120 Mbps, latency: 30 ms, packet loss rate: 0.5%;

[0092] Define a linear adaptive filter, and set the initial weight coefficient of the filter to 0.5; adjust the weight coefficient through the least mean square error algorithm. Assume the initial rate of weight coefficient adjustment is 0.1, and the number of iterations of the linear adaptive filter is 100 times. In each iteration, calculate the error between the expected output and the actual output of the linear adaptive filter, and update the weight coefficient according to the weight coefficient adjustment model;

[0093] Finally, when the error between the expected output and the actual output of the linear adaptive filter is less than the preset error threshold, stop the adjustment. At this time, the obtained weight coefficient is the optimal rate; use the linear adaptive filter to learn the influence of the transmission environment data on the 5G network information data, and obtain the calibrated 5G network information data through the output of the linear adaptive filter.

[0094] The methods for preprocessing the product defect image data, the calibrated 5G network information data, and the transmission environment data to obtain the defect image feature dataset, the calibrated 5G network information feature dataset, and the transmission environment feature dataset include:

[0095] Preprocessing of the product defect image data:

[0096] Convert the product defect image from a color image to a gray image, and the converted gray image is:

[0097] I g(x′, y′) = 0.299·R(x′, y′) + 0.587·G(x′, y′) + 0.114·B(x′, y′); where I g (x′, y′) is the pixel value of the grayscale image at (x′, y′); (x′, y′) are the horizontal and vertical coordinates of each pixel; R(x′, y′) is the pixel value of the red channel of the product defect image; G(x′, y′) is the pixel value of the green channel of the product defect image; B(x′, y′) is the pixel value of the blue channel of the product defect image;

[0098] Use a Gaussian filter to denoise the grayscale image:

[0099] where I gd (x′, y′) is the pixel value of the image after denoising by the Gaussian filter at the position (x′, y′); ω′(a′, b′) is the weight of the Gaussian kernel at the position (a′, b′); I g (x′ + a′, y′ + b′) is the pixel value of the original grayscale image at the position (x′ + a′, y′ + b′); (a′, b′) is the offset of the current position (x′, y′); k′ is the size of the Gaussian kernel;

[0100] Adopt the histogram equalization method to enhance the image contrast, use the Canny edge detection to extract the edge information in the image, preset the image segmentation threshold as U, and perform image binarization based on the image segmentation threshold U: I ge (x′, y′) is the pixel value of the binarized image at the position (x′, y′); 255 represents the product defect area; 0 represents the background area;

[0101] Detect and remove the abnormal data in the product defect image data, calibrated 5G network information data, and transmission environment data through the LOF algorithm, and obtain the processed defect image feature dataset, calibrated 5G network information feature dataset, and transmission environment feature dataset;

[0102] Normalize the defect image feature dataset, calibrated 5G network information feature dataset, and transmission environment feature dataset, and convert them to a standard normal distribution to obtain the normalized defect image feature dataset, calibrated 5G network information feature dataset, and transmission environment feature dataset.

[0103] The method of weighted fusion of the defect image feature dataset, calibrated 5G network information feature dataset, and transmission environment feature dataset to obtain the comprehensive feature dataset includes:

[0104] Fuse the defective image feature dataset, the calibrated 5G network information feature dataset, and the transmission environment feature dataset through a weighted model to form a comprehensive feature dataset. Denote the defective image feature dataset as W1, the calibrated 5G network information feature dataset as W2, and the transmission environment feature dataset as W3.

[0105] The weighted model is: YQL = W1·β1 + W2·β2 + W3·β3; where YQL is the comprehensive feature dataset, β1 is the weight coefficient of the defective image feature dataset, β2 is the weight coefficient of the calibrated 5G network information feature dataset, and β3 is the weight coefficient of the transmission environment feature dataset.

[0106] For example, if the image features are the most important, the calibrated 5G network information is the second most important, and the transmission environment has the least impact, the weight coefficients can be set as follows: β1 is 0.6, β2 is 0.3, and β3 is 0.1. Therefore, the comprehensive feature dataset can be expressed as YQL = W1·0.6 + W2·0.3 + W3·0.1.

[0107] The training method of the product defect assessment model includes:

[0108] Use the historical comprehensive feature dataset and the corresponding output label, the product defect grade coefficient, as the sample set. Use the sample set as the dataset and divide the dataset into a training set, a validation set, and a test set. Select GBDT as the specific implementation of the gradient boosting machine model to handle the regression task.

[0109] Initialize the GBDT parameters and define the objective function. The GBDT parameters include the maximum number of leaf nodes in each tree, the learning rate, the number of trees, and the maximum depth of the trees. Use the historical comprehensive feature dataset as the input data and the corresponding product defect grade coefficient as the output label to train the product defect assessment model. The product defect assessment model is a gradient boosting machine model.

[0110] Use the mean squared error as the loss function to measure the difference between the predicted value and the actual value of the model. The mean squared error loss function is: where n is the number of samples in the dataset; Y b is the actual value of the b-th sample in the dataset; is the predicted value of the b-th sample in the dataset; b is the index of the sample.

[0111] In each iteration step, GBDT fits the negative gradient of the loss function in the previous step by constructing a new decision tree, uses the negative gradient of the objective function as the learning target for the new tree, and adjusts the contribution of the new tree to the final result through the learning rate to minimize the loss function; the performance of the model is evaluated using the validation set, the model is tuned, and the model parameters are adjusted according to its performance feedback until the model performance no longer improves significantly or reaches the preset stopping condition, at which point the process stops.

[0112] The methods for tuning the model include:

[0113] Adding a regularization term to the objective function of GBDT. The objective function of GBDT is: where n is the number of samples in the dataset; Y b is the actual value of the b-th sample in the dataset; is the predicted value of the b-th sample by the model at the t-th iteration; is the mean squared error loss function of the model; Ω(f t ) is the regularization term in the objective function, which is used to penalize the complexity of the model;

[0114] The regularization term Ω(f t ) is: where γ is the coefficient controlling the penalty for the number of leaf nodes; T′ is the number of leaf nodes in the tree f t ; λ is the coefficient controlling the penalty for the square of the leaf node scores; ω j is the score of the j-th leaf node in the tree f t ;

[0115] Combining the loss function and the regularization term, the complete objective function is obtained: where, is the cumulative predicted value at the (t - 1)-th iteration; f t (X b ) is the predicted value of the newly added tree at the t-th iteration;

[0116] In each iteration step, a new decision tree f t (X) is constructed to fit the negative gradient of the loss function in the previous step: where g b is the first derivative of the loss function with respect to the predicted value, i.e., the gradient; where h b is the second derivative of the loss function with respect to the predicted value, i.e., the Hessian matrix;

[0117] Then, by optimizing the predicted value f t (X b ) of the newly added tree at the t-th iteration in the objective function, the best tree structure is found:

[0118] Among them, Obj t is a quadratic function about f t (X).

[0119] Adjust the contribution of the new tree to the final result through the learning rate η: Among them, η is the learning rate, which controls the contribution of each tree to the prediction of the final model; is the predicted value of the b-th sample after the t-th iteration; f t (X b ) is the predicted value of the newly added tree at the t-th iteration;

[0120] Dynamically adjust the learning rate of the model through the learning rate limit, and find the optimal learning rate through the optimal adjustment model;

[0121] The learning rate limit model is: Among them, η′ is the dynamically adjusted learning rate; η max is the maximum value of the learning rate; η min is the minimum value of the learning rate; t uo is the current iteration number; t max is the cycle length;

[0122] The preset learning rate threshold is that when the dynamically adjusted learning rate is less than the preset learning rate threshold, stop the iteration;

[0123] The optimal adjustment model is: Among them, η * is the optimal learning rate; fo is the adjustment times of the learning rate; t′ uo is the total iteration number;

[0124] The preset proportion interval of the learning rate adjustment times to the total iteration number is [a, d]; when the proportion of the learning rate adjustment times to the total iteration number is within the range of [a, d], the model performance is the best, then the determined range is an optimal ratio, that is, the learning rate at this time is the optimal learning rate;

[0125] Use the test set to evaluate the performance of the model in the prediction task, and use the trained product defect evaluation model to predict the current comprehensive feature data set to obtain the product defect level coefficient.

[0126] For example, assume there is a data set, which contains the following features: defective image data: resolution, color depth, defect location and defect area; 5G network information data: bandwidth, latency, packet loss rate; transmission environment data: temperature, electromagnetic interference level, current and voltage of network equipment; the target variable is the product defect level coefficient;

[0127] In each iteration, a new decision tree is constructed to fit the current negative gradient; the learning rate is used to adjust the contribution of the new tree to the final result, and the learning rate is ensured to be dynamically adjusted within a certain range; by optimally adjusting the model, the optimal learning rate is found such that the proportion of the number of learning rate adjustments to the total number of iteration rounds is within a specific range; finally, the trained GBDT model is used to predict the current comprehensive feature dataset to obtain the product defect level coefficient.

[0128] The method for judging whether the quality of rare earth permanent magnet products is qualified by comparing the predicted product defect level coefficient with the preset product defect level coefficient threshold includes:

[0129] If the predicted product defect level coefficient is less than the preset product defect level coefficient threshold, it is judged that the quality of the rare earth permanent magnet product does not meet the standard;

[0130] If the predicted product defect level coefficient is greater than or equal to the preset product defect level coefficient threshold, it is judged that the quality of the rare earth permanent magnet product meets the standard.

[0131] The training method of the defect type diagnosis model includes:

[0132] The dataset is divided into a training set, a test set, and a validation set, and a defect type diagnosis model is constructed. The defect type diagnosis model includes an input layer, a hidden layer, and an output layer; the input layer is the historical unqualified rare earth permanent magnet product data, and the output layer is the product defect type data; the output layer is set with neurons equal in number to the number of product defect types, and each neuron corresponds to the prediction probability of a defect type; the softmax function is used as the activation function; the defect type diagnosis model is a multi-layer perceptron MLP model;

[0133] The multi-class cross-entropy is used as the loss function of the model to measure the difference between the predicted value and the actual value of the model; the multi-class cross-entropy loss function is: where L is the average loss of the dataset; N is the total number of samples in the dataset; C is the number of product defect type data; y ic is the true label of the i-th sample for the c-th type; p ic is the probability that the model predicts the i-th sample belongs to the c-th type;

[0134] The training set is used to train the defect type diagnosis model, and the model parameters are updated through the backpropagation algorithm to minimize the loss function; the validation set is used to evaluate the performance of the defect type diagnosis model by calculating the accuracy index;

[0135] Select the SGD optimization algorithm as the optimizer, tune the model according to the performance feedback of the validation set, and adjust the model parameters until the performance no longer improves significantly or reaches the preset stop condition; use the test set to evaluate the performance of the model in the prediction task, and use the trained defect type diagnosis model to predict the current comprehensive feature dataset to obtain product defect type data.

[0136] The method for the visual detection terminal to issue a warning instruction to feedback the product defect type data to the production department, and the production department to optimize the production process in a timely manner according to the feedback product defect type data includes:

[0137] The visual detection terminal collects product defect type data in real time, and represents the collected product defect type data as a set: {D1, D2,..., D i′ ,..., D n′}; where D i′ is the number of the i'-th defect type; n' is the total number of defect types;

[0138] Sort the product defect type data in descending order according to the impact on production cost, and use the Power BI drawing tool to draw a Pareto chart; in the Pareto chart, the vertical axis is the quantity of product defect type data, and the horizontal axis is the type of product defect type data; draw a bar chart, and the height of each bar in the chart corresponds to the quantity of product defect type data; draw a cumulative curve, with the horizontal axis being the type of product defect type data and the vertical axis being the cumulative percentage of the quantity of product defect type data.

[0139] Preset a cumulative percentage threshold. When the cumulative percentage of the quantity of a certain product defect type data exceeds the preset cumulative percentage threshold, the visual detection terminal issues a warning instruction; the production department identifies product defect problems based on the warning instruction and the product defect type data in the Pareto chart, takes measures to optimize the production process, reduce or eliminate defect problems, and updates the Pareto chart according to the new product defect type data.

[0140] For example, assume a company that produces rare earth permanent magnet products uses a visual detection terminal to detect product defects in real time; the visual detection terminal can identify and classify the defects on the products, and classify these defects into the following types: scratches, missing parts, color mismatch, poor welding;

[0141] The data collected by the visual detection terminal in real time is as follows:

[0142] Number of scratches: 100, number of missing parts: 20, number of color mismatches: 5, number of poor welds: 3; the total number of defect types is 100 + 20 + 5 + 3 = 128.

[0143] Sort these defect type data in descending order according to the impact on production costs: Scratches: 100, Missing parts: 20, Color mismatch: 5, Poor soldering: 3;

[0144] Use the Power BI plotting tool to draw a Pareto chart; The Pareto chart will show the quantity of each defect type and their contribution to the total number of defects;

[0145] Bar chart: The height of each bar corresponds to the quantity of each defect type; For example, the number of scratches is the largest, so it is the highest in the bar chart;

[0146] Cumulative curve: The horizontal axis represents the defect type, and the vertical axis represents the cumulative percentage; The cumulative percentage refers to the proportion of the quantity of the previous defect type to the total quantity when plotting; For example, the number of scratches accounts for 85.9% (100 / 128) of the total quantity, so it will be at the first point of the cumulative curve;

[0147] Preset a cumulative percentage threshold, such as 90%. When the cumulative percentage exceeds 90%, the visual inspection terminal issues a warning instruction. In this example, the number of scratches accounts for 85.9% of the total quantity, so it will not trigger a warning; However, if the threshold is set to 80%, then the number of scratches will trigger a warning because it exceeds this cumulative percentage threshold.

[0148] After receiving the warning, the production department will view the Pareto chart and find that scratches are the main defect type; The production department can take measures, such as improving the cleaning process on the production line or strengthening employee training, to reduce the number of scratch defects.

[0149] Based on the new product defect type data, the Pareto chart can be updated to reflect the effect of any improvement measures; If the number of scratches decreases, the Pareto chart will show the new cumulative percentage, which helps the production department continue to optimize the production process to further reduce defect problems.

[0150] The preset product defect grade coefficient threshold is set by the staff. Different product defect grade coefficients are collected through the visual inspection terminal, and the average value of multiple product defect grade coefficients is taken as the preset product defect grade coefficient threshold; Similarly, set the error threshold between the expected output and the actual output of the linear adaptive filter and the preset cumulative percentage threshold.

[0151] In this embodiment, a linear adaptive filter automatically adjusts its weight coefficients to minimize the error between the desired output and the actual output. This dynamic adjustment ability enables the filter to quickly adapt to changing transmission environments, such as signal attenuation and increased interference, thus ensuring that the calibrated 5G network information data is more accurate and reliable. By calibrating the 5G network information data, data biases and noises caused by the transmission environment can be eliminated or reduced, significantly improving the quality of the data. The calibrated 5G network information data can more accurately reflect the actual condition of the network, providing strong support for network optimization. Through automatic calibration and optimization, the need for manual intervention is reduced, and the complexity and cost of network maintenance are lowered.

[0152] By adding a regularization term, overfitting of the model to the training data is effectively prevented, and the generalization ability of the model on unknown data is improved. By controlling the penalty coefficients of the number of leaf nodes and the leaf node scores, the model can be guided to generate a more reasonable and concise tree structure, thereby improving the interpretability and understandability of the model. By adjusting the learning rate, it can be flexibly adjusted according to the specific data set and model performance to achieve the best training effect, significantly improving the training efficiency of the model and reducing the training time. This makes the model more adaptable and robust to different types of data sets and training environments.

[0153] Through the Pareto chart, the quantity and cumulative percentage of various types of defects are intuitively displayed. This enables the production department to make decisions based on data and prioritize the types of defects that have the greatest impact on production costs, thereby achieving effective allocation of resources. Timely identification and resolution of product defects can reduce waste of raw materials, time, and manpower. This helps to reduce production costs, improve resource utilization, and increase the profitability of the enterprise. Through the close collaboration among the visual inspection terminal, the data analysis team, and the production department; by jointly solving product defect problems, communication and collaboration among different departments are strengthened, promoting the overall collaboration ability and work efficiency of the team.

[0154] Embodiment 2

[0155] Please refer to Figure 2 As shown, for the parts not described in detail in this embodiment, refer to the description content of Embodiment 1. A visual inspection method for rare earth permanent magnet products based on 5G network cloud computing is provided, including:

[0156] S1. Collect product defect image data, 5G network information data, and transmission environment data;

[0157] S2. Calibrate the 5G network information data according to the transmission environment data to obtain calibrated 5G network information data. Preprocess the product defect image data, the calibrated 5G network information data, and the transmission environment data to obtain a defect image feature data set, a calibrated 5G network information feature data set, and a transmission environment feature data set;

[0158] The defective image feature dataset, the calibrated 5G network information feature dataset, and the transmission environment feature dataset are weighted and fused to obtain a comprehensive feature dataset;

[0159] S3. Build a product defect evaluation model, input the comprehensive feature dataset into the product quality prediction model, and predict the product defect level coefficient;

[0160] S4. Compare the predicted product defect level coefficient with the preset product defect level coefficient threshold to determine whether the quality of the rare earth permanent magnet product is qualified;

[0161] S5. Collect the data of unqualified rare earth permanent magnet products, build a defect type diagnosis model, input the data of unqualified rare earth permanent magnet products into the defect type diagnosis model, and predict the product defect type data;

[0162] S6. Send a warning instruction through the vision detection terminal to feedback the product defect type data to the production department, and the production department optimizes the production process in a timely manner according to the feedback product defect type data.

[0163] Since the electronic device introduced in this embodiment is the electronic device used in the vision detection system of rare earth permanent magnet products based on 5G network cloud computing in the embodiment of the present application, based on the vision detection system of rare earth permanent magnet products based on 5G network cloud computing introduced in the embodiment of the present application, those skilled in the art can understand the specific implementation manners and various variations of the electronic device in this embodiment. Therefore, the specific implementation of how this electronic device realizes the method in the embodiment of the present application will not be introduced in detail here. As long as those skilled in the art implement the electronic device used in the vision detection system of rare earth permanent magnet products based on 5G network cloud computing in the embodiment of the present application, it belongs to the scope protected by the present application.

[0164] The above formulas are all dimensionless and take their numerical values for calculation. The formula is obtained by collecting a large amount of data for software simulation to get a formula closest to the actual situation. The preset parameters and threshold selection in the formula are set by those skilled in the art according to the actual situation.

[0165] The above is only the preferred implementation manner of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions within the idea of the present invention belong to the protection scope of the present invention. It should be noted that for ordinary technical users in the technical field, several improvements and refinements made without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A visual inspection system for rare earth permanent magnet products based on 5G network cloud computing, characterized in that, Including: A data acquisition module for acquiring product defect image data, 5G network information data, and transmission environment data; A data processing module for calibrating the 5G network information data according to the transmission environment data to obtain calibrated 5G network information data; Preprocessing the product defect image data, calibrated 5G network information data, and transmission environment data to obtain a defect image feature data set, a calibrated 5G network information feature data set, and a transmission environment feature data set; Performing weighted fusion on the defect image feature data set, the calibrated 5G network information feature data set, and the transmission environment feature data set to obtain a comprehensive feature data set; A product quality prediction module for constructing a product defect evaluation model, inputting the comprehensive feature data set into the product quality prediction model, and predicting a product defect grade coefficient; A product quality evaluation module for comparing the predicted product defect grade coefficient with a preset product defect grade coefficient threshold to determine whether the quality of the rare earth permanent magnet product is qualified; A defect type judgment module for collecting unqualified rare earth permanent magnet product data, constructing a defect type diagnosis model, and inputting the unqualified rare earth permanent magnet product data into the defect type diagnosis model to predict product defect type data; A feedback control module for sending a warning instruction through a visual detection terminal to feedback the product defect type data to the production department, and the production department timely optimizes the production process according to the feedback product defect type data; each module is connected by wired and / or wireless means.

2. The visual inspection system for rare earth permanent magnet products based on 5G network cloud computing according to claim 1, characterized in that, The product defect image data includes defect image parameter data, defect location, and defect area; the defect image parameter data includes the resolution and color depth of the image; the 5G network information data includes the network bandwidth, delay, packet loss rate, data transmission rate, 5G signal strength, and error rate in data transmission; the transmission environment data includes the temperature, electromagnetic interference level, current, and voltage of network equipment in the transmission environment.

3. The visual inspection system for rare earth permanent magnet products based on 5G network cloud computing according to claim 2, characterized in that, The method for calibrating the 5G network information data according to the transmission environment data to obtain calibrated 5G network information data includes; Calibrate the 5G network information data according to the transmission environment data through a linear adaptive filter. Define a linear adaptive filter, and its output is: where y[k] is the output of the linear adaptive filter; x q [k] is the input of the linear adaptive filter, that is, the 5G network information data; ψ q [k] is the weight coefficient of the linear adaptive filter; M is the order of the linear adaptive filter; k is the iteration time of the linear adaptive filter; q is the number of iterations of the linear adaptive filter; The weight coefficients of the linear adaptive filter are adjusted by the least mean square error algorithm, and the update of the weight coefficients at each iteration time is: ψ q [k + 1]=ψ q [k]+2μe[k]x q [k]; where, ψ q [k + 1] is the weight coefficient updated at the (k + 1)-th iteration; e[k] is the error between the desired output and the actual output of the linear adaptive filter; μ is the rate of adjustment of the weight coefficient; The error e[k] between the desired output and the actual output of the linear adaptive filter is: e[k]=d[k]-y[k]; where d[k] is the desired output after calibrating the 5G network information data according to the transmission environment data; y[k] is the output of the linear adaptive filter; Continuously adjust the rate of the adaptive filter weight coefficient adjustment of the model by the weight coefficient according to the error between the expected output and the actual output of the linear adaptive filter until the output is stable; the weight coefficient adjustment model is: where μ0 is the initial rate of the weight coefficient adjustment; q is the iteration number of the linear adaptive filter; Q is the total iteration number of the linear adaptive filter; The error threshold between the expected output and the actual output of the preset linear adaptive filter is e[k]. * When the error between the expected output and the actual output of the linear adaptive filter is less than the error threshold e[k]. * Stop the adjustment at this time, and the optimal rate of weight coefficient adjustment can be obtained; use the linear adaptive filter to learn the influence of the transmission environment data on the 5G network information data, and calibrate the 5G network information data through the output of the linear adaptive filter.

4. The vision inspection system for rare earth permanent magnet products based on 5G network cloud computing according to claim 3, characterized in that, The method for preprocessing the product defect image data, calibrated 5G network information data, and transmission environment data to obtain a defect image feature data set, a calibrated 5G network information feature data set, and a transmission environment feature data set includes: Preprocessing of the product defect image data: Converting the product defect image from a color image to a gray image, and the converted gray image is: I g (x′,y′) = 0.299·R(x′,y′) + 0.587·G(x′,y′) + 0.114·B(x′,y′); where I g (x′,y′) is the pixel value of the gray image at (x′,y′); (x′,y′) are the horizontal and vertical coordinates of each pixel; R(x′,y′) is the pixel value of the red channel of the product defect image; G(x′,y′) is the pixel value of the green channel of the product defect image; B(x′,y′) is the pixel value of the blue channel of the product defect image; Using a Gaussian filter to denoise the gray image: Among them, I gd (x′, y′) is the pixel value of the image after denoising by the Gaussian filter at the position (x′, y′); ω′(a′, b′) is the weight of the Gaussian kernel at the position (a′, b′); I g (x′ + a′, y′ + b′) is the pixel value of the original grayscale image at the position (x′ + a′, y′ + b′); (a′, b′) is the offset of the current position (x′, y′); k′ is the size of the Gaussian kernel; The histogram equalization method is adopted to enhance the image contrast. The Canny edge detection is used to extract the edge information in the image. The preset image segmentation threshold is U, and the image is binarized based on the image segmentation threshold U: I ge (x′, y′) is the pixel value of the binarized image at the position (x′, y′); 255 is the product defect area; 0 is the background area; Detecting and removing abnormal data in the product defect image data, calibrated 5G network information data, and transmission environment data through the LOF algorithm to obtain a processed defect image feature data set, a calibrated 5G network information feature data set, and a transmission environment feature data set; Normalize the defective image feature dataset, the calibrated 5G network information feature dataset, and the transmission environment feature dataset to convert them into a standard normal distribution, obtaining the normalized defective image feature dataset, the calibrated 5G network information feature dataset, and the transmission environment feature dataset.

5. The vision inspection system for rare earth permanent magnet products based on 5G network cloud computing according to claim 4, characterized in that, The method for weighted fusion of the defective image feature dataset, the calibrated 5G network information feature dataset, and the transmission environment feature dataset to obtain a comprehensive feature dataset includes: Fuse the defective image feature dataset, the calibrated 5G network information feature dataset, and the transmission environment feature dataset through a weighted model to form a comprehensive feature dataset; denote the defective image feature dataset as W1, the calibrated 5G network information feature dataset as W2, and the transmission environment feature dataset as W3. The weighted model is: YQL = W1·β1 + W2·β2 + W3·β3; where YQL is the comprehensive feature dataset; β1 is the weight coefficient of the defective image feature dataset; β2 is the weight coefficient of the calibrated 5G network information feature dataset; β3 is the weight coefficient of the transmission environment feature dataset.

6. The visual inspection system for rare earth permanent magnet products based on 5G network cloud computing according to claim 5, wherein The training method of the product defect evaluation model includes: Use the historical comprehensive feature dataset and the corresponding output label product defect level coefficient as a sample set; use the sample set as a dataset and divide the dataset into a training set, a validation set, and a test set; select GBDT as the specific implementation of the gradient boosting machine model to handle the regression task. Initialize the GBDT parameters and define the objective function; the GBDT parameters include the maximum number of leaf nodes in each tree, the learning rate, the number of trees, and the maximum depth of the tree; use the historical comprehensive feature dataset as the input data and the corresponding product defect level coefficient as the output label to train the product defect evaluation model; the product defect evaluation model is a gradient boosting machine model. The mean squared error is used as the loss function to measure the difference between the predicted value and the actual value of the model; the mean squared error loss function is as follows: where n is the number of samples in the dataset; Y b is the actual value of the b-th sample in the dataset; is the predicted value of the b-th sample in the dataset; b is the index of the sample; In each iteration, GBDT constructs a new decision tree to fit the negative gradient of the previous step's loss function, uses the negative gradient of the objective function as the learning target of the new tree, and adjusts the contribution of the new tree to the final result through the learning rate to minimize the loss function; use the validation set to evaluate the performance of the model, tune the model, and adjust the model parameters according to its performance feedback until the model performance no longer improves significantly or reaches the preset stop condition and then stop.

7. The vision inspection system for rare earth permanent magnet products based on 5G network cloud computing according to claim 6, wherein The method for tuning the model includes: Add a regularization term to the objective function of GBDT. The objective function of GBDT is: where n is the number of samples in the dataset; Y b is the actual value of the b-th sample in the dataset; is the predicted value of the model for the b-th sample at the t-th iteration; is the mean squared error loss function of the model; Ω(f t ) is the regularization term in the objective function; The regularization term Ω(f t ) is as follows: where γ is the coefficient for controlling the penalty of the number of leaf nodes; T′ is the number of leaf nodes in the tree f t ; λ is the coefficient for controlling the penalty of the square of the leaf node scores; ω j is the score of the j-th leaf node in the tree f t . Combine the loss function and the regularization term to obtain the complete objective function: where is the cumulative predicted value at the (t - 1)-th iteration; f t (X b ) is the predicted value of the newly added tree at the t-th iteration; In each iteration, construct a new decision tree \(f\) t (X) to fit the negative gradient of the loss function in the previous step: where \(g\) b is the first derivative of the loss function with respect to the predicted value; where \(h\) b is the second derivative of the loss function with respect to the predicted value; Then, by optimizing the predicted value f of the newly added tree at the t-th iteration in the objective function t (X b ) to find the optimal tree structure: Among them, Obj t is a quadratic function with respect to f t (X); Adjust the contribution of the new tree to the final result by the learning rate η: where η is the learning rate; is the predicted value for the b-th sample after the t-th iteration; f t (X b ) is the predicted value of the newly added tree at the t-th iteration; Dynamically adjust the learning rate of the model through the learning rate limit model and find the optimal learning rate through the optimal adjustment model. The learning rate limit model is: where η′ is the learning rate after dynamic adjustment; η max is the maximum value of the learning rate; η min is the minimum value of the learning rate; t uo is the current iteration number; t max is the cycle length; Preset the learning rate threshold as, and stop the iteration when the dynamically adjusted learning rate is less than the preset learning rate threshold. The optimal adjustment model is as follows: where η * is the optimal learning rate; fo is the adjustment times of the learning rate; t′ uo is the total number of iteration rounds; Preset the proportion interval of the learning rate adjustment times to the total number of iteration rounds as [a, d]; when the proportion of the learning rate adjustment times to the total number of iteration rounds is within the range of [a, d], the model performance is the best, then determine the range as an optimal ratio, that is, the learning rate at this time is the optimal learning rate. Use the test set to evaluate the performance of the model in the prediction task, and use the trained product defect evaluation model to predict the current comprehensive feature dataset to obtain the product defect level coefficient.

8. The vision inspection system for rare earth permanent magnet products based on 5G network cloud computing according to claim 7, characterized in that, The method for comparing the predicted product defect level coefficient with the preset product defect level coefficient threshold to determine whether the quality of rare earth permanent magnet products is qualified includes: If the predicted product defect level coefficient is less than the preset product defect level coefficient threshold, it is determined that the quality of the rare earth permanent magnet product does not meet the standard; If the predicted product defect level coefficient is greater than or equal to the preset product defect level coefficient threshold, it is determined that the quality of the rare earth permanent magnet product meets the standard.

9. The visual inspection system for rare earth permanent magnet products based on 5G network cloud computing according to claim 8, wherein, The training method of the defect type diagnosis model includes: Dividing the data set into a training set, a test set and a validation set, constructing a defect type diagnosis model, which includes an input layer, a hidden layer and an output layer; the input layer is the historical unqualified rare earth permanent magnet product data, and the output layer is the product defect type data; the output layer is set with neurons equal in number to the number of product defect types, and each neuron corresponds to the prediction probability of a defect type; using the softmax function as the activation function; the defect type diagnosis model is a multi-layer perceptron MLP model; Use the multi-class cross-entropy as the loss function of the model to measure the difference between the predicted value and the actual value of the model; the multi-class cross-entropy loss function is as follows: where L is the average loss of the data set; N is the total number of samples in the data set; C is the number of product defect type data; y ic is the true label of the i-th sample for the c-th type; p ic is the probability that the i-th sample predicted by the model belongs to the c-th type; Using the training set to train the defect type diagnosis model, updating the model parameters through the backpropagation algorithm to minimize the loss function; using the validation set to evaluate the performance of the defect type diagnosis model by calculating the accuracy index; Selecting the SGD optimization algorithm as the optimizer, tuning the model according to the performance feedback of the validation set, adjusting the model parameters until the performance no longer improves significantly or reaches the preset stop condition; using the test set to evaluate the performance of the model in the prediction task, and using the trained defect type diagnosis model to predict the current comprehensive feature data set to obtain the product defect type data.

10. The visual inspection system for rare earth permanent magnet products based on 5G network cloud computing according to claim 9, characterized in that, The method for feeding back the product defect type data to the production department through the visual detection terminal to issue a warning instruction, and the production department optimizing the production process in a timely manner according to the fed-back product defect type data includes: Collect product defect type data in real time through a visual detection terminal, and represent the collected product defect type data as a set: {D1, D2,..., D i′ ,..., D n′}; where D i′ is the quantity of the i'-th defect type; n' is the total number of defect types; Sorting the product defect type data in descending order according to the impact on production cost, and using the Power BI drawing tool to draw a Pareto chart; in the Pareto chart, the vertical axis is the quantity of product defect type data, and the horizontal axis is the type of product defect type data; drawing a bar chart, where the height of each bar in the chart corresponds to the quantity of product defect type data; drawing a cumulative curve, with the horizontal axis being the type of product defect type data and the vertical axis being the cumulative percentage of the quantity of product defect type data; Presetting a cumulative percentage threshold, and when the cumulative percentage of the quantity of a certain product defect type data exceeds the preset cumulative percentage threshold, the visual detection terminal issues a warning instruction; the production department identifies the product defect problem according to the warning instruction and the product defect type data in the Pareto chart, takes measures to optimize the production process, reduces or eliminates the defect problem, and updates the Pareto chart according to the new product defect type data.

Citation Information

Patent Citations

  • Rare earth partition machine vision detection system and method based on variable background light source

    CN116046738A

  • Minimum error entropy adaptive filtering method based on robust M estimation

    CN115632633A

  • Method and system for monitoring construction quality of 3D printing bridge floor based on semantic segmentation

    CN116664846A