Object recognition method and system for precast component quality detection based on machine vision

By optimizing camera view sequences and multi-axis adjustment platforms using BIM models and genetic algorithms, and combining fusion attention mechanisms and dynamic lighting compensation, the problems of defect omission and lighting adaptability in machine vision inspection were solved, achieving efficient, real-time, and adaptive inspection of prefabricated components.

CN122157232APending Publication Date: 2026-06-05SHANDONG INST FOR PROD QUALITY INSPECTION

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG INST FOR PROD QUALITY INSPECTION
Filing Date
2026-02-12
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing machine vision inspection solutions are unable to cover the complex geometric structure of prefabricated components, resulting in missed defects, poor generalization ability, inability to adapt to changes in component types and processes in the production line, poor adaptability to lighting compensation, high computing power requirements for traditional 3D point cloud processing, difficulty in meeting real-time inspection needs, and lack of self-evolution capability of the model.

Method used

The camera view sequence is optimized by using BIM model and genetic algorithm, and the blind-spot-free image acquisition is achieved by combining multi-axis adjustment platform. An object recognition model with fusion attention mechanism is adopted, dynamic lighting compensation and lightweight 3D detection are introduced, and incremental model updates are supported.

Benefits of technology

It completely solves the problem of missed defect detection, improves the comprehensiveness and relevance of image acquisition, enhances recognition accuracy and applicability, ensures stable operation of the system under varying lighting conditions, realizes real-time detection and self-evolution capabilities, and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122157232A_ABST
    Figure CN122157232A_ABST
Patent Text Reader

Abstract

The application provides a machine vision-based object recognition prefabricated component quality detection method and system, relates to the prefabricated component quality detection technical field, and comprises the following steps: based on the BIM model of a prefabricated component, an optimal camera visual angle sequence is generated through an optimization algorithm, a multi-axis adjusting platform drives the camera to perform image acquisition on the key detection area of the prefabricated component according to the visual angle sequence; the collected images are subjected to light self-adaptive compensation and environmental interference filtering pretreatment; a object recognition model with a fusion attention mechanism is used to perform multi-type quality object synchronous identification on the pretreated images; the BIM model and the genetic algorithm are used to optimize the camera visual angle sequence, and the multi-axis adjusting platform is used to realize blind area-free image acquisition on the key detection area of the prefabricated component, compared with the traditional fixed visual angle acquisition mode, the defect missing detection problem is solved completely, the comprehensiveness and pertinence of image acquisition are improved significantly, and a foundation is laid for subsequent accurate identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of precast component quality inspection technology, and in particular to a method and system for precast component quality inspection based on machine vision object recognition. Background Technology

[0002] Among existing precast component quality inspection technologies, machine vision inspection has gradually replaced traditional manual inspection due to its advantages of being non-contact and highly efficient. Currently, mainstream machine vision inspection solutions typically use a fixed-viewpoint camera to acquire images of precast components and identify defects in the images using a pre-defined object recognition model. Some solutions introduce simple illumination compensation mechanisms and employ traditional 3D point cloud processing techniques to achieve 3D defect detection. Meanwhile, with the development of deep learning technology, defect recognition schemes based on the YOLO series models are also being applied in precast component inspection, enabling the identification of single or a few types of defects by training samples of specific defect types. However, in existing technologies, fixed-view acquisition is difficult to cover the complex geometric structure of prefabricated components, which can easily lead to missed defects and fail to guarantee the comprehensiveness of the inspection. Moreover, existing object recognition models are mostly designed for single defect types, with poor generalization ability, making it difficult to adapt to changes in component types, processes, and the emergence of new defects in the production line. At the same time, the lighting in the workshop environment is variable, and existing lighting compensation schemes have poor adaptability, which can easily lead to detection drift and affect recognition accuracy. In addition, traditional 3D point cloud processing technology has high computing power requirements, making it difficult to deploy on edge devices on the production line and unable to meet the real-time detection requirements. Finally, the model lacks self-evolution capability. When an unknown defect or a new component model appears, the entire model needs to be retrained, which is cumbersome and affects production efficiency. Therefore, this invention proposes a machine vision-based object recognition method and system for prefabricated component quality inspection to solve the problems existing in the prior art. Summary of the Invention

[0003] To address the aforementioned issues, this invention proposes a machine vision-based method and system for prefabricated component quality inspection. By optimizing the camera view sequence using a BIM model and genetic algorithm, and in conjunction with a multi-axis adjustment platform, blind-spot-free image acquisition of key inspection areas of prefabricated components is achieved. Compared to traditional fixed-view acquisition methods, this completely solves the problem of missed defect detection, significantly improves the comprehensiveness and relevance of image acquisition, and lays the foundation for subsequent accurate identification.

