A method for detecting the wiring of an industrial machine tool circuit and a device suitable therefor

By improving image segmentation and OCR models, and combining lightweight adaptation modules and image fusion technology, the problems of missing segmentation of tiny tags and low recognition efficiency in the circuit wiring detection of industrial machine tools have been solved, achieving efficient and accurate circuit wiring detection.

CN120823609BActive Publication Date: 2026-04-07NANJING TALIANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies for testing wiring in industrial machine tools suffer from problems such as missing segmentation of tiny tags, low recognition efficiency, and high false detection rate of damaged characters. In particular, manual testing is slow and unreliable in high-density wiring environments.

Method used

An improved image segmentation model and OCR model are adopted. The segmentation accuracy of shadow areas is enhanced by the lightweight adapter module InjectAdapter. Multiple label images are stitched into a single large image through image fusion technology. The OCR model is trained in combination with the special character set of machine tool interface labels to achieve efficient recognition.

Benefits of technology

It significantly improves detection speed and accuracy, reduces false negative rate and debugging costs, provides a highly reliable intelligent detection method, increases detection speed by 10 times, and significantly improves pass rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120823609B_ABST
    Figure CN120823609B_ABST
Patent Text Reader

Abstract

The application relates to the field of industrial visual detection, and particularly discloses an industrial machine tool circuit wiring detection method and equipment suitable for the same. The method comprises the following steps: collecting a circuit wiring product image; extracting an interface label image through an improved image segmentation model embedded with an InjectAdapter module, injecting high-frequency features to improve shadow segmentation precision under the condition of freezing original model parameters; fusing discrete labels into a global image according to original spatial positions; inputting an OCR model to recognize characters and comparing the characters with a standard circuit diagram; and outputting a detection report and storing the detection report. The equipment corresponds to a label segmentation module, a topology fusion module, a character recognition module and a result analysis module. The innovation lies in that a lightweight adaptive mechanism solves label missing segmentation under shadow interference; a coordinate mapping type fusion realizes batch efficient recognition; and a PAS module generates an industrial defect sample to improve the robustness of the OCR. The application significantly improves detection precision and efficiency and reduces artificial cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial visual inspection technology, and in particular to a method for inspecting the wiring of industrial machine tools and equipment applicable thereto. Background Technology

[0002] In the process of intelligent upgrading of industrial machine tools, the accuracy of circuit wiring directly affects equipment operation safety and production efficiency. Currently, the manufacturing industry mainly relies on manual visual inspection of the labels on the wiring interfaces. However, in high-density wiring environments, manual inspection is slow and prone to omissions and errors due to visual fatigue, resulting in extended equipment debugging cycles and increased maintenance costs. The reliability of manual identification is further reduced, especially when the interface labels are in shaded areas or have minor dirt.

[0003] While existing machine vision-based detection solutions attempt to replace manual labor, they still have significant drawbacks: traditional image segmentation methods are sensitive to changes in lighting and complex background interference, making it difficult to accurately extract tiny labels in shadows; while general character recognition technologies are not adaptable to the blurry and damaged labels specific to industrial scenarios, and require individual recognition of each segmented label, resulting in a lengthy processing flow. Some solutions attempt to optimize label localization through clustering algorithms, but these rely on manually designed features and cannot balance segmentation robustness with batch recognition efficiency. Summary of the Invention

[0004] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.

[0005] In view of the problems existing in the prior art, the present invention is proposed.

[0006] Therefore, the problem to be solved by the present invention is to overcome the defects of missing segmentation of tiny tags, low recognition efficiency and high false detection rate of contaminated characters in the circuit wiring detection of industrial machine tools.

[0007] To address the aforementioned technical problems, this invention provides the following technical solution: a method for detecting circuit wiring in industrial machine tools, comprising: acquiring a product image of the circuit wiring to be detected; inputting the product image into an improved image segmentation model to segment and extract label images on the circuit wiring interfaces; the improved image segmentation model consists of a pre-trained large model embedded with a lightweight adapter module InjectAdapter, which improves the segmentation accuracy of shadow areas by injecting high-frequency enhancement features into the Transformer layer while freezing the original model parameters; stitching and fusing the multiple segmented label images into a single large image according to their original spatial positions; inputting the fused label image into an OCR model to recognize character information and comparing it with a standard circuit diagram to obtain the detection result; visually outputting and storing the detection result.

