Wire production defect detection system and method based on computer vision
By intelligently adjusting the parameters of the lighting system and adopting deep learning technology, the existing wire production defect detection methods are solved, and more efficient and accurate defect detection is achieved, and the overall efficiency and product quality of the production line are improved.
Patent Information
- Application Number
- CN202510350858.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-06-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing wire production defect detection methods are inefficient and not accurate enough, making it difficult to adapt to wires of different materials, colors, diameters and shapes, as well as complex production environment changes.
By obtaining the wire characteristics and detection requirements input by users, intelligently adjusting the lighting system parameters, optimizing the wire image acquisition process, and using deep learning-based image processing technology to improve the accuracy of defect recognition.
It significantly improves the flexibility and adaptability of the inspection system, improves the accuracy of wire defect detection, and improves the overall efficiency and product quality of the production line.
Smart Images

Figure CN120219353A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent detection, and more specifically, to a wire production defect detection system and method based on computer vision. Background Art
[0002] During the wire production process, ensuring the stability and reliability of product quality is crucial. Traditional wire defect detection methods mainly rely on manual inspection, which is not only inefficient but also highly susceptible to human factors such as fatigue and distraction, making it difficult to guarantee the consistency and accuracy of detection results. In addition, with the development of wire manufacturing processes, the requirements for detecting the surface state of wires are becoming increasingly strict, including the identification of minute flaws and complex surface characteristics, which poses a higher challenge to traditional detection means.
[0003] To improve detection efficiency and accuracy, some modern production lines have started to adopt automatic detection systems based on computer vision technology. However, some existing automated detection solutions often have certain limitations. For example, they lack the ability to efficiently adapt to wires of different materials, colors, diameters, and shapes; or they fail to fully consider the dynamic changes in the production environment, such as the impact of changes in wire movement speed on imaging quality; furthermore, in terms of lighting design, many systems do not flexibly adjust the lighting method and angle according to specific wire characteristics and detection requirements, resulting in unsatisfactory image acquisition quality, which in turn affects the subsequent defect recognition effect.
[0004] Therefore, an optimized wire production defect detection method based on computer vision is expected. Summary of the Invention
[0005] To solve the above technical problems, this application is proposed. Embodiments of this application provide a wire production defect detection system and method based on computer vision, which first obtain the wire characteristics and detection requirements input by the user, intelligently adjust the parameters of the lighting system by combining the wire characteristics and detection requirements, optimize the wire image acquisition process based on the lighting system parameters, and further adopt deep learning-based image processing technology to improve the accuracy of wire image defect recognition. In this way, the flexibility and adaptability of the detection system can be significantly improved, enabling it to better cope with the challenges brought by the diversity of wire types and complex production environments, thereby enhancing the accuracy of wire defect detection and improving the overall efficiency and product quality of the production line.
[0006] According to one aspect of this application, a wire production defect detection method based on computer vision is provided, which includes:
[0007] Obtain the wire characteristics and detection requirements input by the user;
[0008] Specify the lighting mode and installation angle of the lighting system based on the wire characteristics and detection requirements;
[0009] Under the action of the lighting system, use a camera to collect wire images of the wire to be detected;
[0010] Extract the image features in the wire image to obtain the surface state coding features of the wire;
[0011] Based on the surface state coding features of the wire, determine whether there are defects in the wire.
[0012] According to another aspect of the present application, there is provided a wire production defect detection system based on computer vision, which includes:
[0013] An information acquisition module for acquiring the wire characteristics and detection requirements input by the user;
[0014] A lighting mode determination module for specifying the lighting mode and installation angle of the lighting system based on the wire characteristics and detection requirements;
[0015] A wire image acquisition module for using a camera to collect wire images of the wire to be detected under the action of the lighting system;
[0016] A wire surface state feature extraction module for extracting the image features in the wire image to obtain the surface state coding features of the wire;
[0017] A wire production defect detection module for determining whether there are defects in the wire based on the surface state coding features of the wire.
[0018] Compared with the prior art, a wire production defect detection system and method based on computer vision provided by the present application first obtains the wire characteristics and detection requirements input by the user, intelligently adjusts the parameters of the lighting system by combining the wire characteristics and detection requirements, optimizes the acquisition process of the wire image based on the lighting system parameters, and further uses deep learning-based image processing technology to improve the accuracy of defect recognition in the wire image. In this way, the flexibility and adaptability of the detection system can be significantly improved, enabling it to better cope with the challenges brought by the diversity of wire types and complex production environments, thereby enhancing the accuracy of wire defect detection and improving the overall efficiency and product quality of the production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] By describing the embodiments of the present application in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present application will become more obvious. The drawings are used to provide a further understanding of the embodiments of the present application, and constitute a part of the specification, and are used to explain the present application together with the embodiments of the present application, and do not constitute a limitation to the present application. In the drawings, the same reference numerals generally represent the same components or steps.
[0020] Figure 1 Flowchart of a computer vision-based wire production defect detection method according to an embodiment of the present application;
[0021] Figure 2 Schematic diagram of data flow of a computer vision-based wire production defect detection method according to an embodiment of the present application;
[0022] Figure 3 Flowchart of sub-step S2 of a computer vision-based wire production defect detection method according to an embodiment of the present application;
[0023] Figure 4 Flowchart of sub-step S21 of a computer vision-based wire production defect detection method according to an embodiment of the present application;
[0024] Figure 5 Block diagram of a computer vision-based wire production defect detection system according to an embodiment of the present application. Detailed implementation manners
[0025] Hereinafter, exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. It should be understood that the present application is not limited by the exemplary embodiments described herein.
[0026] As shown in the present application and the claims, unless the context clearly indicates an exception, words such as "a", "an", "one", and / or "the" are not specifically singular and may also include plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of the clearly identified steps and elements, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0027] Although the present application makes various references to certain modules in the system according to the embodiments of the present application, however, any number of different modules can be used and run on the user terminal and / or the server. The modules are only illustrative, and different aspects of the system and method can use different modules.
[0028] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the operations before or below do not necessarily need to be executed precisely in order. On the contrary, various steps can be processed in reverse order or simultaneously as needed. At the same time, other operations can also be added to these processes, or one or several steps can be removed from these processes.
[0029] Next, exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments of the present application. It should be understood that the present application is not limited by the exemplary embodiments described herein.
[0030] In the technical solution of the present application, a method for detecting wire production defects based on computer vision is proposed. Figure 1 It is a flowchart of a method for detecting wire production defects based on computer vision according to an embodiment of the present application. Figure 2 It is a schematic diagram of data flow of a method for detecting wire production defects based on computer vision according to an embodiment of the present application. As Figure 1 and Figure 2 shown, the method for detecting wire production defects based on computer vision according to the embodiment of the present application includes the steps of: S1, obtaining wire characteristics and detection requirements input by a user; S2, specifying the lighting mode and installation angle of a lighting system based on the wire characteristics and detection requirements; S3, under the action of the lighting system, using a camera to collect wire images of the wire to be detected; S4, extracting image features in the wire images to obtain wire surface state coding features; S5, determining whether there are defects in the wire based on the wire surface state coding features.
[0031] Specifically, in S1, wire characteristics and detection requirements input by the user are obtained. Among them, wire characteristics include material, color, diameter, shape, and movement speed; detection requirements include detection speed, detection accuracy, false detection rate, and environmental conditions. From the dimension of wire characteristics, since wires with different materials, colors, or surface characteristics have significantly different light reflection characteristics. For example, metal materials may produce specular highlight interference, while the surface of dark wires may have insufficient image contrast due to strong light absorption. If the lighting method is not adapted to these characteristics, it may directly lead to the masking or misjudgment of defect features in the image. At the same time, the wire diameter and shape directly affect the selection of the lighting angle. For example, flat wire materials require multi-angle lighting to cover edge details, while the curved surface characteristics of cylindrical wire materials require a ring light source or coaxial light to eliminate shadow interference. In addition, the combination of the dynamic characteristic of the wire movement speed and the detection speed requirement determines the exposure time setting of the lighting system and the parameter configuration of the light source stroboscopic control, avoiding the loss of wire features due to motion blur. From the dimension of detection requirements, the contradiction between the detection accuracy requirement and the tolerance of the false detection rate needs to be balanced through lighting design. For example, for the high-precision detection requirement of micron-level defects, it may be necessary to combine polarized light or light sources with specific wavelengths to enhance the appearance of surface micro-features, while in high-speed production scenarios, it is necessary to optimize the coordination of lighting intensity and camera frame rate to meet the real-time requirement while ensuring the imaging quality. The complexity and variability of environmental conditions highlight the importance of dynamic adaptation. For example, the interference of workshop ambient light needs to be eliminated through active lighting, and temperature and humidity changes may affect the stability of the light source. All these require the linkage adjustment of compensation algorithms and lighting hardware based on the detection requirement parameters. In the technical solution of this application, by structuring and encoding multi-dimensional wire characteristics and detection requirements and performing deep feature interaction, the system can build a dynamic lighting parameter inference model. This demand-oriented lighting configuration strategy not only breaks through the limitations of traditional fixed lighting solutions in complex production scenarios but also lays a high-quality input foundation for subsequent wire image processing through precise optical adaptation.
[0032] Specifically, in S2, based on the wire characteristics and detection requirements, the lighting method and installation angle of the lighting system are specified. In a specific example of this application, as Figure 3 shown, S2 includes: S21, performing sparse optimization of the implicit association strength of lighting information for the implicit features of wire characteristics and the implicit features of detection requirements to obtain the implicit encoded features of lighting requirements; S22, determining the lighting method and installation angle of the lighting system based on the implicit encoded features of lighting requirements.
[0033] Specifically, in S21, sparse optimization of the implicit association strength of lighting information for the implicit features of wire characteristics and the implicit features of detection requirements is performed to obtain the implicit encoded features of lighting requirements. More specifically, in a specific example of this application, as Figure 4As shown, the S21 includes: S211, using the wire characteristic embedding matrix to perform structured mapping encoding on the wire characteristics to obtain a wire characteristic structured encoding vector; S212, passing the detection requirements through a semantic encoder based on the Bert model to obtain a detection requirement semantic embedding encoding vector; S213, performing a sparse constraint-based lighting requirement implicit feature interactive analysis on the wire characteristic structured encoding vector and the detection requirement semantic embedding encoding vector to obtain a lighting requirement implicit encoding vector.
[0034] More specifically, in S211, the wire characteristics are structured mapped and encoded using a wire characteristic embedding matrix to obtain a wire characteristic structured encoding vector. Since the wire characteristics involve multimodal parameters such as material and color, there is a complex nonlinear relationship between their physical properties and optical response. The wire material, color and other properties are essentially discrete categorical variables, while the diameter and movement speed are continuous physical quantities. Traditional encoding methods are difficult to capture the implicit association of such cross-modal features. Therefore, in the technical solution of the present application, the wire characteristic embedding matrix is used to perform structured mapping encoding on the wire characteristics, so as to project discrete physical property parameters (material labels) and continuous variables (such as diameter values) into a unified feature space, eliminate dimensional differences and semantic differences in the original data, and obtain a wire characteristic structured encoding vector. By performing structured mapping and encoding of wire characteristics, we can not only capture the implicit correlation between material surface roughness and color absorbance, but also establish the spatial mapping rules between geometric parameters (diameter, shape) and optical projection angles. The generated structured coding vector of wire characteristics contains the potential demand information of wire characteristics for lighting conditions, laying the foundation for subsequent collaborative analysis with detection needs, and helping the system to more accurately determine the lighting method and installation angle that best suits a specific type of wire, thereby improving the quality of image acquisition.
[0035] More specifically, in S212, the detection requirements are passed through a semantic encoder based on the Bert model to obtain a detection requirement semantic embedding coding vector. It should be understood that in the detection requirements, the trade-off between detection speed and false detection rate, the dynamic coupling between environmental conditions and detection accuracy, and other requirements essentially constitute a natural language description system with multiple layers of implicit relationships. The traditional bag-of-words model or unidirectional RNN structure is difficult to capture the deep logic of such requirements that are time-independent but semantically related. The BERT model, with its multi-layer self-attention mechanism in the bidirectional Transformer architecture, can capture the implicit constraint relationship across dimensions in the requirement description. The parallel feature interaction channels in its multi-head attention layer can synchronously parse the complex association between explicit parameters and implicit constraints in the detection requirement text. The generated detection requirement semantic embedding coding vector essentially constructs an interpretable mapping relationship between the detection requirements and optical physical quantities, so that the subsequent collaborative analysis with the wire characteristic coding vector is no longer limited to numerical matching, but rises to the cross-modal fusion level of requirement semantics and wire properties.
[0036] More specifically, in S213, the structured coding vector of the wire characteristics and the semantic embedded coding vector of the detection requirements are interactively analyzed based on sparse constraints to obtain the implicit coding vector of the lighting requirements. It should be understood that the differences in characteristics such as wire material, color, diameter, and changes in requirements such as detection accuracy and environmental conditions require that the lighting parameters need to be dynamically adjusted to ensure imaging quality. However, the interactive relationship between wire characteristics and dynamic detection requirements has cross-modal and asymmetric characteristics. If the traditional method is used to directly perform feature splicing or simple crossover on the wire characteristics and detection requirements, it is not only difficult to capture the deep correlation between the two, but also the model will be overfitted due to high-dimensional feature redundancy. Therefore, in order to achieve deep collaborative analysis between wire characteristics and detection requirements, in the technical solution of the present application, the structured coding vector of the wire characteristics and the semantic embedded coding vector of the detection requirements are interactively analyzed based on sparse constraints to obtain the implicit coding vector of the lighting requirements. That is, the abstract features of wire characteristics and detection requirements are mapped to the potential interaction space, and the deep correlation patterns between the two are mined in a data-driven manner to adaptively screen out key implicit patterns that are strongly associated with lighting parameters, avoiding lighting parameter decision deviations caused by redundant or noise interaction interference. In this process, first, the wire characteristics and detection requirements are locally decoupled through feature phase space reconstruction, and the implicit query space joint encoding matrix is used to break through the bottleneck of traditional linear interaction, and a multi-dimensional and multi-granular interaction relationship between wire characteristics and detection requirements is constructed in the abstract space; then, by introducing the sparse constraint factor of the lighting requirement space, only the lighting requirement features that are strongly related to defect detection can be retained in the implicit query space, while non-critical interaction noise can be suppressed, and the extraction of core lighting requirement related features such as material reflection characteristics, motion blur compensation, and ambient light interference suppression can be strengthened. This selective interaction modeling method enables the system to automatically select the optimal lighting parameter combination according to the surface state of the wire (such as high reflectivity of metal materials and low contrast of dark wires) and the production environment (such as dynamic blur caused by high-speed motion), forming a targeted lighting optimization strategy. In this way, the system can dynamically generate an adaptive lighting solution when faced with wires of different materials (such as PVC insulation and copper core) and complex environments (such as light fluctuations in the workshop), thereby improving the quality of subsequent image acquisition and providing a high signal-to-noise ratio visual input basis for defect identification, ultimately achieving a dual improvement in detection accuracy and generalization capability.
[0037] Specifically, first, perform feature phase space reconstruction based on one-dimensional convolutional coding on the wire characteristic structured coding vector and the detection requirement semantic embedding coding vector to obtain a set of wire characteristic local feature coding vectors and a set of detection requirement semantic feature coding vectors. Considering that the relationships between wire characteristics such as material, color, and movement speed and requirement parameters such as detection accuracy and environmental conditions are not simple linear superposition relationships, but rather there are complex implicit coupling effects. For example, wires with dark materials are prone to sudden changes in surface reflection characteristics due to environmental light interference in high-speed movement scenarios, and traditional methods are difficult to capture such cross-dimensional dynamic associations. Therefore, in the technical solution of this application, perform feature phase space reconstruction based on one-dimensional convolutional coding on the wire characteristic structured coding vector and the detection requirement semantic embedding coding vector to obtain a set of wire characteristic local feature coding vectors and a set of detection requirement semantic feature coding vectors. That is, map the wire characteristic structured coding vector and the detection requirement semantic embedding coding vector to a high-dimensional abstract space through non-linear transformation. For example, for the wire diameter parameter, different convolutional kernels can respectively capture its local associations with parameters such as light coverage range and motion blur threshold; for the false detection rate parameter in the detection requirements, through the sliding window decomposition of the semantic coding vector, reveal its dynamic balance relationship with implicit constraints such as the morphology of surface defects of the material and environmental temperature and humidity. This phase space reconstruction process not only breaks the dependence of traditional methods on the linear combination of global features, but also forms a multi-perspective local feature coding set through the parallel operation of multiple groups of convolutional kernels, integrating the originally discrete material attributes, motion parameters, and detection target parameters into a distributed feature cluster with local structural semantics. Through the way of distributed redundancy, the robustness of the model to unstable factors such as production line vibration noise and environmental light interference is significantly improved, ensuring that effective features can still be stably extracted under complex working conditions, providing a reliable data basis for subsequent lighting parameter optimization and defect identification. In a specific example of this application, perform feature phase space reconstruction based on one-dimensional convolutional coding on the wire characteristic structured coding vector and the detection requirement semantic embedding coding vector with the following one-dimensional convolutional formula to obtain a set of wire characteristic local feature coding vectors and a set of detection requirement semantic feature coding vectors; where the one-dimensional convolutional formula is:
[0038]
[0039]
[0040] Wherein, and are respectively the wire characteristic structured coding vector and the detection requirement semantic embedding coding vector, is the feature phase space reconstruction process based on one-dimensional convolutional coding, and They are respectively the set of the local feature coding vectors of the wire characteristics and the set of the semantic feature coding vectors of the detection requirements. They are respectively the 1st, 2nd, and the wire local feature coding vectors of the th and
[0041] They are respectively the 1st, 2nd, and the semantic feature coding vectors of the detection requirements of the th.
[0042] Next, calculate the initial joint encoding matrix of the implicit query space for lighting requirements between each corresponding wire characteristic local feature encoding vector and detection requirement semantic feature encoding vector in the set of wire characteristic local feature encoding vectors and the set of detection requirement semantic feature encoding vectors to obtain a set of initial joint encoding matrices of the implicit query space for lighting requirements. Since there are complex implicit coupling relationships between characteristics such as wire material and color and requirements such as detection accuracy and environmental conditions (for example, imaging of minute scratches on the surface of dark wires requires low-reflection lighting at a specific angle, and high-speed motion scenarios need to combine stroboscopic parameters to suppress dynamic blur), conventional linear correlation models or manually preset rules cannot effectively mine the deep interaction patterns between such cross-modal features. Therefore, in the technical solution of this application, calculate the initial joint encoding matrix of the implicit query space for lighting requirements between each corresponding wire characteristic local feature encoding vector and detection requirement semantic feature encoding vector in the set of wire characteristic local feature encoding vectors and the set of detection requirement semantic feature encoding vectors to obtain a set of initial joint encoding matrices of the implicit query space for lighting requirements. By introducing the implicit query space, map the wire characteristic local features (such as the reflective characteristics of metal materials) and detection requirement semantic features (such as the exposure time constraint under high-speed detection) to the potential interaction space, and automatically construct the association topology between the two in the abstract dimension in a data-driven manner to mine the association strength and action mode between wire characteristics and detection requirements, thereby breaking through the dependence of traditional methods on fixed interaction logics. Through the non-linear interaction fusion in the implicit query space, the model can screen out the local interaction patterns sensitive to the current detection task from the high-dimensional features. The generated set of initial joint encoding matrices of the implicit query space for lighting requirements essentially constructs an interaction response map of local feature pairs in the implicit query space for lighting requirements, and each matrix represents the potential lighting requirement pattern triggered by a specific local feature combination. This data-driven interaction modeling method enables the system to adaptively learn the differential lighting requirement association rules of wires with different materials in different detection scenarios, rather than relying on a manually preset parameter mapping table, thus significantly improving the fine-grainedness and robustness of lighting requirement prediction. In a specific example of this application, calculate the initial joint encoding matrix of the implicit query space for lighting requirements between each corresponding wire characteristic local feature encoding vector and detection requirement semantic feature encoding vector in the set of wire characteristic local feature encoding vectors and the set of detection requirement semantic feature encoding vectors according to the following query encoding formula to obtain a set of initial joint encoding matrices of the implicit query space for lighting requirements; where, the query encoding formula is:
[0043]
[0044] Wherein, and are respectively the The trainable weight matrix of the semantic feature encoding vector of the detection requirement and the trainable weight matrix of the local feature encoding vector of the wire characteristics, For the scale of the trainable weight matrix of the local feature encoding vector of the wire characteristics, that is, width times height, Each initial joint encoding matrix of the lighting requirement implicit query space in the set of initial joint encoding matrices of the lighting requirement implicit query space.
[0045] Preferably, for each initial matrix of the jointly encoded implicit query space for lighting requirements in the set of initial matrices of the jointly encoded implicit query space for lighting requirements, a phase-gauge-based optimization of the lighting requirement interaction pattern is performed to obtain a set of matrices of the jointly encoded implicit query space for lighting requirements. It should be understood that since there is a complex non-linear correlation between the local characteristics of wire properties (such as the reflective phase characteristics of metal materials) and the semantic characteristics of detection requirements (such as the dynamic imaging constraints in high-speed motion scenarios) in the implicit query space, the set of initial matrices of the jointly encoded implicit query space for lighting requirements directly generated may contain a large number of redundant local connection structures (for example, unnecessary coupling of illumination angle features caused by microscopic undulations on the material surface). These redundant interactions not only increase the model complexity but also obscure the key lighting requirement patterns. In a preferred example of the present application, for each initial matrix of the jointly encoded implicit query space for lighting requirements in the set of initial matrices of the jointly encoded implicit query space for lighting requirements, a phase-gauge-based optimization of the lighting requirement interaction pattern is performed to obtain a set of matrices of the jointly encoded implicit query space for lighting requirements. In particular, the core of the phase-gauge optimization lies in reconstructing the geometric structure of feature interactions through a mathematical connection mechanism, converting the local curvature distortion originally caused by high-dimensional mapping into a linear gauge transmission on a flat manifold, thereby eliminating the invalid associations caused by redundant projection paths between wire properties and detection requirement parameters. During this process, a spatial state mapping transformation is performed on the initial matrix of the jointly encoded implicit query space for lighting requirements through the phase matrix and its inverse matrix to mathematically reconstruct the feature interaction paths in the jointly encoded implicit query space for lighting requirements. For example, in the scenario of detecting dark-insulated layer wires, the original initial matrix may generate multi-path interference features due to the complex interaction between the light absorption characteristics of the material and the detection accuracy requirements. The phase-gauge optimization converges the redundant interaction paths to a flattened connection space by analyzing the local non-linear phase relationships (such as the geometric correlation between the surface reflection phase of the material and the incident angle of the light source), enabling the optimized matrix of the jointly encoded implicit query space for lighting requirements to more accurately represent the core lighting requirements (such as the enhanced effect of lateral low-angle illumination on surface scratches). In addition, the set of optimized matrices of the jointly encoded implicit query space for lighting requirements eliminates redundant non-linear interaction noise, enabling the model to focus on the key lighting parameter associations strongly related to defect detection, ensuring that the image acquisition quality always meets the dynamic requirements of defect recognition, and thus comprehensively improving the robustness and scalability of the defect detection system.
[0046] In this example, for each initial matrix of the jointly encoded implicit query space for lighting requirements in the set of initial matrices of the jointly encoded implicit query space for lighting requirements, a phase-gauge-based optimization of the lighting requirement interaction pattern is performed to obtain a set of matrices of the jointly encoded implicit query space for lighting requirements; where the optimization formula is:
[0047]
[0048] Among them, is the phase matrix, where the is the relative phase , is the eigenvalue in is the eigenvalue in is the value of the natural exponential function with the natural constant e as the base, is each jointly encoded matrix of the implicit query space for lighting requirements in the set of jointly encoded matrices of the implicit query space for lighting requirements.
[0049] Subsequently, calculate the lighting requirement space sparse constraint factor of each jointly encoded matrix of the implicit query space for lighting requirements in the set of jointly encoded matrices of the implicit query space for lighting requirements to obtain a set of lighting requirement space sparse constraint factors. Here, due to the highly complex interaction relationship between wire characteristics and detection requirements in the implicit query space, the set of jointly encoded matrices of the implicit query space for lighting requirements may contain a large number of redundant or secondary interaction features, while the key interaction patterns that actually affect the effectiveness of defect detection often only account for a small number. Traditional methods using uniform weights to process all interaction relationships are prone to noise interference. By introducing the lighting requirement space sparse constraint factor, the density and intensity of effective interaction patterns in each jointly encoded matrix of the implicit query space for lighting requirements can be quantified, enabling the system to automatically identify key interaction relationships according to the specific working conditions of the wire production environment and suppress unnecessary feature coupling. For example, when the detection requirement switches from conventional dimension measurement to microscopic crack identification, the sparse constraint factor will dynamically adjust the weights of different jointly encoded matrices, strengthen the interaction features between high-resolution imaging requirements and coaxial lighting parameters, and weaken redundant associations irrelevant to the detection task. By quantitatively evaluating the interaction value of each jointly encoded matrix of the implicit query space for lighting requirements, the system can eliminate pseudo-associations introduced by environmental noise or feature coupling (such as the accidental association between wire movement speed and light source color temperature), and retain effective interaction patterns with physical significance (such as the strict matching relationship between movement speed and stroboscopic lighting frequency). Furthermore, the system can more accurately adapt to various wire characteristics and detection requirements in a complex production environment, achieving high-quality automatic defect detection. In a specific example of this application, the lighting requirement space sparse constraint factor of each jointly encoded matrix of the implicit query space for lighting requirements in the set of jointly encoded matrices of the implicit query space for lighting requirements is calculated using the following sparse constraint formula to obtain a set of lighting requirement space sparse constraint factors; where the sparse constraint formula is:
[0050]
[0051] wherein, is the square of the two - norm of the matrix, are the respective lighting demand spatial sparse constraint factors in the set of lighting demand spatial sparse constraint factors.
[0052] Furthermore, based on the set of lighting demand spatial sparse constraint factors, an adaptive aggregation is performed on the set of jointly - encoded matrices of the lighting demand implicit query space to obtain a lighting demand implicit encoding vector. It should be understood that since different types of wires and different detection scenarios have unique requirements for lighting conditions, through adaptive aggregation, the importance of the interaction information captured from each local feature perspective can be dynamically adjusted, so as to accurately determine the optimal lighting method and installation angle. Here, through the adaptive aggregation guided by the sparse constraint factors, the importance of the interaction information captured from each local feature perspective can be dynamically adjusted, so as to accurately determine the optimal lighting method and installation angle. This dynamic fusion mechanism enables the model to extract the most decision - valuable global lighting demand representations from multi - angle local feature interactions (such as the dynamic blur compensation requirements caused by the wire movement speed and the influence of the material surface texture on the diffuse lighting), forming an optimal feature combination that not only retains the physical meaning but also adapts to the current task. In a specific example of the present application, a gating mechanism can be used to perform an adaptive aggregation on the set of jointly - encoded matrices of the lighting demand implicit query space, so as to dynamically adjust the contribution degree of each jointly - encoded matrix of the lighting demand implicit query space according to the set of lighting demand spatial sparse constraint factors, and achieve the optimal fusion of information. In a specific example of the present application, the following aggregation formula is used to perform an adaptive aggregation on the set of jointly - encoded matrices of the lighting demand implicit query space to obtain a lighting demand implicit encoding vector; wherein, the aggregation formula is:
[0053]
[0054]
[0055] wherein, is a function, are the respective lighting demand spatial sparse constraint weights in the set of lighting demand spatial sparse constraint weights, is the lighting demand fusion matrix, represents feature reshaping, is the lighting demand implicit encoding vector.
[0056] Specifically, in S22, based on the illumination demand implicit coding features, the illumination mode and installation angle of the illumination system are determined. That is, in the embodiments of the present application, first, the illumination demand implicit coding vector is input into the illumination mode recommender based on the classifier to obtain the illumination mode of the illumination system. It should be understood that different types of wires and different detection requirements require specific illumination conditions to optimize the imaging quality. The traditional fixed illumination scheme is difficult to adapt to this diversity and complexity, and by intelligently adjusting the illumination mode, various wire characteristics and detection requirements can be more precisely met. Although the illumination demand implicit coding vector aggregates and extracts the key interaction features of the illumination demand, it still needs to be converted into discrete illumination mode decisions (such as ring light, coaxial light, or polarized light mode). The classifier can convert the abstract optical demand features (such as the composite parameters of material refractive index, surface roughness, and motion blur compensation) in the illumination demand implicit coding vector into specific illumination mode labels through the decision boundary trained offline, and establish an intelligent mapping channel from the high-dimensional feature space to the illumination mode labels. In a specific example of the present application, for example, when the illumination demand features contained in the illumination demand implicit coding vector are "high reflectivity - high-speed motion - low false detection rate", the classifier automatically matches the stroboscopic ring illumination mode to suppress motion smear. This not only helps to reduce image quality problems caused by insufficient light or overexposure, but also enhances the visibility of subtle defects, thus providing a clearer and more accurate image basis for subsequent defect identification.
[0057] Furthermore, the lighting requirement implicit encoding vector is input into a decoder-based installation angle recommender to obtain the installation angle of the lighting system. It should be understood that different wire characteristics and detection requirements necessitate specific lighting angles to maximize the accuracy of defect identification. For example, the surface of certain types of wires may exhibit significant differences in light reflection due to different materials, which requires the system to intelligently adjust the lighting angle according to the specific characteristics of the wire. For instance, when inspecting highly glossy metal wires, an appropriate lighting angle can avoid visual interference caused by excessive reflection; while when examining minute cracks on dark wires, proper angle adjustment can increase the contrast and make the defects more obvious. In the technical solution of this application, by inputting the lighting requirement implicit encoding vector into a decoder-based installation angle recommender, the system can dynamically adjust the angle of the lighting device for specific application scenarios. Here, through end-to-end learning, the decoder can break through the limitations of explicit physical models and map the multi-dimensional features compressed in the lighting requirement implicit encoding vector (such as the refractive index of the material and the dynamic blur coefficient caused by the movement speed) to a continuous angle space, solving the problem of adaptation failure under new composite materials or extreme movement speeds. This intelligent method of adjusting the lighting angle greatly improves the overall performance of the wire production defect detection system, ensuring that regardless of the type of wire material or complex production environment, the system can provide high-quality image input, laying a solid foundation for accurate defect identification.
[0058] Specifically, in step S3, under the action of the lighting system, a camera is used to collect wire images of the wire to be detected. It should be understood that the accurate identification of the wire surface state depends on high-quality image input. Through a specially designed lighting system, the light conditions can be optimized according to different wire characteristics and detection requirements, and a ring diffused light source and a precise incident angle can be configured accordingly, so as to ensure that the camera can capture the clearest and most detailed wire surface image. In one example, when facing the problem of specular reflection that may be caused by a smooth surface, the system may recommend using side light or a ring light source to avoid unnecessary reflection interference and ensure that the light can evenly cover the entire detection area. In addition, to meet the requirements of high-speed detection, the lighting system needs to be configured with an appropriate stroboscopic function to synchronize with the camera frame rate, thereby effectively reducing the dynamic blur phenomenon caused by the rapid movement of the wire.
[0059] Specifically, in step S4, image features in the wire image are extracted to obtain the surface state coding features of the wire. That is, in the embodiments of the present application, first, the wire image is subjected to illumination equalization to obtain an enhanced wire image. It should be understood that due to the diversity of wire materials (such as the high reflectivity of metal conductors and the diffuse reflection characteristics of PVC insulation layers) and the dynamic working conditions of the production line (such as equipment moving shadows and ambient light fluctuations), the original wire surface images collected often have problems of local overexposure or underexposure. For example, bright spots formed by strong reflection on the surface of copper core wire cover scratch defects, or the surface texture details of dark insulation layers are lost in low-illuminance areas. Traditional detection systems directly processing the original images are vulnerable to such illumination noises, resulting in incomplete extraction of defect features. Therefore, in the technical solution of the present application, the wire image is subjected to illumination equalization to obtain an enhanced wire image. Here, through the illumination equalization process, the brightness distribution of each region of the enhanced wire image can be dynamically adjusted, and the artifact interference caused by uneven illumination can be eliminated. During this process, the illumination equalization algorithm reconstructs the brightness channel by analyzing the global and local brightness distribution characteristics of the pixels in the enhanced wire image. For example, the highlight areas on the surface of the metal conductor are subjected to inhibitory attenuation, while the dark areas of the insulation layer are subjected to gradient enhancement, so that the microscopic textures of defects such as scratches and bubbles present uniform contrast in the equalized image. This processing is essentially a physical compensation for imaging defects, converging the image quality fluctuations caused by differences in environmental illumination conditions to the standard detection field of view, ensuring that wire images collected in different batches and at different times have a consistent visual representation benchmark, and providing illumination-robust input for the subsequent target positioning of the YOLO model; in addition, the enhanced wire image processed by equalization can effectively strip the illumination interference factors, such as eliminating the brightness tomogram phenomenon caused by flash illumination in high-speed production lines, or compensating for the color temperature shift caused by changes in the workshop ambient light. This preprocessing enables the dilated convolutional neural network to more accurately capture the morphological features of wire surface defects, avoiding mis-extraction of features caused by uneven illumination; at the same time, the equalization processing reduces the impact of imaging differences of wires with different materials on the model, enabling the detection system to still maintain stable detection accuracy through standardized illumination representation when facing new composite wire materials, and providing high-confidence feature input for the support vector machine.
[0060] Next, the wire-enhanced image is passed through a wire detection network based on the YOLO model to obtain a wire ROI image. It should be understood that although the wire-enhanced images after the illumination equalization process have improved the problem of uneven illumination, these images usually contain a large amount of information unrelated to the wire itself, such as the background, equipment, or other interfering elements. To improve the efficiency and accuracy of subsequent defect recognition, it is necessary to determine the specific location of the wire and extract the area that only contains the wire part. Therefore, in the technical solution of this application, the wire-enhanced image is passed through a wire detection network based on the YOLO model to obtain a wire ROI image. The YOLO model, through an end-to-end deep learning architecture, can achieve sub-pixel-level wire body localization in complex industrial scenarios, effectively overcoming imaging interferences such as motion blur and multipath reflection, ensuring that subsequent feature extraction focuses on the effective detection area. By passing the wire-enhanced image through the YOLO model, the system can accurately locate and intercept the effective part of the wire. This not only reduces the risk of misjudgment caused by background interference but also provides high-quality input for subsequent wire surface state feature extraction based on the dilated convolutional neural network model, further enhancing the accuracy of defect recognition.
[0061] Subsequently, a wire surface state feature extractor based on the dilated convolutional neural network model is used to extract features from the wire ROI image to obtain a wire surface state feature encoding vector as the wire surface state encoding feature. It should be understood that in the wire production environment, various types of minute flaws may appear on the wire surface, and wire surface flaws such as micron-level cracks and insulation layer bubbles often exhibit characteristic patterns of local discontinuity and sparse spatial distribution. Due to the limitation of the fixed-size local receptive field of the traditional convolutional neural network, it is difficult to balance the capture of fine-grained features at high resolution and the analysis of large-scale context correlation (such as the abnormal correlation between the extension direction of scratches on the metal conductor surface and the surrounding texture). Dilated convolution can expand the receptive field without increasing the computational complexity by introducing an adjustable dilation rate parameter. For example, when detecting slender cracks, a larger dilation rate can help the model find continuous linear features in a larger range; while when identifying smaller punctate defects, a smaller dilation rate helps to improve the sensitivity to local details. In this way, the problem of detail loss caused by pooling operations in conventional convolution is effectively solved, enabling the network to better capture the detailed features of the wire surface.
[0062] In particular, in step S5, based on the encoded features of the wire surface state, it is determined whether there are defects in the wire. In the technical solution of this application, the encoded vector of the wire surface state features is input into a defect recognizer based on a support vector machine to obtain a recognition result, and the recognition result is used to indicate whether there are defects. Among them, a support vector machine (Support Vector Machine, SVM) is a supervised learning model for classification and regression analysis. In the technical solution of this application, the support vector machine can non-linearly map the wire surface state feature space to a high dimension through a Gaussian kernel function, so as to accurately judge whether there are defects on the wire surface according to the complex patterns in the encoded vector of the wire surface state features. This efficient defect recognition ability ensures that each section of wire on the production line can meet strict quality standards, greatly improving the consistency and stability of product quality.
[0063] In summary, the computer vision-based wire production defect detection method according to the embodiments of this application is clarified. First, it obtains the wire characteristics and detection requirements input by the user, intelligently adjusts the lighting system parameters by combining the wire characteristics and detection requirements, optimizes the acquisition process of the wire image based on the lighting system parameters, and further uses deep learning-based image processing technology to improve the accuracy of wire image defect recognition. In this way, the flexibility and adaptability of the detection system can be significantly improved, enabling it to better cope with the challenges brought by the diversity of wire types and complex production environments, thereby enhancing the accuracy of wire defect detection and improving the overall efficiency of the production line and product quality.
[0064] Furthermore, a computer vision-based wire production defect detection system is also provided.
[0065] Figure 5 FIG. is a block diagram of a computer vision-based wire production defect detection system according to an embodiment of this application. As Figure 5 shown, the computer vision-based wire production defect detection system 300 according to the embodiments of this application includes: an information acquisition module 310 for acquiring the wire characteristics and detection requirements input by the user; a lighting mode determination module 320 for specifying the lighting mode and installation angle of the lighting system based on the wire characteristics and detection requirements; a wire image acquisition module 330 for using a camera to acquire a wire image of the wire to be detected under the action of the lighting system; a wire surface state feature extraction module 340 for extracting image features in the wire image to obtain encoded features of the wire surface state; and a wire production defect detection module 350 for determining whether there are defects in the wire based on the encoded features of the wire surface state.
[0066] As described above, the computer vision-based wire production defect detection system 300 according to the embodiments of the present application can be implemented in various wireless terminals, such as a server with a computer vision-based wire production defect detection algorithm. In a possible implementation manner, the computer vision-based wire production defect detection system 300 according to the embodiments of the present application can be integrated into the wireless terminal as a software module and / or a hardware module. For example, the computer vision-based wire production defect detection system 300 can be a software module in the operating system of the wireless terminal, or can be an application developed for the wireless terminal; of course, the computer vision-based wire production defect detection system 300 can also be one of the many hardware modules of the wireless terminal.
[0067] Alternatively, in another example, the computer vision-based wire production defect detection system 300 and the wireless terminal can also be separate devices, and the computer vision-based wire production defect detection system 300 can be connected to the wireless terminal through a wired and / or wireless network, and transmit and interact information in accordance with a predefined data format.
[0068] The embodiments of the present disclosure have been described above. The above description is exemplary and not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, the practical application, or the improvement of the technology in the market, or to enable other ordinary skilled persons in the technical field to understand the embodiments disclosed herein.
Claims
1. A method for detecting defects in electric wire production based on computer vision, characterized in that: include: Obtain wire characteristics and testing requirements input by the user; Based on the characteristics of the electric wires and the detection requirements, the lighting mode and installation angle of the lighting system are specified, including: performing sparse optimization of the implicit association strength of the lighting information on the implicit characteristics of the electric wires and the implicit characteristics of the detection requirements to obtain the implicit coding characteristics of the lighting requirements; based on the implicit coding characteristics of the lighting requirements, determining the lighting mode and installation angle of the lighting system; Under the action of the lighting system, a camera is used to collect wire images of the inspected wires; Extracting image features from the wire image to obtain wire surface state coding features; Based on the wire surface status coding features, determine whether the wire has defects.
2. The method for detecting electric wire production defects based on computer vision according to claim 1, characterized in that: Wire characteristics include material, color, diameter, shape and movement speed; detection requirements include detection speed, detection accuracy, false detection rate and environmental conditions.
3. The method for detecting electric wire production defects based on computer vision according to claim 2, characterized in that: The implicit features of the wire characteristics and the detection requirements are sparsely optimized for the implicit association strength of lighting information to obtain the implicit coding features of lighting requirements, including: Using the wire characteristic embedding matrix to perform structured mapping encoding on the wire characteristics to obtain a wire characteristic structured encoding vector; The detection requirements are passed through a semantic encoder based on the Bert model to obtain a detection requirement semantic embedding encoding vector; The implicit features of lighting requirements are interactively analyzed based on sparse constraints on the structured coding vector of wire characteristics and the semantic embedded coding vector of detection requirements to obtain the implicit coding vector of lighting requirements.
4. The method for detecting electric wire production defects based on computer vision according to claim 3, characterized in that: The implicit features of lighting requirements are interactively analyzed based on sparse constraints on the structured coding vector of wire characteristics and the semantic embedding coding vector of detection requirements to obtain the implicit coding vector of lighting requirements, including: The structured coding vector of the wire characteristics and the semantic embedding coding vector of the detection requirements are mapped to the implicit association topology of the lighting requirements based on the feature phase space reconstruction to obtain a set of joint coding matrices of the lighting requirements implicit query space; Based on the lighting demand spatial sparse constraint relationship of each lighting demand implicit query space joint coding matrix in the set of lighting demand implicit query space joint coding matrices, the set of lighting demand implicit query space joint coding matrices is adaptively aggregated to obtain a lighting demand implicit coding vector.
5. The method for detecting electric wire production defects based on computer vision according to claim 4, characterized in that: The structured coding vector of the wire characteristics and the semantic embedding coding vector of the detection requirements are mapped to the implicit association topology of the lighting requirements based on the feature phase space reconstruction to obtain a set of joint coding matrices of the implicit query space of the lighting requirements, including: Reconstructing the feature phase space of the structured coding vector of the electric wire characteristic and the semantic embedded coding vector of the detection requirement based on one-dimensional convolution coding to obtain a set of local feature coding vectors of the electric wire characteristic and a set of semantic feature coding vectors of the detection requirement; Calculate the initial matrix of the lighting demand implicit query space joint coding between each corresponding group of the local feature coding vectors of electric wire characteristics and the semantic feature coding vectors of detection requirements in the set of the local feature coding vectors of electric wire characteristics and the set of the semantic feature coding vectors of detection requirements to obtain the set of the initial matrix of the lighting demand implicit query space joint coding; A lighting demand interaction mode optimization based on a phase specification is performed on each lighting demand implicit query space joint coding initial matrix in the set of lighting demand implicit query space joint coding initial matrices to obtain a set of lighting demand implicit query space joint coding matrices.
6. The method for detecting electric wire production defects based on computer vision according to claim 5, characterized in that: Based on the lighting demand spatial sparse constraint relationship of each lighting demand implicit query space joint coding matrix in the set of lighting demand implicit query space joint coding matrices, the set of lighting demand implicit query space joint coding matrices is adaptively aggregated to obtain a lighting demand implicit coding vector, including: Calculating the lighting demand space sparse constraint factor of each lighting demand implicit query space joint coding matrix in the set of lighting demand implicit query space joint coding matrices to obtain a set of lighting demand space sparse constraint factors; Based on a set of lighting demand spatial sparse constraint factors, a set of lighting demand implicit query spatial joint coding matrices is adaptively aggregated to obtain a lighting demand implicit coding vector.
7. The method for detecting electric wire production defects based on computer vision according to claim 6, characterized in that: Based on the implicit coding features of lighting requirements, determine the lighting method and installation angle of the lighting system, including: Inputting the lighting requirement implicit encoding vector into the classifier-based lighting method recommender to obtain the lighting method of the lighting system; The lighting requirement implicit coding vector is input into the decoder-based installation angle recommender to obtain the installation angle of the lighting system.
8. The method for detecting electric wire production defects based on computer vision according to claim 1, characterized in that: Extract image features from the wire image to obtain wire surface state coding features, including: Performing illumination equalization on the wire image to obtain a wire enhanced image; The wire enhanced image is passed through the wire detection network based on the YOLO model to obtain the wire ROI image; A wire surface state feature extractor based on a hole convolutional neural network model is used to extract features from the wire ROI image to obtain a wire surface state feature encoding vector as the wire surface state encoding feature.
9. The method for detecting electric wire production defects based on computer vision according to claim 1, characterized in that: Determine whether the wire has defects based on the wire surface status coding features, including: The wire surface state feature coding vector is input into a defect identifier based on a support vector machine to obtain a recognition result, and the recognition result is used to indicate whether there is a defect.
10. A computer vision-based wire production defect detection system, characterized in that: include: An information acquisition module, used to acquire the wire characteristics and detection requirements input by the user; A lighting mode determination module is used to specify the lighting mode and installation angle of the lighting system based on the characteristics of the wires and the detection requirements; The wire image acquisition module is used to acquire the wire image of the detected wire by using a camera under the action of the lighting system; A wire surface state feature extraction module is used to extract image features in the wire image to obtain wire surface state coding features; The wire production defect detection module is used to determine whether the wire has defects based on the wire surface state coding features.