[0004] To achieve the objectives of this invention, the invention is implemented through the following technical solution: a machine vision-based method for quality inspection of prefabricated components, comprising the following steps: S1: Based on the BIM model of prefabricated components, the optimal camera view sequence is generated through optimization algorithm, and the multi-axis adjustment platform is controlled to drive the camera to acquire images of the key detection areas of the prefabricated components according to the view sequence. S2: Perform adaptive illumination compensation and environmental interference filtering preprocessing on the acquired images; S3: An object recognition model using a fusion attention mechanism is used to simultaneously identify multiple types of quality objects in the preprocessed image and output the defect recognition results. S4: When an unknown type of defect or a new component model is identified, the object recognition model is updated incrementally through the online learning module; S5: For scenarios requiring 3D geometric defect detection, a lightweight 3D object recognition framework is used to complete the detection and output the final detection results.

[0005] A further improvement is made in S1, where the optimization algorithm is a genetic algorithm, and the fitness function of the genetic algorithm is used to express the effectiveness of the camera's viewpoint, specifically as follows: , Where: f(x) is the fitness value of the x-th view scheme, the larger the value, the better the view scheme; α is the coverage weight coefficient, the value range is 0.4-0.6, and it is set according to the importance of the detection area; C(x) is the coverage of the x-th view scheme for the key detection area of ​​the precast component, the value range is [0,1], the larger the coverage area, the closer the value is to 1; β is the non-overlap weight coefficient, the value range is 0.2-0.3, which is used to balance coverage and image overlap rate; D(x) is the image non-overlap rate of the x-th view scheme, the value range is [0,1], the larger the non-overlap area, the closer the value is to 1; γ is the energy consumption weight coefficient, the value range is 0.1-0.3, which is used to consider the energy consumption of multi-axis platform adjustment; E(x) is the multi-axis platform adjustment energy consumption corresponding to the x-th view scheme, the unit is J, the larger the adjustment range, the higher the energy consumption.

[0006] A further improvement is made in S2, where adaptive illumination compensation is implemented using a dynamic illumination compensation module (DLC). Image brightness is adjusted based on image histogram analysis, and the specific brightness adjustment formula is as follows: , Where L(i,j) is the brightness value of the adjusted image at pixel (i,j); L(i,j) is the brightness value of the original image at pixel (i,j); H is the preset average brightness threshold of the image, with a value range of 80-120 and a grayscale value of 0-255; H(i,j) is the histogram mean of the brightness interval of pixel (i,j); i is the row coordinate of the pixel, with a value range of [0,M-1], and M is the image height; j is the column coordinate of the pixel, with a value range of [0,N-1], and N is the image width.

[0007] A further improvement is made in S3, where the object recognition model that integrates the attention mechanism introduces a convolutional attention mechanism to calculate the channel weights, specifically using the following formula: , Where M is the channel attention weight matrix with dimensions [C,1,1], and C is the number of feature map channels; σ is the Sigmoid activation function, used to map weight values ​​to the [0,1] interval; MLP is a multilayer perceptron, containing one hidden layer and one output layer, used for dimensionality reduction and expansion of global features; GAP is a global average pooling operation, used to transform the feature map F with dimensions [C,H,W] into a global feature with dimensions [C,1,1]; F is the input feature map of the attention mechanism with dimensions [C,H,W], where H is the feature map height and W is the feature map width; F' is the output feature map of the attention mechanism with the same dimensions as F; ⊗ is a channel-wise multiplication operation, realizing the fusion of feature map and channel weights.

[0008] A further improvement is made in S4, where the incremental model update uses a stochastic gradient descent algorithm to optimize the loss function, and the loss function formula is: , Where L is the total loss value; λ is the classification loss weight, with a value of 0.6-0.8; λ is the regression loss weight, with a value of 0.2-0.4, satisfying λ+λ=1; L is the cross-entropy classification loss, used to measure the difference between the predicted class and the true class; L is the smoothed L1 regression loss, used to measure the difference between the predicted bounding box and the true bounding box.

[0009] A further improvement is made in S5, where the lightweight 3D object recognition framework employs multi-view 2D projection feature reconstruction technology, and the feature reconstruction formula is: , Where: F is the reconstructed 3D feature vector; K is the number of projection viewpoints, ranging from 3 to 6; w is the weight of the 2D feature of the k-th viewpoint, satisfying... , is determined by feature contribution evaluation; F is the 2D projection feature vector under the k-th view, with dimensions [1,D], where D is the feature dimension.