[0008] As a preferred embodiment of the industrial machine tool circuit wiring detection method of the present invention, the implementation of the lightweight adapter module InjectAdapter includes separating the high-frequency texture and low-frequency contour information of the image through a high-frequency enhancement module to generate fused features. ;

[0009] Will Input a dual MLP structure and generate the hint vector using the following formula. And inject it into each layer of the large model's Transformer:

[0010]

[0011] in Linear layers with a configurable number of layers are used for feature compression; Map features to dimensions that match the large model.

[0012] As a preferred embodiment of the industrial machine tool circuit wiring detection method of the present invention, the operation of the high-frequency enhancement module includes: frequency separation, downsampling the input feature map to extract low-frequency components, and calculating the high-frequency residual by the difference with the original feature map; independent enhancement, using a self-attention mechanism to enhance high-frequency texture; frequency fusion, processing high / low frequency information separately through a dual-branch convolution structure, and splicing and fusing them after channel attention mechanism and convolution fusion operation.

[0013] As a preferred embodiment of the industrial machine tool circuit wiring detection method of the present invention, the training of the OCR model includes constructing a limited character set specific to the machine tool interface label, dividing it into a normal character set and an abnormal character set containing three types of typical industrial defects: broken strokes, ink stains, and character distortion; simulating the defect morphology of industrial scenarios through the Perlin Noise Anomaly Region Generation Module (PAS), and synthesizing training samples to expand the dataset.

[0014] As a preferred embodiment of the industrial machine tool circuit wiring detection method of the present invention, the defect generation of the Perlin noise abnormal area generation module (PAS) satisfies the following conditions: the stroke break length accounts for ≥15% of the character pixels; the ink contamination area accounts for 10%-30%; and the character distortion angle is within ±15°.

[0015] As a preferred embodiment of the industrial machine tool circuit wiring detection method of the present invention, the OCR model is based on the PaddleOCR framework, and is fine-tuned by combining simulated datasets and real defect datasets, with the recognition target limited to the machine tool interface character set.

[0016] To address the aforementioned problems, this invention also provides an industrial machine tool circuit wiring testing device, applicable to industrial machine tool circuit wiring testing methods. It includes an image segmentation module, an image segmentation model integrating an InjectAdapter module, which extracts label images of circuit wiring interfaces from product images; an image fusion module, which stitches the label images together into a single global image according to their original spatial positions; an image recognition module, which recognizes the label character information in the fused image; and a result comparison module, which compares the recognition results with a standard circuit diagram and outputs a testing conclusion.

[0017] The beneficial effects of this invention are as follows: This invention significantly improves industrial inspection efficiency through an innovative combination of technologies: First, a lightweight adaptation module enhances the segmentation capability of large models. Without adjusting the original model parameters, a high-frequency feature injection mechanism greatly improves the extraction accuracy of tiny labels in shadow areas, completely solving the problem of missed segmentation under complex lighting conditions in traditional methods. Second, a unique coordinate mapping image fusion technology reassembles discrete label sub-images into a global image according to physical topological relationships, achieving efficient batch OCR recognition and greatly reducing computational resource consumption. Finally, an industrial-specific character set is constructed through a controllable defect generation strategy, specifically enhancing the model's robustness in recognizing contaminated and distorted labels. The entire solution significantly reduces the missed detection rate and debugging costs while improving detection speed, providing a highly reliable intelligent inspection method for industrial machine tool circuit wiring. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0019] Figure 1 This is a flowchart illustrating the overall concept of the industrial machine tool circuit wiring detection method of the present invention.

[0020] Figure 2This is a structural diagram of the improved image segmentation model of the present invention;

[0021] Figure 3 This is a schematic diagram of the structural composition of the device of the present invention. Detailed Implementation

[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0024] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single embodiment or an embodiment selectively excluded from other embodiments.

[0025] Example 1, referring to Figures 1-2 This is the first embodiment of the present invention. This embodiment provides a method for detecting the wiring of an industrial machine tool circuit. The method for detecting the wiring of an industrial machine tool circuit includes S1: acquiring a product image of the wiring of the circuit to be tested and preprocessing the image;

