Defect detection model construction method and device, electronic equipment and storage medium
By building a defect detection model based on training samples and multiple algorithms, the problems of manpower consumption and real-time detection in traditional copper chain detection methods are solved, and efficient and accurate copper chain defect detection is achieved.
Patent Information
- Application Number
- CN202411632197.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-07
AI Technical Summary
Traditional copper chain crack and wear detection methods rely on manual visual inspection and regular maintenance, which consumes a lot of manpower and time, and cannot detect the equipment status in real time, making it easy to detect untimely or miss inspections.
A defect detection model construction method is adopted. By obtaining multiple training samples, including copper chain sample images and real defect identification, the feature extraction sub-model is trained using the Drosophila optimization algorithm with fuzzy feedback increment, the feature adaptive refinement algorithm is used to train the feature dimensionality reduction sub-model, and combining the deep learning sub-model of the quantum state nonlinear activation function, the defect detection model is built to realize copper chain surface defect detection.
The performance and generalization capabilities of the defect detection model are improved, accurate detection of copper chain defect categories is achieved, efficiency and accuracy of copper chain defect detection is improved, and the problems of manpower consumption and real-time detection are solved in traditional methods.
Smart Images

Figure CN119579529A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection technology, and in particular to a defect detection model construction method, device, electronic equipment and storage medium. Background Art
[0002] During the industrial production process, the copper chain of the wire cutting machine is in high-speed operation and high-load working state for a long time, which is very easy to produce problems such as cracks and wear, resulting in reduced equipment performance and even serious production accidents.
[0003] In the related technology, the traditional copper busbar chain crack and wear detection method mainly relies on manual visual inspection and regular maintenance, which not only consumes a lot of manpower and time, but also fails to detect the equipment status in real time, which easily leads to untimely detection or missed detection. Summary of the invention
[0004] The present invention provides a defect detection model construction method, device, electronic device and storage medium, so as to obtain a defect detection model based on training samples and multiple algorithm training, so as to improve the model performance and generalization ability of the defect detection model, and further, achieve the effect of accurately detecting the defect category of copper bus chain according to the defect detection model, thereby improving the efficiency and accuracy of copper bus chain defect detection.
[0005] According to one aspect of the present invention, a method for constructing a defect detection model is provided, the method comprising:
[0006] Acquire multiple training samples; wherein the training samples include a copper bar chain sample image and a real defect mark corresponding to the copper bar chain sample image, and the real defect mark is used to characterize the defect state of the copper bar chain in the copper bar chain sample image;
[0007] For the plurality of training samples, the copper bus chain sample images in the training samples are processed in turn according to the pre-trained feature extraction sub-model and feature dimension reduction sub-model to obtain the features to be processed corresponding to the training samples, and the copper bus chain sample images in the training samples are updated based on the features to be processed; wherein the feature extraction sub-model is trained based on the fruit fly optimization algorithm of fuzzy feedback increment; and the feature dimension reduction sub-model is trained based on the feature adaptive refinement algorithm;
[0008] Processing the training sample based on a pre-built deep learning sub-model to obtain a third loss value; wherein the activation function included in the deep learning sub-model is a quantum state nonlinear activation function;
[0009] Modifying the model parameters in the deep learning sub-model based on the third loss value, taking the convergence of the third loss function in the deep learning sub-model as a training target, and taking the trained deep learning sub-model as a classification sub-model;
[0010] A defect detection model is constructed based on the feature extraction sub-model, the feature dimension reduction sub-model and the classification sub-model, so as to perform copper bus chain surface defect detection on the copper bus chain image to be processed based on the defect detection model.
[0011] According to another aspect of the present invention, there is provided a defect detection model building device, the device comprising:
[0012] A sample acquisition module, used to acquire a plurality of training samples; wherein the training samples include a copper bar chain sample image and a real defect mark corresponding to the copper bar chain sample image, and the real defect mark is used to characterize the defect state of the copper bar chain in the copper bar chain sample image;
[0013] A sample updating module is used for processing the copper bus chain sample images in the training samples according to the pre-trained feature extraction sub-model and feature dimension reduction sub-model for the plurality of training samples, obtaining the features to be processed corresponding to the training samples, and updating the copper bus chain sample images in the training samples based on the features to be processed; wherein the feature extraction sub-model is trained based on the fruit fly optimization algorithm of fuzzy feedback increment; and the feature dimension reduction sub-model is trained based on the feature adaptive refinement algorithm;
[0014] A loss value determination module, used to process the training sample based on a pre-built deep learning sub-model to obtain a third loss value; wherein the activation function included in the deep learning sub-model is a quantum state nonlinear activation function;
[0015] A model parameter correction module, used to correct the model parameters in the deep learning sub-model based on the third loss value, take the convergence of the third loss function in the deep learning sub-model as the training target, and use the trained deep learning sub-model as the classification sub-model;
[0016] The model building module is used to build a defect detection model based on the feature extraction sub-model, the feature dimension reduction sub-model and the classification sub-model, so as to perform copper bus chain surface defect detection on the copper bus chain image to be processed based on the defect detection model.
[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0018] at least one processor; and
[0019] a memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the defect detection model construction method described in any embodiment of the present invention.
[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the defect detection model construction method described in any embodiment of the present invention when executed.
[0022] The technical solution of the embodiment of the present invention is to obtain multiple training samples; wherein the training samples include copper bar chain sample images and real defect identifications corresponding to the copper bar chain sample images; further, for multiple training samples, the copper bar chain sample images in the training samples are processed in turn according to the pre-trained feature extraction sub-model and feature dimension reduction sub-model to obtain the features to be processed corresponding to the training samples, and the copper bar chain sample images in the training samples are updated based on the features to be processed, wherein the feature extraction sub-model is trained based on the fruit fly optimization algorithm of fuzzy feedback increment, and the feature dimension reduction sub-model is trained based on the feature adaptive refinement algorithm; further, the training samples are processed based on the pre-constructed deep learning sub-model to obtain a third loss value; further, based on the third loss value The model parameters in the deep learning sub-model are corrected, the convergence of the third loss function in the deep learning sub-model is used as the training goal, and the trained deep learning sub-model is used as the classification sub-model; further, a defect detection model is constructed based on the feature extraction sub-model, the feature dimensionality reduction sub-model and the classification sub-model, so that the copper bus chain surface defect detection is performed on the processed copper bus chain image based on the defect detection model, which solves the problem that a lot of manpower and time are consumed in the related technology, and the equipment status cannot be detected in real time. The defect detection model is obtained based on training samples and multiple algorithms to improve the model performance and generalization ability of the defect detection model, and then the effect of accurately detecting the copper bus chain defect category according to the defect detection model is achieved, thereby improving the efficiency and accuracy of copper bus chain defect detection.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 is a flow chart of a defect detection model building method provided according to Embodiment 1 of the present invention;
[0026] Figure 2 is a flow chart of a defect detection model building method provided according to Embodiment 2 of the present invention;
[0027] Figure 3 is a flow chart of a defect detection model construction method provided in accordance with Embodiment 3 of the present invention;
[0028] Figure 4 is a flow chart of a defect detection model building method provided according to a fourth embodiment of the present invention;
[0029] Figure 5 is a structural schematic diagram of a defect detection model building device provided according to Embodiment 5 of the present invention;
[0030] Figure 6 It is a structural schematic diagram of an electronic device for implementing the defect detection model building method of an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] Embodiment 1
[0034] Figure 1 This is a flow chart of a defect detection model construction method provided by the first embodiment of the present invention. This embodiment is applicable to the case of detecting the defect type of copper busbar chain. The method can be executed by a defect detection model construction device. The defect detection model construction device can be implemented in the form of hardware and / or software. The defect detection model construction device can be configured in a terminal and / or a server. Figure 1 As shown, the method includes:
[0035] S110, obtaining a plurality of training samples; wherein the training samples include a copper bus chain sample image and a real defect mark corresponding to the copper bus chain sample image.
[0036] Among them, the training sample can be sample data involved in training the defect detection model. The training sample includes a copper bus chain sample image and a real defect mark corresponding to the copper bus chain sample image. The copper bus chain sample image can be an image including the copper bus chain. Optionally, the copper bus chain sample image can be an image obtained by taking a camera; or, it can be an image reconstructed by an image reconstruction model; or, it can be an image pre-stored in a storage space, etc. The real defect mark can be used to characterize the defect state of the copper bus chain in the copper bus chain sample image. Optionally, the defect state includes a crack state, a wear state, and a normal state. In this embodiment, at least one defect state of the copper bus chain can be predetermined. Furthermore, a corresponding defect mark is set for each defect state, and each defect state is associated with the corresponding defect mark and stored.
[0037] In this embodiment, before training the defect detection model, multiple training samples can be constructed to train the model based on the training samples. In order to improve the accuracy of the model, as many and rich training samples as possible can be constructed. In order to construct the training samples, multiple copper bar chain sample images can be obtained. Further, for each copper bar chain sample image, the defect state of the copper bar chain in the copper bar chain sample image can be determined. Furthermore, the defect identification corresponding to the defect state can be determined according to the association relationship between the predetermined defect identification and the defect state. Further, the defect identification can be used as a real defect identification corresponding to the copper bar chain sample image, and the copper bar chain sample image can be identified and marked based on the real defect identification. Further, a training sample can be constructed based on the copper bar chain sample image and the real defect identification corresponding to the copper bar chain sample image to obtain multiple training samples.
[0038] S120. For multiple training samples, the copper bus chain sample images in the training samples are processed in turn according to the pre-trained feature extraction sub-model and the feature dimension reduction sub-model to obtain the features to be processed corresponding to the training samples, and the copper bus chain sample images in the training samples are updated based on the features to be processed.
[0039] Among them, the feature extraction submodel can be a neural network model that takes the image as an input object to extract features from the image. The feature extraction submodel can be a neural network model of any model structure, optionally, a convolutional neural network (CNN), a residual neural network (ResNet), etc. The feature extraction submodel is trained based on the fruit fly optimization algorithm of fuzzy feedback increment. It can be understood that the fruit fly optimization algorithm of fuzzy feedback increment is a hybrid optimization algorithm that combines fuzzy logic and fruit fly optimization algorithm. The fruit fly optimization algorithm is a bionic optimization algorithm based on the foraging behavior of fruit flies. By simulating the process of fruit flies using keen sense of smell and vision to hunt, the group of solution space is iteratively searched in real time. Fuzzy logic is an effective tool for processing imprecise and fuzzy information, and uncertainty is described and processed through fuzzy sets and fuzzy rules. The fruit fly optimization algorithm based on fuzzy feedback increment introduces a fuzzy feedback mechanism to dynamically adjust the search behavior and parameters of fruit flies on the basis of the fruit fly optimization algorithm.
[0040] Among them, the feature dimension reduction sub-model can be a neural network model connected to the feature extraction sub-model, which uses the features output by the feature extraction sub-model as input objects to perform dimension reduction processing on the features. The feature dimension reduction sub-model can be a neural network model of any model structure, and optionally, it is an auto-encoder neural network (Auto-encoder Neural Network). The feature dimension reduction sub-model is trained based on the feature adaptive refinement algorithm. It can be understood that the feature adaptive refinement algorithm is an algorithm that automatically adjusts and optimizes feature representation according to the special effects of the data and the requirements of the task to improve the performance and generalization ability of the model. The features to be processed can be the features obtained after the copper busbar chain sample image is processed by the feature extraction sub-model and the feature dimension reduction sub-model in sequence.
[0041] In this embodiment, the feature extraction submodel can be trained based on the copper bus chain sample image and the real defect identification corresponding to the copper bus chain sample image. The feature extraction submodel can be trained based on multiple acquired training samples; or, it can also be trained based on other training samples. It should be noted that in order to improve the feature extraction accuracy and efficiency of the trained feature extraction submodel, the feature extraction submodel can be a convolutional neural network that deploys a fuzzy feedback incremental fruit fly optimization algorithm.
[0042] In this embodiment, the feature dimension reduction sub-model can be trained based on the copper bus chain sample image and the real defect identification corresponding to the copper bus chain sample image. The feature dimension reduction sub-model can be trained based on multiple acquired training samples; or, it can also be trained based on other training samples. It should be noted that in order to reduce the data dimension while maintaining the integrity of the feature information, the feature dimension reduction sub-model can be an autoencoder neural network that deploys a feature adaptive refinement algorithm.
[0043] As an optional implementation of this embodiment, a feature extraction submodel and a feature dimensionality reduction submodel can be pre-trained based on multiple training samples, and the feature extraction submodel and the feature dimensionality reduction submodel can be connected to use the output of the feature extraction submodel as the input of the feature dimensionality reduction submodel. Further, for multiple training samples, the copper bar chain sample image in the training sample can be input into the feature extraction submodel, so as to extract features of the copper bar chain sample image based on the feature extraction submodel, and obtain the features to be applied corresponding to the copper bar chain sample image. Further, the features to be applied can be input into the feature dimensionality reduction submodel, so as to reduce the dimensionality of the features to be applied based on the feature dimensionality reduction submodel, and use the features output by the feature dimensionality reduction submodel as the features to be processed corresponding to the training sample. Further, the copper bar chain sample image in the training sample can be updated based on the features to be processed, so that the updated training sample includes the features to be processed and their corresponding real defect identifications.
[0044] S130: Process the training sample based on the pre-built deep learning sub-model to obtain a third loss value.
[0045] The deep learning sub-model may be a neural network model whose model parameters are default values or initial values. The activation function included in the deep learning sub-model is a quantum state nonlinear activation function. The third loss value may be a value representing the degree of difference between the predicted output and the actual output.
[0046] In this embodiment, after obtaining multiple training samples, for multiple training samples, the features to be processed in the training samples can be input into a pre-built deep learning sub-model, so as to process the features to be processed based on the deep learning sub-model, and obtain a network output corresponding to the training samples, and the network output is a linear output of the network layer. Further, the network output can be processed based on the quantum state nonlinear activation function deployed in the deep learning sub-model to obtain a model output corresponding to the training samples. Further, the model output can be compared with the real defect identification in the training sample to determine the loss value, and the loss value is used as the third loss value.
[0047] It should be noted that by training the classification sub-model through the quantum state nonlinear activation function, the sensitivity of the classification model to tiny feature changes is improved, the model's ability to handle highly nonlinear problems is enhanced, and thus the model classification accuracy is improved.
[0048] Exemplarily, the process of processing the network output based on the quantum state nonlinear activation function to obtain the model output can be determined based on the following formula:
[0049]
[0050] Among them, Y u Represents the model output; Z u Indicates network output; |Z u | represents the plural Z u The model; i * Represents an imaginary unit; arg(Z u ) represents the complex number Z u Phase; Z u * Represents Z u The complex conjugate of .
[0051] Furthermore, the third loss value can be determined based on the following formula:
[0052]
[0053] Among them, Js(W u ,X u ,y u) represents the third loss value; y u represents the true identification vector corresponding to the true defect identification; u,k represents the true identification vector of the k-th defect category; K represents the number of defect categories corresponding to the true defect identification; Y u,k represents the model output of the k-th defect category; Im(Y u,k ) indicates Y u,k The imaginary part of .
[0054] S140. Modify the model parameters in the deep learning sub-model based on the third loss value, take the convergence of the third loss function in the deep learning sub-model as the training goal, and use the trained deep learning sub-model as the classification sub-model.
[0055] The third loss function may be a function determined based on the loss value and used to characterize the degree of difference between the predicted output and the actual output. The third loss function may be any loss function. The classification sub-model may be a neural network model that takes image features as input objects and performs classification based on image features. The classification sub-model may be a neural network model of any model structure, and may optionally be a classifier.
[0056] In this embodiment, the model parameters in the deep learning sub-model can be corrected according to the third loss value. Afterwards, the training error of the third loss function in the deep learning sub-model, that is, the loss parameter, can be used as a condition for detecting whether the current third loss function has reached convergence, for example, whether the training error is less than the preset error or whether the error change trend tends to be stable, or whether the current number of model iterations is equal to the preset number of times. If the detection reaches the convergence condition, for example, the training error of the third loss function is less than the preset error or the error change tends to be stable, it indicates that the training of the deep learning sub-model is completed, and the iterative training can be stopped at this time. If it is detected that the convergence condition is not reached at present, other training samples can be further obtained to train the deep learning sub-model until the training error of the loss function is within the preset range. When the training error of the loss function reaches convergence, the trained deep learning sub-model can be obtained, and the trained deep learning sub-model is used as a classification sub-model. S150, a defect detection model is constructed based on the feature extraction sub-model, the feature dimensionality reduction sub-model and the classification sub-model to perform copper bus chain surface defect detection on the copper bus chain image to be processed based on the defect detection model.
[0057] The defect detection model may be a neural network model that takes the copper bus chain image as an input object to detect and identify the defect state of the copper bus chain in the copper bus chain image.
[0058] In this embodiment, after obtaining the classification sub-model, the feature extraction sub-model, the feature dimensionality reduction sub-model and the classification sub-model can be spliced in sequence, so that the model output of the feature extraction sub-model is used as the model input of the feature dimensionality reduction sub-model, and the model output of the feature dimensionality reduction sub-model is used as the model input of the classification sub-model, and the model obtained after splicing is used as the defect detection model. Further, when the defect detection model is obtained, the image of the copper bus chain to be processed can be obtained, and the image of the copper bus chain to be processed can be input into the defect detection model, so that the image of the copper bus chain to be processed is processed in sequence based on the feature extraction sub-model, the feature dimensionality reduction sub-model and the classification sub-model in the defect detection model, and the defect category corresponding to the image of the copper bus chain to be processed is obtained.
[0059] The technical solution provided in this embodiment is to obtain multiple training samples; wherein the training samples include copper bar chain sample images and real defect identifications corresponding to the copper bar chain sample images; further, for multiple training samples, the copper bar chain sample images in the training samples are processed in turn according to the pre-trained feature extraction sub-model and feature dimension reduction sub-model to obtain the features to be processed corresponding to the training samples, and the copper bar chain sample images in the training samples are updated based on the features to be processed, wherein the feature extraction sub-model is trained based on the fruit fly optimization algorithm of fuzzy feedback increment, and the feature dimension reduction sub-model is trained based on the feature adaptive refinement algorithm; further, the training samples are processed based on the pre-constructed deep learning sub-model to obtain a third loss value; further, based on the third loss value The model parameters in the deep learning sub-model are corrected, the convergence of the third loss function in the deep learning sub-model is used as the training goal, and the trained deep learning sub-model is used as the classification sub-model; further, a defect detection model is constructed based on the feature extraction sub-model, the feature dimensionality reduction sub-model and the classification sub-model, so that the copper bus chain surface defect detection is performed on the processed copper bus chain image based on the defect detection model, which solves the problem that a lot of manpower and time are consumed in the related technology, and the equipment status cannot be detected in real time. The defect detection model is obtained based on training samples and multiple algorithms to improve the model performance and generalization ability of the defect detection model, and then the effect of accurately detecting the copper bus chain defect category according to the defect detection model is achieved, thereby improving the efficiency and accuracy of copper bus chain defect detection.
[0060] Embodiment 2
[0061] Figure 2 This is a flow chart of a defect detection model construction method provided by the second embodiment of the present invention. Based on the previous embodiment, before applying the feature extraction sub-model provided by this embodiment, a feature extraction sub-model can be obtained by training based on training samples. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or similar to the above embodiments are not repeated here.
[0062] like Figure 2 As shown, the method includes:
[0063] S210, obtaining a plurality of training samples; wherein the training samples include a copper bus chain sample image and a real defect mark corresponding to the copper bus chain sample image.
[0064] S220: Determine a training sample set corresponding to multiple iterations according to multiple training samples.
[0065] The training sample set includes at least one training sample.
[0066] The iterative process may be a process of training the model once using a batch of data in the training samples during the model training process. The model training process may include multiple iterative processes, and in each iteration, the model performs a forward propagation and a backward propagation based on the current batch of sample data, and updates the weight parameters of the model by calculating the loss function. The training sample set corresponding to the iterative process may be the training sample data applied to the corresponding model iterative process.
[0067] As an optional implementation of this embodiment, after obtaining multiple training samples, the multiple training samples can be divided into multiple training sample sets, each of which can include at least one training sample. Furthermore, the multiple training sample sets can be used as training sample sets corresponding to multiple iterations, so as to perform multiple iterations of training on the model based on the multiple training sample sets.
[0068] S230. For multiple iterations, the copper bus chain sample images in the training sample set corresponding to the current iteration are input into a pre-built convolutional neural network to obtain a model output feature set corresponding to the current iteration, and the model output feature set is processed based on a preset normalization function to obtain a model output label set corresponding to the current iteration.
[0069] The model output feature set may include model output features corresponding to the copper busbar chain sample images in the training samples. The normalization function may be any function, and optionally, a Softmax function. The model output label set includes a model output label corresponding to at least one of the training samples.
[0070] As an optional implementation of this embodiment, for multiple iterations, the copper bar chain sample images in the training sample set corresponding to the current iteration process can be input into a pre-constructed convolutional neural network, so as to perform feature extraction on each copper bar chain sample image in the training sample set based on the convolutional neural network, and output model output features corresponding to each copper bar chain sample image. Furthermore, a model output feature set corresponding to the current iteration process can be constructed based on the model output features corresponding to each copper bar chain sample image. Furthermore, at least one model output feature in the model output feature set can be processed according to a preset normalization function, and a model output label corresponding to each model output feature can be obtained, and a model output label set corresponding to the current iteration process can be constructed based on each model output label.
[0071] S240. Determine the search step corresponding to the current iteration process based on the model output label set corresponding to the current iteration process and the real defect identification in the training sample set, and perform loss processing on the model output label set and the real defect identification in the training sample set according to a preset first loss function to obtain a first loss value corresponding to the current iteration process.
[0072] The search step size may be the amplitude of the parameter or variable change in each iteration or search. The first loss function may be a function determined based on the loss value and used to characterize the degree of difference between the predicted output and the actual output. The first loss function may be an arbitrary loss function.
[0073] In practical applications, when extracting features from images based on convolutional neural networks, traditional feature extraction algorithms are usually used to extract features from images to obtain extracted features. However, traditional feature extraction algorithms are difficult to achieve high accuracy in complex environments, and the feature extraction effect is poor.
[0074] In view of the above situation, in this embodiment, a convolutional neural network deploying a fuzzy feedback incremental fruit fly optimization algorithm is used to extract copper bus chain image features. The training process of the feature extraction sub-model uses an algorithm based on fuzzy feedback incremental fruit fly optimization to optimize parameters, improves the fruit fly optimization algorithm, and uses a fuzzy logic controller to dynamically adjust the search strategy. The search range and direction are adaptively adjusted according to the results of the previous iteration, thereby enhancing the learning ability of the deep network and the depth of feature extraction.
[0075] Based on this, in the process of training to obtain the feature extraction sub-model, the search step size can be determined, so as to modify the model parameters of the convolutional neural network to be trained based on the search step size to obtain the feature extraction sub-model.
[0076] Optionally, the search step corresponding to the current iterative process is determined based on the model output label set corresponding to the current iterative process and the real defect identification in the training sample set, including: determining the relative error corresponding to the current iterative process based on the model output label set corresponding to the current iterative process and the real defect identification in the training sample set; obtaining the error change corresponding to the previous iterative process, and determining the first fuzzy control parameter and the second fuzzy control parameter corresponding to the current iterative process based on the error change corresponding to the previous iterative process; determining the search step corresponding to the current iterative process based on the relative error, the first fuzzy control parameter and the second fuzzy control parameter corresponding to the current iterative process.
[0077] Among them, the relative error can be used to characterize the degree of difference between the model output label and the actual defect identification. The first fuzzy control parameter can be understood as the first parameter of the fuzzy controller. The second fuzzy control parameter can be understood as the second parameter of the fuzzy controller. It can be understood that the search strategy can be dynamically adjusted by adjusting the first parameter and the second parameter in the fuzzy controller. The error change can be used to characterize the degree of difference between the relative errors corresponding to two adjacent iterative processes. The error change corresponding to the previous iterative process is determined based on the relative error corresponding to the previous iterative process and the relative error corresponding to the previous iterative process of the previous iterative process.
[0078] As an optional implementation of this embodiment, the absolute value of the difference between the model output label and the true defect mark can be determined. Further, the ratio between the absolute value of the difference and the true defect mark can be determined, and the ratio is used as the relative error.
[0079] Exemplarily, the relative error can be determined based on the following formula:
[0080]
[0081] Among them, e p Represents relative error; f(W p ,X p ) represents the model output label; y p Indicates the true defect identification.
[0082] Further, the error variation corresponding to the last iteration process can be obtained, and further, the product between the error variation and the preset first adjustment parameter can be determined, and the product is added to the preset value. Further, the first fuzzy control parameter corresponding to the last iteration process can be obtained, and the added value is multiplied with the first fuzzy control parameter corresponding to the last iteration process, and the multiplied value is used as the first fuzzy control parameter corresponding to the current iteration process. And, the product between the error variation corresponding to the last iteration process and the preset second adjustment parameter can be determined, and the difference between the preset value and the product can be determined. Further, the second fuzzy control parameter corresponding to the last iteration process can be obtained, and the product between the difference and the second fuzzy control parameter corresponding to the last iteration process can be determined, and the product is used as the second fuzzy control parameter corresponding to the current iteration process. The preset first adjustment parameter can be a learning adjustment factor. Optionally, the preset first adjustment parameter can be 2. The preset value can be any value, and optionally, it is 1. The preset second adjustment parameter can be a learning adjustment factor. Optionally, the preset second adjustment parameter can be 3.
[0083] Exemplarily, the error variation can be determined based on the following formula:
[0084]
[0085] in, Represents the error change corresponding to the t-1th iteration process; Represents the relative error corresponding to the t-2th iteration process; Represents the relative error corresponding to the t-1th iteration process.
[0086] The first fuzzy control parameter can be determined based on the following formula:
[0087]
[0088] in, represents the first fuzzy control parameter corresponding to the t-th iteration process; represents the first fuzzy control parameter corresponding to the t-1th iteration process; κ p Indicates the preset first adjustment parameter; Represents the error change corresponding to the t-1th iteration process.
[0089] The second fuzzy control parameter can be determined based on the following formula:
[0090]
[0091] in, represents the second fuzzy control parameter corresponding to the t-th iteration process; represents the second fuzzy control parameter corresponding to the t-1th iteration process; ξ p Indicates the preset second adjustment parameter; Represents the error change corresponding to the t-1th iteration process.
[0092] Furthermore, after determining the relative error, the first fuzzy control parameter and the second fuzzy control parameter corresponding to the current iterative process, the relative error and the second fuzzy control parameter can be exponentially processed, and the product between the obtained value and the first fuzzy control parameter can be determined, and the obtained product is used as the search step corresponding to the current iterative process.
[0093] Exemplarily, the search step size may be determined based on the following formula:
[0094]
[0095] in, Indicates the search step size corresponding to the t-th iteration process; represents the first fuzzy control parameter corresponding to the t-th iteration process; represents the second fuzzy control parameter corresponding to the t-th iteration process; Represents the relative error corresponding to the tth iteration process.
[0096] In this embodiment, when determining the search step corresponding to the current iteration process, the model output labels in the model output label set and the real defect identifications in the training sample set can also be processed according to a preset first loss function to obtain a first loss value corresponding to the current iteration process.
[0097] Optionally, loss processing is performed on the model output label set and the real defect identification in the training sample set according to a preset first loss function to obtain a first loss value corresponding to the current iterative process, including: determining the norm regularization term according to the weight matrix corresponding to each layer of the network in the convolutional neural network; determining the first loss value corresponding to the current iterative process according to the model output label set, the real defect identification in the training sample set, the preset regularization coefficient and the norm regularization term.
[0098] Among them, the weight matrix can be a set of weights of the convolution kernels in the convolution layer. It can be understood that the weight is a key parameter for feature extraction in the convolutional neural network, which can be gradually optimized through learning during the network training process to better capture the features in the input data. The norm regularization term is a regularization technique commonly used in machine learning and deep learning. It constrains the complexity of the model by limiting the norm of the model parameters, thereby preventing overfitting. The norm regularization term refers to adding a term related to the norm of the model parameters to the loss function. The norm regularization term penalizes the scale of the model parameters so that the norm of the model parameters will not be too large during the optimization process. Thereby constraining the complexity of the model and reducing the risk of overfitting. The preset regularization coefficient can be used to balance the norm regularization term. The preset regularization coefficient can be any value, optionally, 0.3, 0.4 or 0.5, etc.
[0099] As an optional implementation of the first embodiment of the present invention, the weight matrix corresponding to each layer of the network in the convolutional neural network can be obtained. Further, the norm of each weight matrix can be determined separately, and each norm can be summed, and the obtained norm sum can be used as the norm regularization term. Further, the first loss value to be superimposed can be determined based on the model output label set and the real defect identification in the training sample set, and the product between the norm regularization term and the preset regularization coefficient can be determined, and the product can be used as the second loss value to be superimposed. Further, the first loss value to be superimposed and the second loss value to be superimposed can be added to obtain the first loss value.
[0100] Exemplarily, the norm regularization term can be determined based on the following formula:
[0101]
[0102] Among them, R(W p ) represents the norm regularization term; represents the weight matrix of the lth layer; Represents the norm of the weight matrix of the lth layer; LF represents the number of network layers of the convolutional neural network.
[0103] The first loss value can be determined based on the following formula:
[0104]
[0105] Among them, J(W p ,X p ,y p ) represents the first loss value; represents the true defect identification of the i-th training sample; represents the model output label of the i-th training sample; λ reg represents the preset regularization coefficient, preferably, it can be 0.3; R(W p ) represents the norm regularization term.
[0106] S250, modifying the model parameters of the convolutional neural network according to the search step size and the first loss value, taking the convergence of the first loss function in the convolutional neural network as a training goal, and taking the trained convolutional neural network as a feature extraction sub-model.
[0107] In this embodiment, after obtaining the search step and the first loss value corresponding to the current iteration process, the model parameters of the convolutional neural network in the current iteration process can be corrected based on the search step and the first loss value to obtain the model parameters of the convolutional neural network in the next iteration process. Further, after multiple iterations, when it is detected that the first loss function in the convolutional neural network converges, it can be determined that the convolutional neural network training is completed, and the trained convolutional neural network is used as a feature extraction submodel.
[0108] As an optional implementation of this embodiment, the search position of the current iteration process can be updated according to the search step size to update the search range and direction and obtain the search position of the next iteration process. Further, the weights and biases in the convolutional neural network can be corrected according to the first loss value to obtain the weights and biases corresponding to the next iteration process.
[0109] Exemplarily, the iteration position can be determined based on the following formula:
[0110]
[0111] in, Indicates the search position of the t+1th iteration process; Represents the search position of the tth iteration process; represents the search step size of the tth iteration process; randn(D) represents a random number.
[0112] The update process of weights and biases can be expressed based on the following formula:
[0113]
[0114] in, Represents the weight of the t+1th iteration process; represents the weight of the t-th iteration process; η cf represents the learning rate; Represents the first loss function with respect to parameter W p The gradient of Represents the bias of the t+1th iteration process; Represents the bias of the t-th iteration process; Represents the first loss function with respect to parameter b p gradient.
[0115] S260. For multiple training samples, the copper bus chain sample images in the training samples are processed in turn according to the pre-trained feature extraction sub-model and the feature dimension reduction sub-model to obtain the features to be processed corresponding to the training samples, and the copper bus chain sample images in the training samples are updated based on the features to be processed.
[0116] S270: Process the training sample based on the pre-built deep learning sub-model to obtain a third loss value.
[0117] S280. Modify the model parameters in the deep learning sub-model based on the third loss value, take the convergence of the third loss function in the deep learning sub-model as the training goal, and use the trained deep learning sub-model as the classification sub-model.
[0118] S290, constructing a defect detection model based on the feature extraction sub-model, the feature dimension reduction sub-model and the classification sub-model, so as to perform copper bus chain surface defect detection on the copper bus chain image to be processed based on the defect detection model.
[0119] The technical solution of the embodiment of the present invention is to obtain multiple training samples, determine the training sample set corresponding to the multiple iterative processes according to the multiple training samples, input the copper bus chain sample image in the training sample set corresponding to the current iterative process into a pre-constructed convolutional neural network for the multiple iterative processes, obtain the model output feature set corresponding to the current iterative process, and process the model output feature set based on a preset normalization function to obtain the model output label set corresponding to the current iterative process, wherein the model output label set includes the model output label corresponding to at least one training sample; further, determine the model output label set corresponding to the current iterative process according to the model output label set corresponding to the current iterative process and the real defect identification in the training sample set. A corresponding search step is calculated, and loss processing is performed on the model output label set and the real defect identification in the training sample set according to a preset first loss function to obtain a first loss value corresponding to the current iterative process; further, the model parameters of the convolutional neural network are corrected according to the search step and the first loss value, and the convergence of the first loss function in the convolutional neural network is used as the training goal. The trained convolutional neural network is used as the feature extraction sub-model, and the convolutional neural network is trained based on the fuzzy feedback incremental fruit fly optimization algorithm to obtain the effect of the feature extraction sub-model. By dynamically adjusting the search strategy optimization parameters, the learning ability of the deep network and the depth of feature extraction are enhanced, thereby improving the accuracy and efficiency of feature extraction.
[0120] Embodiment 3
[0121] Figure 3This is a defect detection model construction method provided by the third embodiment of the present invention. Based on the above embodiments, before applying the feature dimension reduction sub-model provided by this embodiment, a feature dimension reduction sub-model can be obtained by training based on training samples. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or similar to the above embodiments are not repeated here.
[0122] like Figure 2 As shown, the method includes:
[0123] S310, obtaining a plurality of training samples; wherein the training samples include a copper bus chain sample image and a real defect mark corresponding to the copper bus chain sample image.
[0124] S320, respectively extracting features from the copper bus chain sample images in the multiple training samples according to the feature extraction sub-model to obtain the features to be applied corresponding to the multiple copper bus chain sample images, adding the features to be applied to the training samples, and determining a training sample set corresponding to the multiple iteration processes according to the multiple training samples, wherein the training sample set includes at least one training sample, and the training sample includes the copper bus chain sample image, the features to be applied corresponding to the copper bus chain sample image, and a real defect identifier.
[0125] The feature to be applied may be a feature obtained by inputting the copper bus chain sample image into the feature extraction model to extract features from the copper bus chain sample image based on the feature extraction sub-model.
[0126] In this embodiment, after obtaining a plurality of training samples, for the plurality of training samples, the copper bar chain sample images in the training samples can be input into the feature extraction sub-model, so as to perform feature extraction on the copper bar chain sample images based on the feature extraction sub-model, and output the features to be applied. Further, the features to be applied can be added to the training samples, so that the training samples include the copper bar chain sample images, the features to be applied corresponding to the copper bar chain sample images, and the real defect identification. Further, the plurality of training samples are divided into a plurality of training sample sets, each of which can include at least one training sample. Furthermore, the plurality of training sample sets can be used as training sample sets corresponding to the multiple iteration processes, so as to perform multiple iteration training on the model based on the plurality of training sample sets.
[0127] S330, for multiple iterations, input the features to be applied in the training sample set corresponding to the current iteration into the autoencoder neural network to obtain a reduced dimension feature set and a reconstructed output feature set corresponding to the current iteration.
[0128] The autoencoder neural network includes an encoder and a decoder. The autoencoder neural network may be a neural network model whose model parameters are default values or initial values. The dimension reduction feature set may include at least one dimension reduction feature, and the dimension reduction feature may be a feature obtained after the feature to be applied is reduced in dimension. The reconstructed output feature set may include at least one reconstructed output feature, and the reconstructed output feature may be a feature output after the dimension reduction feature is reconstructed.
[0129] In this embodiment, for multiple iterations, at least one feature to be applied in the training sample set corresponding to the current iteration can be input into the autoencoder neural network, so as to process the at least one feature to be applied based on the encoder and decoder included in the autoencoder neural network to obtain at least one reduced dimension feature and at least one reconstructed output feature. Furthermore, a reduced dimension feature set can be determined based on the at least one reduced dimension feature, and a reconstructed output feature set can be determined based on the at least one reconstructed output feature.
[0130] Optionally, the features to be applied in the training sample set corresponding to the current iterative process are input into the autoencoder neural network to obtain a reduced dimension feature set and a reconstructed output feature set corresponding to the current iterative process, including: inputting at least one feature to be applied in the training sample set into the autoencoder neural network to perform feature dimension reduction on at least one feature to be applied based on the encoder in the autoencoder neural network to obtain at least one reduced dimension feature; determining a reduced dimension feature set based on at least one reduced dimension feature; and, inputting at least one reduced dimension feature into the decoder of the autoencoder neural network to obtain at least one reconstructed output feature corresponding to the feature to be applied, and determining a reconstructed output feature set based on at least one reconstructed output feature.
[0131] The role of the encoder is to convert the input data into an internal representation (usually called a hidden representation or encoding). This conversion aims to capture the key features of the input data while minimizing the dimension and redundancy of the data. It should be noted that the feature dimension after conversion is smaller than the feature dimension of the input data. The role of the decoder is to convert the encoded features back to the original input data. The decoder can be used to learn how to recover the structure and content of the original data from the compressed representation.
[0132] As an optional implementation of this embodiment, for at least one training sample in the training sample set corresponding to the current iteration process, the feature to be applied in the training sample can be input into the autoencoder neural network, so as to perform feature dimensionality reduction on the feature to be applied based on the encoder in the autoencoder neural network, and output the reduced dimensionality feature corresponding to the feature to be applied. Then, at least one reduced dimensionality feature can be obtained. Furthermore, a reduced dimensionality feature set can be constructed based on at least one reduced dimensionality feature, and at least one reduced dimensionality feature can be input into the decoder of the autoencoder neural network, so as to perform feature reconstruction on at least one reduced dimensionality feature based on the decoder, and obtain at least one reconstructed output feature. Furthermore, a reconstructed output feature set can be constructed based on at least one reconstructed output feature.
[0133] S340. Perform loss processing on the features to be applied in the training sample set, the reconstructed output feature set and the encoder weight parameters according to a preset second loss function to obtain a second loss value corresponding to the current iterative process, and determine the weight update amount corresponding to the current iterative process according to the second loss value, the reduced dimension feature set, the reconstructed output feature set, the encoder weight parameters and the first learning rate.
[0134] The second loss function may be a function determined based on the loss value and used to characterize the degree of difference between the predicted output and the actual output. The second loss function may be any loss function, and optionally, a mean square error loss function. The encoder weight parameter may be a model parameter of the encoder in the autoencoder neural network.
[0135] As an optional implementation of this embodiment, the difference between the feature to be applied and the reconstructed output feature set can be determined, and the square of the norm of the difference can be determined to obtain the first value to be superimposed. Further, the norm of the encoder weight parameter can be determined, and the product between the norm and the regularization coefficient can be determined, and the product can be used as the second value to be superimposed. Further, the first value to be superimposed and the second value to be superimposed can be added, and the value obtained after the addition is used as the second loss value.
[0136] Exemplarily, the second loss value may be determined based on the following formula:
[0137]
[0138] Among them, L r represents the second loss value; X r Indicates the features to be applied; represents the reconstructed output feature in the reconstructed output feature set; ‖‖ represents the L2 norm; α r represents the regularization coefficient, preferably, α r Set to 0.3; Represents the encoder weight parameter; ∥∥1 represents the L1 norm.
[0139] In this embodiment, after obtaining the second loss value, the weight update amount corresponding to the current iteration process can be determined based on the second loss value, the dimensionality reduction feature set, the reconstructed output feature set, the encoder weight parameter and the first learning rate.
[0140] Optionally, the weight update amount corresponding to the current iterative process is determined according to the second loss value, the reduced dimensionality feature set, the reconstructed output feature set, the encoder weight parameters and the first learning rate, including: performing partial derivative processing on the second loss value, the reduced dimensionality feature set, the reconstructed output feature set and the encoder weight parameters to obtain the loss weight gradient; performing hyperbolic tangent function processing on the loss weight gradient to obtain the parameters to be processed, and multiplying the parameters to be processed by the first learning rate to obtain the weight update amount corresponding to the current iterative process.
[0141] The loss weight gradient may be the gradient of the second loss function with respect to the weight.
[0142] As an optional implementation of the first embodiment of this invention, the second loss value, the dimension reduction features in the dimension reduction feature set, the reconstructed output features in the reconstructed output feature set, and the encoder weight parameters can be subjected to partial derivative processing, and the value obtained after partial derivative processing is used as the loss weight gradient. Further, the product between the loss weight gradient and the preset adjustment factor can be determined, and the product can be subjected to hyperbolic tangent function processing, and the value output after the function processing is used as the parameter to be processed. Further, the parameter to be processed can be multiplied by the first learning rate, and the obtained product can be used as the weight update amount corresponding to the current iteration process.
[0143] Exemplarily, the loss weight gradient can be determined based on the following formula:
[0144]
[0145] in, represents the loss weight gradient; Represents the partial derivative of the second loss value with respect to the reconstructed output feature; Represents the partial derivative of the reconstructed output feature with respect to the dimensionality reduction feature; Represents the partial derivative of the reduced dimension feature with respect to the encoder weight parameter.
[0146] The weight update amount can be determined based on the following formula:
[0147]
[0148] Where, ΔW r represents the weight update amount; λ r represents the first learning rate, preferably, λ r Set to 0.01; tanh() represents the hyperbolic tangent function; γ r represents a preset adjustment factor, preferably, γr Set to 3.14; represents the loss weight gradient.
[0149] S350, modifying the model parameters of the autoencoder neural network according to the weight update amount, the second loss value, and the second learning rate corresponding to the current iteration process, taking the convergence of the second loss function in the autoencoder neural network as the training goal, and taking the trained autoencoder neural network as the feature dimensionality reduction sub-model.
[0150] In this embodiment, the second learning rate corresponding to the current iterative process can be determined based on the second learning rate corresponding to the previous iterative process. Further, when determining the second learning rate corresponding to the current iterative process, the gradient descent method can be used to correct the weight parameters and bias parameters of the autoencoder neural network according to the weight update amount, the second loss value and the second learning rate to obtain the weight parameters and bias parameters corresponding to the next iterative process. Further, after multiple iterations, when it is detected that the second loss function in the autoencoder neural network converges, it can be determined that the training of the autoencoder neural network is completed, and the trained autoencoder neural network is used as a feature reduction sub-model.
[0151] Exemplarily, the second learning rate corresponding to the current iteration process can be determined based on the following formula:
[0152]
[0153] in, Represents the second learning rate corresponding to the t-th iteration process; represents the second learning rate corresponding to the t-1th iteration process; δ r Represents the sensitivity parameter for adjusting the learning rate, preferably, δ r Set to 0.5; represents the loss weight gradient.
[0154] The correction process of weight parameters and bias parameters can be expressed based on the following formula:
[0155]
[0156]
[0157] in, Represents the weight parameter corresponding to the t+1th iteration process; Represents the weight parameter corresponding to the tth iteration process; Represents the second learning rate corresponding to the t-th iteration process; Represents the partial derivative of the second loss value with respect to the weight parameter; ΔW r represents the weight update amount; Represents the bias parameter corresponding to the t+1th iteration process; Represents the bias parameter corresponding to the tth iteration process; Represents the partial derivative of the second loss value with respect to the bias parameter.
[0158] S360, for multiple training samples, process the copper bus chain sample images in the training samples according to the pre-trained feature extraction sub-model and feature dimension reduction sub-model in turn to obtain the features to be processed corresponding to the training samples, and update the copper bus chain sample images in the training samples based on the features to be processed.
[0159] S370: Process the training sample based on the pre-built deep learning sub-model to obtain a third loss value.
[0160] S380. Modify the model parameters in the deep learning sub-model based on the third loss value, take the convergence of the third loss function in the deep learning sub-model as the training goal, and use the trained deep learning sub-model as the classification sub-model.
[0161] S390, constructing a defect detection model based on the feature extraction sub-model, the feature dimension reduction sub-model and the classification sub-model, so as to perform copper bus chain surface defect detection on the copper bus chain image to be processed based on the defect detection model.
[0162] The technical solution of the embodiment of the present invention is to extract features of copper bus chain sample images in multiple training samples according to feature extraction sub-models after obtaining multiple training samples, obtain features to be applied corresponding to multiple copper bus chain sample images, add the features to be applied to the training samples, and determine training sample sets corresponding to multiple iterations according to the multiple training samples, wherein the training sample set includes at least one training sample, and the training sample includes the copper bus chain sample image, the features to be applied corresponding to the copper bus chain sample image, and the real defect identification; further, for multiple iterations, the features to be applied in the training sample set corresponding to the current iteration process are input into the autoencoder neural network to obtain the reduced dimension feature set and the reconstructed output feature set corresponding to the current iteration process; further, according to a preset second loss function, the features to be applied in the training sample set, the reconstructed output feature set, and the encoder weights are The parameters are processed by loss to obtain a second loss value corresponding to the current iterative process, and the weight update amount corresponding to the current iterative process is determined according to the second loss value, the dimensionality reduction feature set, the reconstructed output feature set, the encoder weight parameter and the first learning rate; further, the model parameters of the autoencoder neural network are corrected according to the weight update amount, the second loss value and the second learning rate corresponding to the current iterative process, and the convergence of the second loss function in the autoencoder neural network is used as the training goal, and the trained autoencoder neural network is used as the feature dimensionality reduction sub-model, so as to achieve the effect of training the autoencoder neural network based on the feature adaptive refinement algorithm to obtain the feature dimensionality reduction sub-model, so as to achieve the effect of more finely capturing and reconstructing the intrinsic correlation and structural characteristics in the input data, optimizing the information flow of the network, and further, achieving the effect of reducing the data dimension while maintaining the integrity of the feature information.
[0163] Embodiment 4
[0164] Figure 4 A defect detection model construction method provided by the fourth embodiment of the present invention is provided. On the basis of the above-mentioned embodiment, after the defect detection model is obtained, the copper bar chain image to be processed can be processed based on the defect detection model to determine the defect state corresponding to the copper bar chain image to be processed. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or similar to the above-mentioned embodiments are not repeated here.
[0165] like Figure 4 As shown, the method includes:
[0166] S410, obtaining a plurality of training samples; wherein the training samples include a copper bus chain sample image and a real defect mark corresponding to the copper bus chain sample image.
[0167] S420, for multiple training samples, process the copper bus chain sample images in the training samples according to the pre-trained feature extraction sub-model and feature dimension reduction sub-model in turn to obtain the features to be processed corresponding to the training samples, and update the copper bus chain sample images in the training samples based on the features to be processed.
[0168] S430: Process the training sample based on the pre-built deep learning sub-model to obtain a third loss value.
[0169] S440. Modify the model parameters in the deep learning sub-model based on the third loss value, take the convergence of the third loss function in the deep learning sub-model as the training goal, and use the trained deep learning sub-model as the classification sub-model.
[0170] S450, constructing a defect detection model based on the feature extraction sub-model, the feature dimension reduction sub-model and the classification sub-model, so as to perform copper bus chain surface defect detection on the copper bus chain image to be processed based on the defect detection model.
[0171] S460, obtaining an image of the copper bus chain to be processed; wherein the image of the copper bus chain to be processed includes the copper bus chain to be tested.
[0172] The copper chain bus image to be processed may be an image to be processed and includes a copper chain bus. The copper chain bus image to be processed may include a copper chain bus, and the copper chain bus included in the copper chain bus image to be processed may be used as a copper chain bus to be tested. The copper chain bus to be tested may be a copper chain bus to be tested for defects. Optionally, the copper chain bus image to be processed may be an image obtained by real-time shooting based on a camera device; or, it may be a pre-stored image retrieved from a target storage space in response to a user's trigger operation; or, it may be an image uploaded from an external device. The camera device may be any device capable of acquiring images, and may optionally be a high-resolution industrial camera.
[0173] As an optional implementation of this embodiment, the copper bus bar to be tested may be determined. Further, a device may be set to capture an image of the copper bus bar to be tested, and the captured image may be used as the copper bus bar image to be processed.
[0174] S470 processes the copper bus bar image to be processed based on the pre-trained defect detection model to determine the defect category of the copper bus bar to be tested.
[0175] The defect detection model includes a feature extraction sub-model, a feature dimension reduction sub-model and a classification sub-model. The defect category includes at least one of a crack state, a wear state and a normal state.
[0176] In this embodiment, after obtaining the image of the copper bus chain to be processed, the image of the copper bus chain to be processed can be input into a pre-trained defect detection model. Further, feature extraction can be performed on the image of the copper bus chain to be processed based on the feature extraction sub-model to obtain a first feature. Afterwards, the first feature can be input into the feature dimension reduction sub-model to process the first feature based on the feature dimension reduction sub-model to obtain a second feature. Further, the second feature can be input into the classification sub-model to process the second feature based on the classification sub-model, and obtain a defect identification corresponding to the copper bus chain to be tested. Further, the defect category corresponding to the defect identification can be determined based on the association relationship between the pre-established defect identification and the defect category, and the defect category can be used as the defect category corresponding to the copper bus chain to be tested.
[0177] The technical solution of the embodiment of the present invention is to obtain an image of a copper bus chain to be processed; wherein the image of the copper bus chain to be processed includes a copper bus chain to be tested; further, the image of the copper bus chain to be processed is processed based on a pre-trained defect detection model to determine the defect category of the copper bus chain to be tested, thereby achieving the effect of accurately detecting the defect category of the copper bus chain according to the defect detection model, and improving the efficiency and accuracy of copper bus chain defect detection.
[0178] Embodiment 5
[0179] Figure 5 Schematic diagram of a defect detection model building device provided by Embodiment 5 of the present invention. Figure 5 As shown, the device includes: a sample acquisition module 510, a sample update module 520, a loss value determination module 530, a model parameter correction module 540 and a model construction module 550.
[0180] The sample acquisition module 510 is used to acquire a plurality of training samples; wherein the training samples include a copper bar chain sample image and a real defect mark corresponding to the copper bar chain sample image, and the real defect mark is used to characterize the defect state of the copper bar chain in the copper bar chain sample image; the sample update module 520 is used to process the copper bar chain sample image in the training sample in accordance with the pre-trained feature extraction sub-model and feature dimension reduction sub-model for the plurality of training samples, obtain the to-be-processed features corresponding to the training samples, and update the copper bar chain sample image in the training sample based on the to-be-processed features; wherein the feature extraction sub-model is trained based on the fruit fly optimization algorithm of fuzzy feedback increment; the feature dimension reduction sub-model is trained based on the feature adaptive refinement algorithm; The method is obtained by training; a loss value determination module 530 is used to process the training sample based on a pre-constructed deep learning sub-model to obtain a third loss value; wherein the activation function contained in the deep learning sub-model is a quantum state nonlinear activation function; a model parameter correction module 540 is used to correct the model parameters in the deep learning sub-model based on the third loss value, and take the convergence of the third loss function in the deep learning sub-model as the training target, and take the trained deep learning sub-model as the classification sub-model; a model construction module 550 is used to construct a defect detection model based on the feature extraction sub-model, the feature dimensionality reduction sub-model and the classification sub-model, so as to perform copper bus chain surface defect detection on the copper bus chain image to be processed based on the defect detection model.
[0181] The technical solution of the embodiment of the present invention is to obtain multiple training samples; wherein the training samples include copper bar chain sample images and real defect identifications corresponding to the copper bar chain sample images; further, for multiple training samples, the copper bar chain sample images in the training samples are processed in turn according to the pre-trained feature extraction sub-model and feature dimension reduction sub-model to obtain the features to be processed corresponding to the training samples, and the copper bar chain sample images in the training samples are updated based on the features to be processed, wherein the feature extraction sub-model is trained based on the fruit fly optimization algorithm of fuzzy feedback increment, and the feature dimension reduction sub-model is trained based on the feature adaptive refinement algorithm; further, the training samples are processed based on the pre-constructed deep learning sub-model to obtain a third loss value; further, based on the third loss value The model parameters in the deep learning sub-model are corrected, the convergence of the third loss function in the deep learning sub-model is used as the training goal, and the trained deep learning sub-model is used as the classification sub-model; further, a defect detection model is constructed based on the feature extraction sub-model, the feature dimensionality reduction sub-model and the classification sub-model, so that the copper bus chain surface defect detection is performed on the processed copper bus chain image based on the defect detection model, which solves the problem that a lot of manpower and time are consumed in the related technology, and the equipment status cannot be detected in real time. The defect detection model is obtained based on training samples and multiple algorithms to improve the model performance and generalization ability of the defect detection model, and then the effect of accurately detecting the copper bus chain defect category according to the defect detection model is achieved, thereby improving the efficiency and accuracy of copper bus chain defect detection.
[0182] Optionally, the device also includes: a sample set determination module, a model output label set determination module, a first loss value determination module and a feature extraction sub-model determination module.
[0183] A sample set determination module, configured to determine a training sample set corresponding to multiple iterations according to the multiple training samples after the multiple training samples are obtained, wherein the training sample set includes at least one training sample;
[0184] A model output label set determination module is used for inputting the copper busbar chain sample image in the training sample set corresponding to the current iteration process into a pre-built convolutional neural network for multiple iteration processes to obtain a model output feature set corresponding to the current iteration process, and processing the model output feature set based on a preset normalization function to obtain a model output label set corresponding to the current iteration process, wherein the model output label set includes a model output label corresponding to at least one of the training samples;
[0185] A first loss value determination module is used to determine the search step corresponding to the current iterative process according to the model output label set corresponding to the current iterative process and the real defect identifier in the training sample set, and perform loss processing on the model output label set and the real defect identifier in the training sample set according to a preset first loss function to obtain a first loss value corresponding to the current iterative process;
[0186] A feature extraction sub-model determination module is used to modify the model parameters of the convolutional neural network according to the search step and the first loss value, take the convergence of the first loss function in the convolutional neural network as a training target, and use the trained convolutional neural network as a feature extraction sub-model.
[0187] Optionally, the first loss value determination module includes: a relative error determination unit, a fuzzy control parameter determination unit and a search step determination unit.
[0188] A relative error determination unit, configured to determine a relative error corresponding to the current iteration process according to a model output label set corresponding to the current iteration process and the real defect identifier in the training sample set;
[0189] A fuzzy control parameter determination unit, used to obtain the error variation corresponding to the last iteration process, and determine the first fuzzy control parameter and the second fuzzy control parameter corresponding to the current iteration process based on the error variation corresponding to the last iteration process; wherein the error variation corresponding to the last iteration process is determined based on the relative error corresponding to the last iteration process and the relative error corresponding to the last iteration process of the last iteration process;
[0190] The search step length determining unit is used to determine the search step length corresponding to the current iterative process according to the relative error corresponding to the current iterative process, the first fuzzy control parameter and the second fuzzy control parameter.
[0191] Optionally, the first loss value determination module includes: a norm regularization term determination unit and a first loss value determination unit.
[0192] A norm regularization term determination unit, used to determine a norm regularization term according to a weight matrix corresponding to each layer of the convolutional neural network;
[0193] The first loss value determination unit is used to determine a first loss value corresponding to the current iteration process according to the model output label set, the real defect identification in the training sample set, the preset regularization coefficient and the norm regularization term.
[0194] Optionally, the device further includes: a feature extraction module, a feature set determination module, a weight update amount determination module and a feature dimension reduction sub-model determination module.
[0195] A feature extraction module, for, after acquiring the plurality of training samples, respectively extracting features from the copper bar chain sample images in the plurality of training samples according to the feature extraction sub-model, obtaining features to be applied corresponding to the plurality of copper bar chain sample images, adding the features to be applied to the training samples, and determining a training sample set corresponding to the plurality of iterations according to the plurality of training samples, wherein the training sample set includes at least one training sample, and the training sample includes the copper bar chain sample image, the features to be applied corresponding to the copper bar chain sample image, and the real defect identifier;
[0196] A feature set determination module, for inputting the features to be applied in the training sample set corresponding to the current iterative process into the autoencoder neural network for the multiple iterative processes, to obtain a reduced dimension feature set and a reconstructed output feature set corresponding to the current iterative process; wherein the autoencoder neural network includes an encoder and a decoder;
[0197] A weight update amount determination module is used to perform loss processing on the to-be-applied features in the training sample set, the reconstructed output feature set, and the encoder weight parameters according to a preset second loss function to obtain a second loss value corresponding to the current iterative process, and determine the weight update amount corresponding to the current iterative process according to the second loss value, the dimension reduction feature set, the reconstructed output feature set, the encoder weight parameters, and the first learning rate;
[0198] A feature dimensionality reduction sub-model determination module is used to modify the model parameters of the autoencoder neural network according to the weight update amount, the second loss value and the second learning rate corresponding to the current iterative process, take the convergence of the second loss function in the autoencoder neural network as the training goal, and use the trained autoencoder neural network as the feature dimensionality reduction sub-model.
[0199] Optionally, the feature set determination module includes: a dimension reduction feature determination unit, a dimension reduction feature set determination unit and a reconstructed output feature set determination unit.
[0200] A dimension reduction feature determination unit, used for inputting at least one of the to-be-applied features in the training sample set into an autoencoder neural network, so as to perform feature dimension reduction on at least one of the to-be-applied features based on an encoder in the autoencoder neural network, and obtain at least one dimension reduction feature;
[0201] a dimension reduction feature set determining unit, configured to determine a dimension reduction feature set based on at least one of the dimension reduction features; and
[0202] The reconstructed output feature set determination unit is used to input at least one of the dimensionality reduction features into the decoder of the autoencoder neural network to obtain at least one reconstructed output feature corresponding to the feature to be applied, and determine the reconstructed output feature set based on at least one of the reconstructed output features.
[0203] Optionally, the weight update amount determination module includes: a loss weight gradient determination unit and a weight update amount determination unit.
[0204] a loss weight gradient determining unit, configured to perform partial derivative processing on the second loss value, the dimension reduction feature set, the reconstructed output feature set, and the encoder weight parameter to obtain a loss weight gradient;
[0205] The weight update amount determination unit is used to process the loss weight gradient by a hyperbolic tangent function to obtain a parameter to be processed, and multiply the parameter to be processed by a first learning rate to obtain a weight update amount corresponding to the current iterative process.
[0206] Optionally, the device further includes: an image acquisition module and a defect category determination module.
[0207] An image acquisition module, used to acquire an image of a copper bus chain to be processed; wherein the image of the copper bus chain to be processed includes a copper bus chain to be tested;
[0208] A defect category determination module is used to process the copper bus chain image to be processed based on a pre-trained defect detection model to determine the defect category of the copper bus chain to be tested; wherein the defect detection model includes a feature extraction sub-model, a feature dimension reduction sub-model and a classification sub-model; and the defect category includes at least one of a crack state, a wear state and a normal state.
[0209] The defect detection model building device provided in the embodiment of the present invention can execute the defect detection model building method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0210] Embodiment 6
[0211] Figure 6A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0212] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0213] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0214] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a defect detection model building method.
[0215] In some embodiments, the defect detection model building method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the defect detection model building method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the defect detection model building method in any other appropriate manner (e.g., by means of firmware).
[0216] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0217] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0218] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0219] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0220] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0221] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0222] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0223] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A defect detection model construction method, characterized in that: include: Acquire multiple training samples; wherein the training samples include a copper bar chain sample image and a real defect mark corresponding to the copper bar chain sample image, and the real defect mark is used to characterize the defect state of the copper bar chain in the copper bar chain sample image; For the plurality of training samples, the copper bus chain sample images in the training samples are processed in turn according to the pre-trained feature extraction sub-model and feature dimension reduction sub-model to obtain the features to be processed corresponding to the training samples, and the copper bus chain sample images in the training samples are updated based on the features to be processed; wherein the feature extraction sub-model is trained based on the fruit fly optimization algorithm of fuzzy feedback increment; and the feature dimension reduction sub-model is trained based on the feature adaptive refinement algorithm; Processing the training sample based on a pre-built deep learning sub-model to obtain a third loss value; wherein the activation function included in the deep learning sub-model is a quantum state nonlinear activation function; Modifying the model parameters in the deep learning sub-model based on the third loss value, taking the convergence of the third loss function in the deep learning sub-model as a training target, and taking the trained deep learning sub-model as a classification sub-model; A defect detection model is constructed based on the feature extraction sub-model, the feature dimension reduction sub-model and the classification sub-model, so as to perform copper bus chain surface defect detection on the copper bus chain image to be processed based on the defect detection model.
2. The defect detection model construction method according to claim 1, characterized in that: After obtaining a plurality of training samples, the method further includes: Determine a training sample set corresponding to multiple iterations according to the multiple training samples, wherein the training sample set includes at least one training sample; For multiple iterations, the copper busbar chain sample images in the training sample set corresponding to the current iteration are input into a pre-constructed convolutional neural network to obtain a model output feature set corresponding to the current iteration, and the model output feature set is processed based on a preset normalization function to obtain a model output label set corresponding to the current iteration, wherein the model output label set includes a model output label corresponding to at least one of the training samples; Determine the search step corresponding to the current iterative process according to the model output label set corresponding to the current iterative process and the real defect identifier in the training sample set, and perform loss processing on the model output label set and the real defect identifier in the training sample set according to a preset first loss function to obtain a first loss value corresponding to the current iterative process; The model parameters of the convolutional neural network are modified according to the search step and the first loss value, the convergence of the first loss function in the convolutional neural network is used as a training target, and the trained convolutional neural network is used as a feature extraction sub-model.
3. The defect detection model construction method according to claim 2, characterized in that: The step of determining the search step corresponding to the current iteration process according to the model output label set corresponding to the current iteration process and the real defect identifier in the training sample set includes: Determine a relative error corresponding to the current iteration process according to the model output label set corresponding to the current iteration process and the real defect identifier in the training sample set; Obtaining an error variation corresponding to a previous iteration process, and determining a first fuzzy control parameter and a second fuzzy control parameter corresponding to the current iteration process based on the error variation corresponding to the previous iteration process; wherein the error variation corresponding to the previous iteration process is determined based on a relative error corresponding to the previous iteration process and a relative error corresponding to an iteration process previous to the previous iteration process; A search step length corresponding to the current iterative process is determined according to the relative error corresponding to the current iterative process, the first fuzzy control parameter, and the second fuzzy control parameter.
4. The defect detection model construction method according to claim 2, characterized in that: The performing loss processing on the model output label set and the real defect identification in the training sample set according to a preset first loss function to obtain a first loss value corresponding to the current iteration process includes: Determining a norm regularization term according to a weight matrix corresponding to each layer of the convolutional neural network; A first loss value corresponding to the current iteration process is determined according to the model output label set, the real defect identifier in the training sample set, a preset regularization coefficient and the norm regularization term.
5. The defect detection model construction method according to claim 1, characterized in that: After obtaining a plurality of training samples, the method further includes: Performing feature extraction on the copper bar chain sample images in the plurality of training samples according to the feature extraction sub-model respectively, obtaining the to-be-applied features corresponding to the plurality of copper bar chain sample images, adding the to-be-applied features to the training samples, and determining a training sample set corresponding to the plurality of iterative processes according to the plurality of training samples, wherein the training sample set includes at least one training sample, and the training sample includes the copper bar chain sample image, the to-be-applied features corresponding to the copper bar chain sample image, and the real defect identifier; For multiple iterations, the features to be applied in the training sample set corresponding to the current iteration are input into the autoencoder neural network to obtain a reduced dimension feature set and a reconstructed output feature set corresponding to the current iteration; wherein the autoencoder neural network includes an encoder and a decoder; Performing loss processing on the features to be applied in the training sample set, the reconstructed output feature set, and the encoder weight parameters according to a preset second loss function to obtain a second loss value corresponding to the current iterative process, and determining a weight update amount corresponding to the current iterative process according to the second loss value, the reduced dimension feature set, the reconstructed output feature set, the encoder weight parameters, and the first learning rate; The model parameters of the autoencoder neural network are modified according to the weight update amount, the second loss value and the second learning rate corresponding to the current iterative process, the convergence of the second loss function in the autoencoder neural network is used as the training goal, and the trained autoencoder neural network is used as a feature dimensionality reduction sub-model.
6. The defect detection model construction method according to claim 5, characterized in that: The step of inputting the features to be applied in the training sample set corresponding to the current iterative process into the autoencoder neural network to obtain a reduced dimension feature set and a reconstructed output feature set corresponding to the current iterative process includes: Inputting at least one of the features to be applied in the training sample set into an autoencoder neural network, so as to perform feature dimension reduction on at least one of the features to be applied based on an encoder in the autoencoder neural network, and obtain at least one reduced dimension feature; Determining a dimension reduction feature set based on at least one of the dimension reduction features; and, Input at least one of the dimensionality reduction features into the decoder of the autoencoder neural network to obtain at least one reconstructed output feature corresponding to the feature to be applied, and determine a reconstructed output feature set based on the at least one reconstructed output feature.
7. The defect detection model construction method according to claim 5, characterized in that: The step of determining a weight update amount corresponding to the current iteration process according to the second loss value, the dimension reduction feature set, the reconstructed output feature set, the encoder weight parameter, and the first learning rate includes: Performing partial derivative processing on the second loss value, the dimension reduction feature set, the reconstructed output feature set, and the encoder weight parameter to obtain a loss weight gradient; The loss weight gradient is processed by a hyperbolic tangent function to obtain a parameter to be processed, and the parameter to be processed is multiplied by a first learning rate to obtain a weight update amount corresponding to the current iterative process.
8. The defect detection model construction method according to claim 1, characterized in that: Also includes: Acquire a copper bus chain image to be processed; wherein the copper bus chain image to be processed includes the copper bus chain to be tested; The copper bus chain image to be processed is processed based on a pre-trained defect detection model to determine the defect category of the copper bus chain to be tested; wherein the defect detection model includes a feature extraction sub-model, a feature dimension reduction sub-model and a classification sub-model; the defect category includes at least one of a crack state, a wear state and a normal state.
9. A defect detection model building device, characterized in that: include: A sample acquisition module, used to acquire a plurality of training samples; wherein the training samples include a copper bar chain sample image and a real defect mark corresponding to the copper bar chain sample image, and the real defect mark is used to characterize the defect state of the copper bar chain in the copper bar chain sample image; A sample updating module is used for processing the copper bus chain sample images in the training samples according to the pre-trained feature extraction sub-model and feature dimension reduction sub-model for the plurality of training samples, obtaining the features to be processed corresponding to the training samples, and updating the copper bus chain sample images in the training samples based on the features to be processed; wherein the feature extraction sub-model is trained based on the fruit fly optimization algorithm of fuzzy feedback increment; and the feature dimension reduction sub-model is trained based on the feature adaptive refinement algorithm; A loss value determination module, used to process the training sample based on a pre-built deep learning sub-model to obtain a third loss value; wherein the activation function included in the deep learning sub-model is a quantum state nonlinear activation function; A model parameter correction module, used to correct the model parameters in the deep learning sub-model based on the third loss value, take the convergence of the third loss function in the deep learning sub-model as the training target, and use the trained deep learning sub-model as the classification sub-model; The model building module is used to build a defect detection model based on the feature extraction sub-model, the feature dimension reduction sub-model and the classification sub-model, so as to perform copper bus chain surface defect detection on the copper bus chain image to be processed based on the defect detection model.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the defect detection model building method according to any one of claims 1 to 8.