[0010] The machine vision-based object recognition precast component quality inspection system includes an image acquisition module, a preprocessing module, an object recognition module, an adaptive update module, and a control and output module. The image acquisition module optimizes the camera view sequence based on the BIM model and genetic algorithm, and works with a multi-axis adjustment platform to achieve blind-spot-free image acquisition of key inspection areas of precast components. The preprocessing module has a built-in dynamic illumination compensation unit and an interference filtering unit, which are used to adjust the brightness / contrast of the acquired images and filter environmental interference. The object recognition module adopts the YOLOv8 framework with an attention mechanism to achieve synchronous recognition of quality objects of multiple types of prefabricated components, and integrates a lightweight 3D recognition unit for 3D geometric defect detection; the adaptive update module includes an online learning unit and a labeling prompting unit to achieve incremental updates and self-evolution of the object recognition model; the control and output module is used to coordinate the work of each module, receive recognition results and output detection reports, and control the movement of the multi-axis adjustment platform.

[0011] Further improvements are made in that the image acquisition module includes a multi-axis adjustment platform, an industrial camera, and a BIM model analysis unit. The BIM model analysis unit is used to extract the geometric parameters of the prefabricated components and the coordinates of key detection areas, providing basic data for perspective optimization.

[0012] Further improvements are made in that: the dynamic illumination compensation unit in the preprocessing module adjusts the brightness based on image histogram analysis, and the interference filtering unit uses a self-attention mechanism to filter shadows and reflective environmental interference, ensuring that the system operates stably within the illumination range of 0.1 to 10000 lux.

[0013] Further improvements are made in the following aspects: the lightweight 3D recognition unit in the object recognition module adopts the Edge-YOLO lightweight model and is embedded in the edge computing device to achieve real-time detection of 500ms / item; after receiving new sample data, the adaptive update module completes model fine-tuning through loss function and optimization algorithm.

[0014] The beneficial effects of this invention are as follows: 1. This invention optimizes the camera view sequence using BIM model and genetic algorithm, and uses a multi-axis adjustment platform to achieve blind-spot-free image acquisition of key detection areas of precast components. Compared with the traditional fixed-view acquisition method, it completely solves the problem of missed defect detection, significantly improves the comprehensiveness and pertinence of image acquisition, and lays the foundation for subsequent accurate identification.

[0015] 2. This invention introduces a convolutional attention mechanism on the basis of the YOLOv8 framework and combines it with transfer learning to achieve simultaneous recognition of multiple types of quality objects. This solves the problems of high dependence on a single defect type and poor generalization ability of existing models. At the same time, it significantly improves the recognition accuracy of small defects and complex backgrounds and expands the scope of detection applications.

[0016] 3. This invention develops a dynamic illumination compensation module (DLC) and a self-attention mechanism interference filtering unit. Based on image histogram analysis, it adjusts brightness / contrast in real time, filtering out environmental interference such as shadows and reflections. This enables the system to operate stably within an illumination range of 0.1 to 10000 lux with an accuracy fluctuation of <3%. It solves the detection drift problem caused by the changing workshop environment and improves the reliability of the system in real-world scenarios.

[0017] 4. This invention uses multi-view 2D projection feature reconstruction technology to transform 3D geometric defect detection into sequential 2D recognition. Combined with the Edge-YOLO lightweight model embedded in edge computing devices, it achieves real-time detection of 500ms / piece on the Jetson TX2 platform. This solves the problem of high computing power requirements and difficulty in deploying traditional 3D point cloud processing on production lines, and meets the real-time detection requirements of the production line.

[0018] 5. This invention achieves incremental fine-tuning of the object recognition model through an adaptive update module. When an unknown defect or a new component model is identified, only a small number of new samples need to be labeled to complete the model update. There is no need to retrain the entire model, which enables the model to have self-evolution capabilities and continuously adapt to dynamic changes in the production line. This improves the flexibility and practicality of the system and reduces operation and maintenance costs. Attached Figure Description

[0019] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the system of the present invention. Detailed Implementation

[0020] To enhance understanding of the present invention, the present invention will be further described in detail below with reference to embodiments. These embodiments are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention.