[0026] Preprocessing here may include image denoising: removing noise interference in the image through mean filtering and Gaussian blurring to improve the accuracy of subsequent segmentation and recognition; image enhancement: applying histogram equalization to improve the image clarity under different lighting conditions, etc.

[0027] S2: Input the product image into the improved image segmentation model to segment and extract the label image on the circuit wiring interface;

[0028] In one embodiment, the image information of a qualified label includes at least one of the following: circuit wiring content, circuit wiring type, circuit wiring location, and circuit wiring shape; by recognizing the interface identification information in the label image, the correctness and integrity of the circuit wiring can be directly determined.

[0029] The improved image segmentation model consists of a pre-trained large model embedded with a lightweight adapter module InjectAdapter. Under the condition of freezing the original model parameters, the segmentation accuracy of the shadow region is improved by injecting high-frequency enhancement features into the Transformer layer.

[0030] This invention improves the large-scale image segmentation model SAM, trained on a massive dataset containing billions of masks, learning general object segmentation patterns. In circuit wiring detection, it can generalize to unstructured images with severe noise interference. The unimproved SAM model still suffers from performance bottlenecks in fine-grained region segmentation, such as shadow detection. Addressing the need for accurate shadow region segmentation in circuit detection scenarios, the original model's general capabilities are insufficient to meet the accuracy requirements of specific tasks. Unlike traditional improvement strategies, we propose a lightweight adaptation module, InjectAdapter. While maintaining the original model parameters, it seamlessly integrates visual cues relevant to downstream tasks into the segmentation network through efficient modular design, significantly improving the SAM model's ability to perceive and segment shadow regions. This method not only retains the strong generalization performance of SAM but also enhances its adaptability and expressiveness in specific tasks. Its structure is as follows: Figure 2 As shown.

[0031] S3: The multiple segmented label images are stitched together and fused into a single large image according to their original spatial positions;

[0032] By merging multiple tag images into a single image, the computational overhead of processing each small image individually can be reduced, improving recognition efficiency and facilitating consistent comparison with standard circuit diagrams. In dense wiring scenarios, processing each tag image individually may lead to wasted computational resources or recognition errors. Merging images provides a global perspective, enhancing the understanding of the overall wiring layout. Especially in high-density wiring scenarios, it helps to capture the spatial relationships between tags and potential wiring errors (such as misordering or missing connections).

[0033] S4: Input the fused label image into the OCR model to recognize character information, and compare it with the standard circuit diagram to obtain the detection result;

[0034] It is worth noting that the fused label image here is related to the product circuitry. Figure 1 Using the same input OCR model, the detection result of the circuit wiring is obtained by comparing the output results.

[0035] S5: Visualize and store the detection results;

[0036] The test results will be directly labeled on the test images. Inspectors will decide whether to release or rework based on the labeling results, and the testing speed for each batch of labels will be tracked. All comparison results will be automatically saved for later verification.

[0037] Specifically, the implementation of the lightweight adapter module InjectAdapter includes separating the high-frequency texture and low-frequency contour information of the image through a high-frequency enhancement module to generate fused features. ;

[0038] Will Input a dual MLP structure and generate the hint vector using the following formula. And inject it into each layer of the large model's Transformer:

[0039]

[0040] in Linear layers with a configurable number of layers are used for feature compression; Map features to dimensions that match the large model;

[0041] The high-frequency enhancement module is designed based on the characteristics of actual circuit images to quickly separate high-frequency and low-frequency information from an image. It then fuses this information using a specially designed multi-path structure to obtain specific high- and low-frequency fused information. This information is further combined with latent information from a larger model to form a unified information stream. .

[0042] The InjectAdapter module aims to enhance the generalization ability of SAM in specific tasks in a lightweight manner. Based on the traditional Adapter structure, this module employs a dual MLP architecture to extract information from high-frequency enhancement modules. enter Features are extracted and activated by The mapping to the dimension matching the SAM backbone Transformer layer generates the cue vector. .

[0043] In this embodiment, This is a multilayer perceptron with 15 linear layers, used for feature extraction from integrated frequency information. All layers use the GELU activation function, and the final generated cue vector... Soft injection of edge conditions is implemented in each Transformer layer of SAM.

