A charpy impact specimen notch inspection apparatus and method of use thereof
By combining image recognition and ResNet neural network, automatic detection and position adjustment of Charpy impact specimens are achieved, solving the problems of low detection efficiency and frequent replacement of standard templates in the existing technology, and improving detection efficiency and applicability.
Patent Information
- Application Number
- CN202411439021.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2044-10-15
AI Technical Summary
The existing Charpy impact test specimen notch inspection instrument has low testing efficiency, cannot simultaneously meet the testing requirements of different standards, and the frequent replacement of standard templates affects efficiency.
Image recognition technology is combined with an autofocus high-definition camera and a ResNet neural network. The autofocus high-definition camera captures images of the notch, and the image data preprocessing module improves the clarity. The image processing module stores multiple standard templates and performs automatic comparison through the ResNet neural network. Combined with the automatic sample alignment mechanism, the sample position is adjusted.
It enables automatic identification and alignment of Charpy impact specimens, improving testing efficiency, and is applicable to different testing standards. It eliminates the need for frequent template changes and simplifies operation procedures.
Smart Images

Figure CN119394168B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Charpy impact test specimen notch inspection technology, and in particular to a Charpy impact test specimen notch inspection instrument and its usage method. Background Technology
[0002] The inspection of the Charpy impact test specimen after V&U notch machining is mainly to verify whether the V&U notch machining meets the requirements of the testing standard. The pass or fail of the inspection results directly affects the accuracy of the Charpy impact test results. Unqualified notches cannot be used for testing. It is a necessary step before the test begins. The commonly used V&U notch inspection instrument is the impact test specimen notch projector. Its principle is to use two objective lenses to magnify the V&U notch by 50 times, and then compare the outline of the V&U notch with the standard V&U notch outline made according to the allowable tolerance requirements of the testing standard on the projection screen. If the comparison result is within the range of the testing standard, the notch machining is qualified; if it exceeds the range, the notch machining is unqualified.
[0003] The existing projector-based inspection method has the following disadvantages: 1. Low inspection efficiency. When inspecting the notch of the specimen, it is necessary to move and adjust the worktable left and right and back and forth to align it with the standard template on the projection screen; 2. An impact specimen notch projector can usually only be configured with a standard template of one inspection standard, such as the national standard. If the test requires inspection according to the ASTM standard, another notch projector needs to be configured, or the standard notch template needs to be changed. Frequent changes of the standard notch template will still affect the inspection efficiency and are very inconvenient. In view of the above, this application proposes a Charpy impact specimen notch inspector and its usage method. Summary of the Invention
[0004] Based on the technical problems existing in the background art, the present invention proposes a Charpy impact specimen notch inspection instrument and its usage method.
[0005] The present invention proposes a Charpy impact test specimen notch inspection instrument, including a test platform, an automatic specimen alignment mechanism installed on the top of the test platform, a support rod fixedly connected to the rear side of the top of the test platform, a main unit fixedly connected to the front side of the support rod, a switch button and a USB interface provided on the left side of the main unit, a touch operation screen provided on the top of the main unit, and an autofocus high-definition camera fixedly installed on the bottom of the main unit.
[0006] The host includes an image data preprocessing module, an image storage module, an image processing module, an image recognition calculation module, a PLC control unit, and a battery module. The image storage module is connected to an autofocus high-definition camera, a USB interface, and the image data preprocessing module. The image data preprocessing module is connected to the image processing module and the image recognition calculation module. The PLC control unit is connected to the image recognition calculation module and the autofocus high-definition camera. The image processing module is connected to a touch screen.
[0007] Preferably, the automatic sample alignment mechanism includes a sample placement platform that is in movable contact with the top of the testing platform. The top of the testing platform has an installation groove, and a cross-shaped electric slide rail is fixedly connected to the bottom inner wall of the installation groove. A brake motor is fixedly connected to the top of the sliding end of the cross-shaped electric slide rail. The top of the output shaft of the brake motor is fixedly connected to the bottom of the sample placement platform. Both the cross-shaped electric slide rail and the brake motor are electrically connected to the PLC control unit.
[0008] Preferably, the battery module powers the host computer, and the autofocus high-definition camera is used to photograph the notch of the Charpy impact sample. The photographs are stored through the image storage module, and the image data preprocessing module is used to perform noise reduction and filtering data preprocessing on the stored photographs. At the same time, it also performs brightness adjustment and contrast enhancement to improve image clarity and prevent excessive errors due to hardware factors. In the process of brightness adjustment and contrast enhancement, the parameters of the photographs are adjusted to preset parameters to adjust the brightness and contrast of the image, thereby improving the accuracy of subsequent comparisons.
[0009] Preferably, the image processing module stores national standard and ASTM standard V&U notch standard templates. The required standard model can be selected through the touch screen. The image processing module compares the notch photo taken by the autofocus high-definition camera with the selected standard model based on the ResNet neural network to determine whether it is qualified or not.
[0010] The ResNet neural network needs to be trained in advance to form the network, and its accuracy is finally judged through a test set. The specific steps for forming a ResNet neural network are as follows:
[0011] (1) Obtain Charpy impact test specimen images in different states, including samples with notches, no notches, and different notch types and sizes. Label each specimen image to indicate its notch state and corresponding category. Adjust the specimen images to a uniform size (224x224 pixels) to meet the input requirements of ResNet. Scale the pixel values to the [0,1] range and use data augmentation techniques (such as rotation, translation, flipping, color adjustment, etc.) to expand the training set.
[0012] (2) Divide the expanded dataset into a training set (70%), a validation set (15%), and a test set (15%) to ensure that each set has enough samples and is representative.
[0013] (3) Based on the sample complexity and computing resources, select an appropriate ResNet version (ResNet-50, ResNet-101), construct a network containing multiple residual blocks, each residual block including a convolutional layer, batch normalization and ReLU activation function, and use the He initialization method to set initial values for the network weights;
[0014] (4) Input the training set samples into the selected ResNet version network, calculate the output, calculate the loss based on the output and the real label, calculate the gradient of the loss with respect to each parameter through the backpropagation algorithm, and update the weights using the optimization algorithm.
[0015] (5) Evaluate the model’s performance on the validation set, monitor the model’s accuracy and loss, avoid overfitting, and test the model with unseen datasets to evaluate the accuracy, recall and F1-score metrics. Adjust the model parameters according to the metrics to obtain a trained ResNet neural network.
[0016] (6) Deploy the trained ResNet neural network into practical applications and use the ResNet neural network to detect notches in Charpy impact specimens.
[0017] Preferably, the image recognition and calculation module is used to identify the sample notch photo taken by the autofocus high-definition camera, calculate whether the notch position in the photo is offset, and when offset occurs, the PLC control unit controls the cross-shaped electric slide rail to adjust the front, back, left and right positions of the sample placement stage in conjunction with the sliding end, thereby achieving the purpose of adjusting the position of the Charpy impact sample and achieving the effect of straightening the Charpy impact sample.
[0018] Preferably, the USB interface is connected to an external storage device for transferring data stored in the image storage module to the external storage device.
[0019] This invention also proposes a method for using a Charpy impact specimen notch inspector, comprising the following steps:
[0020] S1: Place the Charpy impact test specimen to be tested flat on the top of the specimen placement stage;
[0021] S2: Turn on the main unit by pressing the switch button, click the photo function on the touch screen, and control the automatic focusing high-definition camera through the PLC control unit to take a picture of the Charpy impact sample notch on the top of the sample placement platform.
[0022] S3: Store the Charpy impact test specimen photos taken in S2 in the image storage module. At the same time, the image data preprocessing module performs noise reduction filtering on the photos stored in the image storage module, and also performs brightness adjustment and contrast enhancement to improve image clarity.
[0023] S4: The image recognition and calculation module recognizes the photo processed in S3 and calculates the offset of the Charpy impact specimen notch in the photo using the offset calculation formula, thereby determining the offset of the Charpy impact specimen. When there is an offset, the PLC control unit controls the cross-shaped electric slide rail and the brake motor to drive the specimen placement platform to move forward, backward, left, right and rotate 360° according to the calculated offset. The specimen placement platform moves the Charpy impact specimen on its top to the set standard coordinate position.
[0024] S5: After the Charpy impact specimen is positioned and adjusted, select the standard model to be compared in the image processing module through the touch screen. The standard model is one of the national standard and ASTM standard V&U notch standard templates.
[0025] The image processing module compares the notch photographs of the Charpy impact specimens with the selected standard model based on a trained ResNet neural network. By calculating the similarity, it determines whether the notch is qualified and outputs the results on the touch screen, completing one work cycle of the Charpy impact specimen notch inspection.
[0026] Preferably, in step S4, when calculating the offset of the Charpy impact specimen notch in the photograph using the offset calculation formula, and determining the offset of the Charpy impact specimen, the specific steps are as follows:
[0027] S401: Extracts features from the processed photo using a trained ResNet neural network and identifies feature points in the image using an image processing algorithm. These feature points include the edges and midpoints of the notch.
[0028] S402: Calculate the coordinates of the current gap position based on the detected key points. Predefine the key position coordinates of the standard gap image, compare the measured coordinates with the coordinates of the standard gap, and obtain the offset. The formula for calculating the offset is: Offset = ;
[0029] Where x1 represents the coordinate value of the actual measured position of the notch extracted from the currently captured sample image by the image recognition calculation module on the horizontal axis (x-axis), y1 represents the coordinate value of the actual measured position of the notch extracted from the currently captured sample image by the image recognition calculation module on the vertical axis (y-axis), x2 represents the coordinate value of the preset standard notch position on the horizontal axis (x-axis), y2 represents the coordinate value of the preset standard notch position on the vertical axis (y-axis), and the offset represents the degree of deviation of the currently measured notch position from the standard position;
[0030] S403: Set a reasonable offset threshold as threshold = The absolute value of the calculated offset is compared with a threshold. If the position is positive, the sample is considered to be offset; otherwise, it is not offset.
[0031] Preferably, in step S6, the image processing module compares the notch photograph of the Charpy impact specimen with the selected standard model based on the trained ResNet neural network to determine whether the notch is qualified. The specific logical steps are as follows:
[0032] S601: Input the photo data processed by the image data preprocessing module into the trained ResNet neural network;
[0033] S602: The ResNet neural network extracts features from the missing photos in the input photo data of S601;
[0034] S603: By calculating similarity, the features extracted in S602 are compared with the features of the standard model, and the ResNet neural network outputs a conclusion on whether it is qualified or not.
[0035] Cosine similarity is used to calculate similarity, and its formula is: ;
[0036] Here, A and B are two feature vectors that need to be compared. It is their dot product. The output cosine similarity value is between -1 and 1, with the value closer to 1 indicating that the two vectors are more similar.
[0037] Compared with existing technologies, the beneficial effects of this invention are:
[0038] 1. By combining the image recognition calculation module and the automatic sample alignment mechanism, the offset of the placed Charpy impact sample can be identified and judged by offset calculation. When the Charpy impact sample is offset, it can be automatically aligned and adjusted to the standard coordinate position. This method does not require personnel to adjust the Charpy impact sample back and forth, thereby improving the detection efficiency.
[0039] 2. By combining the image data preprocessing module and the image processing module, the national standard and ASTM standard V&U notch standard templates can be stored in the image processing module at the same time. Based on the ResNet neural network, the notch photos of Charpy impact test specimens are directly compared with the corresponding standard models to determine the pass rate. This direct selection and comparison method can be applied to different notch detection needs, eliminating the need for personnel to frequently change standard notch templates, thus improving the applicability and reducing the number of operation steps.
[0040] This invention can automatically identify and adjust the position of the Charpy impact test specimen to be tested, eliminating the need for personnel to adjust the Charpy impact test specimen back and forth, thereby improving testing efficiency. Furthermore, during testing, it can directly compare the notch image of the Charpy impact test specimen with the corresponding standard model based on the ResNet neural network to determine the pass / fail status. This direct selection and comparison method can be applied to different notch testing needs, eliminating the need for personnel to frequently change the standard notch template, reducing operation steps, and further improving testing efficiency. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the structure of a Charpy impact specimen notch inspection instrument proposed in this invention;
[0042] Figure 2 This is a schematic diagram of the structure of the Charpy impact test specimen notch inspection instrument in the uninstalled state.
[0043] Figure 3 This is a block diagram showing the connection between the autofocus high-definition camera, the main unit, and the cross-shaped electric slide rail in a Charpy impact specimen notch inspection instrument proposed in this invention.
[0044] Figure 4 This is a schematic diagram of the Chinese standard V&U notch template for the use of a Charpy impact test specimen notch inspection instrument proposed in this invention;
[0045] Figure 5 This is a schematic diagram of the ASTM standard V&U notch template used in the method of using a Charpy impact test specimen notch inspection instrument proposed in this invention.
[0046] In the diagram: 1. Testing platform; 2. Support rod; 3. Main unit; 301. Touch screen; 302. Switch button; 303. USB interface; 4. Autofocus HD camera; 5. Sample placement platform; 6. Cross-shaped electric slide rail; 601. Sliding end; 7. Brake motor. Detailed Implementation
[0047] The present invention will be further explained below with reference to specific embodiments. Example
[0048] Reference Figure 1-5 This embodiment proposes a Charpy impact test specimen notch inspection instrument, including a test platform 1, on the top of which is an automatic specimen alignment mechanism.
[0049] The automatic sample alignment mechanism includes a sample placement platform 5 that is in contact with the top of the testing platform 1. The top of the testing platform 1 is provided with a mounting groove 101. A cross-shaped electric slide rail 6 is fixedly connected to the bottom inner wall of the mounting groove 101. A brake motor 7 is fixedly connected to the top of the sliding end 601 of the cross-shaped electric slide rail 6. The top of the output shaft of the brake motor 7 is fixedly connected to the bottom of the sample placement platform 5.
[0050] A support rod 2 is fixedly connected to the top rear side of the testing station 1, and a host 3 is fixedly connected to the front side of the support rod 2. A switch button 302 and a USB interface 303 are provided on the left side of the host 3. A touch screen 301 is provided on the top of the host 3. An autofocus high-definition camera 4 is fixedly installed at the bottom of the host 3.
[0051] The host 3 includes an image data preprocessing module, an image storage module, an image processing module, an image recognition calculation module, a PLC control unit, and a battery module. The image storage module is connected to the autofocus high-definition camera 4, the USB interface 303, and the image data preprocessing module. The image data preprocessing module is connected to the image processing module and the image recognition calculation module. The PLC control unit is connected to the image recognition calculation module and the autofocus high-definition camera 4. The image processing module is connected to the touch screen 301. The cross-shaped electric slide rail 6 and the brake motor 7 are both electrically connected to the PLC control unit.
[0052] The battery module powers the main unit 3, and the autofocus high-definition camera 4 is used to take pictures of the notch of the Charpy impact test specimen. The pictures are stored through the image storage module. The USB interface 303 is connected to an external storage device to transfer the data stored in the image storage module to the external storage device. The storage method facilitates the archiving of notch inspection data and the traceability of specimen processing, avoiding the disadvantage that existing notch projectors cannot store images.
[0053] The image data preprocessing module is used to perform noise reduction and filtering on the stored photos, as well as brightness adjustment and contrast enhancement to improve image clarity and prevent excessive errors due to hardware factors.
[0054] The image processing module stores national standard and ASTM standard V&U notch standard templates. The required standard model can be selected through the touch screen. The image processing module compares the notch photo taken by the autofocus high-definition camera 4 with the selected standard model based on the ResNet neural network to determine whether it is qualified or not.
[0055] The ResNet neural network needs to be trained in advance to form the network, and its accuracy is finally judged through a test set. The specific steps for forming a ResNet neural network are as follows:
[0056] (1) Obtain Charpy impact test specimen images in different states, including samples with notches, no notches, and different notch types and sizes. Label each specimen image to indicate its notch state and corresponding category. Adjust the specimen images to a uniform size (224x224 pixels) to meet the input requirements of ResNet. Scale the pixel values to the [0,1] range and use data augmentation techniques (such as rotation, translation, flipping, color adjustment, etc.) to expand the training set.
[0057] (2) Divide the expanded dataset into a training set (70%), a validation set (15%), and a test set (15%) to ensure that each set has enough samples and is representative.
[0058] (3) Based on the sample complexity and computing resources, select an appropriate ResNet version (ResNet-50, ResNet-101), construct a network containing multiple residual blocks, each residual block including a convolutional layer, batch normalization and ReLU activation function, and use the He initialization method to set initial values for the network weights;
[0059] (4) Input the training set samples into the selected ResNet version network, calculate the output, calculate the loss based on the output and the real label, calculate the gradient of the loss with respect to each parameter through the backpropagation algorithm, and update the weights using the optimization algorithm.
[0060] (5) Evaluate the model’s performance on the validation set, monitor the model’s accuracy and loss, avoid overfitting, and test the model with unseen datasets to evaluate the accuracy, recall and F1-score metrics. Adjust the model parameters according to the metrics to obtain a trained ResNet neural network.
[0061] (6) Deploy the trained ResNet neural network into practical applications and use the ResNet neural network to detect notches in Charpy impact specimens.
[0062] The image recognition and calculation module is used to identify the notch photos of the sample taken by the autofocus high-definition camera 4, and calculate whether the notch position in the photo is offset. When an offset occurs, the PLC control unit controls the cross-shaped electric slide rail 6 to adjust the front, back, left and right positions of the sample placement stage 5 in conjunction with the sliding end 601, thereby adjusting the position of the Charpy impact sample and achieving the effect of straightening the Charpy impact sample. This adjustment method avoids the disadvantages of the original notch projector, which requires manual back and forth adjustment of the sample position and manual focusing of the objective lens.
[0063] This embodiment also proposes a method for using a Charpy impact specimen notch inspector, including the following steps:
[0064] S1: Place the Charpy impact test specimen to be tested flat on the top of the specimen placement stage 5.
[0065] S2: Turn on the host 3 by switching button 302, click the photo function on the touch operation screen 301, and control the autofocus high-definition camera 4 through the PLC control unit to take a picture of the Charpy impact sample notch on the top of the sample placement stage 5.
[0066] S3: Store the Charpy impact test specimen photos taken in S2 in the image storage module. At the same time, the image data preprocessing module performs noise reduction filtering on the photos stored in the image storage module, and also performs brightness adjustment and contrast enhancement to improve image clarity.
[0067] S4: The image recognition and calculation module identifies the image processed in S3 and calculates the offset of the Charpy impact specimen notch in the image using the offset calculation formula, thereby determining the offset of the Charpy impact specimen. The specific steps are as follows:
[0068] S401: Extracts features from the processed photo using a trained ResNet neural network and identifies feature points in the image using an image processing algorithm. These feature points include the edges and midpoints of the notch.
[0069] S402: Calculate the coordinates of the current gap position based on the detected key points. Predefine the key position coordinates of the standard gap image, compare the measured coordinates with the coordinates of the standard gap, and obtain the offset. The formula for calculating the offset is: Offset = ;
[0070] Where x1 represents the coordinate value of the actual measured position of the notch extracted from the currently captured sample image by the image recognition calculation module on the horizontal axis (x-axis), y1 represents the coordinate value of the actual measured position of the notch extracted from the currently captured sample image by the image recognition calculation module on the vertical axis (y-axis), x2 represents the coordinate value of the preset standard notch position on the horizontal axis (x-axis), y2 represents the coordinate value of the preset standard notch position on the vertical axis (y-axis), and {offset} represents the degree of offset of the currently measured notch position relative to the standard position;
[0071] Set a reasonable offset threshold as threshold = The absolute value of the calculated offset is compared with the threshold. If the position is positive, the sample is considered to be offset; otherwise, it is not offset.
[0072] For example: Set the standard position as (x2, y2) = (100, 150);
[0073] The position measured from the captured image is (x1, y1) = (105, 148);
[0074] Offset = (105-100, 148-150) = (5, -2), indicating that the current measurement position is offset by 5 units on the x-axis and -2 units on the y-axis relative to the standard position. The absolute value of the offset is... If the threshold is set to 6, If the image is not offset, it means that the captured image is not shifted.
[0075] When there is a deviation, the cross-shaped electric slide rail 6 and the brake motor 7 are controlled by the PLC control unit to drive the sample placement platform 5 to move forward, backward, left and right and rotate 360° according to the calculated deviation. The sample placement platform 5 drives the Charpy impact sample on its top to move to the set standard coordinate position.
[0076] S5: After the Charpy impact test specimen is positioned and adjusted, select the standard model to be compared in the image processing module through the touch operation screen 301. The standard model is one of the national standard and ASTM standard V&U notch standard templates.
[0077] S6: The image processing module compares the notch photograph of the Charpy impact specimen with the selected standard model based on the trained ResNet neural network. By calculating the similarity, it determines whether the notch is qualified and outputs the result on the touch screen 301, completing one work cycle of the Charpy impact specimen notch inspection.
[0078] In S6 of this embodiment, the image processing module compares the notch photograph of the Charpy impact specimen with the selected standard model based on the trained ResNet neural network to determine whether the notch is qualified. The specific logical steps are as follows:
[0079] S601: Input the photo data processed by the image data preprocessing module into the trained ResNet neural network;
[0080] S602: The ResNet neural network extracts features from the missing photos in the input photo data of S601;
[0081] S603: By calculating similarity, the features extracted in S602 are compared with the features of the standard model, and the ResNet neural network outputs a conclusion on whether it is qualified or not.
[0082] Cosine similarity is used to calculate similarity, and its formula is: ;
[0083] Here, A and B are two feature vectors that need to be compared. It is their dot product. The output cosine similarity value is between -1 and 1, with the value closer to 1 indicating that the two vectors are more similar.
[0084] For example, the feature A of the notched photo is [0.1, 0.5, 0.3, 0.7, 0.2], and the feature B of the standard model is [0.2, 0.4, 0.3, 0.6, 0.1].
[0085] The product of the cosine similarity formula is calculated as follows: A⋅B=(0.1×0.2)+(0.5×0.4)+(0.3×0.3)+(0.7×0.6)+(0.2×0.1)=0.02+0.20+0.09+0.42+0.02=0.75;
[0086] Calculate the computational norm and : = ; = = ;
[0087] Calculate cosine similarity: ;
[0088] The calculation result is 0.995. Since it is close to 1, it means that the photo with the notch in the photo data is very similar to the standard model, so the output result is qualified.
[0089] This embodiment can automatically identify and adjust the position of the Charpy impact test specimen to be tested, eliminating the need for personnel to adjust the Charpy impact test specimen back and forth, thereby improving testing efficiency. Furthermore, during testing, it can directly compare the notch image of the Charpy impact test specimen with the corresponding standard model based on the ResNet neural network to determine the pass / fail status. This direct selection and comparison method can be applied to different notch testing needs, eliminating the need for personnel to frequently change the standard notch template, reducing operation steps, and further improving testing efficiency.
[0090] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A Charpy impact specimen notch inspection apparatus comprising an inspection table (1), characterized in that, The top of the detection platform (1) is provided with a sample automatic alignment mechanism, the rear side of the top of the detection platform (1) is fixedly connected with a supporting rod (2), the front side of the supporting rod (2) is fixedly connected with a main machine (3), the left side of the main machine (3) is provided with a switch button (302) and a USB interface (303), the top of the main machine (3) is provided with a touch operation screen (301), and the bottom of the main machine (3) is fixedly provided with an automatic focusing high-definition camera (4); The main machine (3) comprises an image data preprocessing module, an image storage module, an image processing module, an image recognition calculation module, a PLC control unit and a battery module, the image storage module is connected with the automatic focusing high-definition camera (4), the USB interface (303) and the image data preprocessing module, the image data preprocessing module is connected with the image processing module and the image recognition calculation module, the PLC control unit is connected with the image recognition calculation module and the automatic focusing high-definition camera (4), and the image processing module is connected with the touch operation screen (301); The image processing module stores national standard and ASTM standard V&U notch standard templates, the required standard model can be selected through the touch operation screen, the image processing module compares the notch photo shot by the automatic focusing high-definition camera (4) with the selected standard model based on a ResNet neural network, and a conclusion of whether qualified or not is drawn; The ResNet neural network needs to be trained in advance to form a network, and finally the accuracy is judged through a test set, and the specific steps of forming the ResNet neural network are as follows: (1) obtain Charpy impact sample images in different states, including samples with and without notches, different notch types and sizes, label each sample image, mark the notch state and corresponding category, and adjust the sample image to a uniform size to meet the input requirements of ResNet, scale the pixel value to the [0, 1] interval, and use data enhancement technology to expand the training set; (2) divide the expanded data set into a training set, a validation set and a test set, wherein the training set accounts for 70%, the validation set accounts for 15% and the test set accounts for 15%, and ensure that the samples in each set are sufficient and representative; (3) according to the sample complexity and calculation resources, select an appropriate ResNet version, build a network containing multiple residual blocks, each residual block includes a convolution layer, a batch normalization and a ReLU activation function, and use He initialization method to set the initial value of the network weight; (4) input the training set sample into the selected ResNet version network, calculate the output, calculate the loss according to the output result and the real label, calculate the gradient of each parameter through the back propagation algorithm, and update the weight using the optimization algorithm; (5) evaluate the performance of the model on the validation set, monitor the accuracy and loss of the model, avoid overfitting, and test the model using an unseen data set to evaluate the accuracy, recall rate, F1-score and other indicators, adjust the model parameters according to the indicators, and thus obtain the trained ResNet neural network; (6), the trained ResNet neural network is deployed to practical application, and the notch of Charpy impact specimen is detected by using the ResNet neural network.
2. A Charpy impact specimen notch inspection apparatus according to claim 1, wherein The specimen automatic alignment mechanism comprises a specimen placing table (5) in active contact with the top of the detection table (1), the top of the detection table (1) is provided with a mounting groove (101), the inner wall of the bottom of the mounting groove (101) is fixedly connected with a cross-shaped electric sliding rail (6), the top of the sliding end (601) of the cross-shaped electric sliding rail (6) is fixedly connected with a brake motor (7), the top end of the output shaft of the brake motor (7) is fixedly connected with the bottom of the specimen placing table (5), and the cross-shaped electric sliding rail (6) and the brake motor (7) are electrically connected with the PLC control unit.
3. A Charpy impact specimen notch inspection apparatus according to claim 1, wherein The battery module supplies power for the host (3), the automatic focusing high-definition camera (4) is used for photographing the notch of the Charpy impact specimen, the photographed photos are stored through the image storage module, and the image data preprocessing module is used for data preprocessing of noise reduction filtering of the stored photos, and brightness adjustment and contrast enhancement are also performed, so that the picture definition is improved.
4. A Charpy impact specimen notch inspection apparatus according to claim 2, wherein The image recognition calculation module is used for identifying the specimen notch photos taken by the automatic focusing high-definition camera (4), calculating whether the notch position in the photo is offset, and when the offset occurs, the cross-shaped electric sliding rail (6) is controlled through the PLC control unit to cooperate with the sliding end (601) to adjust the front, back, left and right positions of the specimen placing table (5).
5. A Charpy impact specimen notch inspection apparatus according to claim 1, wherein The USB interface (303) is connected with an external storage, and is used for transmitting the data stored in the image storage module to the external storage.
6. A method of using a notched checker impact specimen checker according to claim 1, characterized in that, The method comprises the following steps: S1: placing the Charpy impact specimen to be detected on the top of the specimen placing table (5); S2: starting the host (3) through the switch button (302), clicking the photographing function on the touch operation screen (301), and starting the automatic focusing high-definition camera (4) to photograph the notch of the Charpy impact specimen on the top of the specimen placing table (5) through the PLC control unit; S3: storing the Charpy impact specimen photos taken in S2 in the image storage module, and performing data preprocessing of noise reduction filtering of the photos stored in the image storage module through the image data preprocessing module, and also performing brightness adjustment and contrast enhancement to improve the picture definition; S4: the image recognition calculation module identifies the processed photos in S3, calculates the offset of the notch of the Charpy impact specimen in the photo through an offset calculation formula, so as to judge the offset of the Charpy impact specimen, when the offset exists, the cross-shaped electric sliding rail (6) and the brake motor (7) are controlled to drive the specimen placing table (5) to move in front, back, left and right positions and rotate 360° through the PLC control unit according to the calculated offset, and the Charpy impact specimen on the top of the specimen placing table (5) is moved to the set standard coordinate position; S5: after the position of the Charpy impact specimen is adjusted, a standard model to be compared is selected in the image processing module through the touch operation screen (301), and the standard model is one of the national standard and the ASTM standard V&U notch standard template. S6: The image processing module compares the notch photo of the Charpy impact sample with the selected standard model based on the trained ResNet neural network, judges whether the notch is qualified or not by calculating the similarity, and outputs the result on the touch operation screen (301), completing a working cycle of the Charpy impact sample notch inspection.
7. A method of using a Charpy impact specimen notch inspection gauge according to claim 6, wherein, In the S4, the offset of the notch of the Charpy impact sample in the photo is calculated by the offset calculation formula, and the offset of the Charpy impact sample is judged. The specific steps are as follows: S401: The features of the image in the processed photo are extracted by the trained ResNet neural network, and the feature points in the image are recognized by the image processing algorithm, including the edges and midpoints of the notch; S402: The coordinates of the current notch position are calculated by the detected key points, and the key position coordinates of the standard notch image are defined in advance. The measured coordinates are compared with the coordinates of the standard notch to obtain the offset, and the formula for calculating the offset is: ; wherein represents a coordinate value on the horizontal axis (x-axis) of the actual measurement position of the notch extracted from the currently photographed sample image by the image recognition calculation module, represents a coordinate value on the vertical axis (y-axis) of the actual measurement position of the notch extracted from the currently photographed sample image by the image recognition calculation module, represents a coordinate value on the horizontal axis (x-axis) of the preset standard notch position, represents a coordinate value on the vertical axis (y-axis) of the preset standard notch position, and the offset represents the degree of offset of the currently measured notch position with respect to the standard position; S403: Set a reasonable offset threshold as threshold value The absolute value of the calculated offset is compared with the threshold value, If yes, the sample position is determined to be offset, otherwise, it is determined to be not offset.
8. The method of using a Charpy impact specimen notch inspection gauge of claim 6, wherein, In the S6, the image processing module compares the notch photo of the Charpy impact sample with the selected standard model based on the trained ResNet neural network, judges whether the notch is qualified or not, and the specific logic steps are as follows: S601: The photo data processed by the image data preprocessing module is input into the trained ResNet neural network; S602: The ResNet neural network extracts features from the notch photo in the photo data input in S601; S603: The features extracted in S602 are compared with the features of the standard model by calculating the similarity, and the conclusion of whether it is qualified or not is output by the ResNet neural network; The cosine similarity is used to calculate the similarity, and the formula is: ; where A and B are two feature vectors to be compared, is their dot product, is the norm of a vector, the value of the cosine similarity output is between -1 and 1, the closer to 1 indicates that the two vectors are more similar.
Citation Information
Patent Citations
Defect detection system and method utilizing template comparison based on twin neural network
CN111179251A
Product quality testing device based on image processing
CN202453297U