[0021] Example 1 according to Figure 1 , 2 As shown, this embodiment proposes a machine vision-based method for quality inspection of prefabricated components, including the following steps: S1: Based on the BIM model of prefabricated components, an optimal camera view sequence is generated through an optimization algorithm. A multi-axis adjustment platform is then controlled to drive the camera to acquire images of key detection areas of the prefabricated components according to the view sequence. The optimization algorithm is a genetic algorithm, and its fitness function expresses the effectiveness of the camera view. The specific formula is as follows: , Where: f(x) is the fitness value of the x-th view scheme, the larger the value, the better the view scheme; α is the coverage weight coefficient, the value range is 0.4-0.6, and it is set according to the importance of the detection area; C(x) is the coverage of the x-th view scheme for the key detection area of ​​the precast component, the value range is [0,1], the larger the coverage area, the closer the value is to 1; β is the non-overlap weight coefficient, the value range is 0.2-0.3, which is used to balance coverage and image overlap rate; D(x) is the image non-overlap rate of the x-th view scheme, the value range is [0,1], the larger the non-overlap area, the closer the value is to 1; γ is the energy consumption weight coefficient, the value range is 0.1-0.3, which is used to consider the energy consumption of multi-axis platform adjustment; E(x) is the multi-axis platform adjustment energy consumption corresponding to the x-th view scheme, the unit is J, the larger the adjustment range, the higher the energy consumption. By optimizing the algorithm to achieve precise planning of the field of view, the blind spots of the fixed field of view are completely avoided, providing a comprehensive and accurate image data source for defect identification; at the same time, the balance between energy consumption and image overlap rate is taken into account, reducing equipment operating costs and data redundancy while ensuring detection effect.

[0022] S2: Preprocessing the acquired images involves adaptive illumination compensation and environmental interference filtering. Adaptive illumination compensation is implemented using a Dynamic Illumination Compensation (DLC) module, which adjusts image brightness based on image histogram analysis. The specific brightness adjustment formula is as follows: , Where L(i,j) is the brightness value of pixel (i,j) in the adjusted image; L(i,j) is the brightness value of pixel (i,j) in the original image; H is the preset average brightness threshold of the image, ranging from 80 to 120, with a grayscale value of 0 to 255; H(i,j) is the histogram mean of the brightness interval of pixel (i,j); i is the row coordinate of the pixel, ranging from [0,M-1], where M is the image height; j is the column coordinate of the pixel, ranging from [0,N-1], where N is the image width. Preprocessing can effectively improve the image signal-to-noise ratio, reduce the masking of defect features by environmental interference such as sudden changes in illumination and shadow reflections; provide high-quality input for subsequent recognition models, and ensure the stability of detection results under different workshop environments.

[0023] S3: An object recognition model employing a fusion attention mechanism performs simultaneous recognition of multiple types of quality objects in the preprocessed image, outputting defect recognition results. The fusion attention mechanism object recognition model introduces a convolutional attention mechanism to calculate channel weights; the specific formula is as follows: , Where M is the channel attention weight matrix with dimensions [C, 1, 1], and C is the number of feature map channels; σ is the Sigmoid activation function, used to map weight values ​​to the [0, 1] interval; MLP is a multilayer perceptron, containing one hidden layer and one output layer, used for dimensionality reduction and expansion of global features; GAP is a global average pooling operation, used to transform the feature map F with dimensions [C, H, W] into a global feature with dimensions [C, 1, 1]; F is the input feature map of the attention mechanism with dimensions [C, H, W], where H is the feature map height and W is the feature map width; F' is the output feature map of the attention mechanism with the same dimensions as F; ⊗ is a channel-wise multiplication operation, realizing the fusion of feature map and channel weights. The attention mechanism can guide the model to focus on small defects and key feature regions, significantly improving the defect recognition accuracy in low-contrast and complex backgrounds; simultaneous recognition of multiple types does not require switching models, significantly improving detection efficiency and adapting to the multi-defect type detection needs of production lines.

[0024] S4: When an unknown type of defect or a new component model is identified, the object recognition model is incrementally updated through the online learning module; the incremental update of the model uses the stochastic gradient descent algorithm to optimize the loss function, and the loss function formula is: , Where L is the total loss value; λ is the classification loss weight, ranging from 0.6 to 0.8; λ is the regression loss weight, ranging from 0.2 to 0.4, satisfying λ + λ = 1; L is the cross-entropy classification loss, used to measure the difference between the predicted class and the true class; L is the smoothed L1 regression loss, used to measure the difference between the predicted bounding box and the true bounding box. Incremental updates do not require retraining the entire model; they can adapt to production line changes with only a small number of new samples, reducing model maintenance costs and downtime. This enables the model to have self-evolution capabilities, continuously adapting to new defects and new component models, and improving the long-term applicability of the system.