[0044] After training on a self-built dataset, SAM can better learn high-frequency boundary information in images. It can also effectively segment images when faced with unstructured, noisy, or diverse defect types. The fine-tuned model does not require parameter retuning or process redesign when facing new product types.

[0045] Specifically, the high-frequency enhancement module operates by frequency separation, which uses average pooling to downsample the input feature map to extract its low-frequency components. Subsequently, the low-frequency features are upsampled back to their original size using bilinear interpolation and subtracted from the original feature map to obtain high-frequency residual information.

[0046] Independent enhancement employs a self-attention mechanism to strengthen high-frequency textures. After obtaining high-frequency features, a self-attention mechanism is introduced to model them globally, thereby enhancing the expressive power of important high-frequency detail information. Low-frequency components are then Gaussian smoothed. In this way, the model can explicitly distinguish between high-frequency and low-frequency features, facilitating subsequent independent modeling and fusion.

[0047] Frequency fusion processes high / low frequency information separately through a dual-branch convolutional structure, and then concatenates and fuses the information after channel attention mechanism and convolutional fusion operation.

[0048] To avoid information loss and insufficient fusion caused by directly performing frequency fusion through ordinary convolutional blocks, a frequency fusion module is designed to process and fuse information from different frequency bands separately. This module contains two parallel convolutional branches: one branch focuses on capturing high-frequency detail textures, while the other focuses on extracting low-frequency contour and structural information. Each branch uses a multi-path structure to process and fuse information from different frequency bands separately. After processing, the features of the low-frequency branch are upsampled and aligned with the high-frequency features, followed by feature concatenation. Then, a channel attention mechanism and convolutional fusion operation are sequentially applied to achieve effective integration of frequency information.

[0049] Specifically, the training of the OCR model includes constructing a limited character set specific to machine tool interface labels, dividing it into a normal character set and an abnormal character set containing three types of typical industrial defects: broken strokes, ink smudges, and character distortion; simulating defect morphology in industrial scenarios through the Perlin Noise Anomaly Region Generation Module (PAS), and synthesizing training samples to expand the dataset.

[0050] In system design, the accuracy of OCR recognition is crucial, as OCR errors can lead to misjudgments. Therefore, a broad and accurate dataset is essential. Unlike OCR recognition in everyday life, in machine tool manufacturing, interface design is regular, and the required circuit interfaces are repetitive, thus limiting the number of characters to be recognized. This naturally reduces the difficulty of OCR recognition but increases the accuracy requirements. To more effectively optimize the model for machine tool interfaces, it is necessary to collect all the characters of the machine tool to be inspected and construct a character set. For OCR recognition tasks with a limited character set, constructing a targeted simulated dataset can significantly improve recognition accuracy.

[0051] It is worth noting that abnormal characters refer to character defects caused by environmental or process problems in actual industrial scenarios. In this embodiment, these include: broken strokes, where some strokes of the character are missing or broken; ink stains, where characters are blurred due to oil stains or ink marks; and distorted characters, where characters are deformed due to lighting, angle, or printing problems.

[0052] Specifically, the defects generated by the Perlin Noise Anomaly Area Generation Module (PAS) meet the following requirements: stroke break length accounts for ≥15% of the character pixels; ink smudge area accounts for 10%-30%; and character distortion angle is within ±15°.

[0053] The Perlin Anomaly Synthesis (PAS) module guides the generation of realistic defects, accurately matching the true defect morphology in industrial scenarios. It balances the difficulty of detection with the generalization requirements of the model, further improving the robustness of the model.

[0054] Specifically, the OCR model is based on the PaddleOCR framework and is fine-tuned by combining simulated datasets and real defect datasets. The target for recognition is limited to the machine tool interface character set.

[0055] The open-source framework PaddleOCR is used for character recognition in machine tool circuit inspection tasks. PaddleOCR's character recognition model is designed to be efficient, fast, and small in size, making it ideal for deployment and operation on equipment. To improve the system's recognition accuracy, this invention uses a self-built simulated dataset and a real-world scene dataset to fine-tune the model. After training on the self-built dataset, the model can accurately recognize characters on machine tool interfaces, even under severe shadow interference or when characters are blurry.

[0056] According to on-site testing statistics, the previous manual testing speed for circuit labels was 20-30 labels per minute. However, after implementing the solution of this invention, the label testing speed increased tenfold to 200-300 labels per minute, and the pass rate also improved, greatly increasing product production capacity and ensuring product quality.

