Engineering sample identification method and device based on neural network model and all-in-one machine
Patent Information
- Application Number
- CN202611061554.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-10-27
AI Technical Summary
而工程样品往往形状不规则、表面纹理复杂、尺寸差异明显,现有神经网络识别方法在处理此类样品时,当模型输出的识别置信度低于预设阈值时,通常直接判定识别失败,要求重新采集图像或转为人工处理
1、由于采用了在自动化检测收样和分样过程中,获取放置于目标区域的多角度拍摄的工程样品和待检测文本图像,无需人工填写样品信息和样品单据,减少人工带来的信息错漏,为后续识别提供数据基础;针对多角度图像融合与多维特征提取,弥补单一视角或单一特征的局限性,使神经网络能够更全面地捕捉样品固有属性,获得高置信度的初始识别结果;在识别的置信度小于第一置信阈值时,复用已提取的几何、纹理、尺寸等物理特征对识别结果进行自主校正,有效提升识别可靠性与通过率,避免因单次识别失败而重复采集或人工干预,保障检测流程的连续性和稳定性;自动提取待检测文本图像信息,并与识别校正后的样品类别进行比对,极大降低因见证流程不合规或委托信息错误导致的检测风险,提高检测合规性与数据准确性,根据校正后的准确类别自动完成样品分样,并生成结构化的样品信息;同时将信息实时挂接至数据孪生模型,为后续检测过程的全流程追溯、状态实时监控、试验数据自动关联及质量闭环管理提供可靠的数字底座。所以,有效解决了相关技术中识别精度下降,难以满足建设工程质量检测对高可靠性和高通过率的要求,实现全流程的自动化的问题。
Smart Images