[0025] S5: For scenarios requiring 3D geometric defect detection, a lightweight 3D object recognition framework is used to complete the detection and output the final detection results. The lightweight 3D object recognition framework employs multi-view 2D projection feature reconstruction technology; the feature reconstruction formula is as follows: , Where: F is the reconstructed 3D feature vector; K is the number of projection viewpoints, ranging from 3 to 6; w is the weight of the 2D feature of the k-th viewpoint, satisfying... The feature contribution is determined by the feature contribution evaluation; F is the 2D projection feature vector under the k-th view, with dimensions [1,D], where D is the feature dimension. This transforms 3D detection into sequential 2D recognition, significantly reducing computing power requirements and enabling real-time production line detection on edge devices. Feature recombination technology ensures the accuracy of 3D defect detection, while the lightweight design lowers the hardware threshold, facilitating large-scale application.

[0026] A machine vision-based object recognition prefabricated component quality inspection system includes an image acquisition module, a preprocessing module, an object recognition module, an adaptive update module, and a control and output module. The image acquisition module optimizes the camera view sequence based on the BIM model and genetic algorithm, and works with a multi-axis adjustment platform to achieve blind-spot-free image acquisition of key inspection areas of prefabricated components. It can ensure the comprehensiveness of the inspection images from the source and completely avoid the risk of missed detection in traditional fixed-view acquisition. No manual intervention is required for view adjustment, which greatly improves the automation level and inspection efficiency of image acquisition.

[0027] The preprocessing module incorporates a dynamic illumination compensation unit and an interference filtering unit, which are used to adjust the brightness / contrast of the acquired images and filter environmental interference. This effectively improves the image signal-to-noise ratio, providing high-quality input data for the subsequent recognition module and enhancing the system's adaptability to harsh environments such as complex lighting and dust in the workshop.

[0028] The object recognition module adopts the YOLOv8 framework with an attention mechanism to achieve synchronous recognition of quality objects of multiple types of prefabricated components, and integrates a lightweight 3D recognition unit for 3D geometric defect detection; it enables multiple defect types to be detected in one go without switching models, significantly improving detection efficiency; the lightweight design balances detection accuracy and real-time performance, adapting to the high-efficiency detection needs of production lines.

[0029] The adaptive update module includes an online learning unit and a labeling and prompting unit, which are used to realize incremental updates and self-evolution of the object recognition model; enabling the model to quickly adapt to new components and new defects without retraining the entire model, reducing maintenance costs; ensuring the continuity of production line inspection and avoiding production stoppages caused by model updates.

[0030] The control and output module is used to coordinate the work of each module, receive the identification results and output the inspection report, and control the movement of the multi-axis adjustment platform; to ensure that each module operates in a coordinated and orderly manner, and improve the overall inspection efficiency of the system; the intuitive inspection report makes it easy for staff to quickly grasp the defect information and help with production quality control.

[0031] The image acquisition module includes a multi-axis adjustment platform, an industrial camera, and a BIM model analysis unit. The BIM model analysis unit is used to extract the geometric parameters and key detection area coordinates of the prefabricated components, providing basic data for perspective optimization. The introduction of the BIM model analysis unit makes perspective optimization more closely match the actual structure of the components, improving the scientificity and accuracy of the perspective scheme. The accurate key area coordinates provide data support for blind-spot-free acquisition, further reducing the probability of missed defect detection.

[0032] The dynamic illumination compensation unit in the preprocessing module adjusts brightness based on image histogram analysis, while the interference filtering unit uses a self-attention mechanism to filter environmental interference such as shadows and reflections, ensuring stable operation of the system within the illumination range of 0.1 to 10000 lux. The dynamic illumination compensation unit can adapt to extreme lighting environments in real time, ensuring image quality stability. The interference filtering unit effectively eliminates environmental noise, making the detection results unaffected by shadows and reflections, thus improving the reliability of the system in real workshop scenarios.

[0033] The lightweight 3D recognition unit in the object recognition module adopts the Edge-YOLO lightweight model and is embedded in an edge computing device to achieve real-time detection of 500ms / piece. Edge computing deployment significantly reduces data transmission latency, ensuring the real-time detection needs of the production line and adapting to the high-speed production rhythm. The lightweight model reduces the hardware configuration requirements of the equipment while ensuring detection accuracy, saving deployment costs.

[0034] After receiving new sample data, the adaptive update module completes model fine-tuning through loss function and optimization algorithm. The fine-tuning method only requires a small number of new samples, which greatly shortens the model update time and improves the system's response speed to production line changes. It avoids the cumbersome process of full training and reduces the technical threshold and time cost of model maintenance.

