A method for detecting inner surface defects of water heater tank
By improving the YOLOv8 model, combined with the improved MobileNet v3 network and dynamic convolutional decomposition layer, a water heater inner liner defect detection system was built, solving the problems of low detection accuracy, low efficiency and high cost in the existing technology, and achieving high-precision and high efficiency defect detection.
Patent Information
- Application Number
- CN202411097377.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-03-13
AI Technical Summary
The prior art is used to detect the inner surface defects of the water heater in the water heater, which are low in accuracy, low efficiency and high cost.
The water heater inner liner defect detection system based on the improved YOLOv8 is adopted, which includes a positioning module, an image detection module and a data analysis module. Through the improved MobileNet v3 network and dynamic convolutional decomposition (DCD) layer, an improved YOLOv8 model is built to detect defects in the water heater inner liner.
It improves the accuracy and efficiency of detecting defects in the inner surface of the water heater, reduces the detection cost, and can observe subtle defects, reducing visual fatigue from manual detection.
Smart Images

Figure CN119006415B_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202410281727.5, the application date is March 13, 2024, and the name of the invention is "Water heater tank defect detection system and method based on improved YOLOv8". Technical Field
[0002] The invention relates to the technical field of image recognition and mechanical control, and in particular to a method for detecting inner surface defects of a water heater tank. Background Art
[0003] The inner tank of a water heater is the most important component of a water heater. At present, the materials of the inner tanks of water heaters on the market include copper tank, stainless steel tank, titanium tank, crystalline silicon tank and enamel tank, each of which has different characteristics and advantages. Most inner tanks of water heaters have the characteristics of high strength, high temperature resistance and corrosion resistance, which can effectively ensure the long-term use of the water heater. The inspection of the finished inner tank of a water heater has always been an important link in the product production process. However, due to the particularity of the inner tank structure, that is, the inlet diameter of the inner tank of the water heater is small, generally about 90mm in diameter, and most of the defects of the inner tank of the water heater are on the inner surface of the inner tank. The traditional manual detection method is to place a handheld external light source into the inner tank, and use the naked eye to observe whether there are scars, porcelain explosions, pinholes and leaks inside the inner tank of the water heater. Due to the poor internal light and the difficulty in observing subtle defects, it is also very easy to produce visual fatigue, which affects the detection accuracy. The market urgently needs a water heater inner tank internal defect detection device with high detection accuracy and efficiency.
[0004] Therefore, it is an urgent problem for technical personnel in this field to propose a water heater tank defect detection system and method based on improved YOLOv8 to solve the problems of low detection accuracy, low efficiency and high cost in the prior art. Summary of the invention
[0005] In view of this, the present invention provides a method for detecting inner surface defects of a water heater tank, which can achieve the effect of improving detection accuracy.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A water heater tank defect detection system based on improved YOLOv8, including a positioning module, an image detection module and a data analysis module connected in sequence;
[0008] Positioning module, used to clamp or release the water heater tank;
[0009] An image detection module, comprising an image acquisition unit and an image recognition unit connected in sequence, wherein the image acquisition unit is used to acquire a video of the inner tank of the water heater, and the image recognition unit is used to detect defects based on the video of the inner tank of the water heater;
[0010] The data analysis module is used to record the information of each water heater tank and to count the proportion of the number of defective water heater tanks to the total number of water heater tanks.
[0011] In the above system, optionally, the image acquisition unit includes a bracket, a linear translation module, an aluminum profile beam, and an image acquisition module;
[0012] The inner side of the upper end of the bracket is horizontally connected to the linear translation module, the aluminum profile crossbeam is vertically connected to the bottom end of the linear translation module, and the image acquisition module is connected to the aluminum profile crossbeam.
[0013] The water heater tank defect detection method based on improved YOLOv8 is applied to any of the above-mentioned water heater tank defect detection systems based on improved YOLOv8, comprising the following steps:
[0014] Steps to obtain data: obtain the video inside the water heater tank;
[0015] Data preprocessing steps: read each frame of the video and perform data enhancement, and divide it into training set and test set according to a certain ratio;
[0016] Model construction steps: Use the improved MobileNet v3 network to replace the backbone network in the YOLOv8 model to build an improved YOLOv8 model;
[0017] Model training step: Input the training set of the data preprocessing step into the improved YOLOv8 model, perform error analysis based on the output predicted value and actual value through the loss function, and adjust the weight values of the improved YOLOv8 model;
[0018] Training end judgment step: determine whether the number of iterations reaches the preset threshold. If not, return to the model training step; if yes, end the model training step and output the trained improved YOLOv8 model to the water heater tank defect detection step;
[0019] Water heater tank defect detection step: Input the test set in the data preprocessing step into the trained improved YOLOv8 model to detect the water heater tank defects and obtain the detection results.
[0020] The above method may optionally include screening defective images and performing data enhancement on the defective images in the data preprocessing step.
[0021] In the above method, optionally, in the model construction step, the improved MobileNet v3 network includes a conv_bn_hswish module, a MobileNet v3 bottleneck module and an improved MobileNetv3 bottleneck module.
[0022] In the above method, optionally, the conv_bn_hswish module includes: replacing the ReLU activation function in the first Conv2d layer of the original MobileNetv3 network with the h-swish function;
[0023] The improved MobileNet v3 bottleneck module includes: using the dynamic convolution decomposition DCD layer to replace the Conv2d layer in the original MobileNet v3 module.
[0024] In the above method, optionally, the first layer of the backbone network in the YOLOv8 model uses the conv_bn_hswish module, the second, third, and fourth layers use the original MobileNet v3 module, and the 5-11 layers use the improved MobileNetv3 module.
[0025] It can be seen from the above technical solution that compared with the prior art, the present invention provides a method for detecting inner surface defects of a water heater tank, which has the following beneficial effects: 1) The present invention introduces dynamic convolution into YOLOv8 for image recognition to prevent visual fatigue caused by manual detection, reduce costs, and improve detection efficiency; 2) The present invention can observe subtle defects and improve monitoring accuracy; 3) The present invention is a non-contact detection method, which improves detection accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0027] Figure 1 It is a structural block diagram of the water heater tank defect detection system based on improved YOLOv8 disclosed in the present invention;
[0028] Figure 2 This is the general assembly diagram of the water heater tank defect detection system disclosed in this embodiment;
[0029] Figure 3 This is a structural diagram of the image acquisition module disclosed in this embodiment;
[0030] Figure 4 It is a flow chart of the water heater tank defect detection method based on improved YOLOv8 disclosed in the present invention;
[0031] Figure 5 The improved YOLOv8 model diagram disclosed in the present invention;
[0032] Among them, 1- bracket, 2- linear translation module, 3- aluminum profile beam, 4- image acquisition module; 41- control motor, 42- industrial endoscope. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0035] Reference Figure 1 As shown, the present invention discloses a water heater tank defect detection system based on improved YOLOv8, including a positioning module, an image detection module and a data analysis module connected in sequence;
[0036] Positioning module, used to clamp or release the water heater tank;
[0037] An image detection module, comprising an image acquisition unit and an image recognition unit connected in sequence, wherein the image acquisition unit is used to acquire a video of the inner tank of the water heater, and the image recognition unit is used to detect defects based on the video of the inner tank of the water heater;
[0038] The data analysis module is used to record the information of each water heater tank and to count the proportion of the number of defective water heater tanks to the total number of water heater tanks.
[0039] Specifically, the positioning module structure is a three-jaw chuck. The clamping mechanism is used to fix the inner tank of the water heater after firing and cooling, so that it remains vertical. It is located at the bottom of the entire detection device. At the initial moment, the claws of the three-jaw chuck are opened, and the inner tank is placed vertically on the chuck. The chuck clamping shaft is rotated to clamp the inner tank of the water heater. The contact surface between the claw and the inner tank is made of rubber.
[0040] Further, see Figure 2 As shown, the image acquisition unit includes a bracket 1, a linear translation module 2, an aluminum profile beam 3, and an image acquisition module 4;
[0041] The inner side of the upper end of the bracket 1 is horizontally connected to the linear translation module 2 , the aluminum profile crossbeam 3 is vertically connected to the bottom end of the linear translation module 2 , and the image acquisition module 4 is connected to the aluminum profile crossbeam 3 .
[0042] Specifically, refer to Figure 3 As shown, the image acquisition module 4 is composed of three industrial endoscopes 42, each of which includes a lens, an LED light source, a guide joint, a traction wire, a data optical fiber, a control motor 41, and a power cord; any two endoscopes of the industrial endoscope 42 form an angle of 120°, and the initial position forms an angle of 120° with the vertical direction. The angle between the first rotation position and the vertical direction is 90°, and the angle between the position after the second rotation and the vertical direction is 60°; the endoscope lens is connected to the four traction wires, and the traction wires are connected to the control motor 41. Each control motor 41 controls two traction wires, and the two control motors 41 control the left and right and up and down directions respectively.
[0043] The linear translation module 2 is connected to the aluminum profile cross beam 3 through a connector, and the aluminum profile cross beam 3 is fixedly connected to the image acquisition module 4. The linear translation module 2 drives the aluminum profile cross beam 3 and the image acquisition module 4 to move up and down.
[0044] The clamping mechanism includes a three-jaw chuck and a rubber claw. The rubber claw is fixed to the three-jaw chuck by bolts. The movement of the three-jaw chuck drives the rubber claw to move. The rubber contact surface of the rubber claw contacts the side wall of the inner tank, fixing the water heater inner tank on the three-jaw chuck. The bottom end of the water heater inner tank contacts the rubber pad on the three-jaw chuck.
[0045] and Figure 1 Corresponding to the system, the present invention also discloses a water heater tank defect detection method based on improved YOLOv8, which is applied to the water heater tank defect detection system based on improved YOLOv8, such as Figure 4 As shown, the following steps are included:
[0046] Steps to obtain data: obtain the video inside the water heater tank;
[0047] Data preprocessing steps: read each frame of the video and perform data enhancement, and divide it into training set and test set according to a certain ratio;
[0048] Model construction steps: Use the improved MobileNet v3 network to replace the backbone network in the YOLOv8 model to build an improved YOLOv8 model;
[0049] Model training step: Input the training set of the data preprocessing step into the improved YOLOv8 model, perform error analysis based on the output predicted value and actual value through the loss function, and adjust the weight values of the improved YOLOv8 model;
[0050] Training end judgment step: determine whether the number of iterations reaches the preset threshold. If not, return to the model training step; if yes, end the model training step and output the trained improved YOLOv8 model to the water heater tank defect detection step;
[0051] Water heater tank defect detection step: Input the test set in the data preprocessing step into the trained improved YOLOv8 model to detect the water heater tank defects and obtain the detection results.
[0052] Specifically, an image acquisition device is used to capture video of the inner tank of the water heater.
[0053] Furthermore, the data preprocessing step includes screening defective images and performing data enhancement on the defective images.
[0054] Specifically, data preprocessing includes the following steps:
[0055] S1: Segment the video into images and perform screening;
[0056] S2: Data enhancement is performed on the four defect images of scar, porcelain burst, pinhole and leak through flipping, cropping, color temperature and noise physical transformation to obtain a data set consisting of 2000 images to be tested;
[0057] S3: Divide the enhanced images into training and test sets in a ratio of 8:2.
[0058] Furthermore, in the model construction step, the improved MobileNet v3 network includes a conv_bn_hswish (convolutional layer) module, a MobileNet v3 bottleneck module, and an improved MobileNet v3 bottleneck module.
[0059] Furthermore, the conv_bn_hswish module includes: replacing the ReLU activation function in the first Conv2d layer of the original MobileNet v3 network with the h-swish function;
[0060] The improved MobileNet v3 bottleneck module includes: using the dynamic convolution decomposition DCD layer to replace the Conv2d layer in the original MobileNet v3 module.
[0061] Further, see Figure 5As shown in the figure, the first layer of the backbone network in the YOLOv8 model uses the conv_bn_hswish module, the second, third, and fourth layers use the original MobileNet v3 module, and the 5-11 layers use the improved MobileNetv3 module.
[0062] Specifically, the neck network upsamples the image obtained in the 11th layer in the first upsampling module, and the first upsampling result and the image of the 8th layer of the backbone network enter the first fully connected layer for analysis and positioning, and the information of the first fully connected layer enters the first c2f layer (compound convolutional layer) to obtain the feature image obtained by the first fully connected layer; the second upsampling module deletes and modifies the feature image obtained by the first fully connected layer, and the second upsampled image and the image obtained by the third layer of the backbone network enter the second fully connected layer for analysis and positioning, and the second fully connected layer information is obtained; the second fully connected layer information ... The second c2f layer obtains the feature image obtained by the second fully connected layer, enters the first convolutional layer to extract the first convolutional image, and inputs the first convolutional image and the feature image obtained by the first c2f layer into the third fully connected layer for analysis and positioning. The information obtained in the third fully connected layer enters the third c2f layer to obtain the feature image obtained by the third fully connected layer; the feature image obtained by the third fully connected layer enters the second convolutional layer to extract the second convolutional image, and the second convolutional image and the image obtained by the 11th layer of the backbone network are sent to the fourth fully connected layer. The information obtained in the fourth fully connected layer enters the fourth c2f layer to obtain the feature image obtained by the fourth fully connected layer.
[0063] In the Head network, the feature image obtained by the second fully connected layer output by the second c2f layer is used as the first output image, the feature image obtained by the third fully connected layer output by the third c2f layer is used as the first output image, and the feature image obtained by the fourth fully connected layer output by the fourth c2f layer is used as the first output image.
[0064] During the model training process, the number of iterations was 300, the minimum batch was 16, the initial learning rate was 0.01, and the initial weights were yolov8x.pt.
[0065] In a specific embodiment,
[0066] When the inner tank of the water heater is clamped on the clamping device, the inner tank is located at the bottom of the image acquisition module 4, that is, the industrial camera lens maintains a certain distance. After the inner tank is clamped stably, the linear translation module 2 drives the aluminum profile beam 3 and the image acquisition module 4 to move downward and move to the bottom of the linear translation module 2. Under the control of the control motor 41, the acute angle between the endoscope lens and the vertical direction is 60°. After that, image acquisition is performed, and the control motor 41 drives the endoscope lens to bend 60° to capture the image of the neck of the inner tank. After completing the image acquisition, the industrial endoscope 42 returns to the initial position, and the linear translation module 2 drives the aluminum profile beam 3 and the image acquisition module 4 to move upward. After the endoscope lens is completely moved out of the inner tank, the clamping device releases the inner tank of the water heater, and the image acquisition process is completed.
[0067] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0068] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting inner surface defects of a water heater tank, characterized in that: The following steps are involved: Steps to obtain data: obtain the video inside the water heater tank; Data preprocessing steps: read each frame of the video and perform data enhancement, and divide it into training set and test set according to a certain ratio; Model construction steps: Use the improved MobileNet v3 network to replace the backbone network in the YOLOv8 model to build an improved YOLOv8 model; Model training step: Input the training set of the data preprocessing step into the improved YOLOv8 model, perform error analysis based on the output predicted value and actual value through the loss function, and adjust the weight values of the improved YOLOv8 model; Training end judgment step: determine whether the number of iterations reaches the preset threshold. If not, return to the model training step; if yes, end the model training step and output the trained improved YOLOv8 model to the water heater tank defect detection step; Water heater tank defect detection step: input the test set in the data preprocessing step into the trained improved YOLOv8 model to detect the water heater tank defects and obtain the detection results; In the YOLOv8 model, the first layer of the backbone network uses the conv_bn_hswish module, the second, third, and fourth layers use the original MobileNet v3 module, and the 5-11 layers use the improved MobileNet v3 module; The neck network upsamples the image obtained in the 11th layer in the first upsampling module, and the first upsampling result and the image of the 8th layer of the backbone network enter the first fully connected layer for analysis and positioning, and the information of the first fully connected layer enters the first composite convolution layer to obtain the feature image obtained by the first fully connected layer; the second upsampling module deletes and modifies the feature image obtained by the first fully connected layer, and the second upsampled image and the image obtained by the third layer of the backbone network enter the second fully connected layer for analysis and positioning, and the second fully connected layer information is obtained; the second fully connected layer information enters the second composite convolution layer to obtain the feature image obtained by the second fully connected layer, enters the first convolution layer to extract the first convolution image, and the first convolution image and the feature image obtained by the first composite convolution layer are input into the third fully connected layer for analysis and positioning, and the third fully connected layer information is obtained. Enter the third composite convolution layer to obtain the feature image obtained by the third fully connected layer; the feature image obtained by the third fully connected layer enters the second convolution layer to extract the second convolution image, and the second convolution image and the image obtained by the 11th layer of the backbone network are sent to the fourth fully connected layer, and the fourth fully connected layer information is obtained. Enter the fourth composite convolution layer to obtain the feature image obtained by the fourth fully connected layer; In the head network, the feature image obtained by the second fully connected layer output by the second composite convolutional layer is used as the first output image, the feature image obtained by the third fully connected layer output by the third composite convolutional layer is used as the first output image, and the feature image obtained by the fourth fully connected layer output by the fourth composite convolutional layer is used as the first output image; In the model construction step, the improved MobileNet v3 network includes the conv_bn_hswish module, the MobileNetv3 bottleneck module, and the improved MobileNet v3 bottleneck module; The conv_bn_hswish module includes: using the h-swish function to replace the ReLU activation function in the first layer Conv2d layer of the original MobileNet v3 network; The improved MobileNet v3 bottleneck module includes: using the dynamic convolution decomposition DCD layer to replace the Conv2d layer in the original MobileNet v3 module.
2. A method for detecting inner surface defects of a water heater tank according to claim 1, characterized in that: In the data preprocessing step, the video is segmented into images and screened; the screened defective images are enhanced by flipping, cropping, color temperature, and noise physical transformation to obtain a data set consisting of images to be detected.
3. A method for detecting inner surface defects of a water heater tank according to claim 1, characterized in that: In the data acquisition step, the video inside the water heater tank is acquired through the image acquisition unit; Among them, the image acquisition unit includes a bracket, a linear translation module, an aluminum profile beam, and an image acquisition module; The inner side of the upper end of the bracket is horizontally connected to the linear translation module, the aluminum profile beam is vertically connected to the bottom end of the linear translation module, the image acquisition module is connected to the aluminum profile beam, and the linear translation module drives the aluminum profile beam and the image acquisition module to move up and down.
4. A method for detecting inner surface defects of a water heater tank according to claim 3, characterized in that: The image acquisition module is composed of three industrial endoscopes, each of which includes a lens, an LED light source, a guide joint, a traction wire, a data optical fiber, a control motor, and a power cord; any two endoscopes of the industrial endoscope form an angle of 120° between each other, and the initial position forms an angle of 120° with the vertical direction; The endoscope lens is connected to four traction wires, the traction wires are connected to control motors, each control motor controls two traction wires, and the two control motors control the left and right and up and down directions respectively.
5. A method for detecting inner surface defects of a water heater tank according to claim 1, characterized in that: In the data acquisition step, the inner tank of the water heater is clamped or released by a clamping mechanism; Among them, the clamping mechanism includes a three-jaw chuck and a rubber claw. The rubber claw is fixed to the three-jaw chuck by bolts. The movement of the three-jaw chuck drives the rubber claw to move. The rubber contact surface of the rubber claw contacts the side wall of the inner tank, fixing the water heater inner tank on the three-jaw chuck, and the bottom end of the water heater inner tank contacts the rubber pad on the three-jaw chuck.
Citation Information
Patent Citations
Vision and ultrasound-based weld defect detection system and detection method
CN115774014A
Strawberry maturity detection method and system based on improved YOLOv8
CN117315473A