Figure CN122990713A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of engineering quality testing technology, specifically to an engineering sample identification method, device, and integrated machine based on a neural network model. Background Technology
[0002] Construction quality testing is a crucial link in ensuring the quality and safety of building projects, involving the testing of the mechanical and physical properties of various building materials such as concrete test blocks, mortar test blocks, steel reinforcement materials, cement, and sand. As my country's infrastructure construction has entered a new stage of high-quality development, with the continuous advancement of key projects such as new infrastructure, urban renewal, transportation, and water conservancy, the industry's requirements for testing efficiency, accuracy, and traceability are becoming increasingly stringent.
[0003] In related technologies, manual sample inspection and registration has shifted towards artificial intelligence. Methods utilizing neural networks for image recognition of engineering samples typically involve capturing sample images, extracting global features, inputting these features into a classification network, and outputting the sample's classification category and confidence level. These methods reduce human intervention to some extent and improve the level of automation in the identification process.
[0004] However, in actual testing scenarios, the automated sample collection and sorting processes, which are part of the closed-loop workflow of sample collection, sorting, and automated testing, place high demands on the accuracy of sample identification and are core prerequisites for subsequent automated testing. Engineering samples often have irregular shapes, complex surface textures, and significant size variations. Existing neural network recognition methods, when processing such samples, typically fail to identify them when the model's output confidence level falls below a preset threshold, requiring image re-acquisition or manual processing. This approach lacks a comprehensive utilization and correction mechanism for the sample's multi-dimensional physical characteristics (such as geometric shape, texture distribution, and actual size). It cannot combine the sample's inherent features related to the neural network prediction results when confidence levels are insufficient, leading to decreased recognition accuracy. This makes it difficult to meet the high reliability and high pass rate requirements of construction engineering quality testing and achieve full-process automation. Summary of the Invention
[0005] This application provides an engineering sample identification method, device, and integrated machine based on a neural network model, which can improve the accuracy of automatic sample collection and sorting identification, meet the requirements of high reliability and high pass rate, and provide a solid foundation for the overall closed loop of automated detection.
[0006] The technical solution of this application embodiment is as follows: In a first aspect, embodiments of this application provide an engineering sample identification method based on a neural network model, applied to a self-service intelligent all-in-one machine, the method comprising: Acquire images of engineering samples and text to be detected from multiple angles placed in the target area; Multi-dimensional feature extraction is performed on the engineering sample photographed from different angles to obtain geometric extraction features, texture extraction features and size extraction features corresponding to different angles. The engineering sample photographed from multiple angles is input into a preset target neural network model to obtain a first recognition result. The first recognition result includes a first recognition confidence level and a first recognition category. If the first recognition confidence is less than a preset first confidence threshold, the first recognition category is corrected using the geometric extraction features, the texture extraction features, and the size extraction features to obtain a second recognition result, which includes a second recognition confidence and a second recognition category. The text image to be detected is subjected to text extraction and recognition to obtain a text recognition result. If the second recognition confidence is greater than the second confidence threshold, the second recognition category and the text recognition result are compared to obtain a comparison result. If the comparison result is satisfactory, the samples are sorted according to the second identification category to obtain sample information, and the sample information is then linked to a preset data twin model.
[0007] In the above technical solution, during the automated sample collection and sorting process, multi-angle images of the engineering sample and the text to be tested, placed in the target area, are acquired. This eliminates the need for manual filling in of sample information and documents, reducing information errors caused by manual intervention and providing a data foundation for subsequent recognition. Multi-angle image fusion and multi-dimensional feature extraction compensate for the limitations of single perspectives or single features, enabling the neural network to more comprehensively capture the inherent attributes of the sample and obtain high-confidence initial recognition results. When the recognition confidence level is less than the first confidence threshold, the extracted geometric, texture, and size physical features are reused to autonomously correct the recognition results, effectively improving... This system enhances recognition reliability and pass rate, avoiding repeated data collection or manual intervention due to single recognition failures, thus ensuring the continuity and stability of the testing process. It automatically extracts the text image information to be tested and compares it with the corrected sample category, significantly reducing testing risks caused by non-compliant witnessing procedures or incorrect commissioning information, improving testing compliance and data accuracy. It automatically sorts samples according to the corrected category and generates structured sample information. Simultaneously, it links the information to a data twin model in real time, providing a reliable digital foundation for full-process traceability, real-time status monitoring, automatic correlation of test data, and closed-loop quality management in subsequent testing processes.
[0008] Secondly, embodiments of this application provide an engineering sample identification device based on a neural network model, applied to a self-service intelligent all-in-one machine, the device comprising: The data acquisition module is used to acquire images of engineering samples and text to be detected from multiple angles placed in the target area; The data recognition module is used to extract multi-dimensional features from the engineering sample taken from different angles, and obtain geometric extraction features, texture extraction features and size extraction features corresponding to different angles. The engineering sample taken from multiple angles is input into a preset target neural network model to obtain a first recognition result, which includes a first recognition confidence level and a first recognition category. The recognition correction module is used to correct the first recognition category using the geometric extraction features, the texture extraction features, and the size extraction features when the first recognition confidence is less than a preset first confidence threshold, so as to obtain a second recognition result, the second recognition result including a second recognition confidence and a second recognition category; The text recognition module is used to extract and recognize text from the text image to be detected, and obtain a text recognition result. When the second recognition confidence is greater than the second confidence threshold, the second recognition category and the text recognition result are compared to obtain a comparison result. The sample segmentation module is used to segment samples according to the second identification category when the comparison result is passed, obtain sample information, and link the sample information to a preset data twin model.
[0009] Thirdly, embodiments of this application provide a self-service intelligent all-in-one machine, including a processor, a memory, a user interface, a communication bus, and a network interface. The processor, the memory, the user interface, and the network interface are respectively connected to the communication bus. The memory is used to store instructions. The user interface and the network interface are used to communicate with other devices. The processor is used to execute the instructions stored in the memory so that the self-service intelligent all-in-one machine performs the method described in any one of the first aspects.
[0010] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed, perform the method described in any one of the methods provided in the first aspect above.
[0011] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. By employing multi-angle images of engineering samples and text to be inspected placed in the target area during automated sample collection and sorting processes, manual input of sample information and forms is eliminated, reducing information errors caused by manual intervention and providing a data foundation for subsequent recognition. Multi-angle image fusion and multi-dimensional feature extraction overcome the limitations of single perspectives or single features, enabling the neural network to more comprehensively capture the inherent attributes of the sample and obtain high-confidence initial recognition results. When the recognition confidence level is lower than the first confidence threshold, the extracted geometric, texture, and size physical features are reused to autonomously correct the recognition results, effectively improving... This system ensures reliability and pass rate, avoiding repeated sampling or manual intervention due to single recognition failures, thus guaranteeing the continuity and stability of the testing process. It automatically extracts the text and image information to be tested and compares it with the corrected sample category, significantly reducing testing risks caused by non-compliant witnessing procedures or incorrect commissioning information, improving testing compliance and data accuracy. Based on the corrected accurate category, it automatically completes sample sorting and generates structured sample information. Simultaneously, it links this information to a data twin model in real time, providing a reliable digital foundation for full-process traceability, real-time status monitoring, automatic correlation of test data, and closed-loop quality management in subsequent testing processes. Therefore, it effectively solves the problem of declining recognition accuracy in related technologies, making it difficult to meet the high reliability and high pass rate requirements of construction engineering quality testing, and achieving full-process automation.
[0012] 2. By standardizing preprocessing, interference from lighting, background, and noise is completely eliminated. Multi-dimensional features are used to accurately quantify the core differences in sample shape, texture, and size, making up for the limitations of single visual features. The improved ResNet-50 model strengthens key recognition features through multi-channel fusion and attention mechanisms, identifies the correlation between various features, and outputs the initial classification results, balancing recognition speed and basic accuracy. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating an engineering sample identification method based on a neural network model provided in one embodiment of this application; Figure 2 This is an overall schematic diagram of an engineering sample identification method based on a neural network model provided in one embodiment of this application; Figure 3 This is a schematic diagram of text detection for an engineering sample recognition method based on a neural network model provided in one embodiment of this application; Figure 4 This is a schematic diagram of the structure of an engineering sample identification device based on a neural network model provided in one embodiment of this application; Figure 5 This is a schematic diagram of the structure of a self-service intelligent all-in-one machine provided in one embodiment of this application. Detailed Implementation
[0014] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0015] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.
[0016] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple systems means two or more systems, and multiple screen terminals means two or more screen terminals. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0017] In related technologies, the automated testing of engineering samples, from sample collection, sorting, and registration to testing and report verification, requires the participation of multiple personnel. Limited by human working hours, continuous 24-hour operation is impossible, resulting in long testing cycles and low efficiency. In automated testing, sample collection and sorting, as preliminary steps, are crucial for accurate and reliable classification and identification. Traditional classification methods merely categorize samples, neglecting the degree of matching with the engineering process; information consistency requires manual review, making full-process automation impossible.
[0018] Based on this, embodiments of this application provide an engineering sample identification method, device, self-service intelligent all-in-one machine, and readable storage medium based on a neural network model. This engineering sample identification method, during automated sample collection and sorting, acquires multi-angle images of the engineering sample and the text to be detected placed in the target area, eliminating the need for manual filling in of sample information and sample forms, reducing information errors caused by manual intervention, and providing a data foundation for subsequent identification. It addresses the limitations of single-viewpoint or single-feature extraction through multi-angle image fusion and multi-dimensional feature extraction, enabling the neural network to more comprehensively capture the inherent attributes of the sample and obtain a high-confidence initial identification result. When the identification confidence level is less than a first confidence threshold, the extracted data is reused. The system autonomously corrects the recognition results based on physical features such as geometry, texture, and size, effectively improving recognition reliability and pass rate. This avoids repeated sampling or manual intervention due to single recognition failures, ensuring the continuity and stability of the testing process. It automatically extracts the text image information to be tested and compares it with the corrected sample category, greatly reducing the testing risk caused by non-compliance of the witnessing process or incorrect entrustment information, improving testing compliance and data accuracy. It automatically completes sample sorting based on the corrected accurate category and generates structured sample information. At the same time, it links the information to the data twin model in real time, providing a reliable digital foundation for full-process traceability, real-time status monitoring, automatic correlation of test data, and closed-loop quality management in subsequent testing processes.
[0019] It should be noted that this engineering sample identification method based on a neural network model is used for quality inspection of samples from different projects, and is used to build a fully automated inspection process to improve the automation and accuracy of sample collection, sorting, and information identification consistency.
[0020] The technical solutions provided in the embodiments of this application will be further described below with reference to the accompanying drawings.
[0021] Reference Figure 1 , Figure 1 This is a flowchart illustrating the engineering sample identification method based on a neural network model provided in this application embodiment. The engineering sample identification method based on a neural network model is applied to a self-service intelligent all-in-one machine. The method is executed by a processor in the self-service intelligent all-in-one machine or a readable storage medium. The method includes steps S100, S200, S300, S400, and S500.
[0022] Step S100: Obtain multi-angle images of the engineering sample and the text to be detected placed in the target area.
[0023] In one embodiment, the target area refers to the shooting and testing area of the self-service intelligent all-in-one machine, which is a standardized framing station with three built-in fixed calibration cameras, a pressure sensor, and a supplementary lighting module. It is the designated work area for placing engineering samples and acquiring images. The multi-angle engineering sample images are original RGB images of the samples simultaneously acquired by three high-definition cameras from the front, left, and right perspectives, with an original resolution of 1920×1080, fully covering the three-dimensional appearance features of the samples. The text images to be tested are images of the entrustment form and witnessing form paper vouchers captured by the self-service intelligent all-in-one machine, containing key text and image information such as QR codes, project names, seals, sample specifications, and testing items, for subsequent information verification.
[0024] The person submitting the sample places it stably in the center of the target detection area of the all-in-one machine. The built-in pressure sensor collects the coordinates of the stress area in real time, locking the sample's placement position and preventing sample displacement from causing framing errors. The machine is then triggered to take a picture, with three cameras simultaneously capturing images: the front-view camera is vertically aimed at the sample's upper surface, while the left and right cameras are positioned at a 45° angle to the front view, simultaneously outputting three original RGB sample images, preserving all information about the original ambient lighting, texture, and contours. The entrustment form and witness certificate are placed flat in the machine's text scanning and shooting area, and high-definition shooting is initiated to obtain complete, wrinkle-free, and glare-free images of the text documents, covering all text, QR codes, and stamp areas. Blurry or incomplete images are discarded, retaining only valid images with sufficient resolution and complete information as raw input data for subsequent processing. Each image is labeled with its shooting angle and shooting type (sample or text), forming structured data stored in the buffer storage area of the self-service intelligent all-in-one machine. The system acquires images of engineering samples and text to be inspected using a pre-defined data reading function. Through standardized workstation acquisition and multi-view synchronous framing, it fully preserves the 3D appearance features of the samples and the text information of the documents, providing a high-quality raw data foundation for subsequent feature extraction, model recognition, and text verification, thus reducing recognition errors at the source. The pre-defined data reading function can be either the `read()` function or the `open()` function.
[0025] Step S200: Multi-dimensional feature extraction is performed on the engineering samples photographed from different angles to obtain geometric extraction features, texture extraction features and size extraction features corresponding to different angles. The engineering samples photographed from multiple angles are input into a preset target neural network model to obtain a first recognition result. The first recognition result includes a first recognition confidence level and a first recognition category.
[0026] In one embodiment, before performing multi-dimensional feature extraction on engineering samples captured from different angles, the acquired raw data undergoes data preprocessing. The preprocessing includes illumination correction, background segmentation, and noise filtering. Illumination correction involves converting the three original RGB images to the LAB color space, using the CLAHE algorithm on the L brightness channel to segment an 8×8 grid region, setting clipLimit=2.0, eliminating block artifacts through bilinear interpolation, and then converting back to the RGB color space to eliminate uneven illumination interference. Background segmentation uses the force coordinates of the pressure sensor to define a foreground seed region, employing an improved GrabCut algorithm iteratively optimized five times to generate a binary mask (sample 255, background 0), accurately separating the sample from the background. Noise filtering uses a bilateral filter with spatial standard deviation σs=3 and color standard deviation σr=75 to smooth noise while preserving sample edges and texture details, outputting a high-quality preprocessed image.
[0027] It should be noted that the traditional GrabCut algorithm relies on manual selection of the global foreground region, resulting in a random initial selection range and uncontrollable iteration count. It also relies solely on a single global color distribution for modeling, making it poorly adaptable to variations in engineering sample reflections, table textures, and lighting, easily leading to oversegmentation and undersegmentation. To address these shortcomings, firstly, the device's pressure sensor collects the position of the force center point after sample placement in real time and determines the effective coverage radius based on the pressure diffusion range. Using the force center point as a reference, a rectangular foreground seed region is automatically generated based on the effective pressure radius. All pixels within the seed region are uniformly marked as suspected foreground pixels, representing areas likely to be engineering sample regions; all pixels outside the seed region are marked as suspected background pixels, representing interference areas such as table surfaces, lighting, and debris. Through physical sensing prior constraints, accurate initial binary classification of image pixels is achieved, providing stable and reliable initial constraints for subsequent iterative optimization and avoiding segmentation failures caused by initial region biases in traditional algorithms.
[0028] Based on the initial pixel partitioning, independent color feature statistical modeling is performed for suspected foreground and suspected background regions. For the RGB color image features of the engineering sample, a Gaussian mixture model is used to fit the color distribution model, learning the color range, brightness distribution, and color change patterns of the sample surface. Simultaneously, color features of the background surface, shadows, and ambient reflections are independently collected. Through dual-model differential modeling, the color differences between the sample body and the complex background are accurately distinguished, overcoming the shortcomings of traditional single-model models that cannot distinguish similar colors and easily misclassify shadows as foreground, thus improving the segmentation robustness under complex conditions. Global pixel label optimization is completed through five iterations. Each iteration includes two core logic steps: First, based on the current foreground and background color models, the matching degree of all pixels in the image is checked pixel by pixel, correcting the foreground and background labels of misclassified pixels; second, based on the updated pixel classification results, the foreground and background color model parameters are iteratively updated again, ensuring that the model features continuously adapt to the current image's real-world conditions. Simultaneously, a neighborhood pixel smoothing constraint is added during the iteration process, utilizing the spatial correlation of adjacent pixels to correct isolated noise points, fill small edge holes, and eliminate segmentation block effects, avoiding scattered misclassified pixels. After five complete iterations, the global pixel classification state converged and stabilized, and no more large label jumps occurred.
[0029] After iterative convergence and pixel assignment determination, global pixel binarization mapping is performed to generate a single-channel standard binary mask image. The specific rules are as follows: all pixels ultimately identified as foreground elements of the engineering sample are uniformly assigned a value of 255, representing the effective target area; all pixels identified as background, shadows, or clutter are uniformly assigned a value of 0, representing the invalid interference area. The resulting binary mask has continuous edges, complete contours, and no scattered noise or holes. Multiplying and superimposing this binary mask with the original illumination-corrected image pixel by pixel completely masks all background interference, retaining only a clean and complete foreground image of the engineering sample, providing an interference-free base image for subsequent high-precision geometric, texture, and size feature extraction.
[0030] In one embodiment, multi-dimensional feature extraction involves extracting quantified parameters from the preprocessed sample image from three independent dimensions: geometric shape, surface texture, and actual size, forming quantifiable and comparable structured feature data. Geometric features reflect parameters of the overall sample shape and contour regularity, including four core parameters: aspect ratio, roundness, compactness, and convex hull defect depth. Texture features reflect parameters of the sample surface texture coarseness, direction, and uniformity, extracting contrast, correlation, energy, homogeneity, and multi-directional statistics based on the gray-level co-occurrence matrix. Size features are obtained through pixel-to-object calibration conversion and multi-view weighted fusion to obtain the sample's true three-dimensional dimensions (length, width, and height) and measurement uncertainty. The target neural network model is a pre-trained improved ResNet-50 model, fusing features from three multi-view images and incorporating an SE attention module, a classification and recognition model specifically customized for six types of engineering samples. The first identification result is the output of the initial inference of the model, which includes the first identification category (one of six categories: concrete test block, mortar test block, steel reinforcement material, steel reinforcement connection joint, cement, and sand) and the first identification confidence level (probability value in the 0-1 interval).
[0031] First, geometric feature extraction is performed: the preprocessed RGB image is converted to grayscale, and Canny edge detection (low threshold 50, high threshold 150) is used to extract the sample contour. The Suzuki-Abe algorithm is used to track edge points, construct a closed contour linked list, and remove noisy contours with an area less than 100 pixels. Four parameters are calculated: aspect ratio R = minimum bounding rectangle aspect ratio, roundness C = 4πA / P² (A is area, P is perimeter), compactness K = P / A, and convex hull defect depth (maximum distance between contour and convex hull). Texture feature extraction: the effective area of the sample is locked based on the foreground mask, and a gray-level co-occurrence matrix is used. The pixel distance d = 1 and the calculation direction is 0° / 45° / 90° / 135°. The contrast, correlation, energy, and homogeneity of each direction are extracted, and the mean and standard deviation are calculated as the final texture feature vector. Size feature extraction: Based on the 200mm×200mm standard calibration plate, a pixel-to-millimeter mapping relationship is established (conversion accuracy ±1mm). The minimum bounding rectangle pixel size of the three image contours is calculated respectively. The confidence of each viewpoint is calculated. The shooting angle confidence and the measured value are weighted and averaged to output the actual three-dimensional size of the sample (length, width, and height) and the measurement uncertainty.
[0032] The three preprocessed images were uniformly scaled to 224×224 pixels, and pixel values were normalized to the [0,1] interval, followed by ImageNet normalization. The three 3-channel RGB images were concatenated along the channel dimension to generate a 9-channel input tensor, which was then fed into the trained target neural network model. Feature adaptive enhancement was performed using a ResNet-50 backbone network with an SE attention module. Six raw scores were output after Dropout (scale 0.5) and a fully connected layer, and then converted to a probability distribution using Softmax. The category with the highest probability was selected as the first recognition category, and its corresponding probability value was assigned as the first recognition confidence score, outputting the first recognition result. The target neural network model has a similar structure to the subsequent initial neural network model, which will be described in detail later; it will not be repeated here.
[0033] Standardized preprocessing completely eliminates interference from lighting, background, and noise. Multi-dimensional features accurately quantify the core differences in sample shape, texture, and size, making up for the limitations of single visual features. The improved ResNet-50 model strengthens key recognition features through multi-channel fusion and attention mechanisms, identifies the correlation between various features, and outputs initial classification results, balancing recognition speed and basic accuracy. This provides accurate initial data and complete feature support for subsequent correction of low-confidence results.
[0034] In one embodiment, the engineering sample identification method based on a neural network model further includes a training process for the target neural network model, the training process including but not limited to the following steps: Step S610: Obtain engineering sample datasets taken from multiple angles. The engineering sample datasets include multiple training sample data and sample classification labels corresponding to each sample data.
[0035] Specifically, the engineering sample dataset includes multiple training sample data and corresponding sample classification labels for each sample data. It serves as a sample set for model training, validation, and testing, totaling over 100,000 images, covering 6 target sample categories and their category labels. Training sample data consists of engineering sample images simultaneously captured from three perspectives (front, left, and right), including diverse samples with different lighting, angles, backgrounds, sizes, and conditions. Sample classification labels consist of 6 manually labeled categories, corresponding to concrete test blocks, mortar test blocks, steel reinforcement materials, steel reinforcement joints, cement, and sand, providing classification basis for model training.
[0036] A multi-view imaging system was used to capture images of six types of samples from various angles, covering scenarios including strong light, low light, backlight, different placement angles, minor stains, and normal appearance. Professional inspectors manually and precisely labeled each set of three-view images to ensure 100% accuracy. The engineering sample dataset was divided into training and testing sets at an 8:2 ratio or other suitable ratio to ensure a balanced distribution of samples across categories and to prevent sample skew. The training sample data for each shooting angle was processed similarly to step S100 and will not be elaborated here. Alternatively, industrial sample data can be obtained from web pages using web scraping algorithms and then filtered by professionals to obtain the engineering sample dataset.
[0037] It should be noted that the acquired training sample data undergoes data preprocessing, including illumination correction, background segmentation, and noise filtering, which will not be elaborated here. This preprocessed sample data is then used as training sample data to prepare for subsequent model output.
[0038] Step S620: Input the training sample data captured from multiple angles into the preset initial neural network model to obtain the training recognition result.
[0039] Specifically, training sample data captured from multiple angles is input into a preset initial neural network model. The training sample data is preprocessed data, and the training recognition result is output. The specific processing procedure is described in the following embodiments.
[0040] In one embodiment, the initial neural network model includes a three-channel input layer, a residual backbone network module, and an output layer. Training sample data is input into the preset initial neural network model to obtain training recognition results, including but not limited to the following steps: The training sample data is input into the preset initial neural network model, and the following process is performed: Training sample data from front-angle, left-angle, and right-angle shots are input into the model using the preset three-channel input layer, and multi-channel feature fusion is performed to obtain input features; the input features are input into the residual backbone network module for multi-level feature extraction to obtain a basic feature map; the basic feature map is spatially compressed, and the compressed features are combined with channel excitations to obtain channel attention weights; the attention weights are multiplied by the basic feature map to obtain a weighted feature map; the weighted feature map and the input features are used to perform residual calculations, and the calculation results are nonlinearly calculated using the output layer to output the training recognition results.
[0041] Specifically, the initial neural network model comprises a three-channel input layer, a residual backbone network module, and an output layer, and is an improved ResNet-50 model. The three-channel input layer is adapted to fuse three RGB images, transforming the original 3-channel input into a 9-channel input to support multi-view feature fusion. The residual backbone network module consists of four sets of residual block units based on ResNet-50, used for multi-level image feature extraction, addressing the gradient vanishing problem in deep networks. An SE attention module is embedded in the residual backbone network to extract the correlations between features. The output layer includes a fully connected classification layer, outputting predicted scores for six classes of samples.
[0042] During training, random enhancements are performed on the input images: ±15° random rotation, 0.8-1.2x random scaling, ±20% brightness adjustment, and Gaussian noise addition to improve model generalization. The enhanced images are then uniformly scaled to 224×224, pixel values are normalized to [0,1], and ImageNet normalization is applied. A 9-channel input layer is used to stitch and fuse the 3-channel images from the front, left, and right perspectives to generate a 9-channel input feature tensor. Four sets of residual blocks from ResNet-50 are used to extract shallow texture, mid-level contours, and deep semantic features layer by layer to generate a basic feature map. The SE module performs global average pooling on the basic feature map, and a two-layer fully connected network with a compression ratio of 16 learns the channel weights to generate channel attention weights. These weights are multiplied by the basic feature map to obtain a weighted feature map, enhancing effective features and suppressing ineffective noise features. The weighted feature map is subjected to residual operation with the original input feature to avoid the degradation problem of deep network. After Dropout (0.5) regularization, the output layer performs nonlinear calculation to output 6 training recognition scores. The category corresponding to the maximum score is selected as the classification category. The recognition score corresponds to the confidence level, and the training recognition result is obtained.
[0043] Step S630: Perform cross-entropy loss and label smoothing calculations on the training recognition results and sample classification labels to obtain the value of the loss function.
[0044] Specifically, cross-entropy loss measures the difference between the model's predicted probability distribution and the true label distribution; the smaller the difference, the lower the loss value and the higher the model accuracy. Label smoothing is a regularization optimization technique with a smoothing coefficient ε=0.1, softening the absolute confidence of hard labels and preventing model overfitting. The loss function value quantifies the model error and serves as the basis for iterative optimization of model parameters. For a 6-class classification task, the true one-hot labels are softened: the true class probability is assigned 1-0.1=0.9, and the other 5 classes are assigned an average error of 0.1, resulting in a single-class error probability of 0.02. The training recognition scores output by the model are converted into a probability distribution in the 0-1 interval using the Softmax function. Using the loss function formula, Loss=-Σq(k)logp(k), where q(k) is the smoothed true label probability and p(k) is the model's predicted probability, the single-sample cross-entropy loss value is calculated, and the batch loss function value is obtained by averaging the batch samples. Label smoothing regularization addresses the overfitting and overconfidence issues caused by traditional hard-label training, reduces the model's sensitivity to noisy samples, makes the loss value more consistent with the distribution of real samples, guides the model to learn more robust features, improves generalization ability, and meets the recognition requirements of engineering samples, making the recognition results of the target neural network model more accurate.
[0045] Step S640: Adjust the parameters of the initial neural network model using the value of the loss function, and obtain the target neural network model under the preset training conditions.
[0046] Specifically, parameter adjustment involves updating the weights and biases of the model's convolutional layers, fully connected layers, and attention modules through backpropagation of the optimizer. Preset training conditions include a maximum number of iterations, a loss convergence threshold, and a validation set accuracy threshold; training terminates once any optimal condition is met. The target neural network model is the final model with iteratively optimized parameters, achieving the required accuracy, and ready for direct use in engineering sample inference and recognition. The AdamW optimizer is used, but other model optimizers can also be employed. A learning rate of 0.001 and weight decay of 0.0001 are set to suppress overfitting of model weights. All of these parameters can be adjusted to optimize the model. ImageNet pre-trained weights are loaded, the parameters of the first three residual blocks are frozen, and only the last residual block, the SE attention module, and the fully connected classification layer are fine-tuned to balance the adaptability of general visual features with industry-specific features. The gradient is backpropagated based on the batch loss value to iteratively update all trainable parameters of the model, gradually reducing the loss value and improving recognition accuracy. Preset training conditions: validation set recognition accuracy ≥ 99.5%, single-sample inference speed < 500ms, and loss value no longer decreasing after 10 consecutive rounds. Training terminates when these conditions are met, the optimal model weights are saved, and the target neural network model is generated. The transfer learning strategy significantly shortens the model training cycle. Precise parameter optimization and convergence criteria ensure that the model balances recognition accuracy, inference speed, and generalization ability. The final model is adaptable to real-time on-site sample collection scenarios, meeting the high-speed, high-precision recognition requirements of engineering inspection.
[0047] Step S300: If the first recognition confidence is less than the preset first confidence threshold, the first recognition category is corrected using geometric extraction features, texture extraction features and size extraction features to obtain a second recognition result. The second recognition result includes a second recognition confidence and a second recognition category.
[0048] In one embodiment, the first recognition confidence level refers to the probability value output by the target neural network model after classifying and recognizing the engineering sample. This probability value characterizes the model's confidence in its output first recognition category, and its value ranges from 0 to 1. The closer the value is to 1, the more confident the model is in the classification result; the lower the value, the more uncertain the model is in the classification result. The first confidence threshold is a pre-set critical value used to judge the reliability of the neural network recognition result. The first confidence threshold can be set to 0.95. When the first recognition confidence level is greater than or equal to 0.95, the recognition result of the neural network is considered reliable and can be directly adopted; when the first recognition confidence level is less than 0.95, the recognition result of the neural network is considered to have uncertainty and needs to be verified and corrected through subsequent feature correction processes. Geometric extraction features, texture features, and size features are the results calculated in step S200. The first recognition category refers to the sample category with the highest probability output by the target neural network model. The second recognition result refers to the final recognition result obtained after correction of geometric extraction features, texture extraction features, and size extraction features. It includes the second recognition category and the second recognition confidence level. The second recognition category is the sample category determined after correction, and the second recognition confidence level is the confidence level calculated based on the comprehensive judgment of multi-level features.
[0049] The first recognition result output by the target neural network model includes a first recognition category and a first recognition confidence level. First, the first recognition confidence level is compared numerically with a preset first confidence threshold. Specifically, the first confidence threshold parameter stored in the configuration file is read and set to 0.95, and the value of the first recognition confidence level is compared with 0.95. If the first recognition confidence level is greater than or equal to the first confidence threshold of 0.95, the recognition result of the target neural network model is determined to have sufficient reliability. In this case, the first recognition category is directly used as the second recognition category, and the first recognition confidence level is used as the second recognition confidence level, forming the second recognition result, which is then output to step S400 without performing subsequent feature correction procedures.
[0050] If the initial recognition confidence level is less than the first confidence threshold of 0.95, the recognition result of the target neural network model is deemed uncertain. At this point, a three-level cascaded judgment and correction process is initiated, sequentially executing steps S310 to S350. Geometric extraction features, texture extraction features, and size extraction features are used to correct and verify the first recognition category, ultimately obtaining a reliable second recognition result. By setting a first confidence threshold to judge the reliability of the neural network recognition result, high-confidence results are quickly passed while low-confidence results are carefully verified, ensuring both recognition efficiency and accuracy. Setting the first confidence threshold to 0.95 effectively filters out samples that the neural network model may misidentify, providing a clear trigger condition for subsequent feature correction processes and avoiding the waste of computational resources caused by performing complex feature correction processes on all samples.
[0051] In one embodiment, the first recognition category is corrected using geometric extraction features, texture extraction features, and size extraction features to obtain a second recognition result, including but not limited to the following steps: Step S310: Construct a candidate category set associated with the first identification category. The candidate category set includes the first identification category and confusion categories that have similar appearance features to the first identification category.
[0052] Specifically, the candidate category set refers to a set of multiple possible categories constructed based on the first identified category when the confidence level of the neural network recognition result is low. This set serves as the screening range for subsequent three-level cascaded judgments. The categories in this set are sample categories that are similar in appearance to the first identified category and are easily confused with it. Confusion categories refer to other sample categories that are similar in appearance to the first identified category and are easily confused by the neural network model during recognition. The determination of confusion categories is based on the physical characteristics of the samples and historical misidentification data analysis. For example, concrete test blocks and mortar test blocks are confused categories because they are both cubic in shape and have similar surface textures; steel reinforcement materials and steel reinforcement joints are confused categories because they are both strip-shaped metal materials. The confusion category mapping table is a pre-established data structure that stores the correspondence between each sample category and its confusion categories. This mapping table is stored in key-value pair format, where the key is the sample category identifier and the value is a list of confusion categories associated with that category.
[0053] A confusion category mapping table is pre-established and stored. This mapping table is determined based on the physical characteristic analysis of construction project samples and the statistical analysis of historical misidentification data. The specific mapping relationship is as follows: The confusion between concrete test blocks and mortar test blocks stems from the fact that both are cubic cement-based materials with a coarse, granular surface texture. The main difference lies in their dimensions: concrete test blocks have standard side lengths of 100 mm, 150 mm, or 200 mm, while mortar test blocks have a standard side length of 70.7 mm. The confusion between mortar test blocks and concrete test blocks is due to the same reasons mentioned above.
[0054] The confusion category for raw steel bars includes steel bar connectors because both are strip-shaped metal materials and appear similar from certain shooting angles. The main difference lies in the fact that steel bar connectors have threaded sleeves or mechanical fasteners at the ends, while raw steel bars have straight cuts or natural cross-sections. The confusion category for steel bar connectors also includes raw steel bars for the same reasons.
[0055] Cement is often confused with sand because they appear similar in their bagged form—both are flexible bags containing powder or granular material. The main differences lie in the packaging label and the color of the material. Sand is also often confused with cement for the same reasons.
[0056] When executing step S310, based on the first identification category output in step S200, the confusion category mapping table is queried using the first identification category as the key to obtain the confusion category list corresponding to the first identification category. An empty candidate category set is created. First, the first identification category is added to this set, and then each category in the confusion category list is added to this set in turn.
[0057] Specifically, if the first identification category is concrete test block, then the list of confused categories obtained from the confused category mapping table is mortar test block. In this case, the candidate category set is constructed as a set containing both concrete test block and mortar test block categories. If the first identification category is steel reinforcement material, then the candidate category set is constructed as a set containing both steel reinforcement material and steel reinforcement connection joints categories.
[0058] In one embodiment, the candidate category set can be dynamically expanded based on the probability distribution output by the target neural network model. Specifically, the six-dimensional probability vector output by the target neural network model is read, and categories with probability values greater than a preset secondary selection threshold are also included in the candidate category set. This secondary selection threshold is set to 0.1 in this embodiment. For example, if the first identification category is concrete test block with a probability of 0.75, while the probability of mortar test block is 0.15 and the probability of steel reinforcement is 0.05, then the system includes concrete test block and mortar test block in the candidate category set, while steel reinforcement is not included because its probability is lower than the secondary selection threshold of 0.1. This dynamic expansion method can fully utilize the probability distribution information output by the neural network model, making the candidate category set more accurately cover the possible correct categories.
[0059] By constructing a candidate category set, instead of simply rejecting the recognition result when the neural network recognition result is uncertain, the first recognition category is retained as a candidate and similar confusing categories are included, providing a clear screening range for subsequent feature determination. The confusion category mapping table is established based on the physical characteristics of construction engineering samples and actual misidentification patterns, ensuring that the candidate category set can cover the probability of real sample categories. By limiting the scope of the candidate category set, the subsequent three-level cascaded determination only needs to perform screening and comparison within a limited category range, significantly reducing computational complexity and avoiding the risk of misjudgment caused by including obviously irrelevant categories in the comparison range.
[0060] Step S320: The candidate category set is filtered based on the aspect ratio and roundness in the geometric extraction features to obtain the first filtered set.
[0061] Specifically, the aspect ratio refers to the ratio of the width to the height of the minimum bounding rectangle of the engineering sample's outline. This parameter is obtained by performing outline detection and minimum bounding rectangle fitting on the preprocessed sample image. The aspect ratio effectively characterizes the overall shape features of the sample. An aspect ratio close to 1 indicates that the sample is approximately square or cubic in shape, while an aspect ratio significantly greater than 1 indicates that the sample is strip-shaped or rod-shaped. Roundness refers to the degree of roundness of the engineering sample's outline. The roundness value ranges from 0 to 1. The closer the roundness is to 1, the closer the outline is to a standard circle; the smaller the roundness, the more the outline deviates from a circle. The shape classification threshold is the critical value of the aspect ratio used to distinguish between block-shaped and strip-shaped samples. It can be set to 2.5, and this threshold is determined based on the actual size characteristics of the construction engineering sample. The roundness threshold is the critical value of roundness used to distinguish between circular cross-section samples and non-circular cross-section samples. It can be set to 0.75, and this threshold is determined based on the actual roundness distribution of circular cross-section samples (like steel bars) and square cross-section samples (like test blocks). Blocky sample category refers to sample categories in construction engineering samples that exhibit a cubic or blocky shape, including concrete test blocks and mortar test blocks. These samples typically have an aspect ratio close to 1 and low roundness. Strip-shaped sample category refers to sample categories in construction engineering samples that exhibit a rod-like or strip-like shape, including raw steel bars and steel bar joints. These samples typically have an aspect ratio significantly greater than 1. Circular cross-section sample category refers to sample categories in construction engineering samples that exhibit a circular cross-section, mainly raw steel bars and steel bar joints. These samples have a roundness close to 1 when viewed from the end face. Non-circular cross-section sample category refers to sample categories in construction engineering samples that exhibit a non-circular cross-section, including concrete test blocks, mortar test blocks, cement, and sand. These samples typically have a roundness below the roundness threshold. The first screening set refers to the set of sample categories retained after aspect ratio and roundness screening. This set is a subset of the candidate category set, excluding categories with significantly inconsistent geometric characteristics.
[0062] In one embodiment, the candidate category set is filtered based on the aspect ratio and roundness in the geometrically extracted features to obtain a first filtered set, including but not limited to the following steps: Step S321: Extract aspect ratio and roundness from geometric features.
[0063] Specifically, the geometric extraction features are feature vectors containing aspect ratio, roundness, compactness, and convex hull defect depth. The aspect ratio parameter R and roundness parameter C are extracted from this feature vector as input parameters for this level of geometric feature determination. Since step S200 extracts geometric features from the engineering sample images from three different perspectives, the aspect ratio and roundness of the three perspectives need to be fused. Specifically, for the aspect ratio parameter, the system calculates the maximum aspect ratio of the three perspectives as the fused aspect ratio. This is because strip-shaped samples may exhibit a lower aspect ratio at certain perspectives due to shooting angle issues; taking the maximum value ensures that the shape features of the strip-shaped sample are correctly captured. For the roundness parameter, the system selects the roundness value from the frontal view as the fused roundness, because the frontal view most accurately reflects the cross-sectional shape features of the sample.
[0064] Step S322: Compare the aspect ratio with the preset shape classification threshold. If the aspect ratio is less than or equal to the shape classification threshold, retain the block sample category in the candidate category set and exclude the strip sample category. If the aspect ratio is greater than the shape classification threshold, retain the strip sample category in the candidate category set and exclude the block sample category.
[0065] Specifically, the shape classification threshold parameter stored in the configuration file is read and set to 2.5. The aspect ratio R of the fused sample is compared with the shape classification threshold of 2.5, and the candidate category set is filtered based on the comparison result. If the aspect ratio R is less than or equal to the shape classification threshold of 2.5, the current sample is determined to have a block shape. At this time, the candidate category set is traversed, and concrete blocks and mortar blocks belonging to the block sample category are retained in the set, while steel bars and steel bar joints belonging to the strip sample category are excluded from the set. For the cement and sand categories, since their shape depends on the packaging method rather than a fixed shape, these two categories are temporarily retained in this step and are not excluded. If the aspect ratio R is greater than the shape classification threshold of 2.5, the current sample is determined to have a strip shape. At this time, the candidate category set is traversed, and steel bars and steel bar joints belonging to the strip sample category are retained in the set, while concrete blocks and mortar blocks belonging to the block sample category are excluded from the set. The cement and sand categories are also temporarily retained.
[0066] Specifically, a category shape attribute table is maintained, which stores the shape attribute label corresponding to each sample category. The shape attribute label for concrete blocks and mortar blocks is block-shaped, the shape attribute label for steel reinforcement and steel reinforcement joints is strip-shaped, and the shape attribute label for cement and sand is amorphous. The target shape attribute is determined based on the aspect ratio comparison result. Then, the candidate category set is traversed, and categories whose shape attributes are consistent with the target shape attribute or are amorphous are retained, while categories whose shape attributes are inconsistent with the target shape attribute are excluded.
[0067] Step S323: Compare the roundness with a preset roundness threshold. If the roundness is greater than or equal to the roundness threshold, retain the circular cross-section sample category in the current retention category and exclude the non-circular cross-section sample category. If the roundness is less than the roundness threshold, retain the non-circular cross-section sample category in the current retention category and exclude the circular cross-section sample category.
[0068] Specifically, the roundness threshold parameter stored in the configuration file is read and set to 0.75. The fused roundness C is compared with the roundness threshold of 0.75, and the category set filtered in step S322 is further filtered based on the comparison result. If the roundness C is greater than or equal to the roundness threshold of 0.75, the cross-section of the current sample is determined to have a circular feature. At this time, each category in the currently retained category set is traversed, and the steel reinforcement materials and steel reinforcement joints belonging to the circular cross-section sample category are retained, while the concrete test blocks and mortar test blocks belonging to the non-circular cross-section sample category are excluded. The cement and sand categories are temporarily retained in this step because they are not determined based on the cross-sectional shape. If the roundness C is less than the roundness threshold of 0.75, the cross-section of the current sample is determined to have a non-circular feature. At this time, each category in the currently retained category set is traversed, and the concrete test blocks, mortar test blocks, cement and sand belonging to the non-circular cross-section sample category are retained, while the steel reinforcement materials and steel reinforcement joints belonging to the circular cross-section sample category are excluded.
[0069] Specifically, a category cross-sectional attribute table is maintained, storing the cross-sectional attribute labels corresponding to each sample category. The cross-sectional attribute labels for steel reinforcement raw materials and steel reinforcement joints are circular, those for concrete test blocks and mortar test blocks are non-circular, and those for cement and sand are inapplicable. The target cross-sectional attribute is determined based on the roundness comparison results. Then, the currently retained category set is traversed, retaining categories whose cross-sectional attributes match the target cross-sectional attribute or are inapplicable, and excluding categories whose cross-sectional attributes do not match the target cross-sectional attribute.
[0070] Step S324: The categories retained after aspect ratio filtering and roundness filtering are combined into a first filtering set.
[0071] Specifically, all categories retained after the two-stage filtering in steps S322 and S323 are collected to form the first filtering set. The first filtering set is checked to see if it is empty. If it is empty, it indicates an anomaly in the geometric feature determination. The entire candidate category set is then used as the first filtering set to ensure that subsequent processes can continue. An anomaly log is recorded for manual investigation.
[0072] Simultaneously, the conformity score of each retained category in the geometric feature determination is recorded. Specifically, a standard geometric feature range table is obtained, which records the standard aspect ratio range and center value, as well as the standard roundness range and center value, for each category. For example, the standard aspect ratio range for concrete test blocks is 0.8 to 1.2, with a center value of 1.0; the standard roundness range is 0.70 to 0.82, with a center value of 0.76. Based on the actual aspect ratio, the center value Rc and half-width Hr of the standard aspect ratio range for the current category are retrieved from the standard geometric feature range table. The half-width Hr is calculated as half the difference between the upper and lower limits of the standard aspect ratio range. The deviation Dr is calculated as: Dr equals R minus the absolute value of Rc, divided by Hr. This represents calculating the absolute value of the difference between the actual aspect ratio and the center value of the standard range, and then normalizing using the half-width of the standard range as the normalization benchmark. When the actual aspect ratio is exactly equal to the center value of the standard range, the aspect ratio deviation is 0; when the actual aspect ratio is exactly at the boundary of the standard range, the aspect ratio deviation is 1; when the actual aspect ratio exceeds the standard range, the aspect ratio deviation is greater than 1. When the aspect ratio deviation Dr is less than or equal to 1, it means that the actual aspect ratio is within the standard range or exactly at the boundary. In this case, the aspect ratio compliance Sr equals 1 minus Dr multiplied by 0.5. This calculation method ensures that when the deviation is 0, the compliance is 1, and when the deviation is 1, the compliance is 0.5. When the aspect ratio deviation Dr is greater than 1 and less than or equal to 2, it means that the actual aspect ratio slightly exceeds the standard range. In this case, the aspect ratio compliance Sr equals 0.5 minus Dr minus 1 multiplied by 0.3. This calculation method ensures that when the deviation is 1, the compliance is 0.5, and when the deviation is 2, the compliance is 0.2. When the aspect ratio deviation Dr is greater than 2, it indicates that the actual aspect ratio significantly exceeds the standard range. In this case, the aspect ratio compliance score Sr equals 0.2 multiplied by 2 divided by Dr. This calculation method ensures that the compliance score approaches 0 as the deviation approaches infinity, while also guaranteeing a smooth decay of the compliance score. The smaller the deviation, the higher the compliance score.
[0073] For roundness determination, the deviation of the actual roundness from the center value of the standard roundness range for that category is calculated. Based on the roundness C, the center value Cc of the standard roundness range and the half-width Hc of the standard roundness range for the current category are retrieved from the standard geometric feature range table. The half-width Hc of the standard roundness range is calculated as half the difference between the upper and lower limits of the standard roundness range. The formula for calculating the roundness deviation Dc is: Dc equals C minus the absolute value of Cc, then divided by Hc. The physical meaning of this formula is consistent with the calculation method for aspect ratio deviation, using the standard range half-width as the normalization benchmark. The roundness conformance Sc is also calculated using a piecewise function, and the calculation rules are completely consistent with the aspect ratio conformance: when the roundness deviation Dc is less than or equal to 1, the roundness conformance Sc equals 1 minus Dc multiplied by 0.5. When the roundness deviation Dc is greater than 1 and less than or equal to 2, the roundness conformance Sc equals 0.5 minus Dc minus 1, then multiplied by 0.3. When the roundness deviation Dc is greater than 2, the roundness conformity Sc is equal to 0.2 multiplied by 2 divided by Dc. The smaller the deviation, the higher the conformity score. The aspect ratio conformity Sr and the roundness conformity Sc are weighted and fused to obtain the geometric feature comprehensive conformity score. The aspect ratio conformity weight is set to 0.6, and the roundness conformity weight is set to 0.4. The weighting is based on the fact that the aspect ratio has a stronger discriminative ability to distinguish between block-shaped and strip-shaped samples, so it is given a higher weight; roundness has an auxiliary discriminative role in distinguishing between circular and non-circular cross-section samples, so it is given a lower weight. The calculated geometric feature comprehensive conformity score Sg is associated and stored with the corresponding category label to form a mapping relationship between category and geometric feature conformity score, which will be used to calculate the second recognition confidence in step S350.
[0074] By sequentially determining the aspect ratio and roundness of two geometric parameters, sample categories with significantly inconsistent shape characteristics can be quickly eliminated. The aspect ratio determination effectively distinguishes between block-shaped and strip-shaped samples, while the roundness determination effectively distinguishes between circular and non-circular cross-section samples. The combination of these two levels of determination can cover the main shape types of construction engineering samples. The shape classification threshold of 2.5 takes into account the tolerance of the actual sample's size characteristics and the influence of the shooting angle, while the roundness threshold of 0.75 takes into account the reduction in roundness of circular cross-section samples such as steel bars due to surface ribs. Each level of determination is based on clear threshold comparison rules, and the determination process is fully traceable, meeting the requirements for accountability in the field of construction engineering quality inspection.
[0075] Step S330: Filter the first filter set according to the contrast and correlation in the texture extraction features to obtain the second filter set.
[0076] Specifically, contrast refers to the texture feature parameter calculated from the gray-level co-occurrence matrix, reflecting the degree of difference in gray-level values between adjacent pixels in the sample surface image. A higher contrast value indicates a clearer sample surface texture and more drastic local gray-level changes, typically corresponding to a rough surface; a lower contrast value indicates a smoother sample surface texture and more uniform gray-level distribution, typically corresponding to a smooth surface. Correlation refers to the texture feature parameter calculated from the gray-level co-occurrence matrix, reflecting the degree of correlation between pixel gray-level values in a specific direction in the sample surface image. A higher correlation value indicates a stronger regularity and directionality of the texture in that direction; a lower correlation value indicates isotropic characteristics. By comparing the correlation differences in different directions, it can be determined whether the sample surface has directional texture features. The contrast threshold is the critical contrast value used to distinguish between rough surface samples and smooth surface samples, which can be set to 500. This threshold is determined based on the actual contrast distribution of rough surface samples such as concrete blocks and mortar blocks and smooth surface samples such as plain round steel bars. The correlation variance threshold is a critical value used to distinguish between directional textured samples and isotropic textured samples. It can be set to 0.05, and this threshold is determined based on the actual correlation distribution between the directional textured features of ribbed steel bars and the isotropic textured features of plain round steel bars. The rough surface sample category refers to the sample category in construction engineering samples that exhibits a rough texture, including concrete blocks, mortar blocks, and sand. The contrast of these samples is usually higher than the contrast threshold. The smooth surface sample category refers to the sample category in construction engineering samples that exhibits a smooth texture, including plain round steel bars. The contrast of these samples is usually lower than the contrast threshold. The directional textured sample category refers to the sample category in construction engineering samples that exhibits a clear directionality in its surface texture, mainly ribbed steel bars, whose spiral ribs show high correlation in a specific direction. The second screening set refers to the set of sample categories retained after contrast screening and correlation screening. This set is a subset of the first screening set, excluding categories with significantly inconsistent texture features.
[0077] The texture extraction features include gray-level co-occurrence matrix parameters in four directions (0 degrees, 45 degrees, 90 degrees, and 135 degrees), with each direction containing four parameter values: contrast, correlation, energy, and homogeneity. Contrast and correlation parameters are extracted from the texture extraction features for this level of texture feature determination.
[0078] For the contrast parameter, the mean of the contrast values in four directions is calculated as the fused contrast ratio Con. This mean value comprehensively reflects the overall roughness of the sample surface in each direction. For the correlation parameter, the variance of the correlation values in four directions is calculated as the correlation variance Var. This variance reflects the directionality of the sample surface texture; a larger variance indicates a greater difference in correlation between different directions, meaning a more pronounced texture directionality. The contrast threshold parameter stored in the configuration file is read; in this embodiment, this parameter is set to 500. The fused contrast ratio Con is then compared with the contrast threshold 500.
[0079] If the contrast ratio Con is greater than or equal to the contrast threshold of 500, the current sample's surface is determined to have a rough texture. At this point, the system iterates through the categories in the first filter set, retaining concrete blocks, mortar blocks, and sand belonging to the rough surface sample category, while excluding plain round steel bars belonging to the smooth surface sample category. For the steel bar raw material category, since it may be plain round steel bars or ribbed steel bars, this category is temporarily retained in the contrast determination, pending further differentiation in subsequent correlation determination. The system also temporarily retains the steel bar connection joint category. For the cement category, since its surface texture depends on the packaging material, it is temporarily retained.
[0080] If the contrast ratio Con is less than the contrast threshold of 500, the surface of the current sample is determined to have a smooth texture. At this time, the categories in the first screening set are traversed, and categories whose surfaces may have a smooth texture are preferentially retained, including steel reinforcement materials, steel reinforcement joints, and cement. For concrete and mortar test blocks, if their contrast ratio is significantly lower than the lower limit of the normal contrast ratio range for that category, they are excluded.
[0081] The correlation variance threshold parameter stored in the configuration file is read and set to 0.05. The correlation variance Var is compared with the correlation variance threshold of 0.05 to further filter the category set after contrast filtering. If the correlation variance Var is greater than or equal to the correlation variance threshold of 0.05, the current sample's surface texture is determined to exhibit obvious directional characteristics, a typical feature of ribbed steel bars. If the currently retained category set contains the steel bar raw material category, the sample is marked as a ribbed steel bar subtype. If the correlation variance Var is less than the correlation variance threshold of 0.05, the current sample's surface texture is determined to exhibit isotropic characteristics. If the currently retained category set contains the steel bar raw material category and has low contrast, the sample is marked as a plain round steel bar subtype.
[0082] The second selection set is formed by collecting all categories retained after contrast and correlation screening. Simultaneously, the conformity score of each retained category in texture feature determination is recorded. This is done by querying the stored standard texture feature range table; the specific calculation process is similar to that of aspect ratio in step S324, and will not be elaborated here. Finally, the contrast conformity and correlation conformity are weighted and fused to obtain a comprehensive texture feature conformity score. The weight of contrast conformity is set to 0.5, and the weight of correlation conformity is set to 0.5. The basis for these weights is that contrast and correlation describe the sample surface features from two complementary perspectives: texture intensity and texture regularity. Both have equally important discriminative effects on sample classification, and therefore, they are given equal weight. The calculated comprehensive texture feature conformity score is associated with the corresponding category identifier and stored to form a mapping relationship between category and texture feature conformity score, which will be used to calculate the second recognition confidence in step S350. By determining the two texture parameters of contrast and correlation, sample categories with different surface features can be effectively distinguished. Contrast analysis effectively distinguishes between rough-surfaced concrete samples and smooth-surfaced steel reinforcement samples, while correlation variance analysis effectively distinguishes between ribbed steel bars and plain round steel bars, achieving detailed identification of steel reinforcement material categories. The contrast threshold of 500 is based on texture statistical analysis of numerous construction engineering inspection sample images, effectively adapting to variations in lighting conditions and image acquisition parameters. The correlation variance threshold of 0.05 is based on the directional feature analysis of the spiral ribs of ribbed steel bars, accurately capturing the presence of directional textures. Texture feature analysis and geometric feature analysis complement each other, further narrowing the candidate category range and improving the final identification accuracy.
[0083] Step S340: Compare the extracted size features with the standard size specifications of each category in the second filtering set, calculate the size deviation value of each category, and select the category with the smallest size deviation value that is less than the preset size tolerance threshold as the second identification category.
[0084] Specifically, the size extraction feature refers to the actual physical size of the sample obtained in step S200 through multi-view image fusion and pixel coordinate transformation, including the measured values of three dimensions: length, width, and height, in millimeters, with a measurement accuracy of ±1 millimeter. Standard size specifications refer to the standard size parameters of various construction engineering samples, established and stored in a pre-built standard size specification library according to national or industry standards. This library contains all standard specifications and their size parameters for each type of sample. Size deviation value refers to the degree of deviation between the actual measured size of the sample and a certain standard size specification, obtained by calculating the comprehensive measure of the size differences in each dimension. Size tolerance threshold refers to the maximum permissible deviation value used to determine whether the sample size conforms to a certain standard specification. The size tolerance threshold for different categories of samples is set separately according to their processing accuracy and testing standards. The standard size specification library refers to a pre-established database storing the standard size specifications of various construction engineering test samples. This database is indexed by sample category and stores the size parameters of all standard specifications under each category and the corresponding size tolerance threshold.
[0085] The standard size specification library includes the following: Concrete test blocks: three standard sizes are included – small cubes with sides of 100 mm, standard cubes with sides of 150 mm, and large cubes with sides of 200 mm. The dimensional tolerance threshold for all three sizes is set to ±2 mm. Mortar test blocks: one standard size is included – a cube with sides of 70.7 mm, with a dimensional tolerance threshold set to ±1 mm. Reinforcing steel raw materials: multiple standard sizes are included, with diameters of 6 mm, 8 mm, 10 mm, 12 mm, 14 mm, 16 mm, 18 mm, 20 mm, 22 mm, 25 mm, 28 mm, and 32 mm, with a dimensional tolerance threshold set to ±0.5 mm. Reinforcing steel connection joints: the sizes correspond to the diameter of the connected reinforcing steel, with a dimensional tolerance threshold set to ±1 mm. Cement: the sizes depend on the packaging specifications, commonly 50 kg bags, with a dimensional tolerance threshold set to ±10 mm. The size specifications of the sand category depend on the packaging or container specifications, and the size tolerance threshold is set at ±15 mm.
[0086] Based on dimensional features, the sample's length (L), width (W), and height (H) are extracted. Each category in the second filter set is traversed, and the following dimensional comparison process is performed for each category. For the currently traversed category, all corresponding standard specifications are retrieved from the standard size specification library. For each standard specification, the dimensional deviation between the sample's actual size and the standard specification is calculated. For cubic sample categories such as concrete blocks and mortar blocks, the dimensional deviation is calculated as follows: first, the average of the actual length, width, and height is calculated as the actual side length; then, the absolute value of the difference between the actual side length and the standard side length is calculated as the dimensional deviation. For circular cross-section sample categories such as steel reinforcement, the dimensional deviation is calculated as follows: first, the equivalent diameter is calculated from the contour area and perimeter of the frontal view image; then, the absolute value of the difference between the equivalent diameter and the standard diameter is calculated as the dimensional deviation. For irregularly shaped sample categories such as cement and sand, the dimensional deviation is calculated as follows: the absolute values of the differences between the actual length, width, and height and the standard length, width, and height are calculated separately; then, the maximum value of the three differences is taken as the dimensional deviation. After calculating the dimensional deviation values of all standard specifications in the current category, the standard specification with the smallest dimensional deviation value is selected as the best matching specification for this category, and the corresponding minimum dimensional deviation value is recorded.
[0087] After traversing all categories in the second screening set, the minimum size deviation value for each category is obtained. The minimum size deviation values for each category are compared, and the category with the smallest minimum size deviation value is selected as the candidate second identification category. Further checks are made to ensure that the minimum size deviation value of the candidate second identification category is less than the corresponding size tolerance threshold. If the minimum size deviation value is less than the size tolerance threshold, the candidate category is confirmed as the second identification category, and the matching standard specification is recorded as the sample specification model. If the minimum size deviation value is greater than or equal to the size tolerance threshold, the size matching is deemed unsuccessful, the sample is marked as requiring manual review, and the second identification category is temporarily set to the category with the smallest size deviation value in the second screening set, with a lower confidence level. The conformity score of the second identification category in the size feature determination is recorded. This score is calculated as follows: the conformity score equals 1 minus the ratio of the minimum size deviation value to the size tolerance threshold, with a value range of 0 to 1. The smaller the minimum size deviation value, the higher the conformity score.
[0088] By precisely comparing the actual measured dimensions of the samples with a standard size specification library, the best-matching sample category and specific specification model can be determined within a limited range of categories in the second screening set. The standard size specification library covers various sample specifications commonly used in construction engineering testing, ensuring comprehensive size matching. Different methods for calculating dimensional deviation values are used for different sample categories, fully considering the geometric characteristics of each type of sample. The classification and setting of dimensional tolerance thresholds take into account the differences in processing precision among different sample categories; the tolerance for concrete and mortar test blocks is wider to accommodate mold processing errors, while the tolerance for steel reinforcement is narrower to ensure accurate identification of diameter specifications. Dimensional features, as the final level of the three-level cascaded judgment, can provide final confirmation based on the screening of geometric and textural features, ensuring the accuracy and reliability of the identification results.
[0089] Step S350: The second recognition confidence score is obtained by weighting the degree of conformity of the second recognition category in the screening of geometric extraction features, texture extraction features, and size extraction features.
[0090] Specifically, the conformity level refers to the degree of matching between the sample and the standard features of the second identification category in each level of feature screening and judgment. It includes three sub-items: geometric feature conformity, texture feature conformity, and size feature conformity. Each sub-item ranges from 0 to 1, with higher values indicating better conformity. Geometric feature conformity refers to the degree of matching between the sample's aspect ratio and roundness and the standard geometric features of the second identification category. Texture feature conformity refers to the degree of matching between the sample's contrast and correlation and the standard texture features of the second identification category. Size feature conformity refers to the degree of matching between the sample's actual measured dimensions and the standard size specifications of the second identification category. Feature weight refers to the weight coefficient of each level of feature conformity level when calculating the second identification confidence level. The setting of the weight coefficient reflects the contribution of each type of feature to the recognition accuracy. Second identification confidence level refers to the overall degree of certainty about the second identification category after three levels of cascaded judgment, with a value ranging from 0 to 1. Higher values indicate higher reliability of the recognition result.
[0091] The weight coefficients for each feature level are read from the configuration file. The weight coefficient Wg for geometric features is set to 0.25, the weight coefficient Wt for texture features is set to 0.25, and the weight coefficient Ws for size features is set to 0.50. The principle for setting the weight coefficients is as follows: size features, as the most direct and accurate judgment basis, are in the final confirmation position in the three-level cascaded judgment, and therefore are given the highest weight; geometric features and texture features, as the first two levels of screening basis, are each given the same weight. The sum of the three weight coefficients equals 1. The second recognition confidence is calculated by weighted summation. The specific calculation process is as follows: the second recognition confidence equals the geometric feature conformity multiplied by the geometric feature weight coefficient Wg, plus the texture feature conformity multiplied by the texture feature weight coefficient Wt, plus the size feature conformity multiplied by the size feature weight coefficient Ws.
[0092] In one embodiment, a penalty factor mechanism is also introduced to adjust the second recognition confidence score. Specifically, if the sample's conformity in a certain level of feature screening is lower than a preset boundary threshold, a penalty factor is applied to the second recognition confidence score. The boundary threshold is set to 0.6, and the penalty factor is set to 0.9. The system checks whether the conformity scores of geometric features, texture features, and size features are lower than 0.6. For each conformity score below the boundary threshold, the second recognition confidence score is multiplied by the penalty factor of 0.9. This penalty mechanism ensures that when a sample is in a region of ambiguous boundaries in a certain level of feature determination, the final confidence score reflects this uncertainty.
[0093] The calculated second recognition confidence score is checked and corrected for range. If the second recognition confidence score is greater than 1, it is corrected to 1; if the second recognition confidence score is less than 0, it is corrected to 0. The second recognition category and the second recognition confidence score are combined to form the second recognition result, which is then output to step S400 for subsequent text comparison and verification. Simultaneously, the system records the complete process of the three-level cascaded determination to a log file, including the construction process of the candidate category set, the judgment criteria and results of each level of screening, the calculated values of the feature conformity at each level, and the calculation process of the second recognition confidence score, for subsequent result traceability and problem investigation.
[0094] Step S400: Perform text extraction and recognition on the text image to be detected to obtain the text recognition result. If the second recognition confidence is greater than the second confidence threshold, compare the second recognition category and the text recognition result to obtain the comparison result.
[0095] In one embodiment, the text image to be detected refers to an image of a text carrier that is placed simultaneously with the engineering sample in the target area and photographed. This text carrier is typically a photograph of a paper document such as an engineering testing request form, sample delivery form, or test authorization letter. The text image to be detected contains key information such as the project name, commissioning unit, sample name, specifications, sample quantity, and commission number. This information is presented on the text carrier in the form of printed text, handwritten text, or a seal. The text image to be detected is acquired together with the engineering sample in step S100, serving as an important basis for sample identity verification. Text extraction and recognition refers to the process of automatically detecting, locating, and recognizing text content from the text image to be detected using optical character recognition technology and image processing technology. Text extraction and recognition includes the recognition of printed text areas, the recognition of seal areas, and the structured processing of the recognition results. The text recognition result refers to the set of structured information obtained after text extraction and recognition processing, including the recognized project name and commission information. The project name is the name of the project extracted and verified from the text image to be detected; the commission information is the detailed information of the testing commission associated with the project name, including fields such as commission number, commissioning unit, sample name, specifications, sample quantity, and commission date.
[0096] The second identification confidence level refers to the quantitative value of the credibility of the engineering sample category identification result obtained after correction processing. Its value ranges from 0 to 1. The second identification confidence level comprehensively considers the initial identification result of the neural network model as well as the correction contributions of geometric features, texture features, and size features, and has higher accuracy and reliability compared to the first identification confidence level. The second confidence threshold is a preset threshold value used to determine whether the identification result is credible, which can be set to 0.75. When the second identification confidence level is greater than the second confidence threshold, it indicates that the system has sufficient confidence in the identification result of the engineering sample category, and subsequent sample information comparison can be performed. When the second identification confidence level is less than or equal to the second confidence threshold, it indicates that the identification result has significant uncertainty and requires manual verification. The second identification category refers to the category to which the engineering sample belongs after the correction processing in step S300. This category is selected from the preset sample category system, including common sample types for construction engineering testing such as concrete test blocks, mortar test blocks, steel reinforcement materials, steel reinforcement joints, cement, and sand. The comparison result refers to the verification conclusion obtained by comparing the sample information corresponding to the second identification category with the commission information in the text recognition result item by item. The comparison result is a binary result, and the value is to determine whether the sample verification is passed or not.
[0097] like Figure 2 As shown, text extraction and recognition are performed on the text image to be detected to obtain the text recognition result, including but not limited to the following steps: Step S410: Perform character recognition on the text image to be detected, locate and extract the first project name of the text region in the text image to be detected.
[0098] Specifically, character recognition refers to the process of automatically detecting and recognizing text content in an image using optical character recognition technology. In an engineering inspection order, text areas are distributed in table cells, title bars, and fill-in fields. The first project name refers to the project name directly identified and extracted from the printed or handwritten text area of the text image to be inspected. The first project name is usually located in the header of the order or in the dedicated fill-in field for project names. It is key information identifying the project to be inspected. As one of the main results of text recognition, the first project name will be cross-validated with the second project name extracted from the seal.
[0099] First, the text image to be detected is preprocessed. The image is converted to grayscale, and Canny edge detection or projected histogram methods are used to detect image edges and calculate the tilt angle of the form. Affine transformation is applied to rotate and correct the image, ensuring the form is horizontal and reducing subsequent text recognition errors. A deep learning text detection model (e.g., DBNet or CRAFT algorithm) is used to extract features from the preprocessed image, generating probability maps and threshold maps for the text regions. Binarization is used to select all text detection boxes in the image, and the coordinate set of each text box's quadrilateral is output. The images containing text detection boxes are cropped and input into a sequence recognition model (e.g., CRNN+CTC model or SVTR model). Image sequence features are extracted and converted into corresponding Chinese and English character sequences, outputting the specific text content of each text box. Anchor keyword rules are set, for example, configuring a keyword list: ["Project Name", "Project Name", "Commissioned Project"]. All recognized text is traversed, and text boxes matching the anchor keywords are used as "reference boxes". Based on the output coordinates, calculate the Euclidean distance to the adjacent area to the right or directly below the reference frame and find the nearest "target text box". Extract the character content within this target text box and use it as the first project name.
[0100] Compared to traditional template matching methods, deep learning-based text detection and recognition models have stronger generalization capabilities, enabling them to handle order forms with different formats and fonts. The project name extraction strategy, combining keyword matching and location rules, balances accuracy and adaptability. Keyword matching accurately locates project names in standard format order forms, while location rules handle non-standard formats or missing keywords. These two methods complement each other, improving the success rate of project name extraction.
[0101] Step S420: Scan the text image to be detected, identify and locate the project seal area in the text image to be detected, segment and extract the seal area image, perform character recognition on the seal area image, and extract the second project name.
[0102] Specifically, image scanning refers to the process of performing a global visual analysis on the text image to detect the presence and location of specific types of visual elements. The target of image scanning is an engineering seal, and automatic detection of the seal area is achieved through comprehensive analysis of color, shape, and texture features. The engineering seal area refers to the image region in the text image containing the official seal of an engineering project, testing agency, or commissioning unit. Engineering seals are typically circular or elliptical, red or blue in color, and contain text information such as the unit name and seal number. The engineering seal is an important credential for the authenticity and validity of the commissioned document, and the project name information within the seal can serve as a secondary data source for project name verification. The seal area image refers to the sub-image containing only the seal content extracted from the text image to be detected. The seal area image undergoes cropping and normalization to facilitate subsequent recognition of the text within the seal. The secondary project name refers to the project name or unit name identified and extracted from the seal area image. Since seal text is usually arranged along a circumference and may have arc-shaped deformations, the extraction of the secondary project name requires specialized seal text recognition technology.
[0103] The original image is converted to the HSV color space, and a threshold range for the red channel is set (to extract the unique ink red of the seal). A red region mask is generated, and a pre-trained object detection network (such as YOLOv8 or Faster R-CNN) is used as the training set for inference, with circular / elliptical seals as the training set. Combined with the red mask, the bounding box of the seal's region is accurately output. The seal region image (ROI) is cropped along the bounding box. To address the issue of overlapping red lines on the seal with black text on the form, a color component-based filtering algorithm (or the U-Net image segmentation network) is used to filter out non-red pixels (such as black handwriting or table lines) and replace them with a white background, obtaining a pure red seal image. The Hough circle transform is used to fit the center coordinates and radius of the purified seal. An inverse polar-to-Cartesian coordinate transformation is used: with the center as the origin, the originally curved circular text is straightened out into a horizontal, elongated text image, following the radius from the outside in and the angle from 0 to 360 degrees. For the expanded elongated horizontal image, a text recognition model (such as CRNN) is called again. Based on the unique layout rules of the seal (such as the text often containing suffixes like "Project Department" or "Engineering Seal"), natural language processing techniques (such as regular expression validation) are used to filter out interfering information (such as five-pointed stars and anti-counterfeiting codes), ultimately extracting the complete name of the seal's owner organization or project name as the second project name.
[0104] The seal color detection method using the HSV color space can adapt to images captured under different lighting conditions and has stronger robustness compared to the RGB color space. It fully utilizes existing mature text recognition models, avoiding the need to develop a dedicated curved text recognition model. The seal text serves as a secondary source of the project name, forming cross-validation with the primary project name extracted from the main text. This effectively detects document forgery and seal misuse, improving the security of document review for construction project inspections.
[0105] Step S430: Calculate the similarity between the first project name and the second project name. If the similarity value is greater than the preset similarity threshold, the text image to be detected passes the verification. Select one of the first project name and the second project name as the project name to be identified.
[0106] Specifically, the similarity threshold refers to a preset numerical boundary used to determine whether two project names match. The similarity threshold can be set to 0.70. When the similarity value is greater than 0.70, the first project name is determined to match the second project name, and the text image to be detected passes the verification; when the similarity value is less than or equal to 0.70, the two project names are determined to not match, and the text image to be detected fails the verification.
[0107] The similarity between the first project name and the second project name is calculated using the cosine similarity algorithm and the distance similarity algorithm. If the similarity value is greater than the preset similarity threshold, the text image to be detected is deemed to have passed the verification and enters the process of selecting the project name. One of the first project name and the second project name is selected as the project name to be identified.
[0108] If the overall similarity value is less than or equal to 0.70, the verification of the text image to be detected is deemed unsuccessful, a verification anomaly record is generated, and the record includes the first project name, the second project name, and the overall similarity value. Simultaneously, a manual review process is triggered. Cross-validation using project names from two independent information sources—the main text and the seal text—significantly improves verification reliability.
[0109] Step S440: Perform commissioned recognition on the text image to be detected. Based on the recognition project name, obtain the commission information corresponding to the commissioned identifier. Use the commission information and the recognition project name as the text recognition result.
[0110] Specifically, an image scanning method is adopted to locate regions where a two-dimensional code or a barcode may exist. For two-dimensional code detection, a positioning pattern recognition method is used to search for a square-in-square positioning pattern in the image. A two-dimensional code usually contains positioning patterns at three corners, and the system determines the two-dimensional code region by detecting these positioning patterns. For barcode detection, a gradient direction analysis method is used. The barcode region has distinct unidirectional gradient features, and the system calculates the gradient direction histogram of a local region, and identifies a region with concentrated gradient directions as a candidate barcode region.
[0111] If a two-dimensional code region is detected, the system decodes the two-dimensional code. The system uses a QR code decoding algorithm to perform binarization processing on the two-dimensional code image, extract the data matrix of the two-dimensional code, perform error correction and decoding in accordance with the QR code encoding specification, and obtain the text information encoded in the two-dimensional code. The two-dimensional code text information is usually a commission note number or a URL link containing the commission note number. The system uses a regular expression to extract the commission note number from the two-dimensional code text information, and the regular expression pattern is: matching a string starting with a prefix such as WT, DJ, JC, followed by 8 to 20 digits or letters. If the regular expression matching is successful, the matching result is taken as the commission identifier.
[0112] If a barcode region is detected, the system decodes the barcode. The system supports common barcode formats such as Code128, Code39, and EAN-13. The system preprocesses the barcode image, including operations such as binarization, skew correction, and denoising, and then uses a barcode decoding algorithm to read the string encoded in the barcode. The system takes the barcode decoding result as the commission identifier.
[0113] If no two-dimensional code or barcode is detected, or the decoding fails, the system extracts the commission identifier from the text content of the document. The system presets a set of positioning keywords for commission note numbers, including: commission note number, commission number, serial number, document number, number, No., etc. The system traverses the text content of the document to search for the above keywords. If a keyword is found, the system extracts the continuous alphanumeric string behind the keyword as the commission identifier. If no keyword is found, the system uses a regular expression to match a string conforming to the format of the commission note number in the full text range.
[0114] Using the commission identifier as a query condition, the system accesses the commission information database of the construction engineering testing business management system, and returns the commission information corresponding to the queried commission identifier. The commission information and the identified project name are encapsulated into a text recognition result data structure. The text recognition result data structure includes the following fields: identified project name, commission identifier, commission information, verification status, and project name consistency check result. The structured encapsulation of the text recognition result provides a clear and complete data interface for subsequent sample information comparison, which facilitates the processing of subsequent steps.
[0115] In one embodiment, it is determined whether the second recognition confidence level is greater than a second confidence threshold, and this value is compared with the second confidence threshold of 0.75. If the second recognition confidence level is less than or equal to 0.75, the automatic recognition result of the current sample is deemed unreliable, and a manual review branch process is executed. A manual review task is generated, the task content of which includes multi-angle images of the engineering sample, the text image to be detected, the first recognition category, the second recognition category, the first recognition confidence level, the second recognition confidence level, and various feature extraction data. The manual review task is pushed to the work terminal of the testing personnel, waiting for the testing personnel to make a manual judgment. The testing personnel manually verify the sample based on its physical appearance and the information on the order form, and after confirming the sample category, enter the result into the system. The manually confirmed sample category is received, taken as the final recognition category, and the comparison result is marked as manually confirmed as passed, and then the process jumps to step S500 to perform subsequent processing.
[0116] If the second recognition confidence level is greater than 0.75, the automatic recognition result of the current sample is deemed sufficiently credible, and the automatic comparison process continues. Then, steps S450 to S490 are called to compare the sample information corresponding to the second recognition category with the commission information in the text recognition result to obtain the comparison result. By setting a second confidence threshold to judge the second recognition confidence level, for samples with high recognition confidence, the subsequent comparison process is completed automatically, improving sample verification efficiency; for samples with low recognition confidence, a manual review step is introduced in a timely manner, avoiding sample information confusion caused by erroneous recognition results. The confidence threshold of 0.75 strikes a balance between automation efficiency and recognition accuracy, ensuring that the vast majority of normal samples can be processed automatically, while reserving a manual intervention channel for abnormal or complex samples.
[0117] In one embodiment, the second recognition category and the text recognition result are compared to obtain a comparison result, including but not limited to the following steps: Step S450: Obtain the sample name, specifications, and quantity of the engineering sample corresponding to the second identification category.
[0118] Specifically, the sample name refers to the standard name description of the engineering sample corresponding to the second identification category. The sample name is a standardized textual identifier for the sample, used for comparison and verification with the sample name field in the commission information. The sample name is usually more specific than the category identifier and may include additional information such as material, purpose, and standard number. Specifications refer to the standard description of the technical parameters of the engineering sample, such as size, strength grade, and material type. Specifications are a key attribute that distinguishes samples of different specifications within the same category. For example, the specification of a concrete test block might be a 150mm cube C30, while the specification of steel reinforcement might be HRB400 with a diameter of 20mm. Specification information is partly derived from the size feature extraction of the sample visually and partly from the default specification configuration associated with the category. Sample quantity refers to the actual number of engineering samples of this category in the current testing batch. The sample quantity is obtained through the analysis of multi-angle images of the target area; the samples have already been counted during the feature extraction process in step S200.
[0119] First, a mapping table is established between category identifiers and sample names, specifications, and sample data. This mapping table is obtained by recording engineering samples and plotting them through statistical analysis of historical data. Based on the obtained second identification category, the mapping table is queried to retrieve the sample name, specifications, and quantity. The sample name, specifications, and quantity are then encapsulated into a sample attribute data structure for comparison and verification in subsequent steps.
[0120] Step S460: Compare the sample name with the sample name in the entrustment information to obtain the sample name comparison result.
[0121] Specifically, first, standardization preprocessing is performed on the sample name and the sample name in the entrustment information. The preprocessing operations include: removing leading and trailing blank characters; converting full-width characters to half-width characters; removing parentheses and the remark information inside the parentheses; removing punctuation marks; merging multiple consecutive spaces into a single space. The preprocessed data is compared using a multi-level matching strategy, which is specifically as follows: at the first level, it is directly compared whether the preprocessed identified sample name is completely identical to the entrusted sample name. If they are completely identical, the sample name comparison result is directly determined to be consistent, and the comparison process ends. At the second level, a sample name synonym dictionary is pre-established, and the dictionary records various common name expressions of the same type of sample. The specific content of the synonym dictionary is as follows: the synonyms of concrete compressive strength test block include concrete test block, concrete test block, concrete compressive test piece, and concrete cube test block; the synonyms of mortar compressive strength test block include mortar test block, cement mortar test block, and mortar compressive test piece; the synonyms of hot-rolled ribbed steel bar include deformed steel bar, ribbed steel bar, HRB steel bar, raw steel bar material, and threaded steel bar; the synonyms of mechanical rebar splice include rebar joint, rebar connector, straight threaded joint, and sleeve connection joint; the synonyms of general portland cement include cement, ordinary portland cement, composite portland cement, PO cement, and PC cement; the synonyms of construction sand include sand, fine aggregate, river sand, manufactured sand, medium sand, and fine sand. The system queries the synonym dictionary to determine whether the identified sample name and the entrusted sample name belong to the same synonym group. If the two names belong to the same synonym group, the sample name comparison result is determined to be consistent, and the comparison process ends. At the third level, if consistency cannot be determined in the first two levels, the system performs keyword-based fuzzy matching. Keywords are extracted from the identified sample name and the entrusted sample name respectively. The keyword extraction rule is: retain nominal words after word segmentation, and filter stop words including "de", "strength", "test", "detection", "for", "type", etc. The Jaccard similarity coefficient of the two keyword sets is calculated, and the Jaccard similarity coefficient is defined as the number of intersection elements of the two sets divided by the number of union elements. If the Jaccard similarity coefficient is greater than 0.5, the sample name comparison result is determined to be consistent; if the Jaccard similarity coefficient is less than or equal to 0.5, the sample name comparison result is determined to be inconsistent. The detailed process information of sample name comparison is recorded, including fields such as the identified sample name, the entrusted sample name, the matching level, the Jaccard similarity coefficient (if fuzzy matching is performed), and the comparison result, for reference in manual review under abnormal circumstances.
[0122] The multi-level matching strategy balances comparison accuracy and error tolerance. The precise matching level handles highly standardized cases, ensuring that completely identical names pass verification quickly. The synonym matching level addresses the issue of multiple names for the same type of sample in real-world business scenarios; for example, a work order might specify "concrete test block," while the system identifies it as "concrete compressive strength test block," correctly determined by a thesaurus. The fuzzy matching level, as a last resort, handles cases where name expressions differ significantly but core keywords are the same, improving the system's adaptability to non-standard expressions. A Jaccard similarity coefficient threshold of 0.5 ensures that at least half of the keywords must be identical for a match to be considered valid, allowing for error tolerance while avoiding misjudgments.
[0123] Step S470: Compare the specifications and models with those in the entrustment information to obtain the model comparison results.
[0124] Specifically, the identified specifications and commissioned specifications are analyzed using structured parsing, and various technical parameters are extracted through rule matching. Regular expressions are used to match specifications for different categories. For example, for concrete and mortar test blocks, the size and strength grade parameters are parsed. Size extraction uses regular expression matching, matching a string of numbers followed by mm or millimeters, then cube, square, or block. Strength grade extraction also uses regular expression matching, matching a string of uppercase C or M followed by two digits. Other categories are not detailed here. Each extracted technical parameter is then compared. Numerical parameters are judged by numerical equality, allowing a tolerance range of ±5% within the standard specification. For example, comparing an identified diameter of 19mm with a commissioned diameter of 20mm, since 19mm falls within the ±5% tolerance range of 20mm (19mm to 21mm), it is considered a match. Grade parameters are judged by string equality, requiring complete consistency. Formal parameters are determined by synonym matching; for example, a straight thread connection and a straight thread connector are considered to be compatible.
[0125] The model comparison result is determined based on the comparison of various parameters. If all parameters match, the model comparison result is consistent. If any parameter is clearly inconsistent, the model comparison result is inconsistent, and the system records the specific parameter and the discrepancy. If any parameter cannot be compared due to missing specifications or commissioned specifications, the model comparison result is pending confirmation, and the system records the specific parameter that could not be compared.
[0126] By performing structured analysis of specifications and model numbers, complex specification strings can be broken down into independent technical parameters, enabling refined comparisons at the parameter level and avoiding misjudgments caused by differences in specification formatting. The tolerance range settings for numerical parameters take into account visual recognition measurement errors and actual processing dimensional deviations, improving the rationality of the comparison. Strict matching of graded parameters ensures that samples of different strength or material grades are not confused.
[0127] Step S480: Compare the number of samples with the number of samples in the commission information to obtain the quantity comparison result.
[0128] Specifically, regarding sample quantity, the system first matches the quantity unit according to regular expression matching rules. If the quantity units are inconsistent, manual intervention for conversion is prompted. If the units are consistent, the system checks whether the sample quantity is equal to the requested sample quantity. If they are equal, the quantity comparison result is consistent. If they are not equal, the system further analyzes the specific reasons for the inconsistency. If the identified sample quantity is greater than the requested sample quantity, the anomaly type is recorded as "sample quantity exceeded," and the anomaly description is that the actual number of samples submitted for testing is more than the requested number, possibly indicating that more samples were submitted. If the identified sample quantity is less than the requested sample quantity, the system prompts for additional samples. Detailed information on the quantity comparison is recorded, including fields such as the identified sample quantity, identified quantity unit, requested sample quantity, requested quantity unit, unit conversion, comparison result, anomaly type, and anomaly level. This detailed analysis of inconsistencies provides clearer guidance for subsequent processing, distinguishing between sample excess and sample shortage anomalies. This provides a foundation for automated scheduling of testing after subsequent classification and processing.
[0129] Step S490: If the comparison results of sample name, model, and quantity are all consistent, the comparison result is that the sample verification is passed. If any one of the comparison results of sample name, model, and quantity is inconsistent, the comparison result is that the sample verification is failed.
[0130] Specifically, the comparison results for sample name, model, and quantity are checked to ensure consistency. If all three are consistent, the comparison result is set as a pass for sample verification. If any one of the three is inconsistent, the comparison result is set as a fail for sample verification. A detailed verification anomaly report is generated, including fields such as: anomaly number, sample number, order number, project name, sample name comparison result and details, model comparison result and details, quantity comparison result and details, and anomaly occurrence time. Based on the anomaly level, a corresponding notification process is triggered, pushing messages to management personnel. This comprehensive three-dimensional judgment mechanism based on sample name, model, and quantity ensures the comprehensiveness of sample verification, guaranteeing that samples conform to the commission information, resulting in more accurate classification results, and providing a foundation for subsequent automated testing scheduling.
[0131] like Figure 3 As shown, first, multi-vision images are acquired, then image preprocessing, multi-dimensional feature extraction, and deep learning are used for classification to obtain sample recognition results. The sample recognition results are then compared with the recognition results of the text to be detected to determine the comparison results.
[0132] In step S500, if the comparison result is satisfactory, the samples are divided according to the second identification category to obtain sample information, and the sample information is linked to the preset data twin model.
[0133] In one embodiment, sample sorting refers to the process of allocating submitted samples to different testing procedures according to the prescribed quantity and method based on testing standards and testing item requirements. Sample sorting is a crucial step in the testing process; correct sorting ensures the representativeness and standardization of the testing. Sample information refers to the structured data record generated after sorting, containing complete sample attribute information and sorting result information. Fields in the sample information include: sample number, sample name, specifications, sample quantity, sorting plan, sample quantity allocated to each testing item, sample status, associated order number, and warehousing time. A data twin model is a digital model established in digital space that corresponds one-to-one with the actual sample in physical space. The data twin model displays the spatial location, status information, and testing progress of the sample through three-dimensional visualization, achieving real-time mapping and synchronous updates between the physical sample and digital information. Linking refers to the process of establishing an association between sample information and the corresponding digital entity in the data twin model. After linking, the digital entity in the data twin model can display the sample's attribute information and status changes in real time.
[0134] If the comparison result is satisfactory, it indicates that subsequent automatic testing of various categories can proceed, with sample sorting as the first priority. The sample sorting rule library is queried based on the second identification category to obtain the standard sample sorting scheme for that category. The sample sorting rule library pre-sets sample sorting rules for various types of samples. For example, the sample sorting rule for concrete test blocks is: 3 blocks per group, used for compressive strength testing of the same batch; if the commission includes both standard curing and same-condition curing, then one group is allocated for each curing method; if the commission includes testing at 7 days and 28 days, then the corresponding number of groups is allocated for each age period. The sample sorting rule for mortar test blocks is: 6 blocks per group, with 3 blocks used for compressive strength testing and 3 blocks used for backup samples; if the commissioned age period is 28 days, then all 6 blocks are allocated to the 28-day age period testing.
[0135] A specific sampling plan is generated based on the sampling rules and the testing items in the commission information. The sampling plan includes the number of samples allocated to each testing item, the sample number range, and the testing schedule. A unique sample sub-number is generated for each sampling unit, with the format being the main sample number plus the sampling sequence number. Sample information data records are generated. These records include the following fields: the main sample number, automatically generated by the system, in the format of year plus month plus a six-digit serial number; sample name; specifications; total sample quantity; the sampling plan generated in this step; the testing item list inherited from the commission information; the current sample status set to "sampled and awaiting testing"; the associated commission order number inherited from the commission information; the associated project name inherited from the identified project name; the sample entry time set to the time the sample was detected; and the estimated testing completion time calculated based on the testing items and age requirements.
[0136] Access the data twin model service interface to create a digital entity of the sample within the data twin model. First, query the spatial coordinates of the target area within the data twin model; these coordinates were calibrated during system initialization. Calculate the sample's specific location coordinates and spatial range within the target area based on its geometric features. Call the data twin model's entity creation interface, passing the following parameters: entity type (sample type), entity name (sample master number), spatial location (calculated 3D coordinates), geometric shape (standard geometric model determined based on sample category), and attribute data (all fields from the sample information data record). Upon receiving the parameters, the data twin model creates a digital entity of the sample at the corresponding spatial location. The digital entity is presented as a 3D model, and its appearance is selected from a preset model template based on the sample category.
[0137] The attribute binding interface of the data twin model is invoked to bind each field of the sample information to the corresponding attribute of the digital entity. After binding, clicking on the sample digital entity in the data twin model allows viewing the complete attribute information of that sample. Simultaneously, attribute synchronization rules are set so that when a field value in the sample information data record changes (e.g., the sample status changes from "sampled and awaiting testing" to "under testing"), the attributes of the corresponding digital entity in the data twin model are automatically updated. A binding confirmation record is generated, including information such as sample number, digital entity identifier, binding time, and binding status, for subsequent data traceability and consistency verification.
[0138] The automated sampling function based on the sampling rule base reduces the workload and error rate of manual sampling, ensuring that the sampling process meets the requirements of testing standards. The preset mechanism of the sampling rule base facilitates rule expansion and adjustment based on new sample types or updated testing standards. The structured generation of sample information provides a standardized data foundation for subsequent testing process management and data analysis. The introduction of the data twin model realizes the integration of physical samples and digital information, enabling intuitive viewing of the spatial location, status information, and related data of samples through the data twin model, improving the visualization and operational convenience of sample management. The attribute synchronization mechanism ensures the consistency between digital twin data and actual business data, avoiding information silos and data lag issues. The entire process of sample entry from warehousing to testing completion leaves a trace record in the data twin model, providing an effective means for testing quality traceability and process monitoring, thereby achieving 24 / 7 unmanned automated testing.
[0139] like Figure 4 As shown, this application provides an engineering sample recognition device 100 based on a neural network model, applied to a self-service intelligent all-in-one machine. This neural network model-based engineering sample recognition device 100 acquires multi-angle images of engineering samples and text images to be detected placed in a target area through a data acquisition module 110; it uses a data recognition module 120 to perform multi-dimensional feature extraction on the engineering samples taken from different angles, obtaining geometric extraction features, texture extraction features, and size extraction features corresponding to different angles; it inputs the multi-angle images of the engineering samples into a preset target neural network model to obtain a first recognition result, which includes a first recognition confidence level and a first recognition category; and it uses a recognition correction module 130 to... If the recognition confidence level is less than a preset first confidence threshold, the first recognition category is corrected using geometric extraction features, texture extraction features, and size extraction features to obtain a second recognition result. The second recognition result includes a second recognition confidence level and a second recognition category. The text recognition module 140 performs text extraction and recognition on the text image to be detected to obtain a text recognition result. If the second recognition confidence level is greater than the second confidence threshold, the second recognition category and the text recognition result are compared to obtain a comparison result. Finally, if the comparison result is satisfactory, the sample segmentation module 150 performs sample segmentation according to the second recognition category to obtain sample information, and the sample information is linked to a preset data twin model.
[0140] It should be noted that the data acquisition module 110 is connected to the data recognition module 120, the data recognition module 120 is connected to the recognition correction module 130, the recognition correction module 130 is connected to the text recognition module 140, and the text recognition module 140 is connected to the sample mounting module 150.
[0141] It should also be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0142] This application also discloses a self-service intelligent all-in-one machine. (See reference...) Figure 5 , Figure 5 This is a schematic diagram of the structure of a self-service intelligent all-in-one machine according to an embodiment of this application. The self-service intelligent all-in-one machine 500 may include: at least one processor 501, at least one network interface 504, user interface 503, memory 505, and at least one communication bus 502.
[0143] The communication bus 502 is used to enable communication between these components.
[0144] The user interface 503 may include a display screen and a camera. Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0145] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0146] The processor 501 may include one or more processing cores. The processor 501 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 505, and by calling data stored in memory 505. Optionally, the processor 501 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array. The processor 501 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor 501.
[0147] The memory 505 may include random access memory (RAM) or read-only memory. Optionally, the memory 505 may include non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 505 may also be at least one storage device located remotely from the aforementioned processor 501. (Refer to...) Figure 5 The memory 505, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for an engineering sample identification method based on a neural network model.
[0148] exist Figure 5 In the self-service intelligent all-in-one machine 500 shown, the user interface 503 is mainly used to provide an input interface for users and obtain user input data; while the processor 501 can be used to call an application program stored in the memory 505 for an engineering sample recognition method based on a neural network model. When executed by one or more processors 501, the self-service intelligent all-in-one machine 500 performs one or more methods as described in the above embodiments. It should be noted that, for the foregoing method embodiments, for the sake of simplicity, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0149] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0150] In the various embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between apparatuses or units may be electrical or other forms.
[0151] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0152] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0153] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0154] The above are merely exemplary embodiments of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will readily conceive of those skilled in the art upon consideration of the specification and the disclosure of practical truths.
[0155] This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.
Claims
1. A method for identifying engineering samples based on a neural network model, characterized in that, The method, applied to self-service intelligent all-in-one machines, includes: Acquire images of engineering samples and text to be detected from multiple angles placed in the target area; Multi-dimensional feature extraction is performed on the engineering sample photographed from different angles to obtain geometric extraction features, texture extraction features and size extraction features corresponding to different angles. The engineering sample photographed from multiple angles is input into a preset target neural network model to obtain a first recognition result, which includes a first recognition confidence level and a first recognition category. If the first recognition confidence is less than a preset first confidence threshold, the first recognition category is corrected using the geometric extraction features, the texture extraction features, and the size extraction features to obtain a second recognition result, which includes a second recognition confidence and a second recognition category. The text image to be detected is subjected to text extraction and recognition to obtain a text recognition result. If the second recognition confidence is greater than the second confidence threshold, the second recognition category and the text recognition result are compared to obtain a comparison result. If the comparison result is satisfactory, the samples are sorted according to the second identification category to obtain sample information, and the sample information is then linked to a preset data twin model.
2. The method according to claim 1, characterized in that, The method further includes a training process for the target neural network model, the training process comprising: A dataset of engineering samples taken from multiple angles is obtained, the dataset including multiple training sample data and sample classification labels corresponding to each sample data; The training sample data, captured from multiple angles, is input into a preset initial neural network model to obtain training recognition results. The training recognition results are compared with the sample classification labels, and cross-entropy loss and label smoothing are calculated to obtain the value of the loss function; The parameters of the initial neural network model are adjusted using the value of the loss function, and the target neural network model is obtained when the preset training conditions are met.
3. The method according to claim 2, characterized in that, The initial neural network model includes a three-channel input layer, a residual backbone network module, and an output layer. The step of inputting the training sample data into the preset initial neural network model to obtain the training recognition result includes: The training sample data is input into a preset initial neural network model, and the following process is performed: The training sample data captured from front, left, and right angles are input into the model using a preset three-channel input layer, and multi-channel feature fusion is performed to obtain the input features. The input features are input into the residual backbone network module for multi-level feature extraction to obtain a basic feature map. The basic feature map is then compressed in spatial dimension, and the compressed features are combined with channel excitation to obtain channel attention weights. The attention weights are multiplied by the base feature map to obtain a weighted feature map. The weighted feature map is then compared with the input features to perform residual calculations. The output layer is used to perform nonlinear calculations on the calculation results to output the training recognition results.
4. The method according to claim 1, characterized in that, The step of correcting the first recognition category using the geometric extraction features, the texture extraction features, and the size extraction features to obtain the second recognition result includes: Construct a candidate category set associated with the first identification category, the candidate category set including the first identification category and confusion categories that have similar appearance features to the first identification category; The candidate category set is filtered based on the aspect ratio and roundness in the geometric extraction features to obtain a first filtered set; The first filter set is filtered based on the contrast and correlation in the texture extraction features to obtain a second filter set; The extracted size features are compared with the standard size specifications of each category in the second filtering set, the size deviation value of each category is calculated, and the category with the smallest size deviation value and less than the preset size tolerance threshold is selected as the second identification category. The second recognition confidence level is obtained by weighting the degree of conformity of the second recognition category in the screening of geometric extraction features, the screening of texture extraction features, and the screening of size extraction features.
5. The method according to claim 4, characterized in that, The candidate category set is filtered based on the aspect ratio and roundness in the geometrically extracted features to obtain a first filtered set, including: Extract aspect ratio and roundness from the geometric features; The aspect ratio is compared with a preset shape classification threshold. If the aspect ratio is less than or equal to the shape classification threshold, the block sample category in the candidate category set is retained and the strip sample category is excluded. If the aspect ratio is greater than the shape classification threshold, the strip sample category in the candidate category set is retained and the block sample category is excluded. The roundness is compared with a preset roundness threshold. If the roundness is greater than or equal to the roundness threshold, the round cross-section sample category in the current retention category is retained, and the non-circular cross-section sample category is excluded. If the roundness is less than the roundness threshold, the non-circular cross-section sample category in the current retention category is retained, and the round cross-section sample category is excluded. The categories retained after aspect ratio and roundness filtering are combined into the first filtering set.
6. The method according to claim 1, characterized in that, The step of extracting and recognizing text from the text image to be detected, and obtaining the text recognition result, includes: Perform character recognition on the text image to be detected, locate and extract the first project name of the text region in the text image to be detected; The text image to be detected is scanned to identify and locate the project seal area in the text image to be detected, the seal area image is segmented and extracted, the seal area image is recognized to extract the second project name; The similarity between the first project name and the second project name is calculated. If the similarity value is greater than a preset similarity threshold, the text image to be detected passes the verification, and one of the first project name and the second project name is selected as the project name to be identified. The text image to be detected is subjected to commissioned recognition. Based on the recognition project name, the commission information corresponding to the commissioned identifier is obtained, and the commission information and the recognition project name are used as the text recognition result.
7. The method according to claim 1, characterized in that, The step of comparing the second recognition category and the text recognition result to obtain a comparison result includes: Obtain the sample name, specifications, and quantity of the engineering sample corresponding to the second identification category; The sample name is compared with the sample name in the entrustment information to obtain the sample name comparison result; The specifications and models are compared with those in the entrustment information to obtain the model comparison results; The sample quantity is compared with the sample quantity in the entrustment information to obtain the quantity comparison result; If the comparison results of the sample name, the model, and the quantity are all consistent, the comparison result indicates that the sample has passed the verification. If any one of the comparison results of the sample name, the model, and the quantity is inconsistent, the comparison result indicates that the sample has failed the verification.
8. An engineering sample identification device based on a neural network model, characterized in that, The device, used in self-service intelligent all-in-one machines, includes: The data acquisition module is used to acquire images of engineering samples and text to be detected from multiple angles placed in the target area; The data recognition module is used to extract multi-dimensional features from the engineering sample taken from different angles, and obtain geometric extraction features, texture extraction features and size extraction features corresponding to different angles. The engineering sample taken from multiple angles is input into a preset target neural network model to obtain a first recognition result, which includes a first recognition confidence level and a first recognition category. The recognition correction module is used to correct the first recognition category using the geometric extraction features, the texture extraction features, and the size extraction features when the first recognition confidence is less than a preset first confidence threshold, so as to obtain a second recognition result, the second recognition result including a second recognition confidence and a second recognition category; The text recognition module is used to extract and recognize text from the text image to be detected, and obtain a text recognition result. If the second recognition confidence is greater than the second confidence threshold, the second recognition category and the text recognition result are compared to obtain a comparison result. The sample segmentation module is used to segment samples according to the second identification category when the comparison result is passed, obtain sample information, and link the sample information to a preset data twin model.
9. A self-service intelligent all-in-one machine, characterized in that, The device includes a processor, a memory, a user interface, a communication bus, and a network interface. The processor, the memory, the user interface, and the network interface are respectively connected to the communication bus. The memory is used to store instructions. The user interface and the network interface are used to communicate with other devices. The processor is used to execute the instructions stored in the memory so that the self-service intelligent all-in-one machine performs the method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed, perform the method as described in any one of claims 1-7.