[0035] Example 2 according to Figure 1 , 2 As shown, this embodiment proposes a machine vision-based object recognition method and system for prefabricated component quality inspection. Targeting the quality inspection scenario of prefabricated wall panels with dimensions of 2400mm × 1200mm × 200mm, the key inspection areas include panel corners, edge joints, and surface flatness. First, the geometric parameters of the wall panel and the coordinates of the key inspection areas are extracted using a BIM model parsing unit. These parameters are then input into a genetic algorithm for viewpoint optimization, with the fitness function set as α=0.5, β=0.25, γ=0.25, and H=100. After 20 iterations, the genetic algorithm generates six optimal viewpoints. A multi-axis adjustment platform is then used to sequentially acquire images from an industrial camera (1920×1080 resolution). Testing shows that this viewpoint sequence achieves 100% coverage of the key areas, reducing the false negative rate from 15% to 0.8% compared to the traditional method of acquiring images from three fixed viewpoints.

[0036] Example 3 according to Figure 1 , 2 As shown, this embodiment proposes a machine vision-based object recognition method and system for precast component quality inspection. It identifies three defect types in precast beam components: cracks, holes, and exposed reinforcement. A training set of 5000 samples is constructed (1500 samples for each defect type and 500 normal samples). A convolutional attention mechanism is introduced based on the YOLOv8 model, and channel weights are calculated using the formula described in claim 4, where the number of feature map channels C=128, H=64, and W=64. A transfer learning method is employed, using pre-trained weights from the COCO dataset as initial values, and training is iterated for 100 epochs. Test results show that the model achieves an average recognition accuracy of 96.3% for the three defects, with a recognition accuracy of 92.1% for microcracks (width < 0.2 mm). Compared to the YOLOv8 model without the attention mechanism, the average recognition accuracy is improved by 7.8%.

[0037] Example 4 according to Figure 1 , 2 As shown, this embodiment proposes a machine vision-based method and system for prefabricated component quality inspection, simulating a novel defect scenario of "honeycomb-like pitting" in prefabricated column components on a production line. After identifying the unknown defect, the system prompts the operator to annotate it, and 50 annotated samples are added to the training set. The model is incrementally fine-tuned using the loss function (λ=0.7, λ=0.3) and stochastic gradient descent algorithm described in claim 6, with a learning rate set to 0.001 and fine-tuning iterations for 20 epochs. After fine-tuning, the model achieves a 93.5% accuracy in identifying the "honeycomb-like pitting" defect. The entire update process takes only 15 minutes, which is 87.5% more efficient than retraining the entire model (which takes 2 hours), without affecting the normal operation of the production line.

[0038] Example 5 according to Figure 1 , 2As shown, this embodiment proposes a machine vision-based method and system for detecting the quality of prefabricated components. Prefabricated floor slab components are detected under different lighting conditions (0.1 lux, 100 lux, 1000 lux, and 10000 lux). A dynamic lighting compensation module is activated, and the image brightness is adjusted in real time using the brightness adjustment formula described in claim 3. In a low-light environment of 0.1 lux, the image brightness is adjusted from an initial grayscale value of 20 to 95; in a strong light environment of 10000 lux, the image brightness is adjusted from an initial grayscale value of 230 to 105. The detection results show that the model's recognition accuracy under different lighting conditions is 94.2%, 95.1%, 95.3%, and 94.8%, respectively, with an accuracy fluctuation of only 0.5%, far less than the 3% fluctuation threshold of existing technologies, effectively solving the detection drift problem caused by varying lighting conditions.

[0039] Example 6 according to Figure 1 , 2 As shown, this embodiment proposes a machine vision-based object recognition method and system for prefabricated component quality inspection. It detects three-dimensional geometric defects (step height deviation, side verticality deviation) in prefabricated stair components, employing the multi-view 2D projection feature reconstruction formula described in claim 5, setting the number of projection views K=4, and weights w=0.3, w=0.25, w=0.25, and w=0.2. The Edge-YOLO lightweight model is embedded into a Jetson TX2 edge computing device for real-time component inspection. Test results show that the inspection time for a single component is 480ms, meeting the production line requirement of 500ms / piece; the detection error of three-dimensional geometric defects is less than 0.5mm. Compared with the traditional 3D point cloud processing solution (detection time 2.5s, error 0.8mm), the detection speed is improved by 80.8%, and the detection accuracy is improved by 37.5%.

[0040] Validation data: After on-site testing on multiple precast component production lines (covering five component types: wall panels, beams, columns, floor slabs, and stairs), the core performance indicators are shown in the table below: As shown in the table above, the present invention is significantly superior to the prior art in terms of detection comprehensiveness, accuracy, environmental adaptability, real-time performance and model flexibility, and can effectively meet the high-quality detection requirements of precast component production lines.