[0057] Example 2, refer to Figure 3 This is the second embodiment of the present invention. This embodiment proposes an industrial machine tool circuit wiring detection device, including an image segmentation module, an image segmentation model integrating an InjectAdapter module, which extracts the label image of the circuit wiring interface from the product image; an image fusion module, which stitches the label image into a single global image according to the original spatial position; an image recognition module, which recognizes the label character information in the fused image; and a result comparison module, which compares the recognition result with the standard circuit diagram and outputs the detection conclusion.

[0058] It is worth noting that the image fusion module stitches the label images together according to their original spatial positions in the product image, ensuring that the relative relationships between the labels remain consistent, thereby providing unified input data for subsequent OCR recognition.

[0059] By implementing this invention, users can alleviate the problems existing in image processing-based solutions, such as sensitivity to lighting conditions, shooting angle and surface material, poor robustness, difficulty in covering all defect patterns, especially when the defect manifestation is blurry or similar to the background, resulting in low segmentation accuracy, and the need for algorithm re-tuning or even redesign of the process when facing new product types, leading to poor system scalability and high maintenance costs.

[0060] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for testing the wiring of an industrial machine tool circuit, characterized in that: include, Acquire product images of the wiring of the circuit to be tested; The product image is input into the improved image segmentation model to segment and extract the label image on the circuit wiring interface; The improved image segmentation model consists of a pre-trained large model embedded with a lightweight adapter module InjectAdapter. Under the condition of freezing the original model parameters, the segmentation accuracy of the shadow region is improved by injecting high-frequency enhancement features into the Transformer layer. The segmented label images are stitched together and fused into a single large image according to their original spatial positions; The fused label image is input into the OCR model to recognize character information, and the detection result is obtained by comparing it with the standard circuit diagram. Visualize and store the detection results; The implementation of the lightweight adapter module InjectAdapter includes separating the high-frequency texture and low-frequency contour information of the image through a high-frequency enhancement module to generate fused features. ; Will Input a dual MLP structure and generate the hint vector using the following formula. And inject it into each layer of the large model's Transformer: , in Linear layers with a configurable number of layers are used for feature compression; Map features to dimensions that match the large model; The operation of the high-frequency enhancement module includes frequency separation, downsampling the input feature map to extract low-frequency components, and calculating the high-frequency residual by differencing the original feature map; Independent enhancement, employing a self-attention mechanism to strengthen high-frequency textures; Frequency fusion processes high and low frequency information separately through a dual-branch convolutional structure, and then splices and fuses them after channel attention mechanism and convolutional fusion operation.

2. The industrial machine tool circuit wiring detection method as described in claim 1, characterized in that: The training of the OCR model includes constructing a limited character set specific to machine tool interface labels, which is divided into a normal character set and an abnormal character set containing three types of typical industrial defects: broken strokes, ink contamination, and character distortion. The Perlin noise anomaly region generation module simulates defect morphology in industrial scenarios, and synthesizes training samples to expand the dataset.

3. The industrial machine tool circuit wiring detection method as described in claim 2, characterized in that: The defect generation of the Perlin noise anomaly region generation module meets the following requirements: the stroke break length accounts for ≥15% of the character pixels; the ink smudge area accounts for 10%-30%; and the character distortion angle is within ±15°.

4. The industrial machine tool circuit wiring detection method as described in claim 3, characterized in that: The OCR model is based on the PaddleOCR framework and is fine-tuned by combining simulated datasets and real defect datasets. The target for recognition is limited to the machine tool interface character set.

5. An industrial machine tool circuit wiring testing device, applicable to the industrial machine tool circuit wiring testing method as described in claim 4, characterized in that: include, The image segmentation module integrates the image segmentation model of the InjectAdapter module to extract the label images of circuit wiring interfaces from product images; The image fusion module stitches the label images together into a single global image according to their original spatial positions; The image recognition module identifies label character information in the fused image; The results comparison module compares the identification results with the standard circuit diagram and outputs the detection conclusion.

Citation Information

Patent Citations

  • Electric power metering box illegal wiring detection method based on machine vision

    CN118446999A

  • Image processing method, device, electronic apparatus and storage medium

    US20230138049A1