[0041] This invention optimizes camera view sequences using BIM models and genetic algorithms, and, in conjunction with a multi-axis adjustment platform, achieves blind-spot-free image acquisition of key inspection areas of precast components. Compared to traditional fixed-view acquisition methods, this completely solves the problem of missed defect detection, significantly improving the comprehensiveness and targeting of image acquisition, laying the foundation for subsequent accurate identification. Furthermore, this invention introduces a convolutional attention mechanism based on the YOLOv8 framework, combined with transfer learning to achieve simultaneous identification of multiple types of quality objects. This solves the problems of high dependence on single defect types and poor generalization ability in existing models, while significantly improving the identification accuracy of minute defects and complex backgrounds, expanding the scope of detection applicability. Simultaneously, this invention develops a dynamic illumination compensation module (DLC) and a self-attention mechanism interference filtering unit. Based on image histogram analysis, it adjusts brightness / contrast in real time, filtering environmental interference such as shadows and reflections. This allows the system to operate stably within an illumination range of 0.1–10000 lux, with an accuracy fluctuation of <3%, solving the detection drift problem caused by the changing workshop environment and improving the system's reliability in real-world scenarios. Furthermore, this invention employs multi-view 2D projection feature reconstruction technology to transform 3D geometric defect detection into sequential 2D recognition. Combined with the Edge-YOLO lightweight model embedded in an edge computing device, it achieves real-time detection of 500ms / piece on the Jetson TX2 platform. This solves the problems of high computing power requirements and difficulty in deploying traditional 3D point cloud processing on production lines, meeting the real-time detection needs of the production line. Finally, this invention uses an adaptive update module to achieve incremental fine-tuning of the object recognition model. When an unknown defect or a new component model is identified, only a small number of new samples need to be labeled to complete the model update, without retraining the entire model. This gives the model self-evolution capabilities, enabling it to continuously adapt to dynamic changes in the production line, improving the system's flexibility and practicality, and reducing maintenance costs.

[0042] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for detecting the quality of precast components based on object recognition using machine vision, characterized in that: Includes the following steps: S1: Based on the BIM model of prefabricated components, the optimal camera view sequence is generated through optimization algorithm, and the multi-axis adjustment platform is controlled to drive the camera to acquire images of the key detection areas of the prefabricated components according to the view sequence. S2: Perform adaptive illumination compensation and environmental interference filtering preprocessing on the acquired images; S3: An object recognition model using a fusion attention mechanism is used to simultaneously identify multiple types of quality objects in the preprocessed image and output the defect recognition results. S4: When an unknown type of defect or a new component model is identified, the object recognition model is updated incrementally through the online learning module; S5: For scenarios requiring 3D geometric defect detection, a lightweight 3D object recognition framework is used to complete the detection and output the final detection results.

2. The method for quality inspection of prefabricated components based on machine vision for object recognition according to claim 1, characterized in that: In step S1, the optimization algorithm is a genetic algorithm. The fitness function of the genetic algorithm is used to express the effectiveness of the camera's viewpoint, and the specific formula is as follows: , Where: f(x) is the fitness value of the x-th view scheme, the larger the value, the better the view scheme; α is the coverage weight coefficient, the value range is 0.4-0.6, and it is set according to the importance of the detection area; C(x) is the coverage of the x-th view scheme for the key detection area of ​​the precast component, the value range is [0,1], the larger the coverage area, the closer the value is to 1; β is the non-overlap weight coefficient, the value range is 0.2-0.3, which is used to balance coverage and image overlap rate; D(x) is the image non-overlap rate of the x-th view scheme, the value range is [0,1], the larger the non-overlap area, the closer the value is to 1; γ is the energy consumption weight coefficient, the value range is 0.1-0.3, which is used to consider the energy consumption of multi-axis platform adjustment; E(x) is the multi-axis platform adjustment energy consumption corresponding to the x-th view scheme, the unit is J, the larger the adjustment range, the higher the energy consumption.

3. The method for quality inspection of prefabricated components based on machine vision for object recognition according to claim 1, characterized in that: In step S2, adaptive illumination compensation is implemented using a dynamic illumination compensation module (DLC). Image brightness is adjusted based on image histogram analysis, and the specific brightness adjustment formula is as follows: , Where L(i,j) is the brightness value of the adjusted image at pixel (i,j); L(i,j) is the brightness value of the original image at pixel (i,j); H is the preset average brightness threshold of the image, with a value range of 80-120 and a grayscale value of 0-255; H(i,j) is the histogram mean of the brightness interval of pixel (i,j); i is the row coordinate of the pixel, with a value range of [0,M-1], and M is the image height; j is the column coordinate of the pixel, with a value range of [0,N-1], and N is the image width.

4. The method for quality inspection of prefabricated components based on machine vision for object recognition according to claim 1, characterized in that: In S3, the object recognition model that integrates the attention mechanism introduces a convolutional attention mechanism to calculate the channel weights, and the specific formula is as follows: , Where M is the channel attention weight matrix with dimensions [C,1,1], and C is the number of feature map channels; σ is the Sigmoid activation function, used to map weight values ​​to the [0,1] interval; MLP is a multilayer perceptron, containing one hidden layer and one output layer, used for dimensionality reduction and expansion of global features; GAP is a global average pooling operation, used to transform the feature map F with dimensions [C,H,W] into a global feature with dimensions [C,1,1]; F is the input feature map of the attention mechanism with dimensions [C,H,W], where H is the feature map height and W is the feature map width; F' is the output feature map of the attention mechanism with the same dimensions as F; ⊗ is a channel-wise multiplication operation, realizing the fusion of feature map and channel weights.

5. The method for quality inspection of prefabricated components based on machine vision for object recognition according to claim 1, characterized in that: In step S4, the incremental update of the model uses the stochastic gradient descent algorithm to optimize the loss function, and the loss function formula is as follows: , Where L is the total loss value; λ is the classification loss weight, with a value of 0.6-0.8; λ is the regression loss weight, with a value of 0.2-0.4, satisfying λ+λ=1; L is the cross-entropy classification loss, used to measure the difference between the predicted class and the true class; L is the smoothed L1 regression loss, used to measure the difference between the predicted bounding box and the true bounding box.

6. The method for quality inspection of prefabricated components based on machine vision for object recognition according to claim 1, characterized in that: In step S5, the lightweight 3D object recognition framework employs multi-view 2D projection feature reconstruction technology, and the feature reconstruction formula is as follows: , Where: F is the reconstructed 3D feature vector; K is the number of projection viewpoints, ranging from 3 to 6; w is the weight of the 2D feature of the k-th viewpoint, satisfying... , is determined by feature contribution evaluation; F is the 2D projection feature vector under the k-th view, with dimensions [1,D], where D is the feature dimension.

7. A machine vision-based object recognition prefabricated component quality inspection system, applied to the machine vision-based object recognition prefabricated component quality inspection method according to any one of claims 1-6, characterized in that: It includes an image acquisition module, a preprocessing module, an object recognition module, an adaptive update module, and a control and output module. The image acquisition module optimizes the camera view sequence based on the BIM model and genetic algorithm, and works with a multi-axis adjustment platform to achieve blind-spot-free image acquisition of key detection areas of prefabricated components. The preprocessing module has a built-in dynamic illumination compensation unit and an interference filtering unit, which are used to adjust the brightness / contrast of the acquired images and filter environmental interference. The object recognition module adopts the YOLOv8 framework with an attention mechanism to achieve synchronous recognition of quality objects of multiple types of prefabricated components, and integrates a lightweight 3D recognition unit for 3D geometric defect detection; the adaptive update module includes an online learning unit and a labeling prompting unit to achieve incremental updates and self-evolution of the object recognition model; the control and output module is used to coordinate the work of each module, receive recognition results and output detection reports, and control the movement of the multi-axis adjustment platform.

8. The machine vision-based object recognition prefabricated component quality inspection system according to claim 7, characterized in that: The image acquisition module includes a multi-axis adjustment platform, an industrial camera, and a BIM model analysis unit. The BIM model analysis unit is used to extract the geometric parameters of the prefabricated components and the coordinates of key detection areas, providing basic data for perspective optimization.

9. The machine vision-based object recognition prefabricated component quality inspection system according to claim 7, characterized in that: The dynamic illumination compensation unit in the preprocessing module adjusts brightness based on image histogram analysis, and the interference filtering unit uses a self-attention mechanism to filter shadows and reflective environmental interference, ensuring that the system operates stably within the illumination range of 0.1 to 10000 lux.

10. The machine vision-based object recognition prefabricated component quality inspection system according to claim 7, characterized in that: The lightweight 3D recognition unit in the object recognition module adopts the Edge-YOLO lightweight model and is embedded in the edge computing device to achieve real-time detection of 500ms / item; after receiving new sample data, the adaptive update module completes model fine-tuning through loss function and optimization algorithm.